Beruflich Dokumente
Kultur Dokumente
BY
AMIT KUMAR SINHA
1
National Institute of Technology Calicut
CERTIFICATE
This is to certify that the work reported in this project report entitled ‘POCKET PC
COMPILER’ is a bonafide record of the work done by AMIT KUMAR SINHA
(Y2M001), a student in the Department of Computer Engineering, National Institute
of Technology Calicut .
Dr.V.K.Govindan Dr.V.K.Govindan
Professor & HOD Professor & HOD
Dept. of Computer Engineering Dept. of Computer Engineering
NIT, Calicut NIT, Calicut
2
ACKNOWLEDGEMENT
I express my heartiest thanks to Dr. Vineeth Kumar Paleri, Asst. Professor, Department
of Computer Engineering, National Institute of Technology, Calicut, for the co-operation
rendered by him during the period of my project work.
I would also like to thank Dr. Priya Chandran, Asst. Professor, Department of
Computer Engineering, National Institute of Technology, Calicut, for her valuable
suggestions.
Last but not the least, I would like to sincerely thank all my friends , for their moral
support, valuable suggestions and help during the course of this work.
3
ABSTRACT
The study of the feasibility analysis of the implementation of a Compiler in Pocket
PC with considering various constraints, if possible implementation of it. Analysis
mainly focuses on the running the system rather than starting it from the scratch.
The project work shows that it is possible to develop compiler for the concerned
device.
4
Table of Contents
1. Introduction………………………………………………………6
2. System Overview………………………………………………….7
3. Design Consideration……………………………………………..8
4. Architectural Strategies…………………………………………....16
5. System Architecture
6. Conclusions ……………………………………………………………………..21
8. References ………………………………………………………22
5
Introduction
Problem Definition:
6
System Overview
Up to yet there is no facility exits that gives end user to compile his
programs on the Pocket PC itself for the considered model of Pocket PC. Compaq
ipaq provides a UNIX type shell through which compilation of any program like
written in C is possible
7
Design Considerations
8
Card, 1 ( 1 ) x CompactFlash Card - type 2
Microsoft eMbedded Visual C++ 3.0 --offers native code C++ compiler for
Windows mobile based developments
9
General Constraints
These are some general constraints imposed
before developing the aforementioned system.
End-user environment:
End use will have some editor in which the program will
be written and with the help of the compiler he/she will be able to compile his/her
programs.
10
Standards compliance:
Interface/protocol requirements:
11
Other means of addressing quality goals:
12
Development Methods
C ARM C ARM
C P
C P We don’t
want this
P
Compiler
C ARM C ARM
ARM
C
C ARM
P We want this
compiler which
can be ported to
the Pocket PC with
ActiveSync
For developing a compiler for the specified target program we have to mainly
manipulate the code gene ration part of two phase compiler, and according as the
instruction set of the processor we have to generate the assembly code. The
generated code of the compiler with the aforementioned technique can be ported
into the ROM of the Pocket PC.
13
Reusable software:
For the easiness and simplicity I have taken my own Compiler which was written
for the SIL language and the machine code was for the SIM machine in the starting.
But bootstrapping C source language compiler is required.
Intermediate
Code
Intermediate Code
Source
Front End Code
Program
Optimizer
Code
Be simple to check it easily like generator
SIL (SL) and C (IL)
Target Program
ARM Instructions Set
Implementation language
14
Interface Used:
Execution:
15
Architectural Strategies
16
System Architecture
First the initial environment is set up. Next the parseProgram method of C_Parser is
called which returns the root of the AST(Abstract Syntax tree) that was constructed
during this step.On the root node of the AST (an object of type CompilationUnitNode
), Main () invokes the typeCheck method. Each node propagates the typeCheck call
down the AST according to its own type checking logic. If no error occurred during
the type checking phase, Main () calls the translate method on the root node of the
AST which triggers the generation. Again, each node propagates the translate call
down the AST if required by its translation rules.
17
Language Processing System:
preprocessor
Source program
Compiler
Assembler
Loader/linker-editor
Library
,relocatable
object files
Absolute machine code
18
Main () C_Parser Compilation Unit
Node
execute
Parser
Source
and build
define initEnv Up AST
ParseProgram
create
type
Type Check
is propagated
down the
AST
translate
19
Imlementaion:
If we will use any IDE then there would be less effort required to
develop the concerned application. GCC compiler also gives some CPU settings
facilities for the ARM processors. We can check the developed system to correctly
know the design path of the system.
20
Conclusions:
21
References:
[1] AHO A.V. And R. Sethi[2003] “Compiler Principles, Techniques and Tools” Pearson
Education.
[2] Beck L. Leland. “System Software An introduction to System Programming” Pearson
Education Asia.
[3] Ian sommerville. “ Software Engineering “ Pearson Education.
[4] http://support.intel.com/design/Pentium4/components/
[5] http://www.codeproject.com/ce/
[6] http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/dnnetcomp/html/netcfppctoce.asp
22