Dear All, I have in my grammar:
fragment UNIT_NAME :; ID : ('a'..'z'|'_')* { if ( myLookUpMethod( *X* ) ) $type=UNIT_NAME; } ; =============================== Instead of *X*, I wanna refer to the text that is in red.. For example, the token "w_aw_s" is ID. I want to take the text of this token "w_aw_s" and look it up in a certain array and if it is in this array then I set its type to UNIT_NAME. P.S.: I tried to replace *X* with *$text* but I receive the error: [16:15:56] symbol : method myLookUpMethod(java.lang.String) [16:15:56] location: class SimpleTestLexer [16:15:56] if(myLookUpMethod(getText())) _type=UNIT_NAME; [16:15:56] ^ [16:15:56] 1 error Find X :-) Many Thanks ! -- Sameh W. Zaky 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.