logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git
commit: 49f60b7f236dbd4fc4839a1c17632ddafb91c001
parent 10e71a69a346c6137d3483ad544fefb0ca6ef3e2
Author: Michael Forney <mforney@mforney.org>
Date:   Wed,  5 Jun 2019 23:09:06 -0700

netsurf: Disable javascript support

It is not that useful in its current form, and this save quite a
bit in executable size.

Diffstat:

M.gitmodules4----
Mpkg/netsurf/gen.lua24+++---------------------
Dpkg/netsurf/nsgenbind/gen.lua23-----------------------
Dpkg/netsurf/nsgenbind/nsgenbind-lexer.c2261-------------------------------------------------------------------------------
Dpkg/netsurf/nsgenbind/nsgenbind-lexer.h338-------------------------------------------------------------------------------
Dpkg/netsurf/nsgenbind/nsgenbind-parser.c2317-------------------------------------------------------------------------------
Dpkg/netsurf/nsgenbind/nsgenbind-parser.h161-------------------------------------------------------------------------------
Dpkg/netsurf/nsgenbind/patch/0001-Use-relative-include-paths.patch37-------------------------------------
Dpkg/netsurf/nsgenbind/src1-
Dpkg/netsurf/nsgenbind/ver1-
Dpkg/netsurf/nsgenbind/webidl-lexer.c2527-------------------------------------------------------------------------------
Dpkg/netsurf/nsgenbind/webidl-lexer.h337-------------------------------------------------------------------------------
Dpkg/netsurf/nsgenbind/webidl-parser.c4012-------------------------------------------------------------------------------
Dpkg/netsurf/nsgenbind/webidl-parser.h161-------------------------------------------------------------------------------
14 files changed, 3 insertions(+), 12201 deletions(-)

