Giter Club home page Giter Club logo

compiler's Introduction

Pascal Compiler

注意:该实现版本一次只判一个错

/**********文法产生式如下**********
A:程序				A->B
B:分程序			B->begin C;M end
C:说明与句表		C->DC'
C'->;DC'|ε
D:说明语句			D->E|J
E:变量说明			E->integer F
F:变量				F->G
G:标识符			G->HG'
G'->HG'|IG'|ε
H:字母				H->a|...|z|A|...|Z
I:数字				I->0|1|...|9
J:函数说明			J->integer function G(K);L
K:参数				K->F
L:函数体			L->begin C;M end
M:执行语句表		M->NM'
M'->;NM'|ε
N:执行语句			N->O|P|Q|W
O:读语句			O->read(F)
P:写语句			P->write(F)
Q:赋值语句			Q->F:=R
R:算术表达式		R->SR'
R'->-SR'|ε
S:项				S->TS'
S'->*TS'|ε
T:因子				T->F|U|Z
U:常数				U->V
V:无符号整数		V->IV'
V'->IV'|ε
W:条件语句			W->if X then N else N
X:条件表达式		X->RYR
Y:关系运算符		Y-><|<=|>|>=|=|<>
Z:函数调用			Z->G(R)
**********************************/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.