chromium/third_party/blink/renderer/core/xml/xpath_grammar_generated.cc

// clang-format off
// A Bison parser, made by GNU Bison 3.7.4.

// Skeleton implementation for Bison LALR(1) parsers in C++

// Copyright (C) 2002-2015, 2018-2020 Free Software Foundation, Inc.

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

// As a special exception, you may create a larger work that contains
// part or all of the Bison parser skeleton and distribute that work
// under terms of your choice, so long as that work isn't itself a
// parser generator using the skeleton or a modified version thereof
// as a parser skeleton.  Alternatively, if you modify or redistribute
// the parser skeleton itself, you may (at your option) remove this
// special exception, which will cause the skeleton and the resulting
// Bison output files to be licensed under the GNU General Public
// License without this special exception.

// This special exception was added by the Free Software Foundation in
// version 2.2 of Bison.

// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
// especially those whose name start with YY_ or yy_.  They are
// private implementation details that can be changed or removed.



// First part of user prologue.
#line 60 "third_party/blink/renderer/core/xml/xpath_grammar.y"


#include "third_party/blink/renderer/core/xml/xpath_functions.h"
#include "third_party/blink/renderer/core/xml/xpath_parser.h"
#include "third_party/blink/renderer/core/xml/xpath_path.h"
#include "third_party/blink/renderer/core/xml/xpath_predicate.h"
#include "third_party/blink/renderer/core/xml/xpath_step.h"
#include "third_party/blink/renderer/core/xml/xpath_variable_reference.h"

#define YYENABLE_NLS
#define YY_EXCEPTIONS
#define YYDEBUG

Step;

#line 58 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"


#include "xpath_grammar_generated.h"


// Unqualified %code blocks.
#line 52 "third_party/blink/renderer/core/xml/xpath_grammar.y"

#if defined(__clang__)
// Clang warns that the variable 'yynerrs_' is set but not used.
#pragma clang diagnostic ignored "-Wunused-but-set-variable"
#endif
#line 121 "third_party/blink/renderer/core/xml/xpath_grammar.y"


static int yylex(xpathyy::YyParser::semantic_type* yylval) {}

namespace xpathyy {
void YyParser::error(const std::string&) {}
}


#line 83 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"


#ifndef YY_
# if defined YYENABLE_NLS && YYENABLE_NLS
#  if ENABLE_NLS
#   include <libintl.h> // FIXME: INFRINGES ON USER NAME SPACE.
#define YY_
#  endif
# endif
# ifndef YY_
#define YY_(msgid)
# endif
#endif


// Whether we are compiled with exception support.
#ifndef YY_EXCEPTIONS
# if defined __GNUC__ && !defined __EXCEPTIONS
#define YY_EXCEPTIONS
# else
#define YY_EXCEPTIONS
# endif
#endif



// Enable debugging if requested.
#if YYDEBUG

// A pseudo ostream that takes yydebug_ into account.
#define YYCDEBUG

#define YY_SYMBOL_PRINT

#define YY_REDUCE_PRINT

#define YY_STACK_PRINT

#else // !YYDEBUG

#define YYCDEBUG
#define YY_SYMBOL_PRINT(Title, Symbol)
#define YY_REDUCE_PRINT(Rule)
#define YY_STACK_PRINT()

#endif // !YYDEBUG

#define yyerrok
#define yyclearin

#define YYACCEPT
#define YYABORT
#define YYERROR
#define YYRECOVERING()

#line 77 "third_party/blink/renderer/core/xml/xpath_grammar.y"
namespace xpathyy {
#line 157 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"

  /// Build a parser object.
  YyParser::YyParser (blink::xpath::Parser* parser__yyarg)
#if YYDEBUG
    :{}

  YyParser::~YyParser ()
  {}

  YyParser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW
  {}

  /*---------------.
  | symbol kinds.  |
  `---------------*/

  // basic_symbol.
  template <typename Base>
  YyParser::basic_symbol<Base>::basic_symbol (const basic_symbol& that)
    :{}



  template <typename Base>
  YyParser::symbol_kind_type
  YyParser::basic_symbol<Base>::type_get () const YY_NOEXCEPT
  {}

  template <typename Base>
  bool
  YyParser::basic_symbol<Base>::empty () const YY_NOEXCEPT
  {}

  template <typename Base>
  void
  YyParser::basic_symbol<Base>::move (basic_symbol& s)
  {}

  // by_kind.
  YyParser::by_kind::by_kind ()
    :{}

#if 201103L <= YY_CPLUSPLUS
  YyParser::by_kind::by_kind (by_kind&& that)
    :{}
#endif

