开发者

Get groups with flex?

开发者 https://www.devze.com 2023-03-06 17:17 出处:网络
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 v

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 comp开发者_JAVA技巧ile error instead

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

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


There are no capturing groups in flex.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消