I would like to know, why
expr:
a=(.*) 'ing' { System.out.println($a.text};
Does not work.
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.
For one, you’re missing
);in your embedded code. It’s not:but:
You’re also not really clear as to what “does not work” means, but I can make an educated guess. You’re probably seeing
nullprinted to the console. This is because you cannot assign a label to.*(a=(.*)is invalid). What you can do is move whatais supposed to point to, to a sub-rule:You should not be using
.*inside parser rules, unless you know exactly what you’re doing.