/// <summary> /// 変数宣言ノードの評価 /// </summary> /// <param name="node">変数宣言ノード</param> /// <returns>null</returns> public override object Visit(VarAssignNode node) { var val = Visit(node.Value); VariableStore.SetVar(node.VarName, val); return(null); //変数宣言ステートメントは不要なので捨てる }
public IValue VisitVarAssignNode(VarAssignNode node, Context context) { var name = node.Name; var value = TraverseTree(node.ValueNode, context); context.Symbols.SetVariable(name, value); return value; }
public abstract T Visit(VarAssignNode node);