  YyParser::by_kind::by_kind (const by_kind& that)
    :{}

  YyParser::by_kind::by_kind (token_kind_type t)
    :{}

  void
  YyParser::by_kind::clear ()
  {}

  void
  YyParser::by_kind::move (by_kind& that)
  {}

  YyParser::symbol_kind_type
  YyParser::by_kind::kind () const YY_NOEXCEPT
  {}

  YyParser::symbol_kind_type
  YyParser::by_kind::type_get () const YY_NOEXCEPT
  {}


  // by_state.
  YyParser::by_state::by_state () YY_NOEXCEPT
    :{}

  YyParser::by_state::by_state (const by_state& that) YY_NOEXCEPT
    :{}

  void
  YyParser::by_state::clear () YY_NOEXCEPT
  {}

  void
  YyParser::by_state::move (by_state& that)
  {}

  YyParser::by_state::by_state (state_type s) YY_NOEXCEPT
    :{}

  YyParser::symbol_kind_type
  YyParser::by_state::kind () const YY_NOEXCEPT
  {}

  YyParser::stack_symbol_type::stack_symbol_type ()
  {}

  YyParser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that)
    :{}

  YyParser::stack_symbol_type::stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) that)
    :{}

#if YY_CPLUSPLUS < 201103L
  YyParser::stack_symbol_type&
  YyParser::stack_symbol_type::operator= (const stack_symbol_type& that)
  {
    state = that.state;
    switch (that.kind ())
    {
      case symbol_kind::S_kNodeType: // kNodeType
      case symbol_kind::S_kPI: // kPI
      case symbol_kind::S_kFunctionName: // kFunctionName
      case symbol_kind::S_kLiteral: // kLiteral
      case symbol_kind::S_kVariableReference: // kVariableReference
      case symbol_kind::S_kNumber: // kNumber
      case symbol_kind::S_kNameTest: // kNameTest
        value.copy< String > (that.value);
        break;

      case symbol_kind::S_ArgumentList: // ArgumentList
        value.copy< blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Expression>>> > (that.value);
        break;

      case symbol_kind::S_OptionalPredicateList: // OptionalPredicateList
      case symbol_kind::S_PredicateList: // PredicateList
        value.copy< blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Predicate>>> > (that.value);
        break;

      case symbol_kind::S_Expr: // Expr
      case symbol_kind::S_Predicate: // Predicate
      case symbol_kind::S_PrimaryExpr: // PrimaryExpr
      case symbol_kind::S_FunctionCall: // FunctionCall
      case symbol_kind::S_Argument: // Argument
      case symbol_kind::S_UnionExpr: // UnionExpr
      case symbol_kind::S_PathExpr: // PathExpr
      case symbol_kind::S_FilterExpr: // FilterExpr
      case symbol_kind::S_OrExpr: // OrExpr
      case symbol_kind::S_AndExpr: // AndExpr
      case symbol_kind::S_EqualityExpr: // EqualityExpr
      case symbol_kind::S_RelationalExpr: // RelationalExpr
      case symbol_kind::S_AdditiveExpr: // AdditiveExpr
      case symbol_kind::S_MultiplicativeExpr: // MultiplicativeExpr
      case symbol_kind::S_UnaryExpr: // UnaryExpr
        value.copy< blink::Persistent<blink::xpath::Expression> > (that.value);
        break;

      case symbol_kind::S_LocationPath: // LocationPath
      case symbol_kind::S_AbsoluteLocationPath: // AbsoluteLocationPath
      case symbol_kind::S_RelativeLocationPath: // RelativeLocationPath
        value.copy< blink::Persistent<blink::xpath::LocationPath> > (that.value);
        break;

      case symbol_kind::S_NodeTest: // NodeTest
        value.copy< blink::Persistent<blink::xpath::Step::NodeTest> > (that.value);
        break;

      case symbol_kind::S_Step: // Step
      case symbol_kind::S_DescendantOrSelf: // DescendantOrSelf
      case symbol_kind::S_AbbreviatedStep: // AbbreviatedStep
        value.copy< blink::Persistent<blink::xpath::Step> > (that.value);
        break;

      case symbol_kind::S_kEqOp: // kEqOp
      case symbol_kind::S_kRelOp: // kRelOp
        value.copy< blink::xpath::EqTestOp::Opcode > (that.value);
        break;

      case symbol_kind::S_kMulOp: // kMulOp
        value.copy< blink::xpath::NumericOp::Opcode > (that.value);
        break;

      case symbol_kind::S_kAxisName: // kAxisName
      case symbol_kind::S_AxisSpecifier: // AxisSpecifier
        value.copy< blink::xpath::Step::Axis > (that.value);
        break;

      default:
        break;
    }

    return *this;
  }

  YyParser::stack_symbol_type&
  YyParser::stack_symbol_type::operator= (stack_symbol_type& that)
  {
    state = that.state;
    switch (that.kind ())
    {
      case symbol_kind::S_kNodeType: // kNodeType
      case symbol_kind::S_kPI: // kPI
      case symbol_kind::S_kFunctionName: // kFunctionName
      case symbol_kind::S_kLiteral: // kLiteral
      case symbol_kind::S_kVariableReference: // kVariableReference
      case symbol_kind::S_kNumber: // kNumber
      case symbol_kind::S_kNameTest: // kNameTest
        value.move< String > (that.value);
        break;

      case symbol_kind::S_ArgumentList: // ArgumentList
        value.move< blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Expression>>> > (that.value);
        break;

      case symbol_kind::S_OptionalPredicateList: // OptionalPredicateList
      case symbol_kind::S_PredicateList: // PredicateList
        value.move< blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Predicate>>> > (that.value);
        break;

      case symbol_kind::S_Expr: // Expr
      case symbol_kind::S_Predicate: // Predicate
      case symbol_kind::S_PrimaryExpr: // PrimaryExpr
      case symbol_kind::S_FunctionCall: // FunctionCall
      case symbol_kind::S_Argument: // Argument
      case symbol_kind::S_UnionExpr: // UnionExpr
      case symbol_kind::S_PathExpr: // PathExpr
      case symbol_kind::S_FilterExpr: // FilterExpr
      case symbol_kind::S_OrExpr: // OrExpr
      case symbol_kind::S_AndExpr: // AndExpr
      case symbol_kind::S_EqualityExpr: // EqualityExpr
      case symbol_kind::S_RelationalExpr: // RelationalExpr
      case symbol_kind::S_AdditiveExpr: // AdditiveExpr
      case symbol_kind::S_MultiplicativeExpr: // MultiplicativeExpr
      case symbol_kind::S_UnaryExpr: // UnaryExpr
        value.move< blink::Persistent<blink::xpath::Expression> > (that.value);
        break;

      case symbol_kind::S_LocationPath: // LocationPath
      case symbol_kind::S_AbsoluteLocationPath: // AbsoluteLocationPath
      case symbol_kind::S_RelativeLocationPath: // RelativeLocationPath
        value.move< blink::Persistent<blink::xpath::LocationPath> > (that.value);
        break;

      case symbol_kind::S_NodeTest: // NodeTest
        value.move< blink::Persistent<blink::xpath::Step::NodeTest> > (that.value);
        break;

      case symbol_kind::S_Step: // Step
      case symbol_kind::S_DescendantOrSelf: // DescendantOrSelf
      case symbol_kind::S_AbbreviatedStep: // AbbreviatedStep
        value.move< blink::Persistent<blink::xpath::Step> > (that.value);
        break;

      case symbol_kind::S_kEqOp: // kEqOp
      case symbol_kind::S_kRelOp: // kRelOp
        value.move< blink::xpath::EqTestOp::Opcode > (that.value);
        break;

      case symbol_kind::S_kMulOp: // kMulOp
        value.move< blink::xpath::NumericOp::Opcode > (that.value);
        break;

      case symbol_kind::S_kAxisName: // kAxisName
      case symbol_kind::S_AxisSpecifier: // AxisSpecifier
        value.move< blink::xpath::Step::Axis > (that.value);
        break;

      default:
        break;
    }

    // that is emptied.
    that.state = empty_state;
    return *this;
  }
