Skip to content
Myr

parser.h

This file

Path

src/parser.h

212 lines · 6.6 KiB · C

Last changed by

Parse `?//` as `?` and `//` outside destructuring patterns (#3593)A4-Tacksbefore adoptiona19efdd

History of this file

Take it

1/* A Bison parser, made by GNU Bison 3.8.2.  */23/* Bison interface for Yacc-like parsers in C45   Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,6   Inc.78   This program is free software: you can redistribute it and/or modify9   it under the terms of the GNU General Public License as published by10   the Free Software Foundation, either version 3 of the License, or11   (at your option) any later version.1213   This program is distributed in the hope that it will be useful,14   but WITHOUT ANY WARRANTY; without even the implied warranty of15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the16   GNU General Public License for more details.1718   You should have received a copy of the GNU General Public License19   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */2021/* As a special exception, you may create a larger work that contains22   part or all of the Bison parser skeleton and distribute that work23   under terms of your choice, so long as that work isn't itself a24   parser generator using the skeleton or a modified version thereof25   as a parser skeleton.  Alternatively, if you modify or redistribute26   the parser skeleton itself, you may (at your option) remove this27   special exception, which will cause the skeleton and the resulting28   Bison output files to be licensed under the GNU General Public29   License without this special exception.3031   This special exception was added by the Free Software Foundation in32   version 2.2 of Bison.  */3334/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,35   especially those whose name start with YY_ or yy_.  They are36   private implementation details that can be changed or removed.  */3738#ifndef YY_YY_SRC_PARSER_H_INCLUDED39# define YY_YY_SRC_PARSER_H_INCLUDED40/* Debug traces.  */41#ifndef YYDEBUG42# define YYDEBUG 043#endif44#if YYDEBUG45extern int yydebug;46#endif47/* "%code requires" blocks.  */48#line 12 "src/parser.y"4950#include "locfile.h"51struct lexer_param;5253#define YYLTYPE location54#define YYLLOC_DEFAULT(Loc, Rhs, N)             \55  do {                                          \56    if (N) {                                    \57      (Loc).start = YYRHSLOC(Rhs, 1).start;     \58      (Loc).end = YYRHSLOC(Rhs, N).end;         \59    } else {                                    \60      (Loc).start = YYRHSLOC(Rhs, 0).end;       \61      (Loc).end = YYRHSLOC(Rhs, 0).end;         \62    }                                           \63  } while (0)6465#line 66 "src/parser.h"6667/* Token kinds.  */68#ifndef YYTOKENTYPE69# define YYTOKENTYPE70  enum yytokentype71  {72    YYEMPTY = -2,73    YYEOF = 0,                     /* "end of file"  */74    YYerror = 256,                 /* error  */75    YYUNDEF = 257,                 /* "invalid token"  */76    INVALID_CHARACTER = 258,       /* INVALID_CHARACTER  */77    IDENT = 259,                   /* IDENT  */78    FIELD = 260,                   /* FIELD  */79    BINDING = 261,                 /* BINDING  */80    LITERAL = 262,                 /* LITERAL  */81    FORMAT = 263,                  /* FORMAT  */82    REC = 264,                     /* ".."  */83    SETMOD = 265,                  /* "%="  */84    EQ = 266,                      /* "=="  */85    NEQ = 267,                     /* "!="  */86    DEFINEDOR = 268,               /* "//"  */87    AS = 269,                      /* "as"  */88    DEF = 270,                     /* "def"  */89    MODULE = 271,                  /* "module"  */90    IMPORT = 272,                  /* "import"  */91    INCLUDE = 273,                 /* "include"  */92    IF = 274,                      /* "if"  */93    THEN = 275,                    /* "then"  */94    ELSE = 276,                    /* "else"  */95    ELSE_IF = 277,                 /* "elif"  */96    REDUCE = 278,                  /* "reduce"  */97    FOREACH = 279,                 /* "foreach"  */98    END = 280,                     /* "end"  */99    AND = 281,                     /* "and"  */100    OR = 282,                      /* "or"  */101    TRY = 283,                     /* "try"  */102    CATCH = 284,                   /* "catch"  */103    LABEL = 285,                   /* "label"  */104    BREAK = 286,                   /* "break"  */105    LOC = 287,                     /* "$__loc__"  */106    SETPIPE = 288,                 /* "|="  */107    SETPLUS = 289,                 /* "+="  */108    SETMINUS = 290,                /* "-="  */109    SETMULT = 291,                 /* "*="  */110    SETDIV = 292,                  /* "/="  */111    SETDEFINEDOR = 293,            /* "//="  */112    LESSEQ = 294,                  /* "<="  */113    GREATEREQ = 295,               /* ">="  */114    QQSTRING_START = 296,          /* QQSTRING_START  */115    QQSTRING_TEXT = 297,           /* QQSTRING_TEXT  */116    QQSTRING_INTERP_START = 298,   /* QQSTRING_INTERP_START  */117    QQSTRING_INTERP_END = 299,     /* QQSTRING_INTERP_END  */118    QQSTRING_END = 300,            /* QQSTRING_END  */119    FUNCDEF = 301,                 /* FUNCDEF  */120    NONOPT = 302                   /* NONOPT  */121  };122  typedef enum yytokentype yytoken_kind_t;123#endif124/* Token kinds.  */125#define YYEMPTY -2126#define YYEOF 0127#define YYerror 256128#define YYUNDEF 257129#define INVALID_CHARACTER 258130#define IDENT 259131#define FIELD 260132#define BINDING 261133#define LITERAL 262134#define FORMAT 263135#define REC 264136#define SETMOD 265137#define EQ 266138#define NEQ 267139#define DEFINEDOR 268140#define AS 269141#define DEF 270142#define MODULE 271143#define IMPORT 272144#define INCLUDE 273145#define IF 274146#define THEN 275147#define ELSE 276148#define ELSE_IF 277149#define REDUCE 278150#define FOREACH 279151#define END 280152#define AND 281153#define OR 282154#define TRY 283155#define CATCH 284156#define LABEL 285157#define BREAK 286158#define LOC 287159#define SETPIPE 288160#define SETPLUS 289161#define SETMINUS 290162#define SETMULT 291163#define SETDIV 292164#define SETDEFINEDOR 293165#define LESSEQ 294166#define GREATEREQ 295167#define QQSTRING_START 296168#define QQSTRING_TEXT 297169#define QQSTRING_INTERP_START 298170#define QQSTRING_INTERP_END 299171#define QQSTRING_END 300172#define FUNCDEF 301173#define NONOPT 302174175/* Value type.  */176#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED177union YYSTYPE178{179#line 32 "src/parser.y"180181  jv literal;182  block blk;183184#line 185 "src/parser.h"185186};187typedef union YYSTYPE YYSTYPE;188# define YYSTYPE_IS_TRIVIAL 1189# define YYSTYPE_IS_DECLARED 1190#endif191192/* Location type.  */193#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED194typedef struct YYLTYPE YYLTYPE;195struct YYLTYPE196{197  int first_line;198  int first_column;199  int last_line;200  int last_column;201};202# define YYLTYPE_IS_DECLARED 1203# define YYLTYPE_IS_TRIVIAL 1204#endif205206207208209int yyparse (block* answer, int* errors, struct locfile* locations, struct lexer_param* lexer_param_ptr);210211212#endif /* !YY_YY_SRC_PARSER_H_INCLUDED  */