I am new to parser generators and I wonder what the ANTLR grammar might look like for an embedded language like JSP / ASP / PHP, but unfortunately the ANTLR site does not provide such grammar files.
More precisely, I donβt know exactly how to determine the AnyText token that matches all (including keywords that have no meaning outside the blocks of code) and can still correctly recognize them inside the blocks.
For example, the following snapshot should be labeled as something like: AnyText, BlockBegin, Keyword, BlockEnd, AnyText.
lorem ipsum KEYWORD dolor sit <% KEYWORD %> amet
Perhaps there is another parser generator that is better suited to my needs. I have only tried ANTLR so far, due to its huge popularity here on stackoverflow :)
Thank you very much in advance!
parsing antlr
tux21b
source share