Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser result #10

Open
alfred42 opened this issue May 22, 2013 · 4 comments
Open

Parser result #10

alfred42 opened this issue May 22, 2013 · 4 comments
Assignees
Labels

Comments

@alfred42
Copy link
Contributor

program
Statement*

Statement
{Statement*}
ifStatement
WhileStatement
DoWhileStatement
ForStatement
FieldDefineStatement
ArrayDefineStatement
AssignStatement
RestStatement

IfStatement
if(Expression) statement else statment

WhileStatment
while(Expression)statement

DoWhile
do Statment while(Expression)

ForStatement
for(Expression;Expression;Expression)Statement

FieldDefineStatement
Type Identify;

ArrayDefineStatement
Type Identify[];

AssignStatement
Identify=Expression;

Expression
(Expression)
Expression[Expression]
OPExpression
SingleOPExpression
ArrayGet
TrueExpression
FalseExpression
IdentifyExpression
ArrayExpression
IntValue
CharValue
LongValue
ParenthesesExpression

OPExpression
Expression op Expression

SingleOPExpression
op Expression

@ghost ghost assigned cntimothy May 22, 2013
@alfred42
Copy link
Contributor Author

Hi @cntimothy
I added two IO statments in AST

print
input

Detailed assemble code you can ask @cissy33 and BIG HUANG

@cntimothy
Copy link
Contributor

Hi @alfred42
I add SingleOPExpression in AST to represent expressions have only one CaoZuoShu and in this case I delete NotExpression because it is contained in SingleOPExpression.

@cntimothy
Copy link
Contributor

Hi, @alfred42 ,
In IfStatement, it should not be for(expression, expression, expression). The first part in bracket should be a statement. For Example "for (i = 0; i < 5; i++)". In this case, the third part is a SingleOPExpression. But in 'for(i = 0; i < 5; i = i + 2)' the third part is a statement. How could we do about it?

@cntimothy
Copy link
Contributor

Hi, @alfred42 ,
I delete assignment in FieldDefineStatement for it can be devide into FieldDefineStatement and AssignStatement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants