├── LICENSE ├── README.md ├── astnode.cpp ├── astnode.h ├── c_ebnf ├── c_parser.cpp ├── doc ├── doxyfile └── makefile ├── e1 ├── e2 ├── e3 ├── e4 ├── env.cpp ├── env.h ├── if1 ├── if2 ├── if3 ├── lexer.cpp ├── lexer.h ├── makefile ├── mytype.h ├── op.cpp ├── op.h ├── parser.cpp ├── parser.h ├── parser_4op.cpp ├── t.sh ├── test_pattern ├── f1 ├── fc1 ├── fc2 ├── fc3 ├── p1 ├── p2 ├── p3 ├── p5 ├── p6.c └── recursive_1 ├── token.cpp ├── token.h ├── var_dec1 └── var_dec2 /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/descent/simple_compiler/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/descent/simple_compiler/HEAD/README.md -------------------------------------------------------------------------------- /astnode.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/descent/simple_compiler/HEAD/astnode.cpp -------------------------------------------------------------------------------- /astnode.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/descent/simple_compiler/HEAD/astnode.h -------------------------------------------------------------------------------- /c_ebnf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/descent/simple_compiler/HEAD/c_ebnf -------------------------------------------------------------------------------- /c_parser.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/descent/simple_compiler/HEAD/c_parser.cpp -------------------------------------------------------------------------------- /doc/doxyfile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/descent/simple_compiler/HEAD/doc/doxyfile -------------------------------------------------------------------------------- /doc/makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/descent/simple_compiler/HEAD/doc/makefile -------------------------------------------------------------------------------- /e1: -------------------------------------------------------------------------------- 1 | 1+2 2 | -------------------------------------------------------------------------------- /e2: -------------------------------------------------------------------------------- 1 | 5*6 2 | -------------------------------------------------------------------------------- /e3: -------------------------------------------------------------------------------- 1 | 1+2*3 2 | -------------------------------------------------------------------------------- /e4: -------------------------------------------------------------------------------- 1 | (1+2)*3 2 | -------------------------------------------------------------------------------- /env.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/descent/simple_compiler/HEAD/env.cpp -------------------------------------------------------------------------------- /env.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/descent/simple_compiler/HEAD/env.h -------------------------------------------------------------------------------- /if1: -------------------------------------------------------------------------------- 1 | 2 | if (x>2) 3 | { 4 | 1+2; 5 | 8*3; 6 | } 7 | 8 | -------------------------------------------------------------------------------- /if2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/descent/simple_compiler/HEAD/if2 -------------------------------------------------------------------------------- /if3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/descent/simple_compiler/HEAD/if3 -------------------------------------------------------------------------------- /lexer.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/descent/simple_compiler/HEAD/lexer.cpp -------------------------------------------------------------------------------- /lexer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/descent/simple_compiler/HEAD/lexer.h -------------------------------------------------------------------------------- /makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/descent/simple_compiler/HEAD/makefile -------------------------------------------------------------------------------- /mytype.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/descent/simple_compiler/HEAD/mytype.h -------------------------------------------------------------------------------- /op.cpp: -------------------------------------------------------------------------------- 1 | #include "op.h" 2 | -------------------------------------------------------------------------------- /op.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/descent/simple_compiler/HEAD/op.h -------------------------------------------------------------------------------- /parser.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/descent/simple_compiler/HEAD/parser.cpp -------------------------------------------------------------------------------- /parser.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/descent/simple_compiler/HEAD/parser.h -------------------------------------------------------------------------------- /parser_4op.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/descent/simple_compiler/HEAD/parser_4op.cpp -------------------------------------------------------------------------------- /t.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/descent/simple_compiler/HEAD/t.sh -------------------------------------------------------------------------------- /test_pattern/f1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/descent/simple_compiler/HEAD/test_pattern/f1 -------------------------------------------------------------------------------- /test_pattern/fc1: -------------------------------------------------------------------------------- 1 | f1(1) 2 | -------------------------------------------------------------------------------- /test_pattern/fc2: -------------------------------------------------------------------------------- 1 | f1(1, 2, x+y, "abc", 1+2*3) 2 | -------------------------------------------------------------------------------- /test_pattern/fc3: -------------------------------------------------------------------------------- 1 | f1() 2 | -------------------------------------------------------------------------------- /test_pattern/p1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/descent/simple_compiler/HEAD/test_pattern/p1 -------------------------------------------------------------------------------- /test_pattern/p2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/descent/simple_compiler/HEAD/test_pattern/p2 -------------------------------------------------------------------------------- /test_pattern/p3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/descent/simple_compiler/HEAD/test_pattern/p3 -------------------------------------------------------------------------------- /test_pattern/p5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/descent/simple_compiler/HEAD/test_pattern/p5 -------------------------------------------------------------------------------- /test_pattern/p6.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/descent/simple_compiler/HEAD/test_pattern/p6.c -------------------------------------------------------------------------------- /test_pattern/recursive_1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/descent/simple_compiler/HEAD/test_pattern/recursive_1 -------------------------------------------------------------------------------- /token.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/descent/simple_compiler/HEAD/token.cpp -------------------------------------------------------------------------------- /token.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/descent/simple_compiler/HEAD/token.h -------------------------------------------------------------------------------- /var_dec1: -------------------------------------------------------------------------------- 1 | int i; 2 | -------------------------------------------------------------------------------- /var_dec2: -------------------------------------------------------------------------------- 1 | int i, j; 2 | char x, y; 3 | --------------------------------------------------------------------------------