Why variable name does not start with numbers in C ?

Posted by ginni arora on June 13th, 2019

    Lexical Analysis Syntax Analysis Semantic Analysis Intermediate Code Generation Code Optimization Code Generation Symbol Table

Backtracking is maintained a strategic distance from in lexical investigation stage while assembling the bit of code. The variable like Apple; the compiler will realize its an identifier immediately when it meets the letter 'A' character in the lexical Analysis stage. In any case, a like 123apple, the compiler won't most likely choose if its a number or identifier until it hits 'an' and it needs backtracking to go in the lexical investigation stage to recognize that it is a variable. In any case, it isn't upheld in the compiler.

When you're parsing the token you just need to take a gander at the main character to decide whether it's an identifier or exacting and afterwards send it to the right capacity for handling. With the goal that's an exhibition advancement.

Like it? Share it!


ginni arora

About the Author

ginni arora
Joined: June 13th, 2019
Articles Posted: 1