/* 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_GRECS_GRECS_GRECS_GRAM_H_INCLUDED
# define YY_GRECS_GRECS_GRECS_GRAM_H_INCLUDED
/* Debug traces.  */
#ifndef GRECS_GRECS_DEBUG
# if defined YYDEBUG
#if YYDEBUG
#   define GRECS_GRECS_DEBUG 1
#  else
#   define GRECS_GRECS_DEBUG 0
#  endif
# else /* ! defined YYDEBUG */
#  define GRECS_GRECS_DEBUG 1
# endif /* ! defined YYDEBUG */
#endif  /* ! defined GRECS_GRECS_DEBUG */
#if GRECS_GRECS_DEBUG
extern int grecs_grecs_debug;
#endif
/* "%code requires" blocks.  */
#line 32 "grecs-gram.y"

#include <signal.h>
#include <grecs/symtab.h>
#include <glob.h>

typedef void *yyscan_t;

struct input_file_ident {
	ino_t i_node;
	dev_t device;
	pid_t pid;
};

struct buffer_ctx;

struct parser_control {
	struct grecs_node *parse_tree;
	struct grecs_locus_point point;
	int error_suppress;
	/* Line accumulator. */
	struct grecs_txtacc *acc;

	int preproc_mode;
	int emit_syncline; /* If not null, emit syncline before next line
			      of output. */
	int emit_comment_warning;
	int beginning_of_line; /* True if output is at the beginning of line */
	/* Here-document support.*/
	char *multiline_delimiter;       /* Here-document delimiter text. */
	size_t multiline_delimiter_len;  /* Its length. */
	int multiline_unescape;          /* Unescape here-document contents */
	/* Source inclusion support. */
	glob_t include_glob;
	size_t include_pos;
	int include_once;
	struct grecs_symtab *incl_sources;
	/* Input context */
	struct buffer_ctx *context_stack;
	struct input_file_ident input_file_ident;
	/* Sigchld handling */
	int sigchld_reset;
	struct sigaction oldsigchld;
};
#define GRECS_GRECS_LTYPE grecs_locus_t

#line 103 "grecs-gram.h"

/* Token kinds.  */
#ifndef GRECS_GRECS_TOKENTYPE
# define GRECS_GRECS_TOKENTYPE
  enum grecs_grecs_tokentype
  {
    GRECS_GRECS_EMPTY = -2,
    GRECS_GRECS_EOF = 0,           /* "end of file"  */
    GRECS_GRECS_error = 256,       /* error  */
    GRECS_GRECS_UNDEF = 257,       /* "invalid token"  */
    STRING = 258,                  /* STRING  */
    QSTRING = 259,                 /* QSTRING  */
    MSTRING = 260,                 /* MSTRING  */
    IDENT = 261                    /* IDENT  */
  };
  typedef enum grecs_grecs_tokentype grecs_grecs_token_kind_t;
#endif

/* Value type.  */
#if ! defined GRECS_GRECS_STYPE && ! defined GRECS_GRECS_STYPE_IS_DECLARED
union GRECS_GRECS_STYPE
{
#line 93 "grecs-gram.y"

	char *string;
	grecs_value_t svalue, *pvalue;
	struct grecs_list *list;
	struct grecs_node *node;
	grecs_locus_t locus;
	struct { struct grecs_node *head, *tail; } node_list;

#line 135 "grecs-gram.h"

};
typedef union GRECS_GRECS_STYPE GRECS_GRECS_STYPE;
# define GRECS_GRECS_STYPE_IS_TRIVIAL 1
# define GRECS_GRECS_STYPE_IS_DECLARED 1
#endif

/* Location type.  */
#if ! defined GRECS_GRECS_LTYPE && ! defined GRECS_GRECS_LTYPE_IS_DECLARED
typedef struct GRECS_GRECS_LTYPE GRECS_GRECS_LTYPE;
struct GRECS_GRECS_LTYPE
{
  int first_line;
  int first_column;
  int last_line;
  int last_column;
};
# define GRECS_GRECS_LTYPE_IS_DECLARED 1
# define GRECS_GRECS_LTYPE_IS_TRIVIAL 1
#endif




int grecs_grecs_parse (struct parser_control *pctl, void *yyscanner);

/* "%code provides" blocks.  */
#line 77 "grecs-gram.y"

int grecs_grecs_lex(GRECS_GRECS_STYPE *lvalp, GRECS_GRECS_LTYPE *llocp,
		    yyscan_t yyscanner);
int grecs_grecs_lex_init_extra(struct parser_control *, yyscan_t *);
int grecs_grecs_lex_destroy (yyscan_t);
void grecs_grecs_error (GRECS_GRECS_LTYPE const *llocp,
			  struct parser_control *pctl, yyscan_t scanner,
			  char const *msg);

struct grecs_node *grecs_grecs_parser(const char *name, int traceflags);

#line 175 "grecs-gram.h"

#endif /* !YY_GRECS_GRECS_GRECS_GRAM_H_INCLUDED  */
