Discussion
Which global variable in LEX points to matched string and which global variable contains the length of the matched string ?
Answer: C
The variables are yytext, yyleng.
In a LEX-generated scanner, yytext points to the text of the lexeme just matched, and yyleng holds its length. Actions in the rules use them, for example to copy the matched identifier or number.
yylex is the scanning function itself, which returns the next token, and yylval is the variable used to pass a token's value to a YACC parser. lextext, lexval and lexyy are not LEX's global variables (lex.yy.c is the name of the generated file).
No comment is present. Be the first to comment.
Loading…
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development