Results 1 to 3 of 3
I need rule that would capture the rest of the line after a token match:
Code:
%x SLURP
identifier [a-zA-Z]+
pluseq \+=
qmarkeq \?=
equals =
restofline [^\n]*
{identifier} {return ...
- 01-13-2012 #1Just Joined!
- Join Date
- Mar 2008
- Posts
- 3
Flex beginner question
I need rule that would capture the rest of the line after a token match:
I don't see entering SLURP state in the debug output.Code:%x SLURP identifier [a-zA-Z]+ pluseq \+= qmarkeq \?= equals = restofline [^\n]* {identifier} {return tok_with_string(IDENTIFIER);} {pluseq} {BEGIN(SLURP);return tok_with_string(PLUSEQ);} {qmarkeq} {BEGIN(SLURP);return tok_with_string(QMARKEQ);} {equals} {BEGIN(SLURP);return tok_with_string(EQUALS);} <SLURP>restofline {BEGIN(INITIAL);return tok_with_string(RESTOFLINE);} ...
- 01-15-2012 #2
I'm not a programmer but perhaps you could get more help if you offered more details.
I do not respond to private messages asking for Linux help, Please keep it on the forums only.
All new users please read this.** Forum FAQS. ** Adopt an unanswered post.
- 01-15-2012 #3Just Joined!
- Join Date
- Mar 2008
- Posts
- 3
More details
I am trying to parse the input like:
foo = rest of the line
foo is captured by identifier, = is captured by equals.
I want to capture all text after =, if I use restofline, it captures
everything. I created a conditional state SLURP which I don't see working.


Reply With Quote