Unlike in flex, /* */ and \\
don’t seem to work in jlex. They give the error,
“Missing brace at start of lexical action.”
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 can include comments in the first and third sections of your JLex specification (which are the definition and java code sections), but not in the second (rules) part, because JLex will think they are part of a pattern.
Write
%state DUMMYin the declaration section and then writing comments in the rules section like this:
<DUMMY>. { /* this is my comment */ }