[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
12.3 The parsing function
Once a grammar has been defined, it can be used to parse some input using the following function:
- bigloo procedure: read/lalrp lg rg port [emptyp]
This function takes three, possibly four, arguments. The first, lg, is the Lalr(1) grammar. The second, rg, is the lexical analyzer that feeds the grammar with tokens. The third argument, port, is the port that contains the input to be parsed. The last argument, emptyp, if provided, should be a function of one argument. It is called with each new token read from the port and should return
#t
if the token denotes the end of input. The result of the call is the value computed by the semantic actions of the production rules.
This document was generated on October 23, 2011 using texi2html 5.0.