diff --git a/ÜB-Praxis-Abstiegsparser für X-Leer/bin/de/dhbw/compiler/xparser/XParser.class b/ÜB-Praxis-Abstiegsparser für X-Leer/bin/de/dhbw/compiler/xparser/XParser.class index 2bea52c..e5cb684 100644 Binary files a/ÜB-Praxis-Abstiegsparser für X-Leer/bin/de/dhbw/compiler/xparser/XParser.class and b/ÜB-Praxis-Abstiegsparser für X-Leer/bin/de/dhbw/compiler/xparser/XParser.class differ diff --git a/ÜB-Praxis-Abstiegsparser für X-Leer/src/de/dhbw/compiler/xparser/XParser.java b/ÜB-Praxis-Abstiegsparser für X-Leer/src/de/dhbw/compiler/xparser/XParser.java index df274c8..187ee36 100644 --- a/ÜB-Praxis-Abstiegsparser für X-Leer/src/de/dhbw/compiler/xparser/XParser.java +++ b/ÜB-Praxis-Abstiegsparser für X-Leer/src/de/dhbw/compiler/xparser/XParser.java @@ -152,9 +152,42 @@ public class XParser { private Tree parseNumExpr() { int oldPosition = in.getPosition(); Tree tree = new Tree(new Token(Token.EXPR)); + Tree intConst; + if ((intConst = parseNumExpr2()) != null) { + tree.addLastChild(intConst); + return tree; + } + in.setPosition(oldPosition); + return null; + } + private Tree parseNumExpr2() { + int oldPosition = in.getPosition(); + Tree tree = new Tree(new Token(Token.EXPR2)); + Tree intConst; + + if ((intConst = parseNumExpr3()) != null) { + tree.addLastChild(intConst); + return tree; + } + + in.setPosition(oldPosition); + return null; + } + + private Tree parseNumExpr3() { + int oldPosition = in.getPosition(); + Tree tree = new Tree(new Token(Token.EXPR3)); + Tree intConst; + + if ((intConst = parseToken(Token.INTCONST)) != null) { + tree.addLastChild(intConst); + return tree; + } + + in.setPosition(oldPosition); return null; }