项目作者: dhpaulino

项目描述 :
A really simple compiler for a really simple language
高级语言: C
项目地址: git://github.com/dhpaulino/littlecompiler.git
创建时间: 2018-08-20T01:30:18Z
项目社区:https://github.com/dhpaulino/littlecompiler

开源协议:

下载


littlecompiler

A really simple compiler for a really simple language

Symbols

  • identifiers: for the names of the variables
    • a string beginning with a letter, it may contein letters, digits and the caracter “_”.
  • intergers:
    • a string with only digits.
  • let: word reserved to assignment
    • the string “let”.
  • print: word reserved to print
    • the string “print”.
  • add: word reserved to addition
    • string “add”.
  • assignment:
    • the caracter “=”.
  • addition:
    • o caracter “+”.

Exemple:

Input

  1. let a = 2
  2. add b + 4
  3. print a
  4. print b

Output

  1. 2
  2. 4

Dependencies

  • Flex
  • Make
  • GCC

Running

  1. make
  2. ./compiler < inputfile