@Override public void visit(BranchingStatement obj) { boolean matchedLabel = false; boolean inLoop = false; for (LanguageObject lo : stack) { if (lo instanceof LoopStatement || lo instanceof WhileStatement) { inLoop = true; if (obj.getLabel() == null) { break; } matchedLabel |= obj.getLabel().equalsIgnoreCase(((Labeled)lo).getLabel()); } else if (obj.getLabel() != null && lo instanceof Block && obj.getLabel().equalsIgnoreCase(((Block)lo).getLabel())) { matchedLabel = true; if (obj.getMode() != BranchingMode.LEAVE) { handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.invalid_label", obj.getLabel()), obj); //$NON-NLS-1$ } } } if (obj.getMode() != BranchingMode.LEAVE && !inLoop) { handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.no_loop"), obj); //$NON-NLS-1$ } if (obj.getLabel() != null && !matchedLabel) { handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.unknown_block_label", obj.getLabel()), obj); //$NON-NLS-1$ } }
throw new ParseException(); ((Statement.Labeled)stmt).setLabel(label); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
throw new ParseException(); ((Statement.Labeled)stmt).setLabel(label); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
throw new ParseException(); ((Statement.Labeled)stmt).setLabel(label); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
@Override public void visit(BranchingStatement obj) { boolean matchedLabel = false; boolean inLoop = false; for (LanguageObject lo : stack) { if (lo instanceof LoopStatement || lo instanceof WhileStatement) { inLoop = true; if (obj.getLabel() == null) { break; } matchedLabel |= obj.getLabel().equalsIgnoreCase(((Labeled)lo).getLabel()); } else if (obj.getLabel() != null && lo instanceof Block && obj.getLabel().equalsIgnoreCase(((Block)lo).getLabel())) { matchedLabel = true; if (obj.getMode() != BranchingMode.LEAVE) { handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.invalid_label", obj.getLabel()), obj); //$NON-NLS-1$ } } } if (obj.getMode() != BranchingMode.LEAVE && !inLoop) { handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.no_loop"), obj); //$NON-NLS-1$ } if (obj.getLabel() != null && !matchedLabel) { handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.unknown_block_label", obj.getLabel()), obj); //$NON-NLS-1$ } }
@Override public void visit(BranchingStatement obj) { boolean matchedLabel = false; boolean inLoop = false; for (LanguageObject lo : stack) { if (lo instanceof LoopStatement || lo instanceof WhileStatement) { inLoop = true; if (obj.getLabel() == null) { break; } matchedLabel |= obj.getLabel().equalsIgnoreCase(((Labeled)lo).getLabel()); } else if (obj.getLabel() != null && lo instanceof Block && obj.getLabel().equalsIgnoreCase(((Block)lo).getLabel())) { matchedLabel = true; if (obj.getMode() != BranchingMode.LEAVE) { handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.invalid_label", obj.getLabel()), obj); //$NON-NLS-1$ } } } if (obj.getMode() != BranchingMode.LEAVE && !inLoop) { handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.no_loop"), obj); //$NON-NLS-1$ } if (obj.getLabel() != null && !matchedLabel) { handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.unknown_block_label", obj.getLabel()), obj); //$NON-NLS-1$ } }
public void visit(Block obj) { if (obj.getLabel() == null) { return; } for (LanguageObject lo : stack) { if (lo instanceof Labeled) { Labeled labeled = (Labeled)lo; if (obj.getLabel().equalsIgnoreCase(labeled.getLabel())) { handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.duplicate_block_label", obj.getLabel()), obj); //$NON-NLS-1$ } } } }
public void visit(Block obj) { if (obj.getLabel() == null) { return; } for (LanguageObject lo : stack) { if (lo instanceof Labeled) { Labeled labeled = (Labeled)lo; if (obj.getLabel().equalsIgnoreCase(labeled.getLabel())) { handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.duplicate_block_label", obj.getLabel()), obj); //$NON-NLS-1$ } } } }
public void visit(Block obj) { if (obj.getLabel() == null) { return; } for (LanguageObject lo : stack) { if (lo instanceof Labeled) { Labeled labeled = (Labeled)lo; if (obj.getLabel().equalsIgnoreCase(labeled.getLabel())) { handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.duplicate_block_label", obj.getLabel()), obj); //$NON-NLS-1$ } } } }