Computer Science EngineeringHardISRO SC
A scanner uses maximal munch with identifiers [a-z_][a-z0-9_]*, decimals digits(.digits)?, and operators/punctuators including <<=, <<, <=, <, ==, =, ++, +, ->, -, &&, &, !=, !, >>, >=, >, *, /, ; ( ) { } and comma. How many tokens does it produce for the input "n2>=3.14<m"?
- A. 6
- B. 4
- C. 7
- D. 5
Correct answer: D. 5
Tokens: n2 | >= | 3.14 | < | m => 5.
Practise more Theory of Computation, Compilers & Digital Logic (ISRO CS) questionsTheory of Computation, Compilers & Digital Logic (ISRO CS): notes and key points
More Theory of Computation, Compilers & Digital Logic (ISRO CS) questions
- Nested procedures use static (access) links. A procedure at nesting depth 4 references a local variable declared in an enclosing procedure…
- Nested procedures use static (access) links. A procedure at nesting depth 3 references a local variable declared in an enclosing procedure…
- Global int g = 2; procedure P(a, b) { a = a + 5; b = b + a; print(a + b + g); } is called as P(g, g). The value printed under call by…
- How many of the following operations are guaranteed to produce a context-free language when applied to context-free languages L1, L2 and a…
- A shift/reduce conflict in a Yacc-style generator that is not resolved by precedence declarations is, by default, resolved by
- The complement of a context-sensitive language is