A syntactically valid email address is made up of a user’s ...
Compiler Construction
1. A syntactically valid email address is made up of a user name followed by ‘@’ followed by a list of at least two domain names separated by ‘.’. Assume that user and domain names are made up of letters [a-z] and digits[0-9], and the main domain name, i.e., the last domain name, contains two or three characters. For example, the following three addresses are valid,
ab@b.ab
ab@b.ab.ab
11@1234.1a
but the following three are invalid:
a.b.ab
ab@ab
ab@ab.abcd
1) Write a regular expression to define valid email addresses.
2) Design a deterministic finite automaton to recognize valid email addresses.
2. Consider the following grammar:
E ::= id |
! E |
E && E |
( E )
where id, !, &&, (, and ) are terminals.
1) Prove that the grammar is ambiguous.
2) Eliminate left-recursion from the grammar.
3. Describe the difference between interpretation and compilation as two implementation methods of programming languages. In the description of compilation, you must describe the main compilation phases.
4. Construct the LL(1) parse table for the following grammar.
E ::= T E’
E’ ::= + T E’ | (
T ::= F T’
T’ ::= * F T’ | (
F ::= (E) | a
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related searches
- definition of a man s man
- importance of a person s name
- made up of definition
- made up of synonym
- description of a man s man
- be made up of meaning
- example of a person s background
- is made up of synonym
- importance of a master s degree
- examples of a person s strengths
- definition of a supervisor s role
- definition of a manager s role