Assignment 2
This question refers to
the definition of integer literals
in Java. What are valid integer literals?
123
123L
0123
00123
0x123
123x
Choose three from Questions 2.1 (a) through (e) in the textbook (p.96-97).
Explain why the following if statement results in syntax error in C, Java, and C#?
if (x==1) y = 2 else y = 3;
Give a CFG for each of the following languages.
Strings of 0's and 1's with an equal number of 0's and 1's.
Strings of 0's and 1's with an unequal number of 0's and 1's.
Context free language over {a,b}: L={a
n
b
n
}