@Test public void testParseGoodInput() { assertThat( ParboiledAppSpecifier.parse("tcp"), equalTo(new ParboiledAppSpecifier(new TcpAppAstNode()))); }
public static ParboiledAppSpecifier parse(String input) { ParsingResult<AstNode> result = new ReportingParseRunner<AstNode>( Parser.instance().getInputRule(Grammar.APPLICATION_SPECIFIER)) .run(input); if (!result.parseErrors.isEmpty()) { throw new IllegalArgumentException( ParserUtils.getErrorString( input, Grammar.APPLICATION_SPECIFIER, (InvalidInputError) result.parseErrors.get(0), Parser.ANCHORS)); } AstNode ast = ParserUtils.getAst(result); checkArgument( ast instanceof AppAstNode, "ParboiledAppSpecifier requires an IP protocol specifier input"); return new ParboiledAppSpecifier((AppAstNode) ast); }
ParboiledAppSpecifier implements ApplicationSpecifier { public static ParboiledAppSpecifier parse(String input) { ParsingResult<AstNode> result = new ReportingParseRunner<AstNode>( Parser.instance().getInputRule(Grammar.APPLICATION_SPECIFIER)) .run(input); if (!result.parseErrors.isEmpty()) { throw new IllegalArgumentException( ParserUtils.getErrorString( input, Grammar.APPLICATION_SPECIFIER, (InvalidInputError) result.parseErrors.get(0), Parser.ANCHORS)); } AstNode ast = ParserUtils.getAst(result); checkArgument( ast instanceof AppAstNode, "ParboiledAppSpecifier requires an IP protocol specifier input"); return new ParboiledAppSpecifier((AppAstNode) ast); } }
ParboiledAppSpecifier implements ApplicationSpecifier { public static ParboiledAppSpecifier parse(String input) { ParsingResult<AstNode> result = new ReportingParseRunner<AstNode>( Parser.instance().getInputRule(Grammar.APPLICATION_SPECIFIER)) .run(input); if (!result.parseErrors.isEmpty()) { throw new IllegalArgumentException( ParserUtils.getErrorString( input, Grammar.APPLICATION_SPECIFIER, (InvalidInputError) result.parseErrors.get(0), Parser.ANCHORS)); } AstNode ast = ParserUtils.getAst(result); checkArgument( ast instanceof AppAstNode, "ParboiledAppSpecifier requires an IP protocol specifier input"); return new ParboiledAppSpecifier((AppAstNode) ast); } ParboiledAppSpecifier(AppAstNode ast); }
ParboiledAppSpecifier implements ApplicationSpecifier { public static ParboiledAppSpecifier parse(String input) { ParsingResult<AstNode> result = new ReportingParseRunner<AstNode>( Parser.instance().getInputRule(Grammar.APPLICATION_SPECIFIER)) .run(input); if (!result.parseErrors.isEmpty()) { throw new IllegalArgumentException( ParserUtils.getErrorString( input, Grammar.APPLICATION_SPECIFIER, (InvalidInputError) result.parseErrors.get(0), Parser.ANCHORS)); } AstNode ast = ParserUtils.getAst(result); checkArgument( ast instanceof AppAstNode, "ParboiledAppSpecifier requires an IP protocol specifier input"); return new ParboiledAppSpecifier((AppAstNode) ast); } ParboiledAppSpecifier(AppAstNode ast); static ParboiledAppSpecifier parse(String input); @Override boolean equals(Object o); @Override int hashCode(); @Override Set<Application> resolve(); }
ParboiledAppSpecifier implements ApplicationSpecifier { public static ParboiledAppSpecifier parse(String input) { ParsingResult<AstNode> result = new ReportingParseRunner<AstNode>( Parser.instance().getInputRule(Grammar.APPLICATION_SPECIFIER)) .run(input); if (!result.parseErrors.isEmpty()) { throw new IllegalArgumentException( ParserUtils.getErrorString( input, Grammar.APPLICATION_SPECIFIER, (InvalidInputError) result.parseErrors.get(0), Parser.ANCHORS)); } AstNode ast = ParserUtils.getAst(result); checkArgument( ast instanceof AppAstNode, "ParboiledAppSpecifier requires an IP protocol specifier input"); return new ParboiledAppSpecifier((AppAstNode) ast); } ParboiledAppSpecifier(AppAstNode ast); static ParboiledAppSpecifier parse(String input); @Override boolean equals(Object o); @Override int hashCode(); @Override Set<Application> resolve();  }