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

Discussion

A lexeme is

  • A.the abstract category to which a group of characters belongs
  • B.the entry that is created in the symbol table for a declared identifier
  • C.the value computed by an expression during semantic analysis
  • D.the actual sequence of characters that forms an instance of a token

Answer: D

Correct answer: the actual sequence of characters that forms an instance of a token

A lexeme is the concrete text in the source - count, 42, while. The token is the category it belongs to, such as identifier or number.

So count and total are two lexemes of the same token. The pattern is the rule describing which lexemes a token admits, and the attribute is the extra information carried along, typically a symbol table pointer. Four terms for four distinct things, and confusing lexeme with token is the usual slip.

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

Post your comment

Please log in or register to post a comment.