Hi,
I am using Antlr 3.
 I have a instruction file where each instruction starts with new line and
it has fixed syntax. So I have written grammar file for the syntax check for
some of the instructions. But I have problem with Comment line.
In my instructions, line comment is represented  by  single quote (') ( no
closing quote is required). So if the line starts with single quote, then
that entire line I need to skip.
This is the rule for Comment

COMMENT : '\'' ~('\n'|'\r')* {$channel=HIDDEN;} ;

This is working well, if there is no single quote occurs within the
instruction. If single quote occurs in the instruction other than at the
beginning of the file, the text after single quote is treating as a comment.
So How to write a rule only if line starts with single quote then it is
comment not any where else? please help me.

Thanks in advance
Virg

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

Reply via email to