Chapter 14. Attributes

Attributes provide metadata that can be used to interpret the language feature they modify.

AttributeSections:
  AttributeSection
  AttributeSections AttributeSection
AttributeSection:
  @{  Nodes  }

Case Sensitive

The CaseSensitive attribute controls whether tokens are matched with or without case sensitivity. The default value is true. The following language recognizes "Hello World", "HELLO World", and "hELLO WorLD".

module HelloWorld {
    @{CaseSensitive[false]}
    language HelloWorld {
        syntax Main
          = Hello World;
        token Hello
          = "Hello";
        token World
          = "World";
        interleave Whitespace
          = " ";
    }
}

 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.137.12