/** * Returns a deep clone of this {@link APatternMatchRuntimeErrorExpIR} node. * @return a deep clone of this {@link APatternMatchRuntimeErrorExpIR} node */ public APatternMatchRuntimeErrorExpIR clone() { return new APatternMatchRuntimeErrorExpIR( _sourceNode, _tag, _metaData, cloneNode(_type), _message ); }
/** * Creates a new complete constructor {@code APatternMatchRuntimeErrorExpIR} node with the given nodes as children. * @deprecated This method should not be used, use AstFactory instead. * The basic child nodes are removed from their previous parents. * @param message_ the {@link String} node for the {@code message} child of this {@link APatternMatchRuntimeErrorExpIR} node */ public APatternMatchRuntimeErrorExpIR(SourceNode sourceNode_, Object tag_, List<? extends ClonableString> metaData_, STypeIR type_, String message_) { super(sourceNode_,tag_,metaData_,type_); this.setMessage(message_); }
/** * Essentially this.toString().equals(o.toString()). **/ @Override public boolean equals(Object o) { if (o != null && o instanceof APatternMatchRuntimeErrorExpIR) { return toString().equals(o.toString()); } return false; }
private void mismatchHandling(SPatternIR pattern, PatternBlockData patternData) { if (!patternData.IsRootPattern(pattern)) { return; } if (patternData.getMismatchHandling() == MismatchHandling.RAISE_ERROR) { APatternMatchRuntimeErrorExpIR matchFail = new APatternMatchRuntimeErrorExpIR(); matchFail.setType(new AErrorTypeIR()); matchFail.setMessage(config.getMatchFailedMessage(pattern)); ARaiseErrorStmIR noMatchStm = new ARaiseErrorStmIR(); noMatchStm.setError(matchFail); AIfStmIR consMismatchCheck = consMismatchCheck(patternData.getSuccessVar(), noMatchStm); patternData.getDeclBlock().getStatements().add(consMismatchCheck); } else if (patternData.getMismatchHandling() == MismatchHandling.LOOP_CONTINUE) { AIfStmIR consMismatchCheck = consMismatchCheck(patternData.getSuccessVar(), new AContinueStmIR()); patternData.getDeclBlock().getStatements().add(consMismatchCheck); } }
/** * Called by the {@link APatternMatchRuntimeErrorExpIR} node from {@link APatternMatchRuntimeErrorExpIR#apply(IAnalysis)}. * @param node the calling {@link APatternMatchRuntimeErrorExpIR} node */ public void caseAPatternMatchRuntimeErrorExpIR(APatternMatchRuntimeErrorExpIR node, Q question) throws AnalysisException { _visitedNodes.add(node); inAPatternMatchRuntimeErrorExpIR(node, question); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this, question); } outAPatternMatchRuntimeErrorExpIR(node, question); }
APatternMatchRuntimeErrorExpIR matchFail = new APatternMatchRuntimeErrorExpIR(); matchFail.setType(new AErrorTypeIR()); matchFail.setMessage(config.getMatchFailedMessage(firstOriginal)); ARaiseErrorStmIR noMatchStm = new ARaiseErrorStmIR(); noMatchStm.setError(matchFail);
/** * Called by the {@link APatternMatchRuntimeErrorExpIR} node from {@link APatternMatchRuntimeErrorExpIR#apply(IAnalysis)}. * @param node the calling {@link APatternMatchRuntimeErrorExpIR} node */ public void caseAPatternMatchRuntimeErrorExpIR(APatternMatchRuntimeErrorExpIR node) throws AnalysisException { _visitedNodes.add(node); inAPatternMatchRuntimeErrorExpIR(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } outAPatternMatchRuntimeErrorExpIR(node); }
/** * Called by the {@link APatternMatchRuntimeErrorExpIR} node from {@link APatternMatchRuntimeErrorExpIR#apply(IIsaAnalysis)}. * @param node the calling {@link APatternMatchRuntimeErrorExpIR} node */ public void caseAPatternMatchRuntimeErrorExpIR(APatternMatchRuntimeErrorExpIR node) throws AnalysisException { _visitedNodes.add(node); inAPatternMatchRuntimeErrorExpIR(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } outAPatternMatchRuntimeErrorExpIR(node); }
/** * Creates a deep clone of this {@link APatternMatchRuntimeErrorExpIR} 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 APatternMatchRuntimeErrorExpIR} node */ public APatternMatchRuntimeErrorExpIR clone(Map<INode,INode> oldToNewMap) { APatternMatchRuntimeErrorExpIR node = new APatternMatchRuntimeErrorExpIR( _sourceNode, _tag, _metaData, cloneNode(_type, oldToNewMap), _message ); oldToNewMap.put(this, node); return node; }
/** * Creates a new tree field only constructor {@code APatternMatchRuntimeErrorExpIR TAG=patternMatch} node with the given nodes as children. * @deprecated This method should not be used, use AstFactory instead. * The basic child nodes are removed from their previous parents. * @param message_ the {@link String} node for the {@code message} child of this {@link APatternMatchRuntimeErrorExpIR} node */ public APatternMatchRuntimeErrorExpIR(STypeIR type_, String message_) { super(null,null,null,type_); this.setMessage(message_); }
/** * Called by the {@link APatternMatchRuntimeErrorExpIR} node from {@link APatternMatchRuntimeErrorExpIR#apply(IAnalysis)}. * @param node the calling {@link APatternMatchRuntimeErrorExpIR} node */ public A caseAPatternMatchRuntimeErrorExpIR(APatternMatchRuntimeErrorExpIR node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAPatternMatchRuntimeErrorExpIR(node, question)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this, question)); } mergeReturns(retVal,outAPatternMatchRuntimeErrorExpIR(node, question)); return retVal; }
/** * Called by the {@link APatternMatchRuntimeErrorExpIR} node from {@link APatternMatchRuntimeErrorExpIR#apply(IAnalysis)}. * @param node the calling {@link APatternMatchRuntimeErrorExpIR} node */ public A caseAPatternMatchRuntimeErrorExpIR(APatternMatchRuntimeErrorExpIR node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAPatternMatchRuntimeErrorExpIR(node)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this)); } mergeReturns(retVal,outAPatternMatchRuntimeErrorExpIR(node)); return retVal; }