public override Expression.EvalResult Run(MakeState s, List <Expression.EvalResult> passed_args) { var n = passed_args[0].strval; s.SetDefine(n, passed_args[1], true); all_defs[n] = passed_args[1]; return(passed_args[1]); }
public override Expression.EvalResult Execute(MakeState s) { Expression.EvalResult e = new Expression.EvalResult(val); s.SetDefine(tok_name, e, assignop); if (export) { ExportDef(tok_name, s); } return(new Expression.EvalResult(0)); }
internal static void ExportDef(string tag, MakeState s) { Expression.EvalResult e = s.GetDefine(tag); MakeState cur_s = s.parent; while (cur_s != null) { cur_s.SetDefine(tag, e); cur_s = cur_s.parent; } }
public override Expression.EvalResult Execute(MakeState s) { LabelExpression le = new LabelExpression { val = val }; Expression.EvalResult e = le.Evaluate(s); s.SetDefine(tok_name, e, assignop); if (export) { ExportDef(tok_name, s); } return(new Expression.EvalResult(0)); }
public void SetDefine(string tag, Expression.EvalResult e, bool export) { if (export == false) { SetLocalDefine(tag, e); } else { MakeState s = this; while (s != null) { s.SetDefine(tag, e); s = s.parent; } } }
public override Expression.EvalResult Execute(MakeState s) { if (s.IsDefined(v) == false) { throw new Exception("export: variable " + v + " is not defined in this scope"); } Expression.EvalResult e = s.GetDefine(v); s.SetDefine(v, e); MakeState cur_s = s.parent; while (cur_s != null) { cur_s.SetDefine(v, e); cur_s = cur_s.parent; } return(new Expression.EvalResult(0)); }