関数呼び出しの実�
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user