If you can't crack this, try JavaCC. There are a ton of examples out
there plus a textbook.
see http://mindprod.com/jgloss/javacc.html

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
On Sep 27, 2:47 pm, Roedy Green <see_webs...@mindprod.com.invalid>
wrote:
> If you can't crack this, try JavaCC. There are a ton of examples out
> there plus a textbook.
[quoted text clipped - 4 lines]
> Roedy Green Canadian Mind Products
> The Java Glossaryhttp://mindprod.com
I have found a "better" way, but I hope its still not the "right" way.
LQS: LQSS {tokenStartCharIndex=getCharIndex();}(options
{greedy=false;} : . )*{text = getText();}LQSE;
LQSS: ('>>>' SPACE* CRLF);
LQSE: CRLF SPACE* '<<<';
That this does: Sets the token start index to the "current" index
after it matches LQSS, and sets the text permanently to what it is
before matching the LQSE.
Not exactly what I call elegant.