Refactor code

Change mpc.py to auto generate antlr4 files without having to run manualy. Also add a small command line ultility.
Remove commented import in others files, and update README
This commit is contained in:
Nguyễn Anh Khoa
2018-12-18 01:06:36 +07:00
parent d33f3a54ba
commit d6be336a0c
7 changed files with 136 additions and 110 deletions

View File

@ -2,46 +2,23 @@ from utils.Utils import Utils
from utils.Visitor import BaseVisitor
from checker.StaticCheck import MType, Symbol
from utils.AST import (
# Type,
IntType,
FloatType,
BoolType,
StringType,
# ArrayType,
VoidType,
# Program,
# Decl,
# VarDecl,
FuncDecl,
# Stmt,
Assign,
# If,
While,
# For,
# Break,
# Continue,
# Return,
# With,
# CallStmt,
# Expr,
BinaryOp,
# UnaryOp,
# CallExpr,
# LHS,
Id,
# ArrayCell,
# Literal,
IntLiteral,
# FloatLiteral,
# StringLiteral,
# BooleanLiteral,
ArrayPointerType,
ClassType
)
from codegen.Emitter import Emitter
from codegen.Frame import Frame
from abc import ABC # , abstractmethod
# from functools import reduce
from abc import ABC
class CodeGenerator(Utils):