But you'd have to have a good reason to use a string literal as a parser
rule instead of a lexer rule.

Bart.


On Tue, Jul 26, 2011 at 9:16 AM, Rob Aarnts <r...@aarnts.com> wrote:

>
> You're entirely right. I use this trick but with a parser rule in stead
> of a lexer one. So SINGLE_QUOTED_STRING should be single_quoted_string
> according to the ANTLR convention
> -----------------------------------------------------
> Rob Aarnts
> phone: +31 2356 14444
> mobile: +31 6 5582 2856
> fax: +31 8 4227 4444
> -----------------------------------------------------
> On 26 jul 2011 09:02 "Gokulakannan Somasundaram" <gokul...@gmail.com>
> <gokul...@gmail.com> wrote:
> > > On Mon, Jul 25, 2011 at 4:44 PM, Rob Aarnts <<r...@aarnts.com>>
> > > wrote:
> > > > Or:
> > > >
> > > > SINGLE_QUOTED_STRING returns [string result]
> > > >     : SQUOTE
> > > >            val=((~SQUOTE)*)    { $result = val.Text; }
> > > >       SQUOTE
> > > >     ;
> > > Is this possible? To my knowledge, Lexer cannot return...
> > > Gokul.
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe:
> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>

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 il-antlr-inter...@googlegroups.com.
To unsubscribe from this group, send email to 
il-antlr-interest+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to