drforr / perl6-ANTLR4

Parser for ANTLR4 grammar
25 stars 12 forks source link

How to avoid endless loops in generated grammar? #16

Open johannes-riecken opened 4 years ago

johannes-riecken commented 4 years ago

I find this a really great and impressive module and was amazed that it could directly generate a syntactically correct Perl6 grammar for a large ANTLR4 grammar (I took the golang grammar from the example grammars repo, moved the grammar and lexer into one file and removed the extra function calls by requiring statements to be semicolon-terminated). While that grammar still works with ANTLR4, I get seemingly endless loops in the Perl6 grammar. Are there any simple steps for me to mechanically rewrite the Perl6 grammar manually so that it runs in a reasonable time?

Here's the grammar and example input text I've used.