lex and yacc program information

For a program to receive input, either interactively or in a batch environment, you must provide another program or a routine to receive the input. Complicated input requires additional code to break the input into pieces that mean something to the program.

You can use the lex and yacc commands to develop this type of input program.

The lex command generates a lexical analyzer program that analyzes input and breaks it into tokens, such as numbers, letters, or operators. The tokens are defined by grammar rules set up in the lex specification file. The yacc command generates a parser program that analyzes input using the tokens identified by the lexical analyzer (generated by the lex command and stored in the lex specification file) and performs specified actions, such as flagging improper syntax. Together these commands generate a lexical analyzer and parser program for interpreting input and output handling.