I'm writing an antlr grammar that reads in yacc specification file. Yacc spec files are of the form
declarations %%rules %%programs
However, I'm only interested in the declarations and rules sections of the yacc spec file. I have defined rules which match the declarations and rules well but I was trying to match everything that comes after the second '%%' using a wildcard operator (.*?). This fails. Here's the
Link to my anltr grammar for yacc grammars
How can I match whatever that comes after the second '%%'.
I have also tried matching anything but the EOF using
<some_rule> : ~(EOF)* ;