Compiler Principles (Week 1) : by Mahalingam. P. R S1 - Csis
Compiler Principles (Week 1) : by Mahalingam. P. R S1 - Csis
(Week 1)
By
Mahalingam. P. R
S1 - CSIS
Contents
• Language Processor
• Compiler
• Phases of a compiler
• Challenges in compiler design
• Current solutions
• Scope for research
• Conclusion
Language processor
• Convert our program in high level language
(human-side) to low level language
(machine-based).
• Under our consideration:
1. Compiler (complete generation at once).
2. Interpreter (step by step execution).
Compiler
• Convert our high level program to machine
code.
• One of the most basic system software.
• The main tool of programmers worldwide.
• Example:
C compiler
Java bytecode generator
...
• Even the OS we use was a complex high
level code once.
• So, even the OS has to undergo a certain
level of compilation to work in the first
place.
• This is where compiler performance
matters the most...
• Reference : Design and construction of Compilers, University of Texas at Arlington
http://lambda.uta.edu/cse5317/notes/
Phases of compiler
• Lexical analysis
• Syntax analysis
• Semantic analysis
• Intermediate Code Generation
• Code Optimization
• Code Generation
• Reference: Compilers – Principles, Techniques and Tools by Alfred Aho, Jeffery
Ullmann, Ravi Sethi
• Our own Project – Compiler-Compiler Training Tool !!!
Challenges in Compiler Design
• Working for a whole set of defined
grammars and patterns.
• Efficiency of generated code.
• Optimization of the code.
• Compilation time.
• Platform independence.
• References: Design and construction of Compilers, University of Texas at Arlington
http://lambda.uta.edu/cse5317/notes/
Present solutions
• Compiler Compilers
• Local and Global optimization
• Partial Compilation
- In Java, the compiler generates only
the bytecode. It is just the partial result of
compilation. The actual code is generated
by a platform-dependent interpreter.
• Reference: Compilers – Principles, Techniques and Tools by Alfred Aho, Jeffery
Ullmann, Ravi Sethi
Scope for research
• Code optimization
• Intermediate code portability
• Incremental Compilers
• Distributed Compilation
• Compiler – Compilers
• Reference: Compilers – Principles, Techniques and Tools by Alfred Aho, Jeffery
Ullmann, Ravi Sethi