Machine-translated by Google. Questions are authored in English.
Top

Discussion

In a Lex action the variable holding the matched text is conventionally

  • A.yylineno
  • B.yytext, with its length available in yyleng
  • C.yylval
  • D.yyin

Answer: B

yytext points at the matched lexeme and yyleng gives its length. yylval carries the attribute value to the parser and yylineno tracks the line, so each has a distinct role. Confusing yytext with yylval is a frequent source of bugs in hand edited scanners.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.