How parser4j works

general informations about LR parser

Flow

There is two part in parser4j:

Generator for generator

Since the parser data generator read a grammar definition text file to generate parser data it use parser to parse this text file. The grammar definition text file have its own grammar definition.

how are generated parser data for grammar text input.

basic concept

TODO
infinite lookahead
ambiguous grammar

parsing stack

TODO

parsing state

It is a set of parsing stack, each stack is for a reduction possibility
TODO

Ambiguity

HasAmbiguityParserException

        } catch (HasAmbiguityParserException exception) {
            try {
                parseNodeToXML.toXml("runtime/parsetree", exception,
                        nonTerminalByIdentifierMap);
            } catch (Exception exception2) {
                _log.error("while output to xml ambiguity", exception2);
            }
            throw exception;
        }
       
        then use ShowParseNodeTree



© 2008-2009, parser4j