An Overview of Compiler Construction
An Overview of Compiler Construction
net/publication/351762702
CITATIONS READS
3 5,649
5 authors, including:
All content following this page was uploaded by Bashir Salisu Abubakar on 21 May 2021.
1. INTRODUCTION
© 2021, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page 587
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 08 Issue: 03 | Mar 2021 www.irjet.net p-ISSN: 2395-0072
SYNTAX ANALYSIS
The next stage immediately after the scanner is the syntax
stage. This stage is also known as parsing [6]. The parsing
stage takes a token produced in the first phase and
constructs a syntax tree (parse tree). The goal of parsing is
to determine the syntactical validity of a source string.
© 2021, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page 588
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 08 Issue: 03 | Mar 2021 www.irjet.net p-ISSN: 2395-0072
CODE GENERATOR
Code generator is the last phase of a compiler construction
process. The code generator uses the optimized
representation of the intermediate code to generate a naïve
machine code. This stage depend on the machine
architecture.
3. CONCLUSIONS
Parse tree as an output of Parser This paper explains what a compiler is and gives an
overview of the steps involved in translating a programing
language into object code. A compiler translate source code
into object without tempering with the meaning of the
source code. The steps involved in translating a language are
six namely; lexical, syntax, semantic, intermediate
representation, code optimizer and code generator. Each of
this phases perform a single task.
REFERENCES
[2]. Guilan, D., Suqing, Z., Jinlan, T., & Weidu, J. (2002). A
study of compiler techniques for multiple targets in
compiler infrastructures. ACM SIGPLAN Notices, 37(6),
45. doi:10.1145/571727.571735
Fig 4: parse information flow
SEMANTIC ANALYSIS [3]. Jatin Chhabra, Hiteshi Chopra, Abhimanyu Vats (2014).
Research paper on Compiler Design. International Journal
This is the third stage in a compiler construction. Semantic
of Innovative Research in Technology (IJIRT), Volume 1,
analysis check for semantic errors in the parse tree
Issue 5
produced by the syntax analyzer [6]. Examples of semantic
errors are data compatibility (data type), undeclared
[4]. Zelkowitz, M. V. (1975). Third generation compiler
variable use and many more.
design. Proceedings of the 1975 Annual Conference on -
ACM 75. doi:10.1145/800181.810332
INTERMEDIATE CODE GENERATOR
In this phase, an intermediate code of the machine-oriented
is generated. It represents a program for some abstract [5]. Rudmik, A., & Lee, E. S. (1979). Compiler design for
machine [6]. The intermediate code is between a program efficient code generation and program optimization.
written in human-oriented and machine-oriented. Proceedings of the 1979 SIGPLAN Symposium on Compiler
Construction - SIGPLAN
’79. doi:10.1145/800229.806962
© 2021, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page 589
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 08 Issue: 03 | Mar 2021 www.irjet.net p-ISSN: 2395-0072
[6]. Grune, D., van Reeuwijk, K., Bal, H. E., Jacobs, C. J. H.,
& Langendoen, K. (2012). Modern Compiler
Design. doi:10.1007/978-1-4614-4699-6
[11]. Li, H., Hu, C., Zhang, P., & Xie, L. (2016). Modular
SDN Compiler Design with Intermediate
Representation. Proceedings of the 2016 Conference
on ACM SIGCOMM 2016 Conference - SIGCOMM
’16. doi:10.1145/2934872.2959061
© 2021, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page 590