IFの構文解析
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user