3
votes

Heres an example rule for oct values. Instead of using YYTEXT i'd like to get the value, letter and the # at end (8,...64). How might i get them? I guessed printf("%s", $1) to see if i'd get the value but lex gave me a compile error instead

0([0-7]+)(([us])(8|16|32|64))?

Also it appears "group" isn't in the manual.

1
I don't think you can use capturing groups in flex, see stackoverflow.com/questions/3901835/…. - Andy

1 Answers

8
votes

There are no capturing groups in flex.

I think this would best be represented as several states, with separate matching rules and state transitions.