1
0

関数呼び出しの実�

This commit is contained in:
otya128
2015-06-03 21:52:09 +09:00
parent 9ed79ef448
commit 421f90d717
4 changed files with 100 additions and 3 deletions

View File

@@ -1,12 +1,17 @@
module otya.smilebasic.node;
import otya.smilebasic.type;
import otya.smilebasic.token;
import std.container;
enum NodeType
{
Node,
Expression,
Constant,
BinaryOperator,
Variable,
CallFunction,
VoidExpression,
}
abstract class Node
{
@@ -49,3 +54,34 @@ class BinaryOperator : Expression
this.item2 = i2;
}
}
class Variable : Expression
{
wstring name;
this(wstring n)
{
this.type = NodeType.Variable;
this.name = n;
}
}
class CallFunction : Expression
{
wstring name;
Expression[] args;
this(wstring n)
{
this.type = NodeType.CallFunction;
this.name = n;
args = new Expression[0];
}
void addArg(Expression arg)
{
args ~= arg;
}
}
class VoidExpression : Expression
{
this()
{
this.type = NodeType.VoidExpression;
}
}