/** * 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_); }
/** * 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_); }
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); } }
matchFail.setMessage(config.getMatchFailedMessage(firstOriginal)); ARaiseErrorStmIR noMatchStm = new ARaiseErrorStmIR(); noMatchStm.setError(matchFail);