You are on page 1of 3

COMPILER DESIGN - LAB WORK

INDEX

SR. NO. EXPERIMENTS DATE SIGN

1. study of compiler design tools 08/02/22

write CPP program to identify lexical


2. 15/02/22
syntax semantic

3. study of lex,yacc,flex,bison tools 22/02/22

implementation of lexical analyser for


4. 08/03/22
identifier keyword and number using lex

5. implementation of Antlr parser 22/03/22

implementation of operations in symbol


6. 29/03/22
table

implementation of intermediate code


7. 05/04/22
generation

implementation of yacc parser to evaluate


8. 12/04/22
arithmetic expression involving,-,*,/
Experiment-1

AIM: To study of compiler design tools

What is a compiler?
A compiler is a computer program which helps you transform source code written in a high-level
language into low-level machine language. It translates the code written in one programming
language to some other language without changing the meaning of the code. The compiler also
makes the end code efficient, which is optimised for execution time and memory space.
The compiling process includes basic translation mechanisms and error detection. The compiler
process goes through lexical, syntax, and semantic analysis at the front end and code generation
and optimization at the back-end.

Compiler Tools:
1. Parser Generator –
It produces syntax analyzers (parsers) from the input that is based on a grammatical
description of a programming language or on a context-free grammar. It is useful as the
syntax analysis phase is highly complex and consumes more manual and compilation time.
Example: PIC, EQM

2. Scanner Generator –
It generates lexical analyzers from the input that consists of regular expression description
based on tokens of a language. It generates a finite automaton to recognize the regular
expression.
Example: Lex

3. Syntax directed translation engines –


It generates intermediate code with three address formats from the input that consists of a
parse tree. These engines have routines to traverse the parse tree and then produce the
intermediate code. In this, each node of the parse tree is associated with one or more
translations.

4. Automatic code generators –


It generates the machine language for a target machine. Each operation of the
intermediate language is translated using a collection of rules and then is taken as an
input by the code generator. A template matching process is used. An intermediate
language statement is replaced by its equivalent machine language statement using
templates.

5. Data-flow analysis engines –


It is used in code optimization.Data flow analysis is a key part of the code optimization
that gathers the information, that is the values that flow from one part of a program to
another. Refer – data flow analysis in Compiler

6. Compiler construction toolkits –


It provides an integrated set of routines that aids in building compiler components or in
the construction of various phases of compiler.

You might also like