/* A Bison parser, made by GNU Bison 3.8.2.  */

/* Bison interface for Yacc-like parsers in C

   Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 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 <https://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.  */

#ifndef YY_GRAPH_COMPILE_GRAPH_PARSER_COMPILE_H_INCLUDED
# define YY_GRAPH_COMPILE_GRAPH_PARSER_COMPILE_H_INCLUDED
/* Debug traces.  */
#ifndef GRAPH_COMPILE_DEBUG
# if defined YYDEBUG
#if YYDEBUG
#   define GRAPH_COMPILE_DEBUG 1
#  else
#   define GRAPH_COMPILE_DEBUG 0
#  endif
# else /* ! defined YYDEBUG */
#  define GRAPH_COMPILE_DEBUG 0
# endif /* ! defined YYDEBUG */
#endif  /* ! defined GRAPH_COMPILE_DEBUG */
#if GRAPH_COMPILE_DEBUG
extern int graph_compile_debug;
#endif
/* "%code requires" blocks.  */
#line 4 "./graph_lang.yy"
 #undef C_S_H_IS_COMPILED 
#line 34 "./graph_lang.yy"

    #include "gvcsh.h"
    #include "graphchart.h"
    #include "graph_lexer.h"

    //To allow including both graph_parse_{compile,csh}.h
    #undef C_S_H
    #undef CHAR_IF_CSH
    #undef FIRST_IF_CSH

    #ifdef C_S_H_IS_COMPILED
        #define C_S_H true
        #define CHAR_IF_CSH(A) char
        #define FIRST_IF_CSH(A,B) A
    #else
        #define C_S_H false
        #define CHAR_IF_CSH(A) A
        #define FIRST_IF_CSH(A,B) B
    #endif

    using namespace graph;

#line 82 "graph_parser_compile.h"

/* Token kinds.  */
#ifndef GRAPH_COMPILE_TOKENTYPE
# define GRAPH_COMPILE_TOKENTYPE
  enum graph_compile_tokentype
  {
    GRAPH_COMPILE_EMPTY = -2,
    TOK_EOF = 0,                   /* TOK_EOF  */
    GRAPH_COMPILE_error = 256,     /* error  */
    GRAPH_COMPILE_UNDEF = 257,     /* "invalid token"  */
    TOK_STRICT = 258,              /* TOK_STRICT  */
    TOK_GRAPH = 259,               /* TOK_GRAPH  */
    TOK_DIGRAPH = 260,             /* TOK_DIGRAPH  */
    TOK_SUBGRAPH = 261,            /* TOK_SUBGRAPH  */
    TOK_NODE = 262,                /* TOK_NODE  */
    TOK_EDGE = 263,                /* TOK_EDGE  */
    TOK_EDGEOP = 264,              /* TOK_EDGEOP  */
    TOK_EQUAL = 265,               /* TOK_EQUAL  */
    TOK_CLUSTER = 266,             /* TOK_CLUSTER  */
    TOK_COLON_STRING = 267,        /* TOK_COLON_STRING  */
    TOK_COLON_QUOTED_STRING = 268, /* TOK_COLON_QUOTED_STRING  */
    TOK_STRING = 269,              /* TOK_STRING  */
    TOK_QSTRING = 270,             /* TOK_QSTRING  */
    TOK_OSBRACKET = 271,           /* TOK_OSBRACKET  */
    TOK_CSBRACKET = 272,           /* TOK_CSBRACKET  */
    TOK_COLON = 273,               /* TOK_COLON  */
    TOK_TILDE = 274,               /* TOK_TILDE  */
    TOK_SEMICOLON = 275,           /* TOK_SEMICOLON  */
    TOK_PARAM_NAME = 276,          /* TOK_PARAM_NAME  */
    TOK_OPARENTHESIS = 277,        /* TOK_OPARENTHESIS  */
    TOK_CPARENTHESIS = 278,        /* TOK_CPARENTHESIS  */
    TOK_COMMAND_DEFPROC = 279,     /* TOK_COMMAND_DEFPROC  */
    TOK_COMMAND_REPLAY = 280,      /* TOK_COMMAND_REPLAY  */
    TOK_COMMAND_SET = 281,         /* TOK_COMMAND_SET  */
    TOK_BYE = 282,                 /* TOK_BYE  */
    TOK_IF = 283,                  /* TOK_IF  */
    TOK_THEN = 284,                /* TOK_THEN  */
    TOK_ELSE = 285,                /* TOK_ELSE  */
    TOK_COMMAND_INCLUDE = 286,     /* TOK_COMMAND_INCLUDE  */
    TOK_OCBRACKET = 287,           /* TOK_OCBRACKET  */
    TOK_CCBRACKET = 288,           /* TOK_CCBRACKET  */
    TOK_COMMA = 289,               /* TOK_COMMA  */
    TOK_DEFDESIGN = 290,           /* TOK_DEFDESIGN  */
    TOK_USEDESIGN = 291,           /* TOK_USEDESIGN  */
    TOK_DEFSTYLE = 292,            /* TOK_DEFSTYLE  */
    TOK_UNRECOGNIZED_CHAR = 293,   /* TOK_UNRECOGNIZED_CHAR  */
    TOK_WHITESPACE = 294,          /* TOK_WHITESPACE  */
    TOK_NEWLINE = 295,             /* TOK_NEWLINE  */
    TOK_COMMENT = 296              /* TOK_COMMENT  */
  };
  typedef enum graph_compile_tokentype graph_compile_token_kind_t;
