alpag.net manual
Parser / Conflicts
< Configuration | Types of conflicts >

Conflicts

Alpag is sometimes unable to build parser for provided grammar. Typical reasons are:

Grammar is ambiguous if it provides more than one interpretation for some input. A trivial example of ambiguous grammar is:

FILE: AandB C | A BandC
AandB: A B
BandC: B C

With above grammar it is impossible to say whether input A B C should be interpreted as AandB C or A BandC. User should avoid defining ambiguous grammars.

Inability to build a parser can have its source in use of LR(1) algorithm. The algorithm can handle only certain grammars which are a subset of general CFG class. Any CFG grammar can be specified as input to Alpag, so it is possible to define a grammar which is valid, but cannot be handled by Alpag.

When grammar cannot be processed either because of ambiguity or due to limitations of LR(1) method, a conflict is reported. All conflicts must be resolved before parser is generated. User can resolve conflicts either by redefining grammar, or providing hints on how to resolve each conflict.

< Configuration | Types of conflicts >
Alpag Manual