1
0

GOSUB実�

This commit is contained in:
otya128
2015-06-07 20:56:34 +09:00
parent 628b259caf
commit f7c4f06eae
6 changed files with 157 additions and 6 deletions

View File

@@ -23,6 +23,9 @@ enum NodeType
Goto,
If,
For,
Gosub,
Return,
End,
}
abstract class Node
{
@@ -245,3 +248,29 @@ class For : Statement
this.statements = statements;
}
}
class Gosub : Statement
{
wstring label;
this(wstring name)
{
this.type = NodeType.Gosub;
this.label = name;
}
}
class Return : Statement
{
Expression expression;
this(Expression expression)
{
this.type = NodeType.Return;
this.expression = expression;
}
}
class End : Statement
{
this()
{
this.type = NodeType.End;
}
}