Hi All

I have a source code that is written in ANTLR V2. I want to migrate the code
from V2 to V3.
What are the procedures that needs to be followed? What all I  need to
install?

Currently I am facing a problem with Comments.

When I instrument the code which is having comment , after instrumentation
all the comments are getting
removed.


I want to retain the comments after instrumentation of code.

The below is the grammar I am using in ANTLR v2.


// Single-line comments

SL_COMMENT

: "//" (~('\r'|'\n'))* {$setType(Token.SKIP);}

;





// multiple-line comments

ML_COMMENT

: "/*"

(options {generateAmbigWarnings=false;}:

{ LA(2)!='/' }? '*'

| EndOfLine

| ~('*'|'\n'|'\r')

)*

"*/" {$setType(Token.SKIP);}

;





if I use $Channel= HIDDEN instead of {$setType(Token.SKIP);}

it throws a error "Undefined token $"

I think this error could be because of using ANTLR 2



It would be nicer if the solution is in ANTLR 2 itslef.

I want to know how to retain comments in the instrumented code.



Vasanthi.

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

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