/** * 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 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; }
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); } }
APatternMatchRuntimeErrorExpIR matchFail = new APatternMatchRuntimeErrorExpIR(); matchFail.setType(new AErrorTypeIR()); matchFail.setMessage(config.getMatchFailedMessage(firstOriginal));