Implementation of Lexical Analysis on Assignment Statements in C++ Programming Language

Authors

  • Zaw Lin Oo  Faculty of Information Science, University of Computer Studies, Taungoo, Pegu Regional Division, Myanmar
  • Mya Sandar Kyin  Faculty of Computer Science, University of Computer Studies, Taungoo, Pegu Regional Division, Myanmar

DOI:

https://doi.org//10.32628/IJSRSET207253

Keywords:

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

  1. P.M. LEWISII, D.J. ROSENKRANTZ, R.E. STEARNS, ”Compiler Design Theory”, Third Printing, November 1978, ISBN 0-201-14455-7
  2. ROBIN HUNTER, “The Essence of Compilers”, First published In ISBN 0-13-727835-7
  3. NWE NWE THANT, “Implementing Syntax Analyzer for Compiler Process”, 2009
  4. Maggie Johnson and Julie Zelenski, “Lexical Analysis”, Printed in 2008
  5. Myo Myint Oo, “Implementation of Lexical Analysis on Declaration Statements in C++ Programming Language”, 2011
  6. https://www.tutorialspoint.com/compiler_design/compiler_design_phases_of_compiler.htm\
  7. https://en.wikipedia.org/wiki/Compiler

Downloads

Published

2020-04-30

Issue

Section

Research Articles

How to Cite

[1]
Zaw Lin Oo, Mya Sandar Kyin, " Implementation of Lexical Analysis on Assignment Statements in C++ Programming Language, International Journal of Scientific Research in Science, Engineering and Technology(IJSRSET), Print ISSN : 2395-1990, Online ISSN : 2394-4099, Volume 7, Issue 2, pp.269-273, March-April-2020. Available at doi : https://doi.org/10.32628/IJSRSET207253