#endif

  template <typename Base>
  void
  YyParser::yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const
  {}

#if YYDEBUG
  template <typename Base>
  void
  YyParser::yy_print_ (std::ostream& yyo, const basic_symbol<Base>& yysym) const
  {
    std::ostream& yyoutput = yyo;
    YYUSE (yyoutput);
    if (yysym.empty ())
      yyo << "empty symbol";
    else
      {
        symbol_kind_type yykind = yysym.kind ();
        yyo << (yykind < YYNTOKENS ? "token" : "nterm")
            << ' ' << yysym.name () << " (";
        YYUSE (yykind);
        yyo << ')';
      }
  }
#endif

  void
  YyParser::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym)
  {}

  void
  YyParser::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym)
  {}

  void
  YyParser::yypop_ (int n)
  {}

#if YYDEBUG
  std::ostream&
  YyParser::debug_stream () const
  {
    return *yycdebug_;
  }

  void
  YyParser::set_debug_stream (std::ostream& o)
  {
    yycdebug_ = &o;
  }


  YyParser::debug_level_type
  YyParser::debug_level () const
  {
    return yydebug_;
  }

  void
  YyParser::set_debug_level (debug_level_type l)
  {
    yydebug_ = l;
  }
#endif // YYDEBUG

  YyParser::state_type
  YyParser::yy_lr_goto_state_ (state_type yystate, int yysym)
  {}

  bool
  YyParser::yy_pact_value_is_default_ (int yyvalue)
  {}

  bool
  YyParser::yy_table_value_is_error_ (int yyvalue)
  {}

  int
  YyParser::operator() ()
  {}

  int
  YyParser::parse ()
  {}

  void
  YyParser::error (const syntax_error& yyexc)
  {}

