public override object VisitImplicitFunCallStmtNode(ImplicitFunCallStmtNode n) { Visit(n.name); TypeSymbol funType = null; string name = ""; if (n.name is IdenExprNode) { name = (n.name as IdenExprNode).Type.Name + n.funname; name = TypeSymbol.MakeFunctionName(name, n.args); funType = varTypes.IsInScope(name); } else { funType = n.name.Type; } semanticChecker.CheckAndReport(funType != null, n.sourceLoc, $"Undeclared Function {name}"); n.name.Type = funType; if (funType != null) { semanticChecker.CheckAndReport(n.args.Count <= funType.ParameterTypes.Count, n.sourceLoc, string.Format("Too many arguments ({0}) given, {1} expected", n.args.Count, funType.ParameterTypes.Count)); semanticChecker.CheckAndReport(n.args.Count >= funType.ParameterTypes.Count, n.sourceLoc, string.Format("Too few arguments ({0}) given, {1} expected", n.args.Count, funType.ParameterTypes.Count)); for (int i = 0; i < Math.Min(funType.ParameterTypes.Count, n.args.Count); i++) { Visit(n.args[i]); semanticChecker.CheckAndReport(funType.ParameterTypes[i].Match(n.args[i].Type), n.sourceLoc, "argument mismatch: " + (i + 1)); } } return(null); }
public object VisitImplicitFunCallStmtNode(ImplicitFunCallStmtNode n) { WriteLine(n.kind); Indent(); WriteLine(n.fullname + ":" + n.funsig.Name); foreach (Expression c in n.args) { Visit(c); } Dedent(); return(null); }
public override object VisitImplicitFunCallStmtNode(ImplicitFunCallStmtNode n) { Visit(n.name); foreach (Expression e in n.args) { Visit(e); } n.name.Type = DoInfer(n.name.Type, n.args); n.fullname = n.name.Type.Name + n.funname; n.funsig = varTypes.IsInScope(TypeSymbol.MakeFunctionName(n.fullname, n.args)); return(null); }
public override MIPSRegister VisitImplicitFunCallStmtNode(ImplicitFunCallStmtNode n) { return(base.VisitImplicitFunCallStmtNode(n)); }
public override LLVMRegister VisitImplicitFunCallStmtNode(ImplicitFunCallStmtNode n) { throw new NotImplementedException(); }
public override LData VisitImplicitFunCallStmtNode(ImplicitFunCallStmtNode n) { interp.CallFunction(TypeSymbol.MakeFunctionName(n.fullname, n.args), n.args.Select(e => Visit(e)).ToArray()); return(null); }
public virtual T VisitImplicitFunCallStmtNode(ImplicitFunCallStmtNode n) { VisitFunCallStmtNode(n); return(default(T)); }