At 00:34 17/07/2009, Michael wrote:
 >> MLB : '/*' ( options { greedy = false; } : .* )
 >> ( '*/' | { print error message }
 >> { skip(); }
 >> ;
 >>
 >> You might need EOF rather just empty alt.
 >
 >I tried that too and it gives an error:

The problem here is that with the end text potentially empty the 
wildcard will consume all input.  You need to use Jim's suggested 
replacement for the wildcard as well in order to limit the scope.

Or another alternative replacement:

MLB : '/*' (~'*' | '*' ~'/')*
       ( '*/' | { print error message }
       { skip(); }
   ;

You *might* need to change ~'*' above to ~('*' | EOF), but I think 
it's ok as is.


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

Reply via email to