/* 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_CONFIG_USR_LIB_CONFIG_CFGPARSE_H_INCLUDED
# define YY_CONFIG_USR_LIB_CONFIG_CFGPARSE_H_INCLUDED
/* Debug traces.  */
#ifndef CONFIGDEBUG
# if defined YYDEBUG
#if YYDEBUG
#   define CONFIGDEBUG 1
#  else
#   define CONFIGDEBUG 0
#  endif
# else /* ! defined YYDEBUG */
#  define CONFIGDEBUG 1
# endif /* ! defined YYDEBUG */
#endif  /* ! defined CONFIGDEBUG */
#if CONFIGDEBUG
extern int configdebug;
#endif
/* "%code requires" blocks.  */
#line 18 "usr/lib/config/cfgparse.y"

#include "configuration.h"
typedef void* configscan_t;

typedef void (*error_hook_f)(int line, int col, const char *msg);

#line 64 "usr/lib/config/cfgparse.h"

/* Token kinds.  */
#ifndef CONFIGTOKENTYPE
# define CONFIGTOKENTYPE
  enum configtokentype
  {
    CONFIGEMPTY = -2,
    CONFIGEOF = 0,                 /* "end of file"  */
    CONFIGerror = 256,             /* error  */
    CONFIGUNDEF = 257,             /* "invalid token"  */
    EOL = 258,                     /* EOL  */
    EQUAL = 259,                   /* EQUAL  */
    BEGIN_DEF = 260,               /* BEGIN_DEF  */
    END_DEF = 261,                 /* END_DEF  */
    BEGIN_LIST = 262,              /* BEGIN_LIST  */
    END_LIST = 263,                /* END_LIST  */
    COMMA = 264,                   /* COMMA  */
    FILEVERSION = 265,             /* FILEVERSION  */
    NUMBER = 266,                  /* NUMBER  */
    VERSION_TOK = 267,             /* VERSION_TOK  */
    BARE = 268,                    /* BARE  */
    COMMENT_TOK = 269,             /* COMMENT_TOK  */
    STRING_TOK = 270               /* STRING_TOK  */
  };
  typedef enum configtokentype configtoken_kind_t;
#endif

/* Value type.  */
#if ! defined CONFIGSTYPE && ! defined CONFIGSTYPE_IS_DECLARED
union CONFIGSTYPE
{
#line 50 "usr/lib/config/cfgparse.y"

  char *str;
  unsigned long num;
  struct ConfigBaseNode *node;

#line 102 "usr/lib/config/cfgparse.h"

};
typedef union CONFIGSTYPE CONFIGSTYPE;
# define CONFIGSTYPE_IS_TRIVIAL 1
# define CONFIGSTYPE_IS_DECLARED 1
#endif

/* Location type.  */
#if ! defined CONFIGLTYPE && ! defined CONFIGLTYPE_IS_DECLARED
typedef struct CONFIGLTYPE CONFIGLTYPE;
struct CONFIGLTYPE
{
  int first_line;
  int first_column;
  int last_line;
  int last_column;
};
# define CONFIGLTYPE_IS_DECLARED 1
# define CONFIGLTYPE_IS_TRIVIAL 1
#endif




int configparse (configscan_t scanner, struct ConfigBaseNode **res, error_hook_f error_hook, int trackComments);

/* "%code provides" blocks.  */
#line 26 "usr/lib/config/cfgparse.y"

  // Tell Flex the expected prototype of yylex.
  #define YY_DECL                             \
    int configlex (CONFIGSTYPE *yylval_param, CONFIGLTYPE *yylloc_param, configscan_t yyscanner)

  // Declare the scanner.
  YY_DECL;

 
  static inline void configerror(CONFIGLTYPE *lloc, configscan_t scanner,
                                 struct ConfigBaseNode **res,
                                 error_hook_f error_hook,
                                 int trackComments,
                                 const char *msg)
  {
    (void)scanner;
    (void)res;
    (void)trackComments;
    if (error_hook) {
      error_hook(lloc->first_line, lloc->first_column, msg);
    }
  }

#line 154 "usr/lib/config/cfgparse.h"

#endif /* !YY_CONFIG_USR_LIB_CONFIG_CFGPARSE_H_INCLUDED  */
