public override void EnterFunction_dec(langParser.Function_decContext context) { List <string> c = new List <string>(); foreach (var id in context.Id()) { c.Add(id.GetText()); } var func = new BaseFunction(this.current_space, c.ToArray()); this.level_of_space.Push(func); }
public override void ExitFunction_dec(langParser.Function_decContext context) { var function = (BaseFunction)this.level_of_space.Pop(); if (context.Parent is langParser.Function_callContext) { ((langParser.Function_callContext)context.Parent).fn = function; } else { this.current_space.add_instruction(new Load(this.current_space, function)); } }