General Information
Tutorials
Reference Manuals
Libraries
Translation Tasks
Tools
Administration
|
New Features of Eli Version 4.4New error reporting for parser conflictsWe have a new default format for reporting parser conflicts: For each conflict, it provides an example of a derivation leading to each of the conflicting situations. Our hope is that it will be easier to determine the cause of the conflict with this information than with the simple printout of the state that was given previously.
ExampleHere is a simple example (see Explanation of the grammar for word classification of Guide for New Eli Users):
text: set_defs . set_defs: set_def / set_defs set_def . set_def: set_name '{' set_body '}' . set_name: word . set_body: elements / . elements: set_element / elements set_element . set_element: word . Suppose that we make the grammar non-LALR by removing the brackets around set_body. Here is the result of applying the default :parsable:
Conflicting Derivations ======================= ************************************************************************ *** shift-reduce conflict on: word text EOF set_defs set_defs set_def | set_name set_body | word | set_def set_name set_body . [REDUCE] set_body -> {word} ? text EOF set_defs set_def set_name set_body elements set_element . word [SHIFT] set_element -> word . ? ************************************************************************ *** shift-reduce conflict on: word text EOF set_defs set_defs set_def | set_name set_body | word | set_def set_name set_body elements . [REDUCE] set_body -> elements {word} ? text EOF set_defs set_def set_name set_body elements set_element . word [SHIFT] set_element -> word . ? ************************************************************************
This output gives two examples in which the parser will be unable to decide
what to do when it sees a
Each derivation begins with
The lines adjacent to the vertical bar show how the lookahead symbol can be
derived:
Below the vertical bar, the main derivation continues by
rewriting the symbol at the top of the bar.
In this case,
This first derivation of the first example shows that the parser could
recognize an empty set body and consider that the lookahead symbol
The second example also involves a
Help
If you have conflicts in your grammar, the :help derivation will show you
messages for a type-`pgsconflict' file.
Each message specifies the type of conflict and the set of terminals
causing the conflict.
Clicking the help browser's
Parsable
The :parsable derivation will give you the new diagnostics by default.
You can still obtain the state printout by supplying a
-> sets.specs +pgsOpt='S' :parsable <
Here the string
|