>#CE5A6A> Example 4

>#6D6DD0> Assignment statement language tokens in LEX

Here, a Delimiter is defined to be a space or a tab or a newline character. WhiteSpace is defined as one or more delimiter. No use-written procedures are shown. There are other ways to find these same tokens using LEX.

When the lexical analyzer is used along with a parser, each lex action should end with a return statement of the form:

return token;

or

return(token);

E.g., we will add return (Id) after the first line in the Translation Rules to return the class Id to the parser generated by YACC.

Send questions and comment to: Karen Lemone