The number of tokens in the following C statement is (GATE 2000)
printf("i = %d, &i = %x", i, &i);
Question 1 Explanation:
In a C source program, the basic element recognized by the compiler is the “token.” A token is source-program text that the compiler does not break down into component elements. There are 6 types of C tokens : identifiers, keywords, constants, operators, string literals and other separators. There are total 10 tokens in the above printf statement. Below are tokens in above program.
printf ( "i = %d, &i = %x" , i , & i ) ;
In a compiler, keywords of a language are recognized during
parsing of the program
the code generation
the lexical analysis of the program
The lexical analysis for a modern computer language such as Java needs the power of which one of the following machine models in a necessary and sufficient sense?
Finite state automata
Deterministic pushdown automata
Non-Deterministic pushdown automata
Question 3 Explanation:
There are 3 questions to complete.