The Wisent's parser is what is called a bottom-up or shift-reduce parser which repeatedly:
The parser will stop on:
The above elementary actions are driven by the LALR(1)
automaton built by
wisent-compile-grammar from a context-free
The Wisent's parser is entered by calling the function:
Parse input using the automaton specified in automaton.
- Is an LALR(1) automaton generated by
wisent-compile-grammar(see Wisent Grammar).
- Is a function with no argument called by the parser to obtain the next terminal (token) in input (see Writing a lexer).
- Is an optional reporting function called when a parse error occurs. It receives a message string to report. It defaults to the function
wisent-message(see Report errors).
- Specify the start symbol (nonterminal) used by the parser as its goal. It defaults to the start symbol defined in the grammar (see Wisent Grammar).
The following two normal hooks permit doing some useful processing respectively before starting parsing, and after the parser terminated.