On 4/16/11 1:18 PM, "Bart Kiers" <[email protected]> wrote:
I have found this FAQ
http://www.antlr.org/wiki/pages/viewpage.action?pageId=1461
But only Java here ...
{setText(getText().substring(1, getText().length()-1));} ;
Now I struggling to find any API of C analogs of
getText() / setText() for LEXER.
> How to remove that quotes in v3? :-)
>
>
> Here's a way:
>
> DELIMITED
> @init {
> String q = null;
> }
> @after {
> String text = getText();
> // remove the first and last quote, replace all 2 quotes with a single
> quote
> setText(text.substring(1, text.length()-1).replace(q+q, q));
> }
> : ( DQUOTE (~DQUOTE | DQUOTE DQUOTE)+ DQUOTE {q = $DQUOTE.text;}
> | BQUOTE (~BQUOTE | BQUOTE BQUOTE)+ BQUOTE {q = $BQUOTE.text;}
> ) { $type = IDENT; }
> ;
>
> or create your own token that handles the replacements
> internally: http://www.antlr.org/wiki/pages/viewpage.action?pageId=1844
--
Best regards,
Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc
Valentina - Joining Worlds of Information
http://www.paradigmasoft.com
[I feel the need: the need for speed]
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
--
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en.