in Compiler Design
1,529 views
2 votes
2 votes

This screenshot is token from the book Ullman,

How can following be a lexical error? because "elipseSize" should have a token recorded as an identifier.

in Compiler Design
1.5k views

4 Comments

You must find "How it matches lexeme to a pattern(description) to form a valid token?"
0
0
yes it reads the token charecter by charecter it doesnt care about anything else even if u have recorded it once as ellipsesize and next time there is a spelling mistake it makes a new entry for this new one so no lexical error
0
0
this is clearly a wrong definition. elipseSize and ellipseSize both are valid.
0
0

1 Answer

1 vote
1 vote
Compiler is all about impementation.

If an automata is already defined for your statement, then it will be counted as a valid token ,Otherwise it will show lexical error.

Here, mis-spelling of keywords or identifier means error while identifying lexemes(longest common sequence).

Related questions