public PType seqApply(AApplyObjectDesignator node, SSeqType seq, Environment env, NameScope scope, boolean unique, IQuestionAnswer<TypeCheckInfo, PType> rootVisitor, TypeCheckInfo question) throws AnalysisException { if (node.getArgs().size() != 1) { TypeCheckerErrors.concern(unique, 3252, "Sequence application must have one argument", node.getLocation(), node); return AstFactory.newAUnknownType(node.getLocation()); } PType argtype = node.getArgs().get(0).apply(rootVisitor, new TypeCheckInfo(question.assistantFactory, env, scope)); if (!env.af.createPTypeAssistant().isNumeric(argtype)) { TypeCheckerErrors.concern(unique, 3253, "Sequence argument is not numeric", node.getLocation(), node); TypeCheckerErrors.detail(unique, "Type", argtype); } return seq.getSeqof(); }
public PType mapApply(AApplyObjectDesignator node, SMapType map, Environment env, NameScope scope, boolean unique, IQuestionAnswer<TypeCheckInfo, PType> rootVisitor) throws AnalysisException { if (node.getArgs().size() != 1) { TypeCheckerErrors.concern(unique, 3250, "Map application must have one argument", node.getLocation(), node); return AstFactory.newAUnknownType(node.getLocation()); } PType argtype = node.getArgs().get(0).apply(rootVisitor, new TypeCheckInfo(env.af, env, scope)); if (!env.af.getTypeComparator().compatible(map.getFrom(), argtype)) { TypeCheckerErrors.concern(unique, 3251, "Map application argument is incompatible type", node.getLocation(), node); TypeCheckerErrors.detail2(unique, "Map domain", map.getFrom(), "Argument", argtype); } return map.getTo(); }
TypeCheckerErrors.concern(unique, 3257, "Too many arguments", node.getLocation(), node); TypeCheckerErrors.detail2(unique, "Args", node.getArgs(), "Params", ptypes); return optype.getResult(); } else if (node.getArgs().size() < ptypes.size()) TypeCheckerErrors.concern(unique, 3258, "Too few arguments", node.getLocation(), node); TypeCheckerErrors.detail2(unique, "Args", node.getArgs(), "Params", ptypes); return optype.getResult(); + i, node.getLocation(), node); TypeCheckerErrors.detail2(unique, "Expect", pt, "Actual", at);
TypeCheckerErrors.concern(unique, 3254, "Too many arguments", node.getLocation(), node); TypeCheckerErrors.detail2(unique, "Args", node.getArgs(), "Params", ptypes); return ftype.getResult(); } else if (node.getArgs().size() < ptypes.size()) TypeCheckerErrors.concern(unique, 3255, "Too few arguments", node.getLocation(), node); TypeCheckerErrors.detail2(unique, "Args", node.getArgs(), "Params", ptypes); return ftype.getResult(); + i, node.getLocation(), node); TypeCheckerErrors.detail2(unique, "Expect", pt, "Actual", at);
VdmRuntimeError.abort(node.getLocation(), 4042, "Sequence does not contain key: " + a, ctxt); return fv.eval(node.getLocation(), argvals, ctxt); } else if (v instanceof OperationValue) return ov.eval(node.getLocation(), argvals, ctxt); } else return VdmRuntimeError.abort(node.getLocation(), 4043, "Object designator is not a map, sequence, operation or function", ctxt); return VdmRuntimeError.abort(node.getLocation(), e);
TypeCheckerErrors.report(3249, "Object designator is not a map, sequence, function or operation", node.getLocation(), node); TypeCheckerErrors.detail2("Designator", node.getObject(), "Type", type); return AstFactory.newAUnknownType(node.getLocation()); return result.getType(node.getLocation());