diff --git a/.gitmodules b/.gitmodules @@ -175,10 +175,6 @@ [submodule "pkg/netsurf/libwapcaplet/src"] path = pkg/netsurf/libwapcaplet/src url = git://git.netsurf-browser.org/libwapcaplet.git -[submodule "pkg/netsurf/nsgenbind/src"] - path = pkg/netsurf/nsgenbind/src - url = git://git.netsurf-browser.org/nsgenbind.git - ignore = all [submodule "pkg/nginx/src"] path = pkg/nginx/src url = https://github.com/nginx/nginx diff --git a/pkg/netsurf/gen.lua b/pkg/netsurf/gen.lua @@ -9,7 +9,6 @@ subgen 'libnsutils' subgen 'libparserutils' subgen 'libsvgtiny' subgen 'libwapcaplet' -subgen 'nsgenbind' sub('tools.ninja', function() toolchain 'host' @@ -51,16 +50,6 @@ cflags{ '-I pkg/utf8proc/src', } -rule('nsgenbind', '$outdir/nsgenbind/nsgenbind -I $srcdir/content/handlers/javascript/WebIDL $in $outdir/duktape', { - restat='1', -}) - -local nsgenbind = expand{'$outdir/duktape/', lines('nsgenbind.txt')} -build('nsgenbind', nsgenbind, { - '$srcdir/content/handlers/javascript/duktape/netsurf.bnd', - '|', '$outdir/nsgenbind/nsgenbind', '$dir/fetch', -}) - pkg.deps = { '$dir/libcss/fetch', '$dir/libdom/fetch', @@ -72,7 +61,6 @@ pkg.deps = { '$dir/libparserutils/fetch', '$dir/libsvgtiny/fetch', '$dir/libwapcaplet/fetch', - '$outdir/duktape/binding.c', 'pkg/curl/headers', 'pkg/freetype/fetch', 'pkg/libjpeg-turbo/headers', @@ -86,13 +74,7 @@ pkg.deps = { 'pkg/zlib/headers', } -local sources = {} -for _, src in ipairs(nsgenbind) do - if src:hassuffix('.c') then - table.insert(sources, src) - end -end -exe('netsurf', {sources, paths[[ +exe('netsurf', [[ desktop/( cookie_manager.c knockout.c hotlist.c mouse.c plot_style.c print.c search.c searchweb.c scrollbar.c @@ -111,7 +93,7 @@ exe('netsurf', {sources, paths[[ handlers/( image/(image.c image_cache.c bmp.c gif.c ico.c jpeg.c png.c svg.c) css/(css.c dump.c internal.c hints.c select.c utils.c) - javascript/(fetcher.c content.c duktape/(dukky.c duktape.c)) + javascript/(fetcher.c none/none.c) html/( box.c box_construct.c box_normalise.c box_textarea.c font.c form.c imagemap.c layout.c search.c table.c @@ -172,7 +154,7 @@ exe('netsurf', {sources, paths[[ wayland-protocols/xdg-shell-protocol.c.o ) -]]}) +]]) file('bin/netsurf', '755', '$outdir/netsurf') build('sed', '$outdir/netsurf.1', '$srcdir/docs/netsurf-fb.1', { diff --git a/pkg/netsurf/nsgenbind/gen.lua b/pkg/netsurf/nsgenbind/gen.lua @@ -1,23 +0,0 @@ -toolchain 'host' -cflags{'-I $srcdir/src'} - -local generated = { - 'nsgenbind-lexer.c', - 'nsgenbind-parser.c', - 'webidl-lexer.c', - 'webidl-parser.c', -} -for _, src in ipairs(generated) do - build('cc', '$outdir/src/'..src..'.o', {'$dir/'..src, '||', '$dir/fetch'}) -end - -exe('nsgenbind', [[src/( - nsgenbind.c utils.c webidl-ast.c nsgenbind-ast.c ir.c - duk-libdom.c duk-libdom-interface.c duk-libdom-dictionary.c - duk-libdom-common.c duk-libdom-generated.c - - nsgenbind-lexer.c.o nsgenbind-parser.c.o - webidl-lexer.c.o webidl-parser.c.o -)]]) - -fetch 'git' diff --git a/pkg/netsurf/nsgenbind/nsgenbind-lexer.c b/pkg/netsurf/nsgenbind/nsgenbind-lexer.c @@ -1,2261 +0,0 @@ -#line 2 "nsgenbind-lexer.c" - -#line 4 "nsgenbind-lexer.c" - -#define YY_INT_ALIGNED short int - -/* A lexical scanner generated by flex */ - -#define yy_create_buffer nsgenbind__create_buffer -#define yy_delete_buffer nsgenbind__delete_buffer -#define yy_flex_debug nsgenbind__flex_debug -#define yy_init_buffer nsgenbind__init_buffer -#define yy_flush_buffer nsgenbind__flush_buffer -#define yy_load_buffer_state nsgenbind__load_buffer_state -#define yy_switch_to_buffer nsgenbind__switch_to_buffer -#define yyin nsgenbind_in -#define yyleng nsgenbind_leng -#define yylex nsgenbind_lex -#define yylineno nsgenbind_lineno -#define yyout nsgenbind_out -#define yyrestart nsgenbind_restart -#define yytext nsgenbind_text -#define yywrap nsgenbind_wrap -#define yyalloc nsgenbind_alloc -#define yyrealloc nsgenbind_realloc -#define yyfree nsgenbind_free - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 6 -#define YY_FLEX_SUBMINOR_VERSION 2 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ -#include <stdio.h> -#include <string.h> -#include <errno.h> -#include <stdlib.h> - -/* end standard C headers. */ - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif - -#include <inttypes.h> -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - -#endif /* ! C99 */ - -#endif /* ! FLEXINT_H */ - -/* TODO: this is always defined, so inline it */ -#define yyconst const - -#if defined(__GNUC__) && __GNUC__ >= 3 -#define yynoreturn __attribute__((__noreturn__)) -#else -#define yynoreturn -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an - * integer in range [0..255] for use as an array index. - */ -#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN (yy_start) = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START (((yy_start) - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE nsgenbind_restart(nsgenbind_in ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else -#define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ -#endif - -/* The state buf must be large enough to hold one state per character in the main buffer. - */ -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE -typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - -extern int nsgenbind_leng; - -extern FILE *nsgenbind_in, *nsgenbind_out; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - - /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires - * access to the local variable yy_act. Since yyless() is a macro, it would break - * existing scanners that call yyless() from OUTSIDE nsgenbind_lex. - * One obvious solution it to make yy_act a global. I tried that, and saw - * a 5% performance hit in a non-nsgenbind_lineno scanner, because yy_act is - * normally declared as a register variable-- so it is not worth it. - */ - #define YY_LESS_LINENO(n) \ - do { \ - int yyl;\ - for ( yyl = n; yyl < nsgenbind_leng; ++yyl )\ - if ( nsgenbind_text[yyl] == '\n' )\ - --nsgenbind_lineno;\ - }while(0) - #define YY_LINENO_REWIND_TO(dst) \ - do {\ - const char *p;\ - for ( p = yy_cp-1; p >= (dst); --p)\ - if ( *p == '\n' )\ - --nsgenbind_lineno;\ - }while(0) - -/* Return all but the first "n" matched characters back to the input stream. */ -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up nsgenbind_text. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = (yy_hold_char); \ - YY_RESTORE_YY_MORE_OFFSET \ - (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up nsgenbind_text again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, (yytext_ptr) ) - -#ifndef YY_STRUCT_YY_BUFFER_STATE -#define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - int yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; - -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via nsgenbind_restart()), so that the user can continue scanning by - * just pointing nsgenbind_in at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - -/* Stack of input buffers. */ -static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ -static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - * - * Returns the top of the stack, or NULL. - */ -#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ - ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ - : NULL) - -/* Same as previous macro, but useful when we know that the buffer stack is not - * NULL or when we need an lvalue. For internal use only. - */ -#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] - -/* yy_hold_char holds the character lost when nsgenbind_text is formed. */ -static char yy_hold_char; -static int yy_n_chars; /* number of characters read into yy_ch_buf */ -int nsgenbind_leng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = NULL; -static int yy_init = 0; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow nsgenbind_wrap()'s to do buffer switches - * instead of setting up a fresh nsgenbind_in. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void nsgenbind_restart (FILE *input_file ); -void nsgenbind__switch_to_buffer (YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE nsgenbind__create_buffer (FILE *file,int size ); -void nsgenbind__delete_buffer (YY_BUFFER_STATE b ); -void nsgenbind__flush_buffer (YY_BUFFER_STATE b ); -void nsgenbind_push_buffer_state (YY_BUFFER_STATE new_buffer ); -void nsgenbind_pop_buffer_state (void ); - -static void nsgenbind_ensure_buffer_stack (void ); -static void nsgenbind__load_buffer_state (void ); -static void nsgenbind__init_buffer (YY_BUFFER_STATE b,FILE *file ); - -#define YY_FLUSH_BUFFER nsgenbind__flush_buffer(YY_CURRENT_BUFFER ) - -YY_BUFFER_STATE nsgenbind__scan_buffer (char *base,yy_size_t size ); -YY_BUFFER_STATE nsgenbind__scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE nsgenbind__scan_bytes (yyconst char *bytes,int len ); - -void *nsgenbind_alloc (yy_size_t ); -void *nsgenbind_realloc (void *,yy_size_t ); -void nsgenbind_free (void * ); - -#define yy_new_buffer nsgenbind__create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! YY_CURRENT_BUFFER ){ \ - nsgenbind_ensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - nsgenbind__create_buffer(nsgenbind_in,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! YY_CURRENT_BUFFER ){\ - nsgenbind_ensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - nsgenbind__create_buffer(nsgenbind_in,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) - -/* Begin user sect3 */ - -#define nsgenbind_wrap() (/*CONSTCOND*/1) -#define YY_SKIP_YYWRAP - -typedef flex_uint8_t YY_CHAR; - -FILE *nsgenbind_in = NULL, *nsgenbind_out = NULL; - -typedef int yy_state_type; - -extern int nsgenbind_lineno; - -int nsgenbind_lineno = 1; - -extern char *nsgenbind_text; -#ifdef yytext_ptr -#undef yytext_ptr -#endif -#define yytext_ptr nsgenbind_text - -static yy_state_type yy_get_previous_state (void ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); -static int yy_get_next_buffer (void ); -static void yynoreturn yy_fatal_error (yyconst char* msg ); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up nsgenbind_text. - */ -#define YY_DO_BEFORE_ACTION \ - (yytext_ptr) = yy_bp; \ - nsgenbind_leng = (int) (yy_cp - yy_bp); \ - (yy_hold_char) = *yy_cp; \ - *yy_cp = '\0'; \ - (yy_c_buf_p) = yy_cp; - -#define YY_NUM_RULES 41 -#define YY_END_OF_BUFFER 42 -/* This struct is not used in this scanner, - but its presence is necessary. */ -struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; -static yyconst flex_int16_t yy_accept[215] = - { 0, - 0, 0, 34, 34, 0, 0, 42, 32, 1, 2, - 1, 2, 32, 32, 32, 33, 32, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 32, 32, 32, 32, 1, 1, 32, 32, 32, 32, - 32, 34, 36, 38, 40, 39, 38, 37, 0, 29, - 27, 0, 26, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, 0, 34, - 35, 38, 0, 37, 38, 0, 0, 28, 28, 28, - - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 1, 2, 0, - 0, 0, 0, 0, 0, 1, 30, 28, 28, 28, - 18, 28, 28, 17, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 13, 28, 28, 28, 28, - 0, 0, 28, 9, 28, 12, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 24, 28, - 28, 28, 0, 28, 28, 20, 28, 19, 28, 28, - 28, 28, 28, 28, 21, 15, 23, 28, 28, 4, - 0, 3, 28, 28, 28, 5, 10, 28, 28, 28, - - 28, 28, 0, 7, 11, 8, 6, 16, 28, 14, - 25, 31, 22, 0 - } ; - -static yyconst YY_CHAR yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 4, 4, 5, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 6, 1, 7, 8, 1, 9, 1, 1, 1, - 1, 10, 1, 1, 1, 1, 11, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 13, 1, 1, - 1, 1, 1, 1, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 1, 15, 1, 1, 14, 1, 16, 17, 18, 19, - - 20, 21, 22, 23, 24, 14, 14, 25, 26, 27, - 28, 29, 14, 30, 31, 32, 33, 34, 35, 14, - 36, 14, 37, 1, 38, 1, 1, 39, 40, 41, - 41, 41, 41, 41, 41, 41, 41, 41, 1, 1, - 1, 42, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 43, 1, 1, 1, 1, 44, 45, - 1, 1, 1, 1, 1, 1, 1, 46, 47, 1, - 1, 1, 1, 1, 48, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 49, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 50, 51, 52, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static yyconst YY_CHAR yy_meta[53] = - { 0, - 1, 2, 3, 1, 4, 1, 2, 1, 5, 1, - 1, 6, 1, 6, 4, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1 - } ; - -static yyconst flex_int16_t yy_base[222] = - { 0, - 0, 51, 293, 292, 58, 60, 300, 303, 303, 303, - 303, 303, 292, 261, 287, 303, 283, 0, 271, 269, - 264, 44, 272, 264, 270, 26, 50, 253, 261, 267, - 241, 29, 36, 246, 102, 0, 260, 238, 34, 41, - 243, 0, 243, 0, 81, 303, 83, 303, 273, 303, - 303, 269, 303, 0, 251, 261, 252, 248, 258, 241, - 54, 240, 240, 71, 238, 253, 238, 238, 74, 249, - 303, 226, 222, 72, 219, 223, 0, 237, 215, 49, - 57, 220, 231, 0, 218, 214, 75, 211, 215, 0, - 303, 0, 122, 303, 124, 243, 241, 232, 219, 224, - - 224, 225, 214, 213, 224, 220, 210, 220, 206, 107, - 207, 208, 204, 216, 207, 110, 210, 303, 303, 194, - 190, 101, 187, 191, 211, 0, 303, 204, 196, 198, - 0, 194, 204, 0, 193, 194, 200, 204, 203, 190, - 197, 188, 195, 194, 195, 0, 185, 195, 188, 190, - 0, 183, 180, 0, 184, 0, 175, 177, 184, 186, - 183, 168, 177, 168, 165, 166, 176, 162, 0, 163, - 165, 166, 148, 158, 144, 0, 154, 0, 151, 130, - 128, 114, 114, 109, 0, 0, 0, 124, 123, 0, - 119, 0, 117, 110, 107, 0, 0, 105, 81, 80, - - 88, 74, 64, 0, 0, 0, 0, 0, 51, 0, - 0, 303, 0, 303, 154, 160, 166, 52, 172, 178, - 184 - } ; - -static yyconst flex_int16_t yy_def[222] = - { 0, - 214, 1, 215, 215, 216, 216, 214, 214, 214, 214, - 214, 214, 217, 214, 214, 214, 214, 218, 218, 218, - 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - 214, 214, 214, 214, 214, 35, 214, 214, 214, 214, - 214, 219, 214, 220, 214, 214, 220, 214, 217, 214, - 214, 221, 214, 218, 218, 218, 218, 218, 218, 218, - 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - 214, 214, 214, 214, 214, 214, 35, 214, 214, 214, - 214, 214, 214, 35, 214, 214, 214, 214, 214, 219, - 214, 220, 214, 214, 220, 221, 221, 218, 218, 218, - - 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - 218, 218, 218, 218, 218, 218, 218, 214, 214, 214, - 214, 214, 214, 214, 214, 35, 214, 218, 218, 218, - 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - 35, 214, 218, 218, 218, 218, 218, 218, 218, 218, - 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - 218, 218, 214, 218, 218, 218, 218, 218, 218, 218, - 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - 214, 218, 218, 218, 218, 218, 218, 218, 218, 218, - - 218, 218, 214, 218, 218, 218, 218, 218, 218, 218, - 218, 214, 218, 0, 214, 214, 214, 214, 214, 214, - 214 - } ; - -static yyconst flex_int16_t yy_nxt[356] = - { 0, - 8, 9, 10, 11, 12, 9, 13, 8, 14, 8, - 15, 16, 17, 18, 8, 18, 19, 20, 18, 21, - 22, 23, 18, 24, 18, 25, 18, 18, 26, 18, - 27, 28, 29, 18, 30, 18, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 31, 32, - 33, 34, 35, 63, 36, 64, 35, 54, 37, 45, - 46, 45, 46, 47, 48, 47, 48, 58, 59, 65, - 213, 72, 66, 73, 74, 75, 85, 104, 86, 87, - 88, 67, 93, 212, 93, 105, 93, 94, 95, 94, - 108, 120, 211, 121, 109, 122, 123, 115, 110, 38, - - 39, 40, 41, 77, 116, 77, 210, 77, 209, 78, - 118, 118, 118, 126, 126, 126, 208, 119, 119, 118, - 119, 119, 126, 93, 207, 93, 206, 93, 94, 95, - 94, 140, 148, 149, 205, 141, 204, 203, 142, 151, - 151, 151, 202, 201, 200, 199, 198, 197, 151, 196, - 79, 80, 81, 82, 42, 42, 42, 42, 42, 42, - 44, 44, 44, 44, 44, 44, 49, 49, 195, 194, - 49, 49, 90, 90, 90, 90, 193, 90, 92, 192, - 191, 92, 92, 92, 96, 96, 96, 96, 96, 96, - 190, 189, 188, 187, 186, 185, 184, 183, 182, 181, - - 180, 179, 178, 177, 176, 175, 174, 173, 172, 171, - 170, 169, 168, 167, 166, 165, 164, 163, 162, 161, - 160, 159, 158, 157, 156, 155, 154, 153, 152, 151, - 151, 151, 151, 150, 147, 146, 145, 144, 143, 139, - 138, 137, 136, 135, 134, 133, 132, 131, 130, 129, - 128, 127, 97, 126, 126, 126, 126, 125, 124, 77, - 83, 118, 118, 118, 118, 117, 114, 113, 112, 111, - 107, 106, 103, 102, 101, 100, 99, 98, 97, 50, - 91, 89, 84, 83, 76, 71, 70, 69, 68, 62, - 61, 60, 57, 56, 55, 53, 52, 51, 50, 214, - - 43, 43, 7, 214, 214, 214, 214, 214, 214, 214, - 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, - 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, - 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, - 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, - 214, 214, 214, 214, 214 - } ; - -static yyconst flex_int16_t yy_chk[356] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 2, 26, 2, 26, 2, 218, 2, 5, - 5, 6, 6, 5, 5, 6, 6, 22, 22, 27, - 209, 32, 27, 32, 33, 33, 39, 61, 39, 40, - 40, 27, 45, 203, 47, 61, 45, 45, 47, 47, - 64, 80, 202, 80, 64, 81, 81, 69, 64, 2, - - 2, 2, 2, 35, 69, 35, 201, 35, 200, 35, - 74, 74, 74, 87, 87, 87, 199, 74, 74, 74, - 87, 87, 87, 93, 198, 95, 195, 93, 93, 95, - 95, 110, 116, 116, 194, 110, 193, 191, 110, 122, - 122, 122, 189, 188, 184, 183, 182, 181, 122, 180, - 35, 35, 35, 35, 215, 215, 215, 215, 215, 215, - 216, 216, 216, 216, 216, 216, 217, 217, 179, 177, - 217, 217, 219, 219, 219, 219, 175, 219, 220, 174, - 173, 220, 220, 220, 221, 221, 221, 221, 221, 221, - 172, 171, 170, 168, 167, 166, 165, 164, 163, 162, - - 161, 160, 159, 158, 157, 155, 153, 152, 150, 149, - 148, 147, 145, 144, 143, 142, 141, 140, 139, 138, - 137, 136, 135, 133, 132, 130, 129, 128, 125, 124, - 123, 121, 120, 117, 115, 114, 113, 112, 111, 109, - 108, 107, 106, 105, 104, 103, 102, 101, 100, 99, - 98, 97, 96, 89, 88, 86, 85, 83, 82, 79, - 78, 76, 75, 73, 72, 70, 68, 67, 66, 65, - 63, 62, 60, 59, 58, 57, 56, 55, 52, 49, - 43, 41, 38, 37, 34, 31, 30, 29, 28, 25, - 24, 23, 21, 20, 19, 17, 15, 14, 13, 7, - - 4, 3, 214, 214, 214, 214, 214, 214, 214, 214, - 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, - 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, - 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, - 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, - 214, 214, 214, 214, 214 - } ; - -/* Table of booleans, true if rule could match eol. */ -static yyconst flex_int32_t yy_rule_can_match_eol[42] = - { 0, -0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, - 0, 0, }; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -extern int nsgenbind__flex_debug; -int nsgenbind__flex_debug = 0; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *nsgenbind_text; -#line 1 "nsgenbind-lexer.l" -#line 2 "nsgenbind-lexer.l" - -/* lexer for the binding generation config file - * - * This file is part of nsgenbind. - * Licensed under the MIT License, - * http://www.opensource.org/licenses/mit-license.php - * Copyright 2012 Vincent Sanders <vince@netsurf-browser.org> - */ - -#include <stdbool.h> -#include <stdio.h> -#include <string.h> - -#include "nsgenbind-parser.h" -#include "nsgenbind-ast.h" - -#define YY_USER_ACTION \ - yylloc->first_line = yylloc->last_line = nsgenbind_lineno; \ - yylloc->first_column = yylloc->last_column + 1; \ - yylloc->last_column += nsgenbind_leng; - - -/* Ensure compatability with bison 2.6 and later */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED && defined NSGENBIND_STYPE_IS_DECLARED -#define YYSTYPE NSGENBIND_STYPE -#endif - -#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED && defined NSGENBIND_LTYPE_IS_DECLARED -#define YYLTYPE NSGENBIND_LTYPE -#endif - -static struct YYLTYPE *locations = NULL; - -static struct YYLTYPE *push_location(struct YYLTYPE *head, - struct YYLTYPE *loc, - const char *filename) -{ - struct YYLTYPE *res; - res = calloc(1, sizeof(struct YYLTYPE)); - /* copy current location and line number */ - *res = *loc; - res->start_line = nsgenbind_lineno; - res->next = head; - - /* reset current location */ - loc->first_line = loc->last_line = 1; - loc->first_column = loc->last_column = 1; - loc->filename = strdup(filename); - nsgenbind_lineno = 1; - - return res; -} - -static struct YYLTYPE *pop_location(struct YYLTYPE *head, struct YYLTYPE *loc) -{ - struct YYLTYPE *res = NULL; - - if (head != NULL) { - res = head->next; - *loc = *head; - free(head); - - nsgenbind_lineno = loc->start_line; - } - return res; -} - - -/* lexer options */ -#define YY_NO_INPUT 1 -/* other Unicode “space separator” */ -/* non breaking space \u00A0 */ -/* Line separator \u2028 */ -/* paragraph separator \u2029 */ -/* used for #include directive */ - - -#line 727 "nsgenbind-lexer.c" - -#define INITIAL 0 -#define cblock 1 -#define incl 2 - -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include <unistd.h> -#endif - -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif - -static int yy_init_globals (void ); - -/* Accessor methods to globals. - These are made visible to non-reentrant scanners for convenience. */ - -int nsgenbind_lex_destroy (void ); - -int nsgenbind_get_debug (void ); - -void nsgenbind_set_debug (int debug_flag ); - -YY_EXTRA_TYPE nsgenbind_get_extra (void ); - -void nsgenbind_set_extra (YY_EXTRA_TYPE user_defined ); - -FILE *nsgenbind_get_in (void ); - -void nsgenbind_set_in (FILE * _in_str ); - -FILE *nsgenbind_get_out (void ); - -void nsgenbind_set_out (FILE * _out_str ); - - int nsgenbind_get_leng (void ); - -char *nsgenbind_get_text (void ); - -int nsgenbind_get_lineno (void ); - -void nsgenbind_set_lineno (int _line_number ); - -YYSTYPE * nsgenbind_get_lval (void ); - -void nsgenbind_set_lval (YYSTYPE * yylval_param ); - - YYLTYPE *nsgenbind_get_lloc (void ); - - void nsgenbind_set_lloc (YYLTYPE * yylloc_param ); - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int nsgenbind_wrap (void ); -#else -extern int nsgenbind_wrap (void ); -#endif -#endif - -#ifndef YY_NO_UNPUT - -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); -#endif - -#ifndef YY_NO_INPUT - -#ifdef __cplusplus -static int yyinput (void ); -#else -static int input (void ); -#endif - -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else -#define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ -#endif - -/* Copy whatever the last rule matched to the standard output. */ -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO do { if (fwrite( nsgenbind_text, (size_t) nsgenbind_leng, 1, nsgenbind_out )) {} } while (0) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ - { \ - int c = '*'; \ - int n; \ - for ( n = 0; n < max_size && \ - (c = getc( nsgenbind_in )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( nsgenbind_in ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, nsgenbind_in)) == 0 && ferror(nsgenbind_in)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(nsgenbind_in); \ - } \ - }\ -\ - -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* end tables serialization structures and prototypes */ - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL_IS_OURS 1 - -extern int nsgenbind_lex \ - (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ); - -#define YY_DECL int nsgenbind_lex \ - (YYSTYPE * yylval_param, YYLTYPE * yylloc_param ) -#endif /* !YY_DECL */ - -/* Code executed at the beginning of each rule, after nsgenbind_text and nsgenbind_leng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK /*LINTED*/break; -#endif - -#define YY_RULE_SETUP \ - if ( nsgenbind_leng > 0 ) \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ - (nsgenbind_text[nsgenbind_leng - 1] == '\n'); \ - YY_USER_ACTION - -/** The main scanner function which does all the work. - */ -YY_DECL -{ - yy_state_type yy_current_state; - char *yy_cp, *yy_bp; - int yy_act; - - YYSTYPE * yylval; - - YYLTYPE * yylloc; - - yylval = yylval_param; - - yylloc = yylloc_param; - - if ( !(yy_init) ) - { - (yy_init) = 1; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! (yy_start) ) - (yy_start) = 1; /* first start state */ - - if ( ! nsgenbind_in ) - nsgenbind_in = stdin; - - if ( ! nsgenbind_out ) - nsgenbind_out = stdout; - - if ( ! YY_CURRENT_BUFFER ) { - nsgenbind_ensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - nsgenbind__create_buffer(nsgenbind_in,YY_BUF_SIZE ); - } - - nsgenbind__load_buffer_state( ); - } - - { -#line 121 "nsgenbind-lexer.l" - - -#line 969 "nsgenbind-lexer.c" - - while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ - { - yy_cp = (yy_c_buf_p); - - /* Support of nsgenbind_text. */ - *yy_cp = (yy_hold_char); - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = (yy_start); - yy_current_state += YY_AT_BOL(); -yy_match: - do - { - YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 215 ) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - ++yy_cp; - } - while ( yy_current_state != 214 ); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - - YY_DO_BEFORE_ACTION; - - if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) - { - int yyl; - for ( yyl = 0; yyl < nsgenbind_leng; ++yyl ) - if ( nsgenbind_text[yyl] == '\n' ) - - nsgenbind_lineno++; -; - } - -do_action: /* This label is used only to access EOF actions. */ - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = (yy_hold_char); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - -case 1: -YY_RULE_SETUP -#line 123 "nsgenbind-lexer.l" -++yylloc->last_column;/* nothing */ - YY_BREAK -case 2: -/* rule 2 can match eol */ -YY_RULE_SETUP -#line 125 "nsgenbind-lexer.l" -if (nsgenbind_text[0] != '\r') { - /* update position counts */ - ++yylloc->last_line; - yylloc->last_column = 0; - } - YY_BREAK -/* binding terminals */ -case 3: -YY_RULE_SETUP -#line 133 "nsgenbind-lexer.l" -return TOK_BINDING; - YY_BREAK -case 4: -YY_RULE_SETUP -#line 134 "nsgenbind-lexer.l" -return TOK_WEBIDL; - YY_BREAK -case 5: -YY_RULE_SETUP -#line 135 "nsgenbind-lexer.l" -return TOK_PREFACE; - YY_BREAK -case 6: -YY_RULE_SETUP -#line 136 "nsgenbind-lexer.l" -return TOK_PROLOGUE; - YY_BREAK -case 7: -YY_RULE_SETUP -#line 137 "nsgenbind-lexer.l" -return TOK_EPILOGUE; - YY_BREAK -case 8: -YY_RULE_SETUP -#line 138 "nsgenbind-lexer.l" -return TOK_POSTFACE; - YY_BREAK -/* class member terminals */ -case 9: -YY_RULE_SETUP -#line 143 "nsgenbind-lexer.l" -return TOK_CLASS; - YY_BREAK -case 10: -YY_RULE_SETUP -#line 144 "nsgenbind-lexer.l" -return TOK_PRIVATE; - YY_BREAK -case 11: -YY_RULE_SETUP -#line 145 "nsgenbind-lexer.l" -return TOK_INTERNAL; - YY_BREAK -case 12: -YY_RULE_SETUP -#line 146 "nsgenbind-lexer.l" -return TOK_FLAGS; - YY_BREAK -case 13: -YY_RULE_SETUP -#line 147 "nsgenbind-lexer.l" -return TOK_TYPE; - YY_BREAK -case 14: -YY_RULE_SETUP -#line 148 "nsgenbind-lexer.l" -return TOK_UNSHARED; - YY_BREAK -case 15: -YY_RULE_SETUP -#line 149 "nsgenbind-lexer.l" -return TOK_SHARED; - YY_BREAK -case 16: -YY_RULE_SETUP -#line 150 "nsgenbind-lexer.l" -return TOK_PROPERTY; - YY_BREAK -/* implementation terminals */ -case 17: -YY_RULE_SETUP -#line 154 "nsgenbind-lexer.l" -return TOK_INIT; - YY_BREAK -case 18: -YY_RULE_SETUP -#line 155 "nsgenbind-lexer.l" -return TOK_FINI; - YY_BREAK -case 19: -YY_RULE_SETUP -#line 156 "nsgenbind-lexer.l" -return TOK_METHOD; - YY_BREAK -case 20: -YY_RULE_SETUP -#line 157 "nsgenbind-lexer.l" -return TOK_GETTER; - YY_BREAK -case 21: -YY_RULE_SETUP -#line 158 "nsgenbind-lexer.l" -return TOK_SETTER; - YY_BREAK -case 22: -YY_RULE_SETUP -#line 159 "nsgenbind-lexer.l" -return TOK_PROTOTYPE; - YY_BREAK -/* c type terminals */ -case 23: -YY_RULE_SETUP -#line 163 "nsgenbind-lexer.l" -return TOK_STRUCT; - YY_BREAK -case 24: -YY_RULE_SETUP -#line 164 "nsgenbind-lexer.l" -return TOK_UNION; - YY_BREAK -case 25: -YY_RULE_SETUP -#line 165 "nsgenbind-lexer.l" -return TOK_UNSIGNED; - YY_BREAK -/* other terminals */ -case 26: -YY_RULE_SETUP -#line 169 "nsgenbind-lexer.l" -return TOK_DBLCOLON; - YY_BREAK -case 27: -YY_RULE_SETUP -#line 171 "nsgenbind-lexer.l" -BEGIN(cblock); - YY_BREAK -case 28: -YY_RULE_SETUP -#line 173 "nsgenbind-lexer.l" -{ - /* A leading "_" is used to escape an identifier from - * looking like a reserved word terminal. - */ - yylval->text = (nsgenbind_text[0] == '_') ? strdup(nsgenbind_text + 1) : strdup(nsgenbind_text); - return TOK_IDENTIFIER; - } - YY_BREAK -case 29: -YY_RULE_SETUP -#line 181 "nsgenbind-lexer.l" -yylval->text = strndup(nsgenbind_text + 1, nsgenbind_leng - 2 ); return TOK_STRING_LITERAL; - YY_BREAK -case 30: -/* rule 30 can match eol */ -YY_RULE_SETUP -#line 183 "nsgenbind-lexer.l" -/* nothing */ - YY_BREAK -case 31: -YY_RULE_SETUP -#line 185 "nsgenbind-lexer.l" -BEGIN(incl); - YY_BREAK -case 32: -YY_RULE_SETUP -#line 187 "nsgenbind-lexer.l" -return (int) nsgenbind_text[0]; - YY_BREAK -case 33: -YY_RULE_SETUP -#line 189 "nsgenbind-lexer.l" -/* nothing */ - YY_BREAK -case 34: -/* rule 34 can match eol */ -YY_RULE_SETUP -#line 191 "nsgenbind-lexer.l" -yylval->text = strdup(nsgenbind_text); return TOK_CCODE_LITERAL; - YY_BREAK -case 35: -YY_RULE_SETUP -#line 192 "nsgenbind-lexer.l" -BEGIN(INITIAL); - YY_BREAK -case 36: -YY_RULE_SETUP -#line 193 "nsgenbind-lexer.l" -yylval->text = strdup(nsgenbind_text); return TOK_CCODE_LITERAL; - YY_BREAK -case 37: -YY_RULE_SETUP -#line 196 "nsgenbind-lexer.l" -/* eat the whitespace and open quotes */ - YY_BREAK -case 38: -YY_RULE_SETUP -#line 198 "nsgenbind-lexer.l" -{ - /* got the include file name */ - nsgenbind_in = genbindopen(nsgenbind_text); - - if (! nsgenbind_in) { - fprintf(stderr, "Unable to open include %s\n", nsgenbind_text); - exit(3); - } - - locations = push_location(locations, yylloc, nsgenbind_text); - - nsgenbind_push_buffer_state(nsgenbind__create_buffer(nsgenbind_in,YY_BUF_SIZE)); - BEGIN(INITIAL); - } - YY_BREAK -case 39: -/* rule 39 can match eol */ -YY_RULE_SETUP -#line 213 "nsgenbind-lexer.l" -BEGIN(INITIAL); - YY_BREAK -case 40: -YY_RULE_SETUP -#line 215 "nsgenbind-lexer.l" -/* nothing */ - YY_BREAK -case YY_STATE_EOF(INITIAL): -case YY_STATE_EOF(cblock): -case YY_STATE_EOF(incl): -#line 217 "nsgenbind-lexer.l" -{ - nsgenbind_pop_buffer_state(); - - if ( !YY_CURRENT_BUFFER ) { - yyterminate(); - } else { - locations = pop_location(locations, yylloc); - BEGIN(incl); - } - - } - YY_BREAK -case 41: -YY_RULE_SETUP -#line 229 "nsgenbind-lexer.l" -YY_FATAL_ERROR( "flex scanner jammed" ); - YY_BREAK -#line 1286 "nsgenbind-lexer.c" - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = (yy_hold_char); - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed nsgenbind_in at a new source and called - * nsgenbind_lex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = nsgenbind_in; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++(yy_c_buf_p); - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_END_OF_FILE: - { - (yy_did_buffer_switch_on_eof) = 0; - - if ( nsgenbind_wrap( ) ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * nsgenbind_text, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = - (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - (yy_c_buf_p) = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of user's declarations */ -} /* end of nsgenbind_lex */ - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ -static int yy_get_next_buffer (void) -{ - char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - char *source = (yytext_ptr); - int number_to_move, i; - int ret_val; - - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; - - else - { - int num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; - - int yy_c_buf_p_offset = - (int) ((yy_c_buf_p) - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - nsgenbind_realloc((void *) b->yy_ch_buf,(yy_size_t) (b->yy_buf_size + 2) ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = NULL; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1; - - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); - - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - if ( (yy_n_chars) == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - nsgenbind_restart(nsgenbind_in ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { - /* Extend the array by 50%, plus the number we really need. */ - int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) nsgenbind_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,(yy_size_t) new_size ); - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); - } - - (yy_n_chars) += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - - (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - - return ret_val; -} - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - - static yy_state_type yy_get_previous_state (void) -{ - yy_state_type yy_current_state; - char *yy_cp; - - yy_current_state = (yy_start); - yy_current_state += YY_AT_BOL(); - - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) - { - YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 215 ) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - } - - return yy_current_state; -} - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) -{ - int yy_is_jam; - char *yy_cp = (yy_c_buf_p); - - YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 215 ) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - yy_is_jam = (yy_current_state == 214); - - return yy_is_jam ? 0 : yy_current_state; -} - -#ifndef YY_NO_UNPUT - -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus - static int yyinput (void) -#else - static int input (void) -#endif - -{ - int c; - - *(yy_c_buf_p) = (yy_hold_char); - - if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - /* This was really a NUL. */ - *(yy_c_buf_p) = '\0'; - - else - { /* need more input */ - int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); - ++(yy_c_buf_p); - - switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - nsgenbind_restart(nsgenbind_in ); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: - { - if ( nsgenbind_wrap( ) ) - return 0; - - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + offset; - break; - } - } - } - - c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve nsgenbind_text */ - (yy_hold_char) = *++(yy_c_buf_p); - - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); - if ( YY_CURRENT_BUFFER_LVALUE->yy_at_bol ) - - nsgenbind_lineno++; -; - - return c; -} -#endif /* ifndef YY_NO_INPUT */ - -/** Immediately switch to a different input stream. - * @param input_file A readable stream. - * - * @note This function does not reset the start condition to @c INITIAL . - */ - void nsgenbind_restart (FILE * input_file ) -{ - - if ( ! YY_CURRENT_BUFFER ){ - nsgenbind_ensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - nsgenbind__create_buffer(nsgenbind_in,YY_BUF_SIZE ); - } - - nsgenbind__init_buffer(YY_CURRENT_BUFFER,input_file ); - nsgenbind__load_buffer_state( ); -} - -/** Switch to a different input buffer. - * @param new_buffer The new input buffer. - * - */ - void nsgenbind__switch_to_buffer (YY_BUFFER_STATE new_buffer ) -{ - - /* TODO. We should be able to replace this entire function body - * with - * nsgenbind_pop_buffer_state(); - * nsgenbind_push_buffer_state(new_buffer); - */ - nsgenbind_ensure_buffer_stack (); - if ( YY_CURRENT_BUFFER == new_buffer ) - return; - - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - YY_CURRENT_BUFFER_LVALUE = new_buffer; - nsgenbind__load_buffer_state( ); - - /* We don't actually know whether we did this switch during - * EOF (nsgenbind_wrap()) processing, but the only time this flag - * is looked at is after nsgenbind_wrap() is called, so it's safe - * to go ahead and always set it. - */ - (yy_did_buffer_switch_on_eof) = 1; -} - -static void nsgenbind__load_buffer_state (void) -{ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - nsgenbind_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - (yy_hold_char) = *(yy_c_buf_p); -} - -/** Allocate and initialize an input buffer state. - * @param file A readable stream. - * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * - * @return the allocated buffer state. - */ - YY_BUFFER_STATE nsgenbind__create_buffer (FILE * file, int size ) -{ - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) nsgenbind_alloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in nsgenbind__create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) nsgenbind_alloc((yy_size_t) (b->yy_buf_size + 2) ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in nsgenbind__create_buffer()" ); - - b->yy_is_our_buffer = 1; - - nsgenbind__init_buffer(b,file ); - - return b; -} - -/** Destroy the buffer. - * @param b a buffer created with nsgenbind__create_buffer() - * - */ - void nsgenbind__delete_buffer (YY_BUFFER_STATE b ) -{ - - if ( ! b ) - return; - - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - nsgenbind_free((void *) b->yy_ch_buf ); - - nsgenbind_free((void *) b ); -} - -/* Initializes or reinitializes a buffer. - * This function is sometimes called more than once on the same buffer, - * such as during a nsgenbind_restart() or at EOF. - */ - static void nsgenbind__init_buffer (YY_BUFFER_STATE b, FILE * file ) - -{ - int oerrno = errno; - - nsgenbind__flush_buffer(b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - - /* If b is the current buffer, then nsgenbind__init_buffer was _probably_ - * called from nsgenbind_restart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } - - b->yy_is_interactive = 0; - - errno = oerrno; -} - -/** Discard all buffered characters. On the next scan, YY_INPUT will be called. - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * - */ - void nsgenbind__flush_buffer (YY_BUFFER_STATE b ) -{ - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == YY_CURRENT_BUFFER ) - nsgenbind__load_buffer_state( ); -} - -/** Pushes the new state onto the stack. The new state becomes - * the current state. This function will allocate the stack - * if necessary. - * @param new_buffer The new state. - * - */ -void nsgenbind_push_buffer_state (YY_BUFFER_STATE new_buffer ) -{ - if (new_buffer == NULL) - return; - - nsgenbind_ensure_buffer_stack(); - - /* This block is copied from nsgenbind__switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - (yy_buffer_stack_top)++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from nsgenbind__switch_to_buffer. */ - nsgenbind__load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; -} - -/** Removes and deletes the top of the stack, if present. - * The next element becomes the new top. - * - */ -void nsgenbind_pop_buffer_state (void) -{ - if (!YY_CURRENT_BUFFER) - return; - - nsgenbind__delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - if ((yy_buffer_stack_top) > 0) - --(yy_buffer_stack_top); - - if (YY_CURRENT_BUFFER) { - nsgenbind__load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; - } -} - -/* Allocates the stack if it does not exist. - * Guarantees space for at least one push. - */ -static void nsgenbind_ensure_buffer_stack (void) -{ - yy_size_t num_to_alloc; - - if (!(yy_buffer_stack)) { - - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. - */ - num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ - (yy_buffer_stack) = (struct yy_buffer_state**)nsgenbind_alloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in nsgenbind_ensure_buffer_stack()" ); - - memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - - (yy_buffer_stack_max) = num_to_alloc; - (yy_buffer_stack_top) = 0; - return; - } - - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ - - /* Increase the buffer to prepare for a possible push. */ - yy_size_t grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)nsgenbind_realloc - ((yy_buffer_stack), - num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in nsgenbind_ensure_buffer_stack()" ); - - /* zero only the new slots.*/ - memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); - (yy_buffer_stack_max) = num_to_alloc; - } -} - -/** Setup the input buffer state to scan directly from a user-specified character buffer. - * @param base the character buffer - * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE nsgenbind__scan_buffer (char * base, yy_size_t size ) -{ - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return NULL; - - b = (YY_BUFFER_STATE) nsgenbind_alloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in nsgenbind__scan_buffer()" ); - - b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = NULL; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - nsgenbind__switch_to_buffer(b ); - - return b; -} - -/** Setup the input buffer state to scan a string. The next call to nsgenbind_lex() will - * scan from a @e copy of @a str. - * @param yystr a NUL-terminated string to scan - * - * @return the newly allocated buffer state object. - * @note If you want to scan bytes that may contain NUL values, then use - * nsgenbind__scan_bytes() instead. - */ -YY_BUFFER_STATE nsgenbind__scan_string (yyconst char * yystr ) -{ - - return nsgenbind__scan_bytes(yystr,(int) strlen(yystr) ); -} - -/** Setup the input buffer state to scan the given bytes. The next call to nsgenbind_lex() will - * scan from a @e copy of @a bytes. - * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE nsgenbind__scan_bytes (yyconst char * yybytes, int _yybytes_len ) -{ - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = (yy_size_t) (_yybytes_len + 2); - buf = (char *) nsgenbind_alloc(n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in nsgenbind__scan_bytes()" ); - - for ( i = 0; i < _yybytes_len; ++i ) - buf[i] = yybytes[i]; - - buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - - b = nsgenbind__scan_buffer(buf,n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in nsgenbind__scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; -} - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -static void yynoreturn yy_fatal_error (yyconst char* msg ) -{ - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); -} - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up nsgenbind_text. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - nsgenbind_text[nsgenbind_leng] = (yy_hold_char); \ - (yy_c_buf_p) = nsgenbind_text + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - nsgenbind_leng = yyless_macro_arg; \ - } \ - while ( 0 ) - -/* Accessor methods (get/set functions) to struct members. */ - -/** Get the current line number. - * - */ -int nsgenbind_get_lineno (void) -{ - - return nsgenbind_lineno; -} - -/** Get the input stream. - * - */ -FILE *nsgenbind_get_in (void) -{ - return nsgenbind_in; -} - -/** Get the output stream. - * - */ -FILE *nsgenbind_get_out (void) -{ - return nsgenbind_out; -} - -/** Get the length of the current token. - * - */ -int nsgenbind_get_leng (void) -{ - return nsgenbind_leng; -} - -/** Get the current token. - * - */ - -char *nsgenbind_get_text (void) -{ - return nsgenbind_text; -} - -/** Set the current line number. - * @param _line_number line number - * - */ -void nsgenbind_set_lineno (int _line_number ) -{ - - nsgenbind_lineno = _line_number; -} - -/** Set the input stream. This does not discard the current - * input buffer. - * @param _in_str A readable stream. - * - * @see nsgenbind__switch_to_buffer - */ -void nsgenbind_set_in (FILE * _in_str ) -{ - nsgenbind_in = _in_str ; -} - -void nsgenbind_set_out (FILE * _out_str ) -{ - nsgenbind_out = _out_str ; -} - -int nsgenbind_get_debug (void) -{ - return nsgenbind__flex_debug; -} - -void nsgenbind_set_debug (int _bdebug ) -{ - nsgenbind__flex_debug = _bdebug ; -} - -static int yy_init_globals (void) -{ - /* Initialization is the same as for the non-reentrant scanner. - * This function is called from nsgenbind_lex_destroy(), so don't allocate here. - */ - - /* We do not touch nsgenbind_lineno unless the option is enabled. */ - nsgenbind_lineno = 1; - - (yy_buffer_stack) = NULL; - (yy_buffer_stack_top) = 0; - (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = NULL; - (yy_init) = 0; - (yy_start) = 0; - -/* Defined in main.c */ -#ifdef YY_STDINIT - nsgenbind_in = stdin; - nsgenbind_out = stdout; -#else - nsgenbind_in = NULL; - nsgenbind_out = NULL; -#endif - - /* For future reference: Set errno on error, since we are called by - * nsgenbind_lex_init() - */ - return 0; -} - -/* nsgenbind_lex_destroy is for both reentrant and non-reentrant scanners. */ -int nsgenbind_lex_destroy (void) -{ - - /* Pop the buffer stack, destroying each element. */ - while(YY_CURRENT_BUFFER){ - nsgenbind__delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - nsgenbind_pop_buffer_state(); - } - - /* Destroy the stack itself. */ - nsgenbind_free((yy_buffer_stack) ); - (yy_buffer_stack) = NULL; - - /* Reset the globals. This is important in a non-reentrant scanner so the next time - * nsgenbind_lex() is called, initialization will occur. */ - yy_init_globals( ); - - return 0; -} - -/* - * Internal utility routines. - */ - -#ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) -{ - - int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; -} -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s ) -{ - int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; -} -#endif - -void *nsgenbind_alloc (yy_size_t size ) -{ - return malloc(size); -} - -void *nsgenbind_realloc (void * ptr, yy_size_t size ) -{ - - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return realloc(ptr, size); -} - -void nsgenbind_free (void * ptr ) -{ - free( (char *) ptr ); /* see nsgenbind_realloc() for (char *) cast */ -} - -#define YYTABLES_NAME "yytables" - -#line 229 "nsgenbind-lexer.l" - - - diff --git a/pkg/netsurf/nsgenbind/nsgenbind-lexer.h b/pkg/netsurf/nsgenbind/nsgenbind-lexer.h @@ -1,338 +0,0 @@ -#ifndef nsgenbind_HEADER_H -#define nsgenbind_HEADER_H 1 -#define nsgenbind_IN_HEADER 1 - -#line 6 "nsgenbind-lexer.h" - -#line 8 "nsgenbind-lexer.h" - -#define YY_INT_ALIGNED short int - -/* A lexical scanner generated by flex */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 6 -#define YY_FLEX_SUBMINOR_VERSION 2 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ -#include <stdio.h> -#include <string.h> -#include <errno.h> -#include <stdlib.h> - -/* end standard C headers. */ - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif - -#include <inttypes.h> -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - -#endif /* ! C99 */ - -#endif /* ! FLEXINT_H */ - -/* TODO: this is always defined, so inline it */ -#define yyconst const - -#if defined(__GNUC__) && __GNUC__ >= 3 -#define yynoreturn __attribute__((__noreturn__)) -#else -#define yynoreturn -#endif - -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else -#define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ -#endif - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE -typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - -extern int nsgenbind_leng; - -extern FILE *nsgenbind_in, *nsgenbind_out; - -#ifndef YY_STRUCT_YY_BUFFER_STATE -#define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - int yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; - - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - -void nsgenbind_restart (FILE *input_file ); -void nsgenbind__switch_to_buffer (YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE nsgenbind__create_buffer (FILE *file,int size ); -void nsgenbind__delete_buffer (YY_BUFFER_STATE b ); -void nsgenbind__flush_buffer (YY_BUFFER_STATE b ); -void nsgenbind_push_buffer_state (YY_BUFFER_STATE new_buffer ); -void nsgenbind_pop_buffer_state (void ); - -YY_BUFFER_STATE nsgenbind__scan_buffer (char *base,yy_size_t size ); -YY_BUFFER_STATE nsgenbind__scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE nsgenbind__scan_bytes (yyconst char *bytes,int len ); - -void *nsgenbind_alloc (yy_size_t ); -void *nsgenbind_realloc (void *,yy_size_t ); -void nsgenbind_free (void * ); - -/* Begin user sect3 */ - -#define nsgenbind_wrap() (/*CONSTCOND*/1) -#define YY_SKIP_YYWRAP - -extern int nsgenbind_lineno; - -extern char *nsgenbind_text; -#ifdef yytext_ptr -#undef yytext_ptr -#endif -#define yytext_ptr nsgenbind_text - -#ifdef YY_HEADER_EXPORT_START_CONDITIONS -#define INITIAL 0 -#define cblock 1 -#define incl 2 - -#endif - -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include <unistd.h> -#endif - -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif - -/* Accessor methods to globals. - These are made visible to non-reentrant scanners for convenience. */ - -int nsgenbind_lex_destroy (void ); - -int nsgenbind_get_debug (void ); - -void nsgenbind_set_debug (int debug_flag ); - -YY_EXTRA_TYPE nsgenbind_get_extra (void ); - -void nsgenbind_set_extra (YY_EXTRA_TYPE user_defined ); - -FILE *nsgenbind_get_in (void ); - -void nsgenbind_set_in (FILE * _in_str ); - -FILE *nsgenbind_get_out (void ); - -void nsgenbind_set_out (FILE * _out_str ); - - int nsgenbind_get_leng (void ); - -char *nsgenbind_get_text (void ); - -int nsgenbind_get_lineno (void ); - -void nsgenbind_set_lineno (int _line_number ); - -YYSTYPE * nsgenbind_get_lval (void ); - -void nsgenbind_set_lval (YYSTYPE * yylval_param ); - - YYLTYPE *nsgenbind_get_lloc (void ); - - void nsgenbind_set_lloc (YYLTYPE * yylloc_param ); - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int nsgenbind_wrap (void ); -#else -extern int nsgenbind_wrap (void ); -#endif -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); -#endif - -#ifndef YY_NO_INPUT - -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else -#define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL_IS_OURS 1 - -extern int nsgenbind_lex \ - (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ); - -#define YY_DECL int nsgenbind_lex \ - (YYSTYPE * yylval_param, YYLTYPE * yylloc_param ) -#endif /* !YY_DECL */ - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -#undef YY_NEW_FILE -#undef YY_FLUSH_BUFFER -#undef yy_set_bol -#undef yy_new_buffer -#undef yy_set_interactive -#undef YY_DO_BEFORE_ACTION - -#ifdef YY_DECL_IS_OURS -#undef YY_DECL_IS_OURS -#undef YY_DECL -#endif - -#line 229 "nsgenbind-lexer.l" - - -#line 337 "nsgenbind-lexer.h" -#undef nsgenbind_IN_HEADER -#endif /* nsgenbind_HEADER_H */ diff --git a/pkg/netsurf/nsgenbind/nsgenbind-parser.c b/pkg/netsurf/nsgenbind/nsgenbind-parser.c @@ -1,2317 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.0.4. */ - -/* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2015 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 <http://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. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "3.0.4" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 1 - -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - -/* Substitute the type names. */ -#define YYSTYPE NSGENBIND_STYPE -#define YYLTYPE NSGENBIND_LTYPE -/* Substitute the variable and function names. */ -#define yyparse nsgenbind_parse -#define yylex nsgenbind_lex -#define yyerror nsgenbind_error -#define yydebug nsgenbind_debug -#define yynerrs nsgenbind_nerrs - - -/* Copy the first part of user declarations. */ - -#line 75 "nsgenbind-parser.c" /* yacc.c:339 */ - -# ifndef YY_NULLPTR -# if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULLPTR nullptr -# else -# define YY_NULLPTR 0 -# endif -# endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 1 -#endif - -/* In a future release of Bison, this section will be replaced - by #include "nsgenbind-parser.h". */ -#ifndef YY_NSGENBIND_NSGENBIND_PARSER_H_INCLUDED -# define YY_NSGENBIND_NSGENBIND_PARSER_H_INCLUDED -/* Debug traces. */ -#ifndef NSGENBIND_DEBUG -# if defined YYDEBUG -#if YYDEBUG -# define NSGENBIND_DEBUG 1 -# else -# define NSGENBIND_DEBUG 0 -# endif -# else /* ! defined YYDEBUG */ -# define NSGENBIND_DEBUG 1 -# endif /* ! defined YYDEBUG */ -#endif /* ! defined NSGENBIND_DEBUG */ -#if NSGENBIND_DEBUG -extern int nsgenbind_debug; -#endif -/* "%code requires" blocks. */ -#line 21 "nsgenbind-parser.y" /* yacc.c:355 */ - - -#define YYLTYPE YYLTYPE -typedef struct YYLTYPE { - struct YYLTYPE *next; - int start_line; - char *filename; - - int first_line; - int first_column; - int last_line; - int last_column; -} YYLTYPE; - - -#define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (N) { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - (Current).filename = YYRHSLOC (Rhs, 1).filename; \ - (Current).start_line = YYRHSLOC (Rhs, 1).start_line; \ - } else { /* empty RHS */ \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - (Current).filename = YYRHSLOC (Rhs, 0).filename; \ - (Current).start_line = YYRHSLOC (Rhs, 0).start_line; \ - } \ - while (0) - - -#line 149 "nsgenbind-parser.c" /* yacc.c:355 */ - -/* Token type. */ -#ifndef NSGENBIND_TOKENTYPE -# define NSGENBIND_TOKENTYPE - enum nsgenbind_tokentype - { - TOK_BINDING = 258, - TOK_WEBIDL = 259, - TOK_PREFACE = 260, - TOK_PROLOGUE = 261, - TOK_EPILOGUE = 262, - TOK_POSTFACE = 263, - TOK_CLASS = 264, - TOK_PRIVATE = 265, - TOK_INTERNAL = 266, - TOK_FLAGS = 267, - TOK_TYPE = 268, - TOK_UNSHARED = 269, - TOK_SHARED = 270, - TOK_PROPERTY = 271, - TOK_INIT = 272, - TOK_FINI = 273, - TOK_METHOD = 274, - TOK_GETTER = 275, - TOK_SETTER = 276, - TOK_PROTOTYPE = 277, - TOK_DBLCOLON = 278, - TOK_STRUCT = 279, - TOK_UNION = 280, - TOK_UNSIGNED = 281, - TOK_IDENTIFIER = 282, - TOK_STRING_LITERAL = 283, - TOK_CCODE_LITERAL = 284 - }; -#endif - -/* Value type. */ -#if ! defined NSGENBIND_STYPE && ! defined NSGENBIND_STYPE_IS_DECLARED - -union NSGENBIND_STYPE -{ -#line 180 "nsgenbind-parser.y" /* yacc.c:355 */ - - char *text; - struct genbind_node *node; - long value; - -#line 197 "nsgenbind-parser.c" /* yacc.c:355 */ -}; - -typedef union NSGENBIND_STYPE NSGENBIND_STYPE; -# define NSGENBIND_STYPE_IS_TRIVIAL 1 -# define NSGENBIND_STYPE_IS_DECLARED 1 -#endif - -/* Location type. */ -#if ! defined NSGENBIND_LTYPE && ! defined NSGENBIND_LTYPE_IS_DECLARED -typedef struct NSGENBIND_LTYPE NSGENBIND_LTYPE; -struct NSGENBIND_LTYPE -{ - int first_line; - int first_column; - int last_line; - int last_column; -}; -# define NSGENBIND_LTYPE_IS_DECLARED 1 -# define NSGENBIND_LTYPE_IS_TRIVIAL 1 -#endif - - - -int nsgenbind_parse (char *filename, struct genbind_node **genbind_ast); - -#endif /* !YY_NSGENBIND_NSGENBIND_PARSER_H_INCLUDED */ - -/* Copy the second part of user declarations. */ - -#line 227 "nsgenbind-parser.c" /* yacc.c:358 */ -/* Unqualified %code blocks. */ -#line 63 "nsgenbind-parser.y" /* yacc.c:359 */ - -/* parser for the binding generation config file - * - * This file is part of nsgenbind. - * Licensed under the MIT License, - * http://www.opensource.org/licenses/mit-license.php - * Copyright 2012 Vincent Sanders <vince@netsurf-browser.org> - */ - -#include <stdio.h> -#include <string.h> - -#define YYFPRINTF genbind_fprintf -#define YY_LOCATION_PRINT(File, Loc) \ - genbind_fprintf(File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) - -#include "utils.h" -#include "nsgenbind-lexer.h" -#include "webidl-ast.h" -#include "nsgenbind-ast.h" - -char *errtxt; - -static void nsgenbind_error(YYLTYPE *locp, - char *filename, - struct genbind_node **genbind_ast, - const char *str) -{ - int errlen; - - UNUSED(genbind_ast); - UNUSED(filename); - - errlen = snprintf(NULL, 0, "%s:%d:%s", - locp->filename, locp->first_line, str); - errtxt = malloc(errlen + 1); - snprintf(errtxt, errlen + 1, "%s:%d:%s", - locp->filename, locp->first_line, str); - -} - -static struct genbind_node * -add_method(struct genbind_node **genbind_ast, - long methodtype, - struct genbind_node *declarator, - char *cdata, - long lineno, - char *filename) -{ - struct genbind_node *res_node; - struct genbind_node *method_node; - struct genbind_node *class_node; - struct genbind_node *cdata_node; - struct genbind_node *location_node; - char *class_name; - - /* extract the class name from the declarator */ - class_name = genbind_node_gettext( - genbind_node_find_type( - genbind_node_getnode( - genbind_node_find_type( - declarator, - NULL, - GENBIND_NODE_TYPE_CLASS)), - NULL, - GENBIND_NODE_TYPE_IDENT)); - - if (cdata == NULL) { - cdata_node = declarator; - } else { - cdata_node = genbind_new_node(GENBIND_NODE_TYPE_CDATA, - declarator, - cdata); - } - - location_node = genbind_new_node(GENBIND_NODE_TYPE_FILE, - genbind_new_number_node(GENBIND_NODE_TYPE_LINE, - cdata_node, - lineno), - strdup(filename)); - - /* generate method node */ - method_node = genbind_new_node(GENBIND_NODE_TYPE_METHOD, - NULL, - genbind_new_number_node(GENBIND_NODE_TYPE_METHOD_TYPE, - location_node, - methodtype)); - - class_node = genbind_node_find_type_ident(*genbind_ast, - NULL, - GENBIND_NODE_TYPE_CLASS, - class_name); - if (class_node == NULL) { - /* no existing class so manufacture one and attach method */ - res_node = genbind_new_node(GENBIND_NODE_TYPE_CLASS, NULL, - genbind_new_node(GENBIND_NODE_TYPE_IDENT, - method_node, - class_name)); - } else { - /* update the existing class */ - - /* link member node into class_node */ - genbind_node_add(class_node, method_node); - - res_node = NULL; /* updating so no need to add a new node */ - } - return res_node; -} - - -#line 342 "nsgenbind-parser.c" /* yacc.c:359 */ - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#else -typedef signed char yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T -# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ -# define YY_(Msgid) dgettext ("bison-runtime", Msgid) -# endif -# endif -# ifndef YY_ -# define YY_(Msgid) Msgid -# endif -#endif - -#ifndef YY_ATTRIBUTE -# if (defined __GNUC__ \ - && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ - || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C -# define YY_ATTRIBUTE(Spec) __attribute__(Spec) -# else -# define YY_ATTRIBUTE(Spec) /* empty */ -# endif -#endif - -#ifndef YY_ATTRIBUTE_PURE -# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) -#endif - -#ifndef YY_ATTRIBUTE_UNUSED -# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) -#endif - -#if !defined _Noreturn \ - && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) -# if defined _MSC_VER && 1200 <= _MSC_VER -# define _Noreturn __declspec (noreturn) -# else -# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) -#else -# define YYUSE(E) /* empty */ -#endif - -#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ - _Pragma ("GCC diagnostic pop") -#else -# define YY_INITIAL_VALUE(Value) Value -#endif -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - - -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include <alloca.h> /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include <malloc.h> /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS -# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ - /* Use EXIT_SUCCESS as a witness for stdlib.h. */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's 'empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined EXIT_SUCCESS \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined NSGENBIND_LTYPE_IS_TRIVIAL && NSGENBIND_LTYPE_IS_TRIVIAL \ - && defined NSGENBIND_STYPE_IS_TRIVIAL && NSGENBIND_STYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; - YYLTYPE yyls_alloc; -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ - + 2 * YYSTACK_GAP_MAXIMUM) - -# define YYCOPY_NEEDED 1 - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) - -#endif - -#if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from SRC to DST. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(Dst, Src, Count) \ - __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) -# else -# define YYCOPY(Dst, Src, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (Dst)[yyi] = (Src)[yyi]; \ - } \ - while (0) -# endif -# endif -#endif /* !YYCOPY_NEEDED */ - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 25 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 134 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 37 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 24 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 61 -/* YYNSTATES -- Number of states. */ -#define YYNSTATES 104 - -/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned - by yylex, with out-of-bounds checking. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 284 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM - as returned by yylex, without out-of-bounds checking. */ -static const yytype_uint8 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, - 35, 36, 33, 2, 34, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 30, - 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, 31, 2, 32, 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, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29 -}; - -#if NSGENBIND_DEBUG - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = -{ - 0, 251, 251, 258, 260, 265, 274, 276, 278, 282, - 292, 294, 301, 303, 317, 327, 336, 345, 354, 361, - 363, 370, 375, 384, 386, 394, 399, 410, 415, 422, - 427, 432, 437, 442, 447, 452, 456, 461, 466, 471, - 478, 483, 488, 496, 507, 518, 527, 538, 547, 551, - 558, 563, 568, 578, 583, 596, 601, 609, 613, 620, - 625, 630 -}; -#endif - -#if NSGENBIND_DEBUG || YYERROR_VERBOSE || 1 -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "TOK_BINDING", "TOK_WEBIDL", - "TOK_PREFACE", "TOK_PROLOGUE", "TOK_EPILOGUE", "TOK_POSTFACE", - "TOK_CLASS", "TOK_PRIVATE", "TOK_INTERNAL", "TOK_FLAGS", "TOK_TYPE", - "TOK_UNSHARED", "TOK_SHARED", "TOK_PROPERTY", "TOK_INIT", "TOK_FINI", - "TOK_METHOD", "TOK_GETTER", "TOK_SETTER", "TOK_PROTOTYPE", - "TOK_DBLCOLON", "TOK_STRUCT", "TOK_UNION", "TOK_UNSIGNED", - "TOK_IDENTIFIER", "TOK_STRING_LITERAL", "TOK_CCODE_LITERAL", "';'", - "'{'", "'}'", "'*'", "','", "'('", "')'", "$accept", "Input", - "Statements", "Statement", "Binding", "BindingArgs", "BindingArg", - "WebIDL", "CTypeSpecifier", "CType", "CTypeIdent", "CBlock", - "ParameterList", "Method", "MethodType", "BindingAndMethodType", - "MethodName", "MethodDeclarator", "Class", "ClassArgs", "ClassArg", - "ClassFlags", "Modifiers", "Modifier", YY_NULLPTR -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[NUM] -- (External) token number corresponding to the - (internal) symbol number NUM (which must be that of a token). */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 59, 123, 125, 42, 44, 40, 41 -}; -# endif - -#define YYPACT_NINF -42 - -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-42))) - -#define YYTABLE_NINF -1 - -#define yytable_value_is_error(Yytable_value) \ - 0 - - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -static const yytype_int8 yypact[] = -{ - 6, -20, 13, -42, -42, -42, -42, 51, -42, -42, - -42, -42, -42, -42, 91, 26, -42, -42, -42, 65, - -42, -42, -42, 62, 64, -42, -42, -15, 37, 76, - 63, 38, 28, -42, -42, 67, 66, -2, -42, -42, - 68, 61, 61, 71, -42, 68, 69, 63, -42, -42, - -42, 70, 72, 73, 75, -42, -42, 74, 77, -42, - -17, -42, 78, 79, -42, 47, 80, 81, -42, -12, - 23, 60, 82, -42, 36, -42, -42, -42, -42, 83, - 61, -42, -42, -42, -42, -42, -42, -42, 86, -42, - -42, -42, 84, -42, -42, -42, -42, 22, 88, -42, - -42, -42, -42, -42 -}; - - /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE does not specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 0, 0, 0, 36, 37, 38, 39, 0, 29, 30, - 31, 32, 33, 34, 0, 2, 3, 6, 8, 0, - 35, 7, 5, 0, 0, 1, 4, 0, 0, 0, - 48, 0, 0, 23, 28, 27, 0, 0, 10, 12, - 0, 0, 0, 0, 57, 0, 0, 48, 42, 41, - 40, 0, 0, 0, 0, 18, 46, 19, 0, 25, - 0, 24, 0, 0, 11, 0, 0, 0, 55, 0, - 0, 0, 0, 49, 0, 16, 17, 15, 20, 21, - 0, 45, 14, 9, 13, 50, 51, 53, 0, 59, - 60, 61, 0, 58, 54, 47, 44, 0, 0, 26, - 56, 52, 43, 22 -}; - - /* YYPGOTO[NTERM-NUM]. */ -static const yytype_int8 yypgoto[] = -{ - -42, -42, -42, 101, -42, -42, 85, -42, -42, -42, - -41, -24, 29, -42, -42, 12, -42, -42, -42, 87, - -42, -42, -42, -42 -}; - - /* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int8 yydefgoto[] = -{ - -1, 14, 15, 16, 17, 37, 38, 39, 57, 58, - 59, 35, 60, 18, 19, 20, 51, 28, 21, 46, - 47, 69, 70, 93 -}; - - /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule whose - number is the opposite. If YYTABLE_NINF, syntax error. */ -static const yytype_uint8 yytable[] = -{ - 66, 67, 36, 3, 4, 5, 6, 1, 31, 2, - 22, 3, 4, 5, 6, 7, 65, 80, 87, 81, - 32, 71, 88, 8, 9, 10, 11, 12, 13, 2, - 63, 3, 4, 5, 6, 7, 89, 90, 91, 99, - 23, 40, 45, 8, 9, 10, 11, 12, 13, 40, - 92, 48, 52, 53, 54, 55, 80, 49, 102, 45, - 52, 53, 54, 55, 56, 50, 33, 34, 3, 4, - 5, 6, 96, 41, 42, 43, 61, 84, 24, 44, - 36, 3, 4, 5, 6, 52, 53, 54, 55, 61, - 94, 25, 27, 29, 62, 30, 61, 33, 68, 75, - 76, 72, 77, 97, 79, 74, 98, 78, 82, 83, - 85, 86, 95, 100, 101, 103, 26, 0, 0, 0, - 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 73 -}; - -static const yytype_int8 yycheck[] = -{ - 41, 42, 4, 5, 6, 7, 8, 1, 23, 3, - 30, 5, 6, 7, 8, 9, 40, 34, 30, 36, - 35, 45, 34, 17, 18, 19, 20, 21, 22, 3, - 32, 5, 6, 7, 8, 9, 13, 14, 15, 80, - 27, 29, 30, 17, 18, 19, 20, 21, 22, 37, - 27, 13, 24, 25, 26, 27, 34, 19, 36, 47, - 24, 25, 26, 27, 36, 27, 29, 30, 5, 6, - 7, 8, 36, 10, 11, 12, 29, 30, 27, 16, - 4, 5, 6, 7, 8, 24, 25, 26, 27, 29, - 30, 0, 27, 31, 28, 31, 29, 29, 27, 27, - 27, 32, 27, 74, 27, 35, 23, 33, 30, 30, - 30, 30, 30, 27, 30, 27, 15, -1, -1, -1, - -1, -1, 37, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 47 -}; - - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = -{ - 0, 1, 3, 5, 6, 7, 8, 9, 17, 18, - 19, 20, 21, 22, 38, 39, 40, 41, 50, 51, - 52, 55, 30, 27, 27, 0, 40, 27, 54, 31, - 31, 23, 35, 29, 30, 48, 4, 42, 43, 44, - 52, 10, 11, 12, 16, 52, 56, 57, 13, 19, - 27, 53, 24, 25, 26, 27, 36, 45, 46, 47, - 49, 29, 28, 32, 43, 48, 47, 47, 27, 58, - 59, 48, 32, 56, 35, 27, 27, 27, 33, 27, - 34, 36, 30, 30, 30, 30, 30, 30, 34, 13, - 14, 15, 27, 60, 30, 30, 36, 49, 23, 47, - 27, 30, 36, 27 -}; - - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 37, 38, 39, 39, 39, 40, 40, 40, 41, - 42, 42, 43, 43, 44, 45, 45, 45, 45, 46, - 46, 47, 47, 48, 48, 49, 49, 50, 50, 51, - 51, 51, 51, 51, 51, 51, 52, 52, 52, 52, - 53, 53, 53, 54, 54, 54, 54, 55, 56, 56, - 57, 57, 57, 57, 57, 58, 58, 59, 59, 60, - 60, 60 -}; - - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 1, 1, 2, 2, 1, 1, 1, 6, - 1, 2, 1, 3, 3, 2, 2, 2, 1, 1, - 2, 2, 4, 1, 2, 1, 3, 3, 3, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 6, 5, 4, 3, 6, 0, 2, - 3, 3, 4, 3, 3, 1, 3, 0, 2, 1, - 1, 1 -}; - - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (&yylloc, filename, genbind_ast, YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (0) - -/* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (N) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (0) -#endif - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) - - -/* Enable debugging if requested. */ -#if NSGENBIND_DEBUG - -# ifndef YYFPRINTF -# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef YY_LOCATION_PRINT -# if defined NSGENBIND_LTYPE_IS_TRIVIAL && NSGENBIND_LTYPE_IS_TRIVIAL - -/* Print *YYLOCP on YYO. Private, do not rely on its existence. */ - -YY_ATTRIBUTE_UNUSED -static unsigned -yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp) -{ - unsigned res = 0; - int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; - if (0 <= yylocp->first_line) - { - res += YYFPRINTF (yyo, "%d", yylocp->first_line); - if (0 <= yylocp->first_column) - res += YYFPRINTF (yyo, ".%d", yylocp->first_column); - } - if (0 <= yylocp->last_line) - { - if (yylocp->first_line < yylocp->last_line) - { - res += YYFPRINTF (yyo, "-%d", yylocp->last_line); - if (0 <= end_col) - res += YYFPRINTF (yyo, ".%d", end_col); - } - else if (0 <= end_col && yylocp->first_column < end_col) - res += YYFPRINTF (yyo, "-%d", end_col); - } - return res; - } - -# define YY_LOCATION_PRINT(File, Loc) \ - yy_location_print_ (File, &(Loc)) - -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif -#endif - - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value, Location, filename, genbind_ast); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) - - -/*----------------------------------------. -| Print this symbol's value on YYOUTPUT. | -`----------------------------------------*/ - -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, char *filename, struct genbind_node **genbind_ast) -{ - FILE *yyo = yyoutput; - YYUSE (yyo); - YYUSE (yylocationp); - YYUSE (filename); - YYUSE (genbind_ast); - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - YYUSE (yytype); -} - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, char *filename, struct genbind_node **genbind_ast) -{ - YYFPRINTF (yyoutput, "%s %s (", - yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); - - YY_LOCATION_PRINT (yyoutput, *yylocationp); - YYFPRINTF (yyoutput, ": "); - yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, filename, genbind_ast); - YYFPRINTF (yyoutput, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -{ - YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -static void -yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, char *filename, struct genbind_node **genbind_ast) -{ - unsigned long int yylno = yyrline[yyrule]; - int yynrhs = yyr2[yyrule]; - int yyi; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, - yystos[yyssp[yyi + 1 - yynrhs]], - &(yyvsp[(yyi + 1) - (yynrhs)]) - , &(yylsp[(yyi + 1) - (yynrhs)]) , filename, genbind_ast); - YYFPRINTF (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyssp, yyvsp, yylsp, Rule, filename, genbind_ast); \ -} while (0) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !NSGENBIND_DEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !NSGENBIND_DEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -yystrlen (const char *yystr) -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -yystpcpy (char *yydest, const char *yysrc) -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) -{ - YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULLPTR; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; - - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) - { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - } - } - } - - switch (yycount) - { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } - - { - YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; -} -#endif /* YYERROR_VERBOSE */ - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, char *filename, struct genbind_node **genbind_ast) -{ - YYUSE (yyvaluep); - YYUSE (yylocationp); - YYUSE (filename); - YYUSE (genbind_ast); - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yytype); - YY_IGNORE_MAYBE_UNINITIALIZED_END -} - - - - -/*----------. -| yyparse. | -`----------*/ - -int -yyparse (char *filename, struct genbind_node **genbind_ast) -{ -/* The lookahead symbol. */ -int yychar; - - -/* The semantic value of the lookahead symbol. */ -/* Default value used for initialization, for pacifying older GCCs - or non-GCC compilers. */ -YY_INITIAL_VALUE (static YYSTYPE yyval_default;) -YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); - -/* Location data for the lookahead symbol. */ -static YYLTYPE yyloc_default -# if defined NSGENBIND_LTYPE_IS_TRIVIAL && NSGENBIND_LTYPE_IS_TRIVIAL - = { 1, 1, 1, 1 } -# endif -; -YYLTYPE yylloc = yyloc_default; - - /* Number of syntax errors so far. */ - int yynerrs; - - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - 'yyss': related to states. - 'yyvs': related to semantic values. - 'yyls': related to locations. - - Refer to the stacks through separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - /* The location stack. */ - YYLTYPE yylsa[YYINITDEPTH]; - YYLTYPE *yyls; - YYLTYPE *yylsp; - - /* The locations where the error started and ended. */ - YYLTYPE yyerror_range[3]; - - YYSIZE_T yystacksize; - - int yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - YYLTYPE yyloc; - -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - yylsp = yyls = yylsa; - yystacksize = YYINITDEPTH; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - -/* User initialization code. */ -#line 57 "nsgenbind-parser.y" /* yacc.c:1429 */ -{ - yylloc.first_line = yylloc.last_line = 1; - yylloc.first_column = yylloc.last_column = 1; - yylloc.filename = filename; -} - -#line 1428 "nsgenbind-parser.c" /* yacc.c:1429 */ - yylsp[0] = yylloc; - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - YYLTYPE *yyls1 = yyls; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yyls1, yysize * sizeof (*yylsp), - &yystacksize); - - yyls = yyls1; - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); - YYSTACK_RELOCATE (yyls_alloc, yyls); -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - yylsp = yyls + yysize - 1; - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - if (yystate == YYFINAL) - YYACCEPT; - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = yylex (&yylval, &yylloc); - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yytable_value_is_error (yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - - yystate = yyn; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - *++yylsp = yylloc; - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - '$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - /* Default location. */ - YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 2: -#line 252 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - *genbind_ast = (yyvsp[0].node); - } -#line 1619 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 4: -#line 261 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = *genbind_ast = genbind_node_prepend((yyvsp[0].node), (yyvsp[-1].node)); - } -#line 1627 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 5: -#line 266 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - fprintf(stderr, "%s\n", errtxt); - free(errtxt); - YYABORT ; - } -#line 1637 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 9: -#line 283 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = genbind_new_node(GENBIND_NODE_TYPE_BINDING, - NULL, - genbind_new_node(GENBIND_NODE_TYPE_NAME, - (yyvsp[-2].node), (yyvsp[-4].text))); - } -#line 1648 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 11: -#line 295 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = genbind_node_link((yyvsp[0].node), (yyvsp[-1].node)); - } -#line 1656 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 13: -#line 304 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = genbind_new_node(GENBIND_NODE_TYPE_METHOD, - NULL, - genbind_new_number_node(GENBIND_NODE_TYPE_METHOD_TYPE, - genbind_new_node(GENBIND_NODE_TYPE_CDATA, - NULL, - (yyvsp[-1].text)), - (yyvsp[-2].value))); - } -#line 1670 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 14: -#line 318 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = genbind_new_node(GENBIND_NODE_TYPE_WEBIDL, NULL, (yyvsp[-1].text)); - } -#line 1678 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 15: -#line 328 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = genbind_new_node(GENBIND_NODE_TYPE_NAME, - genbind_new_node(GENBIND_NODE_TYPE_NAME, - NULL, - strdup("unsigned")), - (yyvsp[0].text)); - } -#line 1690 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 16: -#line 337 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = genbind_new_node(GENBIND_NODE_TYPE_NAME, - genbind_new_node(GENBIND_NODE_TYPE_NAME, - NULL, - strdup("struct")), - (yyvsp[0].text)); - } -#line 1702 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 17: -#line 346 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = genbind_new_node(GENBIND_NODE_TYPE_NAME, - genbind_new_node(GENBIND_NODE_TYPE_NAME, - NULL, - strdup("union")), - (yyvsp[0].text)); - } -#line 1714 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 18: -#line 355 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = genbind_new_node(GENBIND_NODE_TYPE_NAME, NULL, (yyvsp[0].text)); - } -#line 1722 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 20: -#line 364 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = genbind_new_node(GENBIND_NODE_TYPE_NAME, (yyvsp[-1].node), strdup("*")); - } -#line 1730 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 21: -#line 371 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = genbind_new_node(GENBIND_NODE_TYPE_IDENT, (yyvsp[-1].node), (yyvsp[0].text)); - } -#line 1738 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 22: -#line 376 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = genbind_new_node(GENBIND_NODE_TYPE_IDENT, - genbind_new_node(GENBIND_NODE_TYPE_IDENT, (yyvsp[-3].node), (yyvsp[-2].text)), (yyvsp[0].text)); - } -#line 1747 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 24: -#line 387 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = genbind_strapp((yyvsp[-1].text), (yyvsp[0].text)); - } -#line 1755 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 25: -#line 395 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = genbind_new_node(GENBIND_NODE_TYPE_PARAMETER, NULL, (yyvsp[0].node)); - } -#line 1763 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 26: -#line 400 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = genbind_node_prepend((yyvsp[-2].node), - genbind_new_node( - GENBIND_NODE_TYPE_PARAMETER, - NULL, - (yyvsp[0].node))); - } -#line 1775 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 27: -#line 411 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = add_method(genbind_ast, (yyvsp[-2].value), (yyvsp[-1].node), (yyvsp[0].text), (yylsp[-2]).first_line, (yylsp[-2]).filename); - } -#line 1783 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 28: -#line 416 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = add_method(genbind_ast, (yyvsp[-2].value), (yyvsp[-1].node), NULL, (yylsp[-2]).first_line, (yylsp[-2]).filename); - } -#line 1791 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 29: -#line 423 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.value) = GENBIND_METHOD_TYPE_INIT; - } -#line 1799 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 30: -#line 428 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.value) = GENBIND_METHOD_TYPE_FINI; - } -#line 1807 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 31: -#line 433 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.value) = GENBIND_METHOD_TYPE_METHOD; - } -#line 1815 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 32: -#line 438 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.value) = GENBIND_METHOD_TYPE_GETTER; - } -#line 1823 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 33: -#line 443 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.value) = GENBIND_METHOD_TYPE_SETTER; - } -#line 1831 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 34: -#line 448 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.value) = GENBIND_METHOD_TYPE_PROTOTYPE; - } -#line 1839 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 36: -#line 457 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.value) = GENBIND_METHOD_TYPE_PREFACE; - } -#line 1847 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 37: -#line 462 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.value) = GENBIND_METHOD_TYPE_PROLOGUE; - } -#line 1855 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 38: -#line 467 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.value) = GENBIND_METHOD_TYPE_EPILOGUE; - } -#line 1863 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 39: -#line 472 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.value) = GENBIND_METHOD_TYPE_POSTFACE; - } -#line 1871 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 40: -#line 479 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = (yyvsp[0].text); - } -#line 1879 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 41: -#line 484 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("method"); - } -#line 1887 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 42: -#line 489 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("type"); - } -#line 1895 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 43: -#line 497 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = genbind_new_node(GENBIND_NODE_TYPE_CLASS, - genbind_new_node(GENBIND_NODE_TYPE_IDENT, - (yyvsp[-1].node), - (yyvsp[-3].text)), - genbind_new_node(GENBIND_NODE_TYPE_IDENT, - NULL, - (yyvsp[-5].text))); - } -#line 1909 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 44: -#line 508 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = genbind_new_node(GENBIND_NODE_TYPE_CLASS, - genbind_new_node(GENBIND_NODE_TYPE_IDENT, - NULL, - (yyvsp[-2].text)), - genbind_new_node(GENBIND_NODE_TYPE_IDENT, - NULL, - (yyvsp[-4].text))); - } -#line 1923 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 45: -#line 519 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = genbind_new_node(GENBIND_NODE_TYPE_CLASS, - (yyvsp[-1].node), - genbind_new_node(GENBIND_NODE_TYPE_IDENT, - NULL, - (yyvsp[-3].text))); - } -#line 1935 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 46: -#line 528 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = genbind_new_node(GENBIND_NODE_TYPE_CLASS, NULL, - genbind_new_node(GENBIND_NODE_TYPE_IDENT, - NULL, - (yyvsp[-2].text))); - } -#line 1946 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 47: -#line 539 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = genbind_new_node(GENBIND_NODE_TYPE_CLASS, NULL, - genbind_new_node(GENBIND_NODE_TYPE_IDENT, (yyvsp[-2].node), (yyvsp[-4].text))); - } -#line 1955 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 48: -#line 547 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = NULL; - } -#line 1963 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 49: -#line 552 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = genbind_node_prepend((yyvsp[0].node), (yyvsp[-1].node)); - } -#line 1971 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 50: -#line 559 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = genbind_new_node(GENBIND_NODE_TYPE_PRIVATE, NULL, (yyvsp[-1].node)); - } -#line 1979 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 51: -#line 564 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = genbind_new_node(GENBIND_NODE_TYPE_INTERNAL, NULL, (yyvsp[-1].node)); - } -#line 1987 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 52: -#line 569 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = genbind_new_node(GENBIND_NODE_TYPE_PROPERTY, NULL, - genbind_new_number_node(GENBIND_NODE_TYPE_MODIFIER, - genbind_new_node(GENBIND_NODE_TYPE_IDENT, - NULL, - (yyvsp[-1].text)), - (yyvsp[-2].value))); - } -#line 2000 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 53: -#line 579 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = genbind_new_node(GENBIND_NODE_TYPE_FLAGS, NULL, (yyvsp[-1].node)); - } -#line 2008 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 54: -#line 584 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = genbind_new_node(GENBIND_NODE_TYPE_METHOD, - NULL, - genbind_new_number_node(GENBIND_NODE_TYPE_METHOD_TYPE, - genbind_new_node(GENBIND_NODE_TYPE_CDATA, - NULL, - (yyvsp[-1].text)), - (yyvsp[-2].value))); - } -#line 2022 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 55: -#line 597 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = genbind_new_node(GENBIND_NODE_TYPE_IDENT, NULL, (yyvsp[0].text)); - } -#line 2030 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 56: -#line 602 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = genbind_new_node(GENBIND_NODE_TYPE_IDENT, (yyvsp[-2].node), (yyvsp[0].text)); - } -#line 2038 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 57: -#line 609 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.value) = GENBIND_TYPE_NONE; - } -#line 2046 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 58: -#line 614 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.value) |= (yyvsp[0].value); - } -#line 2054 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 59: -#line 621 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.value) = GENBIND_TYPE_TYPE; - } -#line 2062 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 60: -#line 626 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.value) = GENBIND_TYPE_UNSHARED; - } -#line 2070 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - case 61: -#line 631 "nsgenbind-parser.y" /* yacc.c:1646 */ - { - (yyval.value) = GENBIND_TYPE_NONE; - } -#line 2078 "nsgenbind-parser.c" /* yacc.c:1646 */ - break; - - -#line 2082 "nsgenbind-parser.c" /* yacc.c:1646 */ - default: break; - } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - *++yylsp = yyloc; - - /* Now 'shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*--------------------------------------. -| yyerrlab -- here on detecting error. | -`--------------------------------------*/ -yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (&yylloc, filename, genbind_ast, YY_("syntax error")); -#else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) - { - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (&yylloc, filename, genbind_ast, yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; - } -# undef YYSYNTAX_ERROR -#endif - } - - yyerror_range[1] = yylloc; - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval, &yylloc, filename, genbind_ast); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - yyerror_range[1] = yylsp[1-yylen]; - /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - yyerror_range[1] = *yylsp; - yydestruct ("Error: popping", - yystos[yystate], yyvsp, yylsp, filename, genbind_ast); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - yyerror_range[2] = yylloc; - /* Using YYLLOC is tempting, but would change the location of - the lookahead. YYLOC is available though. */ - YYLLOC_DEFAULT (yyloc, yyerror_range, 2); - *++yylsp = yyloc; - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#if !defined yyoverflow || YYERROR_VERBOSE -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (&yylloc, filename, genbind_ast, YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEMPTY) - { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE (yychar); - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval, &yylloc, filename, genbind_ast); - } - /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp, yylsp, filename, genbind_ast); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - return yyresult; -} -#line 636 "nsgenbind-parser.y" /* yacc.c:1906 */ - diff --git a/pkg/netsurf/nsgenbind/nsgenbind-parser.h b/pkg/netsurf/nsgenbind/nsgenbind-parser.h @@ -1,161 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.0.4. */ - -/* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2015 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 <http://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. */ - -#ifndef YY_NSGENBIND_NSGENBIND_PARSER_H_INCLUDED -# define YY_NSGENBIND_NSGENBIND_PARSER_H_INCLUDED -/* Debug traces. */ -#ifndef NSGENBIND_DEBUG -# if defined YYDEBUG -#if YYDEBUG -# define NSGENBIND_DEBUG 1 -# else -# define NSGENBIND_DEBUG 0 -# endif -# else /* ! defined YYDEBUG */ -# define NSGENBIND_DEBUG 1 -# endif /* ! defined YYDEBUG */ -#endif /* ! defined NSGENBIND_DEBUG */ -#if NSGENBIND_DEBUG -extern int nsgenbind_debug; -#endif -/* "%code requires" blocks. */ -#line 21 "nsgenbind-parser.y" /* yacc.c:1909 */ - - -#define YYLTYPE YYLTYPE -typedef struct YYLTYPE { - struct YYLTYPE *next; - int start_line; - char *filename; - - int first_line; - int first_column; - int last_line; - int last_column; -} YYLTYPE; - - -#define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (N) { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - (Current).filename = YYRHSLOC (Rhs, 1).filename; \ - (Current).start_line = YYRHSLOC (Rhs, 1).start_line; \ - } else { /* empty RHS */ \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - (Current).filename = YYRHSLOC (Rhs, 0).filename; \ - (Current).start_line = YYRHSLOC (Rhs, 0).start_line; \ - } \ - while (0) - - -#line 88 "nsgenbind-parser.h" /* yacc.c:1909 */ - -/* Token type. */ -#ifndef NSGENBIND_TOKENTYPE -# define NSGENBIND_TOKENTYPE - enum nsgenbind_tokentype - { - TOK_BINDING = 258, - TOK_WEBIDL = 259, - TOK_PREFACE = 260, - TOK_PROLOGUE = 261, - TOK_EPILOGUE = 262, - TOK_POSTFACE = 263, - TOK_CLASS = 264, - TOK_PRIVATE = 265, - TOK_INTERNAL = 266, - TOK_FLAGS = 267, - TOK_TYPE = 268, - TOK_UNSHARED = 269, - TOK_SHARED = 270, - TOK_PROPERTY = 271, - TOK_INIT = 272, - TOK_FINI = 273, - TOK_METHOD = 274, - TOK_GETTER = 275, - TOK_SETTER = 276, - TOK_PROTOTYPE = 277, - TOK_DBLCOLON = 278, - TOK_STRUCT = 279, - TOK_UNION = 280, - TOK_UNSIGNED = 281, - TOK_IDENTIFIER = 282, - TOK_STRING_LITERAL = 283, - TOK_CCODE_LITERAL = 284 - }; -#endif - -/* Value type. */ -#if ! defined NSGENBIND_STYPE && ! defined NSGENBIND_STYPE_IS_DECLARED - -union NSGENBIND_STYPE -{ -#line 180 "nsgenbind-parser.y" /* yacc.c:1909 */ - - char *text; - struct genbind_node *node; - long value; - -#line 136 "nsgenbind-parser.h" /* yacc.c:1909 */ -}; - -typedef union NSGENBIND_STYPE NSGENBIND_STYPE; -# define NSGENBIND_STYPE_IS_TRIVIAL 1 -# define NSGENBIND_STYPE_IS_DECLARED 1 -#endif - -/* Location type. */ -#if ! defined NSGENBIND_LTYPE && ! defined NSGENBIND_LTYPE_IS_DECLARED -typedef struct NSGENBIND_LTYPE NSGENBIND_LTYPE; -struct NSGENBIND_LTYPE -{ - int first_line; - int first_column; - int last_line; - int last_column; -}; -# define NSGENBIND_LTYPE_IS_DECLARED 1 -# define NSGENBIND_LTYPE_IS_TRIVIAL 1 -#endif - - - -int nsgenbind_parse (char *filename, struct genbind_node **genbind_ast); - -#endif /* !YY_NSGENBIND_NSGENBIND_PARSER_H_INCLUDED */ diff --git a/pkg/netsurf/nsgenbind/patch/0001-Use-relative-include-paths.patch b/pkg/netsurf/nsgenbind/patch/0001-Use-relative-include-paths.patch @@ -1,37 +0,0 @@ -From bf6cb0cd861dd2cbfa6a2e4754b6dd278b89b1d9 Mon Sep 17 00:00:00 2001 -From: Michael Forney <mforney@mforney.org> -Date: Fri, 23 Dec 2016 15:24:36 -0800 -Subject: [PATCH] Use relative include paths - ---- - src/duk-libdom-common.c | 14 +++----------- - 1 file changed, 3 insertions(+), 11 deletions(-) - -diff --git a/src/duk-libdom-common.c b/src/duk-libdom-common.c -index 6111070..ff225b0 100644 ---- a/src/duk-libdom-common.c -+++ b/src/duk-libdom-common.c -@@ -85,17 +85,9 @@ int output_tool_prologue(FILE* outf) - { - char *fpath; - -- fpath = genb_fpath("binding.h"); -- fprintf(outf, "\n#include \"%s\"\n", fpath); -- free(fpath); -- -- fpath = genb_fpath("private.h"); -- fprintf(outf, "#include \"%s\"\n", fpath); -- free(fpath); -- -- fpath = genb_fpath("prototype.h"); -- fprintf(outf, "#include \"%s\"\n", fpath); -- free(fpath); -+ fputs("\n#include \"binding.h\"\n", outf); -+ fputs("#include \"private.h\"\n", outf); -+ fputs("#include \"prototype.h\"\n", outf); - - return 0; - } --- -2.11.0 - diff --git a/pkg/netsurf/nsgenbind/src b/pkg/netsurf/nsgenbind/src @@ -1 +0,0 @@ -Subproject commit b39750cd36da48996a3ae429fb5c60df5e3a016b diff --git a/pkg/netsurf/nsgenbind/ver b/pkg/netsurf/nsgenbind/ver @@ -1 +0,0 @@ -0.6 diff --git a/pkg/netsurf/nsgenbind/webidl-lexer.c b/pkg/netsurf/nsgenbind/webidl-lexer.c @@ -1,2527 +0,0 @@ -#line 2 "webidl-lexer.c" - -#line 4 "webidl-lexer.c" - -#define YY_INT_ALIGNED short int - -/* A lexical scanner generated by flex */ - -#define yy_create_buffer webidl__create_buffer -#define yy_delete_buffer webidl__delete_buffer -#define yy_flex_debug webidl__flex_debug -#define yy_init_buffer webidl__init_buffer -#define yy_flush_buffer webidl__flush_buffer -#define yy_load_buffer_state webidl__load_buffer_state -#define yy_switch_to_buffer webidl__switch_to_buffer -#define yyin webidl_in -#define yyleng webidl_leng -#define yylex webidl_lex -#define yylineno webidl_lineno -#define yyout webidl_out -#define yyrestart webidl_restart -#define yytext webidl_text -#define yywrap webidl_wrap -#define yyalloc webidl_alloc -#define yyrealloc webidl_realloc -#define yyfree webidl_free - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 6 -#define YY_FLEX_SUBMINOR_VERSION 2 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ -#include <stdio.h> -#include <string.h> -#include <errno.h> -#include <stdlib.h> - -/* end standard C headers. */ - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif - -#include <inttypes.h> -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - -#endif /* ! C99 */ - -#endif /* ! FLEXINT_H */ - -/* TODO: this is always defined, so inline it */ -#define yyconst const - -#if defined(__GNUC__) && __GNUC__ >= 3 -#define yynoreturn __attribute__((__noreturn__)) -#else -#define yynoreturn -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an - * integer in range [0..255] for use as an array index. - */ -#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN (yy_start) = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START (((yy_start) - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE webidl_restart(webidl_in ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else -#define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ -#endif - -/* The state buf must be large enough to hold one state per character in the main buffer. - */ -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE -typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - -extern int webidl_leng; - -extern FILE *webidl_in, *webidl_out; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - - /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires - * access to the local variable yy_act. Since yyless() is a macro, it would break - * existing scanners that call yyless() from OUTSIDE webidl_lex. - * One obvious solution it to make yy_act a global. I tried that, and saw - * a 5% performance hit in a non-webidl_lineno scanner, because yy_act is - * normally declared as a register variable-- so it is not worth it. - */ - #define YY_LESS_LINENO(n) \ - do { \ - int yyl;\ - for ( yyl = n; yyl < webidl_leng; ++yyl )\ - if ( webidl_text[yyl] == '\n' )\ - --webidl_lineno;\ - }while(0) - #define YY_LINENO_REWIND_TO(dst) \ - do {\ - const char *p;\ - for ( p = yy_cp-1; p >= (dst); --p)\ - if ( *p == '\n' )\ - --webidl_lineno;\ - }while(0) - -/* Return all but the first "n" matched characters back to the input stream. */ -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up webidl_text. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = (yy_hold_char); \ - YY_RESTORE_YY_MORE_OFFSET \ - (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up webidl_text again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, (yytext_ptr) ) - -#ifndef YY_STRUCT_YY_BUFFER_STATE -#define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - int yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; - -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via webidl_restart()), so that the user can continue scanning by - * just pointing webidl_in at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - -/* Stack of input buffers. */ -static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ -static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - * - * Returns the top of the stack, or NULL. - */ -#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ - ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ - : NULL) - -/* Same as previous macro, but useful when we know that the buffer stack is not - * NULL or when we need an lvalue. For internal use only. - */ -#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] - -/* yy_hold_char holds the character lost when webidl_text is formed. */ -static char yy_hold_char; -static int yy_n_chars; /* number of characters read into yy_ch_buf */ -int webidl_leng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = NULL; -static int yy_init = 0; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow webidl_wrap()'s to do buffer switches - * instead of setting up a fresh webidl_in. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void webidl_restart (FILE *input_file ); -void webidl__switch_to_buffer (YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE webidl__create_buffer (FILE *file,int size ); -void webidl__delete_buffer (YY_BUFFER_STATE b ); -void webidl__flush_buffer (YY_BUFFER_STATE b ); -void webidl_push_buffer_state (YY_BUFFER_STATE new_buffer ); -void webidl_pop_buffer_state (void ); - -static void webidl_ensure_buffer_stack (void ); -static void webidl__load_buffer_state (void ); -static void webidl__init_buffer (YY_BUFFER_STATE b,FILE *file ); - -#define YY_FLUSH_BUFFER webidl__flush_buffer(YY_CURRENT_BUFFER ) - -YY_BUFFER_STATE webidl__scan_buffer (char *base,yy_size_t size ); -YY_BUFFER_STATE webidl__scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE webidl__scan_bytes (yyconst char *bytes,int len ); - -void *webidl_alloc (yy_size_t ); -void *webidl_realloc (void *,yy_size_t ); -void webidl_free (void * ); - -#define yy_new_buffer webidl__create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! YY_CURRENT_BUFFER ){ \ - webidl_ensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - webidl__create_buffer(webidl_in,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! YY_CURRENT_BUFFER ){\ - webidl_ensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - webidl__create_buffer(webidl_in,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) - -/* Begin user sect3 */ - -#define webidl_wrap() (/*CONSTCOND*/1) -#define YY_SKIP_YYWRAP - -typedef flex_uint8_t YY_CHAR; - -FILE *webidl_in = NULL, *webidl_out = NULL; - -typedef int yy_state_type; - -extern int webidl_lineno; - -int webidl_lineno = 1; - -extern char *webidl_text; -#ifdef yytext_ptr -#undef yytext_ptr -#endif -#define yytext_ptr webidl_text - -static yy_state_type yy_get_previous_state (void ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); -static int yy_get_next_buffer (void ); -static void yynoreturn yy_fatal_error (yyconst char* msg ); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up webidl_text. - */ -#define YY_DO_BEFORE_ACTION \ - (yytext_ptr) = yy_bp; \ - webidl_leng = (int) (yy_cp - yy_bp); \ - (yy_hold_char) = *yy_cp; \ - *yy_cp = '\0'; \ - (yy_c_buf_p) = yy_cp; - -#define YY_NUM_RULES 64 -#define YY_END_OF_BUFFER 65 -/* This struct is not used in this scanner, - but its presence is necessary. */ -struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; -static yyconst flex_int16_t yy_accept[407] = - { 0, - 0, 0, 0, 0, 65, 60, 1, 2, 1, 60, - 60, 60, 60, 52, 52, 51, 51, 51, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 51, 60, 60, - 60, 60, 1, 1, 60, 60, 60, 60, 60, 62, - 64, 63, 62, 61, 0, 56, 0, 52, 0, 55, - 0, 58, 55, 53, 0, 0, 52, 51, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 51, 37, 51, - - 51, 51, 51, 51, 51, 51, 51, 51, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 62, 0, 61, - 62, 0, 0, 0, 25, 0, 0, 0, 55, 0, - 0, 55, 54, 51, 51, 51, 51, 29, 51, 51, - 30, 51, 51, 51, 51, 51, 51, 51, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 51, 1, 2, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, - - 55, 57, 0, 55, 51, 51, 26, 51, 51, 51, - 51, 51, 4, 51, 51, 51, 51, 51, 51, 12, - 51, 51, 51, 51, 51, 51, 51, 51, 51, 34, - 35, 51, 51, 51, 51, 51, 51, 51, 51, 51, - 51, 51, 41, 51, 51, 51, 43, 0, 0, 0, - 51, 51, 51, 51, 51, 51, 51, 51, 8, 51, - 51, 51, 51, 51, 32, 33, 51, 51, 51, 51, - 51, 51, 51, 5, 51, 51, 51, 51, 51, 51, - 40, 51, 51, 51, 51, 51, 0, 0, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 51, 51, 31, - - 51, 14, 51, 51, 51, 51, 51, 36, 51, 51, - 51, 51, 51, 20, 21, 51, 51, 51, 51, 0, - 51, 51, 51, 51, 45, 51, 3, 51, 9, 10, - 51, 51, 51, 16, 51, 51, 51, 51, 51, 19, - 51, 51, 51, 51, 23, 51, 51, 0, 51, 51, - 28, 51, 51, 7, 51, 51, 51, 51, 46, 51, - 51, 38, 44, 48, 39, 51, 51, 42, 59, 51, - 27, 51, 6, 51, 13, 51, 17, 51, 51, 51, - 51, 51, 51, 11, 15, 51, 51, 51, 51, 49, - 51, 51, 51, 22, 51, 51, 18, 51, 24, 51, - - 51, 51, 47, 51, 50, 0 - } ; - -static yyconst YY_CHAR yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 4, 4, 5, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 6, 1, 7, 8, 1, 1, 1, 9, 1, - 1, 10, 11, 1, 11, 12, 13, 14, 15, 15, - 15, 15, 15, 15, 15, 15, 16, 1, 1, 1, - 1, 1, 1, 1, 17, 17, 18, 19, 20, 17, - 21, 21, 22, 21, 21, 21, 23, 24, 25, 26, - 21, 21, 27, 21, 21, 21, 21, 28, 21, 21, - 1, 29, 1, 1, 21, 1, 30, 31, 32, 33, - - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 21, 52, - 53, 21, 1, 1, 1, 1, 1, 54, 55, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 1, 1, - 1, 57, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 58, 1, 1, 1, 1, 59, 60, - 1, 1, 1, 1, 1, 1, 1, 61, 62, 1, - 1, 1, 1, 1, 63, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 64, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 65, 66, 67, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static yyconst YY_CHAR yy_meta[68] = - { 0, - 1, 2, 3, 1, 4, 1, 2, 1, 1, 1, - 1, 1, 1, 5, 5, 5, 5, 5, 5, 5, - 6, 6, 6, 6, 6, 6, 6, 6, 1, 5, - 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1 - } ; - -static yyconst flex_int16_t yy_base[413] = - { 0, - 0, 66, 73, 75, 659, 660, 660, 660, 660, 62, - 68, 73, 80, 82, 89, 0, 614, 70, 614, 626, - 608, 43, 54, 78, 77, 74, 83, 620, 86, 93, - 603, 107, 622, 617, 106, 59, 607, 605, 588, 13, - 64, 593, 140, 145, 608, 585, 98, 105, 590, 0, - 155, 660, 161, 660, 107, 660, 127, 158, 631, 166, - 632, 660, 169, 150, 179, 0, 201, 0, 598, 617, - 590, 603, 145, 593, 583, 586, 590, 584, 591, 588, - 596, 588, 596, 577, 576, 593, 583, 579, 573, 576, - 139, 586, 583, 575, 576, 577, 566, 565, 0, 566, - - 120, 150, 568, 161, 561, 565, 150, 571, 660, 554, - 550, 164, 547, 551, 226, 566, 543, 164, 147, 548, - 558, 234, 546, 542, 189, 539, 543, 0, 247, 660, - 253, 232, 295, 317, 660, 251, 586, 582, 254, 261, - 232, 242, 0, 546, 566, 558, 553, 0, 556, 547, - 0, 541, 546, 552, 544, 536, 553, 548, 532, 549, - 537, 544, 529, 546, 526, 533, 539, 538, 524, 540, - 533, 527, 533, 532, 527, 515, 530, 512, 511, 511, - 512, 509, 519, 522, 521, 520, 515, 519, 660, 660, - 497, 493, 224, 490, 494, 515, 314, 368, 390, 267, - - 270, 660, 280, 289, 497, 496, 0, 501, 510, 504, - 503, 506, 0, 508, 489, 488, 487, 497, 493, 0, - 488, 498, 482, 496, 495, 481, 480, 496, 493, 0, - 0, 492, 474, 478, 483, 476, 481, 484, 483, 467, - 477, 471, 0, 480, 464, 475, 0, 351, 469, 412, - 462, 461, 469, 488, 457, 473, 473, 472, 0, 457, - 466, 455, 464, 448, 0, 0, 449, 453, 456, 458, - 461, 438, 441, 0, 446, 458, 444, 439, 442, 437, - 0, 451, 446, 447, 431, 436, 428, 0, 427, 438, - 426, 430, 430, 413, 414, 424, 394, 393, 396, 0, - - 400, 0, 403, 387, 405, 393, 191, 0, 403, 378, - 373, 379, 380, 0, 0, 373, 362, 349, 361, 361, - 361, 349, 338, 347, 0, 340, 0, 337, 0, 0, - 346, 331, 331, 0, 341, 338, 341, 321, 328, 0, - 315, 334, 332, 330, 0, 326, 330, 328, 312, 324, - 0, 310, 322, 0, 307, 303, 296, 310, 0, 302, - 308, 0, 0, 0, 0, 303, 308, 0, 660, 295, - 0, 289, 0, 270, 0, 273, 0, 278, 270, 274, - 258, 259, 250, 0, 0, 255, 243, 224, 230, 0, - 213, 194, 206, 0, 200, 199, 0, 173, 0, 126, - - 137, 101, 0, 73, 0, 660, 447, 453, 455, 461, - 467, 94 - } ; - -static yyconst flex_int16_t yy_def[413] = - { 0, - 406, 1, 407, 407, 406, 406, 406, 406, 406, 408, - 406, 406, 406, 406, 406, 409, 409, 409, 409, 409, - 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, - 409, 409, 409, 409, 409, 409, 409, 409, 406, 406, - 406, 406, 406, 406, 406, 406, 406, 406, 406, 410, - 406, 406, 410, 406, 408, 406, 408, 406, 406, 406, - 411, 406, 406, 406, 406, 412, 406, 409, 409, 409, - 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, - 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, - 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, - - 409, 409, 409, 409, 409, 409, 409, 409, 406, 406, - 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, - 406, 406, 406, 406, 406, 406, 406, 410, 406, 406, - 410, 408, 408, 133, 406, 406, 411, 411, 406, 406, - 406, 406, 412, 409, 409, 409, 409, 409, 409, 409, - 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, - 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, - 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, - 409, 409, 409, 409, 409, 409, 409, 409, 406, 406, - 406, 406, 406, 406, 406, 406, 406, 133, 133, 406, - - 406, 406, 406, 406, 409, 409, 409, 409, 409, 409, - 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, - 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, - 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, - 409, 409, 409, 409, 409, 409, 409, 406, 406, 133, - 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, - 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, - 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, - 409, 409, 409, 409, 409, 409, 406, 199, 409, 409, - 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, - - 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, - 409, 409, 409, 409, 409, 409, 409, 409, 409, 406, - 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, - 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, - 409, 409, 409, 409, 409, 409, 409, 406, 409, 409, - 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, - 409, 409, 409, 409, 409, 409, 409, 409, 406, 409, - 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, - 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, - 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, - - 409, 409, 409, 409, 409, 0, 406, 406, 406, 406, - 406, 406 - } ; - -static yyconst flex_int16_t yy_nxt[728] = - { 0, - 6, 7, 8, 9, 8, 7, 10, 6, 6, 6, - 11, 12, 13, 14, 15, 15, 16, 17, 18, 16, - 16, 19, 16, 20, 16, 21, 16, 16, 6, 22, - 23, 24, 25, 26, 27, 28, 16, 29, 16, 16, - 30, 16, 31, 32, 33, 16, 34, 35, 36, 37, - 38, 16, 16, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 39, 40, 41, 42, 43, 56, 44, - 110, 43, 111, 45, 51, 52, 51, 52, 53, 54, - 53, 54, 58, 58, 59, 75, 60, 60, 60, 61, - 57, 76, 62, 63, 70, 64, 64, 77, 143, 71, - - 63, 65, 67, 67, 67, 105, 78, 79, 65, 66, - 82, 106, 87, 56, 83, 65, 85, 112, 113, 405, - 84, 80, 65, 88, 81, 86, 93, 90, 91, 46, - 47, 48, 49, 66, 92, 57, 94, 96, 97, 102, - 132, 115, 103, 115, 404, 115, 115, 116, 115, 177, - 115, 98, 116, 99, 104, 123, 129, 124, 125, 126, - 129, 130, 129, 64, 64, 178, 131, 130, 148, 63, - 403, 67, 67, 67, 402, 167, 133, 65, 134, 60, - 60, 60, 139, 139, 139, 136, 149, 168, 140, 141, - 182, 65, 142, 142, 142, 179, 186, 187, 180, 136, - - 193, 194, 140, 117, 118, 119, 120, 183, 117, 118, - 119, 120, 63, 401, 67, 67, 67, 189, 189, 189, - 65, 191, 337, 192, 190, 190, 189, 115, 338, 115, - 400, 115, 399, 116, 65, 115, 398, 115, 56, 115, - 397, 116, 197, 197, 197, 142, 142, 142, 129, 190, - 190, 197, 129, 130, 129, 142, 142, 142, 131, 130, - 57, 200, 396, 395, 201, 201, 201, 139, 139, 139, - 394, 203, 393, 140, 204, 204, 204, 248, 248, 248, - 201, 201, 201, 201, 201, 201, 248, 140, 392, 117, - 118, 119, 120, 204, 204, 204, 391, 117, 118, 119, - - 120, 56, 204, 204, 204, 390, 389, 388, 198, 198, - 198, 198, 198, 198, 198, 115, 387, 115, 386, 115, - 385, 116, 384, 57, 198, 198, 198, 198, 198, 198, - 199, 199, 199, 199, 199, 199, 199, 383, 382, 381, - 380, 379, 378, 377, 376, 375, 199, 199, 199, 199, - 199, 199, 115, 374, 115, 373, 115, 372, 116, 371, - 370, 369, 368, 367, 366, 365, 364, 363, 362, 361, - 360, 359, 358, 357, 356, 355, 354, 117, 118, 119, - 120, 250, 250, 250, 250, 250, 250, 250, 353, 352, - 351, 350, 349, 348, 347, 346, 345, 250, 250, 250, - - 250, 250, 250, 132, 132, 132, 132, 132, 132, 132, - 344, 343, 342, 341, 117, 118, 119, 120, 340, 132, - 132, 132, 132, 132, 132, 288, 288, 288, 288, 288, - 288, 288, 339, 336, 335, 334, 333, 332, 331, 330, - 329, 288, 288, 288, 288, 288, 288, 50, 50, 50, - 50, 50, 50, 55, 55, 328, 327, 55, 55, 68, - 68, 128, 326, 325, 128, 128, 128, 137, 137, 137, - 137, 137, 137, 324, 323, 322, 321, 320, 319, 318, - 317, 316, 315, 314, 313, 312, 311, 310, 309, 308, - 307, 306, 305, 304, 303, 302, 301, 300, 299, 298, - - 297, 296, 295, 294, 293, 292, 291, 290, 289, 287, - 286, 285, 284, 283, 282, 281, 280, 279, 278, 277, - 276, 275, 274, 273, 272, 271, 270, 269, 268, 267, - 266, 265, 264, 263, 262, 261, 260, 259, 258, 257, - 256, 255, 254, 253, 252, 251, 249, 248, 248, 248, - 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, - 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, - 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, - 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, - 208, 207, 206, 205, 202, 138, 197, 197, 197, 197, - - 196, 195, 115, 121, 189, 189, 189, 189, 188, 185, - 184, 181, 176, 175, 174, 173, 172, 171, 170, 169, - 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, - 156, 155, 154, 153, 152, 151, 150, 147, 146, 145, - 144, 138, 135, 127, 122, 121, 114, 109, 108, 107, - 101, 100, 95, 89, 74, 73, 72, 69, 406, 5, - 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, - 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, - 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, - 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, - - 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, - 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, - 406, 406, 406, 406, 406, 406, 406 - } ; - -static yyconst flex_int16_t yy_chk[728] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, 10, 2, - 40, 2, 40, 2, 3, 3, 4, 4, 3, 3, - 4, 4, 11, 11, 12, 22, 12, 12, 12, 13, - 10, 22, 13, 14, 18, 14, 14, 23, 412, 18, - - 15, 14, 15, 15, 15, 36, 23, 24, 15, 14, - 25, 36, 27, 55, 25, 14, 26, 41, 41, 404, - 25, 24, 15, 27, 24, 26, 30, 29, 29, 2, - 2, 2, 2, 14, 29, 55, 30, 32, 32, 35, - 57, 43, 35, 43, 402, 43, 44, 43, 44, 101, - 44, 32, 44, 32, 35, 47, 51, 47, 48, 48, - 51, 51, 53, 64, 64, 101, 53, 53, 73, 58, - 401, 58, 58, 58, 400, 91, 57, 58, 57, 60, - 60, 60, 63, 63, 63, 60, 73, 91, 63, 65, - 104, 58, 65, 65, 65, 102, 107, 107, 102, 60, - - 119, 119, 63, 43, 43, 43, 43, 104, 44, 44, - 44, 44, 67, 398, 67, 67, 67, 112, 112, 112, - 67, 118, 307, 118, 112, 112, 112, 115, 307, 115, - 396, 115, 395, 115, 67, 122, 393, 122, 132, 122, - 392, 122, 125, 125, 125, 141, 141, 141, 129, 125, - 125, 125, 129, 129, 131, 142, 142, 142, 131, 131, - 132, 136, 391, 389, 136, 136, 136, 139, 139, 139, - 388, 140, 387, 139, 140, 140, 140, 193, 193, 193, - 200, 200, 200, 201, 201, 201, 193, 139, 386, 115, - 115, 115, 115, 203, 203, 203, 383, 122, 122, 122, - - 122, 133, 204, 204, 204, 382, 381, 380, 133, 133, - 133, 133, 133, 133, 133, 197, 379, 197, 378, 197, - 376, 197, 374, 133, 133, 133, 133, 133, 133, 133, - 134, 134, 134, 134, 134, 134, 134, 372, 370, 367, - 366, 361, 360, 358, 357, 356, 134, 134, 134, 134, - 134, 134, 248, 355, 248, 353, 248, 352, 248, 350, - 349, 348, 347, 346, 344, 343, 342, 341, 339, 338, - 337, 336, 335, 333, 332, 331, 328, 197, 197, 197, - 197, 198, 198, 198, 198, 198, 198, 198, 326, 324, - 323, 322, 321, 320, 319, 318, 317, 198, 198, 198, - - 198, 198, 198, 199, 199, 199, 199, 199, 199, 199, - 316, 313, 312, 311, 248, 248, 248, 248, 310, 199, - 199, 199, 199, 199, 199, 250, 250, 250, 250, 250, - 250, 250, 309, 306, 305, 304, 303, 301, 299, 298, - 297, 250, 250, 250, 250, 250, 250, 407, 407, 407, - 407, 407, 407, 408, 408, 296, 295, 408, 408, 409, - 409, 410, 294, 293, 410, 410, 410, 411, 411, 411, - 411, 411, 411, 292, 291, 290, 289, 287, 286, 285, - 284, 283, 282, 280, 279, 278, 277, 276, 275, 273, - 272, 271, 270, 269, 268, 267, 264, 263, 262, 261, - - 260, 258, 257, 256, 255, 254, 253, 252, 251, 249, - 246, 245, 244, 242, 241, 240, 239, 238, 237, 236, - 235, 234, 233, 232, 229, 228, 227, 226, 225, 224, - 223, 222, 221, 219, 218, 217, 216, 215, 214, 212, - 211, 210, 209, 208, 206, 205, 196, 195, 194, 192, - 191, 188, 187, 186, 185, 184, 183, 182, 181, 180, - 179, 178, 177, 176, 175, 174, 173, 172, 171, 170, - 169, 168, 167, 166, 165, 164, 163, 162, 161, 160, - 159, 158, 157, 156, 155, 154, 153, 152, 150, 149, - 147, 146, 145, 144, 138, 137, 127, 126, 124, 123, - - 121, 120, 117, 116, 114, 113, 111, 110, 108, 106, - 105, 103, 100, 98, 97, 96, 95, 94, 93, 92, - 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, - 80, 79, 78, 77, 76, 75, 74, 72, 71, 70, - 69, 61, 59, 49, 46, 45, 42, 39, 38, 37, - 34, 33, 31, 28, 21, 20, 19, 17, 5, 406, - 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, - 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, - 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, - 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, - - 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, - 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, - 406, 406, 406, 406, 406, 406, 406 - } ; - -/* Table of booleans, true if rule could match eol. */ -static yyconst flex_int32_t yy_rule_can_match_eol[65] = - { 0, -0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 0, }; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -extern int webidl__flex_debug; -int webidl__flex_debug = 0; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *webidl_text; -#line 1 "webidl-lexer.l" -#line 2 "webidl-lexer.l" - -/* This is a unicode tolerant lexer for web IDL - * - * This file is part of nsgenbind. - * Licensed under the MIT License, - * http://www.opensource.org/licenses/mit-license.php - * Copyright 2012 Vincent Sanders <vince@netsurf-browser.org> - * - * Derived from: - * - * W3C WEB IDL - http://www.w3.org/TR/WebIDL/ (especially the grammar - * in apendix A) - * - * The ECMA script spec - - * http://ecma-international.org/ecma-262/5.1/#sec-7.2 (expecially - * section 7.2 for unicode value handling) - */ - -#include <stdbool.h> -#include <stdio.h> -#include <string.h> - -#include "webidl-parser.h" - -#define YY_USER_ACTION yylloc->first_line = yylloc->last_line; \ - yylloc->first_column = yylloc->last_column + 1; \ - yylloc->last_column += webidl_leng; - -/* Ensure compatability with bison 2.6 and later */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED && defined WEBIDL_STYPE_IS_DECLARED -#define YYSTYPE WEBIDL_STYPE -#endif - -#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED && defined WEBIDL_LTYPE_IS_DECLARED -#define YYLTYPE WEBIDL_LTYPE -#endif - -/* lexer options */ -/* regular definitions */ -/* ecmascript section 7.2 defines whitespace http://ecma-international.org/ecma-262/5.1/#sec-7.2 -* Web IDL appendix A has the IDL grammar http://www.w3.org/TR/WebIDL/#idl-grammar -*/ -/* we do not define space, line feed, carriage return, tab, vertical -* tab or form feed here as they are the standard C escapes -*/ -/* other Unicode “space separator” */ -/* Line separator \u2028 */ -/* paragraph separator \u2029 */ -/* non breaking space \u00A0 */ -/* web idl grammar for whitespace matches single and multiline - * comments too. Here there are separate definitions for both single - * and multiline comments. - */ -/* integer numbers in hexidecimal, decimal and octal, slight extension - * to spec which only allows for decimal values - */ -/* decimal floating point number */ -/* quoted string. spec simply has "[^"]*" but here escapes are allowed for */ -/* web idl identifier direct from spec */ -/* web idl other direct from spec */ -/* used for #include directive - not part of web idl spec */ - -#line 859 "webidl-lexer.c" - -#define INITIAL 0 -#define incl 1 - -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include <unistd.h> -#endif - -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif - -static int yy_init_globals (void ); - -/* Accessor methods to globals. - These are made visible to non-reentrant scanners for convenience. */ - -int webidl_lex_destroy (void ); - -int webidl_get_debug (void ); - -void webidl_set_debug (int debug_flag ); - -YY_EXTRA_TYPE webidl_get_extra (void ); - -void webidl_set_extra (YY_EXTRA_TYPE user_defined ); - -FILE *webidl_get_in (void ); - -void webidl_set_in (FILE * _in_str ); - -FILE *webidl_get_out (void ); - -void webidl_set_out (FILE * _out_str ); - - int webidl_get_leng (void ); - -char *webidl_get_text (void ); - -int webidl_get_lineno (void ); - -void webidl_set_lineno (int _line_number ); - -YYSTYPE * webidl_get_lval (void ); - -void webidl_set_lval (YYSTYPE * yylval_param ); - - YYLTYPE *webidl_get_lloc (void ); - - void webidl_set_lloc (YYLTYPE * yylloc_param ); - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int webidl_wrap (void ); -#else -extern int webidl_wrap (void ); -#endif -#endif - -#ifndef YY_NO_UNPUT - -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); -#endif - -#ifndef YY_NO_INPUT - -#ifdef __cplusplus -static int yyinput (void ); -#else -static int input (void ); -#endif - -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else -#define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ -#endif - -/* Copy whatever the last rule matched to the standard output. */ -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO do { if (fwrite( webidl_text, (size_t) webidl_leng, 1, webidl_out )) {} } while (0) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ - { \ - int c = '*'; \ - int n; \ - for ( n = 0; n < max_size && \ - (c = getc( webidl_in )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( webidl_in ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, webidl_in)) == 0 && ferror(webidl_in)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(webidl_in); \ - } \ - }\ -\ - -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* end tables serialization structures and prototypes */ - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL_IS_OURS 1 - -extern int webidl_lex \ - (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ); - -#define YY_DECL int webidl_lex \ - (YYSTYPE * yylval_param, YYLTYPE * yylloc_param ) -#endif /* !YY_DECL */ - -/* Code executed at the beginning of each rule, after webidl_text and webidl_leng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK /*LINTED*/break; -#endif - -#define YY_RULE_SETUP \ - if ( webidl_leng > 0 ) \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ - (webidl_text[webidl_leng - 1] == '\n'); \ - YY_USER_ACTION - -/** The main scanner function which does all the work. - */ -YY_DECL -{ - yy_state_type yy_current_state; - char *yy_cp, *yy_bp; - int yy_act; - - YYSTYPE * yylval; - - YYLTYPE * yylloc; - - yylval = yylval_param; - - yylloc = yylloc_param; - - if ( !(yy_init) ) - { - (yy_init) = 1; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! (yy_start) ) - (yy_start) = 1; /* first start state */ - - if ( ! webidl_in ) - webidl_in = stdin; - - if ( ! webidl_out ) - webidl_out = stdout; - - if ( ! YY_CURRENT_BUFFER ) { - webidl_ensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - webidl__create_buffer(webidl_in,YY_BUF_SIZE ); - } - - webidl__load_buffer_state( ); - } - - { -#line 114 "webidl-lexer.l" - - -#line 1100 "webidl-lexer.c" - - while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ - { - yy_cp = (yy_c_buf_p); - - /* Support of webidl_text. */ - *yy_cp = (yy_hold_char); - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = (yy_start); - yy_current_state += YY_AT_BOL(); -yy_match: - do - { - YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 407 ) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - ++yy_cp; - } - while ( yy_current_state != 406 ); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - - YY_DO_BEFORE_ACTION; - - if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) - { - int yyl; - for ( yyl = 0; yyl < webidl_leng; ++yyl ) - if ( webidl_text[yyl] == '\n' ) - - webidl_lineno++; -; - } - -do_action: /* This label is used only to access EOF actions. */ - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = (yy_hold_char); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - -case 1: -YY_RULE_SETUP -#line 116 "webidl-lexer.l" -++yylloc->last_column; /* skip whitespace */ - YY_BREAK -case 2: -/* rule 2 can match eol */ -YY_RULE_SETUP -#line 118 "webidl-lexer.l" -if (webidl_text[0] != '\r') { - /* update position counts */ - ++yylloc->last_line; - yylloc->last_column = 0; - } - YY_BREAK -/* Simple text terminals */ -case 3: -YY_RULE_SETUP -#line 126 "webidl-lexer.l" -return TOK_BOOLEAN; - YY_BREAK -case 4: -YY_RULE_SETUP -#line 128 "webidl-lexer.l" -return TOK_BYTE; - YY_BREAK -case 5: -YY_RULE_SETUP -#line 130 "webidl-lexer.l" -return TOK_OCTET; - YY_BREAK -case 6: -YY_RULE_SETUP -#line 132 "webidl-lexer.l" -return TOK_ATTRIBUTE; - YY_BREAK -case 7: -YY_RULE_SETUP -#line 134 "webidl-lexer.l" -return TOK_CALLBACK; - YY_BREAK -case 8: -YY_RULE_SETUP -#line 136 "webidl-lexer.l" -return TOK_CONST; - YY_BREAK -case 9: -YY_RULE_SETUP -#line 138 "webidl-lexer.l" -return TOK_CREATOR; - YY_BREAK -case 10: -YY_RULE_SETUP -#line 140 "webidl-lexer.l" -return TOK_DELETER; - YY_BREAK -case 11: -YY_RULE_SETUP -#line 142 "webidl-lexer.l" -return TOK_DICTIONARY; - YY_BREAK -case 12: -YY_RULE_SETUP -#line 144 "webidl-lexer.l" -return TOK_ENUM; - YY_BREAK -case 13: -YY_RULE_SETUP -#line 146 "webidl-lexer.l" -return TOK_EXCEPTION; - YY_BREAK -case 14: -YY_RULE_SETUP -#line 148 "webidl-lexer.l" -return TOK_GETTER; - YY_BREAK -case 15: -YY_RULE_SETUP -#line 150 "webidl-lexer.l" -return TOK_IMPLEMENTS; - YY_BREAK -case 16: -YY_RULE_SETUP -#line 152 "webidl-lexer.l" -return TOK_INHERIT; - YY_BREAK -case 17: -YY_RULE_SETUP -#line 154 "webidl-lexer.l" -return TOK_INTERFACE; - YY_BREAK -case 18: -YY_RULE_SETUP -#line 156 "webidl-lexer.l" -return TOK_LEGACYCALLER; - YY_BREAK -case 19: -YY_RULE_SETUP -#line 158 "webidl-lexer.l" -return TOK_PARTIAL; - YY_BREAK -case 20: -YY_RULE_SETUP -#line 160 "webidl-lexer.l" -return TOK_SETTER; - YY_BREAK -case 21: -YY_RULE_SETUP -#line 162 "webidl-lexer.l" -return TOK_STATIC; - YY_BREAK -case 22: -YY_RULE_SETUP -#line 164 "webidl-lexer.l" -return TOK_STRINGIFIER; - YY_BREAK -case 23: -YY_RULE_SETUP -#line 166 "webidl-lexer.l" -return TOK_TYPEDEF; - YY_BREAK -case 24: -YY_RULE_SETUP -#line 168 "webidl-lexer.l" -return TOK_UNRESTRICTED; - YY_BREAK -case 25: -YY_RULE_SETUP -#line 170 "webidl-lexer.l" -return TOK_ELLIPSIS; - YY_BREAK -case 26: -YY_RULE_SETUP -#line 172 "webidl-lexer.l" -return TOK_DATE; - YY_BREAK -case 27: -YY_RULE_SETUP -#line 174 "webidl-lexer.l" -return TOK_STRING; /* dom strings are just strings */ - YY_BREAK -case 28: -YY_RULE_SETUP -#line 176 "webidl-lexer.l" -return TOK_INFINITY; - YY_BREAK -case 29: -YY_RULE_SETUP -#line 178 "webidl-lexer.l" -return TOK_NAN; - YY_BREAK -case 30: -YY_RULE_SETUP -#line 180 "webidl-lexer.l" -return TOK_ANY; - YY_BREAK -case 31: -YY_RULE_SETUP -#line 182 "webidl-lexer.l" -return TOK_DOUBLE; - YY_BREAK -case 32: -YY_RULE_SETUP -#line 184 "webidl-lexer.l" -return TOK_FALSE; - YY_BREAK -case 33: -YY_RULE_SETUP -#line 186 "webidl-lexer.l" -return TOK_FLOAT; - YY_BREAK -case 34: -YY_RULE_SETUP -#line 188 "webidl-lexer.l" -return TOK_LONG; - YY_BREAK -case 35: -YY_RULE_SETUP -#line 190 "webidl-lexer.l" -return TOK_NULL_LITERAL; - YY_BREAK -case 36: -YY_RULE_SETUP -#line 192 "webidl-lexer.l" -yylval->text = strdup(webidl_text); return TOK_IDENTIFIER; - YY_BREAK -case 37: -YY_RULE_SETUP -#line 194 "webidl-lexer.l" -return TOK_OR; - YY_BREAK -case 38: -YY_RULE_SETUP -#line 196 "webidl-lexer.l" -return TOK_OPTIONAL; - YY_BREAK -case 39: -YY_RULE_SETUP -#line 198 "webidl-lexer.l" -return TOK_SEQUENCE; - YY_BREAK -case 40: -YY_RULE_SETUP -#line 200 "webidl-lexer.l" -return TOK_SHORT; - YY_BREAK -case 41: -YY_RULE_SETUP -#line 202 "webidl-lexer.l" -return TOK_TRUE; - YY_BREAK -case 42: -YY_RULE_SETUP -#line 204 "webidl-lexer.l" -return TOK_UNSIGNED; - YY_BREAK -case 43: -YY_RULE_SETUP -#line 206 "webidl-lexer.l" -return TOK_VOID; - YY_BREAK -case 44: -YY_RULE_SETUP -#line 208 "webidl-lexer.l" -return TOK_READONLY; - YY_BREAK -case 45: -YY_RULE_SETUP -#line 210 "webidl-lexer.l" -return TOK_PROMISE; - YY_BREAK -case 46: -YY_RULE_SETUP -#line 212 "webidl-lexer.l" -return TOK_ITERABLE; - YY_BREAK -case 47: -YY_RULE_SETUP -#line 214 "webidl-lexer.l" -return TOK_LEGACYITERABLE; - YY_BREAK -case 48: -YY_RULE_SETUP -#line 216 "webidl-lexer.l" -return TOK_REQUIRED; - YY_BREAK -case 49: -YY_RULE_SETUP -#line 218 "webidl-lexer.l" -return TOK_CONSTRUCTOR; - YY_BREAK -case 50: -YY_RULE_SETUP -#line 220 "webidl-lexer.l" -return TOK_NAMEDCONSTRUCTOR; - YY_BREAK -case 51: -YY_RULE_SETUP -#line 222 "webidl-lexer.l" -{ - /* A leading "_" is used to escape an identifier from - * looking like a reserved word terminal. */ - yylval->text = (webidl_text[0] == '_') ? strdup(webidl_text + 1) : strdup(webidl_text); - return TOK_IDENTIFIER; - } - YY_BREAK -case 52: -YY_RULE_SETUP -#line 229 "webidl-lexer.l" -yylval->value = strtol(webidl_text, NULL, 10); return TOK_INT_LITERAL; - YY_BREAK -case 53: -YY_RULE_SETUP -#line 231 "webidl-lexer.l" -yylval->value = strtol(webidl_text, NULL, 8); return TOK_INT_LITERAL; - YY_BREAK -case 54: -YY_RULE_SETUP -#line 233 "webidl-lexer.l" -yylval->value = strtol(webidl_text, NULL, 16); return TOK_INT_LITERAL; - YY_BREAK -case 55: -YY_RULE_SETUP -#line 235 "webidl-lexer.l" -yylval->text = strdup(webidl_text); return TOK_FLOAT_LITERAL; - YY_BREAK -case 56: -YY_RULE_SETUP -#line 237 "webidl-lexer.l" -yylval->text = strdup(webidl_text + 1); *(yylval->text + webidl_leng - 2) = 0; return TOK_STRING_LITERAL; - YY_BREAK -case 57: -/* rule 57 can match eol */ -YY_RULE_SETUP -#line 239 "webidl-lexer.l" -{ - /* multicomment */ - char* s = webidl_text; - for (; *s; ++s) - { - if (*s == '\n') - { - ++yylloc->last_line; - yylloc->last_column = 0; - } - else - { - ++yylloc->last_column; - } - } - if (strncmp(webidl_text, "/**", 3) == 0) - { - /* Javadoc style comment */ - yylval->text = strdup(webidl_text); - return TOK_JAVADOC; - } - } - YY_BREAK -case 58: -YY_RULE_SETUP -#line 262 "webidl-lexer.l" -{ - /* singlecomment */ - int c; - - do { - c = input(); - } while (c != '\n' && c != '\r' && c != EOF); - ++yylloc->last_line; - yylloc->last_column = 0; - } - YY_BREAK -case 59: -YY_RULE_SETUP -#line 275 "webidl-lexer.l" -BEGIN(incl); - YY_BREAK -case 60: -YY_RULE_SETUP -#line 277 "webidl-lexer.l" -return (int) webidl_text[0]; - YY_BREAK -case 61: -YY_RULE_SETUP -#line 279 "webidl-lexer.l" -/* eat the whitespace and open quotes */ - YY_BREAK -case 62: -YY_RULE_SETUP -#line 281 "webidl-lexer.l" -{ - /* got the include file name */ - webidl_in = fopen( webidl_text, "r" ); - - if ( ! webidl_in ) { - fprintf(stderr, "Unable to open include %s\n", webidl_text); - exit(3); - } - webidl_push_buffer_state(webidl__create_buffer(webidl_in,YY_BUF_SIZE )); - - BEGIN(INITIAL); - } - YY_BREAK -case 63: -/* rule 63 can match eol */ -YY_RULE_SETUP -#line 294 "webidl-lexer.l" -BEGIN(INITIAL); - YY_BREAK -case YY_STATE_EOF(INITIAL): -case YY_STATE_EOF(incl): -#line 296 "webidl-lexer.l" -{ - webidl_pop_buffer_state(); - - if ( !YY_CURRENT_BUFFER ) { - yyterminate(); - } else { - BEGIN(incl); - } - - } - YY_BREAK -case 64: -YY_RULE_SETUP -#line 308 "webidl-lexer.l" -ECHO; - YY_BREAK -#line 1552 "webidl-lexer.c" - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = (yy_hold_char); - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed webidl_in at a new source and called - * webidl_lex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = webidl_in; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++(yy_c_buf_p); - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_END_OF_FILE: - { - (yy_did_buffer_switch_on_eof) = 0; - - if ( webidl_wrap( ) ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * webidl_text, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = - (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - (yy_c_buf_p) = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of user's declarations */ -} /* end of webidl_lex */ - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ -static int yy_get_next_buffer (void) -{ - char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - char *source = (yytext_ptr); - int number_to_move, i; - int ret_val; - - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; - - else - { - int num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; - - int yy_c_buf_p_offset = - (int) ((yy_c_buf_p) - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - webidl_realloc((void *) b->yy_ch_buf,(yy_size_t) (b->yy_buf_size + 2) ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = NULL; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1; - - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); - - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - if ( (yy_n_chars) == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - webidl_restart(webidl_in ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { - /* Extend the array by 50%, plus the number we really need. */ - int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) webidl_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,(yy_size_t) new_size ); - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); - } - - (yy_n_chars) += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - - (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - - return ret_val; -} - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - - static yy_state_type yy_get_previous_state (void) -{ - yy_state_type yy_current_state; - char *yy_cp; - - yy_current_state = (yy_start); - yy_current_state += YY_AT_BOL(); - - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) - { - YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 407 ) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - } - - return yy_current_state; -} - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) -{ - int yy_is_jam; - char *yy_cp = (yy_c_buf_p); - - YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 407 ) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - yy_is_jam = (yy_current_state == 406); - - return yy_is_jam ? 0 : yy_current_state; -} - -#ifndef YY_NO_UNPUT - -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus - static int yyinput (void) -#else - static int input (void) -#endif - -{ - int c; - - *(yy_c_buf_p) = (yy_hold_char); - - if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - /* This was really a NUL. */ - *(yy_c_buf_p) = '\0'; - - else - { /* need more input */ - int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); - ++(yy_c_buf_p); - - switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - webidl_restart(webidl_in ); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: - { - if ( webidl_wrap( ) ) - return 0; - - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + offset; - break; - } - } - } - - c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve webidl_text */ - (yy_hold_char) = *++(yy_c_buf_p); - - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); - if ( YY_CURRENT_BUFFER_LVALUE->yy_at_bol ) - - webidl_lineno++; -; - - return c; -} -#endif /* ifndef YY_NO_INPUT */ - -/** Immediately switch to a different input stream. - * @param input_file A readable stream. - * - * @note This function does not reset the start condition to @c INITIAL . - */ - void webidl_restart (FILE * input_file ) -{ - - if ( ! YY_CURRENT_BUFFER ){ - webidl_ensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - webidl__create_buffer(webidl_in,YY_BUF_SIZE ); - } - - webidl__init_buffer(YY_CURRENT_BUFFER,input_file ); - webidl__load_buffer_state( ); -} - -/** Switch to a different input buffer. - * @param new_buffer The new input buffer. - * - */ - void webidl__switch_to_buffer (YY_BUFFER_STATE new_buffer ) -{ - - /* TODO. We should be able to replace this entire function body - * with - * webidl_pop_buffer_state(); - * webidl_push_buffer_state(new_buffer); - */ - webidl_ensure_buffer_stack (); - if ( YY_CURRENT_BUFFER == new_buffer ) - return; - - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - YY_CURRENT_BUFFER_LVALUE = new_buffer; - webidl__load_buffer_state( ); - - /* We don't actually know whether we did this switch during - * EOF (webidl_wrap()) processing, but the only time this flag - * is looked at is after webidl_wrap() is called, so it's safe - * to go ahead and always set it. - */ - (yy_did_buffer_switch_on_eof) = 1; -} - -static void webidl__load_buffer_state (void) -{ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - webidl_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - (yy_hold_char) = *(yy_c_buf_p); -} - -/** Allocate and initialize an input buffer state. - * @param file A readable stream. - * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * - * @return the allocated buffer state. - */ - YY_BUFFER_STATE webidl__create_buffer (FILE * file, int size ) -{ - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) webidl_alloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in webidl__create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) webidl_alloc((yy_size_t) (b->yy_buf_size + 2) ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in webidl__create_buffer()" ); - - b->yy_is_our_buffer = 1; - - webidl__init_buffer(b,file ); - - return b; -} - -/** Destroy the buffer. - * @param b a buffer created with webidl__create_buffer() - * - */ - void webidl__delete_buffer (YY_BUFFER_STATE b ) -{ - - if ( ! b ) - return; - - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - webidl_free((void *) b->yy_ch_buf ); - - webidl_free((void *) b ); -} - -/* Initializes or reinitializes a buffer. - * This function is sometimes called more than once on the same buffer, - * such as during a webidl_restart() or at EOF. - */ - static void webidl__init_buffer (YY_BUFFER_STATE b, FILE * file ) - -{ - int oerrno = errno; - - webidl__flush_buffer(b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - - /* If b is the current buffer, then webidl__init_buffer was _probably_ - * called from webidl_restart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } - - b->yy_is_interactive = 0; - - errno = oerrno; -} - -/** Discard all buffered characters. On the next scan, YY_INPUT will be called. - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * - */ - void webidl__flush_buffer (YY_BUFFER_STATE b ) -{ - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == YY_CURRENT_BUFFER ) - webidl__load_buffer_state( ); -} - -/** Pushes the new state onto the stack. The new state becomes - * the current state. This function will allocate the stack - * if necessary. - * @param new_buffer The new state. - * - */ -void webidl_push_buffer_state (YY_BUFFER_STATE new_buffer ) -{ - if (new_buffer == NULL) - return; - - webidl_ensure_buffer_stack(); - - /* This block is copied from webidl__switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - (yy_buffer_stack_top)++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from webidl__switch_to_buffer. */ - webidl__load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; -} - -/** Removes and deletes the top of the stack, if present. - * The next element becomes the new top. - * - */ -void webidl_pop_buffer_state (void) -{ - if (!YY_CURRENT_BUFFER) - return; - - webidl__delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - if ((yy_buffer_stack_top) > 0) - --(yy_buffer_stack_top); - - if (YY_CURRENT_BUFFER) { - webidl__load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; - } -} - -/* Allocates the stack if it does not exist. - * Guarantees space for at least one push. - */ -static void webidl_ensure_buffer_stack (void) -{ - yy_size_t num_to_alloc; - - if (!(yy_buffer_stack)) { - - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. - */ - num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ - (yy_buffer_stack) = (struct yy_buffer_state**)webidl_alloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in webidl_ensure_buffer_stack()" ); - - memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - - (yy_buffer_stack_max) = num_to_alloc; - (yy_buffer_stack_top) = 0; - return; - } - - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ - - /* Increase the buffer to prepare for a possible push. */ - yy_size_t grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)webidl_realloc - ((yy_buffer_stack), - num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in webidl_ensure_buffer_stack()" ); - - /* zero only the new slots.*/ - memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); - (yy_buffer_stack_max) = num_to_alloc; - } -} - -/** Setup the input buffer state to scan directly from a user-specified character buffer. - * @param base the character buffer - * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE webidl__scan_buffer (char * base, yy_size_t size ) -{ - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return NULL; - - b = (YY_BUFFER_STATE) webidl_alloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in webidl__scan_buffer()" ); - - b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = NULL; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - webidl__switch_to_buffer(b ); - - return b; -} - -/** Setup the input buffer state to scan a string. The next call to webidl_lex() will - * scan from a @e copy of @a str. - * @param yystr a NUL-terminated string to scan - * - * @return the newly allocated buffer state object. - * @note If you want to scan bytes that may contain NUL values, then use - * webidl__scan_bytes() instead. - */ -YY_BUFFER_STATE webidl__scan_string (yyconst char * yystr ) -{ - - return webidl__scan_bytes(yystr,(int) strlen(yystr) ); -} - -/** Setup the input buffer state to scan the given bytes. The next call to webidl_lex() will - * scan from a @e copy of @a bytes. - * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE webidl__scan_bytes (yyconst char * yybytes, int _yybytes_len ) -{ - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = (yy_size_t) (_yybytes_len + 2); - buf = (char *) webidl_alloc(n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in webidl__scan_bytes()" ); - - for ( i = 0; i < _yybytes_len; ++i ) - buf[i] = yybytes[i]; - - buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - - b = webidl__scan_buffer(buf,n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in webidl__scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; -} - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -static void yynoreturn yy_fatal_error (yyconst char* msg ) -{ - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); -} - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up webidl_text. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - webidl_text[webidl_leng] = (yy_hold_char); \ - (yy_c_buf_p) = webidl_text + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - webidl_leng = yyless_macro_arg; \ - } \ - while ( 0 ) - -/* Accessor methods (get/set functions) to struct members. */ - -/** Get the current line number. - * - */ -int webidl_get_lineno (void) -{ - - return webidl_lineno; -} - -/** Get the input stream. - * - */ -FILE *webidl_get_in (void) -{ - return webidl_in; -} - -/** Get the output stream. - * - */ -FILE *webidl_get_out (void) -{ - return webidl_out; -} - -/** Get the length of the current token. - * - */ -int webidl_get_leng (void) -{ - return webidl_leng; -} - -/** Get the current token. - * - */ - -char *webidl_get_text (void) -{ - return webidl_text; -} - -/** Set the current line number. - * @param _line_number line number - * - */ -void webidl_set_lineno (int _line_number ) -{ - - webidl_lineno = _line_number; -} - -/** Set the input stream. This does not discard the current - * input buffer. - * @param _in_str A readable stream. - * - * @see webidl__switch_to_buffer - */ -void webidl_set_in (FILE * _in_str ) -{ - webidl_in = _in_str ; -} - -void webidl_set_out (FILE * _out_str ) -{ - webidl_out = _out_str ; -} - -int webidl_get_debug (void) -{ - return webidl__flex_debug; -} - -void webidl_set_debug (int _bdebug ) -{ - webidl__flex_debug = _bdebug ; -} - -static int yy_init_globals (void) -{ - /* Initialization is the same as for the non-reentrant scanner. - * This function is called from webidl_lex_destroy(), so don't allocate here. - */ - - /* We do not touch webidl_lineno unless the option is enabled. */ - webidl_lineno = 1; - - (yy_buffer_stack) = NULL; - (yy_buffer_stack_top) = 0; - (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = NULL; - (yy_init) = 0; - (yy_start) = 0; - -/* Defined in main.c */ -#ifdef YY_STDINIT - webidl_in = stdin; - webidl_out = stdout; -#else - webidl_in = NULL; - webidl_out = NULL; -#endif - - /* For future reference: Set errno on error, since we are called by - * webidl_lex_init() - */ - return 0; -} - -/* webidl_lex_destroy is for both reentrant and non-reentrant scanners. */ -int webidl_lex_destroy (void) -{ - - /* Pop the buffer stack, destroying each element. */ - while(YY_CURRENT_BUFFER){ - webidl__delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - webidl_pop_buffer_state(); - } - - /* Destroy the stack itself. */ - webidl_free((yy_buffer_stack) ); - (yy_buffer_stack) = NULL; - - /* Reset the globals. This is important in a non-reentrant scanner so the next time - * webidl_lex() is called, initialization will occur. */ - yy_init_globals( ); - - return 0; -} - -/* - * Internal utility routines. - */ - -#ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) -{ - - int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; -} -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s ) -{ - int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; -} -#endif - -void *webidl_alloc (yy_size_t size ) -{ - return malloc(size); -} - -void *webidl_realloc (void * ptr, yy_size_t size ) -{ - - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return realloc(ptr, size); -} - -void webidl_free (void * ptr ) -{ - free( (char *) ptr ); /* see webidl_realloc() for (char *) cast */ -} - -#define YYTABLES_NAME "yytables" - -#line 308 "webidl-lexer.l" - - - diff --git a/pkg/netsurf/nsgenbind/webidl-lexer.h b/pkg/netsurf/nsgenbind/webidl-lexer.h @@ -1,337 +0,0 @@ -#ifndef webidl_HEADER_H -#define webidl_HEADER_H 1 -#define webidl_IN_HEADER 1 - -#line 6 "webidl-lexer.h" - -#line 8 "webidl-lexer.h" - -#define YY_INT_ALIGNED short int - -/* A lexical scanner generated by flex */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 6 -#define YY_FLEX_SUBMINOR_VERSION 2 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ -#include <stdio.h> -#include <string.h> -#include <errno.h> -#include <stdlib.h> - -/* end standard C headers. */ - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif - -#include <inttypes.h> -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - -#endif /* ! C99 */ - -#endif /* ! FLEXINT_H */ - -/* TODO: this is always defined, so inline it */ -#define yyconst const - -#if defined(__GNUC__) && __GNUC__ >= 3 -#define yynoreturn __attribute__((__noreturn__)) -#else -#define yynoreturn -#endif - -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else -#define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ -#endif - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE -typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - -extern int webidl_leng; - -extern FILE *webidl_in, *webidl_out; - -#ifndef YY_STRUCT_YY_BUFFER_STATE -#define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - int yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; - - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - -void webidl_restart (FILE *input_file ); -void webidl__switch_to_buffer (YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE webidl__create_buffer (FILE *file,int size ); -void webidl__delete_buffer (YY_BUFFER_STATE b ); -void webidl__flush_buffer (YY_BUFFER_STATE b ); -void webidl_push_buffer_state (YY_BUFFER_STATE new_buffer ); -void webidl_pop_buffer_state (void ); - -YY_BUFFER_STATE webidl__scan_buffer (char *base,yy_size_t size ); -YY_BUFFER_STATE webidl__scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE webidl__scan_bytes (yyconst char *bytes,int len ); - -void *webidl_alloc (yy_size_t ); -void *webidl_realloc (void *,yy_size_t ); -void webidl_free (void * ); - -/* Begin user sect3 */ - -#define webidl_wrap() (/*CONSTCOND*/1) -#define YY_SKIP_YYWRAP - -extern int webidl_lineno; - -extern char *webidl_text; -#ifdef yytext_ptr -#undef yytext_ptr -#endif -#define yytext_ptr webidl_text - -#ifdef YY_HEADER_EXPORT_START_CONDITIONS -#define INITIAL 0 -#define incl 1 - -#endif - -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include <unistd.h> -#endif - -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif - -/* Accessor methods to globals. - These are made visible to non-reentrant scanners for convenience. */ - -int webidl_lex_destroy (void ); - -int webidl_get_debug (void ); - -void webidl_set_debug (int debug_flag ); - -YY_EXTRA_TYPE webidl_get_extra (void ); - -void webidl_set_extra (YY_EXTRA_TYPE user_defined ); - -FILE *webidl_get_in (void ); - -void webidl_set_in (FILE * _in_str ); - -FILE *webidl_get_out (void ); - -void webidl_set_out (FILE * _out_str ); - - int webidl_get_leng (void ); - -char *webidl_get_text (void ); - -int webidl_get_lineno (void ); - -void webidl_set_lineno (int _line_number ); - -YYSTYPE * webidl_get_lval (void ); - -void webidl_set_lval (YYSTYPE * yylval_param ); - - YYLTYPE *webidl_get_lloc (void ); - - void webidl_set_lloc (YYLTYPE * yylloc_param ); - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int webidl_wrap (void ); -#else -extern int webidl_wrap (void ); -#endif -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); -#endif - -#ifndef YY_NO_INPUT - -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else -#define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL_IS_OURS 1 - -extern int webidl_lex \ - (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ); - -#define YY_DECL int webidl_lex \ - (YYSTYPE * yylval_param, YYLTYPE * yylloc_param ) -#endif /* !YY_DECL */ - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -#undef YY_NEW_FILE -#undef YY_FLUSH_BUFFER -#undef yy_set_bol -#undef yy_new_buffer -#undef yy_set_interactive -#undef YY_DO_BEFORE_ACTION - -#ifdef YY_DECL_IS_OURS -#undef YY_DECL_IS_OURS -#undef YY_DECL -#endif - -#line 308 "webidl-lexer.l" - - -#line 336 "webidl-lexer.h" -#undef webidl_IN_HEADER -#endif /* webidl_HEADER_H */ diff --git a/pkg/netsurf/nsgenbind/webidl-parser.c b/pkg/netsurf/nsgenbind/webidl-parser.c @@ -1,4012 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.0.4. */ - -/* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2015 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 <http://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. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "3.0.4" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 1 - -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - -/* Substitute the type names. */ -#define YYSTYPE WEBIDL_STYPE -#define YYLTYPE WEBIDL_LTYPE -/* Substitute the variable and function names. */ -#define yyparse webidl_parse -#define yylex webidl_lex -#define yyerror webidl_error -#define yydebug webidl_debug -#define yynerrs webidl_nerrs - - -/* Copy the first part of user declarations. */ -#line 1 "webidl-parser.y" /* yacc.c:339 */ - - -/* This is a bison parser for Web IDL - * - * This file is part of nsgenbind. - * Licensed under the MIT License, - * http://www.opensource.org/licenses/mit-license.php - * Copyright 2012 Vincent Sanders <vince@netsurf-browser.org> - * - * Derived from the the grammar in apendix A of W3C WEB IDL - * http://www.w3.org/TR/WebIDL/ - * - * WebIDL now has a second edition draft (mid 2015) that the dom and - * html specs are using. https://heycam.github.io/webidl - */ - -#include <stdio.h> -#include <string.h> -#include <stdbool.h> -#include <stdint.h> -#include <math.h> - -#define YYFPRINTF webidl_fprintf -#define YY_LOCATION_PRINT(File, Loc) \ - webidl_fprintf(File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) - -#include "utils.h" -#include "webidl-parser.h" -#include "webidl-lexer.h" - -#include "webidl-ast.h" - -char *errtxt; - -static void -webidl_error(YYLTYPE *locp, struct webidl_node **winbind_ast, const char *str) -{ - UNUSED(locp); - UNUSED(winbind_ast); - errtxt = strdup(str); -} - - -#line 120 "webidl-parser.c" /* yacc.c:339 */ - -# ifndef YY_NULLPTR -# if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULLPTR nullptr -# else -# define YY_NULLPTR 0 -# endif -# endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 1 -#endif - -/* In a future release of Bison, this section will be replaced - by #include "webidl-parser.h". */ -#ifndef YY_WEBIDL_WEBIDL_PARSER_H_INCLUDED -# define YY_WEBIDL_WEBIDL_PARSER_H_INCLUDED -/* Debug traces. */ -#ifndef WEBIDL_DEBUG -# if defined YYDEBUG -#if YYDEBUG -# define WEBIDL_DEBUG 1 -# else -# define WEBIDL_DEBUG 0 -# endif -# else /* ! defined YYDEBUG */ -# define WEBIDL_DEBUG 1 -# endif /* ! defined YYDEBUG */ -#endif /* ! defined WEBIDL_DEBUG */ -#if WEBIDL_DEBUG -extern int webidl_debug; -#endif - -/* Token type. */ -#ifndef WEBIDL_TOKENTYPE -# define WEBIDL_TOKENTYPE - enum webidl_tokentype - { - TOK_ANY = 258, - TOK_ATTRIBUTE = 259, - TOK_BOOLEAN = 260, - TOK_BYTE = 261, - TOK_CALLBACK = 262, - TOK_CONST = 263, - TOK_CONSTRUCTOR = 264, - TOK_CREATOR = 265, - TOK_DATE = 266, - TOK_DELETER = 267, - TOK_DICTIONARY = 268, - TOK_DOUBLE = 269, - TOK_ELLIPSIS = 270, - TOK_ENUM = 271, - TOK_EOL = 272, - TOK_EXCEPTION = 273, - TOK_FALSE = 274, - TOK_FLOAT = 275, - TOK_GETRAISES = 276, - TOK_GETTER = 277, - TOK_IMPLEMENTS = 278, - TOK_IN = 279, - TOK_INFINITY = 280, - TOK_INHERIT = 281, - TOK_INTERFACE = 282, - TOK_ITERABLE = 283, - TOK_LEGACYCALLER = 284, - TOK_LEGACYITERABLE = 285, - TOK_LONG = 286, - TOK_MODULE = 287, - TOK_NAN = 288, - TOK_NATIVE = 289, - TOK_NAMEDCONSTRUCTOR = 290, - TOK_NULL_LITERAL = 291, - TOK_OBJECT = 292, - TOK_OCTET = 293, - TOK_OMITTABLE = 294, - TOK_OPTIONAL = 295, - TOK_OR = 296, - TOK_PARTIAL = 297, - TOK_PROMISE = 298, - TOK_RAISES = 299, - TOK_READONLY = 300, - TOK_REQUIRED = 301, - TOK_SETRAISES = 302, - TOK_SETTER = 303, - TOK_SEQUENCE = 304, - TOK_SHORT = 305, - TOK_STATIC = 306, - TOK_STRING = 307, - TOK_STRINGIFIER = 308, - TOK_TRUE = 309, - TOK_TYPEDEF = 310, - TOK_UNRESTRICTED = 311, - TOK_UNSIGNED = 312, - TOK_VOID = 313, - TOK_POUND_SIGN = 314, - TOK_IDENTIFIER = 315, - TOK_INT_LITERAL = 316, - TOK_FLOAT_LITERAL = 317, - TOK_STRING_LITERAL = 318, - TOK_OTHER_LITERAL = 319, - TOK_JAVADOC = 320 - }; -#endif - -/* Value type. */ -#if ! defined WEBIDL_STYPE && ! defined WEBIDL_STYPE_IS_DECLARED - -union WEBIDL_STYPE -{ -#line 56 "webidl-parser.y" /* yacc.c:355 */ - - int attr; - long value; - bool isit; - char* text; - struct webidl_node *node; - -#line 242 "webidl-parser.c" /* yacc.c:355 */ -}; - -typedef union WEBIDL_STYPE WEBIDL_STYPE; -# define WEBIDL_STYPE_IS_TRIVIAL 1 -# define WEBIDL_STYPE_IS_DECLARED 1 -#endif - -/* Location type. */ -#if ! defined WEBIDL_LTYPE && ! defined WEBIDL_LTYPE_IS_DECLARED -typedef struct WEBIDL_LTYPE WEBIDL_LTYPE; -struct WEBIDL_LTYPE -{ - int first_line; - int first_column; - int last_line; - int last_column; -}; -# define WEBIDL_LTYPE_IS_DECLARED 1 -# define WEBIDL_LTYPE_IS_TRIVIAL 1 -#endif - - - -int webidl_parse (struct webidl_node **webidl_ast); - -#endif /* !YY_WEBIDL_WEBIDL_PARSER_H_INCLUDED */ - -/* Copy the second part of user declarations. */ - -#line 272 "webidl-parser.c" /* yacc.c:358 */ - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#else -typedef signed char yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T -# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ -# define YY_(Msgid) dgettext ("bison-runtime", Msgid) -# endif -# endif -# ifndef YY_ -# define YY_(Msgid) Msgid -# endif -#endif - -#ifndef YY_ATTRIBUTE -# if (defined __GNUC__ \ - && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ - || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C -# define YY_ATTRIBUTE(Spec) __attribute__(Spec) -# else -# define YY_ATTRIBUTE(Spec) /* empty */ -# endif -#endif - -#ifndef YY_ATTRIBUTE_PURE -# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) -#endif - -#ifndef YY_ATTRIBUTE_UNUSED -# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) -#endif - -#if !defined _Noreturn \ - && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) -# if defined _MSC_VER && 1200 <= _MSC_VER -# define _Noreturn __declspec (noreturn) -# else -# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) -#else -# define YYUSE(E) /* empty */ -#endif - -#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ - _Pragma ("GCC diagnostic pop") -#else -# define YY_INITIAL_VALUE(Value) Value -#endif -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - - -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include <alloca.h> /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include <malloc.h> /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS -# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ - /* Use EXIT_SUCCESS as a witness for stdlib.h. */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's 'empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined EXIT_SUCCESS \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined WEBIDL_LTYPE_IS_TRIVIAL && WEBIDL_LTYPE_IS_TRIVIAL \ - && defined WEBIDL_STYPE_IS_TRIVIAL && WEBIDL_STYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; - YYLTYPE yyls_alloc; -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ - + 2 * YYSTACK_GAP_MAXIMUM) - -# define YYCOPY_NEEDED 1 - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) - -#endif - -#if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from SRC to DST. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(Dst, Src, Count) \ - __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) -# else -# define YYCOPY(Dst, Src, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (Dst)[yyi] = (Src)[yyi]; \ - } \ - while (0) -# endif -# endif -#endif /* !YYCOPY_NEEDED */ - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 3 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 819 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 81 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 83 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 232 -/* YYNSTATES -- Number of states. */ -#define YYNSTATES 387 - -/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned - by yylex, with out-of-bounds checking. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 320 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM - as returned by yylex, without out-of-bounds checking. */ -static const yytype_uint8 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, - 72, 73, 2, 2, 71, 74, 79, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 70, 68, - 75, 69, 76, 80, 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, 77, 2, 78, 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, 66, 2, 67, 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, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65 -}; - -#if WEBIDL_DEBUG - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = -{ - 0, 230, 230, 234, 240, 250, 252, 254, 256, 258, - 260, 262, 268, 273, 278, 280, 285, 326, 334, 336, - 341, 372, 376, 440, 442, 444, 446, 451, 492, 496, - 509, 520, 548, 585, 589, 598, 600, 608, 615, 618, - 624, 628, 636, 646, 651, 652, 658, 659, 666, 674, - 682, 714, 732, 734, 736, 743, 751, 758, 768, 778, - 788, 798, 811, 816, 818, 823, 825, 831, 841, 872, - 881, 902, 923, 931, 933, 938, 948, 952, 964, 968, - 977, 985, 993, 1009, 1013, 1021, 1028, 1035, 1045, 1052, - 1062, 1074, 1078, 1090, 1094, 1103, 1107, 1116, 1124, 1133, - 1145, 1147, 1153, 1157, 1165, 1170, 1179, 1183, 1191, 1193, - 1198, 1204, 1208, 1219, 1223, 1235, 1240, 1246, 1252, 1260, - 1272, 1286, 1298, 1302, 1311, 1315, 1324, 1334, 1344, 1355, - 1362, 1367, 1372, 1377, 1382, 1387, 1392, 1397, 1402, 1407, - 1412, 1417, 1422, 1427, 1432, 1437, 1442, 1447, 1452, 1457, - 1462, 1467, 1472, 1477, 1482, 1487, 1492, 1497, 1502, 1507, - 1512, 1517, 1522, 1527, 1532, 1542, 1547, 1552, 1557, 1562, - 1567, 1572, 1577, 1582, 1587, 1592, 1597, 1602, 1607, 1612, - 1617, 1622, 1627, 1632, 1637, 1642, 1647, 1655, 1660, 1668, - 1673, 1682, 1684, 1695, 1703, 1708, 1714, 1723, 1727, 1738, - 1743, 1749, 1756, 1765, 1772, 1779, 1789, 1794, 1808, 1810, - 1812, 1819, 1826, 1836, 1843, 1848, 1855, 1865, 1872, 1877, - 1884, 1901, 1905, 1913, 1922, 1926, 1931, 1940, 1944, 1951, - 1954, 1959, 1961 -}; -#endif - -#if WEBIDL_DEBUG || YYERROR_VERBOSE || 1 -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "TOK_ANY", "TOK_ATTRIBUTE", - "TOK_BOOLEAN", "TOK_BYTE", "TOK_CALLBACK", "TOK_CONST", - "TOK_CONSTRUCTOR", "TOK_CREATOR", "TOK_DATE", "TOK_DELETER", - "TOK_DICTIONARY", "TOK_DOUBLE", "TOK_ELLIPSIS", "TOK_ENUM", "TOK_EOL", - "TOK_EXCEPTION", "TOK_FALSE", "TOK_FLOAT", "TOK_GETRAISES", "TOK_GETTER", - "TOK_IMPLEMENTS", "TOK_IN", "TOK_INFINITY", "TOK_INHERIT", - "TOK_INTERFACE", "TOK_ITERABLE", "TOK_LEGACYCALLER", - "TOK_LEGACYITERABLE", "TOK_LONG", "TOK_MODULE", "TOK_NAN", "TOK_NATIVE", - "TOK_NAMEDCONSTRUCTOR", "TOK_NULL_LITERAL", "TOK_OBJECT", "TOK_OCTET", - "TOK_OMITTABLE", "TOK_OPTIONAL", "TOK_OR", "TOK_PARTIAL", "TOK_PROMISE", - "TOK_RAISES", "TOK_READONLY", "TOK_REQUIRED", "TOK_SETRAISES", - "TOK_SETTER", "TOK_SEQUENCE", "TOK_SHORT", "TOK_STATIC", "TOK_STRING", - "TOK_STRINGIFIER", "TOK_TRUE", "TOK_TYPEDEF", "TOK_UNRESTRICTED", - "TOK_UNSIGNED", "TOK_VOID", "TOK_POUND_SIGN", "TOK_IDENTIFIER", - "TOK_INT_LITERAL", "TOK_FLOAT_LITERAL", "TOK_STRING_LITERAL", - "TOK_OTHER_LITERAL", "TOK_JAVADOC", "'{'", "'}'", "';'", "'='", "':'", - "','", "'('", "')'", "'-'", "'<'", "'>'", "'['", "']'", "'.'", "'?'", - "$accept", "Definitions", "Definition", "CallbackOrInterface", - "CallbackRestOrInterface", "Interface", "Partial", "PartialDefinition", - "PartialInterface", "InterfaceMembers", "InterfaceMember", "Dictionary", - "DictionaryMembers", "DictionaryMember", "PartialDictionary", "Default", - "DefaultValue", "Exception", "ExceptionMembers", "Inheritance", "Enum", - "EnumValueList", "EnumValueListComma", "EnumValueListString", - "CallbackRest", "Typedef", "ImplementsStatement", "Const", "ConstValue", - "BooleanLiteral", "FloatLiteral", "AttributeOrOperation", - "StringifierAttributeOrOperation", "Attribute", "StaticMember", - "StaticMemberRest", "AttributeRest", "AttributeName", - "AttributeNameKeyword", "Inherit", "ReadOnly", "Operation", - "SpecialOperation", "Specials", "Special", "OperationRest", - "OptionalIdentifier", "ArgumentList", "Arguments", "Argument", - "OptionalOrRequiredArgument", "ArgumentName", "Ellipsis", "Iterable", - "OptionalType", "ExceptionMember", "ExceptionField", - "ExtendedAttributeList", "ExtendedAttributes", "ExtendedAttribute", - "ExtendedAttributeRest", "ExtendedAttributeInner", "Other", - "ArgumentNameKeyword", "OtherOrComma", "Type", "SingleType", "UnionType", - "UnionMemberType", "UnionMemberTypes", "NonAnyType", "ConstType", - "PrimitiveType", "UnrestrictedFloatType", "FloatType", - "UnsignedIntegerType", "IntegerType", "OptionalLong", "PromiseType", - "TypeSuffix", "TypeSuffixStartingWithArray", "Null", "ReturnType", YY_NULLPTR -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[NUM] -- (External) token number corresponding to the - (internal) symbol number NUM (which must be that of a token). */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 123, 125, 59, 61, - 58, 44, 40, 41, 45, 60, 62, 91, 93, 46, - 63 -}; -# endif - -#define YYPACT_NINF -289 - -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-289))) - -#define YYTABLE_NINF -94 - -#define yytable_value_is_error(Yytable_value) \ - 0 - - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -static const yytype_int16 yypact[] = -{ - 16, -289, 11, -289, 256, 32, -289, -289, -289, -289, - -289, -289, 0, -289, -289, -289, -289, -289, -289, -289, - -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, - -289, -289, -289, 12, -289, -289, -289, -289, -289, -289, - -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, - -289, -289, -289, -289, -289, -289, -289, 334, -289, -289, - -289, 334, -289, -289, -289, 334, -289, -289, -20, 256, - -289, -3, 18, 34, 39, 41, 9, 27, 83, -289, - -289, -289, -289, -289, -289, -289, -289, -289, -10, 47, - 334, -289, 334, 334, 51, -289, 334, 40, 36, 256, - 42, -289, -289, 50, -289, -289, -289, 57, 55, 57, - 57, 69, 79, -289, -289, -289, 660, 81, 70, 73, - 460, 76, 78, 77, 74, 256, -289, 256, 256, -20, - -289, 508, 91, 87, 93, 88, 92, 94, 98, 80, - -289, -289, -15, -289, -289, 128, -15, -289, 90, 99, - -289, -15, 46, -1, -15, 708, 109, -289, -15, -289, - -15, -289, -289, -289, -289, -15, 108, -289, 27, -289, - 660, -289, 165, -10, 334, 334, 334, -289, -289, -289, - -289, -289, -289, 110, -289, -42, 113, 123, -30, -289, - -42, -289, 107, -289, 116, 80, -289, -289, -289, -289, - 508, 660, -289, -289, -289, -289, 114, -15, 158, -289, - 132, -289, -289, -289, -289, 73, 759, -289, 759, 129, - -289, -289, -289, -10, 134, 556, 140, -289, 138, 141, - 612, -21, 142, -13, -15, -15, -289, 131, 135, 136, - -289, 708, -289, -289, -289, 143, -289, -289, -289, 153, - 145, 660, -42, 168, 113, -289, -289, 162, 111, -289, - -30, -289, 172, 166, 167, 169, 170, -289, -289, -289, - 155, -15, 192, 737, -289, 173, -289, 176, -289, 143, - -289, -289, 155, 180, 155, -289, 174, -289, -289, -289, - -289, -289, 171, -289, 177, -289, 412, 1, -289, -289, - -289, -289, -289, 198, -289, -289, 118, -289, 184, -289, - -289, -289, -289, -289, 708, 175, -289, -289, -289, -289, - -289, -289, -289, -289, 222, -289, -289, -289, -289, -289, - 181, 183, -289, 186, -289, -289, 660, 660, -289, -289, - 249, 184, -289, -289, -289, -289, -289, 185, 249, 508, - 118, -289, 192, -289, -289, -289, -289, 72, 202, 201, - 660, -289, -289, -10, -289, 184, -289, -289, 188, 660, - 204, 220, -18, 217, -289, -289, -289, 227, -289, -289, - -289, 231, -289, 232, -289, -289, -289 -}; - - /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE does not specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 0, 4, 111, 1, 0, 0, 147, 165, 148, 149, - 166, 167, 118, 168, 143, 169, 170, 150, 136, 171, - 172, 151, 152, 173, 174, 145, 175, 176, 177, 178, - 179, 153, 146, 0, 154, 155, 156, 158, 157, 180, - 181, 182, 159, 160, 183, 144, 184, 161, 185, 186, - 162, 163, 131, 129, 130, 132, 133, 124, 138, 140, - 137, 124, 134, 139, 141, 124, 135, 142, 113, 122, - 164, 0, 0, 0, 0, 0, 0, 111, 0, 3, - 5, 13, 6, 7, 8, 9, 10, 11, 111, 0, - 124, 188, 124, 124, 0, 187, 124, 0, 0, 0, - 0, 123, 121, 0, 12, 15, 14, 40, 0, 40, - 40, 0, 0, 17, 18, 19, 0, 0, 0, 95, - 0, 0, 0, 0, 0, 122, 128, 122, 122, 113, - 112, 0, 0, 0, 0, 0, 0, 0, 0, 227, - 210, 211, 224, 216, 215, 221, 224, 212, 0, 0, - 219, 224, 0, 0, 224, 0, 0, 189, 224, 191, - 224, 209, 214, 208, 218, 224, 0, 119, 111, 94, - 0, 97, 102, 111, 124, 124, 124, 117, 115, 116, - 114, 232, 231, 0, 41, 111, 45, 0, 111, 21, - 111, 21, 0, 192, 0, 227, 205, 222, 220, 204, - 0, 0, 201, 213, 217, 202, 0, 224, 0, 194, - 0, 190, 199, 200, 50, 95, 0, 103, 0, 0, - 127, 125, 126, 111, 0, 0, 47, 43, 0, 0, - 0, 111, 0, 111, 224, 224, 226, 0, 0, 0, - 195, 0, 49, 96, 101, 33, 100, 99, 120, 0, - 0, 0, 111, 0, 45, 44, 42, 0, 0, 108, - 111, 109, 0, 0, 76, 0, 0, 228, 225, 223, - 229, 224, 197, 0, 98, 0, 27, 0, 29, 33, - 46, 37, 229, 0, 229, 39, 0, 16, 87, 88, - 85, 77, 0, 89, 0, 86, 78, 76, 22, 23, - 24, 63, 25, 78, 64, 81, 83, 26, 91, 32, - 20, 230, 203, 196, 0, 0, 57, 60, 61, 55, - 56, 54, 58, 36, 0, 34, 35, 52, 53, 48, - 0, 0, 207, 0, 206, 110, 0, 0, 79, 69, - 0, 91, 92, 67, 62, 65, 66, 0, 0, 0, - 83, 80, 197, 193, 59, 30, 31, 0, 106, 0, - 0, 70, 71, 111, 68, 91, 84, 198, 0, 0, - 0, 0, 0, 0, 82, 51, 107, 0, 105, 75, - 74, 0, 73, 0, 104, 72, 90 -}; - - /* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = -{ - -289, -289, -289, -289, -289, 230, -289, -289, -289, 112, - -289, -289, -172, -289, -289, 44, -289, -289, 61, 2, - -289, -289, 75, -289, -289, -289, -289, 63, -23, -289, - -289, -289, -289, 54, -289, -289, -33, -289, -289, -289, - 52, -289, -289, -7, 102, -288, -289, -171, 154, 190, - -289, 150, -289, -289, -289, -289, -289, -2, 244, 4, - -43, -52, 10, -185, -289, -115, -289, -152, -231, 25, - -151, -289, 120, -289, 229, -289, 226, -289, -289, -139, - 206, -184, -194 -}; - - /* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = -{ - -1, 2, 79, 80, 104, 81, 82, 113, 114, 231, - 298, 83, 224, 252, 115, 274, 325, 84, 229, 133, - 85, 187, 227, 255, 106, 86, 87, 259, 326, 327, - 328, 300, 344, 301, 302, 339, 361, 381, 382, 303, - 340, 304, 305, 349, 350, 346, 347, 118, 169, 119, - 171, 245, 218, 307, 370, 260, 261, 120, 100, 101, - 102, 94, 95, 70, 96, 182, 157, 158, 208, 315, - 159, 283, 160, 161, 162, 163, 164, 198, 165, 196, - 193, 312, 183 -}; - - /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule whose - number is the opposite. If YYTABLE_NINF, syntax error. */ -static const yytype_int16 yytable[] = -{ - 5, 156, 219, 207, 209, 172, 237, 199, 68, 97, - 272, 3, 202, 98, 69, 205, -2, 1, 232, 211, - 351, 212, 111, -2, 75, -28, 213, 291, 379, -2, - 145, 246, -2, 246, -2, 4, 112, -38, 122, 71, - 123, 124, 380, -2, 126, 72, 263, 4, 73, 150, - 74, 99, 249, 362, 266, 216, 4, 103, -2, 75, - 143, 342, 194, -93, 4, 195, 144, 4, 240, 343, - 308, -2, 88, -91, 76, 116, -2, 374, 107, 69, - 278, 89, 177, 352, 178, 179, 238, 77, 4, 207, - 209, 316, 78, -2, 108, 267, 268, 317, 332, 109, - 334, 110, 341, 129, 4, 318, 117, 121, 319, 69, - 253, 135, 136, 127, 128, 262, 140, 141, 125, 131, - 130, 134, 220, 221, 222, 143, 320, 132, 288, 137, - 289, 144, 313, 321, 322, 69, 277, 69, 69, 138, - 290, 166, 145, 167, 168, 174, 324, 293, 173, 147, - 175, 184, 176, 185, 188, 365, 186, 192, 189, 197, - 190, 150, 207, 209, 191, 200, 295, 152, 153, 210, - 139, 282, 140, 141, 201, 258, 214, 288, 142, 289, - 217, 143, 223, 225, 226, 234, 230, 144, 225, 290, - 228, 239, 373, 291, 235, 292, 293, 294, 145, 241, - 242, 250, 248, 254, 146, 147, 256, 269, 257, 265, - 148, 270, 273, 276, 271, 295, 149, 150, 296, 151, - 297, 358, 359, 152, 153, 181, 275, 154, 279, 264, - 281, 264, 286, 314, 287, 311, 330, 309, 310, 155, - 333, 329, 335, 338, 342, 372, 336, 354, 353, 355, - 225, 356, 337, 360, 376, 357, 375, 363, 230, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 369, 20, 21, 22, 371, 23, 24, - 377, 25, 26, 27, 28, 29, 30, 31, 378, 32, - 383, 33, 34, 35, 36, 384, 37, 38, 39, 385, - 386, 105, 40, 233, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 364, 52, 53, 54, 55, - 56, 285, 57, 331, 58, 59, 60, 299, 61, 280, - 62, 63, 64, 65, 368, 66, 67, 6, 7, 8, - 9, 10, 11, 366, 13, 14, 15, 16, 17, 18, - 19, 345, 20, 21, 22, 348, 23, 24, 215, 25, - 26, 27, 28, 29, 30, 31, 306, 32, 247, 243, - 34, 35, 36, 180, 37, 38, 39, 367, 284, 204, - 40, 203, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 0, 52, 53, 54, 55, 56, 0, - 90, 236, 58, 59, 60, 91, 92, 0, 62, 63, - 64, 93, 0, 66, 67, 139, 0, 140, 141, 0, - 0, 0, 0, 142, 0, 0, 143, 0, 0, 0, - 0, 0, 144, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 145, 0, 0, 0, 0, 0, 146, - 147, 0, 0, 0, 0, 148, 0, 338, 0, 0, - 0, 149, 150, 139, 151, 140, 141, 0, 152, 153, - 181, 142, 154, 0, 143, 0, 0, 0, 0, 0, - 144, 0, 0, 0, 155, 0, 0, 0, 0, 0, - 0, 145, 0, 0, 0, 0, 0, 146, 147, 0, - 170, 0, 0, 148, 0, 0, 0, 0, 0, 149, - 150, 139, 151, 140, 141, 0, 152, 153, 0, 142, - 154, 0, 143, 0, 0, 0, 0, 0, 144, 0, - 0, 0, 155, 0, 0, 0, 0, 0, 0, 145, - 0, 0, 0, 0, 0, 146, 147, 0, 0, 0, - 0, 148, 0, 0, 0, 0, 0, 149, 150, 139, - 151, 140, 141, 0, 152, 153, 181, 142, 154, 0, - 143, 0, 0, 0, 0, 0, 144, 0, 0, 0, - 155, 0, 0, 0, 0, 0, 0, 145, 0, 0, - 0, 0, 0, 146, 147, 0, 0, 0, 0, 148, - 0, 0, 251, 0, 0, 149, 150, 0, 151, 0, - 0, 0, 152, 153, 0, 139, 154, 140, 141, 0, - 258, 0, 0, 142, 0, 0, 143, 0, 155, 0, - 0, 0, 144, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 145, 0, 0, 0, 0, 0, 146, - 147, 0, 0, 0, 0, 148, 0, 0, 0, 0, - 0, 149, 150, 139, 151, 140, 141, 0, 152, 153, - 0, 142, 154, 0, 143, 0, 0, 0, 0, 0, - 144, 0, 0, 0, 155, 0, 0, 0, 0, 0, - 0, 145, 0, 0, 0, 0, 0, 146, 147, 0, - 0, 0, 0, 148, 0, 0, 0, 0, 0, 149, - 150, 206, 151, 140, 141, 0, 152, 153, 0, 142, - 154, 0, 143, 0, 0, 0, 0, 0, 144, 0, - 0, 0, 155, 0, 0, 0, 0, 0, 0, 145, - 0, 0, 0, 0, 0, 146, 147, 0, 0, 0, - 0, 148, 0, 0, 0, 0, 316, 149, 150, 0, - 151, 0, 317, 7, 152, 153, 10, 11, 154, 13, - 318, 15, 16, 319, 0, 19, 0, 20, 0, 0, - 155, 23, 24, 0, 0, 26, 27, 28, 29, 30, - 0, 320, 0, 0, 0, 0, 0, 0, 321, 322, - 323, 39, 0, 0, 0, 40, 0, 41, 0, 0, - 44, 324, 46, 0, 48, 49, 0, 0, 0, 244 -}; - -static const yytype_int16 yycheck[] = -{ - 2, 116, 173, 155, 155, 120, 200, 146, 4, 61, - 241, 0, 151, 65, 4, 154, 0, 1, 190, 158, - 308, 160, 13, 7, 27, 67, 165, 26, 46, 13, - 31, 216, 16, 218, 18, 77, 27, 67, 90, 7, - 92, 93, 60, 27, 96, 13, 67, 77, 16, 50, - 18, 71, 223, 341, 67, 170, 77, 60, 42, 27, - 14, 60, 77, 73, 77, 80, 20, 77, 207, 68, - 264, 55, 72, 72, 42, 77, 60, 365, 60, 69, - 252, 69, 125, 314, 127, 128, 201, 55, 77, 241, - 241, 19, 60, 77, 60, 234, 235, 25, 282, 60, - 284, 60, 296, 99, 77, 33, 23, 60, 36, 99, - 225, 109, 110, 73, 78, 230, 5, 6, 67, 69, - 78, 66, 174, 175, 176, 14, 54, 70, 10, 60, - 12, 20, 271, 61, 62, 125, 251, 127, 128, 60, - 22, 60, 31, 73, 71, 67, 74, 29, 72, 38, - 73, 60, 78, 66, 66, 349, 63, 77, 66, 31, - 66, 50, 314, 314, 66, 75, 48, 56, 57, 60, - 3, 60, 5, 6, 75, 8, 68, 10, 11, 12, - 15, 14, 72, 185, 71, 78, 188, 20, 190, 22, - 67, 77, 363, 26, 78, 28, 29, 30, 31, 41, - 68, 67, 73, 63, 37, 38, 68, 76, 67, 67, - 43, 76, 69, 68, 78, 48, 49, 50, 51, 52, - 53, 336, 337, 56, 57, 58, 73, 60, 60, 231, - 68, 233, 60, 41, 68, 80, 60, 68, 68, 72, - 60, 68, 68, 45, 60, 360, 75, 25, 73, 68, - 252, 68, 75, 4, 369, 69, 68, 72, 260, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 71, 18, 19, 20, 76, 22, 23, - 76, 25, 26, 27, 28, 29, 30, 31, 68, 33, - 73, 35, 36, 37, 38, 68, 40, 41, 42, 68, - 68, 71, 46, 191, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 348, 60, 61, 62, 63, - 64, 260, 66, 279, 68, 69, 70, 264, 72, 254, - 74, 75, 76, 77, 357, 79, 80, 3, 4, 5, - 6, 7, 8, 350, 10, 11, 12, 13, 14, 15, - 16, 297, 18, 19, 20, 303, 22, 23, 168, 25, - 26, 27, 28, 29, 30, 31, 264, 33, 218, 215, - 36, 37, 38, 129, 40, 41, 42, 352, 258, 153, - 46, 152, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, -1, 60, 61, 62, 63, 64, -1, - 66, 195, 68, 69, 70, 71, 72, -1, 74, 75, - 76, 77, -1, 79, 80, 3, -1, 5, 6, -1, - -1, -1, -1, 11, -1, -1, 14, -1, -1, -1, - -1, -1, 20, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 31, -1, -1, -1, -1, -1, 37, - 38, -1, -1, -1, -1, 43, -1, 45, -1, -1, - -1, 49, 50, 3, 52, 5, 6, -1, 56, 57, - 58, 11, 60, -1, 14, -1, -1, -1, -1, -1, - 20, -1, -1, -1, 72, -1, -1, -1, -1, -1, - -1, 31, -1, -1, -1, -1, -1, 37, 38, -1, - 40, -1, -1, 43, -1, -1, -1, -1, -1, 49, - 50, 3, 52, 5, 6, -1, 56, 57, -1, 11, - 60, -1, 14, -1, -1, -1, -1, -1, 20, -1, - -1, -1, 72, -1, -1, -1, -1, -1, -1, 31, - -1, -1, -1, -1, -1, 37, 38, -1, -1, -1, - -1, 43, -1, -1, -1, -1, -1, 49, 50, 3, - 52, 5, 6, -1, 56, 57, 58, 11, 60, -1, - 14, -1, -1, -1, -1, -1, 20, -1, -1, -1, - 72, -1, -1, -1, -1, -1, -1, 31, -1, -1, - -1, -1, -1, 37, 38, -1, -1, -1, -1, 43, - -1, -1, 46, -1, -1, 49, 50, -1, 52, -1, - -1, -1, 56, 57, -1, 3, 60, 5, 6, -1, - 8, -1, -1, 11, -1, -1, 14, -1, 72, -1, - -1, -1, 20, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 31, -1, -1, -1, -1, -1, 37, - 38, -1, -1, -1, -1, 43, -1, -1, -1, -1, - -1, 49, 50, 3, 52, 5, 6, -1, 56, 57, - -1, 11, 60, -1, 14, -1, -1, -1, -1, -1, - 20, -1, -1, -1, 72, -1, -1, -1, -1, -1, - -1, 31, -1, -1, -1, -1, -1, 37, 38, -1, - -1, -1, -1, 43, -1, -1, -1, -1, -1, 49, - 50, 3, 52, 5, 6, -1, 56, 57, -1, 11, - 60, -1, 14, -1, -1, -1, -1, -1, 20, -1, - -1, -1, 72, -1, -1, -1, -1, -1, -1, 31, - -1, -1, -1, -1, -1, 37, 38, -1, -1, -1, - -1, 43, -1, -1, -1, -1, 19, 49, 50, -1, - 52, -1, 25, 4, 56, 57, 7, 8, 60, 10, - 33, 12, 13, 36, -1, 16, -1, 18, -1, -1, - 72, 22, 23, -1, -1, 26, 27, 28, 29, 30, - -1, 54, -1, -1, -1, -1, -1, -1, 61, 62, - 63, 42, -1, -1, -1, 46, -1, 48, -1, -1, - 51, 74, 53, -1, 55, 56, -1, -1, -1, 60 -}; - - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = -{ - 0, 1, 82, 0, 77, 138, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 18, 19, 20, 22, 23, 25, 26, 27, 28, 29, - 30, 31, 33, 35, 36, 37, 38, 40, 41, 42, - 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 60, 61, 62, 63, 64, 66, 68, 69, - 70, 72, 74, 75, 76, 77, 79, 80, 140, 143, - 144, 7, 13, 16, 18, 27, 42, 55, 60, 83, - 84, 86, 87, 92, 98, 101, 106, 107, 72, 69, - 66, 71, 72, 77, 142, 143, 145, 142, 142, 71, - 139, 140, 141, 60, 85, 86, 105, 60, 60, 60, - 60, 13, 27, 88, 89, 95, 138, 23, 128, 130, - 138, 60, 142, 142, 142, 67, 142, 73, 78, 140, - 78, 69, 70, 100, 66, 100, 100, 60, 60, 3, - 5, 6, 11, 14, 20, 31, 37, 38, 43, 49, - 50, 52, 56, 57, 60, 72, 146, 147, 148, 151, - 153, 154, 155, 156, 157, 159, 60, 73, 71, 129, - 40, 131, 146, 72, 67, 73, 78, 141, 141, 141, - 139, 58, 146, 163, 60, 66, 63, 102, 66, 66, - 66, 66, 77, 161, 77, 80, 160, 31, 158, 160, - 75, 75, 160, 155, 157, 160, 3, 148, 149, 151, - 60, 160, 160, 160, 68, 130, 146, 15, 133, 128, - 142, 142, 142, 72, 93, 138, 71, 103, 67, 99, - 138, 90, 93, 90, 78, 78, 161, 163, 146, 77, - 160, 41, 68, 129, 60, 132, 144, 132, 73, 128, - 67, 46, 94, 146, 63, 104, 68, 67, 8, 108, - 136, 137, 146, 67, 138, 67, 67, 160, 160, 76, - 76, 78, 149, 69, 96, 73, 68, 146, 93, 60, - 103, 68, 60, 152, 153, 99, 60, 68, 10, 12, - 22, 26, 28, 29, 30, 48, 51, 53, 91, 108, - 112, 114, 115, 120, 122, 123, 125, 134, 163, 68, - 68, 80, 162, 160, 41, 150, 19, 25, 33, 36, - 54, 61, 62, 63, 74, 97, 109, 110, 111, 68, - 60, 96, 162, 60, 162, 68, 75, 75, 45, 116, - 121, 163, 60, 68, 113, 114, 126, 127, 121, 124, - 125, 126, 149, 73, 25, 68, 68, 69, 146, 146, - 4, 117, 126, 72, 117, 163, 124, 150, 109, 71, - 135, 76, 146, 128, 126, 68, 146, 76, 68, 46, - 60, 118, 119, 73, 68, 68, 68 -}; - - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 81, 82, 82, 82, 83, 83, 83, 83, 83, - 83, 83, 84, 84, 85, 85, 86, 87, 88, 88, - 89, 90, 90, 91, 91, 91, 91, 92, 93, 93, - 94, 94, 95, 96, 96, 97, 97, 98, 99, 99, - 100, 100, 101, 102, 103, 103, 104, 104, 105, 106, - 107, 108, 109, 109, 109, 109, 110, 110, 111, 111, - 111, 111, 112, 112, 112, 113, 113, 113, 114, 115, - 116, 116, 117, 118, 118, 119, 120, 120, 121, 121, - 122, 122, 123, 124, 124, 125, 125, 125, 125, 125, - 126, 127, 127, 128, 128, 129, 129, 130, 131, 131, - 132, 132, 133, 133, 134, 134, 135, 135, 136, 136, - 137, 138, 138, 139, 139, 140, 140, 140, 140, 140, - 140, 140, 141, 141, 142, 142, 142, 142, 142, 143, - 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, - 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, - 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, - 143, 143, 143, 143, 143, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 145, 145, 146, - 146, 147, 147, 148, 149, 149, 149, 150, 150, 151, - 151, 151, 151, 151, 151, 151, 152, 152, 153, 153, - 153, 153, 153, 154, 154, 155, 155, 156, 156, 157, - 157, 158, 158, 159, 160, 160, 160, 161, 161, 162, - 162, 163, 163 -}; - - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 0, 3, 1, 1, 1, 1, 1, 1, - 1, 1, 2, 1, 1, 1, 7, 2, 1, 1, - 6, 0, 3, 1, 1, 1, 1, 7, 0, 3, - 4, 4, 6, 0, 2, 1, 1, 7, 0, 3, - 0, 2, 6, 2, 2, 0, 2, 0, 7, 5, - 4, 6, 1, 1, 1, 1, 1, 1, 1, 2, - 1, 1, 2, 1, 1, 1, 1, 1, 3, 2, - 2, 2, 4, 1, 1, 1, 0, 1, 0, 1, - 2, 1, 4, 0, 2, 1, 1, 1, 1, 1, - 5, 0, 1, 0, 2, 0, 3, 2, 4, 3, - 1, 1, 0, 1, 6, 5, 0, 2, 1, 1, - 3, 0, 4, 0, 3, 4, 4, 4, 1, 4, - 6, 2, 0, 1, 0, 4, 4, 4, 2, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 1, 2, 6, 1, 2, 4, 0, 3, 2, - 2, 2, 2, 5, 2, 2, 2, 2, 1, 1, - 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, - 2, 0, 1, 4, 0, 3, 2, 0, 3, 0, - 1, 1, 1 -}; - - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (&yylloc, webidl_ast, YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (0) - -/* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (N) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (0) -#endif - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) - - -/* Enable debugging if requested. */ -#if WEBIDL_DEBUG - -# ifndef YYFPRINTF -# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef YY_LOCATION_PRINT -# if defined WEBIDL_LTYPE_IS_TRIVIAL && WEBIDL_LTYPE_IS_TRIVIAL - -/* Print *YYLOCP on YYO. Private, do not rely on its existence. */ - -YY_ATTRIBUTE_UNUSED -static unsigned -yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp) -{ - unsigned res = 0; - int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; - if (0 <= yylocp->first_line) - { - res += YYFPRINTF (yyo, "%d", yylocp->first_line); - if (0 <= yylocp->first_column) - res += YYFPRINTF (yyo, ".%d", yylocp->first_column); - } - if (0 <= yylocp->last_line) - { - if (yylocp->first_line < yylocp->last_line) - { - res += YYFPRINTF (yyo, "-%d", yylocp->last_line); - if (0 <= end_col) - res += YYFPRINTF (yyo, ".%d", end_col); - } - else if (0 <= end_col && yylocp->first_column < end_col) - res += YYFPRINTF (yyo, "-%d", end_col); - } - return res; - } - -# define YY_LOCATION_PRINT(File, Loc) \ - yy_location_print_ (File, &(Loc)) - -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif -#endif - - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value, Location, webidl_ast); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) - - -/*----------------------------------------. -| Print this symbol's value on YYOUTPUT. | -`----------------------------------------*/ - -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, struct webidl_node **webidl_ast) -{ - FILE *yyo = yyoutput; - YYUSE (yyo); - YYUSE (yylocationp); - YYUSE (webidl_ast); - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - YYUSE (yytype); -} - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, struct webidl_node **webidl_ast) -{ - YYFPRINTF (yyoutput, "%s %s (", - yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); - - YY_LOCATION_PRINT (yyoutput, *yylocationp); - YYFPRINTF (yyoutput, ": "); - yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, webidl_ast); - YYFPRINTF (yyoutput, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -{ - YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -static void -yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, struct webidl_node **webidl_ast) -{ - unsigned long int yylno = yyrline[yyrule]; - int yynrhs = yyr2[yyrule]; - int yyi; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, - yystos[yyssp[yyi + 1 - yynrhs]], - &(yyvsp[(yyi + 1) - (yynrhs)]) - , &(yylsp[(yyi + 1) - (yynrhs)]) , webidl_ast); - YYFPRINTF (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyssp, yyvsp, yylsp, Rule, webidl_ast); \ -} while (0) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !WEBIDL_DEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !WEBIDL_DEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -yystrlen (const char *yystr) -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -yystpcpy (char *yydest, const char *yysrc) -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) -{ - YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULLPTR; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; - - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) - { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - } - } - } - - switch (yycount) - { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } - - { - YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; -} -#endif /* YYERROR_VERBOSE */ - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, struct webidl_node **webidl_ast) -{ - YYUSE (yyvaluep); - YYUSE (yylocationp); - YYUSE (webidl_ast); - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yytype); - YY_IGNORE_MAYBE_UNINITIALIZED_END -} - - - - -/*----------. -| yyparse. | -`----------*/ - -int -yyparse (struct webidl_node **webidl_ast) -{ -/* The lookahead symbol. */ -int yychar; - - -/* The semantic value of the lookahead symbol. */ -/* Default value used for initialization, for pacifying older GCCs - or non-GCC compilers. */ -YY_INITIAL_VALUE (static YYSTYPE yyval_default;) -YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); - -/* Location data for the lookahead symbol. */ -static YYLTYPE yyloc_default -# if defined WEBIDL_LTYPE_IS_TRIVIAL && WEBIDL_LTYPE_IS_TRIVIAL - = { 1, 1, 1, 1 } -# endif -; -YYLTYPE yylloc = yyloc_default; - - /* Number of syntax errors so far. */ - int yynerrs; - - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - 'yyss': related to states. - 'yyvs': related to semantic values. - 'yyls': related to locations. - - Refer to the stacks through separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - /* The location stack. */ - YYLTYPE yylsa[YYINITDEPTH]; - YYLTYPE *yyls; - YYLTYPE *yylsp; - - /* The locations where the error started and ended. */ - YYLTYPE yyerror_range[3]; - - YYSIZE_T yystacksize; - - int yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - YYLTYPE yyloc; - -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - yylsp = yyls = yylsa; - yystacksize = YYINITDEPTH; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - yylsp[0] = yylloc; - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - YYLTYPE *yyls1 = yyls; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yyls1, yysize * sizeof (*yylsp), - &yystacksize); - - yyls = yyls1; - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); - YYSTACK_RELOCATE (yyls_alloc, yyls); -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - yylsp = yyls + yysize - 1; - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - if (yystate == YYFINAL) - YYACCEPT; - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = yylex (&yylval, &yylloc); - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yytable_value_is_error (yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - - yystate = yyn; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - *++yylsp = yylloc; - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - '$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - /* Default location. */ - YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 2: -#line 230 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = NULL; - } -#line 1855 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 3: -#line 235 "webidl-parser.y" /* yacc.c:1646 */ - { - webidl_node_add((yyvsp[0].node), (yyvsp[-1].node)); - (yyval.node) = *webidl_ast = webidl_node_prepend(*webidl_ast, (yyvsp[0].node)); - } -#line 1864 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 4: -#line 241 "webidl-parser.y" /* yacc.c:1646 */ - { - fprintf(stderr, "%d: %s\n", yylloc.first_line, errtxt); - free(errtxt); - YYABORT ; - } -#line 1874 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 12: -#line 269 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = (yyvsp[0].node); - } -#line 1882 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 16: -#line 286 "webidl-parser.y" /* yacc.c:1646 */ - { - /* extend interface with additional members */ - struct webidl_node *interface_node; - struct webidl_node *members = NULL; - - if ((yyvsp[-4].text) != NULL) { - members = webidl_node_new(WEBIDL_NODE_TYPE_INHERITANCE, - members, - (yyvsp[-4].text)); - } - - members = webidl_node_new(WEBIDL_NODE_TYPE_LIST, members, (yyvsp[-2].node)); - - - interface_node = webidl_node_find_type_ident(*webidl_ast, - WEBIDL_NODE_TYPE_INTERFACE, - (yyvsp[-5].text)); - - if (interface_node == NULL) { - /* no existing interface - create one with ident */ - members = webidl_node_new(WEBIDL_NODE_TYPE_IDENT, - members, - (yyvsp[-5].text)); - - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_INTERFACE, - NULL, - members); - } else { - /* update the existing interface */ - - /* link member node into interfaces_node */ - webidl_node_add(interface_node, members); - - (yyval.node) = NULL; /* updating so no need to add a new node */ - } - } -#line 1923 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 17: -#line 327 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = (yyvsp[0].node); - } -#line 1931 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 20: -#line 342 "webidl-parser.y" /* yacc.c:1646 */ - { - /* extend interface with additional members */ - struct webidl_node *members; - struct webidl_node *interface_node; - - interface_node = webidl_node_find_type_ident(*webidl_ast, - WEBIDL_NODE_TYPE_INTERFACE, - (yyvsp[-4].text)); - - members = webidl_node_new(WEBIDL_NODE_TYPE_LIST, NULL, (yyvsp[-2].node)); - - if (interface_node == NULL) { - /* doesnt already exist so create it */ - - members = webidl_node_new(WEBIDL_NODE_TYPE_IDENT, members, (yyvsp[-4].text)); - - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_INTERFACE, NULL, members); - } else { - /* update the existing interface */ - - /* link member node into interfaces_node */ - webidl_node_add(interface_node, members); - - (yyval.node) = NULL; /* updating so no need to add a new node */ - } - } -#line 1962 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 21: -#line 372 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = NULL; /* empty */ - } -#line 1970 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 22: -#line 377 "webidl-parser.y" /* yacc.c:1646 */ - { - /* This needs to deal with members with the same - * identifier which indicate polymorphism. this is - * handled in the AST by adding the argument lists for - * each polymorphism to the same - * WEBIDL_NODE_TYPE_OPERATION - * - * @todo need to consider qualifer/stringifier compatibility - */ - struct webidl_node *member_node; - struct webidl_node *ident_node; - struct webidl_node *list_node; - - ident_node = webidl_node_find_type(webidl_node_getnode((yyvsp[0].node)), - NULL, - WEBIDL_NODE_TYPE_IDENT); - - list_node = webidl_node_find_type(webidl_node_getnode((yyvsp[0].node)), - NULL, - WEBIDL_NODE_TYPE_LIST); - - if (ident_node == NULL) { - /* something with no ident - possibly constructors? */ - /* @todo understand this better */ - - (yyval.node) = webidl_node_prepend((yyvsp[-2].node), (yyvsp[0].node)); - - } else if (list_node == NULL) { - /* member with no argument list, usually an - * attribute, cannot be polymorphic - */ - - /* add extended attributes to parameter list */ - webidl_node_add((yyvsp[0].node), (yyvsp[-1].node)); - - (yyval.node) = webidl_node_prepend((yyvsp[-2].node), (yyvsp[0].node)); - - } else { - /* add extended attributes to parameter list */ - webidl_node_add(list_node, (yyvsp[-1].node)); - - /* has an arguemnt list so can be polymorphic */ - member_node = webidl_node_find_type_ident( - (yyvsp[-2].node), - webidl_node_gettype((yyvsp[0].node)), - webidl_node_gettext(ident_node)); - if (member_node == NULL) { - /* not a member with that ident already present */ - (yyval.node) = webidl_node_prepend((yyvsp[-2].node), (yyvsp[0].node)); - } else { - webidl_node_add(member_node, list_node); - (yyval.node) = (yyvsp[-2].node); /* updated existing node do not add new one */ - } - } - } -#line 2030 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 27: -#line 452 "webidl-parser.y" /* yacc.c:1646 */ - { - /* extend dictionary with additional members */ - struct webidl_node *dictionary_node; - struct webidl_node *members = NULL; - - if ((yyvsp[-4].text) != NULL) { - members = webidl_node_new(WEBIDL_NODE_TYPE_INHERITANCE, - members, - (yyvsp[-4].text)); - } - - members = webidl_node_new(WEBIDL_NODE_TYPE_LIST, members, (yyvsp[-2].node)); - - dictionary_node = webidl_node_find_type_ident( - *webidl_ast, - WEBIDL_NODE_TYPE_DICTIONARY, - (yyvsp[-5].text)); - - if (dictionary_node == NULL) { - /* no existing interface - create one with ident */ - members = webidl_node_new(WEBIDL_NODE_TYPE_IDENT, - members, - (yyvsp[-5].text)); - - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_DICTIONARY, - NULL, - members); - } else { - /* update the existing interface */ - - /* link member node into interfaces_node */ - webidl_node_add(dictionary_node, members); - - (yyval.node) = NULL; /* updating so no need to add a new node */ - } - } -#line 2071 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 28: -#line 492 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = NULL; /* empty */ - } -#line 2079 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 29: -#line 497 "webidl-parser.y" /* yacc.c:1646 */ - { - /** \todo handle ExtendedAttributeList */ - (yyval.node) = webidl_node_append((yyvsp[0].node), (yyvsp[-1].node)); - } -#line 2088 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 30: -#line 510 "webidl-parser.y" /* yacc.c:1646 */ - { - struct webidl_node *member; - /* add name */ - member = webidl_node_new(WEBIDL_NODE_TYPE_IDENT, NULL, (yyvsp[-1].text)); - /* add type node */ - member = webidl_node_prepend(member, (yyvsp[-2].node)); - - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_ARGUMENT, NULL, member); - } -#line 2102 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 31: -#line 521 "webidl-parser.y" /* yacc.c:1646 */ - { - struct webidl_node *member; - /* add name */ - member = webidl_node_new(WEBIDL_NODE_TYPE_IDENT, NULL, (yyvsp[-2].text)); - /* add default */ - member = webidl_node_new(WEBIDL_NODE_TYPE_OPTIONAL, member, (yyvsp[-1].node)); - /* add type node */ - member = webidl_node_prepend(member, (yyvsp[-3].node)); - - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_ARGUMENT, NULL, member); - } -#line 2118 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 32: -#line 549 "webidl-parser.y" /* yacc.c:1646 */ - { - /* extend dictionary with additional members */ - struct webidl_node *members; - struct webidl_node *dictionary_node; - - dictionary_node = webidl_node_find_type_ident( - *webidl_ast, - WEBIDL_NODE_TYPE_DICTIONARY, - (yyvsp[-4].text)); - - members = webidl_node_new(WEBIDL_NODE_TYPE_LIST, NULL, (yyvsp[-2].node)); - - if (dictionary_node == NULL) { - /* doesnt already exist so create it */ - - members = webidl_node_new(WEBIDL_NODE_TYPE_IDENT, - members, - (yyvsp[-4].text)); - - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_DICTIONARY, - NULL, - members); - } else { - /* update the existing dictionary */ - - /* link member node into dictionary node */ - webidl_node_add(dictionary_node, members); - - (yyval.node) = NULL; /* updating so no need to add a new node */ - } - } -#line 2154 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 33: -#line 585 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = NULL; - } -#line 2162 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 34: -#line 590 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = (yyvsp[0].node); - } -#line 2170 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 36: -#line 601 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_LITERAL_STRING, NULL, (yyvsp[0].text)); - } -#line 2178 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 37: -#line 609 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = NULL; - } -#line 2186 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 40: -#line 624 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = NULL; - } -#line 2194 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 41: -#line 629 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = (yyvsp[0].text); - } -#line 2202 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 42: -#line 637 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = NULL; - } -#line 2210 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 48: -#line 667 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = NULL; - } -#line 2218 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 49: -#line 675 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = NULL; - } -#line 2226 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 50: -#line 683 "webidl-parser.y" /* yacc.c:1646 */ - { - /* extend interface with implements members */ - struct webidl_node *implements; - struct webidl_node *interface_node; - - - interface_node = webidl_node_find_type_ident(*webidl_ast, - WEBIDL_NODE_TYPE_INTERFACE, - (yyvsp[-3].text)); - - implements = webidl_node_new(WEBIDL_NODE_TYPE_INTERFACE_IMPLEMENTS, NULL, (yyvsp[-1].text)); - - if (interface_node == NULL) { - /* interface doesnt already exist so create it */ - - implements = webidl_node_new(WEBIDL_NODE_TYPE_IDENT, implements, (yyvsp[-3].text)); - - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_INTERFACE, NULL, implements); - } else { - /* update the existing interface */ - - /* link implements node into interfaces_node */ - webidl_node_add(interface_node, implements); - - (yyval.node) = NULL; /* updating so no need to add a new node */ - } - } -#line 2258 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 51: -#line 715 "webidl-parser.y" /* yacc.c:1646 */ - { - struct webidl_node *constant; - - constant = webidl_node_new(WEBIDL_NODE_TYPE_IDENT, NULL, (yyvsp[-3].text)); - - /* add constant type */ - constant = webidl_node_prepend(constant, (yyvsp[-4].node)); - - /* add constant value */ - constant = webidl_node_prepend(constant, (yyvsp[-1].node)); - - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_CONST, NULL, constant); - } -#line 2276 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 54: -#line 737 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_new_number_node(WEBIDL_NODE_TYPE_LITERAL_INT, - NULL, - (yyvsp[0].value)); - } -#line 2286 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 55: -#line 744 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_LITERAL_NULL, NULL, NULL); - } -#line 2294 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 56: -#line 752 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_new_number_node(WEBIDL_NODE_TYPE_LITERAL_BOOL, - NULL, - (int)true); - } -#line 2304 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 57: -#line 759 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_new_number_node(WEBIDL_NODE_TYPE_LITERAL_BOOL, - NULL, - (int)false); - } -#line 2314 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 58: -#line 769 "webidl-parser.y" /* yacc.c:1646 */ - { - float *value; - value = malloc(sizeof(float)); - *value = strtof((yyvsp[0].text), NULL); - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_LITERAL_FLOAT, - NULL, - value); - } -#line 2327 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 59: -#line 779 "webidl-parser.y" /* yacc.c:1646 */ - { - float *value; - value = malloc(sizeof(float)); - *value = -INFINITY; - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_LITERAL_FLOAT, - NULL, - value); - } -#line 2340 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 60: -#line 789 "webidl-parser.y" /* yacc.c:1646 */ - { - float *value; - value = malloc(sizeof(float)); - *value = INFINITY; - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_LITERAL_FLOAT, - NULL, - value); - } -#line 2353 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 61: -#line 799 "webidl-parser.y" /* yacc.c:1646 */ - { - float *value; - value = malloc(sizeof(float)); - *value = NAN; - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_LITERAL_FLOAT, - NULL, - value); - } -#line 2366 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 62: -#line 812 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = (yyvsp[0].node); - } -#line 2374 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 66: -#line 826 "webidl-parser.y" /* yacc.c:1646 */ - { - /* @todo deal with stringifier */ - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_OPERATION, NULL, (yyvsp[0].node)); - } -#line 2383 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 67: -#line 832 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node)=NULL; - } -#line 2391 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 68: -#line 842 "webidl-parser.y" /* yacc.c:1646 */ - { - struct webidl_node *attribute; - - attribute = (yyvsp[0].node); - - /* deal with inherit modifier */ - if ((yyvsp[-2].isit)) { - attribute = webidl_new_number_node( - WEBIDL_NODE_TYPE_MODIFIER, - attribute, - WEBIDL_TYPE_MODIFIER_INHERIT); - } - - /* deal with readonly modifier */ - if ((yyvsp[-1].isit)) { - attribute = webidl_new_number_node( - WEBIDL_NODE_TYPE_MODIFIER, - attribute, - WEBIDL_TYPE_MODIFIER_READONLY); - } - - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_ATTRIBUTE, - NULL, - attribute); - } -#line 2421 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 69: -#line 873 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = (yyvsp[0].node); - } -#line 2429 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 70: -#line 882 "webidl-parser.y" /* yacc.c:1646 */ - { - struct webidl_node *attribute; - - attribute = webidl_new_number_node(WEBIDL_NODE_TYPE_MODIFIER, - (yyvsp[0].node), - WEBIDL_TYPE_MODIFIER_STATIC); - - /* deal with readonly modifier */ - if ((yyvsp[-1].isit)) { - attribute = webidl_new_number_node( - WEBIDL_NODE_TYPE_MODIFIER, - attribute, - WEBIDL_TYPE_MODIFIER_READONLY); - } - - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_ATTRIBUTE, - NULL, - attribute); - } -#line 2453 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 71: -#line 903 "webidl-parser.y" /* yacc.c:1646 */ - { - struct webidl_node *operation; - - /* add static modifier */ - operation = webidl_new_number_node(WEBIDL_NODE_TYPE_MODIFIER, - (yyvsp[0].node), - WEBIDL_TYPE_MODIFIER_STATIC); - - /* put return type on the operation */ - operation = webidl_node_prepend((yyvsp[-1].node), operation); - - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_OPERATION, - NULL, - operation); - } -#line 2473 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 72: -#line 924 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_IDENT, (yyvsp[-2].node), (yyvsp[-1].text)); - } -#line 2481 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 75: -#line 939 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("required"); - } -#line 2489 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 76: -#line 948 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.isit) = false; - } -#line 2497 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 77: -#line 953 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.isit) = true; - } -#line 2505 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 78: -#line 964 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.isit) = false; - } -#line 2513 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 79: -#line 969 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.isit) = true; - } -#line 2521 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 80: -#line 978 "webidl-parser.y" /* yacc.c:1646 */ - { - /* put return type on the operation */ - (yyvsp[0].node) = webidl_node_prepend((yyvsp[-1].node), (yyvsp[0].node)); - - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_OPERATION, NULL, (yyvsp[0].node)); - } -#line 2532 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 81: -#line 986 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_OPERATION, NULL, (yyvsp[0].node)); - } -#line 2540 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 82: -#line 994 "webidl-parser.y" /* yacc.c:1646 */ - { - /* put return type on the operation */ - (yyval.node) = webidl_node_prepend((yyvsp[0].node), (yyvsp[-1].node)); - - /* specials */ - (yyval.node) = webidl_node_prepend((yyval.node), (yyvsp[-2].node)); - - /* special */ - (yyval.node) = webidl_node_prepend((yyval.node), (yyvsp[-3].node)); - } -#line 2555 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 83: -#line 1009 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = NULL; - } -#line 2563 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 84: -#line 1014 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_node_prepend((yyvsp[0].node), (yyvsp[-1].node)); - } -#line 2571 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 85: -#line 1022 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_new_number_node(WEBIDL_NODE_TYPE_SPECIAL, - NULL, - WEBIDL_TYPE_SPECIAL_GETTER); - } -#line 2581 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 86: -#line 1029 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_new_number_node(WEBIDL_NODE_TYPE_SPECIAL, - NULL, - WEBIDL_TYPE_SPECIAL_SETTER); - } -#line 2591 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 87: -#line 1036 "webidl-parser.y" /* yacc.c:1646 */ - { - /* second edition removed this special but the - * specifications still use it! - */ - (yyval.node) = webidl_new_number_node(WEBIDL_NODE_TYPE_SPECIAL, - NULL, - WEBIDL_TYPE_SPECIAL_CREATOR); - } -#line 2604 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 88: -#line 1046 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_new_number_node(WEBIDL_NODE_TYPE_SPECIAL, - NULL, - WEBIDL_TYPE_SPECIAL_DELETER); - } -#line 2614 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 89: -#line 1053 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_new_number_node(WEBIDL_NODE_TYPE_SPECIAL, - NULL, - WEBIDL_TYPE_SPECIAL_LEGACYCALLER); - } -#line 2624 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 90: -#line 1063 "webidl-parser.y" /* yacc.c:1646 */ - { - /* argument list */ - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_LIST, NULL, (yyvsp[-2].node)); - - (yyval.node) = webidl_node_prepend((yyvsp[-4].node), (yyval.node)); /* identifier */ - } -#line 2635 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 91: -#line 1074 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = NULL; - } -#line 2643 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 92: -#line 1079 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_IDENT, NULL, (yyvsp[0].text)); - } -#line 2651 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 93: -#line 1090 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = NULL; - } -#line 2659 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 94: -#line 1095 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_node_append((yyvsp[0].node), (yyvsp[-1].node)); - } -#line 2667 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 95: -#line 1103 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = NULL; - } -#line 2675 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 96: -#line 1108 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_node_append((yyvsp[0].node), (yyvsp[-1].node)); - } -#line 2683 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 97: -#line 1117 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = (yyvsp[0].node); - } -#line 2691 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 98: -#line 1125 "webidl-parser.y" /* yacc.c:1646 */ - { - struct webidl_node *argument; - argument = webidl_node_new(WEBIDL_NODE_TYPE_IDENT, NULL, (yyvsp[-1].text)); - argument = webidl_node_new(WEBIDL_NODE_TYPE_OPTIONAL, argument, (yyvsp[0].node)); - argument = webidl_node_prepend(argument, (yyvsp[-2].node)); /* add type node */ - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_ARGUMENT, NULL, argument); - } -#line 2703 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 99: -#line 1134 "webidl-parser.y" /* yacc.c:1646 */ - { - struct webidl_node *argument; - argument = webidl_node_new(WEBIDL_NODE_TYPE_IDENT, NULL, (yyvsp[0].text)); - argument = webidl_node_prepend(argument, (yyvsp[-1].node)); /* ellipsis node */ - argument = webidl_node_prepend(argument, (yyvsp[-2].node)); /* add type node */ - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_ARGUMENT, NULL, argument); - } -#line 2715 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 102: -#line 1153 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = NULL; - } -#line 2723 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 103: -#line 1158 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_ELLIPSIS, NULL, NULL); - } -#line 2731 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 104: -#line 1166 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = NULL; - } -#line 2739 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 105: -#line 1171 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = NULL; - } -#line 2747 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 106: -#line 1179 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = NULL; - } -#line 2755 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 107: -#line 1184 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = NULL; - } -#line 2763 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 111: -#line 1204 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = NULL; - } -#line 2771 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 112: -#line 1209 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_EXTENDED_ATTRIBUTE, - (yyvsp[-1].node), - (yyvsp[-2].node)); - } -#line 2781 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 113: -#line 1219 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = NULL; - } -#line 2789 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 114: -#line 1224 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_EXTENDED_ATTRIBUTE, - (yyvsp[0].node), - (yyvsp[-1].node)); - } -#line 2799 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 115: -#line 1236 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_EXTENDED_ATTRIBUTE, (yyvsp[0].node), (yyvsp[-2].node)); - } -#line 2807 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 116: -#line 1241 "webidl-parser.y" /* yacc.c:1646 */ - { - /* @todo should be a WEBIDL_NODE_TYPE_EXTENDED_ATTRIBUTE_SQUARE */ - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_EXTENDED_ATTRIBUTE, (yyvsp[0].node), (yyvsp[-2].node)); - } -#line 2816 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 117: -#line 1247 "webidl-parser.y" /* yacc.c:1646 */ - { - /* @todo should be a WEBIDL_NODE_TYPE_EXTENDED_ATTRIBUTE_CURLY */ - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_EXTENDED_ATTRIBUTE, (yyvsp[0].node), (yyvsp[-2].node)); - } -#line 2825 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 118: -#line 1253 "webidl-parser.y" /* yacc.c:1646 */ - { - /* Constructor */ - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_IDENT, - NULL, - strdup("Constructor")); - } -#line 2836 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 119: -#line 1261 "webidl-parser.y" /* yacc.c:1646 */ - { - /* Constructor */ - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_OPERATION, - webidl_node_new(WEBIDL_NODE_TYPE_IDENT, - NULL, - strdup("Constructor")), - webidl_node_new(WEBIDL_NODE_TYPE_LIST, - NULL, - (yyvsp[-1].node))); - } -#line 2851 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 120: -#line 1273 "webidl-parser.y" /* yacc.c:1646 */ - { - /* Constructor */ - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_OPERATION, - webidl_node_new(WEBIDL_NODE_TYPE_IDENT, - NULL, - strdup("NamedConstructor")), - webidl_node_new(WEBIDL_NODE_TYPE_LIST, - webidl_node_new(WEBIDL_NODE_TYPE_IDENT, - NULL, - (yyvsp[-3].text)), - (yyvsp[-1].node))); - } -#line 2868 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 121: -#line 1287 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_node_append((yyvsp[0].node), - webidl_node_new(WEBIDL_NODE_TYPE_IDENT, - NULL, - (yyvsp[-1].text))); - } -#line 2879 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 122: -#line 1298 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = NULL; - } -#line 2887 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 123: -#line 1303 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = (yyvsp[0].node); - } -#line 2895 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 124: -#line 1311 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = NULL; - } -#line 2903 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 125: -#line 1316 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_node_prepend( - webidl_node_new(WEBIDL_NODE_TYPE_EXTENDED_ATTRIBUTE, - NULL, - (yyvsp[-2].node)), - (yyvsp[0].node)); - } -#line 2915 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 126: -#line 1325 "webidl-parser.y" /* yacc.c:1646 */ - { - /* @todo should be a WEBIDL_NODE_TYPE_EXTENDED_ATTRIBUTE_SQUARE */ - (yyval.node) = webidl_node_prepend( - webidl_node_new(WEBIDL_NODE_TYPE_EXTENDED_ATTRIBUTE, - NULL, - (yyvsp[-2].node)), - (yyvsp[0].node)); - } -#line 2928 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 127: -#line 1335 "webidl-parser.y" /* yacc.c:1646 */ - { - /* @todo should be a WEBIDL_NODE_TYPE_EXTENDED_ATTRIBUTE_CURLY */ - (yyval.node) = webidl_node_prepend( - webidl_node_new(WEBIDL_NODE_TYPE_EXTENDED_ATTRIBUTE, - NULL, - (yyvsp[-2].node)), - (yyvsp[0].node)); - } -#line 2941 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 128: -#line 1345 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_node_append((yyvsp[0].node), - webidl_node_new(WEBIDL_NODE_TYPE_IDENT, - NULL, - (yyvsp[-1].text))); - } -#line 2952 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 129: -#line 1356 "webidl-parser.y" /* yacc.c:1646 */ - { - /* @todo loosing base info here might break the attribute */ - (yyval.text) = calloc(1, 32); - snprintf((yyval.text), 32, "%ld", (yyvsp[0].value)); - } -#line 2962 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 130: -#line 1363 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = (yyvsp[0].text); - } -#line 2970 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 131: -#line 1368 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = (yyvsp[0].text); - } -#line 2978 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 132: -#line 1373 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = (yyvsp[0].text); - } -#line 2986 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 133: -#line 1378 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = (yyvsp[0].text); - } -#line 2994 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 134: -#line 1383 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("-"); - } -#line 3002 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 135: -#line 1388 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("."); - } -#line 3010 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 136: -#line 1393 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("..."); - } -#line 3018 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 137: -#line 1398 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup(":"); - } -#line 3026 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 138: -#line 1403 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup(";"); - } -#line 3034 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 139: -#line 1408 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("<"); - } -#line 3042 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 140: -#line 1413 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("="); - } -#line 3050 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 141: -#line 1418 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup(">"); - } -#line 3058 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 142: -#line 1423 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("?"); - } -#line 3066 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 143: -#line 1428 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("Date"); - } -#line 3074 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 144: -#line 1433 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("DOMString"); - } -#line 3082 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 145: -#line 1438 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("Infinity"); - } -#line 3090 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 146: -#line 1443 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("NaN"); - } -#line 3098 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 147: -#line 1448 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("any"); - } -#line 3106 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 148: -#line 1453 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("boolean"); - } -#line 3114 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 149: -#line 1458 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("byte"); - } -#line 3122 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 150: -#line 1463 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("double"); - } -#line 3130 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 151: -#line 1468 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("false"); - } -#line 3138 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 152: -#line 1473 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("float"); - } -#line 3146 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 153: -#line 1478 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("long"); - } -#line 3154 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 154: -#line 1483 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("null"); - } -#line 3162 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 155: -#line 1488 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("object"); - } -#line 3170 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 156: -#line 1493 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("octet"); - } -#line 3178 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 157: -#line 1498 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("or"); - } -#line 3186 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 158: -#line 1503 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("optional"); - } -#line 3194 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 159: -#line 1508 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("sequence"); - } -#line 3202 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 160: -#line 1513 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("short"); - } -#line 3210 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 161: -#line 1518 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("true"); - } -#line 3218 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 162: -#line 1523 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("unsigned"); - } -#line 3226 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 163: -#line 1528 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("void"); - } -#line 3234 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 164: -#line 1533 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = (yyvsp[0].text); - } -#line 3242 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 165: -#line 1543 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("attribute"); - } -#line 3250 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 166: -#line 1548 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("callback"); - } -#line 3258 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 167: -#line 1553 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("const"); - } -#line 3266 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 168: -#line 1558 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("creator"); - } -#line 3274 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 169: -#line 1563 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("deleter"); - } -#line 3282 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 170: -#line 1568 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("dictionary"); - } -#line 3290 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 171: -#line 1573 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("enum"); - } -#line 3298 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 172: -#line 1578 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("exception"); - } -#line 3306 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 173: -#line 1583 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("getter"); - } -#line 3314 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 174: -#line 1588 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("implements"); - } -#line 3322 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 175: -#line 1593 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("inherit"); - } -#line 3330 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 176: -#line 1598 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("interface"); - } -#line 3338 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 177: -#line 1603 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("iterable"); - } -#line 3346 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 178: -#line 1608 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("legacycaller"); - } -#line 3354 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 179: -#line 1613 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("legacyiterable"); - } -#line 3362 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 180: -#line 1618 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("partial"); - } -#line 3370 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 181: -#line 1623 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("required"); - } -#line 3378 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 182: -#line 1628 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("setter"); - } -#line 3386 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 183: -#line 1633 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("static"); - } -#line 3394 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 184: -#line 1638 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("stringifier"); - } -#line 3402 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 185: -#line 1643 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("typedef"); - } -#line 3410 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 186: -#line 1648 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup("unrestricted"); - } -#line 3418 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 187: -#line 1656 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = (yyvsp[0].text); - } -#line 3426 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 188: -#line 1661 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.text) = strdup(","); - } -#line 3434 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 189: -#line 1669 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_TYPE, NULL, (yyvsp[0].node)); - } -#line 3442 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 190: -#line 1674 "webidl-parser.y" /* yacc.c:1646 */ - { - /* todo handle suffix */ - (yyval.node) = (yyvsp[-1].node); - } -#line 3451 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 192: -#line 1685 "webidl-parser.y" /* yacc.c:1646 */ - { - /* todo deal with TypeSuffixStartingWithArray */ - (yyval.node) = webidl_new_number_node(WEBIDL_NODE_TYPE_TYPE_BASE, - NULL, - WEBIDL_TYPE_ANY); - } -#line 3462 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 193: -#line 1696 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_node_prepend((yyvsp[-4].node), webidl_node_prepend((yyvsp[-2].node), (yyvsp[-1].node))); - } -#line 3470 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 194: -#line 1704 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_TYPE, NULL, (yyvsp[0].node)); - } -#line 3478 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 195: -#line 1709 "webidl-parser.y" /* yacc.c:1646 */ - { - /* todo handle suffix */ - (yyval.node) = (yyvsp[-1].node); - } -#line 3487 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 196: -#line 1715 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = NULL; - } -#line 3495 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 197: -#line 1723 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = NULL; - } -#line 3503 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 198: -#line 1728 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_node_prepend((yyvsp[-1].node), (yyvsp[0].node)); - } -#line 3511 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 199: -#line 1739 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_node_prepend((yyvsp[-1].node), (yyvsp[0].node)); - } -#line 3519 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 200: -#line 1744 "webidl-parser.y" /* yacc.c:1646 */ - { - /* second edition adds promise types */ - (yyval.node) = webidl_node_prepend((yyvsp[-1].node), (yyvsp[0].node)); - } -#line 3528 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 201: -#line 1750 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_new_number_node(WEBIDL_NODE_TYPE_TYPE_BASE, - (yyvsp[0].node), - WEBIDL_TYPE_STRING); - } -#line 3538 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 202: -#line 1757 "webidl-parser.y" /* yacc.c:1646 */ - { - struct webidl_node *type; - type = webidl_new_number_node(WEBIDL_NODE_TYPE_TYPE_BASE, - (yyvsp[0].node), - WEBIDL_TYPE_USER); - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_IDENT, type, (yyvsp[-1].text)); - } -#line 3550 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 203: -#line 1766 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_new_number_node(WEBIDL_NODE_TYPE_TYPE_BASE, - (yyvsp[-2].node), - WEBIDL_TYPE_SEQUENCE); - } -#line 3560 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 204: -#line 1773 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_new_number_node(WEBIDL_NODE_TYPE_TYPE_BASE, - (yyvsp[0].node), - WEBIDL_TYPE_OBJECT); - } -#line 3570 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 205: -#line 1780 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_new_number_node(WEBIDL_NODE_TYPE_TYPE_BASE, - (yyvsp[0].node), - WEBIDL_TYPE_DATE); - } -#line 3580 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 206: -#line 1790 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_TYPE, NULL, (yyvsp[-1].node)); - } -#line 3588 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 207: -#line 1795 "webidl-parser.y" /* yacc.c:1646 */ - { - struct webidl_node *type; - type = webidl_new_number_node(WEBIDL_NODE_TYPE_TYPE_BASE, - NULL, - WEBIDL_TYPE_USER); - type = webidl_node_new(WEBIDL_NODE_TYPE_IDENT, type, (yyvsp[-1].text)); - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_TYPE, NULL, type); - } -#line 3601 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 210: -#line 1813 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_new_number_node(WEBIDL_NODE_TYPE_TYPE_BASE, - NULL, - WEBIDL_TYPE_BOOL); - } -#line 3611 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 211: -#line 1820 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_new_number_node(WEBIDL_NODE_TYPE_TYPE_BASE, - NULL, - WEBIDL_TYPE_BYTE); - } -#line 3621 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 212: -#line 1827 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_new_number_node(WEBIDL_NODE_TYPE_TYPE_BASE, - NULL, - WEBIDL_TYPE_OCTET); - } -#line 3631 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 213: -#line 1837 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_new_number_node(WEBIDL_NODE_TYPE_MODIFIER, - (yyvsp[0].node), - WEBIDL_TYPE_MODIFIER_UNRESTRICTED); - } -#line 3641 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 215: -#line 1849 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_new_number_node(WEBIDL_NODE_TYPE_TYPE_BASE, - NULL, - WEBIDL_TYPE_FLOAT); - } -#line 3651 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 216: -#line 1856 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_new_number_node(WEBIDL_NODE_TYPE_TYPE_BASE, - NULL, - WEBIDL_TYPE_DOUBLE); - } -#line 3661 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 217: -#line 1866 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_new_number_node(WEBIDL_NODE_TYPE_MODIFIER, - (yyvsp[0].node), - WEBIDL_TYPE_MODIFIER_UNSIGNED); - } -#line 3671 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 219: -#line 1878 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_new_number_node(WEBIDL_NODE_TYPE_TYPE_BASE, - NULL, - WEBIDL_TYPE_SHORT); - } -#line 3681 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 220: -#line 1885 "webidl-parser.y" /* yacc.c:1646 */ - { - if ((yyvsp[0].isit)) { - (yyval.node) = webidl_new_number_node(WEBIDL_NODE_TYPE_TYPE_BASE, - NULL, - WEBIDL_TYPE_LONGLONG); - } else { - (yyval.node) = webidl_new_number_node(WEBIDL_NODE_TYPE_TYPE_BASE, - NULL, - WEBIDL_TYPE_LONG); - } - } -#line 3697 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 221: -#line 1901 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.isit) = false; - } -#line 3705 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 222: -#line 1906 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.isit) = true; - } -#line 3713 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 223: -#line 1914 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = NULL; - } -#line 3721 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 224: -#line 1922 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = NULL; - } -#line 3729 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 225: -#line 1927 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_TYPE_ARRAY, (yyvsp[0].node), NULL); - } -#line 3737 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 226: -#line 1932 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_TYPE_NULLABLE, (yyvsp[0].node), NULL); - } -#line 3745 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 227: -#line 1940 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = NULL; - } -#line 3753 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 228: -#line 1945 "webidl-parser.y" /* yacc.c:1646 */ - { - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_TYPE_ARRAY, (yyvsp[0].node), NULL); - } -#line 3761 "webidl-parser.c" /* yacc.c:1646 */ - break; - - case 232: -#line 1962 "webidl-parser.y" /* yacc.c:1646 */ - { - struct webidl_node *type; - type = webidl_new_number_node(WEBIDL_NODE_TYPE_TYPE_BASE, - NULL, - WEBIDL_TYPE_VOID); - (yyval.node) = webidl_node_new(WEBIDL_NODE_TYPE_TYPE, NULL, type); - } -#line 3773 "webidl-parser.c" /* yacc.c:1646 */ - break; - - -#line 3777 "webidl-parser.c" /* yacc.c:1646 */ - default: break; - } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - *++yylsp = yyloc; - - /* Now 'shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*--------------------------------------. -| yyerrlab -- here on detecting error. | -`--------------------------------------*/ -yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (&yylloc, webidl_ast, YY_("syntax error")); -#else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) - { - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (&yylloc, webidl_ast, yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; - } -# undef YYSYNTAX_ERROR -#endif - } - - yyerror_range[1] = yylloc; - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval, &yylloc, webidl_ast); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - yyerror_range[1] = yylsp[1-yylen]; - /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - yyerror_range[1] = *yylsp; - yydestruct ("Error: popping", - yystos[yystate], yyvsp, yylsp, webidl_ast); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - yyerror_range[2] = yylloc; - /* Using YYLLOC is tempting, but would change the location of - the lookahead. YYLOC is available though. */ - YYLLOC_DEFAULT (yyloc, yyerror_range, 2); - *++yylsp = yyloc; - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#if !defined yyoverflow || YYERROR_VERBOSE -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (&yylloc, webidl_ast, YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEMPTY) - { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE (yychar); - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval, &yylloc, webidl_ast); - } - /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp, yylsp, webidl_ast); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - return yyresult; -} -#line 1972 "webidl-parser.y" /* yacc.c:1906 */ - diff --git a/pkg/netsurf/nsgenbind/webidl-parser.h b/pkg/netsurf/nsgenbind/webidl-parser.h @@ -1,161 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.0.4. */ - -/* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2015 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 <http://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. */ - -#ifndef YY_WEBIDL_WEBIDL_PARSER_H_INCLUDED -# define YY_WEBIDL_WEBIDL_PARSER_H_INCLUDED -/* Debug traces. */ -#ifndef WEBIDL_DEBUG -# if defined YYDEBUG -#if YYDEBUG -# define WEBIDL_DEBUG 1 -# else -# define WEBIDL_DEBUG 0 -# endif -# else /* ! defined YYDEBUG */ -# define WEBIDL_DEBUG 1 -# endif /* ! defined YYDEBUG */ -#endif /* ! defined WEBIDL_DEBUG */ -#if WEBIDL_DEBUG -extern int webidl_debug; -#endif - -/* Token type. */ -#ifndef WEBIDL_TOKENTYPE -# define WEBIDL_TOKENTYPE - enum webidl_tokentype - { - TOK_ANY = 258, - TOK_ATTRIBUTE = 259, - TOK_BOOLEAN = 260, - TOK_BYTE = 261, - TOK_CALLBACK = 262, - TOK_CONST = 263, - TOK_CONSTRUCTOR = 264, - TOK_CREATOR = 265, - TOK_DATE = 266, - TOK_DELETER = 267, - TOK_DICTIONARY = 268, - TOK_DOUBLE = 269, - TOK_ELLIPSIS = 270, - TOK_ENUM = 271, - TOK_EOL = 272, - TOK_EXCEPTION = 273, - TOK_FALSE = 274, - TOK_FLOAT = 275, - TOK_GETRAISES = 276, - TOK_GETTER = 277, - TOK_IMPLEMENTS = 278, - TOK_IN = 279, - TOK_INFINITY = 280, - TOK_INHERIT = 281, - TOK_INTERFACE = 282, - TOK_ITERABLE = 283, - TOK_LEGACYCALLER = 284, - TOK_LEGACYITERABLE = 285, - TOK_LONG = 286, - TOK_MODULE = 287, - TOK_NAN = 288, - TOK_NATIVE = 289, - TOK_NAMEDCONSTRUCTOR = 290, - TOK_NULL_LITERAL = 291, - TOK_OBJECT = 292, - TOK_OCTET = 293, - TOK_OMITTABLE = 294, - TOK_OPTIONAL = 295, - TOK_OR = 296, - TOK_PARTIAL = 297, - TOK_PROMISE = 298, - TOK_RAISES = 299, - TOK_READONLY = 300, - TOK_REQUIRED = 301, - TOK_SETRAISES = 302, - TOK_SETTER = 303, - TOK_SEQUENCE = 304, - TOK_SHORT = 305, - TOK_STATIC = 306, - TOK_STRING = 307, - TOK_STRINGIFIER = 308, - TOK_TRUE = 309, - TOK_TYPEDEF = 310, - TOK_UNRESTRICTED = 311, - TOK_UNSIGNED = 312, - TOK_VOID = 313, - TOK_POUND_SIGN = 314, - TOK_IDENTIFIER = 315, - TOK_INT_LITERAL = 316, - TOK_FLOAT_LITERAL = 317, - TOK_STRING_LITERAL = 318, - TOK_OTHER_LITERAL = 319, - TOK_JAVADOC = 320 - }; -#endif - -/* Value type. */ -#if ! defined WEBIDL_STYPE && ! defined WEBIDL_STYPE_IS_DECLARED - -union WEBIDL_STYPE -{ -#line 56 "webidl-parser.y" /* yacc.c:1909 */ - - int attr; - long value; - bool isit; - char* text; - struct webidl_node *node; - -#line 136 "webidl-parser.h" /* yacc.c:1909 */ -}; - -typedef union WEBIDL_STYPE WEBIDL_STYPE; -# define WEBIDL_STYPE_IS_TRIVIAL 1 -# define WEBIDL_STYPE_IS_DECLARED 1 -#endif - -/* Location type. */ -#if ! defined WEBIDL_LTYPE && ! defined WEBIDL_LTYPE_IS_DECLARED -typedef struct WEBIDL_LTYPE WEBIDL_LTYPE; -struct WEBIDL_LTYPE -{ - int first_line; - int first_column; - int last_line; - int last_column; -}; -# define WEBIDL_LTYPE_IS_DECLARED 1 -# define WEBIDL_LTYPE_IS_TRIVIAL 1 -#endif - - - -int webidl_parse (struct webidl_node **webidl_ast); - -#endif /* !YY_WEBIDL_WEBIDL_PARSER_H_INCLUDED */