public static PType deBracket(PType other) { while (other instanceof ABracketType) { other = ((ABracketType) other).getType(); } return other; }
public static ABracketType newABracketType(ILexLocation location, PType type) { ABracketType result = new ABracketType(); initType(result, location); result.setType(type); return result; }
@Override public void caseABracketType(ABracketType type) throws AnalysisException { if (!type.getResolved()) { return; } else { type.setResolved(false); } type.apply(THIS); }
/** * Called by the {@link ABracketType} node from {@link ABracketType#apply(IPOFAnalysis)}. * @param node the calling {@link ABracketType} node */ public void caseABracketType(ABracketType node) throws AnalysisException { _visitedNodes.add(node); inABracketType(node); { List<PDefinition> copy = new ArrayList<PDefinition>(node.getDefinitions()); for( PDefinition e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } outABracketType(node); }
@Override public PType caseABracketType(ABracketType type, Newquestion question) throws AnalysisException { if (type.getResolved()) { return type; } else { type.setResolved(true); } PType tmp = type; try { do { tmp = af.createPTypeAssistant().typeResolve(((ABracketType)tmp).getType(), question.root, question.rootVisitor, question.question); } while (tmp instanceof ABracketType); tmp = af.createPTypeAssistant().typeResolve(tmp, question.root, question.rootVisitor, question.question); tmp.parent(type.parent());// re-link tree after bracket removal return tmp; } catch (TypeCheckException e) { af.createPTypeAssistant().unResolve(type); throw e; } }
/** * Returns a deep clone of this {@link ABracketType} node. * @return a deep clone of this {@link ABracketType} node */ public ABracketType clone() { return new ABracketType( _location, _resolved, _definitions, _type ); }
/** * Called by the {@link ABracketType} node from {@link ABracketType#apply(IAnalysis)}. * @param node the calling {@link ABracketType} node */ public void caseABracketType(ABracketType node) throws AnalysisException { _visitedNodes.add(node); inABracketType(node); { List<PDefinition> copy = new ArrayList<PDefinition>(node.getDefinitions()); for( PDefinition e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } outABracketType(node); }
/** * Creates a deep clone of this {@link ABracketType} node while putting all * old node-new node relations in the map {@code oldToNewMap}. * @param oldToNewMap the map filled with the old node-new node relation * @return a deep clone of this {@link ABracketType} node */ public ABracketType clone(Map<INode,INode> oldToNewMap) { ABracketType node = new ABracketType( _location, _resolved, _definitions, _type ); oldToNewMap.put(this, node); return node; }
@Override public String caseABracketType(ABracketType type) throws AnalysisException { return "(" + type.getType() + ")"; }
/** * Called by the {@link ABracketType} node from {@link ABracketType#apply(IAnalysis)}. * @param node the calling {@link ABracketType} node */ public void caseABracketType(ABracketType node, Q question) throws AnalysisException { _visitedNodes.add(node); inABracketType(node, question); { List<PDefinition> copy = new ArrayList<PDefinition>(node.getDefinitions()); for( PDefinition e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this, question); } } } if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this, question); } outABracketType(node, question); }
public PType deBracket(PType other) { while (other instanceof ABracketType) { other = ((ABracketType) other).getType(); } return other; }
/** * Called by the {@link ABracketType} node from {@link ABracketType#apply(IAnalysis)}. * @param node the calling {@link ABracketType} node */ public A caseABracketType(ABracketType node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inABracketType(node)); { List<PDefinition> copy = new ArrayList<PDefinition>(node.getDefinitions()); for( PDefinition e : copy) { if(!_visitedNodes.contains(e)) { mergeReturns(retVal,e.apply(this)); } } } if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this)); } mergeReturns(retVal,outABracketType(node)); return retVal; }
public Object deBracket(Object other) { while (other instanceof ABracketType) { other = ((ABracketType) other).getType(); } return other; }
/** * Called by the {@link ABracketType} node from {@link ABracketType#apply(IAnalysis)}. * @param node the calling {@link ABracketType} node */ public A caseABracketType(ABracketType node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inABracketType(node, question)); { List<PDefinition> copy = new ArrayList<PDefinition>(node.getDefinitions()); for( PDefinition e : copy) { if(!_visitedNodes.contains(e)) { mergeReturns(retVal,e.apply(this, question)); } } } if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this, question)); } mergeReturns(retVal,outABracketType(node, question)); return retVal; }
@Override public Boolean caseABracketType(ABracketType type) throws AnalysisException { return type.getType().apply(THIS); }
@Override public Boolean caseABracketType(ABracketType type) throws AnalysisException { return type.getType().apply(THIS); }
@Override public Integer caseABracketType(ABracketType type) throws AnalysisException { return type.getType().apply(THIS); }
@Override public AFunctionType caseABracketType(ABracketType type) throws AnalysisException { return type.getType().apply(THIS); }
@Override public PType caseABracketType(ABracketType type, String typename) throws AnalysisException { return type.getType().apply(THIS, typename); }
@Override public PTypeList caseABracketType(ABracketType node) throws AnalysisException { return node.getType().apply(THIS); }