I have been working on something with ANTLRv4 this morning, and I have a need to take a certain string from the user, defined in the grammar as:
OP : 'a' | 'b' | 'c';
In a {} Java-thingy after a different definition, I need to compare the OP to another string. Currently, this is not working:
if ($string.text == "a") {
    //Do Something
}
where string is the name I attached to that specific instance of OP. How can I compare the text value of string to another string ("a")?
 
     
     
    