@Override public SFunctionDefinitionAssistantTC createSFunctionDefinitionAssistant() { if (sfd == null) { sfd = new SFunctionDefinitionAssistantTC(this); } return sfd; }
private List<PDefinition> getParamDefs(AExplicitFunctionDefinition node) { SFunctionDefinitionAssistantTC funcAssistant = this.af.createSFunctionDefinitionAssistant(); List<List<PDefinition>> paramDefs = funcAssistant.getParamDefinitions(node, node.getType(), node.getParamPatternList(), node.getLocation()); List<PDefinition> paramDefFlattened = new LinkedList<PDefinition>(); for (List<PDefinition> list : paramDefs) { paramDefFlattened.addAll(list); } return paramDefFlattened; }
@Override public LexNameSet caseAExplicitFunctionDefinition(AExplicitFunctionDefinition node, FreeVarInfo info) throws AnalysisException { List<PDefinition> defs = new Vector<PDefinition>(); List<List<PDefinition>> paramDefinitionList = af.createSFunctionDefinitionAssistant(). getParamDefinitions(node, (AFunctionType) node.getType(), node.getParamPatternList(), node.getLocation()); for (List<PDefinition> list: paramDefinitionList) { defs.addAll(list); } FreeVarInfo local = info.set(new FlatEnvironment(af, defs, info.env)); LexNameSet names = node.getBody().apply(this, local); if (node.getPredef() != null) { names.addAll(node.getPredef().apply(this, local)); } if (node.getPostdef() != null) { names.addAll(node.getPostdef().apply(this, local)); } return names; }
List<List<PDefinition>> paramDefinitionList = question.assistantFactory.createSFunctionDefinitionAssistant().getParamDefinitions(node, (AFunctionType) node.getType(), node.getParamPatternList(), node.getLocation());