#endif

/* Value type.  */
#if ! defined GRAPH_COMPILE_STYPE && ! defined GRAPH_COMPILE_STYPE_IS_DECLARED
union GRAPH_COMPILE_STYPE
{
#line 99 "./graph_lang.yy"

    str_view                                                   str;
    bool                                                       boolean;
    int                                                        i;
    GraphEdgeType                                              edgetype;
    CHAR_IF_CSH(gsl::owner<Attribute*>)                        attr;
    CHAR_IF_CSH(gsl::owner<GraphStyle*>)                       attrlist;
    CHAR_IF_CSH(gsl::owner<GraphNodePort*>)                    node;
    CHAR_IF_CSH(gsl::owner<GraphNodePortList*>)                nodelist;
    FIRST_IF_CSH(int, gsl::owner<GraphEdgeList*>)              edgelist;
    CHAR_IF_CSH(EdgeAttrlist)                                  edgelist_attrlist;
    gsl::owner<std::vector<std::string>*>                      stringlist;
    const char*                                                input_text_ptr;
    int                                                        condition; //0:false, 1:true, 2:had_error
    ECompareOperator                                           compare_op;
    multi_segment_string                                       multi_str;
    CHAR_IF_CSH(gsl::owner<Procedure*>)                        procedure;
    CHAR_IF_CSH(const Procedure)*                              cprocedure;
    gsl::owner<CHAR_IF_CSH(ProcParamDef)*>                     procparamdef;      //the CSH version holds an owning string of param value, null if none
    CHAR_IF_CSH(gsl::owner<ProcParamDefList*>)                 procparamdeflist;
    CHAR_IF_CSH(gsl::owner<ProcParamInvocation*>)              procparaminvoc;
    CHAR_IF_CSH(gsl::owner<ProcParamInvocationList*>)          procparaminvoclist;
    CHAR_IF_CSH(gsl::owner<ProcDefParseHelper<GraphStyle>*>)   procdefhelper;

#line 165 "graph_parser_compile.h"

};
typedef union GRAPH_COMPILE_STYPE GRAPH_COMPILE_STYPE;
# define GRAPH_COMPILE_STYPE_IS_TRIVIAL 1
# define GRAPH_COMPILE_STYPE_IS_DECLARED 1
#endif

/* Location type.  */
typedef SourceLocationRange<C_S_H> GRAPH_COMPILE_LTYPE;




int graph_compile_parse (graph::GraphChart &chart, graph::gv_parser_helper_compile &parse_helper, sv_reader<C_S_H> &input);


#endif /* !YY_GRAPH_COMPILE_GRAPH_PARSER_COMPILE_H_INCLUDED  */
