Parser interface

The Ocamlyacc parser is actually Ocaml functions named after start symbols (see The Start-Symbol). Here we describe the interface conventions of parser functions and the other functions that it needs to use.

    Parser Functions

    To cause parsing to occur, you call the parser function with two parameters.

    Lexical Functions

    The lexical analyzer function, named after rule declarations, recognizes tokens from the input stream and returns them to the parser.

    Error Functions

    The Ocamlyacc parser detects a parse error or syntax error whenever it reads a token which cannot satisfy any syntax rule.

comments powered by Disqus