How do I lex this input?
Posted
by etheros
on Stack Overflow
See other posts from Stack Overflow
or by etheros
Published on 2010-05-09T17:46:54Z
Indexed on
2010/05/09
17:48 UTC
Read the original article
Hit count: 227
antlr
|lexical-analysis
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 STRINGAPOS CPARENT SEMI CLOSE CDATA
How can I achieve this, or is there a better way?
© Stack Overflow or respective owner