/* 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_MSC_COMPILE_MSC_PARSER_COMPILE_H_INCLUDED
# define YY_MSC_COMPILE_MSC_PARSER_COMPILE_H_INCLUDED
/* Debug traces.  */
#ifndef MSC_COMPILE_DEBUG
# if defined YYDEBUG
#if YYDEBUG
#   define MSC_COMPILE_DEBUG 1
#  else
#   define MSC_COMPILE_DEBUG 0
#  endif
# else /* ! defined YYDEBUG */
#  define MSC_COMPILE_DEBUG 0
# endif /* ! defined YYDEBUG */
#endif  /* ! defined MSC_COMPILE_DEBUG */
#if MSC_COMPILE_DEBUG
extern int msc_compile_debug;
#endif
/* "%code requires" blocks.  */
#line 5 "./msc_lang.yy"
 #undef C_S_H_IS_COMPILED 
#line 35 "./msc_lang.yy"

    #include "cgen_shapes.h"
    #include "msccsh.h"
    #include "commands.h"//For AttrNames and AttrValues
    #include "msc.h" //For AttrNames and AttrValues
    #include "msc_lexer.h"

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

    #ifdef C_S_H_IS_COMPILED
        #define C_S_H true
        #define CHAR_IF_CSH(A) char

    #else
        #define C_S_H false
        #define CHAR_IF_CSH(A) A
    #endif

    using namespace msc;

#line 82 "msc_parser_compile.h"

