gnnng / pascal Goto Github PK
View Code? Open in Web Editor NEWA naive pascal compiler written in C++, using flex/bison as front-end and llvm as the back-end
A naive pascal compiler written in C++, using flex/bison as front-end and llvm as the back-end
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.
Need to reimplement the function getValue
of CodeGenBlock, and check if a symbol has not been declared
Currently only support integer type
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: llvm/IR/Value.h: No such file or directory
#include "llvm/IR/Value.h"
^
compilation terminated.
makefile:27: recipe for target 'parser.o' failed
make: *** [parser.o] Error 1
How fix?
Two sets of error:
More subtypes in each set. E.g. syntax error and invalid type error are both compile errors
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.