示例#1
0
        /// <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);    //変数宣言ステートメントは不要なので捨てる
        }
示例#2
0
 public IValue VisitVarAssignNode(VarAssignNode node, Context context)
 {
     var name = node.Name;
     var value = TraverseTree(node.ValueNode, context);
     context.Symbols.SetVariable(name, value);
     return value;
 }
示例#3
0
 public abstract T Visit(VarAssignNode node);