Translation Section[slide by John Werth.]
The {ws} rule causes the lexical analyzer to skip all delimiters until the next non-delimiter.
The if rule recognizes the string 'if'. When it is found the lexical analyzer returns the token IF, a manifest constant.
The {id} rule must do three jobs:
The first two are accomplished by
yylval = install(id);yylval is a global used for this purpose in Yacc. The third is accomplished by return(ID);
The action for {number} is similar.
The rules for the relational operators set yylval to specific manifest constants to show which value was found and return the token RELOP to signify that a relational operator was seen.