Compiler Construction Asig

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Compiler Construction

ASSIGNMENT#02
Question#01: What is the Input alphabet of each of the following Languages?
1.
2.
3.
4.

Pascal
C
Ada
LISP

Question#02: What are the conventions regarding the use of blanks in each of the Languages
in Question#01?

Question#03: Identify the Lexemes that make up the tokens in the following programs. Give
reasonable attribute values for the tokens.

a) int max ( i , j ) int i , j;


/* return maximum of integers I and j */
{
return i > j ? i : j ;
}

Question#04: Write regular definitions for the following languages.


a)
b)
c)
d)

All strings of letters that contain the five vowels in order.


All strings of letters in which the letters are in ascending lexicographic order.
All strings of digits with at most no repeated digit.
All strings of digits with at most one repeated digit.

Question#05: Specify the Lexical form regular expression/ pattern) of


1. Numeric Constant in C language.
2. Identifiers in C Language
3. Keywords in C language

You might also like