char c = s.charAt(from); if (c == '}') { throw new SyntaxException(CODE_MISSING_EXPR_IDENT, "Missing expression identifier at " + from, Location.at(1 + from)); } else { status = EXPR_IDENT; throw new SyntaxException(CODE_UNCLOSED_EXPR, "Unclosed expression at " + from, Location.at(1 + from)); throw new SyntaxException(CODE_UNCLOSED_EXPR, "Unclosed expression at " + from, Location.at(1 + from));
private void fail(String route, int expectedCode, int index) { try { RouteParser.parse(route, new Collector()); throw failure("Was expecting route to fail at " + index); } catch (SyntaxException e) { assertEquals(expectedCode, e.getCode()); assertNotNull(e.getLocation()); assertEquals(index, e.getLocation().getCol()); assertEquals(1, e.getLocation().getLine()); } }
char c = s.charAt(from); if (c == '}') { throw new SyntaxException(CODE_MISSING_EXPR_IDENT, "Missing expression identifier at " + from, Location.at(1 + from)); } else { status = EXPR_IDENT; throw new SyntaxException(CODE_UNCLOSED_EXPR, "Unclosed expression at " + from, Location.at(1 + from)); throw new SyntaxException(CODE_UNCLOSED_EXPR, "Unclosed expression at " + from, Location.at(1 + from));
private void fail(String route, int expectedCode, int index) { try { RouteParser.parse(route, new Collector()); throw failure("Was expecting route to fail at " + index); } catch (SyntaxException e) { assertEquals(expectedCode, e.getCode()); assertNotNull(e.getLocation()); assertEquals(index, e.getLocation().getCol()); assertEquals(1, e.getLocation().getLine()); } }
private RENode.CharacterClassExpr _parseCharacterClass() throws SyntaxException { if (lexer.next(Kind.CC_OPEN)) { boolean negated = lexer.getToken().length() > 1; RENode.CharacterClassExpr expr = parseCharacterClassExpression(); if (expr != null) { if (lexer.next(Kind.CC_CLOSE)) { return negated ? new RENode.CharacterClassExpr.Not(expr) : expr; } else { throw new SyntaxException(""); } } else { throw new SyntaxException(""); } } else { return null; } }
private RENode.CharacterClassExpr _parseCharacterClass() throws SyntaxException { if (lexer.next(Kind.CC_OPEN)) { boolean negated = lexer.getToken().length() > 1; RENode.CharacterClassExpr expr = parseCharacterClassExpression(); if (expr != null) { if (lexer.next(Kind.CC_CLOSE)) { return negated ? new RENode.CharacterClassExpr.Not(expr) : expr; } else { throw new SyntaxException(""); } } else { throw new SyntaxException(""); } } else { return null; } }
throw new SyntaxException(); throw new SyntaxException(); throw new SyntaxException(); throw new SyntaxException(); throw new SyntaxException(); throw new SyntaxException(); throw new SyntaxException(); throw new SyntaxException(); throw new SyntaxException(); throw new SyntaxException();
throw new SyntaxException(); throw new SyntaxException(); throw new SyntaxException(); throw new SyntaxException(); throw new SyntaxException(); throw new SyntaxException(); throw new SyntaxException(); throw new SyntaxException(); throw new SyntaxException(); throw new SyntaxException();
assertEquals(s.length(), stream.getIndex()); if (lexer.hasNext()) { throw new SyntaxException();
assertEquals(s.length(), stream.getIndex()); if (lexer.hasNext()) { throw new SyntaxException();
throw new SyntaxException();
throw new SyntaxException();
public RENode.Expr parseExpression() throws SyntaxException { RENode.Expr expr; if (lexer.next(Kind.BEGIN)) { expr = new RENode.Assertion.Begin(); } else if (lexer.next(Kind.END)) { expr = new RENode.Assertion.End(); } else if (lexer.next(Kind.GROUP_OPEN)) { GroupType groupType = GroupType.forPrefix(lexer.getToken()); RENode.Disjunction group = parseDisjunction(); if (lexer.next(Kind.GROUP_CLOSE)) { expr = new RENode.Group(group, groupType); } else { throw new SyntaxException("Group not closed "); } } else { expr = parseCharacter(); } if (expr != null) { Quantifier quantifier = parseQuantifier(); if (quantifier != null) { expr.setQuantifier(quantifier); } } return expr; }
public RENode.Expr parseExpression() throws SyntaxException { RENode.Expr expr; if (lexer.next(Kind.BEGIN)) { expr = new RENode.Assertion.Begin(); } else if (lexer.next(Kind.END)) { expr = new RENode.Assertion.End(); } else if (lexer.next(Kind.GROUP_OPEN)) { GroupType groupType = GroupType.forPrefix(lexer.getToken()); RENode.Disjunction group = parseDisjunction(); if (lexer.next(Kind.GROUP_CLOSE)) { expr = new RENode.Group(group, groupType); } else { throw new SyntaxException("Group not closed "); } } else { expr = parseCharacter(); } if (expr != null) { Quantifier quantifier = parseQuantifier(); if (quantifier != null) { expr.setQuantifier(quantifier); } } return expr; }