public override void ExitFunction_call(langParser.Function_callContext context) { if (context.Id() != null) { this.current_space.add_instruction(new Load_Var(this.current_space, context.Id().GetText())); } else if (context.function_dec() != null) { this.current_space.add_instruction(new Load(this.current_space, context.fn)); } else if (context.member_function() != null) { if (context.member_function().idx != null) { this.current_space.add_instruction(new Load_Var(this.current_space, context.member_function().idx.Text)); this.current_space.add_instruction(new Load(this.current_space, new String(context.member_function().member_name.Text))); this.current_space.add_instruction(new MemberAccess(this.current_space)); } else if (context.member_function().hash() != null) { this.current_space.add_instruction(new Load( (Load)this.current_space.get_instruction(context.member_function().begin) )); this.current_space.add_instruction(new Load(this.current_space, new String(context.member_function().member_name.Text))); this.current_space.add_instruction(new MemberAccess(this.current_space)); } } this.current_space.add_instruction(new FunctionCall(this.current_space, context.expression().Length + (context.member_function() != null ? 1 : 0))); }
public override void EnterFunction_call(langParser.Function_callContext context) { }