/* Token kinds.  */
#ifndef MSC_COMPILE_TOKENTYPE
# define MSC_COMPILE_TOKENTYPE
  enum msc_compile_tokentype
  {
    MSC_COMPILE_EMPTY = -2,
    TOK_EOF = 0,                   /* TOK_EOF  */
    MSC_COMPILE_error = 256,       /* error  */
    MSC_COMPILE_UNDEF = 257,       /* "invalid token"  */
    TOK_STRING = 258,              /* TOK_STRING  */
    TOK_QSTRING = 259,             /* TOK_QSTRING  */
    TOK_MULTILINE_QSTRING = 260,   /* TOK_MULTILINE_QSTRING  */
    TOK_NUMBER = 261,              /* TOK_NUMBER  */
    TOK_DASH = 262,                /* TOK_DASH  */
    TOK_EQUAL = 263,               /* TOK_EQUAL  */
    TOK_COMMA = 264,               /* TOK_COMMA  */
    TOK_TILDE = 265,               /* TOK_TILDE  */
    TOK_SEMICOLON = 266,           /* TOK_SEMICOLON  */
    TOK_PLUS = 267,                /* TOK_PLUS  */
    TOK_PLUS_EQUAL = 268,          /* TOK_PLUS_EQUAL  */
    TOK_PIPE_SYMBOL = 269,         /* TOK_PIPE_SYMBOL  */
    TOK_OCBRACKET = 270,           /* TOK_OCBRACKET  */
    TOK_CCBRACKET = 271,           /* TOK_CCBRACKET  */
    TOK_OSBRACKET = 272,           /* TOK_OSBRACKET  */
    TOK_CSBRACKET = 273,           /* TOK_CSBRACKET  */
    TOK_OPARENTHESIS = 274,        /* TOK_OPARENTHESIS  */
    TOK_CPARENTHESIS = 275,        /* TOK_CPARENTHESIS  */
    TOK_PARAM_NAME = 276,          /* TOK_PARAM_NAME  */
    TOK_ASTERISK = 277,            /* TOK_ASTERISK  */
    TOK_MSC = 278,                 /* TOK_MSC  */
    TOK_COLON_STRING = 279,        /* TOK_COLON_STRING  */
    TOK_COLON_QUOTED_STRING = 280, /* TOK_COLON_QUOTED_STRING  */
    TOK_STYLE_NAME = 281,          /* TOK_STYLE_NAME  */
    TOK_COLORDEF = 282,            /* TOK_COLORDEF  */
    TOK_COLORDEF_NAME_NUMBER = 283, /* TOK_COLORDEF_NAME_NUMBER  */
    TOK_REL_TO = 284,              /* TOK_REL_TO  */
    TOK_REL_FROM = 285,            /* TOK_REL_FROM  */
    TOK_REL_BIDIR = 286,           /* TOK_REL_BIDIR  */
    TOK_REL_X = 287,               /* TOK_REL_X  */
    TOK_REL_DASH_X = 288,          /* TOK_REL_DASH_X  */
    TOK_REL_MSCGEN = 289,          /* TOK_REL_MSCGEN  */
    TOK_SPECIAL_ARC = 290,         /* TOK_SPECIAL_ARC  */
    TOK_EMPH = 291,                /* TOK_EMPH  */
    TOK_EMPH_PLUS_PLUS = 292,      /* TOK_EMPH_PLUS_PLUS  */
    TOK_OINLINE = 293,             /* TOK_OINLINE  */
    TOK_CINLINE = 294,             /* TOK_CINLINE  */
    TOK_INLINE = 295,              /* TOK_INLINE  */
    TOK_UNMATCHED_INLINE = 296,    /* TOK_UNMATCHED_INLINE  */
    TOK_COMMAND_HEADING = 297,     /* TOK_COMMAND_HEADING  */
    TOK_COMMAND_NUDGE = 298,       /* TOK_COMMAND_NUDGE  */
    TOK_COMMAND_NEWPAGE = 299,     /* TOK_COMMAND_NEWPAGE  */
    TOK_COMMAND_DEFSHAPE = 300,    /* TOK_COMMAND_DEFSHAPE  */
    TOK_COMMAND_DEFCOLOR = 301,    /* TOK_COMMAND_DEFCOLOR  */
    TOK_COMMAND_DEFSTYLE = 302,    /* TOK_COMMAND_DEFSTYLE  */
    TOK_COMMAND_DEFDESIGN = 303,   /* TOK_COMMAND_DEFDESIGN  */
    TOK_COMMAND_DEFPROC = 304,     /* TOK_COMMAND_DEFPROC  */
    TOK_COMMAND_REPLAY = 305,      /* TOK_COMMAND_REPLAY  */
    TOK_COMMAND_SET = 306,         /* TOK_COMMAND_SET  */
    TOK_COMMAND_INCLUDE = 307,     /* TOK_COMMAND_INCLUDE  */
    TOK_COMMAND_BIG = 308,         /* TOK_COMMAND_BIG  */
    TOK_COMMAND_BOX = 309,         /* TOK_COMMAND_BOX  */
    TOK_COMMAND_PIPE = 310,        /* TOK_COMMAND_PIPE  */
    TOK_COMMAND_MARK = 311,        /* TOK_COMMAND_MARK  */
    TOK_COMMAND_MARK_SRC = 312,    /* TOK_COMMAND_MARK_SRC  */
    TOK_COMMAND_MARK_DST = 313,    /* TOK_COMMAND_MARK_DST  */
    TOK_COMMAND_PARALLEL = 314,    /* TOK_COMMAND_PARALLEL  */
    TOK_COMMAND_OVERLAP = 315,     /* TOK_COMMAND_OVERLAP  */
    TOK_COMMAND_INLINE = 316,      /* TOK_COMMAND_INLINE  */
    TOK_VERTICAL = 317,            /* TOK_VERTICAL  */
    TOK_VERTICAL_SHAPE = 318,      /* TOK_VERTICAL_SHAPE  */
    TOK_AT = 319,                  /* TOK_AT  */
    TOK_LOST = 320,                /* TOK_LOST  */
    TOK_AT_POS = 321,              /* TOK_AT_POS  */
    TOK_SHOW = 322,                /* TOK_SHOW  */
    TOK_HIDE = 323,                /* TOK_HIDE  */
    TOK_ACTIVATE = 324,            /* TOK_ACTIVATE  */
    TOK_DEACTIVATE = 325,          /* TOK_DEACTIVATE  */
    TOK_BYE = 326,                 /* TOK_BYE  */
    TOK_START = 327,               /* TOK_START  */
    TOK_BEFORE = 328,              /* TOK_BEFORE  */
    TOK_END = 329,                 /* TOK_END  */
    TOK_AFTER = 330,               /* TOK_AFTER  */
    TOK_COMMAND_VSPACE = 331,      /* TOK_COMMAND_VSPACE  */
    TOK_COMMAND_HSPACE = 332,      /* TOK_COMMAND_HSPACE  */
    TOK_COMMAND_SYMBOL = 333,      /* TOK_COMMAND_SYMBOL  */
    TOK_COMMAND_NOTE = 334,        /* TOK_COMMAND_NOTE  */
    TOK_COMMAND_COMMENT = 335,     /* TOK_COMMAND_COMMENT  */
    TOK_COMMAND_ENDNOTE = 336,     /* TOK_COMMAND_ENDNOTE  */
    TOK_COMMAND_FOOTNOTE = 337,    /* TOK_COMMAND_FOOTNOTE  */
    TOK_COMMAND_TITLE = 338,       /* TOK_COMMAND_TITLE  */
    TOK_COMMAND_SUBTITLE = 339,    /* TOK_COMMAND_SUBTITLE  */
    TOK_COMMAND_TEXT = 340,        /* TOK_COMMAND_TEXT  */
    TOK_SHAPE_COMMAND = 341,       /* TOK_SHAPE_COMMAND  */
    TOK_JOIN = 342,                /* TOK_JOIN  */
    TOK_IF = 343,                  /* TOK_IF  */
    TOK_THEN = 344,                /* TOK_THEN  */
    TOK_ELSE = 345,                /* TOK_ELSE  */
    TOK_MSCGEN_RBOX = 346,         /* TOK_MSCGEN_RBOX  */
    TOK_MSCGEN_ABOX = 347,         /* TOK_MSCGEN_ABOX  */
    TOK_UNRECOGNIZED_CHAR = 348,   /* TOK_UNRECOGNIZED_CHAR  */
    TOK_WHITESPACE = 349,          /* TOK_WHITESPACE  */
    TOK_NEWLINE = 350,             /* TOK_NEWLINE  */
    TOK_COMMENT = 351,             /* TOK_COMMENT  */
    TOK_SYMBOLPOS_ABOVE = 352,     /* TOK_SYMBOLPOS_ABOVE  */
    TOK_SYMBOLPOS_BELOW = 353,     /* TOK_SYMBOLPOS_BELOW  */
    TOK_SYMBOLPOS_LEFTOF = 354,    /* TOK_SYMBOLPOS_LEFTOF  */
    TOK_SYMBOLPOS_RIGHTOF = 355,   /* TOK_SYMBOLPOS_RIGHTOF  */
    TOK_SYMBOLPOS_AROUND = 356     /* TOK_SYMBOLPOS_AROUND  */
  };
  typedef enum msc_compile_tokentype msc_compile_token_kind_t;