#if YYDEBUG || 0
  const char *
  YyParser::symbol_name (symbol_kind_type yysymbol)
  {
    return yytname_[yysymbol];
  }
#endif // #if YYDEBUG || 0





  const signed char YyParser::yypact_ninf_ =;

  const signed char YyParser::yytable_ninf_ =;

  const signed char
  YyParser::yypact_[] =;

  const signed char
  YyParser::yydefact_[] =;

  const signed char
  YyParser::yypgoto_[] =;

  const signed char
  YyParser::yydefgoto_[] =;

  const signed char
  YyParser::yytable_[] =;

  const signed char
  YyParser::yycheck_[] =;

  const signed char
  YyParser::yystos_[] =;

  const signed char
  YyParser::yyr1_[] =;

  const signed char
  YyParser::yyr2_[] =;


#if YYDEBUG
  // YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
  // First, the terminals, then, starting at \a YYNTOKENS, nonterminals.
  const char*
  const YyParser::yytname_[] =
  {
  "\"end of file\"", "error", "\"invalid token\"", "kMulOp", "kEqOp",
  "kRelOp", "kPlus", "kMinus", "kOr", "kAnd", "kAxisName", "kNodeType",
  "kPI", "kFunctionName", "kLiteral", "kVariableReference", "kNumber",
  "kDotDot", "kSlashSlash", "kNameTest", "kXPathError", "'/'", "'@'",
  "'('", "')'", "'['", "']'", "'.'", "','", "'|'", "$accept", "Expr",
  "LocationPath", "AbsoluteLocationPath", "RelativeLocationPath", "Step",
  "AxisSpecifier", "NodeTest", "OptionalPredicateList", "PredicateList",
  "Predicate", "DescendantOrSelf", "AbbreviatedStep", "PrimaryExpr",
  "FunctionCall", "ArgumentList", "Argument", "UnionExpr", "PathExpr",
  "FilterExpr", "OrExpr", "AndExpr", "EqualityExpr", "RelationalExpr",
  "AdditiveExpr", "MultiplicativeExpr", "UnaryExpr", YY_NULLPTR
  };
#endif


#if YYDEBUG
  const short
  YyParser::yyrline_[] =
  {
       0,   136,   136,   144,   150,   158,   163,   168,   176,   182,
     188,   197,   205,   220,   228,   243,   247,   249,   256,   266,
     271,   279,   283,   290,   296,   304,   311,   318,   323,   330,
     335,   340,   345,   350,   354,   361,   370,   376,   384,   388,
     390,   399,   404,   406,   412,   421,   423,   430,   432,   439,
     441,   448,   450,   457,   459,   466,   468,   473,   480,   482,
     489,   491
  };

  void
  YyParser::yy_stack_print_ () const
  {
    *yycdebug_ << "Stack now";
    for (stack_type::const_iterator
           i = yystack_.begin (),
           i_end = yystack_.end ();
         i != i_end; ++i)
      *yycdebug_ << ' ' << int (i->state);
    *yycdebug_ << '\n';
  }

  void
  YyParser::yy_reduce_print_ (int yyrule) const
  {
    int yylno = yyrline_[yyrule];
    int yynrhs = yyr2_[yyrule];
    // Print the symbols being reduced, and their result.
    *yycdebug_ << "Reducing stack by rule " << yyrule - 1
               << " (line " << yylno << "):\n";
    // The symbols being reduced.
    for (int yyi = 0; yyi < yynrhs; yyi++)
      YY_SYMBOL_PRINT ("   $" << yyi + 1 << " =",
                       yystack_[(yynrhs) - (yyi + 1)]);
  }
#endif // YYDEBUG

  YyParser::symbol_kind_type
  YyParser::yytranslate_ (int t)
  {}

#line 77 "third_party/blink/renderer/core/xml/xpath_grammar.y"
} // xpathyy
#line 2021 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"

#line 498 "third_party/blink/renderer/core/xml/xpath_grammar.y"