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.
To cause parsing to occur, you call the parser function with two parameters.
The lexical analyzer function, named after rule declarations, recognizes tokens from the input stream and returns them to the parser.
The Ocamlyacc parser detects a parse error or syntax error whenever it reads a token which cannot satisfy any syntax rule.