Skip to content

A set of solutions to problems that are the base to generate a compiler.

License

Notifications You must be signed in to change notification settings

shreyanshanchlia/Compiler-Design

Repository files navigation

Compiler Design

A set of solutions to problems that are the base to generate a compiler.

  1. Design a lexical analyzer for given language and the lexical analyzer should ignore redundant spaces, tabs and new lines. It should also ignore comments. Although the syntax specification states that identifiers can be arbitrarily long, you may restrict the length to some reasonable value. Simulate the same in C language.
  2. Write a C program to identify whether a given line is a comment or not.
  3. Write a C program to recognize strings under 'a', 'a*b+', 'abb'.
  4. Write a C program to test whether a given identifier is valid or not.
  5. Write a C program to simulate lexical analyzer for validating operators.
  6. Implement the lexical analyzer using JLex, flex or other lexical analyzer generating tools.
  7. Write a C program for implementing the functionalities of predictive parser for the mini language specified.
    1. Write a C program for constructing of LL (1) parsing.
    2. Write a C program for constructing recursive descent parsing.
  8. Write a C program to implement LALR parsing.
    1. Write a C program to implement operator precedence parsing.
    2. Write a C program to implement Program semantic rules to calculate the expression that takes an expression with digits, + and * and computes the value.
  9. Convert the BNF rules into Yacc form and write code to generate abstract syntax tree for the mini language specified.
  10. Write a C program to generate machine code from abstract syntax tree generated by the parser. The instruction set specified may be considered as the target code.

About

A set of solutions to problems that are the base to generate a compiler.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages