How do I match a string in bison grammar? A string that stands for itself like “polySphere” let’s say. Will I have to create a token in the .lex file like POLYSPHERE and then use that in bison? Can’t I just use the string directly?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could recognize the string in bison character by character, eg:
but that is rather ineffecient — generally its much better to recognize the string in the lexer and return a single token