In TeX, equations are defined in between $...$. How can I define the lexer rule for lex, for the instance of any number of any characters between two dollar signs?
I tried:
equation \$[^\$]*\$
without a success.
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 try using start conditions if you don’t want the dollar signs to be included as part of the equation:
Alternately instead of using
BEGIN(STATE)you can useyy_push_state()andyy_pop_state()if you have other states defined in your lexer.