I am tying to create a treetop grammar. I have created the rules to match sections in the file that are of interest to me.
grammar Sexp
rule bodies
body+
end
rule body
commentPortString (ifdef_blocks / interface)+ (!newLine)
end
...
end
How do I run this on a file to extract out the bodies
and ignore other sections that I dont care about, or do I need to end up writing rules for those sections also?
Thanks in advance
It's a common idiom in PEG grammars to repeatedly match any character
.
that isn't part of a rule!body
. Something like this: