@Test public void testParseGoodInput() { assertThat( ParboiledIpSpaceSpecifier.parse("1.1.1.1"), equalTo(new ParboiledIpSpaceSpecifier(new IpAstNode("1.1.1.1")))); }
public static ParboiledIpSpaceSpecifier parse(String input) { ParsingResult<AstNode> result = new ReportingParseRunner<AstNode>( Parser.instance().getInputRule(Grammar.IP_SPACE_SPECIFIER)) .run(input); if (!result.parseErrors.isEmpty()) { throw new IllegalArgumentException( ParserUtils.getErrorString( input, Grammar.IP_SPACE_SPECIFIER, (InvalidInputError) result.parseErrors.get(0), Parser.ANCHORS)); } AstNode ast = ParserUtils.getAst(result); checkArgument( ast instanceof IpSpaceAstNode, "ParboiledIpSpaceSpecifier requires an IpSpace input"); return new ParboiledIpSpaceSpecifier((IpSpaceAstNode) ast); }
ParboiledIpSpaceSpecifier implements IpSpaceSpecifier { public static ParboiledIpSpaceSpecifier parse(String input) { ParsingResult<AstNode> result = new ReportingParseRunner<AstNode>( Parser.instance().getInputRule(Grammar.IP_SPACE_SPECIFIER)) .run(input); if (!result.parseErrors.isEmpty()) { throw new IllegalArgumentException( ParserUtils.getErrorString( input, Grammar.IP_SPACE_SPECIFIER, (InvalidInputError) result.parseErrors.get(0), Parser.ANCHORS)); } AstNode ast = ParserUtils.getAst(result); checkArgument( ast instanceof IpSpaceAstNode, "ParboiledIpSpaceSpecifier requires an IpSpace input"); return new ParboiledIpSpaceSpecifier((IpSpaceAstNode) ast); } }
ParboiledIpSpaceSpecifier implements IpSpaceSpecifier { public static ParboiledIpSpaceSpecifier parse(String input) { ParsingResult<AstNode> result = new ReportingParseRunner<AstNode>( Parser.instance().getInputRule(Grammar.IP_SPACE_SPECIFIER)) .run(input); if (!result.parseErrors.isEmpty()) { throw new IllegalArgumentException( ParserUtils.getErrorString( input, Grammar.IP_SPACE_SPECIFIER, (InvalidInputError) result.parseErrors.get(0), Parser.ANCHORS)); } AstNode ast = ParserUtils.getAst(result); checkArgument( ast instanceof IpSpaceAstNode, "ParboiledIpSpaceSpecifier requires an IpSpace input"); return new ParboiledIpSpaceSpecifier((IpSpaceAstNode) ast); } ParboiledIpSpaceSpecifier(IpSpaceAstNode ast); }
ParboiledIpSpaceSpecifier implements IpSpaceSpecifier { public static ParboiledIpSpaceSpecifier parse(String input) { ParsingResult<AstNode> result = new ReportingParseRunner<AstNode>( Parser.instance().getInputRule(Grammar.IP_SPACE_SPECIFIER)) .run(input); if (!result.parseErrors.isEmpty()) { throw new IllegalArgumentException( ParserUtils.getErrorString( input, Grammar.IP_SPACE_SPECIFIER, (InvalidInputError) result.parseErrors.get(0), Parser.ANCHORS)); } AstNode ast = ParserUtils.getAst(result); checkArgument( ast instanceof IpSpaceAstNode, "ParboiledIpSpaceSpecifier requires an IpSpace input"); return new ParboiledIpSpaceSpecifier((IpSpaceAstNode) ast); } ParboiledIpSpaceSpecifier(IpSpaceAstNode ast); static ParboiledIpSpaceSpecifier parse(String input); @Override boolean equals(Object o); @Override int hashCode(); @Override IpSpaceAssignment resolve(Set<Location> locations, SpecifierContext ctxt); @Override String toString(); }
ParboiledIpSpaceSpecifier implements IpSpaceSpecifier { public static ParboiledIpSpaceSpecifier parse(String input) { ParsingResult<AstNode> result = new ReportingParseRunner<AstNode>( Parser.instance().getInputRule(Grammar.IP_SPACE_SPECIFIER)) .run(input); if (!result.parseErrors.isEmpty()) { throw new IllegalArgumentException( ParserUtils.getErrorString( input, Grammar.IP_SPACE_SPECIFIER, (InvalidInputError) result.parseErrors.get(0), Parser.ANCHORS)); } AstNode ast = ParserUtils.getAst(result); checkArgument( ast instanceof IpSpaceAstNode, "ParboiledIpSpaceSpecifier requires an IpSpace input"); return new ParboiledIpSpaceSpecifier((IpSpaceAstNode) ast); } ParboiledIpSpaceSpecifier(IpSpaceAstNode ast); static ParboiledIpSpaceSpecifier parse(String input); @Override boolean equals(Object o); @Override int hashCode(); @Override IpSpaceAssignment resolve(Set<Location> locations, SpecifierContext ctxt); @Override String toString();  }