Lexical Analysis ---------------- Comments are enclosed in /* and */ and may span several lines. Comments do not nest. Blanks, tabs, returns, newlines, and comments are skipped during lexical analysis. Identifiers (terminals as well as nonterminals) must begin with a letter, and consist of letters and digits. The underscore counts as a letter. Program fragments are enclosed in %{ and %}. They do not nest. Furthermore, they are immediately copied to the generated parser during lexical analysis of the specification (so that there is no danger of overflowing the generator's matching buffer). For the tokens and attributes returned by the scanner of the parser generator see the following table: Lexeme Token Attribute blank - - tab - - return - - newline - - /* comment */ - - EOF E_O_F - %% SDEL - %{ program text %} PROG - %token TOKEN - %start START - %empty EMPTY - letter, followed by letters or digits IDENT pointer to name : COLON - ; SEMIC - | BAR - Syntax of the Specification Language (LR Parsing) ------------------------------------------------- specification : definitions SDEL rules E_O_F | definitions SDEL rules SDEL utilities E_O_F ; utilities : /* epsilon */ | utilities PROG ; definitions : /* epsilon */ | definitions definition ; definition : TOKEN tokenlist | START IDENT | PROG ; tokenlist : IDENT | tokenlist IDENT ; rules : /* epsilon */ | rules rule ; rule : IDENT COLON alternatives SEMIC ; alternatives : alternative | alternatives BAR alternative ; alternative : EMPTY | EMPTY PROG | sequence | sequence PROG ; sequence : IDENT | sequence IDENT ;