Recursive Decent Parsing:Actions in the Parsing Functions
Here is one of the augmented grammar productions, with abbreviated versions of 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:
\\ {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 = goes here . . .
if( tokentype != SEMICOLON ){
\\ {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
return TRUE; /* parsing succeeded */