class ParboiledRoutingPolicySpecifier implements RoutingPolicySpecifier {

  public static ParboiledRoutingPolicySpecifier parse(String input) {
    ParsingResult<AstNode> result =
        new ReportingParseRunner<AstNode>(
                Parser.instance().getInputRule(Grammar.ROUTING_POLICY_SPECIFIER))
            .run(input);

    if (!result.parseErrors.isEmpty()) {
      throw new IllegalArgumentException(
          ParserUtils.getErrorString(
              input,
              Grammar.ROUTING_POLICY_SPECIFIER,
              (InvalidInputError) result.parseErrors.get(0),
              Parser.ANCHORS));
    }

    AstNode ast = ParserUtils.getAst(result);

    checkArgument(
        ast instanceof RoutingPolicyAstNode,
        "ParboiledRoutingPolicySpecifier requires an RoutingPolicySpecifier input");

    return new ParboiledRoutingPolicySpecifier((RoutingPolicyAstNode) ast);
  }

    ParboiledRoutingPolicySpecifier(RoutingPolicyAstNode ast);

}