@Override public PType defaultPRelation(PRelation node, TypeCheckInfo question) throws AnalysisException { return node.apply(tcDefinition, question); }
private AExplicitFunctionDefinition getRelDef(PRelation node, ATypeDefinition typedef, ILexNameToken fname) { ILexLocation loc = node.getLhsPattern().getLocation(); List<PPattern> params = new Vector<PPattern>(); params.add(node.getLhsPattern().clone()); params.add(node.getRhsPattern().clone()); List<List<PPattern>> parameters = new Vector<List<PPattern>>(); parameters.add(params); PTypeList ptypes = getPTypes(typedef); AFunctionType ftype = AstFactory.newAFunctionType(loc, false, ptypes, AstFactory.newABooleanBasicType(loc)); AExplicitFunctionDefinition def = AstFactory.newAExplicitFunctionDefinition(fname, NameScope.GLOBAL, null, ftype, parameters, node.getRelExp(), null, null, false, null); def.setAccess(typedef.getAccess().clone()); // Same as type's def.setClassDefinition(typedef.getClassDefinition()); return def; }