#endif

/* Value type.  */
#if ! defined MSC_COMPILE_STYPE && ! defined MSC_COMPILE_STYPE_IS_DECLARED
union MSC_COMPILE_STYPE
{
#line 136 "./msc_lang.yy"

    str_view                                                   str;
    const char*                                                input_text_ptr;
    int                                                        condition; //0:false, 1:true, 2:had_error
    ECompareOperator                                           compare_op;
    multi_segment_string                                       multi_str;
    gsl::owner<CHAR_IF_CSH(ArcBase)*>                          arcbase;
    gsl::owner<CHAR_IF_CSH(ArcList)*>                          arclist;
    gsl::owner<CHAR_IF_CSH(Arrow)*>                            arcarrow;
    gsl::owner<CHAR_IF_CSH(Vertical)*>                         arcvertarrow;
    gsl::owner<CHAR_IF_CSH(Box)*>                              arcbox;
    gsl::owner<CHAR_IF_CSH(Pipe)*>                             arcpipe;
    gsl::owner<CHAR_IF_CSH(BoxSeries)*>                        arcboxseries;
    gsl::owner<CHAR_IF_CSH(PipeSeries)*>                       arcpipeseries;
    gsl::owner<CHAR_IF_CSH(ParallelBlocks)*>                   arcparallel;
    EArcSymbol                                                 arcsymbol;
    gsl::owner<CHAR_IF_CSH(EntityAppHelper)*>                  entitylist;
    gsl::owner<CHAR_IF_CSH(Attribute)*>                        attrib;
    gsl::owner<CHAR_IF_CSH(AttributeList)*>                    attriblist;
    gsl::owner<CHAR_IF_CSH(VertXPos)*>                         vertxpos;
    gsl::owner<CHAR_IF_CSH(VertRefPos)*>                       vertrefpos;
    gsl::owner<CHAR_IF_CSH(ExtVertXPos)*>                      extvertxpos;
    gsl::owner<CHAR_IF_CSH(NamePair)*>                         namerel;
    gsl::owner<std::vector<std::string>*>                      stringlist;
    CHAR_IF_CSH(ESide)                                         eside;
    gsl::owner<CHAR_IF_CSH(ArrowSegmentData)*>                 arcsegdata;
    Vertical::EVerticalShape                                   vshape;
    gsl::owner<CHAR_IF_CSH(ArcTypePlusDir)*>                   arctypeplusdir;
    ShapeElement::Type                                         shapecommand;
    gsl::owner<CHAR_IF_CSH(Shape)*>                            shape;
    gsl::owner<CHAR_IF_CSH(ShapeElement)*>                     shapeelement;
    gsl::owner<CHAR_IF_CSH(ArrowEnding)*>                      arrowending;
    gsl::owner<CHAR_IF_CSH(Procedure)*>                        procedure;
    CHAR_IF_CSH(const Procedure)*                              cprocedure;
    gsl::owner<CHAR_IF_CSH(ProcParamDef)*>                     procparamdef;
    gsl::owner<CHAR_IF_CSH(ProcParamDefList)*>                 procparamdeflist;
    gsl::owner<CHAR_IF_CSH(ProcParamInvocation)*>              procparaminvoc;
    gsl::owner<CHAR_IF_CSH(ProcParamInvocationList)*>          procparaminvoclist;
    gsl::owner<CHAR_IF_CSH(ProcDefParseHelper<AttributeList>)*>procdefhelper;

#line 241 "msc_parser_compile.h"

};
typedef union MSC_COMPILE_STYPE MSC_COMPILE_STYPE;
# define MSC_COMPILE_STYPE_IS_TRIVIAL 1
# define MSC_COMPILE_STYPE_IS_DECLARED 1
#endif

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




int msc_compile_parse (msc::MscChart &chart, procedure_parse_helper &proc_helper, msc::lexing_state &current_state, sv_reader<C_S_H> &input);


#endif /* !YY_MSC_COMPILE_MSC_PARSER_COMPILE_H_INCLUDED  */
