Given answer is 25, while my answer is 26, they have considered -10.0 as single token, which is wrong?
So yes 26. Minus is included.
https://stackoverflow.com/questions/26529711/how-to-differentiate-operator-from-a-negative-number-for-a-tokenizer
Ans is 25
i think you done mistak -10.0 take tow token but only 1.
Lexical analyzer checks for a longest valid lexeme which matches the pattern in case of "<=", it is the longest valid pattern so it will see "-10.0" as one pattern (as it is also a longest valid pattern).
srestha
lexical analysis, syntax analysis and symantic checking
all happens in lexer ??
Why? then what is the use of parser if lexer will do syntax analysis.
and parsers with SDD does semantic checking right ? Shaik Masthan
you are right @Aakash_
64.3k questions
77.9k answers
244k comments
80.0k users