Hi,

I’m using the parser contained in strategoxt.jar to parse some input. I use an own implementation of the ITreeBuilder interface to do some work on the parse tree created by the parser. In this parse tree the inner nodes represent applications of rules (or the occurence of ambuiguities) and the leafs represent recognized characters or the applications of epsilon rules.

I configured the default disambiguator as followed:

sglr.getDisambiguator().setFilterCycles(true);
sglr.getDisambiguator().setFilterAny(true);
sglr.getDisambiguator().setHeuristicFilters(false);
sglr.getDisambiguator().setAmbiguityIsError(false);

With this configuration I expected that the parse forest would not contain a node which represents a rejected rule. But it does, if I try to parse the input V() with the following grammar:

module Test
exports
    sorts Keyword Expression Identifier BigIdentifier SmallIdentifier
    lexical start-symbols Expression
    lexical syntax
        "V" -> Keyword

        Identifier "(" ")" -> Expression

        BigIdentifier   -> Identifier
        SmallIdentifier -> Identifier

        [A-Z\_\$\255][A-Za-z0-9\_\$\255\254]* -> BigIdentifier
        Keyword -> BigIdentifier {reject}
	
        [a-z][A-Za-z0-9\_\$\255\254]* -> SmallIdentifier
        Keyword -> SmallIdentifier {reject}

    lexical restrictions
        BigIdentifier -/- [a-zA-Z0-9\_\$\255\254]
        SmallIdentifier -/- [a-zA-Z0-9\_\$\255\254]
Submitted on 21 November 2012 at 17:11

Log in to post comments