Basic requirement is use keyword as identifier, so I want to distinguish the token from it’s context.(e.g.class is a keyword, but we allowed a variable named class). In java, this is possible, but it’s so hard, here is how I do it TOKEN : { <I_CAL: "CAL"> : DO_CAL | <I_CALL: "CALL"> | <I_CMP: "CMP"> […]
The post Can JavaCC distinguish token by its context? appeared first on BlogoSfera.