Ysera
Ysera

Reputation: 13

Flex and Bison, parse command line arguments

I'm using Flex and Bison, and I would like my lex/parse to analyse text from command line, for example if I have : mybin mytext , I would like my yyparse to analyse mytext (which is not a file)

Upvotes: 1

Views: 1519

Answers (1)

rici
rici

Reputation: 241931

Use yy_scan_string to set the flex input buffer to a specified string (argv[1] in this case). See the flex manual for details.

Upvotes: 1

Related Questions