LEX–YACC LabCSL411 Compiler Lab · tokens → grammar → a working program

0 · The question

1 · Tokens: what LEX reads and what it passes on

One row per kind of lexeme, in order: on a tie LEX picks the earlier row, otherwise the longest match wins. In a LEX+YACC program each useful row ends with return NAME; — that NAME is the token YACC sees.

Definitions (optional, e.g. digit [0-9], used as {digit})
#Pattern (regular expression)Action (C code)
Quick add: