1
0

IFの構文解析

This commit is contained in:
otya128
2015-06-06 17:11:02 +09:00
parent 2eaab2ef55
commit 5cab924046
6 changed files with 160 additions and 10 deletions

View File

@@ -20,6 +20,7 @@ enum NodeType
Print,
Label,
Goto,
If,
}
abstract class Node
{
@@ -191,3 +192,16 @@ class Goto : Statement
this.label = name;
}
}
class If : Statement
{
Expression condition;
Statements then;
Statements else_;
this(Expression condition, Statements t, Statements e)
{
this.type = NodeType.If;
this.condition = condition;
this.then = t;
this.else_ = e;
}
}