Discussion
Match each term with its correct description.
List I
A. token
B. lexeme
C. pattern
D. attribute
List II
1. the rule describing what lexemes a token matches
2. a category such as identifier or number
3. extra information such as a symbol table pointer
4. the actual characters matched in the source
Answer: A
Correct answer: A-2, B-4, C-1, D-3
The four terms describe one relationship from four sides. A token is the category - identifier, number, keyword. A lexeme is the actual characters matched in the source.
A pattern is the rule, usually a regular expression, describing which lexemes a token admits. An attribute is the extra information carried with the token, such as a symbol table pointer or a literal's value. Category, instance, rule and payload - keeping those four ideas apart is the whole of the matching.
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