Professional Documents
Culture Documents
Assignment 01 2023 Compiler
Assignment 01 2023 Compiler
Question # 1:
Compare the speed of execution of computer program in various languages to which you
have access.
Question # 2:
Try to find out which of the compilers you have used are single-pass, and which are multi-
pass, and for the latter, find out how many passes are involved. Which produce relocatable
code needing further processing by linkers or linkage editors?
Question # 3:
Identify the lexemes that make up the tokens in the following program. Give
reasonable attribute values for the tokens.
Question # 4:
Write regular definitions for the following languages:
a) All strings of letters that contain the five vowels in order.
b) Comments consisting of a string surrounded by /* and */ without an intervening */
unless it appears inside the quotes “and”.
c) All strings of digits with at most one repeated digit
d) All formats of integer constant used in C language
A decimal numeral is either the single ASCII character 0, representing the integer
zero, or consists of an ASCII digit from 1 to 9, optionally followed by one or more
ASCII digits from 0 to 9, representing a positive integer.
An octal numeral consists of an ASCII digit 0 followed by one or more of the ASCII
digits 0 through 7 and can represent a positive, zero, or negative integer. Note that
octal numerals are always consist of two or more digits; 0 is always considered to be
a decimal numeral—not that it matters much in practice, for the numerals 0,00, and
0x0 all represent exactly the same integer value.
NOTE: Write your full name and section on the top right corner of the first page.
Missing any of the above instructions will cost 1 mark.
Only hand written assignments will be accepted (no printed assignments).
Do the assignments individually, copied assignments will get Zero.
2 Mark will be deducted each day on late submissions.