Recursive Decent Parsing:Actions in the Parsing Functions
Here is one of the augmented grammar productions that make up the translation scheme, with the semantic action symbols inserted as before:
<> --> ID {enter} = <> {pop;copy} ;
The code for the recursive-descent parsing function that implements the semantic actions for this production looks something like this:
errprint(Missing identifier);
\\ {enter} action goes here: Call a function that
\\ returns a pointer to the identifier in the
\\ symbol table. If not found there, enter it.
. . . usual code to match EQUALS goes here . . .
\\ {pop;copy} action goes here: Pop the top value
\\ off the value stack and copy it into the
\\ symbol table at the location of the identifier
if( tokentype != SEMICOLON ){
return TRUE; /* parsing succeeded */