lukehutch / pikaparser

The Pika Parser reference implementation
MIT License
141 stars 12 forks source link

Parsing code example does not compile #1

Closed wrandelshofer closed 4 years ago

wrandelshofer commented 4 years ago

Hi Luke,

I think, in the parsing code example in the readme file there are same wrong variable names. I have made them fat below:

String grammarSpecFilename = "arithmetic.grammar"; String inputFilename = "arithmetic.input"; String topRuleName = "Program"; String[] recoveryRuleNames = { topRuleName, "Statement" };

String grammarSpec = Files.readString(Paths.get(grammarSpecFilename));

Grammar grammar = MetaGrammar.parse( grammarSpecInput );

String input = Files.readString(Paths.get(inputFilename));

MemoTable memoTable = metaGrammar .parse( srcStr );

ParserInfo.printParseResult(topRuleName, metaGrammar , memoTable, input, recoveryRuleNames, false);

lukehutch commented 4 years ago

Oops, I should have tested that the code compiles! Fixed, thanks.

wrandelshofer commented 4 years ago

Thank you for the fix!