which of the following is an invalid variable a) EMP b) emp_ c) 12emp in computer science?
Answers
Answer:
c ) 12emp
Because backtracking is avoided in lexical analysis phase.
The variable like Apple;, the compiler will know it an identifier right away when it meets the letter ‘A’ character in the lexical analysis phase. However, a variable like 123apple; , compiler won’t be able to decide if its a number or identifier until it hits ‘a’ and it needs backtracking to go in the lexical analysis phase to identify that it is a variable. But it is not supported in the compiler.
When you’re parsing the token you only have to look at the first character to determine if it’s an identifier or literal and then send it to the correct function for processing. So that’s a performance optimization.
Answer:
c) 12emp
Explanation:
I hope this answer may help you