The main aim of Lexical is to identify token . each lexeme in source language , it will be categorized into token class .
The following are well known token class 1. Opening braces 2. Closing braces 3. Identifier 4.Keywords 5.Digits 6.Other ( including punctuation marks and all )
now each lexeme is taken and it is matched using a pattern specified for a token class
Remember that white spaces tab etc are used as a seperator . Just like in English lang , these spaces help us to identify words from sentences . The same thing is applied here
So according to me 'Int ---- Keyword
a--- identifier
= ---- operator
a--- identifier
now space is there it mean it was end of one token and begining of other token '
so 10 --- digit
I think its a lexical
And we shouldnt talk about semantic , we will get error at syntax phase only