You are on page 1of 2

VI Semester

Class: III BE Max.Marks:


50
Major: Computer Science and Engineering Time:3hours

17BE0C23 Compiler Design Practicals

1. Execute a program to find whether the string is a keyword or not


2. Write a program for lexical analyzer to recognize all the valid tokens in the input program
written according to the grammar.
3. Execute a program to find whether the string is a constant or not
4. Verify the input of the state using the transition diagram to recognize if the strings can be
accepted or not under the given pattern rule 'a', 'a*b+', 'abb'
5. Accept a deterministic finite automaton from the user and apply the DFA algorithm to give
an equivalent DFA that has a minimum number of states.
6. Simulate a lexical analyzer for validating operators.
7. Generate a parser tree for the given expression
Production rules:T= T + T | T * T
T = a|b|c
Input: a * b + c
8. Implement a program to generate all the tokens for the given grammar: (12+23*34)
9. Implement a program to find the first character of the string produced when a production
rule is applied in Context Free Grammar
10. Implement a program to convert a nondeterministic finite automaton to a deterministic finite
automaton
11. Construct LALR parsing table for the following grammar.
S iCtSS’
S’ eS/ î
12. FOLLOW can make a Non-terminal to vanish out if needed to generate the string from the
parse tree. Compute a program by applying the Follow function for the following grammar
E TE'
E' +TE'/î
T FT’
T' *FT'/î
F (E)/i
13. Design Predictive parser for the given language
S->A
A->Bb
A->Cd
B->aB
B->@
C->Cc
C->@
14. Generate an intermediate code from the abstract syntax tree generated by the parser.
15. Read the given input string from the user and check whether the initial character of the string
is numerical or any special character except ‘_’ and print if the identifier is valid or not

You might also like