Implementation of Lexical Analysis on Assignment Statements in C++ Programming Language
DOI:
https://doi.org/10.32628/IJSRSET207253Keywords:
Learn C++ syntax, Compiling Technique, Compiler Design Theory, Tokenization in NLP, Lexical Analysis on C++Abstract
A compiler is a computer program that translates computer code written in one programming language (the source language) into another language (the target language). The name compiler is primarily used for programs that translate source code from a high-level programming language to a lower level language [7]. The three main processes of compilation are lexical analysis, syntax analysis and semantic analysis. A compiler has two components, front-end and back-end. Front-end portion of a compiler has to do to main tasks lexical analysis and syntax analysis. On the lexical analysis, input source code are scanned and tokenized into various tokens [6]. In the system, front-end portion of the compiler, lexical analysis is used. There are many token elements in C++ programming language. In this system, line break token, white space tokens (space and tab) and operators (+,-,*,/,=,+= and so on) are used as token elements for the assignment statements of C++ source program. This system is taken all the assignment statements of C++ program as input. Of course, the extracted assignment statements may be literals or values assignment statement (e.g. x=3; or pi= 3.142;), variable assignment statement (e.g. x=y; or x=z;) and expression assignment statement (e.g. a=b+c; or x=y*z; or a=b*(c+d); and produced symbol table, step by step recognized table by using finite state automata and lexeme table.
References
- P.M. LEWISII, D.J. ROSENKRANTZ, R.E. STEARNS, ”Compiler Design Theory”, Third Printing, November 1978, ISBN 0-201-14455-7
- ROBIN HUNTER, “The Essence of Compilers”, First published In ISBN 0-13-727835-7
- NWE NWE THANT, “Implementing Syntax Analyzer for Compiler Process”, 2009
- Maggie Johnson and Julie Zelenski, “Lexical Analysis”, Printed in 2008
- Myo Myint Oo, “Implementation of Lexical Analysis on Declaration Statements in C++ Programming Language”, 2011
- https://www.tutorialspoint.com/compiler_design/compiler_design_phases_of_compiler.htm\
- https://en.wikipedia.org/wiki/Compiler
Downloads
Published
Issue
Section
License
Copyright (c) IJSRSET

This work is licensed under a Creative Commons Attribution 4.0 International License.