print syntaxfehler
This commit is contained in:
@ -73,10 +73,14 @@ public class LL1Parser {
|
|||||||
} else if (this.parsetable.getTerminals().contains(top)) {
|
} else if (this.parsetable.getTerminals().contains(top)) {
|
||||||
// Wenn das Terminal auf dem Stack nicht mit der aktuellen Eingabe übereinstimmt
|
// Wenn das Terminal auf dem Stack nicht mit der aktuellen Eingabe übereinstimmt
|
||||||
|
|
||||||
|
System.out.println("Syntaxfehler.");
|
||||||
|
|
||||||
throw new MyParseException("Invalid terminal on stack: " + top, tree);
|
throw new MyParseException("Invalid terminal on stack: " + top, tree);
|
||||||
} else if (prod == null) {
|
} else if (prod == null) {
|
||||||
// Wenn es für das aktuelle Terminal und das Nichtterminal auf dem Stack keine Regel gibt
|
// Wenn es für das aktuelle Terminal und das Nichtterminal auf dem Stack keine Regel gibt
|
||||||
|
|
||||||
|
System.out.println("Syntaxfehler.");
|
||||||
|
|
||||||
throw new MyParseException("No prod. for nonterminal " + top + ", terminal " + currentTokenSym, tree);
|
throw new MyParseException("No prod. for nonterminal " + top + ", terminal " + currentTokenSym, tree);
|
||||||
} else {
|
} else {
|
||||||
// Wenn das Nichtterminal auf dem Stack durch (s)eine Produktion ersetzt werden kann
|
// Wenn das Nichtterminal auf dem Stack durch (s)eine Produktion ersetzt werden kann
|
||||||
|
|||||||
Reference in New Issue
Block a user