I have pages that have similar examples for the following other languages:
To build the above examples, use flex and gcc.
slurpy -> slimp slump slimp -> A rest_slimp rest_slimp -> H rest_slimp -> B slimp C rest_slimp -> slump C slump -> d_or_e F f_string end d_or_e -> D d_or_e -> E f_string -> F f_string | lambda end -> slump end -> G Some strings in the language: AHDFG, ADFGCDFFFFFG, ABAEFGCCDFEFFFFFFG Some strings NOT in the lanuage: AHDFGA, DFGAH, ABABCC
slurpy_file: slurpy_file slurpy EOLN | slurpy EOLN ;
seq -> seq instr seq -> BEGIN instr -> EAST instr -> WEST instr -> NORTH instr -> SOUTHThis simple example demonstrates the use of structs in unions.