# 1 "glr-regr14.c" # 1 "" # 1 "" # 1 "glr-regr14.c" # 1 "glr-regr14.y" # 12 "glr-regr14.y" typedef union # 31 "glr-regr14.y" { char value; } # 77 "glr-regr14.c" YYSTYPE; typedef struct YYLTYPE { int first_line; int first_column; int last_line; int last_column; } YYLTYPE; # 120 "glr-regr14.c" static YYSTYPE yyval_default; # 33 "glr-regr14.y" # 1 "/usr/include/stdio.h" 1 3 4 # 41 "/usr/include/stdio.h" 3 4 # 1 "/usr/include/sys/cdefs.h" 1 3 4 # 41 "/usr/include/sys/cdefs.h" 3 4 # 1 "/usr/include/machine/cdefs.h" 1 3 4 # 42 "/usr/include/sys/cdefs.h" 2 3 4 # 42 "/usr/include/stdio.h" 2 3 4 # 1 "/usr/include/sys/_types.h" 1 3 4 # 37 "/usr/include/sys/_types.h" 3 4 # 1 "/usr/include/machine/_types.h" 1 3 4 # 45 "/usr/include/machine/_types.h" 3 4 typedef signed char __int8_t; typedef unsigned char __uint8_t; typedef short __int16_t; typedef unsigned short __uint16_t; typedef int __int32_t; typedef unsigned int __uint32_t; typedef long long __int64_t; typedef unsigned long long __uint64_t; typedef __int8_t __int_least8_t; typedef __uint8_t __uint_least8_t; typedef __int16_t __int_least16_t; typedef __uint16_t __uint_least16_t; typedef __int32_t __int_least32_t; typedef __uint32_t __uint_least32_t; typedef __int64_t __int_least64_t; typedef __uint64_t __uint_least64_t; typedef __int32_t __int_fast8_t; typedef __uint32_t __uint_fast8_t; typedef __int32_t __int_fast16_t; typedef __uint32_t __uint_fast16_t; typedef __int32_t __int_fast32_t; typedef __uint32_t __uint_fast32_t; typedef __int64_t __int_fast64_t; typedef __uint64_t __uint_fast64_t; typedef long __intptr_t; typedef unsigned long __uintptr_t; typedef __int64_t __intmax_t; typedef __uint64_t __uintmax_t; typedef __int32_t __register_t; typedef unsigned long __vaddr_t; typedef unsigned long __vsize_t; typedef unsigned long long __paddr_t; typedef unsigned long long __psize_t; typedef int __clock_t; typedef int __clockid_t; typedef long long __off_t; typedef long __ptrdiff_t; typedef unsigned long __size_t; typedef long __ssize_t; typedef int __time_t; typedef int __timer_t; typedef __builtin_va_list __va_list; typedef int __wchar_t; typedef int __wint_t; typedef int __rune_t; typedef void * __wctrans_t; typedef void * __wctype_t; # 38 "/usr/include/sys/_types.h" 2 3 4 typedef unsigned long __cpuid_t; typedef __int32_t __dev_t; typedef __uint32_t __fixpt_t; typedef __uint32_t __gid_t; typedef __uint32_t __id_t; typedef __uint32_t __in_addr_t; typedef __uint16_t __in_port_t; typedef __uint32_t __ino_t; typedef long __key_t; typedef __uint32_t __mode_t; typedef __uint32_t __nlink_t; typedef __int32_t __pid_t; typedef __uint64_t __rlim_t; typedef __uint8_t __sa_family_t; typedef __int32_t __segsz_t; typedef __uint32_t __socklen_t; typedef __int32_t __swblk_t; typedef __uint32_t __uid_t; typedef __uint32_t __useconds_t; typedef __int32_t __suseconds_t; typedef union { char __mbstate8[128]; __int64_t __mbstateL; } __mbstate_t; # 43 "/usr/include/stdio.h" 2 3 4 # 1 "/usr/include/sys/types.h" 1 3 4 # 45 "/usr/include/sys/types.h" 3 4 # 1 "/usr/include/machine/endian.h" 1 3 4 # 68 "/usr/include/machine/endian.h" 3 4 # 1 "/usr/include/sys/endian.h" 1 3 4 # 161 "/usr/include/sys/endian.h" 3 4 __uint64_t htobe64(__uint64_t); __uint32_t htobe32(__uint32_t); __uint16_t htobe16(__uint16_t); __uint64_t betoh64(__uint64_t); __uint32_t betoh32(__uint32_t); __uint16_t betoh16(__uint16_t); __uint64_t htole64(__uint64_t); __uint32_t htole32(__uint32_t); __uint16_t htole16(__uint16_t); __uint64_t letoh64(__uint64_t); __uint32_t letoh32(__uint32_t); __uint16_t letoh16(__uint16_t); # 69 "/usr/include/machine/endian.h" 2 3 4 # 46 "/usr/include/sys/types.h" 2 3 4 typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned int u_int; typedef unsigned long u_long; typedef unsigned char unchar; typedef unsigned short ushort; typedef unsigned int uint; typedef unsigned long ulong; typedef __cpuid_t cpuid_t; typedef __register_t register_t; # 72 "/usr/include/sys/types.h" 3 4 typedef __int8_t int8_t; typedef __uint8_t uint8_t; typedef __int16_t int16_t; typedef __uint16_t uint16_t; typedef __int32_t int32_t; typedef __uint32_t uint32_t; typedef __int64_t int64_t; typedef __uint64_t uint64_t; typedef __uint8_t u_int8_t; typedef __uint16_t u_int16_t; typedef __uint32_t u_int32_t; typedef __uint64_t u_int64_t; typedef __int64_t quad_t; typedef __uint64_t u_quad_t; typedef quad_t * qaddr_t; typedef __vaddr_t vaddr_t; typedef __paddr_t paddr_t; typedef __vsize_t vsize_t; typedef __psize_t psize_t; typedef char * caddr_t; typedef __int32_t daddr_t; typedef __dev_t dev_t; typedef __fixpt_t fixpt_t; typedef __gid_t gid_t; typedef __id_t id_t; typedef __ino_t ino_t; typedef __key_t key_t; typedef __mode_t mode_t; typedef __nlink_t nlink_t; typedef __pid_t pid_t; typedef __rlim_t rlim_t; typedef __segsz_t segsz_t; typedef __swblk_t swblk_t; typedef __uid_t uid_t; typedef __useconds_t useconds_t; typedef __suseconds_t suseconds_t; # 156 "/usr/include/sys/types.h" 3 4 typedef __in_addr_t in_addr_t; typedef __in_port_t in_port_t; typedef __sa_family_t sa_family_t; typedef __socklen_t socklen_t; typedef __clock_t clock_t; typedef __clockid_t clockid_t; typedef __size_t size_t; typedef __ssize_t ssize_t; typedef __time_t time_t; typedef __timer_t timer_t; typedef __off_t off_t; # 205 "/usr/include/sys/types.h" 3 4 off_t lseek(int, off_t, int); int ftruncate(int, off_t); int truncate(const char *, off_t); # 220 "/usr/include/sys/types.h" 3 4 # 1 "/usr/include/sys/select.h" 1 3 4 # 38 "/usr/include/sys/select.h" 3 4 # 1 "/usr/include/sys/time.h" 1 3 4 # 39 "/usr/include/sys/time.h" 3 4 # 1 "/usr/include/sys/types.h" 1 3 4 # 40 "/usr/include/sys/time.h" 2 3 4 # 49 "/usr/include/sys/time.h" 3 4 struct timeval { long tv_sec; long tv_usec; }; struct timespec { time_t tv_sec; long tv_nsec; }; # 74 "/usr/include/sys/time.h" 3 4 struct timezone { int tz_minuteswest; int tz_dsttime; }; # 139 "/usr/include/sys/time.h" 3 4 struct bintime { time_t sec; uint64_t frac; }; static __inline void bintime_addx(struct bintime *bt, uint64_t x) { uint64_t u; u = bt->frac; bt->frac += x; if (u > bt->frac) bt->sec++; } static __inline void bintime_add(struct bintime *bt, struct bintime *bt2) { uint64_t u; u = bt->frac; bt->frac += bt2->frac; if (u > bt->frac) bt->sec++; bt->sec += bt2->sec; } static __inline void bintime_sub(struct bintime *bt, struct bintime *bt2) { uint64_t u; u = bt->frac; bt->frac -= bt2->frac; if (u < bt->frac) bt->sec--; bt->sec -= bt2->sec; } # 193 "/usr/include/sys/time.h" 3 4 static __inline void bintime2timespec(struct bintime *bt, struct timespec *ts) { ts->tv_sec = bt->sec; ts->tv_nsec = (long)(((uint64_t)1000000000 * (uint32_t)(bt->frac >> 32)) >> 32); } static __inline void timespec2bintime(struct timespec *ts, struct bintime *bt) { bt->sec = ts->tv_sec; bt->frac = (uint64_t)ts->tv_nsec * (uint64_t)18446744073ULL; } static __inline void bintime2timeval(struct bintime *bt, struct timeval *tv) { tv->tv_sec = bt->sec; tv->tv_usec = (long)(((uint64_t)1000000 * (uint32_t)(bt->frac >> 32)) >> 32); } static __inline void timeval2bintime(struct timeval *tv, struct bintime *bt) { bt->sec = (time_t)tv->tv_sec; bt->frac = (uint64_t)tv->tv_usec * (uint64_t)18446744073709ULL; } # 235 "/usr/include/sys/time.h" 3 4 struct itimerval { struct timeval it_interval; struct timeval it_value; }; struct itimerspec { struct timespec it_interval; struct timespec it_value; }; struct clockinfo { int hz; int tick; int tickadj; int stathz; int profhz; }; # 344 "/usr/include/sys/time.h" 3 4 # 1 "/usr/include/time.h" 1 3 4 # 88 "/usr/include/time.h" 3 4 struct tm { int tm_sec; int tm_min; int tm_hour; int tm_mday; int tm_mon; int tm_year; int tm_wday; int tm_yday; int tm_isdst; long tm_gmtoff; char *tm_zone; }; struct timespec; char *asctime(const struct tm *); clock_t clock(void); char *ctime(const time_t *); double difftime(time_t, time_t); struct tm *gmtime(const time_t *); struct tm *localtime(const time_t *); time_t mktime(struct tm *); size_t strftime(char *, size_t, const char *, const struct tm *) __attribute__ ((__bounded__(__string__,1,2))); char *strptime(const char *, const char *, struct tm *); time_t time(time_t *); char *asctime_r(const struct tm *, char *) __attribute__ ((__bounded__(__minbytes__,2,26))); char *ctime_r(const time_t *, char *) __attribute__ ((__bounded__(__minbytes__,2,26))); struct tm *gmtime_r(const time_t *, struct tm *); struct tm *localtime_r(const time_t *, struct tm *); int nanosleep(const struct timespec *, struct timespec *); extern char *tzname[2]; void tzset(void); char *timezone(int, int); void tzsetwall(void); time_t timelocal(struct tm *); time_t timegm(struct tm *); time_t timeoff(struct tm *, const long); # 345 "/usr/include/sys/time.h" 2 3 4 int adjtime(const struct timeval *, struct timeval *); int adjfreq(const int64_t *, int64_t *); int clock_getres(clockid_t, struct timespec *); int clock_gettime(clockid_t, struct timespec *); int clock_settime(clockid_t, const struct timespec *); int futimes(int, const struct timeval *); int getitimer(int, struct itimerval *); int gettimeofday(struct timeval *, struct timezone *); int setitimer(int, const struct itimerval *, struct itimerval *); int settimeofday(const struct timeval *, const struct timezone *); int utimes(const char *, const struct timeval *); # 39 "/usr/include/sys/select.h" 2 3 4 # 55 "/usr/include/sys/select.h" 3 4 typedef int32_t __fd_mask; typedef struct fd_set { __fd_mask fds_bits[(((1024) + ((((unsigned)(sizeof(__fd_mask) * 8))) - 1)) / (((unsigned)(sizeof(__fd_mask) * 8))))]; } fd_set; # 89 "/usr/include/sys/select.h" 3 4 struct timeval; int select(int, fd_set *, fd_set *, fd_set *, struct timeval *); # 221 "/usr/include/sys/types.h" 2 3 4 # 46 "/usr/include/stdio.h" 2 3 4 # 68 "/usr/include/stdio.h" 3 4 typedef off_t fpos_t; # 77 "/usr/include/stdio.h" 3 4 struct __sbuf { unsigned char *_base; int _size; }; # 106 "/usr/include/stdio.h" 3 4 typedef struct __sFILE { unsigned char *_p; int _r; int _w; short _flags; short _file; struct __sbuf _bf; int _lbfsize; void *_cookie; int (*_close)(void *); int (*_read)(void *, char *, int); fpos_t (*_seek)(void *, fpos_t, int); int (*_write)(void *, const char *, int); struct __sbuf _ext; unsigned char *_up; int _ur; unsigned char _ubuf[3]; unsigned char _nbuf[1]; struct __sbuf _lb; int _blksize; fpos_t _offset; } FILE; extern FILE __sF[]; # 210 "/usr/include/stdio.h" 3 4 void clearerr(FILE *); int fclose(FILE *); int feof(FILE *); int ferror(FILE *); int fflush(FILE *); int fgetc(FILE *); int fgetpos(FILE *, fpos_t *); char *fgets(char *, int, FILE *) __attribute__((__bounded__ (__string__,1,2))); FILE *fopen(const char *, const char *); int fprintf(FILE *, const char *, ...); int fputc(int, FILE *); int fputs(const char *, FILE *); size_t fread(void *, size_t, size_t, FILE *) __attribute__((__bounded__ (__size__,1,3,2))); FILE *freopen(const char *, const char *, FILE *); int fscanf(FILE *, const char *, ...); int fseek(FILE *, long, int); int fseeko(FILE *, off_t, int); int fsetpos(FILE *, const fpos_t *); long ftell(FILE *); off_t ftello(FILE *); size_t fwrite(const void *, size_t, size_t, FILE *) __attribute__((__bounded__ (__size__,1,3,2))); int getc(FILE *); int getchar(void); char *gets(char *); extern int sys_nerr; extern char *sys_errlist[]; void perror(const char *); int printf(const char *, ...); int putc(int, FILE *); int putchar(int); int puts(const char *); int remove(const char *); int rename(const char *, const char *); void rewind(FILE *); int scanf(const char *, ...); void setbuf(FILE *, char *); int setvbuf(FILE *, char *, int, size_t); int sprintf(char *, const char *, ...); int sscanf(const char *, const char *, ...); FILE *tmpfile(void); char *tmpnam(char *); int ungetc(int, FILE *); int vfprintf(FILE *, const char *, __va_list); int vprintf(const char *, __va_list); int vsprintf(char *, const char *, __va_list); int snprintf(char *, size_t, const char *, ...) __attribute__((__format__ (printf, 3, 4))) __attribute__((__nonnull__ (3))) __attribute__((__bounded__ (__string__,1,2))); int vfscanf(FILE *, const char *, __va_list) __attribute__((__format__ (scanf, 2, 0))) __attribute__((__nonnull__ (2))); int vscanf(const char *, __va_list) __attribute__((__format__ (scanf, 1, 0))) __attribute__((__nonnull__ (1))); int vsnprintf(char *, size_t, const char *, __va_list) __attribute__((__format__ (printf, 3, 0))) __attribute__((__nonnull__ (3))) __attribute__((__bounded__(__string__,1,2))); int vsscanf(const char *, const char *, __va_list) __attribute__((__format__ (scanf, 2, 0))) __attribute__((__nonnull__ (2))); # 294 "/usr/include/stdio.h" 3 4 char *ctermid(char *); char *cuserid(char *); FILE *fdopen(int, const char *); int fileno(FILE *); int pclose(FILE *); FILE *popen(const char *, const char *); void flockfile(FILE *); int ftrylockfile(FILE *); void funlockfile(FILE *); int getc_unlocked(FILE *); int getchar_unlocked(void); int putc_unlocked(int, FILE *); int putchar_unlocked(int); char *tempnam(const char *, const char *); # 337 "/usr/include/stdio.h" 3 4 int asprintf(char **, const char *, ...) __attribute__((__format__ (printf, 2, 3))) __attribute__((__nonnull__ (2))); char *fgetln(FILE *, size_t *); int fpurge(FILE *); int getw(FILE *); int putw(int, FILE *); void setbuffer(FILE *, char *, int); int setlinebuf(FILE *); int vasprintf(char **, const char *, __va_list) __attribute__((__format__ (printf, 2, 0))) __attribute__((__nonnull__ (2))); FILE *funopen(const void *, int (*)(void *, char *, int), int (*)(void *, const char *, int), fpos_t (*)(void *, fpos_t, int), int (*)(void *)); int __srget(FILE *); int __swbuf(int, FILE *); static __inline int __sputc(int _c, FILE *_p) { if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n')) return (*_p->_p++ = _c); else return (__swbuf(_c, _p)); } # 35 "glr-regr14.y" 2 static void yyerror (char const *); static int yylex (void); static void print_look_ahead (char const *); static char merge (union YYSTYPE, union YYSTYPE); # 135 "glr-regr14.c" # 1 "/usr/include/stdlib.h" 1 3 4 # 52 "/usr/include/stdlib.h" 3 4 typedef __wchar_t wchar_t; typedef struct { int quot; int rem; } div_t; typedef struct { long quot; long rem; } ldiv_t; typedef struct { long long quot; long long rem; } lldiv_t; typedef struct { quad_t quot; quad_t rem; } qdiv_t; # 93 "/usr/include/stdlib.h" 3 4 extern size_t __mb_cur_max; # 107 "/usr/include/stdlib.h" 3 4 __attribute__((__noreturn__)) void abort(void); int abs(int); int atexit(void (*)(void)); double atof(const char *); int atoi(const char *); long atol(const char *); void *bsearch(const void *, const void *, size_t, size_t, int (*)(const void *, const void *)); void *calloc(size_t, size_t); div_t div(int, int); char *ecvt(double, int, int *, int *); __attribute__((__noreturn__)) void exit(int); __attribute__((__noreturn__)) void _Exit(int); char *fcvt(double, int, int *, int *); void free(void *); char *gcvt(double, int, char *); char *getenv(const char *); long labs(long); ldiv_t ldiv(long, long); void *malloc(size_t); void qsort(void *, size_t, size_t, int (*)(const void *, const void *)); int rand(void); void *realloc(void *, size_t); void srand(unsigned); double strtod(const char *, char **); long strtol(const char *, char **, int); unsigned long strtoul(const char *, char **, int); int system(const char *); int mblen(const char *, size_t); size_t mbstowcs(wchar_t *, const char *, size_t); int wctomb(char *, wchar_t); int mbtowc(wchar_t *, const char *, size_t); size_t wcstombs(char *, const wchar_t *, size_t); int rand_r(unsigned int *); double drand48(void); double erand48(unsigned short[3]); long jrand48(unsigned short[3]); void lcong48(unsigned short[7]); long lrand48(void); long mrand48(void); long nrand48(unsigned short[3]); unsigned short *seed48(unsigned short[3]); void srand48(long); int putenv(const char *); long a64l(const char *); char *l64a(long); char *initstate(unsigned int, char *, size_t) __attribute__((__bounded__ (__string__,2,3))); long random(void); char *setstate(const char *); void srandom(unsigned int); int mkstemp(char *); char *mktemp(char *); char *realpath(const char *, char *); int setkey(const char *); int ttyslot(void); void *valloc(size_t); long long atoll(const char *); long long llabs(long long); long long strtoll(const char *, char **, int); unsigned long long strtoull(const char *, char **, int); int setenv(const char *, const char *, int); void unsetenv(const char *); void *alloca(size_t); char *getbsize(int *, long *); char *cgetcap(char *, const char *, int); int cgetclose(void); int cgetent(char **, char **, const char *); int cgetfirst(char **, char **); int cgetmatch(char *, const char *); int cgetnext(char **, char **); int cgetnum(char *, const char *, long *); int cgetset(const char *); int cgetusedb(int); int cgetstr(char *, const char *, char **); int cgetustr(char *, const char *, char **); int daemon(int, int); char *devname(int, mode_t); int getloadavg(double [], int); void cfree(void *); int getopt(int, char * const *, const char *); extern char *optarg; extern int opterr, optind, optopt, optreset; int getsubopt(char **, char * const *, char **); extern char *suboptarg; char *mkdtemp(char *); int mkstemps(char *, int); int heapsort(void *, size_t, size_t, int (*)(const void *, const void *)); int mergesort(void *, size_t, size_t, int (*)(const void *, const void *)); int radixsort(const unsigned char **, int, const unsigned char *, unsigned); int sradixsort(const unsigned char **, int, const unsigned char *, unsigned); void srandomdev(void); long long strtonum(const char *, long long, long long, const char **); void setproctitle(const char *, ...) __attribute__((__format__ (__printf__, 1, 2))); quad_t qabs(quad_t); qdiv_t qdiv(quad_t, quad_t); quad_t strtoq(const char *, char **, int); u_quad_t strtouq(const char *, char **, int); u_int32_t arc4random(void); void arc4random_stir(void); void arc4random_addrandom(unsigned char *, int) __attribute__((__bounded__ (__string__,1,2))); # 138 "glr-regr14.c" 2 # 1 "/usr/include/string.h" 1 3 4 # 54 "/usr/include/string.h" 3 4 void *memchr(const void *, int, size_t); int memcmp(const void *, const void *, size_t); void *memcpy(void *, const void *, size_t) __attribute__ ((__bounded__(__buffer__,1,3))) __attribute__ ((__bounded__(__buffer__,2,3))); void *memmove(void *, const void *, size_t) __attribute__ ((__bounded__(__buffer__,1,3))) __attribute__ ((__bounded__(__buffer__,2,3))); void *memset(void *, int, size_t) __attribute__ ((__bounded__(__buffer__,1,3))); char *strcat(char *, const char *); char *strchr(const char *, int); int strcmp(const char *, const char *); int strcoll(const char *, const char *); char *strcpy(char *, const char *); size_t strcspn(const char *, const char *); char *strerror(int); size_t strlen(const char *); char *strncat(char *, const char *, size_t) __attribute__ ((__bounded__(__string__,1,3))); int strncmp(const char *, const char *, size_t); char *strncpy(char *, const char *, size_t) __attribute__ ((__bounded__(__string__,1,3))); char *strpbrk(const char *, const char *); char *strrchr(const char *, int); size_t strspn(const char *, const char *); char *strstr(const char *, const char *); char *strtok(char *, const char *); char *strtok_r(char *, const char *, char **); size_t strxfrm(char *, const char *, size_t) __attribute__ ((__bounded__(__string__,1,3))); void *memccpy(void *, const void *, int, size_t) __attribute__ ((__bounded__(__buffer__,1,4))); int bcmp(const void *, const void *, size_t); void bcopy(const void *, void *, size_t) __attribute__ ((__bounded__(__buffer__,1,3))) __attribute__ ((__bounded__(__buffer__,2,3))); void bzero(void *, size_t) __attribute__ ((__bounded__(__buffer__,1,2))); int ffs(int); char *index(const char *, int); char *rindex(const char *, int); int strcasecmp(const char *, const char *); int strncasecmp(const char *, const char *, size_t); char *strdup(const char *); int strerror_r(int, char *, size_t) __attribute__ ((__bounded__(__string__,2,3))); char *strcasestr(const char *, const char *); size_t strlcat(char *, const char *, size_t) __attribute__ ((__bounded__(__string__,1,3))); size_t strlcpy(char *, const char *, size_t) __attribute__ ((__bounded__(__string__,1,3))); void strmode(int, char *); char *strsep(char **, const char *); char *strsignal(int); # 139 "glr-regr14.c" 2 # 1 "/usr/include/stdarg.h" 1 3 4 # 27 "/usr/include/stdarg.h" 3 4 typedef __builtin_va_list __gnuc_va_list; # 41 "/usr/include/stdarg.h" 3 4 typedef __gnuc_va_list va_list; # 140 "glr-regr14.c" 2 # 193 "glr-regr14.c" typedef unsigned char yybool; # 1 "/usr/include/setjmp.h" 1 3 4 # 44 "/usr/include/setjmp.h" 3 4 # 1 "/usr/include/machine/setjmp.h" 1 3 4 # 45 "/usr/include/setjmp.h" 2 3 4 typedef long sigjmp_buf[10 + 1]; typedef long jmp_buf[10]; int setjmp(jmp_buf); void longjmp(jmp_buf, int); int sigsetjmp(sigjmp_buf, int); void siglongjmp(sigjmp_buf, int); int _setjmp(jmp_buf); void _longjmp(jmp_buf, int); void longjmperror(void); # 200 "glr-regr14.c" 2 # 251 "glr-regr14.c" static const unsigned char yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 4, 5, 6, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2 }; # 321 "glr-regr14.c" static const unsigned char yyr1[] = { 0, 7, 8, 9, 9, 10, 11, 11, 12, 13, 14, 15, 15, 15, 15, 16, 17, 18, 19 }; static const unsigned char yyr2[] = { 0, 2, 3, 4, 6, 0, 0, 1, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 0 }; static const unsigned char yydprec[] = { 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; static const unsigned char yymerger[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0 }; static const unsigned char yydefact[] = { 5, 0, 0, 0, 9, 1, 11, 0, 0, 18, 2, 11, 11, 11, 6, 6, 15, 12, 13, 14, 7, 3, 0, 10, 4 }; static const signed char yydefgoto[] = { -1, 1, 2, 3, 21, 4, 8, 24, 10, 11, 12, 13, 16 }; static const signed char yypact[] = { 1, 5, 2, 6, -11, -11, 4, 7, 9, -11, -11, 4, 4, 4, 10, 10, 0, -11, -11, -11, -11, -11, 11, -11, -11 }; static const signed char yypgoto[] = { -11, -11, -11, -11, -7, -11, -11, -11, -10, -11, -11, -11, -11 }; static const signed char yytable[] = { -15, 17, 18, 19, -5, 5, -15, 6, 22, 7, 9, 14, 15, 20, 0, 23 }; static const unsigned char yyconflp[] = { 3, 0, 0, 0, 1, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; static const short int yyconfl[] = { 0, 8, 0, 16, 17, 0, 16, 17, 0 }; static const signed char yycheck[] = { 0, 11, 12, 13, 3, 0, 6, 5, 15, 3, 6, 4, 3, 3, -1, 4 }; static const unsigned char yystos[] = { 0, 8, 9, 10, 12, 0, 5, 3, 13, 6, 15, 16, 17, 18, 4, 3, 19, 15, 15, 15, 3, 11, 11, 4, 14 }; int yyparse (void); # 476 "glr-regr14.c" YYSTYPE yylval; YYLTYPE yylloc; int yynerrs; int yychar; static const int YYEOF = 0; static const int YYEMPTY = -2; typedef enum { yyok, yyaccept, yyabort, yyerr } YYRESULTTAG; # 691 "glr-regr14.c" typedef int yyStateNum; typedef int yyRuleNum; typedef short int yySymbol; typedef short int yyItemNum; typedef struct yyGLRState yyGLRState; typedef struct yyGLRStateSet yyGLRStateSet; typedef struct yySemanticOption yySemanticOption; typedef union yyGLRStackItem yyGLRStackItem; typedef struct yyGLRStack yyGLRStack; struct yyGLRState { yybool yyisState; yybool yyresolved; yyStateNum yylrState; yyGLRState* yypred; size_t yyposn; union { yySemanticOption* yyfirstVal; YYSTYPE yysval; } yysemantics; YYLTYPE yyloc; }; struct yyGLRStateSet { yyGLRState** yystates; yybool* yylookaheadNeeds; size_t yysize, yycapacity; }; struct yySemanticOption { yybool yyisState; yyRuleNum yyrule; yyGLRState* yystate; int yyrawchar; YYSTYPE yyval; YYLTYPE yyloc; yySemanticOption* yynext; }; union yyGLRStackItem { yyGLRState yystate; yySemanticOption yyoption; }; struct yyGLRStack { int yyerrState; yyGLRStackItem yyerror_range[3]; jmp_buf yyexception_buffer; yyGLRStackItem* yyitems; yyGLRStackItem* yynextFree; size_t yyspaceLeft; yyGLRState* yysplitPoint; yyGLRState* yylastDeleted; yyGLRStateSet yytops; }; static void yyexpandGLRStack (yyGLRStack* yystackp); static void yyFail (yyGLRStack* yystackp, const char* yymsg) __attribute__ ((__noreturn__)); static void yyFail (yyGLRStack* yystackp, const char* yymsg) { if (yymsg != 0L) yyerror (yymsg); longjmp (yystackp->yyexception_buffer, 1); } static void yyMemoryExhausted (yyGLRStack* yystackp) __attribute__ ((__noreturn__)); static void yyMemoryExhausted (yyGLRStack* yystackp) { longjmp (yystackp->yyexception_buffer, 2); } # 816 "glr-regr14.c" static void yyfillin (yyGLRStackItem *, int, int) __attribute__ ((__unused__)); static void yyfillin (yyGLRStackItem *yyvsp, int yylow0, int yylow1) { yyGLRState* s; int i; s = yyvsp[yylow0].yystate.yypred; for (i = yylow0-1; i >= yylow1; i -= 1) { ((void) ((s->yyresolved) || (abort (), 0))); yyvsp[i].yystate.yyresolved = 1; yyvsp[i].yystate.yysemantics.yysval = s->yysemantics.yysval; yyvsp[i].yystate.yyloc = s->yyloc; s = yyvsp[i].yystate.yypred = s->yypred; } } static inline int yyfill (yyGLRStackItem *, int *, int, yybool) __attribute__ ((__unused__)); static inline int yyfill (yyGLRStackItem *yyvsp, int *yylow, int yylow1, yybool yynormal) { if (!yynormal && yylow1 < *yylow) { yyfillin (yyvsp, *yylow, yylow1); *yylow = yylow1; } return yylow1; } static YYRESULTTAG yyuserAction (yyRuleNum yyn, int yyrhslen, yyGLRStackItem* yyvsp, YYSTYPE* yyvalp, YYLTYPE* yylocp, yyGLRStack* yystackp ) { yybool yynormal __attribute__ ((__unused__)) = (yystackp->yysplitPoint == 0L); int yylow; # 883 "glr-regr14.c" yylow = 1; if (yyrhslen == 0) *yyvalp = yyval_default; else *yyvalp = yyvsp[yyfill (yyvsp, &yylow, 1-yyrhslen, yynormal)].yystate.yysemantics.yysval; do if ((yyrhslen)) { ((*yylocp)).first_line = (((yyvsp - yyrhslen))[1].yystate.yyloc).first_line; ((*yylocp)).first_column = (((yyvsp - yyrhslen))[1].yystate.yyloc).first_column; ((*yylocp)).last_line = (((yyvsp - yyrhslen))[yyrhslen].yystate.yyloc).last_line; ((*yylocp)).last_column = (((yyvsp - yyrhslen))[yyrhslen].yystate.yyloc).last_column; } else { ((*yylocp)).first_line = ((*yylocp)).last_line = (((yyvsp - yyrhslen))[0].yystate.yyloc).last_line; ((*yylocp)).first_column = ((*yylocp)).last_column = (((yyvsp - yyrhslen))[0].yystate.yyloc).last_column; } while ((0)); yystackp->yyerror_range[1].yystate.yyloc = *yylocp; switch (yyn) { case 2: # 49 "glr-regr14.y" { ; ; print_look_ahead ("start <- merge 'c' stack_explosion"); ;} break; case 3: # 57 "glr-regr14.y" { ; ; print_look_ahead ("merge <- nonconflict1 'a' 'b' nonconflict2"); ;} break; case 4: # 61 "glr-regr14.y" { ; ; print_look_ahead ("merge <- conflict defstate_look 'a' nonconflict2 'b'" " defstate_shift"); ;} break; case 5: # 69 "glr-regr14.y" { print_look_ahead ("nonconflict1 <- empty string"); ;} break; case 6: # 74 "glr-regr14.y" { print_look_ahead ("nonconflict2 <- empty string"); ;} break; case 7: # 77 "glr-regr14.y" { ; print_look_ahead ("nonconflict2 <- 'a'"); ;} break; case 8: # 83 "glr-regr14.y" { print_look_ahead ("conflict <- empty string"); ;} break; case 9: # 88 "glr-regr14.y" { print_look_ahead ("defstate_look <- empty string"); ;} break; case 10: # 95 "glr-regr14.y" { print_look_ahead ("defstate_shift <- empty string"); ;} break; case 11: # 101 "glr-regr14.y" { ((*yyvalp).value) = '\0'; ;} break; case 12: # 102 "glr-regr14.y" { ((*yyvalp).value) = (((yyGLRStackItem const *)yyvsp)[yyfill (yyvsp, &yylow, (2) - (2), yynormal)].yystate.yysemantics.yysval.value); ;} break; case 13: # 103 "glr-regr14.y" { ((*yyvalp).value) = (((yyGLRStackItem const *)yyvsp)[yyfill (yyvsp, &yylow, (2) - (2), yynormal)].yystate.yysemantics.yysval.value); ;} break; case 14: # 104 "glr-regr14.y" { ((*yyvalp).value) = (((yyGLRStackItem const *)yyvsp)[yyfill (yyvsp, &yylow, (2) - (2), yynormal)].yystate.yysemantics.yysval.value); ;} break; case 15: # 107 "glr-regr14.y" { ; if (yychar != 'd' && yychar != YYEOF) { fprintf ((&__sF[2]), "Incorrect lookahead during stack explosion.\n"); } ;} break; case 16: # 116 "glr-regr14.y" { ; if (yychar != 'd' && yychar != YYEOF) { fprintf ((&__sF[2]), "Incorrect lookahead during stack explosion.\n"); } ;} break; case 17: # 125 "glr-regr14.y" { ; if (yychar != 'd' && yychar != YYEOF) { fprintf ((&__sF[2]), "Incorrect lookahead during stack explosion.\n"); } ;} break; case 18: # 134 "glr-regr14.y" { if (yychar != YYEMPTY) { fprintf ((&__sF[2]), "Found lookahead where shouldn't during stack explosion.\n"); } ;} break; # 1028 "glr-regr14.c" default: break; } return yyok; } static void yyuserMerge (int yyn, YYSTYPE* yy0, YYSTYPE* yy1) { ((void) (yy0)); ((void) (yy1)); switch (yyn) { case 1: yy0->value = merge (*yy0, *yy1); break; default: break; } } # 1063 "glr-regr14.c" static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp) { ((void) (yyvaluep)); ((void) (yylocationp)); if (!yymsg) yymsg = "Deleting"; ; switch (yytype) { default: break; } } static inline int yyrhsLength (yyRuleNum yyrule) { return yyr2[yyrule]; } static void yydestroyGLRState (char const *yymsg, yyGLRState *yys) { if (yys->yyresolved) yydestruct (yymsg, yystos[yys->yylrState], &yys->yysemantics.yysval, &yys->yyloc); else { # 1109 "glr-regr14.c" if (yys->yysemantics.yyfirstVal) { yySemanticOption *yyoption = yys->yysemantics.yyfirstVal; yyGLRState *yyrh; int yyn; for (yyrh = yyoption->yystate, yyn = yyrhsLength (yyoption->yyrule); yyn > 0; yyrh = yyrh->yypred, yyn -= 1) yydestroyGLRState (yymsg, yyrh); } } } static inline yySymbol yylhsNonterm (yyRuleNum yyrule) { return yyr1[yyrule]; } static inline yybool yyisDefaultedState (yyStateNum yystate) { return ((yypact[yystate]) == -11); } static inline yyRuleNum yydefaultAction (yyStateNum yystate) { return yydefact[yystate]; } # 1158 "glr-regr14.c" static inline void yygetLRActions (yyStateNum yystate, int yytoken, int* yyaction, const short int** yyconflicts) { int yyindex = yypact[yystate] + yytoken; if (yyindex < 0 || 15 < yyindex || yycheck[yyindex] != yytoken) { *yyaction = -yydefact[yystate]; *yyconflicts = yyconfl; } else if (! (0)) { *yyaction = yytable[yyindex]; *yyconflicts = yyconfl + yyconflp[yyindex]; } else { *yyaction = 0; *yyconflicts = yyconfl + yyconflp[yyindex]; } } static inline yyStateNum yyLRgotoState (yyStateNum yystate, yySymbol yylhs) { int yyr; yyr = yypgoto[yylhs - 7] + yystate; if (0 <= yyr && yyr <= 15 && yycheck[yyr] == yystate) return yytable[yyr]; else return yydefgoto[yylhs - 7]; } static inline yybool yyisShiftAction (int yyaction) { return 0 < yyaction; } static inline yybool yyisErrorAction (int yyaction) { return yyaction == 0; } static inline yyGLRStackItem* yynewGLRStackItem (yyGLRStack* yystackp, yybool yyisState) { yyGLRStackItem* yynewItem = yystackp->yynextFree; yystackp->yyspaceLeft -= 1; yystackp->yynextFree += 1; yynewItem->yystate.yyisState = yyisState; return yynewItem; } static void yyaddDeferredAction (yyGLRStack* yystackp, size_t yyk, yyGLRState* yystate, yyGLRState* rhs, yyRuleNum yyrule) { yySemanticOption* yynewOption = &yynewGLRStackItem (yystackp, 0)->yyoption; yynewOption->yystate = rhs; yynewOption->yyrule = yyrule; if (yystackp->yytops.yylookaheadNeeds[yyk]) { yynewOption->yyrawchar = yychar; yynewOption->yyval = yylval; yynewOption->yyloc = yylloc; } else yynewOption->yyrawchar = YYEMPTY; yynewOption->yynext = yystate->yysemantics.yyfirstVal; yystate->yysemantics.yyfirstVal = yynewOption; do { if (yystackp->yyspaceLeft < 2) yyexpandGLRStack (yystackp); } while ((0)); } static yybool yyinitStateSet (yyGLRStateSet* yyset) { yyset->yysize = 1; yyset->yycapacity = 16; yyset->yystates = (yyGLRState**) malloc (16 * sizeof yyset->yystates[0]); if (! yyset->yystates) return 0; yyset->yystates[0] = 0L; yyset->yylookaheadNeeds = (yybool*) malloc (16 * sizeof yyset->yylookaheadNeeds[0]); if (! yyset->yylookaheadNeeds) { free (yyset->yystates); return 0; } return 1; } static void yyfreeStateSet (yyGLRStateSet* yyset) { free (yyset->yystates); free (yyset->yylookaheadNeeds); } static yybool yyinitGLRStack (yyGLRStack* yystackp, size_t yysize) { yystackp->yyerrState = 0; yynerrs = 0; yystackp->yyspaceLeft = yysize; yystackp->yyitems = (yyGLRStackItem*) malloc (yysize * sizeof yystackp->yynextFree[0]); if (!yystackp->yyitems) return 0; yystackp->yynextFree = yystackp->yyitems; yystackp->yysplitPoint = 0L; yystackp->yylastDeleted = 0L; return yyinitStateSet (&yystackp->yytops); } # 1301 "glr-regr14.c" static void yyexpandGLRStack (yyGLRStack* yystackp) { yyGLRStackItem* yynewItems; yyGLRStackItem* yyp0, *yyp1; size_t yysize, yynewSize; size_t yyn; yysize = yystackp->yynextFree - yystackp->yyitems; if (10000 - 2 < yysize) yyMemoryExhausted (yystackp); yynewSize = 2*yysize; if (10000 < yynewSize) yynewSize = 10000; yynewItems = (yyGLRStackItem*) malloc (yynewSize * sizeof yynewItems[0]); if (! yynewItems) yyMemoryExhausted (yystackp); for (yyp0 = yystackp->yyitems, yyp1 = yynewItems, yyn = yysize; 0 < yyn; yyn -= 1, yyp0 += 1, yyp1 += 1) { *yyp1 = *yyp0; if (*(yybool *) yyp0) { yyGLRState* yys0 = &yyp0->yystate; yyGLRState* yys1 = &yyp1->yystate; if (yys0->yypred != 0L) yys1->yypred = &((yyp1) - ((yyp0) - (yyGLRStackItem*) (yys0->yypred)))->yystate; if (! yys0->yyresolved && yys0->yysemantics.yyfirstVal != 0L) yys1->yysemantics.yyfirstVal = &((yyp1) - ((yyp0) - (yyGLRStackItem*) (yys0->yysemantics.yyfirstVal)))->yyoption; } else { yySemanticOption* yyv0 = &yyp0->yyoption; yySemanticOption* yyv1 = &yyp1->yyoption; if (yyv0->yystate != 0L) yyv1->yystate = &((yyp1) - ((yyp0) - (yyGLRStackItem*) (yyv0->yystate)))->yystate; if (yyv0->yynext != 0L) yyv1->yynext = &((yyp1) - ((yyp0) - (yyGLRStackItem*) (yyv0->yynext)))->yyoption; } } if (yystackp->yysplitPoint != 0L) yystackp->yysplitPoint = &((yynewItems) - ((yystackp->yyitems) - (yyGLRStackItem*) (yystackp->yysplitPoint)))->yystate; for (yyn = 0; yyn < yystackp->yytops.yysize; yyn += 1) if (yystackp->yytops.yystates[yyn] != 0L) yystackp->yytops.yystates[yyn] = &((yynewItems) - ((yystackp->yyitems) - (yyGLRStackItem*) (yystackp->yytops.yystates[yyn])))->yystate; free (yystackp->yyitems); yystackp->yyitems = yynewItems; yystackp->yynextFree = yynewItems + yysize; yystackp->yyspaceLeft = yynewSize - yysize; } static void yyfreeGLRStack (yyGLRStack* yystackp) { free (yystackp->yyitems); yyfreeStateSet (&yystackp->yytops); } static inline void yyupdateSplit (yyGLRStack* yystackp, yyGLRState* yys) { if (yystackp->yysplitPoint != 0L && yystackp->yysplitPoint > yys) yystackp->yysplitPoint = yys; } static inline void yymarkStackDeleted (yyGLRStack* yystackp, size_t yyk) { if (yystackp->yytops.yystates[yyk] != 0L) yystackp->yylastDeleted = yystackp->yytops.yystates[yyk]; yystackp->yytops.yystates[yyk] = 0L; } static void yyundeleteLastStack (yyGLRStack* yystackp) { if (yystackp->yylastDeleted == 0L || yystackp->yytops.yysize != 0) return; yystackp->yytops.yystates[0] = yystackp->yylastDeleted; yystackp->yytops.yysize = 1; ; yystackp->yylastDeleted = 0L; } static inline void yyremoveDeletes (yyGLRStack* yystackp) { size_t yyi, yyj; yyi = yyj = 0; while (yyj < yystackp->yytops.yysize) { if (yystackp->yytops.yystates[yyi] == 0L) { if (yyi == yyj) { ; } yystackp->yytops.yysize -= 1; } else { yystackp->yytops.yystates[yyj] = yystackp->yytops.yystates[yyi]; yystackp->yytops.yylookaheadNeeds[yyj] = yystackp->yytops.yylookaheadNeeds[yyi]; if (yyj != yyi) { ; } yyj += 1; } yyi += 1; } } static inline void yyglrShift (yyGLRStack* yystackp, size_t yyk, yyStateNum yylrState, size_t yyposn, YYSTYPE* yyvalp, YYLTYPE* yylocp) { yyGLRState* yynewState = &yynewGLRStackItem (yystackp, 1)->yystate; yynewState->yylrState = yylrState; yynewState->yyposn = yyposn; yynewState->yyresolved = 1; yynewState->yypred = yystackp->yytops.yystates[yyk]; yynewState->yysemantics.yysval = *yyvalp; yynewState->yyloc = *yylocp; yystackp->yytops.yystates[yyk] = yynewState; do { if (yystackp->yyspaceLeft < 2) yyexpandGLRStack (yystackp); } while ((0)); } static inline void yyglrShiftDefer (yyGLRStack* yystackp, size_t yyk, yyStateNum yylrState, size_t yyposn, yyGLRState* rhs, yyRuleNum yyrule) { yyGLRState* yynewState = &yynewGLRStackItem (yystackp, 1)->yystate; yynewState->yylrState = yylrState; yynewState->yyposn = yyposn; yynewState->yyresolved = 0; yynewState->yypred = yystackp->yytops.yystates[yyk]; yynewState->yysemantics.yyfirstVal = 0L; yystackp->yytops.yystates[yyk] = yynewState; yyaddDeferredAction (yystackp, yyk, yynewState, rhs, yyrule); } static inline YYRESULTTAG yydoAction (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule, YYSTYPE* yyvalp, YYLTYPE* yylocp) { int yynrhs = yyrhsLength (yyrule); if (yystackp->yysplitPoint == 0L) { yyGLRStackItem* rhs = (yyGLRStackItem*) yystackp->yytops.yystates[yyk]; ((void) ((yyk == 0) || (abort (), 0))); yystackp->yynextFree -= yynrhs; yystackp->yyspaceLeft += yynrhs; yystackp->yytops.yystates[0] = & yystackp->yynextFree[-1].yystate; return yyuserAction (yyrule, yynrhs, rhs, yyvalp, yylocp, yystackp); } else { int yyi; yyGLRState* yys; yyGLRStackItem yyrhsVals[6 + 0 + 1]; yys = yyrhsVals[6 + 0].yystate.yypred = yystackp->yytops.yystates[yyk]; if (yynrhs == 0) yyrhsVals[6 + 0 - 1].yystate.yyloc = yys->yyloc; for (yyi = 0; yyi < yynrhs; yyi += 1) { yys = yys->yypred; ((void) ((yys) || (abort (), 0))); } yyupdateSplit (yystackp, yys); yystackp->yytops.yystates[yyk] = yys; return yyuserAction (yyrule, yynrhs, yyrhsVals + 6 + 0 - 1, yyvalp, yylocp, yystackp); } } # 1575 "glr-regr14.c" static inline YYRESULTTAG yyglrReduce (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule, yybool yyforceEval) { size_t yyposn = yystackp->yytops.yystates[yyk]->yyposn; if (yyforceEval || yystackp->yysplitPoint == 0L) { YYSTYPE yysval; YYLTYPE yyloc; ; do { YYRESULTTAG yyflag = yydoAction (yystackp, yyk, yyrule, &yysval, &yyloc); if (yyflag != yyok) return yyflag; } while ((0)); ; yyglrShift (yystackp, yyk, yyLRgotoState (yystackp->yytops.yystates[yyk]->yylrState, yylhsNonterm (yyrule)), yyposn, &yysval, &yyloc); } else { size_t yyi; int yyn; yyGLRState* yys, *yys0 = yystackp->yytops.yystates[yyk]; yyStateNum yynewLRState; for (yys = yystackp->yytops.yystates[yyk], yyn = yyrhsLength (yyrule); 0 < yyn; yyn -= 1) { yys = yys->yypred; ((void) ((yys) || (abort (), 0))); } yyupdateSplit (yystackp, yys); yynewLRState = yyLRgotoState (yys->yylrState, yylhsNonterm (yyrule)); ; for (yyi = 0; yyi < yystackp->yytops.yysize; yyi += 1) if (yyi != yyk && yystackp->yytops.yystates[yyi] != 0L) { yyGLRState* yyp, *yysplit = yystackp->yysplitPoint; yyp = yystackp->yytops.yystates[yyi]; while (yyp != yys && yyp != yysplit && yyp->yyposn >= yyposn) { if (yyp->yylrState == yynewLRState && yyp->yypred == yys) { yyaddDeferredAction (yystackp, yyk, yyp, yys0, yyrule); yymarkStackDeleted (yystackp, yyk); ; return yyok; } yyp = yyp->yypred; } } yystackp->yytops.yystates[yyk] = yys; yyglrShiftDefer (yystackp, yyk, yynewLRState, yyposn, yys0, yyrule); } return yyok; } static size_t yysplitStack (yyGLRStack* yystackp, size_t yyk) { if (yystackp->yysplitPoint == 0L) { ((void) ((yyk == 0) || (abort (), 0))); yystackp->yysplitPoint = yystackp->yytops.yystates[yyk]; } if (yystackp->yytops.yysize >= yystackp->yytops.yycapacity) { yyGLRState** yynewStates; yybool* yynewLookaheadNeeds; yynewStates = 0L; if (yystackp->yytops.yycapacity > (((size_t) -1) / (2 * sizeof yynewStates[0]))) yyMemoryExhausted (yystackp); yystackp->yytops.yycapacity *= 2; yynewStates = (yyGLRState**) realloc (yystackp->yytops.yystates, (yystackp->yytops.yycapacity * sizeof yynewStates[0])); if (yynewStates == 0L) yyMemoryExhausted (yystackp); yystackp->yytops.yystates = yynewStates; yynewLookaheadNeeds = (yybool*) realloc (yystackp->yytops.yylookaheadNeeds, (yystackp->yytops.yycapacity * sizeof yynewLookaheadNeeds[0])); if (yynewLookaheadNeeds == 0L) yyMemoryExhausted (yystackp); yystackp->yytops.yylookaheadNeeds = yynewLookaheadNeeds; } yystackp->yytops.yystates[yystackp->yytops.yysize] = yystackp->yytops.yystates[yyk]; yystackp->yytops.yylookaheadNeeds[yystackp->yytops.yysize] = yystackp->yytops.yylookaheadNeeds[yyk]; yystackp->yytops.yysize += 1; return yystackp->yytops.yysize-1; } static yybool yyidenticalOptions (yySemanticOption* yyy0, yySemanticOption* yyy1) { if (yyy0->yyrule == yyy1->yyrule) { yyGLRState *yys0, *yys1; int yyn; for (yys0 = yyy0->yystate, yys1 = yyy1->yystate, yyn = yyrhsLength (yyy0->yyrule); yyn > 0; yys0 = yys0->yypred, yys1 = yys1->yypred, yyn -= 1) if (yys0->yyposn != yys1->yyposn) return 0; return 1; } else return 0; } static void yymergeOptionSets (yySemanticOption* yyy0, yySemanticOption* yyy1) { yyGLRState *yys0, *yys1; int yyn; for (yys0 = yyy0->yystate, yys1 = yyy1->yystate, yyn = yyrhsLength (yyy0->yyrule); yyn > 0; yys0 = yys0->yypred, yys1 = yys1->yypred, yyn -= 1) { if (yys0 == yys1) break; else if (yys0->yyresolved) { yys1->yyresolved = 1; yys1->yysemantics.yysval = yys0->yysemantics.yysval; } else if (yys1->yyresolved) { yys0->yyresolved = 1; yys0->yysemantics.yysval = yys1->yysemantics.yysval; } else { yySemanticOption** yyz0p; yySemanticOption* yyz1; yyz0p = &yys0->yysemantics.yyfirstVal; yyz1 = yys1->yysemantics.yyfirstVal; while ((1)) { if (yyz1 == *yyz0p || yyz1 == 0L) break; else if (*yyz0p == 0L) { *yyz0p = yyz1; break; } else if (*yyz0p < yyz1) { yySemanticOption* yyz = *yyz0p; *yyz0p = yyz1; yyz1 = yyz1->yynext; (*yyz0p)->yynext = yyz; } yyz0p = &(*yyz0p)->yynext; } yys1->yysemantics.yyfirstVal = yys0->yysemantics.yyfirstVal; } } } static int yypreference (yySemanticOption* y0, yySemanticOption* y1) { yyRuleNum r0 = y0->yyrule, r1 = y1->yyrule; int p0 = yydprec[r0], p1 = yydprec[r1]; if (p0 == p1) { if (yymerger[r0] == 0 || yymerger[r0] != yymerger[r1]) return 0; else return 1; } if (p0 == 0 || p1 == 0) return 0; if (p0 < p1) return 3; if (p1 < p0) return 2; return 0; } static YYRESULTTAG yyresolveValue (yyGLRState* yys, yyGLRStack* yystackp); static YYRESULTTAG yyresolveStates (yyGLRState* yys, int yyn, yyGLRStack* yystackp) { if (0 < yyn) { ((void) ((yys->yypred) || (abort (), 0))); do { YYRESULTTAG yyflag = yyresolveStates (yys->yypred, yyn-1, yystackp); if (yyflag != yyok) return yyflag; } while ((0)); if (! yys->yyresolved) do { YYRESULTTAG yyflag = yyresolveValue (yys, yystackp); if (yyflag != yyok) return yyflag; } while ((0)); } return yyok; } static YYRESULTTAG yyresolveAction (yySemanticOption* yyopt, yyGLRStack* yystackp, YYSTYPE* yyvalp, YYLTYPE* yylocp) { yyGLRStackItem yyrhsVals[6 + 0 + 1]; int yynrhs; int yychar_current; YYSTYPE yylval_current; YYLTYPE yylloc_current; YYRESULTTAG yyflag; yynrhs = yyrhsLength (yyopt->yyrule); yyflag = yyresolveStates (yyopt->yystate, yynrhs, yystackp); if (yyflag != yyok) { yyGLRState *yys; for (yys = yyopt->yystate; yynrhs > 0; yys = yys->yypred, yynrhs -= 1) yydestroyGLRState ("Cleanup: popping", yys); return yyflag; } yyrhsVals[6 + 0].yystate.yypred = yyopt->yystate; if (yynrhs == 0) yyrhsVals[6 + 0 - 1].yystate.yyloc = yyopt->yystate->yyloc; yychar_current = yychar; yylval_current = yylval; yylloc_current = yylloc; yychar = yyopt->yyrawchar; yylval = yyopt->yyval; yylloc = yyopt->yyloc; yyflag = yyuserAction (yyopt->yyrule, yynrhs, yyrhsVals + 6 + 0 - 1, yyvalp, yylocp, yystackp); yychar = yychar_current; yylval = yylval_current; yylloc = yylloc_current; return yyflag; } # 1897 "glr-regr14.c" static YYRESULTTAG yyreportAmbiguity (yySemanticOption* yyx0, yySemanticOption* yyx1) { ((void) (yyx0)); ((void) (yyx1)); # 1913 "glr-regr14.c" yyerror ("syntax is ambiguous"); return yyabort; } static void yyresolveLocations (yyGLRState* yys1, int yyn1, yyGLRStack *yystackp) { if (0 < yyn1) { yyresolveLocations (yys1->yypred, yyn1 - 1, yystackp); if (!yys1->yyresolved) { yySemanticOption *yyoption; yyGLRStackItem yyrhsloc[1 + 6]; int yynrhs; int yychar_current; YYSTYPE yylval_current; YYLTYPE yylloc_current; yyoption = yys1->yysemantics.yyfirstVal; ((void) ((yyoption != 0L) || (abort (), 0))); yynrhs = yyrhsLength (yyoption->yyrule); if (yynrhs > 0) { yyGLRState *yys; int yyn; yyresolveLocations (yyoption->yystate, yynrhs, yystackp); for (yys = yyoption->yystate, yyn = yynrhs; yyn > 0; yys = yys->yypred, yyn -= 1) yyrhsloc[yyn].yystate.yyloc = yys->yyloc; } else { yyGLRState *yyprevious = yyoption->yystate; yyrhsloc[0].yystate.yyloc = yyprevious->yyloc; } yychar_current = yychar; yylval_current = yylval; yylloc_current = yylloc; yychar = yyoption->yyrawchar; yylval = yyoption->yyval; yylloc = yyoption->yyloc; do if ((yynrhs)) { ((yys1->yyloc)).first_line = ((yyrhsloc)[1].yystate.yyloc).first_line; ((yys1->yyloc)).first_column = ((yyrhsloc)[1].yystate.yyloc).first_column; ((yys1->yyloc)).last_line = ((yyrhsloc)[yynrhs].yystate.yyloc).last_line; ((yys1->yyloc)).last_column = ((yyrhsloc)[yynrhs].yystate.yyloc).last_column; } else { ((yys1->yyloc)).first_line = ((yys1->yyloc)).last_line = ((yyrhsloc)[0].yystate.yyloc).last_line; ((yys1->yyloc)).first_column = ((yys1->yyloc)).last_column = ((yyrhsloc)[0].yystate.yyloc).last_column; } while ((0)); yychar = yychar_current; yylval = yylval_current; yylloc = yylloc_current; } } } static YYRESULTTAG yyresolveValue (yyGLRState* yys, yyGLRStack* yystackp) { yySemanticOption* yyoptionList = yys->yysemantics.yyfirstVal; yySemanticOption* yybest; yySemanticOption** yypp; yybool yymerge; YYSTYPE yysval; YYRESULTTAG yyflag; YYLTYPE *yylocp = &yys->yyloc; yybest = yyoptionList; yymerge = 0; for (yypp = &yyoptionList->yynext; *yypp != 0L; ) { yySemanticOption* yyp = *yypp; if (yyidenticalOptions (yybest, yyp)) { yymergeOptionSets (yybest, yyp); *yypp = yyp->yynext; } else { switch (yypreference (yybest, yyp)) { case 0: yyresolveLocations (yys, 1, yystackp); return yyreportAmbiguity (yybest, yyp); break; case 1: yymerge = 1; break; case 2: break; case 3: yybest = yyp; yymerge = 0; break; default: break; } yypp = &yyp->yynext; } } if (yymerge) { yySemanticOption* yyp; int yyprec = yydprec[yybest->yyrule]; yyflag = yyresolveAction (yybest, yystackp, &yysval, yylocp); if (yyflag == yyok) for (yyp = yybest->yynext; yyp != 0L; yyp = yyp->yynext) { if (yyprec == yydprec[yyp->yyrule]) { YYSTYPE yysval_other; YYLTYPE yydummy; yyflag = yyresolveAction (yyp, yystackp, &yysval_other, &yydummy); if (yyflag != yyok) { yydestruct ("Cleanup: discarding incompletely merged value for", yystos[yys->yylrState], &yysval, yylocp); break; } yyuserMerge (yymerger[yyp->yyrule], &yysval, &yysval_other); } } } else yyflag = yyresolveAction (yybest, yystackp, &yysval, yylocp); if (yyflag == yyok) { yys->yyresolved = 1; yys->yysemantics.yysval = yysval; } else yys->yysemantics.yyfirstVal = 0L; return yyflag; } static YYRESULTTAG yyresolveStack (yyGLRStack* yystackp) { if (yystackp->yysplitPoint != 0L) { yyGLRState* yys; int yyn; for (yyn = 0, yys = yystackp->yytops.yystates[0]; yys != yystackp->yysplitPoint; yys = yys->yypred, yyn += 1) continue; do { YYRESULTTAG yyflag = yyresolveStates (yystackp->yytops.yystates[0], yyn, yystackp ); if (yyflag != yyok) return yyflag; } while ((0)); } return yyok; } static void yycompressStack (yyGLRStack* yystackp) { yyGLRState* yyp, *yyq, *yyr; if (yystackp->yytops.yysize != 1 || yystackp->yysplitPoint == 0L) return; for (yyp = yystackp->yytops.yystates[0], yyq = yyp->yypred, yyr = 0L; yyp != yystackp->yysplitPoint; yyr = yyp, yyp = yyq, yyq = yyp->yypred) yyp->yypred = yyr; yystackp->yyspaceLeft += yystackp->yynextFree - yystackp->yyitems; yystackp->yynextFree = ((yyGLRStackItem*) yystackp->yysplitPoint) + 1; yystackp->yyspaceLeft -= yystackp->yynextFree - yystackp->yyitems; yystackp->yysplitPoint = 0L; yystackp->yylastDeleted = 0L; while (yyr != 0L) { yystackp->yynextFree->yystate = *yyr; yyr = yyr->yypred; yystackp->yynextFree->yystate.yypred = &yystackp->yynextFree[-1].yystate; yystackp->yytops.yystates[0] = &yystackp->yynextFree->yystate; yystackp->yynextFree += 1; yystackp->yyspaceLeft -= 1; } } static YYRESULTTAG yyprocessOneStack (yyGLRStack* yystackp, size_t yyk, size_t yyposn) { int yyaction; const short int* yyconflicts; yyRuleNum yyrule; while (yystackp->yytops.yystates[yyk] != 0L) { yyStateNum yystate = yystackp->yytops.yystates[yyk]->yylrState; ; ((void) ((yystate != 5) || (abort (), 0))); if (yyisDefaultedState (yystate)) { yyrule = yydefaultAction (yystate); if (yyrule == 0) { ; yymarkStackDeleted (yystackp, yyk); return yyok; } do { YYRESULTTAG yyflag = yyglrReduce (yystackp, yyk, yyrule, 0); if (yyflag != yyok) return yyflag; } while ((0)); } else { yySymbol yytoken; yystackp->yytops.yylookaheadNeeds[yyk] = 1; if (yychar == YYEMPTY) { ; yychar = yylex (); yytoken = ((yychar <= 0) ? YYEOF : (unsigned int) (yychar) <= 257 ? yytranslate[yychar] : 2); ; } else yytoken = ((yychar <= 0) ? YYEOF : (unsigned int) (yychar) <= 257 ? yytranslate[yychar] : 2); yygetLRActions (yystate, yytoken, &yyaction, &yyconflicts); while (*yyconflicts != 0) { size_t yynewStack = yysplitStack (yystackp, yyk); ; do { YYRESULTTAG yyflag = yyglrReduce (yystackp, yynewStack, *yyconflicts, 0); if (yyflag != yyok) return yyflag; } while ((0)); do { YYRESULTTAG yyflag = yyprocessOneStack (yystackp, yynewStack, yyposn); if (yyflag != yyok) return yyflag; } while ((0)); yyconflicts += 1; } if (yyisShiftAction (yyaction)) break; else if (yyisErrorAction (yyaction)) { ; yymarkStackDeleted (yystackp, yyk); break; } else do { YYRESULTTAG yyflag = yyglrReduce (yystackp, yyk, -yyaction, 0); if (yyflag != yyok) return yyflag; } while ((0)); } } return yyok; } static void yyreportSyntaxError (yyGLRStack* yystackp) { if (yystackp->yyerrState == 0) { # 2286 "glr-regr14.c" yyerror ("syntax error"); yynerrs += 1; } } static void yyrecoverSyntaxError (yyGLRStack* yystackp) { size_t yyk; int yyj; if (yystackp->yyerrState == 3) while ((1)) { yySymbol yytoken; if (yychar == YYEOF) yyFail (yystackp, 0L); if (yychar != YYEMPTY) { yyGLRState *yys = yystackp->yytops.yystates[0]; yyGLRStackItem yyerror_range[3]; yyerror_range[1].yystate.yyloc = yys->yyloc; yyerror_range[2].yystate.yyloc = yylloc; do if ((2)) { ((yys->yyloc)).first_line = ((yyerror_range)[1].yystate.yyloc).first_line; ((yys->yyloc)).first_column = ((yyerror_range)[1].yystate.yyloc).first_column; ((yys->yyloc)).last_line = ((yyerror_range)[2].yystate.yyloc).last_line; ((yys->yyloc)).last_column = ((yyerror_range)[2].yystate.yyloc).last_column; } else { ((yys->yyloc)).first_line = ((yys->yyloc)).last_line = ((yyerror_range)[0].yystate.yyloc).last_line; ((yys->yyloc)).first_column = ((yys->yyloc)).last_column = ((yyerror_range)[0].yystate.yyloc).last_column; } while ((0)); yytoken = ((yychar <= 0) ? YYEOF : (unsigned int) (yychar) <= 257 ? yytranslate[yychar] : 2); yydestruct ("Error: discarding", yytoken, &yylval, &yylloc); } ; yychar = yylex (); yytoken = ((yychar <= 0) ? YYEOF : (unsigned int) (yychar) <= 257 ? yytranslate[yychar] : 2); ; yyj = yypact[yystackp->yytops.yystates[0]->yylrState]; if (((yyj) == -11)) return; yyj += yytoken; if (yyj < 0 || 15 < yyj || yycheck[yyj] != yytoken) { if (yydefact[yystackp->yytops.yystates[0]->yylrState] != 0) return; } else if (yytable[yyj] != 0 && ! (0)) return; } for (yyk = 0; yyk < yystackp->yytops.yysize; yyk += 1) if (yystackp->yytops.yystates[yyk] != 0L) break; if (yyk >= yystackp->yytops.yysize) yyFail (yystackp, 0L); for (yyk += 1; yyk < yystackp->yytops.yysize; yyk += 1) yymarkStackDeleted (yystackp, yyk); yyremoveDeletes (yystackp); yycompressStack (yystackp); yystackp->yyerrState = 3; while (yystackp->yytops.yystates[0] != 0L) { yyGLRState *yys = yystackp->yytops.yystates[0]; yyj = yypact[yys->yylrState]; if (! ((yyj) == -11)) { yyj += 1; if (0 <= yyj && yyj <= 15 && yycheck[yyj] == 1 && yyisShiftAction (yytable[yyj])) { YYLTYPE yyerrloc; yystackp->yyerror_range[2].yystate.yyloc = yylloc; do if ((2)) { (yyerrloc).first_line = (((yystackp->yyerror_range))[1].yystate.yyloc).first_line; (yyerrloc).first_column = (((yystackp->yyerror_range))[1].yystate.yyloc).first_column; (yyerrloc).last_line = (((yystackp->yyerror_range))[2].yystate.yyloc).last_line; (yyerrloc).last_column = (((yystackp->yyerror_range))[2].yystate.yyloc).last_column; } else { (yyerrloc).first_line = (yyerrloc).last_line = (((yystackp->yyerror_range))[0].yystate.yyloc).last_line; (yyerrloc).first_column = (yyerrloc).last_column = (((yystackp->yyerror_range))[0].yystate.yyloc).last_column; } while ((0)); ; yyglrShift (yystackp, 0, yytable[yyj], yys->yyposn, &yylval, &yyerrloc); yys = yystackp->yytops.yystates[0]; break; } } yystackp->yyerror_range[1].yystate.yyloc = yys->yyloc; yydestroyGLRState ("Error: popping", yys); yystackp->yytops.yystates[0] = yys->yypred; yystackp->yynextFree -= 1; yystackp->yyspaceLeft += 1; } if (yystackp->yytops.yystates[0] == 0L) yyFail (yystackp, 0L); } # 2404 "glr-regr14.c" int yyparse (void) { int yyresult; yyGLRStack yystack; yyGLRStack* const yystackp = &yystack; size_t yyposn; ; yychar = YYEMPTY; yylval = yyval_default; yylloc.first_line = yylloc.last_line = 1; yylloc.first_column = yylloc.last_column = 0; if (! yyinitGLRStack (yystackp, 200)) goto yyexhaustedlab; switch (setjmp (yystack.yyexception_buffer)) { case 0: break; case 1: goto yyabortlab; case 2: goto yyexhaustedlab; default: goto yybuglab; } yyglrShift (&yystack, 0, 0, 0, &yylval, &yylloc); yyposn = 0; while ((1)) { while ((1)) { yyRuleNum yyrule; int yyaction; const short int* yyconflicts; yyStateNum yystate = yystack.yytops.yystates[0]->yylrState; ; if (yystate == 5) goto yyacceptlab; if (yyisDefaultedState (yystate)) { yyrule = yydefaultAction (yystate); if (yyrule == 0) { yystack.yyerror_range[1].yystate.yyloc = yylloc; yyreportSyntaxError (&yystack); goto yyuser_error; } do { switch (yyglrReduce (&yystack, 0, yyrule, 1)) { case yyok: break; case yyabort: goto yyabortlab; case yyaccept: goto yyacceptlab; case yyerr: goto yyuser_error; default: goto yybuglab; } } while ((0)); } else { yySymbol yytoken; if (yychar == YYEMPTY) { ; yychar = yylex (); yytoken = ((yychar <= 0) ? YYEOF : (unsigned int) (yychar) <= 257 ? yytranslate[yychar] : 2); ; } else yytoken = ((yychar <= 0) ? YYEOF : (unsigned int) (yychar) <= 257 ? yytranslate[yychar] : 2); yygetLRActions (yystate, yytoken, &yyaction, &yyconflicts); if (*yyconflicts != 0) break; if (yyisShiftAction (yyaction)) { ; if (yychar != YYEOF) yychar = YYEMPTY; yyposn += 1; yyglrShift (&yystack, 0, yyaction, yyposn, &yylval, &yylloc); if (0 < yystack.yyerrState) yystack.yyerrState -= 1; } else if (yyisErrorAction (yyaction)) { yystack.yyerror_range[1].yystate.yyloc = yylloc; yyreportSyntaxError (&yystack); goto yyuser_error; } else do { switch (yyglrReduce (&yystack, 0, -yyaction, 1)) { case yyok: break; case yyabort: goto yyabortlab; case yyaccept: goto yyacceptlab; case yyerr: goto yyuser_error; default: goto yybuglab; } } while ((0)); } } while ((1)) { yySymbol yytoken_to_shift; size_t yys; for (yys = 0; yys < yystack.yytops.yysize; yys += 1) yystackp->yytops.yylookaheadNeeds[yys] = yychar != YYEMPTY; # 2525 "glr-regr14.c" for (yys = 0; yys < yystack.yytops.yysize; yys += 1) do { switch (yyprocessOneStack (&yystack, yys, yyposn)) { case yyok: break; case yyabort: goto yyabortlab; case yyaccept: goto yyacceptlab; case yyerr: goto yyuser_error; default: goto yybuglab; } } while ((0)); yyremoveDeletes (&yystack); if (yystack.yytops.yysize == 0) { yyundeleteLastStack (&yystack); if (yystack.yytops.yysize == 0) yyFail (&yystack, "syntax error"); do { switch (yyresolveStack (&yystack)) { case yyok: break; case yyabort: goto yyabortlab; case yyaccept: goto yyacceptlab; case yyerr: goto yyuser_error; default: goto yybuglab; } } while ((0)); ; yystack.yyerror_range[1].yystate.yyloc = yylloc; yyreportSyntaxError (&yystack); goto yyuser_error; } yytoken_to_shift = ((yychar <= 0) ? YYEOF : (unsigned int) (yychar) <= 257 ? yytranslate[yychar] : 2); yychar = YYEMPTY; yyposn += 1; for (yys = 0; yys < yystack.yytops.yysize; yys += 1) { int yyaction; const short int* yyconflicts; yyStateNum yystate = yystack.yytops.yystates[yys]->yylrState; yygetLRActions (yystate, yytoken_to_shift, &yyaction, &yyconflicts); ; ; yyglrShift (&yystack, yys, yyaction, yyposn, &yylval, &yylloc); ; } if (yystack.yytops.yysize == 1) { do { switch (yyresolveStack (&yystack)) { case yyok: break; case yyabort: goto yyabortlab; case yyaccept: goto yyacceptlab; case yyerr: goto yyuser_error; default: goto yybuglab; } } while ((0)); ; yycompressStack (&yystack); break; } } continue; yyuser_error: yyrecoverSyntaxError (&yystack); yyposn = yystack.yytops.yystates[0]->yyposn; } yyacceptlab: yyresult = 0; goto yyreturn; yybuglab: ((void) ((0) || (abort (), 0))); goto yyabortlab; yyabortlab: yyresult = 1; goto yyreturn; yyexhaustedlab: yyerror ("memory exhausted"); yyresult = 2; goto yyreturn; yyreturn: if (yychar != YYEOF && yychar != YYEMPTY) yydestruct ("Cleanup: discarding lookahead", ((yychar <= 0) ? YYEOF : (unsigned int) (yychar) <= 257 ? yytranslate[yychar] : 2), &yylval, &yylloc); if (yystack.yyitems) { yyGLRState** yystates = yystack.yytops.yystates; if (yystates) { size_t yysize = yystack.yytops.yysize; size_t yyk; for (yyk = 0; yyk < yysize; yyk += 1) if (yystates[yyk]) { while (yystates[yyk]) { yyGLRState *yys = yystates[yyk]; yystack.yyerror_range[1].yystate.yyloc = yys->yyloc; yydestroyGLRState ("Cleanup: popping", yys); yystates[yyk] = yys->yypred; yystack.yynextFree -= 1; yystack.yyspaceLeft += 1; } break; } } yyfreeGLRStack (&yystack); } return (yyresult); } static void yypstack (yyGLRStack* yystackp, size_t yyk) __attribute__ ((__unused__)); static void yypdumpstack (yyGLRStack* yystackp) __attribute__ ((__unused__)); static void yy_yypstack (yyGLRState* yys) { if (yys->yypred) { yy_yypstack (yys->yypred); fprintf ((&__sF[2]), " -> "); } fprintf ((&__sF[2]), "address@hidden", yys->yylrState, (unsigned long int) yys->yyposn); } static void yypstates (yyGLRState* yyst) { if (yyst == 0L) fprintf ((&__sF[2]), ""); else yy_yypstack (yyst); fprintf ((&__sF[2]), "\n"); } static void yypstack (yyGLRStack* yystackp, size_t yyk) { yypstates (yystackp->yytops.yystates[yyk]); } static void yypdumpstack (yyGLRStack* yystackp) { yyGLRStackItem* yyp; size_t yyi; for (yyp = yystackp->yyitems; yyp < yystackp->yynextFree; yyp += 1) { fprintf ((&__sF[2]), "%3lu. ", (unsigned long int) (yyp - yystackp->yyitems)); if (*(yybool *) yyp) { fprintf ((&__sF[2]), "Res: %d, LR State: %d, posn: %lu, pred: %ld", yyp->yystate.yyresolved, yyp->yystate.yylrState, (unsigned long int) yyp->yystate.yyposn, (long int) ((yyp->yystate.yypred) == 0L ? -1 : (yyGLRStackItem*) (yyp->yystate.yypred) - yystackp->yyitems)); if (! yyp->yystate.yyresolved) fprintf ((&__sF[2]), ", firstVal: %ld", (long int) ((yyp->yystate.yysemantics.yyfirstVal) == 0L ? -1 : (yyGLRStackItem*) (yyp->yystate.yysemantics.yyfirstVal) - yystackp->yyitems)); } else { fprintf ((&__sF[2]), "Option. rule: %d, state: %ld, next: %ld", yyp->yyoption.yyrule - 1, (long int) ((yyp->yyoption.yystate) == 0L ? -1 : (yyGLRStackItem*) (yyp->yyoption.yystate) - yystackp->yyitems), (long int) ((yyp->yyoption.yynext) == 0L ? -1 : (yyGLRStackItem*) (yyp->yyoption.yynext) - yystackp->yyitems)); } fprintf ((&__sF[2]), "\n"); } fprintf ((&__sF[2]), "Tops:"); for (yyi = 0; yyi < yystackp->yytops.yysize; yyi += 1) fprintf ((&__sF[2]), "%lu: %ld; ", (unsigned long int) yyi, (long int) ((yystackp->yytops.yystates[yyi]) == 0L ? -1 : (yyGLRStackItem*) (yystackp->yytops.yystates[yyi]) - yystackp->yyitems)); fprintf ((&__sF[2]), "\n"); } # 143 "glr-regr14.y" static void yyerror (char const *msg) { fprintf ((&__sF[2]), "%s\n", msg); } static int yylex (void) { static char const *input = "abcdddd"; static int i = 0; yylloc.first_line = yylloc.last_line = 1; yylloc.first_column = yylloc.last_column = i + 1; yylval.value = input[i] + 'A' - 'a'; return input[i++]; } static void print_look_ahead (char const *reduction) { printf ("%s:\n yychar=", reduction); if (yychar == YYEMPTY) printf ("YYEMPTY"); else if (yychar == YYEOF) printf ("YYEOF"); else { printf ("'%c', yylval='", yychar); if (yylval.value > ' ') printf ("%c", yylval.value); printf ("', yylloc=(%d,%d),(%d,%d)", yylloc.first_line, yylloc.first_column, yylloc.last_line, yylloc.last_column); } printf ("\n"); } static char merge (union YYSTYPE s1, union YYSTYPE s2) { char dummy = s1.value + s2.value; return dummy; } int main (void) { yychar = '#'; yylval.value = '!'; return yyparse (); }