Pascal
Pascal copied to clipboard
A naive pascal compiler written in C++, using flex/bison as front-end and llvm as the back-end
$ make ---------- ``` g++ -c `/usr/local/opt/llvm35/bin/llvm-config-3.5 --cppflags` -std=c++11 -Wno-return-type -Wno-c++11-compat-deprecated-writable-strings -Wno-deprecated-register -Wno-switch -g -o parser.o parser.cpp /bin/sh: 1: /usr/local/opt/llvm35/bin/llvm-config-3.5: not found In file included from pascal.y:7:0: ast.h:4:27: fatal error:...
``` pascal program llvm; var a, b, c: integer; a, b, c: integer; ... ``` Codes like this will pass the check, `a,b,c` should not be allowed to declared again....
1. const_value (real, char, boolean) 2. array_type_decl 3. record_type_decl
Two sets of error: 1. compile error 2. running error More subtypes in each set. E.g. syntax error and invalid type error are both compile errors