Assignment 2

  1. This question refers to the definition of integer literals in Java. What are valid integer literals?
  2. Choose three from Questions 2.1 (a) through (e) in the textbook (p.96-97).

  3. Explain why the following if statement results in syntax error in C, Java, and C#?
    
       if (x==1) y = 2 else y = 3;
    

  4. Give a CFG for each of the following languages.