in reply to How does Perl do it it's thing?
expr : expr ANDOP expr { $$ = newLOGOP(OP_AND, 0, $1, $3); } | expr OROP expr { $$ = newLOGOP($2, 0, $1, $3); } | argexpr %prec PREC_LOW ;
This process builds a so-called "parse tree" where each of the operations is represented by a data structure that points to other data structures.
In a compiler that expected to output to machine code, this would be approximately the same, but it would be followed by a pass that would read the parse tree and output machine code. In Perl, instead of making machine code for execution by a real processor, a somewhat higher-level representation is made that is then interpreted and executed by a little program inside Perl.
|
---|