How do I lex this input?
问题 I currently have a working, simple language implemented in Java using ANTLR. What I want to do is embed it in plain text, in a similar fashion to PHP. For example: Lorem ipsum dolor sit amet <% print('consectetur adipiscing elit'); %> Phasellus volutpat dignissim sapien. I anticipate that the resulting token stream would look something like: CDATA OPEN PRINT OPAREN APOS STRING APOS CPAREN SEMI CLOSE CDATA How can I achieve this, or is there a better way? There is no restriction on what might