├── .gitignore ├── README.md ├── images ├── asm.png ├── c.png └── python.png ├── lib ├── Makefile └── lib418.c ├── sample ├── calculator.418 ├── compare_2_numbers.418 ├── factorial.418 ├── hello_world.418 └── swap_variables.418 ├── src ├── Main.py ├── Parser.py ├── Tokenizer.py ├── __init__.py ├── compilers │ ├── AssemblyCompiler.py │ ├── CCompiler.py │ ├── Compiler.py │ └── PythonInterpreter.py └── nodes │ ├── Addition.py │ ├── ArithmeticExpression.py │ ├── Assignment.py │ ├── Comment.py │ ├── CompoundStatement.py │ ├── Condition.py │ ├── Conditional.py │ ├── Division.py │ ├── EqualTo.py │ ├── Expression.py │ ├── GreaterOrEqualTo.py │ ├── GreaterThan.py │ ├── LessOrEqualTo.py │ ├── LessThan.py │ ├── Loop.py │ ├── Modulus.py │ ├── Multiplication.py │ ├── NotEqualTo.py │ ├── Number.py │ ├── Read.py │ ├── Statement.py │ ├── String.py │ ├── Subtraction.py │ ├── Value.py │ ├── VarDeclare.py │ ├── Variable.py │ ├── WriteString.py │ ├── WriteValue.py │ └── __init__.py └── syntax ├── 418.md └── EBNF.txt /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | *.pyc 3 | lib/lib418.o 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/README.md -------------------------------------------------------------------------------- /images/asm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/images/asm.png -------------------------------------------------------------------------------- /images/c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/images/c.png -------------------------------------------------------------------------------- /images/python.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/images/python.png -------------------------------------------------------------------------------- /lib/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/lib/Makefile -------------------------------------------------------------------------------- /lib/lib418.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/lib/lib418.c -------------------------------------------------------------------------------- /sample/calculator.418: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/sample/calculator.418 -------------------------------------------------------------------------------- /sample/compare_2_numbers.418: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/sample/compare_2_numbers.418 -------------------------------------------------------------------------------- /sample/factorial.418: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/sample/factorial.418 -------------------------------------------------------------------------------- /sample/hello_world.418: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/sample/hello_world.418 -------------------------------------------------------------------------------- /sample/swap_variables.418: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/sample/swap_variables.418 -------------------------------------------------------------------------------- /src/Main.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/src/Main.py -------------------------------------------------------------------------------- /src/Parser.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/src/Parser.py -------------------------------------------------------------------------------- /src/Tokenizer.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/src/Tokenizer.py -------------------------------------------------------------------------------- /src/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/compilers/AssemblyCompiler.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/src/compilers/AssemblyCompiler.py -------------------------------------------------------------------------------- /src/compilers/CCompiler.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/src/compilers/CCompiler.py -------------------------------------------------------------------------------- /src/compilers/Compiler.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/src/compilers/Compiler.py -------------------------------------------------------------------------------- /src/compilers/PythonInterpreter.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/src/compilers/PythonInterpreter.py -------------------------------------------------------------------------------- /src/nodes/Addition.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/src/nodes/Addition.py -------------------------------------------------------------------------------- /src/nodes/ArithmeticExpression.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/src/nodes/ArithmeticExpression.py -------------------------------------------------------------------------------- /src/nodes/Assignment.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/src/nodes/Assignment.py -------------------------------------------------------------------------------- /src/nodes/Comment.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/src/nodes/Comment.py -------------------------------------------------------------------------------- /src/nodes/CompoundStatement.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/src/nodes/CompoundStatement.py -------------------------------------------------------------------------------- /src/nodes/Condition.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/src/nodes/Condition.py -------------------------------------------------------------------------------- /src/nodes/Conditional.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/src/nodes/Conditional.py -------------------------------------------------------------------------------- /src/nodes/Division.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/src/nodes/Division.py -------------------------------------------------------------------------------- /src/nodes/EqualTo.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/src/nodes/EqualTo.py -------------------------------------------------------------------------------- /src/nodes/Expression.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/src/nodes/Expression.py -------------------------------------------------------------------------------- /src/nodes/GreaterOrEqualTo.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/src/nodes/GreaterOrEqualTo.py -------------------------------------------------------------------------------- /src/nodes/GreaterThan.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/src/nodes/GreaterThan.py -------------------------------------------------------------------------------- /src/nodes/LessOrEqualTo.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/src/nodes/LessOrEqualTo.py -------------------------------------------------------------------------------- /src/nodes/LessThan.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/src/nodes/LessThan.py -------------------------------------------------------------------------------- /src/nodes/Loop.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/src/nodes/Loop.py -------------------------------------------------------------------------------- /src/nodes/Modulus.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/src/nodes/Modulus.py -------------------------------------------------------------------------------- /src/nodes/Multiplication.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/src/nodes/Multiplication.py -------------------------------------------------------------------------------- /src/nodes/NotEqualTo.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/src/nodes/NotEqualTo.py -------------------------------------------------------------------------------- /src/nodes/Number.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/src/nodes/Number.py -------------------------------------------------------------------------------- /src/nodes/Read.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/src/nodes/Read.py -------------------------------------------------------------------------------- /src/nodes/Statement.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/src/nodes/Statement.py -------------------------------------------------------------------------------- /src/nodes/String.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/src/nodes/String.py -------------------------------------------------------------------------------- /src/nodes/Subtraction.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/src/nodes/Subtraction.py -------------------------------------------------------------------------------- /src/nodes/Value.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/src/nodes/Value.py -------------------------------------------------------------------------------- /src/nodes/VarDeclare.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/src/nodes/VarDeclare.py -------------------------------------------------------------------------------- /src/nodes/Variable.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/src/nodes/Variable.py -------------------------------------------------------------------------------- /src/nodes/WriteString.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/src/nodes/WriteString.py -------------------------------------------------------------------------------- /src/nodes/WriteValue.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/src/nodes/WriteValue.py -------------------------------------------------------------------------------- /src/nodes/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/src/nodes/__init__.py -------------------------------------------------------------------------------- /syntax/418.md: -------------------------------------------------------------------------------- 1 | # EBNF 2 | -------------------------------------------------------------------------------- /syntax/EBNF.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAsEnd/418-compiler/HEAD/syntax/EBNF.txt --------------------------------------------------------------------------------