The Development of Lexer and Parser as Parts of Compiler for GAMA32 Processor’s Instruction-set using Python

2019 
At this time, there are many products based on embedded systems, each of these products requires an embedded processor. This results in high demand for embedded processors. Therefore, we need a tool that is able to design an embedded processor completely with its software development tool. One of the embedded processor that is developed is GAMA32 processor. GAMA32 processor is a 32-bit embedded processor designed using System C Model. Its processor architecture is General Purpose Processor (GPP). GAMA32 processor has its own software development tool, but it has no compiler. The most common used compiler is open source compiler like GNU Compiler Collection (GCC) and Low Level Virtual Machine (LLVM). However, this two open source compilers are not compatible with GAMA32 processor because their complexity. In this research, a simple and flexible compiler will be developed, especially the Abstract Syntax Tree (AST) generator part using Python library rPLY and the AST’s output is in the format of JavaScript Object Notation (JSON). For testing the result of AST generator, 5 statement patterns are used namely if, if-else, while, do-while, and for patterns with initial value, and data type declaration as well. The test results show that the correct AST can be produced from the patterns used.
    • Correction
    • Source
    • Cite
    • Save
    • Machine Reading By IdeaReader
    4
    References
    0
    Citations
    NaN
    KQI
    []