[Midnightbsd-cvs] src [12026] trunk/contrib/flex: remove old files
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Tue Sep 11 21:41:00 EDT 2018
Revision: 12026
http://svnweb.midnightbsd.org/src/?rev=12026
Author: laffer1
Date: 2018-09-11 21:40:59 -0400 (Tue, 11 Sep 2018)
Log Message:
-----------
remove old files
Removed Paths:
-------------
trunk/contrib/flex/buf.c
trunk/contrib/flex/flex.skl
trunk/contrib/flex/flexdef.h
trunk/contrib/flex/flexint.h
trunk/contrib/flex/libyywrap.c
trunk/contrib/flex/main.c
trunk/contrib/flex/scanflags.c
Deleted: trunk/contrib/flex/buf.c
===================================================================
--- trunk/contrib/flex/buf.c 2018-09-12 01:37:07 UTC (rev 12025)
+++ trunk/contrib/flex/buf.c 2018-09-12 01:40:59 UTC (rev 12026)
@@ -1,274 +0,0 @@
-/* flex - tool to generate fast lexical analyzers */
-
-/* Copyright (c) 1990 The Regents of the University of California. */
-/* All rights reserved. */
-
-/* This code is derived from software contributed to Berkeley by */
-/* Vern Paxson. */
-
-/* The United States Government has rights in this work pursuant */
-/* to contract no. DE-AC03-76SF00098 between the United States */
-/* Department of Energy and the University of California. */
-
-/* This file is part of flex. */
-
-/* Redistribution and use in source and binary forms, with or without */
-/* modification, are permitted provided that the following conditions */
-/* are met: */
-
-/* 1. Redistributions of source code must retain the above copyright */
-/* notice, this list of conditions and the following disclaimer. */
-/* 2. Redistributions in binary form must reproduce the above copyright */
-/* notice, this list of conditions and the following disclaimer in the */
-/* documentation and/or other materials provided with the distribution. */
-
-/* Neither the name of the University nor the names of its contributors */
-/* may be used to endorse or promote products derived from this software */
-/* without specific prior written permission. */
-
-/* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR */
-/* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED */
-/* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */
-/* PURPOSE. */
-
-#include "flexdef.h"
-
-/* Take note: The buffer object is sometimes used as a String buffer (one
- * continuous string), and sometimes used as a list of strings, usually line by
- * line.
- *
- * The type is specified in buf_init by the elt_size. If the elt_size is
- * sizeof(char), then the buffer should be treated as string buffer. If the
- * elt_size is sizeof(char*), then the buffer should be treated as a list of
- * strings.
- *
- * Certain functions are only appropriate for one type or the other.
- */
-
-/* global buffers. */
-struct Buf userdef_buf; /**< for user #definitions triggered by cmd-line. */
-struct Buf defs_buf; /**< for #define's autogenerated. List of strings. */
-struct Buf yydmap_buf; /**< string buffer to hold yydmap elements */
-struct Buf m4defs_buf; /**< m4 definitions. List of strings. */
-struct Buf top_buf; /**< contains %top code. String buffer. */
-
-struct Buf *buf_print_strings(struct Buf * buf, FILE* out)
-{
- int i;
-
- if(!buf || !out)
- return buf;
-
- for (i=0; i < buf->nelts; i++){
- const char * s = ((char**)buf->elts)[i];
- if(s)
- fprintf(out, "%s", s);
- }
- return buf;
-}
-
-/* Append a "%s" formatted string to a string buffer */
-struct Buf *buf_prints (struct Buf *buf, const char *fmt, const char *s)
-{
- char *t;
- size_t tsz;
-
- t = flex_alloc (tsz = strlen (fmt) + strlen (s) + 1);
- if (!t)
- flexfatal (_("Allocation of buffer to print string failed"));
- snprintf (t, tsz, fmt, s);
- buf = buf_strappend (buf, t);
- flex_free (t);
- return buf;
-}
-
-/** Append a line directive to the string buffer.
- * @param buf A string buffer.
- * @param filename file name
- * @param lineno line number
- * @return buf
- */
-struct Buf *buf_linedir (struct Buf *buf, const char* filename, int lineno)
-{
- char *dst, *t;
- const char *src;
-
- t = flex_alloc (strlen ("#line \"\"\n") + /* constant parts */
- 2 * strlen (filename) + /* filename with possibly all backslashes escaped */
- NUMCHARLINES + /* line number */
- 1); /* NUL */
- if (!t)
- flexfatal (_("Allocation of buffer for line directive failed"));
- for (dst = t + sprintf (t, "#line %d \"", lineno), src = filename; *src; *dst++ = *src++)
- if (*src == '\\') /* escape backslashes */
- *dst++ = '\\';
- *dst++ = '"';
- *dst++ = '\n';
- *dst = '\0';
- buf = buf_strappend (buf, t);
- flex_free (t);
- return buf;
-}
-
-
-/** Append the contents of @a src to @a dest.
- * @param @a dest the destination buffer
- * @param @a dest the source buffer
- * @return @a dest
- */
-struct Buf *buf_concat(struct Buf* dest, const struct Buf* src)
-{
- buf_append(dest, src->elts, src->nelts);
- return dest;
-}
-
-
-/* Appends n characters in str to buf. */
-struct Buf *buf_strnappend (buf, str, n)
- struct Buf *buf;
- const char *str;
- int n;
-{
- buf_append (buf, str, n + 1);
-
- /* "undo" the '\0' character that buf_append() already copied. */
- buf->nelts--;
-
- return buf;
-}
-
-/* Appends characters in str to buf. */
-struct Buf *buf_strappend (buf, str)
- struct Buf *buf;
- const char *str;
-{
- return buf_strnappend (buf, str, strlen (str));
-}
-
-/* appends "#define str def\n" */
-struct Buf *buf_strdefine (buf, str, def)
- struct Buf *buf;
- const char *str;
- const char *def;
-{
- buf_strappend (buf, "#define ");
- buf_strappend (buf, " ");
- buf_strappend (buf, str);
- buf_strappend (buf, " ");
- buf_strappend (buf, def);
- buf_strappend (buf, "\n");
- return buf;
-}
-
-/** Pushes "m4_define( [[def]], [[val]])m4_dnl" to end of buffer.
- * @param buf A buffer as a list of strings.
- * @param def The m4 symbol to define.
- * @param val The definition; may be NULL.
- * @return buf
- */
-struct Buf *buf_m4_define (struct Buf *buf, const char* def, const char* val)
-{
- const char * fmt = "m4_define( [[%s]], [[%s]])m4_dnl\n";
- char * str;
- size_t strsz;
-
- val = val?val:"";
- str = (char*)flex_alloc(strsz = strlen(fmt) + strlen(def) + strlen(val) + 2);
- if (!str)
- flexfatal (_("Allocation of buffer for m4 def failed"));
-
- snprintf(str, strsz, fmt, def, val);
- buf_append(buf, &str, 1);
- return buf;
-}
-
-/** Pushes "m4_undefine([[def]])m4_dnl" to end of buffer.
- * @param buf A buffer as a list of strings.
- * @param def The m4 symbol to undefine.
- * @return buf
- */
-struct Buf *buf_m4_undefine (struct Buf *buf, const char* def)
-{
- const char * fmt = "m4_undefine( [[%s]])m4_dnl\n";
- char * str;
- size_t strsz;
-
- str = (char*)flex_alloc(strsz = strlen(fmt) + strlen(def) + 2);
- if (!str)
- flexfatal (_("Allocation of buffer for m4 undef failed"));
-
- snprintf(str, strsz, fmt, def);
- buf_append(buf, &str, 1);
- return buf;
-}
-
-/* create buf with 0 elements, each of size elem_size. */
-void buf_init (buf, elem_size)
- struct Buf *buf;
- size_t elem_size;
-{
- buf->elts = (void *) 0;
- buf->nelts = 0;
- buf->elt_size = elem_size;
- buf->nmax = 0;
-}
-
-/* frees memory */
-void buf_destroy (buf)
- struct Buf *buf;
-{
- if (buf && buf->elts)
- flex_free (buf->elts);
- buf->elts = (void *) 0;
-}
-
-
-/* appends ptr[] to buf, grow if necessary.
- * n_elem is number of elements in ptr[], NOT bytes.
- * returns buf.
- * We grow by mod(512) boundaries.
- */
-
-struct Buf *buf_append (buf, ptr, n_elem)
- struct Buf *buf;
- const void *ptr;
- int n_elem;
-{
- int n_alloc = 0;
-
- if (!ptr || n_elem == 0)
- return buf;
-
- /* May need to alloc more. */
- if (n_elem + buf->nelts > buf->nmax) {
-
- /* exact amount needed... */
- n_alloc = (n_elem + buf->nelts) * buf->elt_size;
-
- /* ...plus some extra */
- if (((n_alloc * buf->elt_size) % 512) != 0
- && buf->elt_size < 512)
- n_alloc +=
- (512 -
- ((n_alloc * buf->elt_size) % 512)) /
- buf->elt_size;
-
- if (!buf->elts)
- buf->elts =
- allocate_array (n_alloc, buf->elt_size);
- else
- buf->elts =
- reallocate_array (buf->elts, n_alloc,
- buf->elt_size);
-
- buf->nmax = n_alloc;
- }
-
- memcpy ((char *) buf->elts + buf->nelts * buf->elt_size, ptr,
- n_elem * buf->elt_size);
- buf->nelts += n_elem;
-
- return buf;
-}
-
-/* vim:set tabstop=8 softtabstop=4 shiftwidth=4: */
Deleted: trunk/contrib/flex/flex.skl
===================================================================
--- trunk/contrib/flex/flex.skl 2018-09-12 01:37:07 UTC (rev 12025)
+++ trunk/contrib/flex/flex.skl 2018-09-12 01:40:59 UTC (rev 12026)
@@ -1,3460 +0,0 @@
-%# -*-C-*- vi: set ft=c:
-%# This file is processed in several stages.
-%# Here are the stages, as best as I can describe:
-%#
-%# 1. flex.skl is processed through GNU m4 during the
-%# pre-compilation stage of flex. Only macros starting
-%# with `m4preproc_' are processed, and quoting is normal.
-%#
-%# 2. The preprocessed skeleton is translated verbatim into a
-%# C array, saved as "skel.c" and compiled into the flex binary.
-%#
-%# 3. At runtime, the skeleton is generated and filtered (again)
-%# through m4. Macros beginning with `m4_' will be processed.
-%# The quoting is "[[" and "]]" so we don't interfere with
-%# user code.
-%#
-%# All generate macros for the m4 stage contain the text "m4" or "M4"
-%# in them. This is to distinguish them from CPP macros.
-%# The exception to this rule is YY_G, which is an m4 macro,
-%# but it needs to be remain short because it is used everywhere.
-%#
-/* A lexical scanner generated by flex */
-
-%# Macros for preproc stage.
-m4preproc_changecom
-
-%# Macros for runtime processing stage.
-m4_changecom
-m4_changequote
-m4_changequote([[, ]])
-
-%#
-%# Lines in this skeleton starting with a "%" character are "control lines"
-%# and affect the generation of the scanner. The possible control codes are
-%# listed and processed in misc.c.
-%#
-%# %# - A comment. The current line is omitted from the generated scanner.
-%# %if-c++-only - The following lines are printed for C++ scanners ONLY.
-%# %if-c-only - The following lines are NOT printed for C++ scanners.
-%# %if-c-or-c++ - The following lines are printed in BOTH C and C++ scanners.
-%# %if-reentrant - Print for reentrant scanners.(push)
-%# %if-not-reentrant - Print for non-reentrant scanners. (push)
-%# %if-bison-bridge - Print for bison-bridge. (push)
-%# %if-not-bison-bridge - Print for non-bison-bridge. (push)
-%# %endif - pop from the previous if code.
-%# %% - A stop-point, where code is inserted by flex.
-%# Each stop-point is numbered here and also in the code generator.
-%# (See gen.c, etc. for details.)
-%# %not-for-header - Begin code that should NOT appear in a ".h" file.
-%# %ok-for-header - %c and %e are used for building a header file.
-%# %if-tables-serialization
-%#
-%# All control-lines EXCEPT comment lines ("%#") will be inserted into
-%# the generated scanner as a C-style comment. This is to aid those who
-%# edit the skeleton.
-%#
-
-%not-for-header
-%if-c-only
-%if-not-reentrant
-m4_ifelse(M4_YY_PREFIX,yy,,
-#define yy_create_buffer M4_YY_PREFIX[[_create_buffer]]
-#define yy_delete_buffer M4_YY_PREFIX[[_delete_buffer]]
-#define yy_flex_debug M4_YY_PREFIX[[_flex_debug]]
-#define yy_init_buffer M4_YY_PREFIX[[_init_buffer]]
-#define yy_flush_buffer M4_YY_PREFIX[[_flush_buffer]]
-#define yy_load_buffer_state M4_YY_PREFIX[[_load_buffer_state]]
-#define yy_switch_to_buffer M4_YY_PREFIX[[_switch_to_buffer]]
-#define yyin M4_YY_PREFIX[[in]]
-#define yyleng M4_YY_PREFIX[[leng]]
-#define yylex M4_YY_PREFIX[[lex]]
-#define yylineno M4_YY_PREFIX[[lineno]]
-#define yyout M4_YY_PREFIX[[out]]
-#define yyrestart M4_YY_PREFIX[[restart]]
-#define yytext M4_YY_PREFIX[[text]]
-#define yywrap M4_YY_PREFIX[[wrap]]
-#define yyalloc M4_YY_PREFIX[[alloc]]
-#define yyrealloc M4_YY_PREFIX[[realloc]]
-#define yyfree M4_YY_PREFIX[[free]]
-)
-%endif
-%endif
-%ok-for-header
-
-#define FLEX_SCANNER
-#define YY_FLEX_MAJOR_VERSION FLEX_MAJOR_VERSION
-#define YY_FLEX_MINOR_VERSION FLEX_MINOR_VERSION
-#define YY_FLEX_SUBMINOR_VERSION FLEX_SUBMINOR_VERSION
-#if YY_FLEX_SUBMINOR_VERSION > 0
-#define FLEX_BETA
-#endif
-
-%# Some negated symbols
-m4_ifdef( [[M4_YY_IN_HEADER]], , [[m4_define([[M4_YY_NOT_IN_HEADER]], [[]])]])
-m4_ifdef( [[M4_YY_REENTRANT]], , [[m4_define([[M4_YY_NOT_REENTRANT]], [[]])]])
-
-%# This is the m4 way to say "(stack_used || is_reentrant)
-m4_ifdef( [[M4_YY_STACK_USED]], [[m4_define([[M4_YY_HAS_START_STACK_VARS]])]])
-m4_ifdef( [[M4_YY_REENTRANT]], [[m4_define([[M4_YY_HAS_START_STACK_VARS]])]])
-
-%# Prefixes.
-%# The complexity here is necessary so that m4 preserves
-%# the argument lists to each C function.
-
-
-m4_ifdef( [[M4_YY_PREFIX]],, [[m4_define([[M4_YY_PREFIX]], [[yy]])]])
-
-m4preproc_define(`M4_GEN_PREFIX',
- ``m4_define(yy[[$1]], [[M4_YY_PREFIX[[$1]]m4_ifelse($'`#,0,,[[($'`@)]])]])'')
-
-%if-c++-only
- /* The c++ scanner is a mess. The FlexLexer.h header file relies on the
- * following macro. This is required in order to pass the c++-multiple-scanners
- * test in the regression suite. We get reports that it breaks inheritance.
- * We will address this in a future release of flex, or omit the C++ scanner
- * altogether.
- */
- #define yyFlexLexer M4_YY_PREFIX[[FlexLexer]]
-%endif
-
-%if-c-only
- M4_GEN_PREFIX(`_create_buffer')
- M4_GEN_PREFIX(`_delete_buffer')
- M4_GEN_PREFIX(`_scan_buffer')
- M4_GEN_PREFIX(`_scan_string')
- M4_GEN_PREFIX(`_scan_bytes')
- M4_GEN_PREFIX(`_init_buffer')
- M4_GEN_PREFIX(`_flush_buffer')
- M4_GEN_PREFIX(`_load_buffer_state')
- M4_GEN_PREFIX(`_switch_to_buffer')
- M4_GEN_PREFIX(`push_buffer_state')
- M4_GEN_PREFIX(`pop_buffer_state')
- M4_GEN_PREFIX(`ensure_buffer_stack')
- M4_GEN_PREFIX(`lex')
- M4_GEN_PREFIX(`restart')
- M4_GEN_PREFIX(`lex_init')
- M4_GEN_PREFIX(`lex_init_extra')
- M4_GEN_PREFIX(`lex_destroy')
- M4_GEN_PREFIX(`get_debug')
- M4_GEN_PREFIX(`set_debug')
- M4_GEN_PREFIX(`get_extra')
- M4_GEN_PREFIX(`set_extra')
- M4_GEN_PREFIX(`get_in')
- M4_GEN_PREFIX(`set_in')
- M4_GEN_PREFIX(`get_out')
- M4_GEN_PREFIX(`set_out')
- M4_GEN_PREFIX(`get_leng')
- M4_GEN_PREFIX(`get_text')
- M4_GEN_PREFIX(`get_lineno')
- M4_GEN_PREFIX(`set_lineno')
- m4_ifdef( [[M4_YY_REENTRANT]],
- [[
- M4_GEN_PREFIX(`get_column')
- M4_GEN_PREFIX(`set_column')
- ]])
- M4_GEN_PREFIX(`wrap')
-%endif
-
-m4_ifdef( [[M4_YY_BISON_LVAL]],
-[[
- M4_GEN_PREFIX(`get_lval')
- M4_GEN_PREFIX(`set_lval')
-]])
-
-m4_ifdef( [[<M4_YY_BISON_LLOC>]],
-[[
- M4_GEN_PREFIX(`get_lloc')
- M4_GEN_PREFIX(`set_lloc')
-]])
-
-
- M4_GEN_PREFIX(`alloc')
- M4_GEN_PREFIX(`realloc')
- M4_GEN_PREFIX(`free')
-
-%if-c-only
-m4_ifdef( [[M4_YY_NOT_REENTRANT]],
-[[
- M4_GEN_PREFIX(`text')
- M4_GEN_PREFIX(`leng')
- M4_GEN_PREFIX(`in')
- M4_GEN_PREFIX(`out')
- M4_GEN_PREFIX(`_flex_debug')
- M4_GEN_PREFIX(`lineno')
-]])
-%endif
-
-
-m4_ifdef( [[M4_YY_TABLES_EXTERNAL]],
-[[
- M4_GEN_PREFIX(`tables_fload')
- M4_GEN_PREFIX(`tables_destroy')
- M4_GEN_PREFIX(`TABLES_NAME')
-]])
-
-/* First, we deal with platform-specific or compiler-specific issues. */
-#if defined(__MidnightBSD__)
-#ifndef __STDC_LIMIT_MACROS
-#define __STDC_LIMIT_MACROS
-#endif
-#include <sys/cdefs.h>
-#include <stdint.h>
-#else
-#define __dead2
-#endif
-
-/* begin standard C headers. */
-%if-c-only
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <stdlib.h>
-%endif
-
-%if-tables-serialization
-#include <sys/types.h>
-#include <netinet/in.h>
-%endif
-/* end standard C headers. */
-
-%if-c-or-c++
-m4preproc_include(`flexint.h')
-%endif
-
-%if-c++-only
-/* begin standard C++ headers. */
-#include <iostream>
-#include <errno.h>
-#include <cstdlib>
-#include <cstdio>
-#include <cstring>
-/* end standard C++ headers. */
-%endif
-
-#ifdef __cplusplus
-
-/* The "const" storage-class-modifier is valid. */
-#define YY_USE_CONST
-
-#else /* ! __cplusplus */
-
-/* C99 requires __STDC__ to be defined as 1. */
-#if defined (__STDC__)
-
-#define YY_USE_CONST
-
-#endif /* defined (__STDC__) */
-#endif /* ! __cplusplus */
-
-#ifdef YY_USE_CONST
-#define yyconst const
-#else
-#define yyconst
-#endif
-
-%# For compilers that can not handle prototypes.
-%# e.g.,
-%# The function prototype
-%# int foo(int x, char* y);
-%#
-%# ...should be written as
-%# int foo M4_YY_PARAMS(int x, char* y);
-%#
-%# ...which could possibly generate
-%# int foo ();
-%#
-m4_ifdef( [[M4_YY_NO_ANSI_FUNC_PROTOS]],
-[[
- m4_define( [[M4_YY_PARAMS]], [[()]])
-]],
-[[
- m4_define( [[M4_YY_PARAMS]], [[($*)]])
-]])
-
-%not-for-header
-/* Returned upon end-of-file. */
-#define YY_NULL 0
-%ok-for-header
-
-%not-for-header
-/* Promotes a possibly negative, possibly signed char to an unsigned
- * integer for use as an array index. If the signed char is negative,
- * we want to instead treat it as an 8-bit unsigned char, hence the
- * double cast.
- */
-#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
-%ok-for-header
-
-
-
-%if-reentrant
-
-/* An opaque pointer. */
-#ifndef YY_TYPEDEF_YY_SCANNER_T
-#define YY_TYPEDEF_YY_SCANNER_T
-typedef void* yyscan_t;
-#endif
-
-%# Declare yyguts variable
-m4_define( [[M4_YY_DECL_GUTS_VAR]], [[struct yyguts_t * yyg = (struct yyguts_t*)yyscanner]])
-%# Perform a noop access on yyguts to prevent unused variable complains
-m4_define( [[M4_YY_NOOP_GUTS_VAR]], [[(void)yyg]])
-%# For use wherever a Global is accessed or assigned.
-m4_define( [[YY_G]], [[yyg->$1]])
-
-%# For use in function prototypes to append the additional argument.
-m4_define( [[M4_YY_PROTO_LAST_ARG]], [[, yyscan_t yyscanner]])
-m4_define( [[M4_YY_PROTO_ONLY_ARG]], [[yyscan_t yyscanner]])
-
-%# For use in function definitions to append the additional argument.
-m4_ifdef( [[M4_YY_NO_ANSI_FUNC_DEFS]],
-[[
- m4_define( [[M4_YY_DEF_LAST_ARG]], [[, yyscanner]])
- m4_define( [[M4_YY_DEF_ONLY_ARG]], [[yyscanner]])
-]],
-[[
- m4_define( [[M4_YY_DEF_LAST_ARG]], [[, yyscan_t yyscanner]])
- m4_define( [[M4_YY_DEF_ONLY_ARG]], [[yyscan_t yyscanner]])
-]])
-m4_define( [[M4_YY_DECL_LAST_ARG]], [[yyscan_t yyscanner;]])
-
-%# For use in function calls to pass the additional argument.
-m4_define( [[M4_YY_CALL_LAST_ARG]], [[, yyscanner]])
-m4_define( [[M4_YY_CALL_ONLY_ARG]], [[yyscanner]])
-
-%# For use in function documentation to adjust for additional argument.
-m4_define( [[M4_YY_DOC_PARAM]], [[@param yyscanner The scanner object.]])
-
-/* For convenience, these vars (plus the bison vars far below)
- are macros in the reentrant scanner. */
-#define yyin YY_G(yyin_r)
-#define yyout YY_G(yyout_r)
-#define yyextra YY_G(yyextra_r)
-#define yyleng YY_G(yyleng_r)
-#define yytext YY_G(yytext_r)
-#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
-#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
-#define yy_flex_debug YY_G(yy_flex_debug_r)
-
-m4_define( [[M4_YY_INCR_LINENO]],
-[[
- do{ yylineno++;
- yycolumn=0;
- }while(0)
-]])
-
-%endif
-
-
-
-%if-not-reentrant
-
-m4_define( [[M4_YY_INCR_LINENO]],
-[[
- yylineno++;
-]])
-
-%# Define these macros to be no-ops.
-m4_define( [[M4_YY_DECL_GUTS_VAR]], [[m4_dnl]])
-m4_define( [[M4_YY_NOOP_GUTS_VAR]], [[m4_dnl]])
-m4_define( [[YY_G]], [[($1)]])
-m4_define( [[M4_YY_PROTO_LAST_ARG]])
-m4_define( [[M4_YY_PROTO_ONLY_ARG]], [[void]])
-m4_define( [[M4_YY_DEF_LAST_ARG]])
-
-m4_ifdef( [[M4_YY_NO_ANSI_FUNC_DEFS]],
-[[
- m4_define( [[M4_YY_DEF_ONLY_ARG]])
-]],
-[[
- m4_define( [[M4_YY_DEF_ONLY_ARG]], [[void]])
-]])
-m4_define([[M4_YY_DECL_LAST_ARG]])
-m4_define([[M4_YY_CALL_LAST_ARG]])
-m4_define([[M4_YY_CALL_ONLY_ARG]])
-m4_define( [[M4_YY_DOC_PARAM]], [[]])
-
-%endif
-
-
-m4_ifdef( [[M4_YY_NO_ANSI_FUNC_DEFS]],
-[[
-%# For compilers that need traditional function definitions.
-%# e.g.,
-%# The function prototype taking 2 arguments
-%# int foo (int x, char* y)
-%#
-%# ...should be written as
-%# int foo YYFARGS2(int,x, char*,y)
-%#
-%# ...which could possibly generate
-%# int foo (x,y,yyscanner)
-%# int x;
-%# char * y;
-%# yyscan_t yyscanner;
-%#
-%# Generate traditional function defs
- m4_define( [[YYFARGS0]], [[(M4_YY_DEF_ONLY_ARG) [[\]]
- M4_YY_DECL_LAST_ARG]])
- m4_define( [[YYFARGS1]], [[($2 M4_YY_DEF_LAST_ARG) [[\]]
- $1 $2; [[\]]
- M4_YY_DECL_LAST_ARG]])
- m4_define( [[YYFARGS2]], [[($2,$4 M4_YY_DEF_LAST_ARG) [[\]]
- $1 $2; [[\]]
- $3 $4; [[\]]
- M4_YY_DECL_LAST_ARG]])
- m4_define( [[YYFARGS3]], [[($2,$4,$6 M4_YY_DEF_LAST_ARG) [[\]]
- $1 $2; [[\]]
- $3 $4; [[\]]
- $5 $6; [[\]]
- M4_YY_DECL_LAST_ARG]])
-]],
-[[
-%# Generate C99 function defs.
- m4_define( [[YYFARGS0]], [[(M4_YY_DEF_ONLY_ARG)]])
- m4_define( [[YYFARGS1]], [[($1 $2 M4_YY_DEF_LAST_ARG)]])
- m4_define( [[YYFARGS2]], [[($1 $2, $3 $4 M4_YY_DEF_LAST_ARG)]])
- m4_define( [[YYFARGS3]], [[($1 $2, $3 $4, $5 $6 M4_YY_DEF_LAST_ARG)]])
-]])
-
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
-/* 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_G(yy_start) = 1 + 2 *
-]])
-
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
-/* 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_G(yy_start) - 1) / 2)
-#define YYSTATE YY_START
-]])
-
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
-/* Action number for EOF rule of a given start state. */
-#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
-]])
-
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
-/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE yyrestart( yyin M4_YY_CALL_LAST_ARG )
-]])
-
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
-#define YY_END_OF_BUFFER_CHAR 0
-]])
-
-/* Size of default input buffer. */
-#ifndef YY_BUF_SIZE
-#define YY_BUF_SIZE 16384
-#endif
-
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
-/* 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
-
-%if-not-reentrant
-extern yy_size_t yyleng;
-%endif
-
-%if-c-only
-%if-not-reentrant
-extern FILE *yyin, *yyout;
-%endif
-%endif
-
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
-#define EOB_ACT_CONTINUE_SCAN 0
-#define EOB_ACT_END_OF_FILE 1
-#define EOB_ACT_LAST_MATCH 2
-]])
-
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
- m4_ifdef( [[M4_YY_USE_LINENO]],
- [[
- /* 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 yylex.
- * One obvious solution it to make yy_act a global. I tried that, and saw
- * a 5% performance hit in a non-yylineno 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 < yyleng; ++yyl )\
- if ( yytext[yyl] == '\n' )\
- --yylineno;\
- }while(0)
- #define YY_LINENO_REWIND_TO(dst) \
- do {\
- const char *p;\
- for ( p = yy_cp-1; p >= (dst); --p)\
- if ( *p == '\n' )\
- --yylineno;\
- }while(0)
- ]],
- [[
- #define YY_LESS_LINENO(n)
- #define YY_LINENO_REWIND_TO(ptr)
- ]])
-]])
-
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
-/* Return all but the first "n" matched characters back to the input stream. */
-#define yyless(n) \
- do \
- { \
- /* Undo effects of setting up yytext. */ \
- int yyless_macro_arg = (n); \
- YY_LESS_LINENO(yyless_macro_arg);\
- *yy_cp = YY_G(yy_hold_char); \
- YY_RESTORE_YY_MORE_OFFSET \
- YY_G(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
- YY_DO_BEFORE_ACTION; /* set up yytext again */ \
- } \
- while ( 0 )
-]])
-
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
-#define unput(c) yyunput( c, YY_G(yytext_ptr) M4_YY_CALL_LAST_ARG )
-]])
-
-#ifndef YY_STRUCT_YY_BUFFER_STATE
-#define YY_STRUCT_YY_BUFFER_STATE
-struct yy_buffer_state
- {
-%if-c-only
- FILE *yy_input_file;
-%endif
-
-%if-c++-only
- std::istream* yy_input_file;
-%endif
-
-
- 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.
- */
- yy_size_t yy_buf_size;
-
- /* Number of characters read into yy_ch_buf, not including EOB
- * characters.
- */
- yy_size_t 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;
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
-#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 yyrestart()), so that the user can continue scanning by
- * just pointing yyin at a new input file.
- */
-#define YY_BUFFER_EOF_PENDING 2
-]])
- };
-#endif /* !YY_STRUCT_YY_BUFFER_STATE */
-
-%if-c-only Standard (non-C++) definition
-%not-for-header
-%if-not-reentrant
-
-/* 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 = 0; /**< Stack as an array. */
-%endif
-%ok-for-header
-%endif
-
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
-/* 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_G(yy_buffer_stack) \
- ? YY_G(yy_buffer_stack)[YY_G(yy_buffer_stack_top)] \
- : NULL)
-]])
-
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
-/* 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_G(yy_buffer_stack)[YY_G(yy_buffer_stack_top)]
-]])
-
-%if-c-only Standard (non-C++) definition
-
-%if-not-reentrant
-%not-for-header
-/* yy_hold_char holds the character lost when yytext is formed. */
-static char yy_hold_char;
-static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
-yy_size_t yyleng;
-
-/* Points to current character in buffer. */
-static char *yy_c_buf_p = (char *) 0;
-static int yy_init = 0; /* whether we need to initialize */
-static int yy_start = 0; /* start state number */
-
-/* Flag which is used to allow yywrap()'s to do buffer switches
- * instead of setting up a fresh yyin. A bit of a hack ...
- */
-static int yy_did_buffer_switch_on_eof;
-%ok-for-header
-%endif
-
-void yyrestart M4_YY_PARAMS( FILE *input_file M4_YY_PROTO_LAST_ARG );
-void yy_switch_to_buffer M4_YY_PARAMS( YY_BUFFER_STATE new_buffer M4_YY_PROTO_LAST_ARG );
-YY_BUFFER_STATE yy_create_buffer M4_YY_PARAMS( FILE *file, int size M4_YY_PROTO_LAST_ARG );
-void yy_delete_buffer M4_YY_PARAMS( YY_BUFFER_STATE b M4_YY_PROTO_LAST_ARG );
-void yy_flush_buffer M4_YY_PARAMS( YY_BUFFER_STATE b M4_YY_PROTO_LAST_ARG );
-void yypush_buffer_state M4_YY_PARAMS( YY_BUFFER_STATE new_buffer M4_YY_PROTO_LAST_ARG );
-void yypop_buffer_state M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
-
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
-static void yyensure_buffer_stack M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
-static void yy_load_buffer_state M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
-static void yy_init_buffer M4_YY_PARAMS( YY_BUFFER_STATE b, FILE *file M4_YY_PROTO_LAST_ARG );
-]])
-
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
-#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER M4_YY_CALL_LAST_ARG)
-]])
-
-YY_BUFFER_STATE yy_scan_buffer M4_YY_PARAMS( char *base, yy_size_t size M4_YY_PROTO_LAST_ARG );
-YY_BUFFER_STATE yy_scan_string M4_YY_PARAMS( yyconst char *yy_str M4_YY_PROTO_LAST_ARG );
-YY_BUFFER_STATE yy_scan_bytes M4_YY_PARAMS( yyconst char *bytes, yy_size_t len M4_YY_PROTO_LAST_ARG );
-
-%endif
-
-void *yyalloc M4_YY_PARAMS( yy_size_t M4_YY_PROTO_LAST_ARG );
-void *yyrealloc M4_YY_PARAMS( void *, yy_size_t M4_YY_PROTO_LAST_ARG );
-void yyfree M4_YY_PARAMS( void * M4_YY_PROTO_LAST_ARG );
-
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
-#define yy_new_buffer yy_create_buffer
-]])
-
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
-#define yy_set_interactive(is_interactive) \
- { \
- if ( ! YY_CURRENT_BUFFER ){ \
- yyensure_buffer_stack (M4_YY_CALL_ONLY_ARG); \
- YY_CURRENT_BUFFER_LVALUE = \
- yy_create_buffer( yyin, YY_BUF_SIZE M4_YY_CALL_LAST_ARG); \
- } \
- YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
- }
-]])
-
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
-#define yy_set_bol(at_bol) \
- { \
- if ( ! YY_CURRENT_BUFFER ){\
- yyensure_buffer_stack (M4_YY_CALL_ONLY_ARG); \
- YY_CURRENT_BUFFER_LVALUE = \
- yy_create_buffer( yyin, YY_BUF_SIZE M4_YY_CALL_LAST_ARG); \
- } \
- YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
- }
-]])
-
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
-#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
-]])
-
-%% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here
-
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
-%% [1.5] DFA
-]])
-
-%if-c-only Standard (non-C++) definition
-
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
-static yy_state_type yy_get_previous_state M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
-static yy_state_type yy_try_NUL_trans M4_YY_PARAMS( yy_state_type current_state M4_YY_PROTO_LAST_ARG);
-static int yy_get_next_buffer M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
-static void yy_fatal_error M4_YY_PARAMS( yyconst char msg[] M4_YY_PROTO_LAST_ARG );
-]])
-
-%endif
-
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
-/* Done after the current pattern has been matched and before the
- * corresponding action - sets up yytext.
- */
-#define YY_DO_BEFORE_ACTION \
- YY_G(yytext_ptr) = yy_bp; \
-%% [2.0] code to fiddle yytext and yyleng for yymore() goes here \
- YY_G(yy_hold_char) = *yy_cp; \
- *yy_cp = '\0'; \
-%% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \
- YY_G(yy_c_buf_p) = yy_cp;
-]])
-
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
-%% [4.0] data tables for the DFA and the user's section 1 definitions go here
-]])
-
-m4_ifdef( [[M4_YY_IN_HEADER]], [[#ifdef YY_HEADER_EXPORT_START_CONDITIONS]])
-M4_YY_SC_DEFS
-m4_ifdef( [[M4_YY_IN_HEADER]], [[#endif]])
-
-m4_ifdef( [[M4_YY_NO_UNISTD_H]],,
-[[
-#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.
- */
-%if-c-only
-#include <unistd.h>
-%endif
-%if-c++-only
-#include <unistd.h>
-%endif
-#endif
-]])
-
-m4_ifdef( [[M4_EXTRA_TYPE_DEFS]],
-[[
-#define YY_EXTRA_TYPE M4_EXTRA_TYPE_DEFS
-]],
-[[
-#ifndef YY_EXTRA_TYPE
-#define YY_EXTRA_TYPE void *
-#endif
-]]
-)
-
-%if-c-only Reentrant structure and macros (non-C++).
-%if-reentrant
-
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
-/* Holds the entire state of the reentrant scanner. */
-struct yyguts_t
- {
-
- /* User-defined. Not touched by flex. */
- YY_EXTRA_TYPE yyextra_r;
-
- /* The rest are the same as the globals declared in the non-reentrant scanner. */
- FILE *yyin_r, *yyout_r;
- size_t yy_buffer_stack_top; /**< index of top of stack. */
- size_t yy_buffer_stack_max; /**< capacity of stack. */
- YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
- char yy_hold_char;
- yy_size_t yy_n_chars;
- yy_size_t yyleng_r;
- char *yy_c_buf_p;
- int yy_init;
- int yy_start;
- int yy_did_buffer_switch_on_eof;
- int yy_start_stack_ptr;
- int yy_start_stack_depth;
- int *yy_start_stack;
- yy_state_type yy_last_accepting_state;
- char* yy_last_accepting_cpos;
-
- int yylineno_r;
- int yy_flex_debug_r;
-
-m4_ifdef( [[M4_YY_USES_REJECT]],
-[[
- yy_state_type *yy_state_buf;
- yy_state_type *yy_state_ptr;
- char *yy_full_match;
- int yy_lp;
-
- /* These are only needed for trailing context rules,
- * but there's no conditional variable for that yet. */
- int yy_looking_for_trail_begin;
- int yy_full_lp;
- int *yy_full_state;
-]])
-
-m4_ifdef( [[M4_YY_TEXT_IS_ARRAY]],
-[[
- char yytext_r[YYLMAX];
- char *yytext_ptr;
- int yy_more_offset;
- int yy_prev_more_offset;
-]],
-[[
- char *yytext_r;
- int yy_more_flag;
- int yy_more_len;
-]])
-
-m4_ifdef( [[M4_YY_BISON_LVAL]],
-[[
- YYSTYPE * yylval_r;
-]])
-
-m4_ifdef( [[<M4_YY_BISON_LLOC>]],
-[[
- YYLTYPE * yylloc_r;
-]])
-
- }; /* end struct yyguts_t */
-]])
-
-
-%if-c-only
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
-static int yy_init_globals M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
-]])
-%endif
-
-%if-reentrant
-
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
- m4_ifdef( [[M4_YY_BISON_LVAL]],
- [[
- /* This must go here because YYSTYPE and YYLTYPE are included
- * from bison output in section 1.*/
- # define yylval YY_G(yylval_r)
- ]])
-
- m4_ifdef( [[<M4_YY_BISON_LLOC>]],
- [[
- # define yylloc YY_G(yylloc_r)
- ]])
-]])
-
-int yylex_init M4_YY_PARAMS(yyscan_t* scanner);
-
-int yylex_init_extra M4_YY_PARAMS( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
-
-%endif
-
-%endif End reentrant structures and macros.
-
-/* Accessor methods to globals.
- These are made visible to non-reentrant scanners for convenience. */
-
-m4_ifdef( [[M4_YY_NO_DESTROY]],,
-[[
-int yylex_destroy M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
-]])
-
-m4_ifdef( [[M4_YY_NO_GET_DEBUG]],,
-[[
-int yyget_debug M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
-]])
-
-m4_ifdef( [[M4_YY_NO_SET_DEBUG]],,
-[[
-void yyset_debug M4_YY_PARAMS( int debug_flag M4_YY_PROTO_LAST_ARG );
-]])
-
-m4_ifdef( [[M4_YY_NO_GET_EXTRA]],,
-[[
-YY_EXTRA_TYPE yyget_extra M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
-]])
-
-m4_ifdef( [[M4_YY_NO_SET_EXTRA]],,
-[[
-void yyset_extra M4_YY_PARAMS( YY_EXTRA_TYPE user_defined M4_YY_PROTO_LAST_ARG );
-]])
-
-m4_ifdef( [[M4_YY_NO_GET_IN]],,
-[[
-FILE *yyget_in M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
-]])
-
-m4_ifdef( [[M4_YY_NO_SET_IN]],,
-[[
-void yyset_in M4_YY_PARAMS( FILE * in_str M4_YY_PROTO_LAST_ARG );
-]])
-
-m4_ifdef( [[M4_YY_NO_GET_OUT]],,
-[[
-FILE *yyget_out M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
-]])
-
-m4_ifdef( [[M4_YY_NO_SET_OUT]],,
-[[
-void yyset_out M4_YY_PARAMS( FILE * out_str M4_YY_PROTO_LAST_ARG );
-]])
-
-m4_ifdef( [[M4_YY_NO_GET_LENG]],,
-[[
-yy_size_t yyget_leng M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
-]])
-
-m4_ifdef( [[M4_YY_NO_GET_TEXT]],,
-[[
-char *yyget_text M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
-]])
-
-m4_ifdef( [[M4_YY_NO_GET_LINENO]],,
-[[
-int yyget_lineno M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
-]])
-
-m4_ifdef( [[M4_YY_NO_SET_LINENO]],,
-[[
-void yyset_lineno M4_YY_PARAMS( int line_number M4_YY_PROTO_LAST_ARG );
-]])
-
-m4_ifdef( [[M4_YY_REENTRANT]],
-[[
-m4_ifdef( [[M4_YY_NO_GET_COLUMN]],,
-[[
-int yyget_column M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
-]])
-]])
-
-m4_ifdef( [[M4_YY_REENTRANT]],
-[[
-m4_ifdef( [[M4_YY_NO_SET_COLUMN]],,
-[[
-void yyset_column M4_YY_PARAMS( int column_no M4_YY_PROTO_LAST_ARG );
-]])
-]])
-
-%if-bison-bridge
-m4_ifdef( [[M4_YY_NO_GET_LVAL]],,
-[[
-YYSTYPE * yyget_lval M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
-]])
-
-void yyset_lval M4_YY_PARAMS( YYSTYPE * yylval_param M4_YY_PROTO_LAST_ARG );
-
-m4_ifdef( [[<M4_YY_BISON_LLOC>]],
-[[
- m4_ifdef( [[M4_YY_NO_GET_LLOC]],,
- [[
- YYLTYPE *yyget_lloc M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
- ]])
-
- m4_ifdef( [[M4_YY_NO_SET_LLOC]],,
- [[
- void yyset_lloc M4_YY_PARAMS( YYLTYPE * yylloc_param M4_YY_PROTO_LAST_ARG );
- ]])
-]])
-%endif
-
-/* Macros after this point can all be overridden by user definitions in
- * section 1.
- */
-
-#ifndef YY_SKIP_YYWRAP
-#ifdef __cplusplus
-extern "C" int yywrap M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
-#else
-extern int yywrap M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
-#endif
-#endif
-
-%not-for-header
- m4_ifdef( [[M4_YY_NO_UNPUT]],,
- [[
-#ifndef YY_NO_UNPUT
- static void yyunput M4_YY_PARAMS( int c, char *buf_ptr M4_YY_PROTO_LAST_ARG);
-#endif
- ]])
-%ok-for-header
-%endif
-
-#ifndef yytext_ptr
-static void yy_flex_strncpy M4_YY_PARAMS( char *, yyconst char *, int M4_YY_PROTO_LAST_ARG);
-#endif
-
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen M4_YY_PARAMS( yyconst char * M4_YY_PROTO_LAST_ARG);
-#endif
-
-#ifndef YY_NO_INPUT
-%if-c-only Standard (non-C++) definition
-%not-for-header
-#ifdef __cplusplus
-static int yyinput M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
-#else
-static int input M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
-#endif
-%ok-for-header
-%endif
-#endif
-
-
-%if-c-only
-%# TODO: This is messy.
-m4_ifdef( [[M4_YY_STACK_USED]],
-[[
-
-m4_ifdef( [[M4_YY_NOT_REENTRANT]],
-[[
- m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
- [[
- static int yy_start_stack_ptr = 0;
- static int yy_start_stack_depth = 0;
- static int *yy_start_stack = NULL;
- ]])
-]])
-
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
- m4_ifdef( [[M4_YY_NO_PUSH_STATE]],,
- [[
- static void yy_push_state M4_YY_PARAMS( int new_state M4_YY_PROTO_LAST_ARG);
- ]])
- m4_ifdef( [[M4_YY_NO_POP_STATE]],,
- [[
- static void yy_pop_state M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
- ]])
- m4_ifdef( [[M4_YY_NO_TOP_STATE]],,
- [[
- static int yy_top_state M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
- ]])
-]])
-
-]],
-[[
-m4_define( [[M4_YY_NO_PUSH_STATE]])
-m4_define( [[M4_YY_NO_POP_STATE]])
-m4_define( [[M4_YY_NO_TOP_STATE]])
-]])
-%endif
-
-/* Amount of stuff to slurp up with each read. */
-#ifndef YY_READ_BUF_SIZE
-#define YY_READ_BUF_SIZE 8192
-#endif
-
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
-/* Copy whatever the last rule matched to the standard output. */
-#ifndef ECHO
-%if-c-only Standard (non-C++) definition
-/* This used to be an fputs(), but since the string might contain NUL's,
- * we now use fwrite().
- */
-#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
-%endif
-%if-c++-only C++ definition
-#define ECHO LexerOutput( yytext, yyleng )
-%endif
-#endif
-]])
-
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
-/* 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) \
-%% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \
-\
-%if-c++-only C++ definition \
- if ( (result = LexerInput( (char *) buf, max_size )) < 0 ) \
- YY_FATAL_ERROR( "input in flex scanner failed" );
-%endif
-
-#endif
-]])
-
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
-/* 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
-
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
-/* Report a fatal error. */
-#ifndef YY_FATAL_ERROR
-%if-c-only
-#define YY_FATAL_ERROR(msg) yy_fatal_error( msg M4_YY_CALL_LAST_ARG)
-%endif
-%if-c++-only
-#define YY_FATAL_ERROR(msg) LexerError( msg )
-%endif
-#endif
-]])
-
-%if-tables-serialization structures and prototypes
-m4preproc_include(`tables_shared.h')
-
-/* Load the DFA tables from the given stream. */
-int yytables_fload M4_YY_PARAMS(FILE * fp M4_YY_PROTO_LAST_ARG);
-
-/* Unload the tables from memory. */
-int yytables_destroy M4_YY_PARAMS(M4_YY_PROTO_ONLY_ARG);
-%not-for-header
-
-/** Describes a mapping from a serialized table id to its deserialized state in
- * this scanner. This is the bridge between our "generic" deserialization code
- * and the specifics of this scanner.
- */
-struct yytbl_dmap {
- enum yytbl_id dm_id;/**< table identifier */
- void **dm_arr; /**< address of pointer to store the deserialized table. */
- size_t dm_sz; /**< local sizeof() each element in table. */
-};
-
-/** A {0,0,0}-terminated list of structs, forming the map */
-static struct yytbl_dmap yydmap[] =
-{
-%tables-yydmap generated elements
- {0,0,0}
-};
-
-/** A tables-reader object to maintain some state in the read. */
-struct yytbl_reader {
- FILE * fp; /**< input stream */
- flex_uint32_t bread; /**< bytes read since beginning of current tableset */
-};
-
-%endif
-/* end tables serialization structures and prototypes */
-
-%ok-for-header
-
-/* Default declaration of generated scanner - a define so the user can
- * easily add parameters.
- */
-#ifndef YY_DECL
-#define YY_DECL_IS_OURS 1
-%if-c-only Standard (non-C++) definition
-
-
-m4_define( [[M4_YY_LEX_PROTO]], [[M4_YY_PARAMS(M4_YY_PROTO_ONLY_ARG)]])
-m4_define( [[M4_YY_LEX_DECLARATION]], [[YYFARGS0(void)]])
-
-m4_ifdef( [[M4_YY_BISON_LVAL]],
-[[
- m4_dnl The bison pure parser is used. Redefine yylex to
- m4_dnl accept the lval parameter.
-
- m4_define( [[M4_YY_LEX_PROTO]], [[\]]
- [[M4_YY_PARAMS(YYSTYPE * yylval_param M4_YY_PROTO_LAST_ARG)]])
- m4_define( [[M4_YY_LEX_DECLARATION]], [[\]]
- [[YYFARGS1(YYSTYPE *,yylval_param)]])
-]])
-
-m4_ifdef( [[<M4_YY_BISON_LLOC>]],
-[[
- m4_dnl Locations are used. yylex should also accept the ylloc parameter.
-
- m4_define( [[M4_YY_LEX_PROTO]], [[\]]
- [[M4_YY_PARAMS(YYSTYPE * yylval_param, YYLTYPE * yylloc_param M4_YY_PROTO_LAST_ARG)]])
- m4_define( [[M4_YY_LEX_DECLARATION]], [[\]]
- [[YYFARGS2(YYSTYPE *,yylval_param, YYLTYPE *,yylloc_param)]])
-]])
-
-extern int yylex M4_YY_LEX_PROTO;
-
-#define YY_DECL int yylex M4_YY_LEX_DECLARATION
-%endif
-%if-c++-only C++ definition
-#define YY_DECL int yyFlexLexer::yylex()
-%endif
-#endif /* !YY_DECL */
-
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
-/* Code executed at the beginning of each rule, after yytext and yyleng
- * have been set up.
- */
-#ifndef YY_USER_ACTION
-#define YY_USER_ACTION
-#endif
-]])
-
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
-/* Code executed at the end of each rule. */
-#ifndef YY_BREAK
-#define YY_BREAK break;
-#endif
-]])
-
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
-%% [6.0] YY_RULE_SETUP definition goes here
-]])
-
-%not-for-header
-/** The main scanner function which does all the work.
- */
-YY_DECL
-{
- register yy_state_type yy_current_state;
- register char *yy_cp, *yy_bp;
- register int yy_act;
- M4_YY_DECL_GUTS_VAR();
-
-m4_ifdef( [[M4_YY_NOT_REENTRANT]],
-[[
- m4_ifdef( [[M4_YY_BISON_LVAL]],
- [[
- YYSTYPE * yylval;
- ]])
- m4_ifdef( [[<M4_YY_BISON_LLOC>]],
- [[
- YYLTYPE * yylloc;
- ]])
-]])
-
-m4_ifdef( [[M4_YY_BISON_LVAL]],
-[[
- yylval = yylval_param;
-]])
-
-m4_ifdef( [[<M4_YY_BISON_LLOC>]],
-[[
- yylloc = yylloc_param;
-]])
-
- if ( !YY_G(yy_init) )
- {
- YY_G(yy_init) = 1;
-
-#ifdef YY_USER_INIT
- YY_USER_INIT;
-#endif
-
-m4_ifdef( [[M4_YY_USES_REJECT]],
-[[
- /* Create the reject buffer large enough to save one state per allowed character. */
- if ( ! YY_G(yy_state_buf) )
- YY_G(yy_state_buf) = (yy_state_type *)yyalloc(YY_STATE_BUF_SIZE M4_YY_CALL_LAST_ARG);
- if ( ! YY_G(yy_state_buf) )
- YY_FATAL_ERROR( "out of dynamic memory in yylex()" );
-]])
-
- if ( ! YY_G(yy_start) )
- YY_G(yy_start) = 1; /* first start state */
-
- if ( ! yyin )
-%if-c-only
- yyin = stdin;
-%endif
-%if-c++-only
- yyin = & std::cin;
-%endif
-
- if ( ! yyout )
-%if-c-only
- yyout = stdout;
-%endif
-%if-c++-only
- yyout = & std::cout;
-%endif
-
- if ( ! YY_CURRENT_BUFFER ) {
- yyensure_buffer_stack (M4_YY_CALL_ONLY_ARG);
- YY_CURRENT_BUFFER_LVALUE =
- yy_create_buffer( yyin, YY_BUF_SIZE M4_YY_CALL_LAST_ARG);
- }
-
- yy_load_buffer_state( M4_YY_CALL_ONLY_ARG );
- }
-
- {
-%% [7.0] user's declarations go here
-
- while ( 1 ) /* loops until end-of-file is reached */
- {
-%% [8.0] yymore()-related code goes here
- yy_cp = YY_G(yy_c_buf_p);
-
- /* Support of yytext. */
- *yy_cp = YY_G(yy_hold_char);
-
- /* yy_bp points to the position in yy_ch_buf of the start of
- * the current run.
- */
- yy_bp = yy_cp;
-
-%% [9.0] code to set up and find next match goes here
-
-yy_find_action:
-%% [10.0] code to find the action number goes here
-
- YY_DO_BEFORE_ACTION;
-
-%% [11.0] code for yylineno update goes here
-
-do_action: /* This label is used only to access EOF actions. */
-
-%% [12.0] debug code goes here
-
- switch ( yy_act )
- { /* beginning of action switch */
-%% [13.0] actions go here
-
- case YY_END_OF_BUFFER:
- {
- /* Amount of text matched not including the EOB char. */
- int yy_amount_of_matched_text = (int) (yy_cp - YY_G(yytext_ptr)) - 1;
-
- /* Undo the effects of YY_DO_BEFORE_ACTION. */
- *yy_cp = YY_G(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 yyin at a new source and called
- * yylex(). 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_G(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
- YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
- 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_G(yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(yy_n_chars)] )
- { /* This was really a NUL. */
- yy_state_type yy_next_state;
-
- YY_G(yy_c_buf_p) = YY_G(yytext_ptr) + yy_amount_of_matched_text;
-
- yy_current_state = yy_get_previous_state( M4_YY_CALL_ONLY_ARG );
-
- /* 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 M4_YY_CALL_LAST_ARG);
-
- yy_bp = YY_G(yytext_ptr) + YY_MORE_ADJ;
-
- if ( yy_next_state )
- {
- /* Consume the NUL. */
- yy_cp = ++YY_G(yy_c_buf_p);
- yy_current_state = yy_next_state;
- goto yy_match;
- }
-
- else
- {
-%% [14.0] code to do back-up for compressed tables and set up yy_cp goes here
- goto yy_find_action;
- }
- }
-
- else switch ( yy_get_next_buffer( M4_YY_CALL_ONLY_ARG ) )
- {
- case EOB_ACT_END_OF_FILE:
- {
- YY_G(yy_did_buffer_switch_on_eof) = 0;
-
- if ( yywrap( M4_YY_CALL_ONLY_ARG ) )
- {
- /* Note: because we've taken care in
- * yy_get_next_buffer() to have set up
- * yytext, 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_G(yy_c_buf_p) = YY_G(yytext_ptr) + YY_MORE_ADJ;
-
- yy_act = YY_STATE_EOF(YY_START);
- goto do_action;
- }
-
- else
- {
- if ( ! YY_G(yy_did_buffer_switch_on_eof) )
- YY_NEW_FILE;
- }
- break;
- }
-
- case EOB_ACT_CONTINUE_SCAN:
- YY_G(yy_c_buf_p) =
- YY_G(yytext_ptr) + yy_amount_of_matched_text;
-
- yy_current_state = yy_get_previous_state( M4_YY_CALL_ONLY_ARG );
-
- yy_cp = YY_G(yy_c_buf_p);
- yy_bp = YY_G(yytext_ptr) + YY_MORE_ADJ;
- goto yy_match;
-
- case EOB_ACT_LAST_MATCH:
- YY_G(yy_c_buf_p) =
- &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(yy_n_chars)];
-
- yy_current_state = yy_get_previous_state( M4_YY_CALL_ONLY_ARG );
-
- yy_cp = YY_G(yy_c_buf_p);
- yy_bp = YY_G(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 yylex */
-%ok-for-header
-
-%if-c++-only
-%not-for-header
-/* The contents of this function are C++ specific, so the YY_G macro is not used.
- */
-yyFlexLexer::yyFlexLexer( std::istream* arg_yyin, std::ostream* arg_yyout )
-{
- yyin = arg_yyin;
- yyout = arg_yyout;
- yy_c_buf_p = 0;
- yy_init = 0;
- yy_start = 0;
- yy_flex_debug = 0;
- yylineno = 1; // this will only get updated if %option yylineno
-
- yy_did_buffer_switch_on_eof = 0;
-
- yy_looking_for_trail_begin = 0;
- yy_more_flag = 0;
- yy_more_len = 0;
- yy_more_offset = yy_prev_more_offset = 0;
-
- yy_start_stack_ptr = yy_start_stack_depth = 0;
- yy_start_stack = NULL;
-
- yy_buffer_stack = 0;
- yy_buffer_stack_top = 0;
- yy_buffer_stack_max = 0;
-
-
-m4_ifdef( [[M4_YY_USES_REJECT]],
-[[
- yy_state_buf = new yy_state_type[YY_STATE_BUF_SIZE];
-]],
-[[
- yy_state_buf = 0;
-]])
-}
-
-/* The contents of this function are C++ specific, so the YY_G macro is not used.
- */
-yyFlexLexer::~yyFlexLexer()
-{
- delete [] yy_state_buf;
- yyfree( yy_start_stack M4_YY_CALL_LAST_ARG );
- yy_delete_buffer( YY_CURRENT_BUFFER M4_YY_CALL_LAST_ARG);
- yyfree( yy_buffer_stack M4_YY_CALL_LAST_ARG );
-}
-
-/* The contents of this function are C++ specific, so the YY_G macro is not used.
- */
-void yyFlexLexer::switch_streams( std::istream* new_in, std::ostream* new_out )
-{
- if ( new_in )
- {
- yy_delete_buffer( YY_CURRENT_BUFFER M4_YY_CALL_LAST_ARG);
- yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE M4_YY_CALL_LAST_ARG) M4_YY_CALL_LAST_ARG);
- }
-
- if ( new_out )
- yyout = new_out;
-}
-
-#ifdef YY_INTERACTIVE
-int yyFlexLexer::LexerInput( char* buf, int /* max_size */ )
-#else
-int yyFlexLexer::LexerInput( char* buf, int max_size )
-#endif
-{
- if ( yyin->eof() || yyin->fail() )
- return 0;
-
-#ifdef YY_INTERACTIVE
- yyin->get( buf[0] );
-
- if ( yyin->eof() )
- return 0;
-
- if ( yyin->bad() )
- return -1;
-
- return 1;
-
-#else
- (void) yyin->read( buf, max_size );
-
- if ( yyin->bad() )
- return -1;
- else
- return yyin->gcount();
-#endif
-}
-
-void yyFlexLexer::LexerOutput( const char* buf, int size )
-{
- (void) yyout->write( buf, size );
-}
-%ok-for-header
-%endif
-
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
-/* 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
- */
-%if-c-only
-static int yy_get_next_buffer YYFARGS0(void)
-%endif
-%if-c++-only
-int yyFlexLexer::yy_get_next_buffer()
-%endif
-{
- M4_YY_DECL_GUTS_VAR();
- register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
- register char *source = YY_G(yytext_ptr);
- register int number_to_move, i;
- int ret_val;
-
- if ( YY_G(yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(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_G(yy_c_buf_p) - YY_G(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_G(yy_c_buf_p) - YY_G(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_G(yy_n_chars) = 0;
-
- else
- {
- yy_size_t 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. */
-m4_ifdef( [[M4_YY_USES_REJECT]],
-[[
- YY_FATAL_ERROR(
-"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
-]],
-[[
- /* just a shorter name for the current buffer */
- YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
-
- int yy_c_buf_p_offset =
- (int) (YY_G(yy_c_buf_p) - b->yy_ch_buf);
-
- if ( b->yy_is_our_buffer )
- {
- yy_size_t 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. */
- yyrealloc( (void *) b->yy_ch_buf,
- b->yy_buf_size + 2 M4_YY_CALL_LAST_ARG );
- }
- else
- /* Can't grow it, we don't own it. */
- b->yy_ch_buf = 0;
-
- if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR(
- "fatal error - scanner input buffer overflow" );
-
- YY_G(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_G(yy_n_chars), num_to_read );
-
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = YY_G(yy_n_chars);
- }
-
- if ( YY_G(yy_n_chars) == 0 )
- {
- if ( number_to_move == YY_MORE_ADJ )
- {
- ret_val = EOB_ACT_END_OF_FILE;
- yyrestart( yyin M4_YY_CALL_LAST_ARG);
- }
-
- 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_size_t) (YY_G(yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
- /* Extend the array by 50%, plus the number we really need. */
- yy_size_t new_size = YY_G(yy_n_chars) + number_to_move + (YY_G(yy_n_chars) >> 1);
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
- (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, new_size M4_YY_CALL_LAST_ARG );
- if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
- }
-
- YY_G(yy_n_chars) += number_to_move;
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
-
- YY_G(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 */
-
-%if-c-only
-%not-for-header
- static yy_state_type yy_get_previous_state YYFARGS0(void)
-%endif
-%if-c++-only
- yy_state_type yyFlexLexer::yy_get_previous_state()
-%endif
-{
- register yy_state_type yy_current_state;
- register char *yy_cp;
- M4_YY_DECL_GUTS_VAR();
-
-%% [15.0] code to get the start state into yy_current_state goes here
-
- for ( yy_cp = YY_G(yytext_ptr) + YY_MORE_ADJ; yy_cp < YY_G(yy_c_buf_p); ++yy_cp )
- {
-%% [16.0] code to find the next state goes here
- }
-
- 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 );
- */
-%if-c-only
- static yy_state_type yy_try_NUL_trans YYFARGS1( yy_state_type, yy_current_state)
-%endif
-%if-c++-only
- yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state )
-%endif
-{
- register int yy_is_jam;
- M4_YY_DECL_GUTS_VAR(); /* This var may be unused depending upon options. */
-%% [17.0] code to find the next state, and perhaps do backing up, goes here
-
- M4_YY_NOOP_GUTS_VAR();
- return yy_is_jam ? 0 : yy_current_state;
-}
-
-
-%if-c-only
-m4_ifdef( [[M4_YY_NO_UNPUT]],,
-[[
-#ifndef YY_NO_UNPUT
- static void yyunput YYFARGS2( int,c, register char *,yy_bp)
-%endif
-%if-c++-only
-#ifndef YY_NO_UNPUT
- void yyFlexLexer::yyunput( int c, register char* yy_bp)
-%endif
-{
- register char *yy_cp;
- M4_YY_DECL_GUTS_VAR();
-
- yy_cp = YY_G(yy_c_buf_p);
-
- /* undo effects of setting up yytext */
- *yy_cp = YY_G(yy_hold_char);
-
- if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
- { /* need to shift things up to make room */
- /* +2 for EOB chars. */
- register yy_size_t number_to_move = YY_G(yy_n_chars) + 2;
- register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
- YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
- register char *source =
- &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
-
- while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
- *--dest = *--source;
-
- yy_cp += (int) (dest - source);
- yy_bp += (int) (dest - source);
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
- YY_G(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
-
- if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
- YY_FATAL_ERROR( "flex scanner push-back overflow" );
- }
-
- *--yy_cp = (char) c;
-
-%% [18.0] update yylineno here
-m4_ifdef( [[M4_YY_USE_LINENO]],
-[[
- if ( c == '\n' ){
- --yylineno;
- }
-]])
- YY_G(yytext_ptr) = yy_bp;
- YY_G(yy_hold_char) = *yy_cp;
- YY_G(yy_c_buf_p) = yy_cp;
-}
-#endif /* ifndef YY_NO_UNPUT */
-%if-c-only
-]])
-%endif
-
-%if-c-only
-#ifndef YY_NO_INPUT
-#ifdef __cplusplus
- static int yyinput YYFARGS0(void)
-#else
- static int input YYFARGS0(void)
-#endif
-
-%endif
-%if-c++-only
- int yyFlexLexer::yyinput()
-%endif
-{
- int c;
- M4_YY_DECL_GUTS_VAR();
-
- *YY_G(yy_c_buf_p) = YY_G(yy_hold_char);
-
- if ( *YY_G(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_G(yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(yy_n_chars)] )
- /* This was really a NUL. */
- *YY_G(yy_c_buf_p) = '\0';
-
- else
- { /* need more input */
- yy_size_t offset = YY_G(yy_c_buf_p) - YY_G(yytext_ptr);
- ++YY_G(yy_c_buf_p);
-
- switch ( yy_get_next_buffer( M4_YY_CALL_ONLY_ARG ) )
- {
- 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. */
- yyrestart( yyin M4_YY_CALL_LAST_ARG);
-
- /*FALLTHROUGH*/
-
- case EOB_ACT_END_OF_FILE:
- {
- if ( yywrap( M4_YY_CALL_ONLY_ARG ) )
- return EOF;
-
- if ( ! YY_G(yy_did_buffer_switch_on_eof) )
- YY_NEW_FILE;
-#ifdef __cplusplus
- return yyinput(M4_YY_CALL_ONLY_ARG);
-#else
- return input(M4_YY_CALL_ONLY_ARG);
-#endif
- }
-
- case EOB_ACT_CONTINUE_SCAN:
- YY_G(yy_c_buf_p) = YY_G(yytext_ptr) + offset;
- break;
- }
- }
- }
-
- c = *(unsigned char *) YY_G(yy_c_buf_p); /* cast for 8-bit char's */
- *YY_G(yy_c_buf_p) = '\0'; /* preserve yytext */
- YY_G(yy_hold_char) = *++YY_G(yy_c_buf_p);
-
-%% [19.0] update BOL and yylineno
-
- return c;
-}
-%if-c-only
-#endif /* ifndef YY_NO_INPUT */
-%endif
-
-/** Immediately switch to a different input stream.
- * @param input_file A readable stream.
- * M4_YY_DOC_PARAM
- * @note This function does not reset the start condition to @c INITIAL .
- */
-%if-c-only
- void yyrestart YYFARGS1( FILE *,input_file)
-%endif
-%if-c++-only
- void yyFlexLexer::yyrestart( std::istream* input_file )
-%endif
-{
- M4_YY_DECL_GUTS_VAR();
-
- if ( ! YY_CURRENT_BUFFER ){
- yyensure_buffer_stack (M4_YY_CALL_ONLY_ARG);
- YY_CURRENT_BUFFER_LVALUE =
- yy_create_buffer( yyin, YY_BUF_SIZE M4_YY_CALL_LAST_ARG);
- }
-
- yy_init_buffer( YY_CURRENT_BUFFER, input_file M4_YY_CALL_LAST_ARG);
- yy_load_buffer_state( M4_YY_CALL_ONLY_ARG );
-}
-
-/** Switch to a different input buffer.
- * @param new_buffer The new input buffer.
- * M4_YY_DOC_PARAM
- */
-%if-c-only
- void yy_switch_to_buffer YYFARGS1( YY_BUFFER_STATE ,new_buffer)
-%endif
-%if-c++-only
- void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
-%endif
-{
- M4_YY_DECL_GUTS_VAR();
-
- /* TODO. We should be able to replace this entire function body
- * with
- * yypop_buffer_state();
- * yypush_buffer_state(new_buffer);
- */
- yyensure_buffer_stack (M4_YY_CALL_ONLY_ARG);
- if ( YY_CURRENT_BUFFER == new_buffer )
- return;
-
- if ( YY_CURRENT_BUFFER )
- {
- /* Flush out information for old buffer. */
- *YY_G(yy_c_buf_p) = YY_G(yy_hold_char);
- YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = YY_G(yy_c_buf_p);
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = YY_G(yy_n_chars);
- }
-
- YY_CURRENT_BUFFER_LVALUE = new_buffer;
- yy_load_buffer_state( M4_YY_CALL_ONLY_ARG );
-
- /* We don't actually know whether we did this switch during
- * EOF (yywrap()) processing, but the only time this flag
- * is looked at is after yywrap() is called, so it's safe
- * to go ahead and always set it.
- */
- YY_G(yy_did_buffer_switch_on_eof) = 1;
-}
-
-
-%if-c-only
-static void yy_load_buffer_state YYFARGS0(void)
-%endif
-%if-c++-only
- void yyFlexLexer::yy_load_buffer_state()
-%endif
-{
- M4_YY_DECL_GUTS_VAR();
- YY_G(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
- YY_G(yytext_ptr) = YY_G(yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
- yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
- YY_G(yy_hold_char) = *YY_G(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.
- * M4_YY_DOC_PARAM
- * @return the allocated buffer state.
- */
-%if-c-only
- YY_BUFFER_STATE yy_create_buffer YYFARGS2( FILE *,file, int ,size)
-%endif
-%if-c++-only
- YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream* file, int size )
-%endif
-{
- YY_BUFFER_STATE b;
- m4_dnl M4_YY_DECL_GUTS_VAR();
-
- b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) M4_YY_CALL_LAST_ARG );
- if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in yy_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 *) yyalloc( b->yy_buf_size + 2 M4_YY_CALL_LAST_ARG );
- if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
-
- b->yy_is_our_buffer = 1;
-
- yy_init_buffer( b, file M4_YY_CALL_LAST_ARG);
-
- return b;
-}
-
-/** Destroy the buffer.
- * @param b a buffer created with yy_create_buffer()
- * M4_YY_DOC_PARAM
- */
-%if-c-only
- void yy_delete_buffer YYFARGS1( YY_BUFFER_STATE ,b)
-%endif
-%if-c++-only
- void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b )
-%endif
-{
- M4_YY_DECL_GUTS_VAR();
-
- 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 )
- yyfree( (void *) b->yy_ch_buf M4_YY_CALL_LAST_ARG );
-
- yyfree( (void *) b M4_YY_CALL_LAST_ARG );
-}
-
-
-/* Initializes or reinitializes a buffer.
- * This function is sometimes called more than once on the same buffer,
- * such as during a yyrestart() or at EOF.
- */
-%if-c-only
- static void yy_init_buffer YYFARGS2( YY_BUFFER_STATE ,b, FILE *,file)
-%endif
-%if-c++-only
- void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, std::istream* file )
-%endif
-
-{
- int oerrno = errno;
- M4_YY_DECL_GUTS_VAR();
-
- yy_flush_buffer( b M4_YY_CALL_LAST_ARG);
-
- b->yy_input_file = file;
- b->yy_fill_buffer = 1;
-
- /* If b is the current buffer, then yy_init_buffer was _probably_
- * called from yyrestart() 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;
- }
-
-%if-c-only
-m4_ifdef( [[M4_YY_ALWAYS_INTERACTIVE]],
-[[
- b->yy_is_interactive = 1;
-]],
-[[
- m4_ifdef( [[M4_YY_NEVER_INTERACTIVE]],
- [[
- b->yy_is_interactive = 0;
- ]],
- [[
- b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
- ]])
-]])
-%endif
-%if-c++-only
- b->yy_is_interactive = 0;
-%endif
- 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.
- * M4_YY_DOC_PARAM
- */
-%if-c-only
- void yy_flush_buffer YYFARGS1( YY_BUFFER_STATE ,b)
-%endif
-%if-c++-only
- void yyFlexLexer::yy_flush_buffer( YY_BUFFER_STATE b )
-%endif
-{
- M4_YY_DECL_GUTS_VAR();
- 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 )
- yy_load_buffer_state( M4_YY_CALL_ONLY_ARG );
-}
-
-%if-c-or-c++
-/** 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.
- * M4_YY_DOC_PARAM
- */
-%if-c-only
-void yypush_buffer_state YYFARGS1(YY_BUFFER_STATE,new_buffer)
-%endif
-%if-c++-only
-void yyFlexLexer::yypush_buffer_state (YY_BUFFER_STATE new_buffer)
-%endif
-{
- M4_YY_DECL_GUTS_VAR();
- if (new_buffer == NULL)
- return;
-
- yyensure_buffer_stack(M4_YY_CALL_ONLY_ARG);
-
- /* This block is copied from yy_switch_to_buffer. */
- if ( YY_CURRENT_BUFFER )
- {
- /* Flush out information for old buffer. */
- *YY_G(yy_c_buf_p) = YY_G(yy_hold_char);
- YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = YY_G(yy_c_buf_p);
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = YY_G(yy_n_chars);
- }
-
- /* Only push if top exists. Otherwise, replace top. */
- if (YY_CURRENT_BUFFER)
- YY_G(yy_buffer_stack_top)++;
- YY_CURRENT_BUFFER_LVALUE = new_buffer;
-
- /* copied from yy_switch_to_buffer. */
- yy_load_buffer_state( M4_YY_CALL_ONLY_ARG );
- YY_G(yy_did_buffer_switch_on_eof) = 1;
-}
-%endif
-
-
-%if-c-or-c++
-/** Removes and deletes the top of the stack, if present.
- * The next element becomes the new top.
- * M4_YY_DOC_PARAM
- */
-%if-c-only
-void yypop_buffer_state YYFARGS0(void)
-%endif
-%if-c++-only
-void yyFlexLexer::yypop_buffer_state (void)
-%endif
-{
- M4_YY_DECL_GUTS_VAR();
- if (!YY_CURRENT_BUFFER)
- return;
-
- yy_delete_buffer(YY_CURRENT_BUFFER M4_YY_CALL_LAST_ARG);
- YY_CURRENT_BUFFER_LVALUE = NULL;
- if (YY_G(yy_buffer_stack_top) > 0)
- --YY_G(yy_buffer_stack_top);
-
- if (YY_CURRENT_BUFFER) {
- yy_load_buffer_state( M4_YY_CALL_ONLY_ARG );
- YY_G(yy_did_buffer_switch_on_eof) = 1;
- }
-}
-%endif
-
-
-%if-c-or-c++
-/* Allocates the stack if it does not exist.
- * Guarantees space for at least one push.
- */
-%if-c-only
-static void yyensure_buffer_stack YYFARGS0(void)
-%endif
-%if-c++-only
-void yyFlexLexer::yyensure_buffer_stack(void)
-%endif
-{
- yy_size_t num_to_alloc;
- M4_YY_DECL_GUTS_VAR();
-
- if (!YY_G(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;
- YY_G(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
- (num_to_alloc * sizeof(struct yy_buffer_state*)
- M4_YY_CALL_LAST_ARG);
- if ( ! YY_G(yy_buffer_stack) )
- YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
-
-
- memset(YY_G(yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-
- YY_G(yy_buffer_stack_max) = num_to_alloc;
- YY_G(yy_buffer_stack_top) = 0;
- return;
- }
-
- if (YY_G(yy_buffer_stack_top) >= (YY_G(yy_buffer_stack_max)) - 1){
-
- /* Increase the buffer to prepare for a possible push. */
- int grow_size = 8 /* arbitrary grow size */;
-
- num_to_alloc = YY_G(yy_buffer_stack_max) + grow_size;
- YY_G(yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
- (YY_G(yy_buffer_stack),
- num_to_alloc * sizeof(struct yy_buffer_state*)
- M4_YY_CALL_LAST_ARG);
- if ( ! YY_G(yy_buffer_stack) )
- YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
-
- /* zero only the new slots.*/
- memset(YY_G(yy_buffer_stack) + YY_G(yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
- YY_G(yy_buffer_stack_max) = num_to_alloc;
- }
-}
-%endif
-
-
-
-
-m4_ifdef( [[M4_YY_NO_SCAN_BUFFER]],,
-[[
-%if-c-only
-/** 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
- * M4_YY_DOC_PARAM
- * @return the newly allocated buffer state object.
- */
-YY_BUFFER_STATE yy_scan_buffer YYFARGS2( char *,base, yy_size_t ,size)
-{
- YY_BUFFER_STATE b;
- m4_dnl M4_YY_DECL_GUTS_VAR();
-
- 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 0;
-
- b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) M4_YY_CALL_LAST_ARG );
- if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
-
- b->yy_buf_size = 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 = 0;
- 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;
-
- yy_switch_to_buffer( b M4_YY_CALL_LAST_ARG );
-
- return b;
-}
-%endif
-]])
-
-
-m4_ifdef( [[M4_YY_NO_SCAN_STRING]],,
-[[
-%if-c-only
-/** Setup the input buffer state to scan a string. The next call to yylex() will
- * scan from a @e copy of @a str.
- * @param yystr a NUL-terminated string to scan
- * M4_YY_DOC_PARAM
- * @return the newly allocated buffer state object.
- * @note If you want to scan bytes that may contain NUL values, then use
- * yy_scan_bytes() instead.
- */
-YY_BUFFER_STATE yy_scan_string YYFARGS1( yyconst char *, yystr)
-{
- m4_dnl M4_YY_DECL_GUTS_VAR();
-
- return yy_scan_bytes( yystr, strlen(yystr) M4_YY_CALL_LAST_ARG);
-}
-%endif
-]])
-
-
-m4_ifdef( [[M4_YY_NO_SCAN_BYTES]],,
-[[
-%if-c-only
-/** Setup the input buffer state to scan the given bytes. The next call to yylex() 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.
- * M4_YY_DOC_PARAM
- * @return the newly allocated buffer state object.
- */
-YY_BUFFER_STATE yy_scan_bytes YYFARGS2( yyconst char *,yybytes, yy_size_t ,_yybytes_len)
-{
- YY_BUFFER_STATE b;
- char *buf;
- yy_size_t n;
- yy_size_t i;
- m4_dnl M4_YY_DECL_GUTS_VAR();
-
- /* Get memory for full buffer, including space for trailing EOB's. */
- n = _yybytes_len + 2;
- buf = (char *) yyalloc( n M4_YY_CALL_LAST_ARG );
- if ( ! buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_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 = yy_scan_buffer( buf, n M4_YY_CALL_LAST_ARG);
- if ( ! b )
- YY_FATAL_ERROR( "bad buffer in yy_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;
-}
-%endif
-]])
-
-
-m4_ifdef( [[M4_YY_NO_PUSH_STATE]],,
-[[
-%if-c-only
- static void yy_push_state YYFARGS1( int ,new_state)
-%endif
-%if-c++-only
- void yyFlexLexer::yy_push_state( int new_state )
-%endif
-{
- M4_YY_DECL_GUTS_VAR();
- if ( YY_G(yy_start_stack_ptr) >= YY_G(yy_start_stack_depth) )
- {
- yy_size_t new_size;
-
- YY_G(yy_start_stack_depth) += YY_START_STACK_INCR;
- new_size = YY_G(yy_start_stack_depth) * sizeof( int );
-
- if ( ! YY_G(yy_start_stack) )
- YY_G(yy_start_stack) = (int *) yyalloc( new_size M4_YY_CALL_LAST_ARG );
-
- else
- YY_G(yy_start_stack) = (int *) yyrealloc(
- (void *) YY_G(yy_start_stack), new_size M4_YY_CALL_LAST_ARG );
-
- if ( ! YY_G(yy_start_stack) )
- YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
- }
-
- YY_G(yy_start_stack)[YY_G(yy_start_stack_ptr)++] = YY_START;
-
- BEGIN(new_state);
-}
-]])
-
-
-m4_ifdef( [[M4_YY_NO_POP_STATE]],,
-[[
-%if-c-only
- static void yy_pop_state YYFARGS0(void)
-%endif
-%if-c++-only
- void yyFlexLexer::yy_pop_state()
-%endif
-{
- M4_YY_DECL_GUTS_VAR();
- if ( --YY_G(yy_start_stack_ptr) < 0 )
- YY_FATAL_ERROR( "start-condition stack underflow" );
-
- BEGIN(YY_G(yy_start_stack)[YY_G(yy_start_stack_ptr)]);
-}
-]])
-
-
-m4_ifdef( [[M4_YY_NO_TOP_STATE]],,
-[[
-%if-c-only
- static int yy_top_state YYFARGS0(void)
-%endif
-%if-c++-only
- int yyFlexLexer::yy_top_state()
-%endif
-{
- M4_YY_DECL_GUTS_VAR();
- return YY_G(yy_start_stack)[YY_G(yy_start_stack_ptr) - 1];
-}
-]])
-
-#ifndef YY_EXIT_FAILURE
-#define YY_EXIT_FAILURE 2
-#endif
-
-%if-c-only
-static void yy_fatal_error YYFARGS1(yyconst char*, msg)
-{
- m4_dnl M4_YY_DECL_GUTS_VAR();
- (void) fprintf( stderr, "%s\n", msg );
- exit( YY_EXIT_FAILURE );
-}
-%endif
-%if-c++-only
-void yyFlexLexer::LexerError( yyconst char msg[] )
-{
- M4_YY_DECL_GUTS_VAR();
- std::cerr << msg << std::endl;
- exit( YY_EXIT_FAILURE );
-}
-%endif
-
-/* Redefine yyless() so it works in section 3 code. */
-
-#undef yyless
-#define yyless(n) \
- do \
- { \
- /* Undo effects of setting up yytext. */ \
- int yyless_macro_arg = (n); \
- YY_LESS_LINENO(yyless_macro_arg);\
- yytext[yyleng] = YY_G(yy_hold_char); \
- YY_G(yy_c_buf_p) = yytext + yyless_macro_arg; \
- YY_G(yy_hold_char) = *YY_G(yy_c_buf_p); \
- *YY_G(yy_c_buf_p) = '\0'; \
- yyleng = yyless_macro_arg; \
- } \
- while ( 0 )
-
-
-
-/* Accessor methods (get/set functions) to struct members. */
-
-%if-c-only
-%if-reentrant
-m4_ifdef( [[M4_YY_NO_GET_EXTRA]],,
-[[
-/** Get the user-defined data for this scanner.
- * M4_YY_DOC_PARAM
- */
-YY_EXTRA_TYPE yyget_extra YYFARGS0(void)
-{
- M4_YY_DECL_GUTS_VAR();
- return yyextra;
-}
-]])
-%endif
-
-m4_ifdef( [[M4_YY_NO_GET_LINENO]],,
-[[
-/** Get the current line number.
- * M4_YY_DOC_PARAM
- */
-int yyget_lineno YYFARGS0(void)
-{
- M4_YY_DECL_GUTS_VAR();
-
- m4_ifdef( [[M4_YY_REENTRANT]],
- [[
- if (! YY_CURRENT_BUFFER)
- return 0;
- ]])
- return yylineno;
-}
-]])
-
-m4_ifdef( [[M4_YY_REENTRANT]],
-[[
-m4_ifdef( [[M4_YY_NO_GET_COLUMN]],,
-[[
-/** Get the current column number.
- * M4_YY_DOC_PARAM
- */
-int yyget_column YYFARGS0(void)
-{
- M4_YY_DECL_GUTS_VAR();
-
- m4_ifdef( [[M4_YY_REENTRANT]],
- [[
- if (! YY_CURRENT_BUFFER)
- return 0;
- ]])
- return yycolumn;
-}
-]])
-]])
-
-m4_ifdef( [[M4_YY_NO_GET_IN]],,
-[[
-/** Get the input stream.
- * M4_YY_DOC_PARAM
- */
-FILE *yyget_in YYFARGS0(void)
-{
- M4_YY_DECL_GUTS_VAR();
- return yyin;
-}
-]])
-
-m4_ifdef( [[M4_YY_NO_GET_OUT]],,
-[[
-/** Get the output stream.
- * M4_YY_DOC_PARAM
- */
-FILE *yyget_out YYFARGS0(void)
-{
- M4_YY_DECL_GUTS_VAR();
- return yyout;
-}
-]])
-
-m4_ifdef( [[M4_YY_NO_GET_LENG]],,
-[[
-/** Get the length of the current token.
- * M4_YY_DOC_PARAM
- */
-yy_size_t yyget_leng YYFARGS0(void)
-{
- M4_YY_DECL_GUTS_VAR();
- return yyleng;
-}
-]])
-
-/** Get the current token.
- * M4_YY_DOC_PARAM
- */
-m4_ifdef( [[M4_YY_NO_GET_TEXT]],,
-[[
-char *yyget_text YYFARGS0(void)
-{
- M4_YY_DECL_GUTS_VAR();
- return yytext;
-}
-]])
-
-%if-reentrant
-m4_ifdef( [[M4_YY_NO_SET_EXTRA]],,
-[[
-/** Set the user-defined data. This data is never touched by the scanner.
- * @param user_defined The data to be associated with this scanner.
- * M4_YY_DOC_PARAM
- */
-void yyset_extra YYFARGS1( YY_EXTRA_TYPE ,user_defined)
-{
- M4_YY_DECL_GUTS_VAR();
- yyextra = user_defined ;
-}
-]])
-%endif
-
-m4_ifdef( [[M4_YY_NO_SET_LINENO]],,
-[[
-/** Set the current line number.
- * @param line_number
- * M4_YY_DOC_PARAM
- */
-void yyset_lineno YYFARGS1( int ,line_number)
-{
- M4_YY_DECL_GUTS_VAR();
-
- m4_ifdef( [[M4_YY_REENTRANT]],
- [[
- /* lineno is only valid if an input buffer exists. */
- if (! YY_CURRENT_BUFFER )
- YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
- ]])
- yylineno = line_number;
-}
-]])
-
-m4_ifdef( [[M4_YY_REENTRANT]],
-[[
-m4_ifdef( [[M4_YY_NO_SET_COLUMN]],,
-[[
-/** Set the current column.
- * @param line_number
- * M4_YY_DOC_PARAM
- */
-void yyset_column YYFARGS1( int , column_no)
-{
- M4_YY_DECL_GUTS_VAR();
-
- m4_ifdef( [[M4_YY_REENTRANT]],
- [[
- /* column is only valid if an input buffer exists. */
- if (! YY_CURRENT_BUFFER )
- YY_FATAL_ERROR( "yyset_column called with no buffer" );
- ]])
- yycolumn = column_no;
-}
-]])
-]])
-
-
-m4_ifdef( [[M4_YY_NO_SET_IN]],,
-[[
-/** Set the input stream. This does not discard the current
- * input buffer.
- * @param in_str A readable stream.
- * M4_YY_DOC_PARAM
- * @see yy_switch_to_buffer
- */
-void yyset_in YYFARGS1( FILE * ,in_str)
-{
- M4_YY_DECL_GUTS_VAR();
- yyin = in_str ;
-}
-]])
-
-m4_ifdef( [[M4_YY_NO_SET_OUT]],,
-[[
-void yyset_out YYFARGS1( FILE * ,out_str)
-{
- M4_YY_DECL_GUTS_VAR();
- yyout = out_str ;
-}
-]])
-
-
-m4_ifdef( [[M4_YY_NO_GET_DEBUG]],,
-[[
-int yyget_debug YYFARGS0(void)
-{
- M4_YY_DECL_GUTS_VAR();
- return yy_flex_debug;
-}
-]])
-
-m4_ifdef( [[M4_YY_NO_SET_DEBUG]],,
-[[
-void yyset_debug YYFARGS1( int ,bdebug)
-{
- M4_YY_DECL_GUTS_VAR();
- yy_flex_debug = bdebug ;
-}
-]])
-%endif
-
-%if-reentrant
-/* Accessor methods for yylval and yylloc */
-
-%if-bison-bridge
-m4_ifdef( [[M4_YY_NO_GET_LVAL]],,
-[[
-YYSTYPE * yyget_lval YYFARGS0(void)
-{
- M4_YY_DECL_GUTS_VAR();
- return yylval;
-}
-]])
-
-m4_ifdef( [[M4_YY_NO_SET_LVAL]],,
-[[
-void yyset_lval YYFARGS1( YYSTYPE * ,yylval_param)
-{
- M4_YY_DECL_GUTS_VAR();
- yylval = yylval_param;
-}
-]])
-
-m4_ifdef( [[<M4_YY_BISON_LLOC>]],
-[[
- m4_ifdef( [[M4_YY_NO_GET_LLOC]],,
- [[
-YYLTYPE *yyget_lloc YYFARGS0(void)
-{
- M4_YY_DECL_GUTS_VAR();
- return yylloc;
-}
- ]])
-
- m4_ifdef( [[M4_YY_NO_SET_LLOC]],,
- [[
-void yyset_lloc YYFARGS1( YYLTYPE * ,yylloc_param)
-{
- M4_YY_DECL_GUTS_VAR();
- yylloc = yylloc_param;
-}
- ]])
-]])
-
-%endif
-
-
-/* User-visible API */
-
-/* yylex_init is special because it creates the scanner itself, so it is
- * the ONLY reentrant function that doesn't take the scanner as the last argument.
- * That's why we explicitly handle the declaration, instead of using our macros.
- */
-m4_ifdef( [[M4_YY_NO_ANSI_FUNC_DEFS]],
-[[
-int yylex_init( ptr_yy_globals )
- yyscan_t* ptr_yy_globals;
-]],
-[[
-int yylex_init(yyscan_t* ptr_yy_globals)
-]])
-{
- if (ptr_yy_globals == NULL){
- errno = EINVAL;
- return 1;
- }
-
- *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
-
- if (*ptr_yy_globals == NULL){
- errno = ENOMEM;
- return 1;
- }
-
- /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
- memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
-
- return yy_init_globals ( *ptr_yy_globals );
-}
-
-
-/* yylex_init_extra has the same functionality as yylex_init, but follows the
- * convention of taking the scanner as the last argument. Note however, that
- * this is a *pointer* to a scanner, as it will be allocated by this call (and
- * is the reason, too, why this function also must handle its own declaration).
- * The user defined value in the first argument will be available to yyalloc in
- * the yyextra field.
- */
-m4_ifdef( [[M4_YY_NO_ANSI_FUNC_DEFS]],
-[[
-int yylex_init_extra( yy_user_defined, ptr_yy_globals )
- YY_EXTRA_TYPE yy_user_defined;
- yyscan_t* ptr_yy_globals;
-]],
-[[
-int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )
-]])
-{
- struct yyguts_t dummy_yyguts;
-
- yyset_extra (yy_user_defined, &dummy_yyguts);
-
- if (ptr_yy_globals == NULL){
- errno = EINVAL;
- return 1;
- }
-
- *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
-
- if (*ptr_yy_globals == NULL){
- errno = ENOMEM;
- return 1;
- }
-
- /* By setting to 0xAA, we expose bugs in
- yy_init_globals. Leave at 0x00 for releases. */
- memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
-
- yyset_extra (yy_user_defined, *ptr_yy_globals);
-
- return yy_init_globals ( *ptr_yy_globals );
-}
-
-%endif if-c-only
-
-
-%if-c-only
-static int yy_init_globals YYFARGS0(void)
-{
- M4_YY_DECL_GUTS_VAR();
- /* Initialization is the same as for the non-reentrant scanner.
- * This function is called from yylex_destroy(), so don't allocate here.
- */
-
-m4_ifdef( [[M4_YY_USE_LINENO]],
-[[
- m4_ifdef( [[M4_YY_NOT_REENTRANT]],
- [[
- /* We do not touch yylineno unless the option is enabled. */
- yylineno = 1;
- ]])
-]])
- YY_G(yy_buffer_stack) = 0;
- YY_G(yy_buffer_stack_top) = 0;
- YY_G(yy_buffer_stack_max) = 0;
- YY_G(yy_c_buf_p) = (char *) 0;
- YY_G(yy_init) = 0;
- YY_G(yy_start) = 0;
-
-m4_ifdef( [[M4_YY_HAS_START_STACK_VARS]],
-[[
- YY_G(yy_start_stack_ptr) = 0;
- YY_G(yy_start_stack_depth) = 0;
- YY_G(yy_start_stack) = NULL;
-]])
-
-m4_ifdef( [[M4_YY_USES_REJECT]],
-[[
- YY_G(yy_state_buf) = 0;
- YY_G(yy_state_ptr) = 0;
- YY_G(yy_full_match) = 0;
- YY_G(yy_lp) = 0;
-]])
-
-m4_ifdef( [[M4_YY_TEXT_IS_ARRAY]],
-[[
- YY_G(yytext_ptr) = 0;
- YY_G(yy_more_offset) = 0;
- YY_G(yy_prev_more_offset) = 0;
-]])
-
-/* Defined in main.c */
-#ifdef YY_STDINIT
- yyin = stdin;
- yyout = stdout;
-#else
- yyin = (FILE *) 0;
- yyout = (FILE *) 0;
-#endif
-
- /* For future reference: Set errno on error, since we are called by
- * yylex_init()
- */
- return 0;
-}
-%endif
-
-
-%if-c-only SNIP! this currently causes conflicts with the c++ scanner
-/* yylex_destroy is for both reentrant and non-reentrant scanners. */
-int yylex_destroy YYFARGS0(void)
-{
- M4_YY_DECL_GUTS_VAR();
-
- /* Pop the buffer stack, destroying each element. */
- while(YY_CURRENT_BUFFER){
- yy_delete_buffer( YY_CURRENT_BUFFER M4_YY_CALL_LAST_ARG );
- YY_CURRENT_BUFFER_LVALUE = NULL;
- yypop_buffer_state(M4_YY_CALL_ONLY_ARG);
- }
-
- /* Destroy the stack itself. */
- yyfree(YY_G(yy_buffer_stack) M4_YY_CALL_LAST_ARG);
- YY_G(yy_buffer_stack) = NULL;
-
-m4_ifdef( [[M4_YY_HAS_START_STACK_VARS]],
-[[
- /* Destroy the start condition stack. */
- yyfree( YY_G(yy_start_stack) M4_YY_CALL_LAST_ARG );
- YY_G(yy_start_stack) = NULL;
-]])
-
-m4_ifdef( [[M4_YY_USES_REJECT]],
-[[
- yyfree ( YY_G(yy_state_buf) M4_YY_CALL_LAST_ARG);
- YY_G(yy_state_buf) = NULL;
-]])
-
- /* Reset the globals. This is important in a non-reentrant scanner so the next time
- * yylex() is called, initialization will occur. */
- yy_init_globals( M4_YY_CALL_ONLY_ARG);
-
-%if-reentrant
- /* Destroy the main struct (reentrant only). */
- yyfree ( yyscanner M4_YY_CALL_LAST_ARG );
- yyscanner = NULL;
-%endif
- return 0;
-}
-%endif
-
-
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
-/*
- * Internal utility routines.
- */
-]])
-
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
-#ifndef yytext_ptr
-static void yy_flex_strncpy YYFARGS3( char*,s1, yyconst char *,s2, int,n)
-{
- register int i;
- for ( i = 0; i < n; ++i )
- s1[i] = s2[i];
-}
-#endif
-]])
-
-m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
-[[
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen YYFARGS1( yyconst char *,s)
-{
- register int n;
- for ( n = 0; s[n]; ++n )
- ;
-
- return n;
-}
-#endif
-]])
-
-m4_ifdef( [[M4_YY_NO_FLEX_ALLOC]],,
-[[
-void *yyalloc YYFARGS1( yy_size_t ,size)
-{
- return (void *) malloc( size );
-}
-]])
-
-m4_ifdef( [[M4_YY_NO_FLEX_REALLOC]],,
-[[
-void *yyrealloc YYFARGS2( 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 (void *) realloc( (char *) ptr, size );
-}
-]])
-
-m4_ifdef( [[M4_YY_NO_FLEX_FREE]],,
-[[
-void yyfree YYFARGS1( void *,ptr)
-{
- free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
-}
-]])
-
-%if-tables-serialization definitions
-m4preproc_include(`tables_shared.c')
-
-static int yytbl_read8 (void *v, struct yytbl_reader * rd)
-{
- errno = 0;
- if (fread (v, sizeof (flex_uint8_t), 1, rd->fp) != 1){
- errno = EIO;
- return -1;
- }
- rd->bread += sizeof(flex_uint8_t);
- return 0;
-}
-
-static int yytbl_read16 (void *v, struct yytbl_reader * rd)
-{
- errno = 0;
- if (fread (v, sizeof (flex_uint16_t), 1, rd->fp) != 1){
- errno = EIO;
- return -1;
- }
- *((flex_uint16_t *) v) = ntohs (*((flex_uint16_t *) v));
- rd->bread += sizeof(flex_uint16_t);
- return 0;
-}
-
-static int yytbl_read32 (void *v, struct yytbl_reader * rd)
-{
- errno = 0;
- if (fread (v, sizeof (flex_uint32_t), 1, rd->fp) != 1){
- errno = EIO;
- return -1;
- }
- *((flex_uint32_t *) v) = ntohl (*((flex_uint32_t *) v));
- rd->bread += sizeof(flex_uint32_t);
- return 0;
-}
-
-/** Read the header */
-static int yytbl_hdr_read YYFARGS2(struct yytbl_hdr *, th, struct yytbl_reader *, rd)
-{
- int bytes;
- memset (th, 0, sizeof (struct yytbl_hdr));
-
- if (yytbl_read32 (&(th->th_magic), rd) != 0)
- return -1;
-
- if (th->th_magic != YYTBL_MAGIC){
- YY_FATAL_ERROR( "bad magic number" ); /* TODO: not fatal. */
- return -1;
- }
-
- if (yytbl_read32 (&(th->th_hsize), rd) != 0
- || yytbl_read32 (&(th->th_ssize), rd) != 0
- || yytbl_read16 (&(th->th_flags), rd) != 0)
- return -1;
-
- /* Sanity check on header size. Greater than 1k suggests some funny business. */
- if (th->th_hsize < 16 || th->th_hsize > 1024){
- YY_FATAL_ERROR( "insane header size detected" ); /* TODO: not fatal. */
- return -1;
- }
-
- /* Allocate enough space for the version and name fields */
- bytes = th->th_hsize - 14;
- th->th_version = (char *) yyalloc (bytes M4_YY_CALL_LAST_ARG);
- if ( ! th->th_version )
- YY_FATAL_ERROR( "out of dynamic memory in yytbl_hdr_read()" );
-
- /* we read it all into th_version, and point th_name into that data */
- if (fread (th->th_version, 1, bytes, rd->fp) != bytes){
- errno = EIO;
- yyfree(th->th_version M4_YY_CALL_LAST_ARG);
- th->th_version = NULL;
- return -1;
- }
- else
- rd->bread += bytes;
-
- th->th_name = th->th_version + strlen (th->th_version) + 1;
- return 0;
-}
-
-/** lookup id in the dmap list.
- * @param dmap pointer to first element in list
- * @return NULL if not found.
- */
-static struct yytbl_dmap *yytbl_dmap_lookup YYFARGS2(struct yytbl_dmap *, dmap,
- int, id)
-{
- while (dmap->dm_id)
- if (dmap->dm_id == id)
- return dmap;
- else
- dmap++;
- return NULL;
-}
-
-/** Read a table while mapping its contents to the local array.
- * @param dmap used to performing mapping
- * @return 0 on success
- */
-static int yytbl_data_load YYFARGS2(struct yytbl_dmap *, dmap, struct yytbl_reader*, rd)
-{
- struct yytbl_data td;
- struct yytbl_dmap *transdmap=0;
- int len, i, rv, inner_loop_count;
- void *p=0;
-
- memset (&td, 0, sizeof (struct yytbl_data));
-
- if (yytbl_read16 (&td.td_id, rd) != 0
- || yytbl_read16 (&td.td_flags, rd) != 0
- || yytbl_read32 (&td.td_hilen, rd) != 0
- || yytbl_read32 (&td.td_lolen, rd) != 0)
- return -1;
-
- /* Lookup the map for the transition table so we have it in case we need it
- * inside the loop below. This scanner might not even have a transition
- * table, which is ok.
- */
- transdmap = yytbl_dmap_lookup (dmap, YYTD_ID_TRANSITION M4_YY_CALL_LAST_ARG);
-
- if ((dmap = yytbl_dmap_lookup (dmap, td.td_id M4_YY_CALL_LAST_ARG)) == NULL){
- YY_FATAL_ERROR( "table id not found in map." ); /* TODO: not fatal. */
- return -1;
- }
-
- /* Allocate space for table.
- * The --full yy_transition table is a special case, since we
- * need the dmap.dm_sz entry to tell us the sizeof the individual
- * struct members.
- */
- {
- size_t bytes;
-
- if ((td.td_flags & YYTD_STRUCT))
- bytes = sizeof(struct yy_trans_info) * td.td_lolen * (td.td_hilen ? td.td_hilen : 1);
- else
- bytes = td.td_lolen * (td.td_hilen ? td.td_hilen : 1) * dmap->dm_sz;
-
- if(M4_YY_TABLES_VERIFY)
- /* We point to the array itself */
- p = dmap->dm_arr;
- else
- /* We point to the address of a pointer. */
- *dmap->dm_arr = p = (void *) yyalloc (bytes M4_YY_CALL_LAST_ARG);
- if ( ! p )
- YY_FATAL_ERROR( "out of dynamic memory in yytbl_data_load()" );
- }
-
- /* If it's a struct, we read 2 integers to get one element */
- if ((td.td_flags & YYTD_STRUCT) != 0)
- inner_loop_count = 2;
- else
- inner_loop_count = 1;
-
- /* read and map each element.
- * This loop iterates once for each element of the td_data array.
- * Notice that we increment 'i' in the inner loop.
- */
- len = yytbl_calc_total_len (&td);
- for (i = 0; i < len; ){
- int j;
-
-
- /* This loop really executes exactly 1 or 2 times.
- * The second time is to handle the second member of the
- * YYTD_STRUCT for the yy_transition array.
- */
- for (j = 0; j < inner_loop_count; j++, i++) {
- flex_int32_t t32;
-
- /* read into t32 no matter what the real size is. */
- {
- flex_int16_t t16;
- flex_int8_t t8;
-
- switch (YYTDFLAGS2BYTES (td.td_flags)) {
- case sizeof (flex_int32_t):
- rv = yytbl_read32 (&t32, rd);
- break;
- case sizeof (flex_int16_t):
- rv = yytbl_read16 (&t16, rd);
- t32 = t16;
- break;
- case sizeof (flex_int8_t):
- rv = yytbl_read8 (&t8, rd);
- t32 = t8;
- break;
- default:
- YY_FATAL_ERROR( "invalid td_flags" ); /* TODO: not fatal. */
- return -1;
- }
- }
- if (rv != 0)
- return -1;
-
- /* copy into the deserialized array... */
-
- if ((td.td_flags & YYTD_STRUCT)) {
- /* t32 is the j'th member of a two-element struct. */
- void *v;
-
- v = j == 0 ? &(((struct yy_trans_info *) p)->yy_verify)
- : &(((struct yy_trans_info *) p)->yy_nxt);
-
- switch (dmap->dm_sz) {
- case sizeof (flex_int32_t):
- if (M4_YY_TABLES_VERIFY){
- if( ((flex_int32_t *) v)[0] != (flex_int32_t) t32)
- YY_FATAL_ERROR( "tables verification failed at YYTD_STRUCT flex_int32_t" );
- }else
- ((flex_int32_t *) v)[0] = (flex_int32_t) t32;
- break;
- case sizeof (flex_int16_t):
- if (M4_YY_TABLES_VERIFY ){
- if(((flex_int16_t *) v)[0] != (flex_int16_t) t32)
- YY_FATAL_ERROR( "tables verification failed at YYTD_STRUCT flex_int16_t" );
- }else
- ((flex_int16_t *) v)[0] = (flex_int16_t) t32;
- break;
- case sizeof(flex_int8_t):
- if (M4_YY_TABLES_VERIFY ){
- if( ((flex_int8_t *) v)[0] != (flex_int8_t) t32)
- YY_FATAL_ERROR( "tables verification failed at YYTD_STRUCT flex_int8_t" );
- }else
- ((flex_int8_t *) v)[0] = (flex_int8_t) t32;
- break;
- default:
- YY_FATAL_ERROR( "invalid dmap->dm_sz for struct" ); /* TODO: not fatal. */
- return -1;
- }
-
- /* if we're done with j, increment p */
- if (j == 1)
- p = (struct yy_trans_info *) p + 1;
- }
- else if ((td.td_flags & YYTD_PTRANS)) {
- /* t32 is an index into the transition array. */
- struct yy_trans_info *v;
-
-
- if (!transdmap){
- YY_FATAL_ERROR( "transition table not found" ); /* TODO: not fatal. */
- return -1;
- }
-
- if( M4_YY_TABLES_VERIFY)
- v = &(((struct yy_trans_info *) (transdmap->dm_arr))[t32]);
- else
- v = &((*((struct yy_trans_info **) (transdmap->dm_arr)))[t32]);
-
- if(M4_YY_TABLES_VERIFY ){
- if( ((struct yy_trans_info **) p)[0] != v)
- YY_FATAL_ERROR( "tables verification failed at YYTD_PTRANS" );
- }else
- ((struct yy_trans_info **) p)[0] = v;
-
- /* increment p */
- p = (struct yy_trans_info **) p + 1;
- }
- else {
- /* t32 is a plain int. copy data, then incrememnt p. */
- switch (dmap->dm_sz) {
- case sizeof (flex_int32_t):
- if(M4_YY_TABLES_VERIFY ){
- if( ((flex_int32_t *) p)[0] != (flex_int32_t) t32)
- YY_FATAL_ERROR( "tables verification failed at flex_int32_t" );
- }else
- ((flex_int32_t *) p)[0] = (flex_int32_t) t32;
- p = ((flex_int32_t *) p) + 1;
- break;
- case sizeof (flex_int16_t):
- if(M4_YY_TABLES_VERIFY ){
- if( ((flex_int16_t *) p)[0] != (flex_int16_t) t32)
- YY_FATAL_ERROR( "tables verification failed at flex_int16_t" );
- }else
- ((flex_int16_t *) p)[0] = (flex_int16_t) t32;
- p = ((flex_int16_t *) p) + 1;
- break;
- case sizeof (flex_int8_t):
- if(M4_YY_TABLES_VERIFY ){
- if( ((flex_int8_t *) p)[0] != (flex_int8_t) t32)
- YY_FATAL_ERROR( "tables verification failed at flex_int8_t" );
- }else
- ((flex_int8_t *) p)[0] = (flex_int8_t) t32;
- p = ((flex_int8_t *) p) + 1;
- break;
- default:
- YY_FATAL_ERROR( "invalid dmap->dm_sz for plain int" ); /* TODO: not fatal. */
- return -1;
- }
- }
- }
-
- }
-
- /* Now eat padding. */
- {
- int pad;
- pad = yypad64(rd->bread);
- while(--pad >= 0){
- flex_int8_t t8;
- if(yytbl_read8(&t8,rd) != 0)
- return -1;
- }
- }
-
- return 0;
-}
-
-%define-yytables The name for this specific scanner's tables.
-
-/* Find the key and load the DFA tables from the given stream. */
-static int yytbl_fload YYFARGS2(FILE *, fp, const char *, key)
-{
- int rv=0;
- struct yytbl_hdr th;
- struct yytbl_reader rd;
-
- rd.fp = fp;
- th.th_version = NULL;
-
- /* Keep trying until we find the right set of tables or end of file. */
- while (!feof(rd.fp)) {
- rd.bread = 0;
- if (yytbl_hdr_read (&th, &rd M4_YY_CALL_LAST_ARG) != 0){
- rv = -1;
- goto return_rv;
- }
-
- /* A NULL key means choose the first set of tables. */
- if (key == NULL)
- break;
-
- if (strcmp(th.th_name,key) != 0){
- /* Skip ahead to next set */
- fseek(rd.fp, th.th_ssize - th.th_hsize, SEEK_CUR);
- yyfree(th.th_version M4_YY_CALL_LAST_ARG);
- th.th_version = NULL;
- }
- else
- break;
- }
-
- while (rd.bread < th.th_ssize){
- /* Load the data tables */
- if(yytbl_data_load (yydmap,&rd M4_YY_CALL_LAST_ARG) != 0){
- rv = -1;
- goto return_rv;
- }
- }
-
-return_rv:
- if(th.th_version){
- yyfree(th.th_version M4_YY_CALL_LAST_ARG);
- th.th_version = NULL;
- }
-
- return rv;
-}
-
-/** Load the DFA tables for this scanner from the given stream. */
-int yytables_fload YYFARGS1(FILE *, fp)
-{
-
- if( yytbl_fload(fp, YYTABLES_NAME M4_YY_CALL_LAST_ARG) != 0)
- return -1;
- return 0;
-}
-
-/** Destroy the loaded tables, freeing memory, etc.. */
-int yytables_destroy YYFARGS0(void)
-{
- struct yytbl_dmap *dmap=0;
-
- if(!M4_YY_TABLES_VERIFY){
- /* Walk the dmap, freeing the pointers */
- for(dmap=yydmap; dmap->dm_id; dmap++) {
- void * v;
- v = dmap->dm_arr;
- if(v && *(char**)v){
- yyfree(*(char**)v M4_YY_CALL_LAST_ARG);
- *(char**)v = NULL;
- }
- }
- }
-
- return 0;
-}
-
-/* end table serialization code definitions */
-%endif
-
-
-m4_ifdef([[M4_YY_MAIN]], [[
-int main M4_YY_PARAMS(void);
-
-int main ()
-{
-
-%if-reentrant
- yyscan_t lexer;
- yylex_init(&lexer);
- yylex( lexer );
- yylex_destroy( lexer);
-
-%endif
-%if-not-reentrant
- yylex();
-%endif
-
- return 0;
-}
-]])
-
-%ok-for-header
-m4_ifdef( [[M4_YY_IN_HEADER]],
-[[
-#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
-]])
Deleted: trunk/contrib/flex/flexdef.h
===================================================================
--- trunk/contrib/flex/flexdef.h 2018-09-12 01:37:07 UTC (rev 12025)
+++ trunk/contrib/flex/flexdef.h 2018-09-12 01:40:59 UTC (rev 12026)
@@ -1,1228 +0,0 @@
-
-/* flexdef - definitions file for flex */
-
-/* Copyright (c) 1990 The Regents of the University of California. */
-/* All rights reserved. */
-
-/* This code is derived from software contributed to Berkeley by */
-/* Vern Paxson. */
-
-/* The United States Government has rights in this work pursuant */
-/* to contract no. DE-AC03-76SF00098 between the United States */
-/* Department of Energy and the University of California. */
-
-/* This file is part of flex. */
-
-/* Redistribution and use in source and binary forms, with or without */
-/* modification, are permitted provided that the following conditions */
-/* are met: */
-
-/* 1. Redistributions of source code must retain the above copyright */
-/* notice, this list of conditions and the following disclaimer. */
-/* 2. Redistributions in binary form must reproduce the above copyright */
-/* notice, this list of conditions and the following disclaimer in the */
-/* documentation and/or other materials provided with the distribution. */
-
-/* Neither the name of the University nor the names of its contributors */
-/* may be used to endorse or promote products derived from this software */
-/* without specific prior written permission. */
-
-/* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR */
-/* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED */
-/* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */
-/* PURPOSE. */
-
-#ifndef FLEXDEF_H
-#define FLEXDEF_H 1
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-/* AIX requires this to be the first thing in the file. */
-#ifndef __GNUC__
-# if HAVE_ALLOCA_H
-# include <alloca.h>
-# else
-# ifdef _AIX
- #pragma alloca
-# else
-# ifndef alloca /* predefined by HP cc +Olibcalls */
-char *alloca ();
-# endif
-# endif
-# endif
-#endif
-
-#ifdef STDC_HEADERS
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <setjmp.h>
-#include <ctype.h>
-#include <string.h>
-#include <math.h>
-#endif
-#ifdef HAVE_ASSERT_H
-#include <assert.h>
-#else
-#define assert(Pred)
-#endif
-
-#ifdef HAVE_LIMITS_H
-#include <limits.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_SYS_PARAMS_H
-#include <sys/params.h>
-#endif
-#ifdef HAVE_SYS_WAIT_H
-#include <sys/wait.h>
-#endif
-#ifdef HAVE_STDBOOL_H
-#include <stdbool.h>
-#else
-#define bool int
-#define true 1
-#define false 0
-#endif
-#ifdef HAVE_REGEX_H
-#include <regex.h>
-#endif
-#include "flexint.h"
-
-/* We use gettext. So, when we write strings which should be translated, we mark them with _() */
-#ifdef ENABLE_NLS
-#ifdef HAVE_LOCALE_H
-#include <locale.h>
-#endif /* HAVE_LOCALE_H */
-#include "gettext.h"
-#define _(String) gettext (String)
-#else
-#define _(STRING) STRING
-#endif /* ENABLE_NLS */
-
-/* Always be prepared to generate an 8-bit scanner. */
-#define CSIZE 256
-#define Char unsigned char
-
-/* Size of input alphabet - should be size of ASCII set. */
-#ifndef DEFAULT_CSIZE
-#define DEFAULT_CSIZE 128
-#endif
-
-#ifndef PROTO
-#if defined(__STDC__)
-#define PROTO(proto) proto
-#else
-#define PROTO(proto) ()
-#endif
-#endif
-
-#ifdef VMS
-#ifndef __VMS_POSIX
-#define unlink remove
-#define SHORT_FILE_NAMES
-#endif
-#endif
-
-#ifdef MS_DOS
-#define SHORT_FILE_NAMES
-#endif
-
-
-/* Maximum line length we'll have to deal with. */
-#define MAXLINE 2048
-
-#ifndef MIN
-#define MIN(x,y) ((x) < (y) ? (x) : (y))
-#endif
-#ifndef MAX
-#define MAX(x,y) ((x) > (y) ? (x) : (y))
-#endif
-#ifndef ABS
-#define ABS(x) ((x) < 0 ? -(x) : (x))
-#endif
-
-
-/* ANSI C does not guarantee that isascii() is defined */
-#ifndef isascii
-#define isascii(c) ((c) <= 0177)
-#endif
-
-#define unspecified -1
-
-/* Special chk[] values marking the slots taking by end-of-buffer and action
- * numbers.
- */
-#define EOB_POSITION -1
-#define ACTION_POSITION -2
-
-/* Number of data items per line for -f output. */
-#define NUMDATAITEMS 10
-
-/* Number of lines of data in -f output before inserting a blank line for
- * readability.
- */
-#define NUMDATALINES 10
-
-#define NUMCHARLINES 10
-
-/* transition_struct_out() definitions. */
-#define TRANS_STRUCT_PRINT_LENGTH 14
-
-/* Returns true if an nfa state has an epsilon out-transition slot
- * that can be used. This definition is currently not used.
- */
-#define FREE_EPSILON(state) \
- (transchar[state] == SYM_EPSILON && \
- trans2[state] == NO_TRANSITION && \
- finalst[state] != state)
-
-/* Returns true if an nfa state has an epsilon out-transition character
- * and both slots are free
- */
-#define SUPER_FREE_EPSILON(state) \
- (transchar[state] == SYM_EPSILON && \
- trans1[state] == NO_TRANSITION) \
-
-/* Maximum number of NFA states that can comprise a DFA state. It's real
- * big because if there's a lot of rules, the initial state will have a
- * huge epsilon closure.
- */
-#define INITIAL_MAX_DFA_SIZE 750
-#define MAX_DFA_SIZE_INCREMENT 750
-
-
-/* A note on the following masks. They are used to mark accepting numbers
- * as being special. As such, they implicitly limit the number of accepting
- * numbers (i.e., rules) because if there are too many rules the rule numbers
- * will overload the mask bits. Fortunately, this limit is \large/ (0x2000 ==
- * 8192) so unlikely to actually cause any problems. A check is made in
- * new_rule() to ensure that this limit is not reached.
- */
-
-/* Mask to mark a trailing context accepting number. */
-#define YY_TRAILING_MASK 0x2000
-
-/* Mask to mark the accepting number of the "head" of a trailing context
- * rule.
- */
-#define YY_TRAILING_HEAD_MASK 0x4000
-
-/* Maximum number of rules, as outlined in the above note. */
-#define MAX_RULE (YY_TRAILING_MASK - 1)
-
-
-/* NIL must be 0. If not, its special meaning when making equivalence classes
- * (it marks the representative of a given e.c.) will be unidentifiable.
- */
-#define NIL 0
-
-#define JAM -1 /* to mark a missing DFA transition */
-#define NO_TRANSITION NIL
-#define UNIQUE -1 /* marks a symbol as an e.c. representative */
-#define INFINITE_REPEAT -1 /* for x{5,} constructions */
-
-#define INITIAL_MAX_CCLS 100 /* max number of unique character classes */
-#define MAX_CCLS_INCREMENT 100
-
-/* Size of table holding members of character classes. */
-#define INITIAL_MAX_CCL_TBL_SIZE 500
-#define MAX_CCL_TBL_SIZE_INCREMENT 250
-
-#define INITIAL_MAX_RULES 100 /* default maximum number of rules */
-#define MAX_RULES_INCREMENT 100
-
-#define INITIAL_MNS 2000 /* default maximum number of nfa states */
-#define MNS_INCREMENT 1000 /* amount to bump above by if it's not enough */
-
-#define INITIAL_MAX_DFAS 1000 /* default maximum number of dfa states */
-#define MAX_DFAS_INCREMENT 1000
-
-#define JAMSTATE -32766 /* marks a reference to the state that always jams */
-
-/* Maximum number of NFA states. */
-#define MAXIMUM_MNS 31999
-#define MAXIMUM_MNS_LONG 1999999999
-
-/* Enough so that if it's subtracted from an NFA state number, the result
- * is guaranteed to be negative.
- */
-#define MARKER_DIFFERENCE (maximum_mns+2)
-
-/* Maximum number of nxt/chk pairs for non-templates. */
-#define INITIAL_MAX_XPAIRS 2000
-#define MAX_XPAIRS_INCREMENT 2000
-
-/* Maximum number of nxt/chk pairs needed for templates. */
-#define INITIAL_MAX_TEMPLATE_XPAIRS 2500
-#define MAX_TEMPLATE_XPAIRS_INCREMENT 2500
-
-#define SYM_EPSILON (CSIZE + 1) /* to mark transitions on the symbol epsilon */
-
-#define INITIAL_MAX_SCS 40 /* maximum number of start conditions */
-#define MAX_SCS_INCREMENT 40 /* amount to bump by if it's not enough */
-
-#define ONE_STACK_SIZE 500 /* stack of states with only one out-transition */
-#define SAME_TRANS -1 /* transition is the same as "default" entry for state */
-
-/* The following percentages are used to tune table compression:
-
- * The percentage the number of out-transitions a state must be of the
- * number of equivalence classes in order to be considered for table
- * compaction by using protos.
- */
-#define PROTO_SIZE_PERCENTAGE 15
-
-/* The percentage the number of homogeneous out-transitions of a state
- * must be of the number of total out-transitions of the state in order
- * that the state's transition table is first compared with a potential
- * template of the most common out-transition instead of with the first
- * proto in the proto queue.
- */
-#define CHECK_COM_PERCENTAGE 50
-
-/* The percentage the number of differences between a state's transition
- * table and the proto it was first compared with must be of the total
- * number of out-transitions of the state in order to keep the first
- * proto as a good match and not search any further.
- */
-#define FIRST_MATCH_DIFF_PERCENTAGE 10
-
-/* The percentage the number of differences between a state's transition
- * table and the most similar proto must be of the state's total number
- * of out-transitions to use the proto as an acceptable close match.
- */
-#define ACCEPTABLE_DIFF_PERCENTAGE 50
-
-/* The percentage the number of homogeneous out-transitions of a state
- * must be of the number of total out-transitions of the state in order
- * to consider making a template from the state.
- */
-#define TEMPLATE_SAME_PERCENTAGE 60
-
-/* The percentage the number of differences between a state's transition
- * table and the most similar proto must be of the state's total number
- * of out-transitions to create a new proto from the state.
- */
-#define NEW_PROTO_DIFF_PERCENTAGE 20
-
-/* The percentage the total number of out-transitions of a state must be
- * of the number of equivalence classes in order to consider trying to
- * fit the transition table into "holes" inside the nxt/chk table.
- */
-#define INTERIOR_FIT_PERCENTAGE 15
-
-/* Size of region set aside to cache the complete transition table of
- * protos on the proto queue to enable quick comparisons.
- */
-#define PROT_SAVE_SIZE 2000
-
-#define MSP 50 /* maximum number of saved protos (protos on the proto queue) */
-
-/* Maximum number of out-transitions a state can have that we'll rummage
- * around through the interior of the internal fast table looking for a
- * spot for it.
- */
-#define MAX_XTIONS_FULL_INTERIOR_FIT 4
-
-/* Maximum number of rules which will be reported as being associated
- * with a DFA state.
- */
-#define MAX_ASSOC_RULES 100
-
-/* Number that, if used to subscript an array, has a good chance of producing
- * an error; should be small enough to fit into a short.
- */
-#define BAD_SUBSCRIPT -32767
-
-/* Absolute value of largest number that can be stored in a short, with a
- * bit of slop thrown in for general paranoia.
- */
-#define MAX_SHORT 32700
-
-
-/* Declarations for global variables. */
-
-
-/* Variables for flags:
- * printstats - if true (-v), dump statistics
- * syntaxerror - true if a syntax error has been found
- * eofseen - true if we've seen an eof in the input file
- * ddebug - if true (-d), make a "debug" scanner
- * trace - if true (-T), trace processing
- * nowarn - if true (-w), do not generate warnings
- * spprdflt - if true (-s), suppress the default rule
- * interactive - if true (-I), generate an interactive scanner
- * lex_compat - if true (-l), maximize compatibility with AT&T lex
- * posix_compat - if true (-X), maximize compatibility with POSIX lex
- * do_yylineno - if true, generate code to maintain yylineno
- * useecs - if true (-Ce flag), use equivalence classes
- * fulltbl - if true (-Cf flag), don't compress the DFA state table
- * usemecs - if true (-Cm flag), use meta-equivalence classes
- * fullspd - if true (-F flag), use Jacobson method of table representation
- * gen_line_dirs - if true (i.e., no -L flag), generate #line directives
- * performance_report - if > 0 (i.e., -p flag), generate a report relating
- * to scanner performance; if > 1 (-p -p), report on minor performance
- * problems, too
- * backing_up_report - if true (i.e., -b flag), generate "lex.backup" file
- * listing backing-up states
- * C_plus_plus - if true (i.e., -+ flag), generate a C++ scanner class;
- * otherwise, a standard C scanner
- * reentrant - if true (-R), generate a reentrant C scanner.
- * bison_bridge_lval - if true (--bison-bridge), bison pure calling convention.
- * bison_bridge_lloc - if true (--bison-locations), bison yylloc.
- * long_align - if true (-Ca flag), favor long-word alignment.
- * use_read - if true (-f, -F, or -Cr) then use read() for scanner input;
- * otherwise, use fread().
- * yytext_is_array - if true (i.e., %array directive), then declare
- * yytext as a array instead of a character pointer. Nice and inefficient.
- * do_yywrap - do yywrap() processing on EOF. If false, EOF treated as
- * "no more files".
- * csize - size of character set for the scanner we're generating;
- * 128 for 7-bit chars and 256 for 8-bit
- * yymore_used - if true, yymore() is used in input rules
- * reject - if true, generate back-up tables for REJECT macro
- * real_reject - if true, scanner really uses REJECT (as opposed to just
- * having "reject" set for variable trailing context)
- * continued_action - true if this rule's action is to "fall through" to
- * the next rule's action (i.e., the '|' action)
- * in_rule - true if we're inside an individual rule, false if not.
- * yymore_really_used - whether to treat yymore() as really used, regardless
- * of what we think based on references to it in the user's actions.
- * reject_really_used - same for REJECT
- */
-
-extern int printstats, syntaxerror, eofseen, ddebug, trace, nowarn,
- spprdflt;
-extern int interactive, lex_compat, posix_compat, do_yylineno;
-extern int useecs, fulltbl, usemecs, fullspd;
-extern int gen_line_dirs, performance_report, backing_up_report;
-extern int reentrant, bison_bridge_lval, bison_bridge_lloc;
-extern bool ansi_func_defs, ansi_func_protos;
-extern int C_plus_plus, long_align, use_read, yytext_is_array, do_yywrap;
-extern int csize;
-extern int yymore_used, reject, real_reject, continued_action, in_rule;
-
-extern int yymore_really_used, reject_really_used;
-
-
-/* Variables used in the flex input routines:
- * datapos - characters on current output line
- * dataline - number of contiguous lines of data in current data
- * statement. Used to generate readable -f output
- * linenum - current input line number
- * skelfile - the skeleton file
- * skel - compiled-in skeleton array
- * skel_ind - index into "skel" array, if skelfile is nil
- * yyin - input file
- * backing_up_file - file to summarize backing-up states to
- * infilename - name of input file
- * outfilename - name of output file
- * headerfilename - name of the .h file to generate
- * did_outfilename - whether outfilename was explicitly set
- * prefix - the prefix used for externally visible names ("yy" by default)
- * yyclass - yyFlexLexer subclass to use for YY_DECL
- * do_stdinit - whether to initialize yyin/yyout to stdin/stdout
- * use_stdout - the -t flag
- * input_files - array holding names of input files
- * num_input_files - size of input_files array
- * program_name - name with which program was invoked
- *
- * action_array - array to hold the rule actions
- * action_size - size of action_array
- * defs1_offset - index where the user's section 1 definitions start
- * in action_array
- * prolog_offset - index where the prolog starts in action_array
- * action_offset - index where the non-prolog starts in action_array
- * action_index - index where the next action should go, with respect
- * to "action_array"
- */
-
-extern int datapos, dataline, linenum;
-extern FILE *skelfile, *yyin, *backing_up_file;
-extern const char *skel[];
-extern int skel_ind;
-extern char *infilename, *outfilename, *headerfilename;
-extern int did_outfilename;
-extern char *prefix, *yyclass, *extra_type;
-extern int do_stdinit, use_stdout;
-extern char **input_files;
-extern int num_input_files;
-extern char *program_name;
-
-extern char *action_array;
-extern int action_size;
-extern int defs1_offset, prolog_offset, action_offset, action_index;
-
-
-/* Variables for stack of states having only one out-transition:
- * onestate - state number
- * onesym - transition symbol
- * onenext - target state
- * onedef - default base entry
- * onesp - stack pointer
- */
-
-extern int onestate[ONE_STACK_SIZE], onesym[ONE_STACK_SIZE];
-extern int onenext[ONE_STACK_SIZE], onedef[ONE_STACK_SIZE], onesp;
-
-
-/* Variables for nfa machine data:
- * maximum_mns - maximal number of NFA states supported by tables
- * current_mns - current maximum on number of NFA states
- * num_rules - number of the last accepting state; also is number of
- * rules created so far
- * num_eof_rules - number of <<EOF>> rules
- * default_rule - number of the default rule
- * current_max_rules - current maximum number of rules
- * lastnfa - last nfa state number created
- * firstst - physically the first state of a fragment
- * lastst - last physical state of fragment
- * finalst - last logical state of fragment
- * transchar - transition character
- * trans1 - transition state
- * trans2 - 2nd transition state for epsilons
- * accptnum - accepting number
- * assoc_rule - rule associated with this NFA state (or 0 if none)
- * state_type - a STATE_xxx type identifying whether the state is part
- * of a normal rule, the leading state in a trailing context
- * rule (i.e., the state which marks the transition from
- * recognizing the text-to-be-matched to the beginning of
- * the trailing context), or a subsequent state in a trailing
- * context rule
- * rule_type - a RULE_xxx type identifying whether this a ho-hum
- * normal rule or one which has variable head & trailing
- * context
- * rule_linenum - line number associated with rule
- * rule_useful - true if we've determined that the rule can be matched
- * rule_has_nl - true if rule could possibly match a newline
- * ccl_has_nl - true if current ccl could match a newline
- * nlch - default eol char
- */
-
-extern int maximum_mns, current_mns, current_max_rules;
-extern int num_rules, num_eof_rules, default_rule, lastnfa;
-extern int *firstst, *lastst, *finalst, *transchar, *trans1, *trans2;
-extern int *accptnum, *assoc_rule, *state_type;
-extern int *rule_type, *rule_linenum, *rule_useful;
-extern bool *rule_has_nl, *ccl_has_nl;
-extern int nlch;
-
-/* Different types of states; values are useful as masks, as well, for
- * routines like check_trailing_context().
- */
-#define STATE_NORMAL 0x1
-#define STATE_TRAILING_CONTEXT 0x2
-
-/* Global holding current type of state we're making. */
-
-extern int current_state_type;
-
-/* Different types of rules. */
-#define RULE_NORMAL 0
-#define RULE_VARIABLE 1
-
-/* True if the input rules include a rule with both variable-length head
- * and trailing context, false otherwise.
- */
-extern int variable_trailing_context_rules;
-
-
-/* Variables for protos:
- * numtemps - number of templates created
- * numprots - number of protos created
- * protprev - backlink to a more-recently used proto
- * protnext - forward link to a less-recently used proto
- * prottbl - base/def table entry for proto
- * protcomst - common state of proto
- * firstprot - number of the most recently used proto
- * lastprot - number of the least recently used proto
- * protsave contains the entire state array for protos
- */
-
-extern int numtemps, numprots, protprev[MSP], protnext[MSP], prottbl[MSP];
-extern int protcomst[MSP], firstprot, lastprot, protsave[PROT_SAVE_SIZE];
-
-
-/* Variables for managing equivalence classes:
- * numecs - number of equivalence classes
- * nextecm - forward link of Equivalence Class members
- * ecgroup - class number or backward link of EC members
- * nummecs - number of meta-equivalence classes (used to compress
- * templates)
- * tecfwd - forward link of meta-equivalence classes members
- * tecbck - backward link of MEC's
- */
-
-/* Reserve enough room in the equivalence class arrays so that we
- * can use the CSIZE'th element to hold equivalence class information
- * for the NUL character. Later we'll move this information into
- * the 0th element.
- */
-extern int numecs, nextecm[CSIZE + 1], ecgroup[CSIZE + 1], nummecs;
-
-/* Meta-equivalence classes are indexed starting at 1, so it's possible
- * that they will require positions from 1 .. CSIZE, i.e., CSIZE + 1
- * slots total (since the arrays are 0-based). nextecm[] and ecgroup[]
- * don't require the extra position since they're indexed from 1 .. CSIZE - 1.
- */
-extern int tecfwd[CSIZE + 1], tecbck[CSIZE + 1];
-
-
-/* Variables for start conditions:
- * lastsc - last start condition created
- * current_max_scs - current limit on number of start conditions
- * scset - set of rules active in start condition
- * scbol - set of rules active only at the beginning of line in a s.c.
- * scxclu - true if start condition is exclusive
- * sceof - true if start condition has EOF rule
- * scname - start condition name
- */
-
-extern int lastsc, *scset, *scbol, *scxclu, *sceof;
-extern int current_max_scs;
-extern char **scname;
-
-
-/* Variables for dfa machine data:
- * current_max_dfa_size - current maximum number of NFA states in DFA
- * current_max_xpairs - current maximum number of non-template xtion pairs
- * current_max_template_xpairs - current maximum number of template pairs
- * current_max_dfas - current maximum number DFA states
- * lastdfa - last dfa state number created
- * nxt - state to enter upon reading character
- * chk - check value to see if "nxt" applies
- * tnxt - internal nxt table for templates
- * base - offset into "nxt" for given state
- * def - where to go if "chk" disallows "nxt" entry
- * nultrans - NUL transition for each state
- * NUL_ec - equivalence class of the NUL character
- * tblend - last "nxt/chk" table entry being used
- * firstfree - first empty entry in "nxt/chk" table
- * dss - nfa state set for each dfa
- * dfasiz - size of nfa state set for each dfa
- * dfaacc - accepting set for each dfa state (if using REJECT), or accepting
- * number, if not
- * accsiz - size of accepting set for each dfa state
- * dhash - dfa state hash value
- * numas - number of DFA accepting states created; note that this
- * is not necessarily the same value as num_rules, which is the analogous
- * value for the NFA
- * numsnpairs - number of state/nextstate transition pairs
- * jambase - position in base/def where the default jam table starts
- * jamstate - state number corresponding to "jam" state
- * end_of_buffer_state - end-of-buffer dfa state number
- */
-
-extern int current_max_dfa_size, current_max_xpairs;
-extern int current_max_template_xpairs, current_max_dfas;
-extern int lastdfa, *nxt, *chk, *tnxt;
-extern int *base, *def, *nultrans, NUL_ec, tblend, firstfree, **dss,
- *dfasiz;
-extern union dfaacc_union {
- int *dfaacc_set;
- int dfaacc_state;
-} *dfaacc;
-extern int *accsiz, *dhash, numas;
-extern int numsnpairs, jambase, jamstate;
-extern int end_of_buffer_state;
-
-/* Variables for ccl information:
- * lastccl - ccl index of the last created ccl
- * current_maxccls - current limit on the maximum number of unique ccl's
- * cclmap - maps a ccl index to its set pointer
- * ccllen - gives the length of a ccl
- * cclng - true for a given ccl if the ccl is negated
- * cclreuse - counts how many times a ccl is re-used
- * current_max_ccl_tbl_size - current limit on number of characters needed
- * to represent the unique ccl's
- * ccltbl - holds the characters in each ccl - indexed by cclmap
- */
-
-extern int lastccl, *cclmap, *ccllen, *cclng, cclreuse;
-extern int current_maxccls, current_max_ccl_tbl_size;
-extern Char *ccltbl;
-
-
-/* Variables for miscellaneous information:
- * nmstr - last NAME scanned by the scanner
- * sectnum - section number currently being parsed
- * nummt - number of empty nxt/chk table entries
- * hshcol - number of hash collisions detected by snstods
- * dfaeql - number of times a newly created dfa was equal to an old one
- * numeps - number of epsilon NFA states created
- * eps2 - number of epsilon states which have 2 out-transitions
- * num_reallocs - number of times it was necessary to realloc() a group
- * of arrays
- * tmpuses - number of DFA states that chain to templates
- * totnst - total number of NFA states used to make DFA states
- * peakpairs - peak number of transition pairs we had to store internally
- * numuniq - number of unique transitions
- * numdup - number of duplicate transitions
- * hshsave - number of hash collisions saved by checking number of states
- * num_backing_up - number of DFA states requiring backing up
- * bol_needed - whether scanner needs beginning-of-line recognition
- */
-
-extern char nmstr[MAXLINE];
-extern int sectnum, nummt, hshcol, dfaeql, numeps, eps2, num_reallocs;
-extern int tmpuses, totnst, peakpairs, numuniq, numdup, hshsave;
-extern int num_backing_up, bol_needed;
-
-void *allocate_array PROTO ((int, size_t));
-void *reallocate_array PROTO ((void *, int, size_t));
-
-void *flex_alloc PROTO ((size_t));
-void *flex_realloc PROTO ((void *, size_t));
-void flex_free PROTO ((void *));
-
-#define allocate_integer_array(size) \
- (int *) allocate_array( size, sizeof( int ) )
-
-#define reallocate_integer_array(array,size) \
- (int *) reallocate_array( (void *) array, size, sizeof( int ) )
-
-#define allocate_bool_array(size) \
- (bool *) allocate_array( size, sizeof( bool ) )
-
-#define reallocate_bool_array(array,size) \
- (bool *) reallocate_array( (void *) array, size, sizeof( bool ) )
-
-#define allocate_int_ptr_array(size) \
- (int **) allocate_array( size, sizeof( int * ) )
-
-#define allocate_char_ptr_array(size) \
- (char **) allocate_array( size, sizeof( char * ) )
-
-#define allocate_dfaacc_union(size) \
- (union dfaacc_union *) \
- allocate_array( size, sizeof( union dfaacc_union ) )
-
-#define reallocate_int_ptr_array(array,size) \
- (int **) reallocate_array( (void *) array, size, sizeof( int * ) )
-
-#define reallocate_char_ptr_array(array,size) \
- (char **) reallocate_array( (void *) array, size, sizeof( char * ) )
-
-#define reallocate_dfaacc_union(array, size) \
- (union dfaacc_union *) \
- reallocate_array( (void *) array, size, sizeof( union dfaacc_union ) )
-
-#define allocate_character_array(size) \
- (char *) allocate_array( size, sizeof( char ) )
-
-#define reallocate_character_array(array,size) \
- (char *) reallocate_array( (void *) array, size, sizeof( char ) )
-
-#define allocate_Character_array(size) \
- (Char *) allocate_array( size, sizeof( Char ) )
-
-#define reallocate_Character_array(array,size) \
- (Char *) reallocate_array( (void *) array, size, sizeof( Char ) )
-
-
-/* Used to communicate between scanner and parser. The type should really
- * be YYSTYPE, but we can't easily get our hands on it.
- */
-extern int yylval;
-
-
-/* External functions that are cross-referenced among the flex source files. */
-
-
-/* from file ccl.c */
-
-extern void ccladd PROTO ((int, int)); /* add a single character to a ccl */
-extern int cclinit PROTO ((void)); /* make an empty ccl */
-extern void cclnegate PROTO ((int)); /* negate a ccl */
-extern int ccl_set_diff (int a, int b); /* set difference of two ccls. */
-extern int ccl_set_union (int a, int b); /* set union of two ccls. */
-
-/* List the members of a set of characters in CCL form. */
-extern void list_character_set PROTO ((FILE *, int[]));
-
-
-/* from file dfa.c */
-
-/* Check a DFA state for backing up. */
-extern void check_for_backing_up PROTO ((int, int[]));
-
-/* Check to see if NFA state set constitutes "dangerous" trailing context. */
-extern void check_trailing_context PROTO ((int *, int, int *, int));
-
-/* Construct the epsilon closure of a set of ndfa states. */
-extern int *epsclosure PROTO ((int *, int *, int[], int *, int *));
-
-/* Increase the maximum number of dfas. */
-extern void increase_max_dfas PROTO ((void));
-
-extern void ntod PROTO ((void)); /* convert a ndfa to a dfa */
-
-/* Converts a set of ndfa states into a dfa state. */
-extern int snstods PROTO ((int[], int, int[], int, int, int *));
-
-
-/* from file ecs.c */
-
-/* Convert character classes to set of equivalence classes. */
-extern void ccl2ecl PROTO ((void));
-
-/* Associate equivalence class numbers with class members. */
-extern int cre8ecs PROTO ((int[], int[], int));
-
-/* Update equivalence classes based on character class transitions. */
-extern void mkeccl PROTO ((Char[], int, int[], int[], int, int));
-
-/* Create equivalence class for single character. */
-extern void mkechar PROTO ((int, int[], int[]));
-
-
-/* from file gen.c */
-
-extern void do_indent PROTO ((void)); /* indent to the current level */
-
-/* Generate the code to keep backing-up information. */
-extern void gen_backing_up PROTO ((void));
-
-/* Generate the code to perform the backing up. */
-extern void gen_bu_action PROTO ((void));
-
-/* Generate full speed compressed transition table. */
-extern void genctbl PROTO ((void));
-
-/* Generate the code to find the action number. */
-extern void gen_find_action PROTO ((void));
-
-extern void genftbl PROTO ((void)); /* generate full transition table */
-
-/* Generate the code to find the next compressed-table state. */
-extern void gen_next_compressed_state PROTO ((char *));
-
-/* Generate the code to find the next match. */
-extern void gen_next_match PROTO ((void));
-
-/* Generate the code to find the next state. */
-extern void gen_next_state PROTO ((int));
-
-/* Generate the code to make a NUL transition. */
-extern void gen_NUL_trans PROTO ((void));
-
-/* Generate the code to find the start state. */
-extern void gen_start_state PROTO ((void));
-
-/* Generate data statements for the transition tables. */
-extern void gentabs PROTO ((void));
-
-/* Write out a formatted string at the current indentation level. */
-extern void indent_put2s PROTO ((const char *, const char *));
-
-/* Write out a string + newline at the current indentation level. */
-extern void indent_puts PROTO ((const char *));
-
-extern void make_tables PROTO ((void)); /* generate transition tables */
-
-
-/* from file main.c */
-
-extern void check_options PROTO ((void));
-extern void flexend PROTO ((int));
-extern void usage PROTO ((void));
-
-
-/* from file misc.c */
-
-/* Add a #define to the action file. */
-extern void action_define PROTO ((const char *defname, int value));
-
-/* Add the given text to the stored actions. */
-extern void add_action PROTO ((const char *new_text));
-
-/* True if a string is all lower case. */
-extern int all_lower PROTO ((register char *));
-
-/* True if a string is all upper case. */
-extern int all_upper PROTO ((register char *));
-
-/* Compare two integers for use by qsort. */
-extern int intcmp PROTO ((const void *, const void *));
-
-/* Check a character to make sure it's in the expected range. */
-extern void check_char PROTO ((int c));
-
-/* Replace upper-case letter to lower-case. */
-extern Char clower PROTO ((int));
-
-/* Returns a dynamically allocated copy of a string. */
-extern char *copy_string PROTO ((register const char *));
-
-/* Returns a dynamically allocated copy of a (potentially) unsigned string. */
-extern Char *copy_unsigned_string PROTO ((register Char *));
-
-/* Compare two characters for use by qsort with '\0' sorting last. */
-extern int cclcmp PROTO ((const void *, const void *));
-
-/* Finish up a block of data declarations. */
-extern void dataend PROTO ((void));
-
-/* Flush generated data statements. */
-extern void dataflush PROTO ((void));
-
-/* Report an error message and terminate. */
-extern void flexerror PROTO ((const char *));
-
-/* Report a fatal error message and terminate. */
-extern void flexfatal PROTO ((const char *));
-
-/* Report a fatal error with a pinpoint, and terminate */
-#if HAVE_DECL___FUNC__
-#define flex_die(msg) \
- do{ \
- fprintf (stderr,\
- _("%s: fatal internal error at %s:%d (%s): %s\n"),\
- program_name, __FILE__, (int)__LINE__,\
- __func__,msg);\
- FLEX_EXIT(1);\
- }while(0)
-#else /* ! HAVE_DECL___FUNC__ */
-#define flex_die(msg) \
- do{ \
- fprintf (stderr,\
- _("%s: fatal internal error at %s:%d %s\n"),\
- program_name, __FILE__, (int)__LINE__,\
- msg);\
- FLEX_EXIT(1);\
- }while(0)
-#endif /* ! HAVE_DECL___func__ */
-
-/* Convert a hexadecimal digit string to an integer value. */
-extern int htoi PROTO ((Char[]));
-
-/* Report an error message formatted with one integer argument. */
-extern void lerrif PROTO ((const char *, int));
-
-/* Report an error message formatted with one string argument. */
-extern void lerrsf PROTO ((const char *, const char *));
-
-/* Like lerrsf, but also exit after displaying message. */
-extern void lerrsf_fatal PROTO ((const char *, const char *));
-
-/* Spit out a "#line" statement. */
-extern void line_directive_out PROTO ((FILE *, int));
-
-/* Mark the current position in the action array as the end of the section 1
- * user defs.
- */
-extern void mark_defs1 PROTO ((void));
-
-/* Mark the current position in the action array as the end of the prolog. */
-extern void mark_prolog PROTO ((void));
-
-/* Generate a data statment for a two-dimensional array. */
-extern void mk2data PROTO ((int));
-
-extern void mkdata PROTO ((int)); /* generate a data statement */
-
-/* Return the integer represented by a string of digits. */
-extern int myctoi PROTO ((const char *));
-
-/* Return character corresponding to escape sequence. */
-extern Char myesc PROTO ((Char[]));
-
-/* Convert an octal digit string to an integer value. */
-extern int otoi PROTO ((Char[]));
-
-/* Output a (possibly-formatted) string to the generated scanner. */
-extern void out PROTO ((const char *));
-extern void out_dec PROTO ((const char *, int));
-extern void out_dec2 PROTO ((const char *, int, int));
-extern void out_hex PROTO ((const char *, unsigned int));
-extern void out_str PROTO ((const char *, const char *));
-extern void out_str3
-PROTO ((const char *, const char *, const char *, const char *));
-extern void out_str_dec PROTO ((const char *, const char *, int));
-extern void outc PROTO ((int));
-extern void outn PROTO ((const char *));
-extern void out_m4_define (const char* def, const char* val);
-
-/* Return a printable version of the given character, which might be
- * 8-bit.
- */
-extern char *readable_form PROTO ((int));
-
-/* Write out one section of the skeleton file. */
-extern void skelout PROTO ((void));
-
-/* Output a yy_trans_info structure. */
-extern void transition_struct_out PROTO ((int, int));
-
-/* Only needed when using certain broken versions of bison to build parse.c. */
-extern void *yy_flex_xmalloc PROTO ((int));
-
-/* Set a region of memory to 0. */
-extern void zero_out PROTO ((char *, size_t));
-
-
-/* from file nfa.c */
-
-/* Add an accepting state to a machine. */
-extern void add_accept PROTO ((int, int));
-
-/* Make a given number of copies of a singleton machine. */
-extern int copysingl PROTO ((int, int));
-
-/* Debugging routine to write out an nfa. */
-extern void dumpnfa PROTO ((int));
-
-/* Finish up the processing for a rule. */
-extern void finish_rule PROTO ((int, int, int, int, int));
-
-/* Connect two machines together. */
-extern int link_machines PROTO ((int, int));
-
-/* Mark each "beginning" state in a machine as being a "normal" (i.e.,
- * not trailing context associated) state.
- */
-extern void mark_beginning_as_normal PROTO ((register int));
-
-/* Make a machine that branches to two machines. */
-extern int mkbranch PROTO ((int, int));
-
-extern int mkclos PROTO ((int)); /* convert a machine into a closure */
-extern int mkopt PROTO ((int)); /* make a machine optional */
-
-/* Make a machine that matches either one of two machines. */
-extern int mkor PROTO ((int, int));
-
-/* Convert a machine into a positive closure. */
-extern int mkposcl PROTO ((int));
-
-extern int mkrep PROTO ((int, int, int)); /* make a replicated machine */
-
-/* Create a state with a transition on a given symbol. */
-extern int mkstate PROTO ((int));
-
-extern void new_rule PROTO ((void)); /* initialize for a new rule */
-
-
-/* from file parse.y */
-
-/* Build the "<<EOF>>" action for the active start conditions. */
-extern void build_eof_action PROTO ((void));
-
-/* Write out a message formatted with one string, pinpointing its location. */
-extern void format_pinpoint_message PROTO ((const char *, const char *));
-
-/* Write out a message, pinpointing its location. */
-extern void pinpoint_message PROTO ((const char *));
-
-/* Write out a warning, pinpointing it at the given line. */
-extern void line_warning PROTO ((const char *, int));
-
-/* Write out a message, pinpointing it at the given line. */
-extern void line_pinpoint PROTO ((const char *, int));
-
-/* Report a formatted syntax error. */
-extern void format_synerr PROTO ((const char *, const char *));
-extern void synerr PROTO ((const char *)); /* report a syntax error */
-extern void format_warn PROTO ((const char *, const char *));
-extern void warn PROTO ((const char *)); /* report a warning */
-extern void yyerror PROTO ((const char *)); /* report a parse error */
-extern int yyparse PROTO ((void)); /* the YACC parser */
-
-
-/* from file scan.l */
-
-/* The Flex-generated scanner for flex. */
-extern int flexscan PROTO ((void));
-
-/* Open the given file (if NULL, stdin) for scanning. */
-extern void set_input_file PROTO ((char *));
-
-/* Wrapup a file in the lexical analyzer. */
-extern int yywrap PROTO ((void));
-
-
-/* from file sym.c */
-
-/* Save the text of a character class. */
-extern void cclinstal PROTO ((Char[], int));
-
-/* Lookup the number associated with character class. */
-extern int ccllookup PROTO ((Char[]));
-
-extern void ndinstal PROTO ((const char *, Char[])); /* install a name definition */
-extern Char *ndlookup PROTO ((const char *)); /* lookup a name definition */
-
-/* Increase maximum number of SC's. */
-extern void scextend PROTO ((void));
-extern void scinstal PROTO ((const char *, int)); /* make a start condition */
-
-/* Lookup the number associated with a start condition. */
-extern int sclookup PROTO ((const char *));
-
-
-/* from file tblcmp.c */
-
-/* Build table entries for dfa state. */
-extern void bldtbl PROTO ((int[], int, int, int, int));
-
-extern void cmptmps PROTO ((void)); /* compress template table entries */
-extern void expand_nxt_chk PROTO ((void)); /* increase nxt/chk arrays */
-
-/* Finds a space in the table for a state to be placed. */
-extern int find_table_space PROTO ((int *, int));
-extern void inittbl PROTO ((void)); /* initialize transition tables */
-
-/* Make the default, "jam" table entries. */
-extern void mkdeftbl PROTO ((void));
-
-/* Create table entries for a state (or state fragment) which has
- * only one out-transition.
- */
-extern void mk1tbl PROTO ((int, int, int, int));
-
-/* Place a state into full speed transition table. */
-extern void place_state PROTO ((int *, int, int));
-
-/* Save states with only one out-transition to be processed later. */
-extern void stack1 PROTO ((int, int, int, int));
-
-
-/* from file yylex.c */
-
-extern int yylex PROTO ((void));
-
-/* A growable array. See buf.c. */
-struct Buf {
- void *elts; /* elements. */
- int nelts; /* number of elements. */
- size_t elt_size; /* in bytes. */
- int nmax; /* max capacity of elements. */
-};
-
-extern void buf_init PROTO ((struct Buf * buf, size_t elem_size));
-extern void buf_destroy PROTO ((struct Buf * buf));
-extern struct Buf *buf_append
-PROTO ((struct Buf * buf, const void *ptr, int n_elem));
-extern struct Buf *buf_concat PROTO((struct Buf* dest, const struct Buf* src));
-extern struct Buf *buf_strappend PROTO ((struct Buf *, const char *str));
-extern struct Buf *buf_strnappend
-PROTO ((struct Buf *, const char *str, int nchars));
-extern struct Buf *buf_strdefine
-PROTO ((struct Buf * buf, const char *str, const char *def));
-extern struct Buf *buf_prints PROTO((struct Buf *buf, const char *fmt, const char* s));
-extern struct Buf *buf_m4_define PROTO((struct Buf *buf, const char* def, const char* val));
-extern struct Buf *buf_m4_undefine PROTO((struct Buf *buf, const char* def));
-extern struct Buf *buf_print_strings PROTO((struct Buf * buf, FILE* out));
-extern struct Buf *buf_linedir PROTO((struct Buf *buf, const char* filename, int lineno));
-
-extern struct Buf userdef_buf; /* a string buffer for #define's generated by user-options on cmd line. */
-extern struct Buf defs_buf; /* a char* buffer to save #define'd some symbols generated by flex. */
-extern struct Buf yydmap_buf; /* a string buffer to hold yydmap elements */
-extern struct Buf m4defs_buf; /* Holds m4 definitions. */
-extern struct Buf top_buf; /* contains %top code. String buffer. */
-
-/* For blocking out code from the header file. */
-#define OUT_BEGIN_CODE() outn("m4_ifdef( [[M4_YY_IN_HEADER]],,[[")
-#define OUT_END_CODE() outn("]])")
-
-/* For setjmp/longjmp (instead of calling exit(2)). Linkage in main.c */
-extern jmp_buf flex_main_jmp_buf;
-
-#define FLEX_EXIT(status) longjmp(flex_main_jmp_buf,(status)+1)
-
-/* Removes all \n and \r chars from tail of str. returns str. */
-extern char *chomp (char *str);
-
-/* ctype functions forced to return boolean */
-#define b_isalnum(c) (isalnum(c)?true:false)
-#define b_isalpha(c) (isalpha(c)?true:false)
-#define b_isascii(c) (isascii(c)?true:false)
-#define b_isblank(c) (isblank(c)?true:false)
-#define b_iscntrl(c) (iscntrl(c)?true:false)
-#define b_isdigit(c) (isdigit(c)?true:false)
-#define b_isgraph(c) (isgraph(c)?true:false)
-#define b_islower(c) (islower(c)?true:false)
-#define b_isprint(c) (isprint(c)?true:false)
-#define b_ispunct(c) (ispunct(c)?true:false)
-#define b_isspace(c) (isspace(c)?true:false)
-#define b_isupper(c) (isupper(c)?true:false)
-#define b_isxdigit(c) (isxdigit(c)?true:false)
-
-/* return true if char is uppercase or lowercase. */
-bool has_case(int c);
-
-/* Change case of character if possible. */
-int reverse_case(int c);
-
-/* return false if [c1-c2] is ambiguous for a caseless scanner. */
-bool range_covers_case (int c1, int c2);
-
-/*
- * From "filter.c"
- */
-
-/** A single stdio filter to execute.
- * The filter may be external, such as "sed", or it
- * may be internal, as a function call.
- */
-struct filter {
- int (*filter_func)(struct filter*); /**< internal filter function */
- void * extra; /**< extra data passed to filter_func */
- int argc; /**< arg count */
- const char ** argv; /**< arg vector, \0-terminated */
- struct filter * next; /**< next filter or NULL */
-};
-
-/* output filter chain */
-extern struct filter * output_chain;
-extern struct filter *filter_create_ext PROTO((struct filter * chain, const char *cmd, ...));
-struct filter *filter_create_int PROTO((struct filter *chain,
- int (*filter_func) (struct filter *),
- void *extra));
-extern bool filter_apply_chain PROTO((struct filter * chain));
-extern int filter_truncate (struct filter * chain, int max_len);
-extern int filter_tee_header PROTO((struct filter *chain));
-extern int filter_fix_linedirs PROTO((struct filter *chain));
-
-
-/*
- * From "regex.c"
- */
-
-extern regex_t regex_linedir, regex_blank_line;
-bool flex_init_regex(void);
-void flex_regcomp(regex_t *preg, const char *regex, int cflags);
-char *regmatch_dup (regmatch_t * m, const char *src);
-char *regmatch_cpy (regmatch_t * m, char *dest, const char *src);
-int regmatch_len (regmatch_t * m);
-int regmatch_strtol (regmatch_t * m, const char *src, char **endptr, int base);
-bool regmatch_empty (regmatch_t * m);
-
-/* From "scanflags.h" */
-typedef unsigned int scanflags_t;
-extern scanflags_t* _sf_stk;
-extern size_t _sf_top_ix, _sf_max; /**< stack of scanner flags. */
-#define _SF_CASE_INS 0x0001
-#define _SF_DOT_ALL 0x0002
-#define _SF_SKIP_WS 0x0004
-#define sf_top() (_sf_stk[_sf_top_ix])
-#define sf_case_ins() (sf_top() & _SF_CASE_INS)
-#define sf_dot_all() (sf_top() & _SF_DOT_ALL)
-#define sf_skip_ws() (sf_top() & _SF_SKIP_WS)
-#define sf_set_case_ins(X) ((X) ? (sf_top() |= _SF_CASE_INS) : (sf_top() &= ~_SF_CASE_INS))
-#define sf_set_dot_all(X) ((X) ? (sf_top() |= _SF_DOT_ALL) : (sf_top() &= ~_SF_DOT_ALL))
-#define sf_set_skip_ws(X) ((X) ? (sf_top() |= _SF_SKIP_WS) : (sf_top() &= ~_SF_SKIP_WS))
-extern void sf_init(void);
-extern void sf_push(void);
-extern void sf_pop(void);
-
-
-#endif /* not defined FLEXDEF_H */
Deleted: trunk/contrib/flex/flexint.h
===================================================================
--- trunk/contrib/flex/flexint.h 2018-09-12 01:37:07 UTC (rev 12025)
+++ trunk/contrib/flex/flexint.h 2018-09-12 01:40:59 UTC (rev 12026)
@@ -1,64 +0,0 @@
-/* flex integer type definitions */
-
-#ifndef FLEXINT_H
-#define FLEXINT_H
-
-/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
-
-#if defined(__FreeBSD__) || \
- (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 */
Deleted: trunk/contrib/flex/libyywrap.c
===================================================================
--- trunk/contrib/flex/libyywrap.c 2018-09-12 01:37:07 UTC (rev 12025)
+++ trunk/contrib/flex/libyywrap.c 2018-09-12 01:40:59 UTC (rev 12026)
@@ -1,29 +0,0 @@
-/* libyywrap - flex run-time support library "yywrap" function */
-
-/* This file is part of flex. */
-
-/* Redistribution and use in source and binary forms, with or without */
-/* modification, are permitted provided that the following conditions */
-/* are met: */
-
-/* 1. Redistributions of source code must retain the above copyright */
-/* notice, this list of conditions and the following disclaimer. */
-/* 2. Redistributions in binary form must reproduce the above copyright */
-/* notice, this list of conditions and the following disclaimer in the */
-/* documentation and/or other materials provided with the distribution. */
-
-/* Neither the name of the University nor the names of its contributors */
-/* may be used to endorse or promote products derived from this software */
-/* without specific prior written permission. */
-
-/* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR */
-/* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED */
-/* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */
-/* PURPOSE. */
-
-int yywrap (void);
-
-int yywrap (void)
-{
- return 1;
-}
Deleted: trunk/contrib/flex/main.c
===================================================================
--- trunk/contrib/flex/main.c 2018-09-12 01:37:07 UTC (rev 12025)
+++ trunk/contrib/flex/main.c 2018-09-12 01:40:59 UTC (rev 12026)
@@ -1,1858 +0,0 @@
-/* flex - tool to generate fast lexical analyzers */
-
-/* Copyright (c) 1990 The Regents of the University of California. */
-/* All rights reserved. */
-
-/* This code is derived from software contributed to Berkeley by */
-/* Vern Paxson. */
-
-/* The United States Government has rights in this work pursuant */
-/* to contract no. DE-AC03-76SF00098 between the United States */
-/* Department of Energy and the University of California. */
-
-/* This file is part of flex. */
-
-/* Redistribution and use in source and binary forms, with or without */
-/* modification, are permitted provided that the following conditions */
-/* are met: */
-
-/* 1. Redistributions of source code must retain the above copyright */
-/* notice, this list of conditions and the following disclaimer. */
-/* 2. Redistributions in binary form must reproduce the above copyright */
-/* notice, this list of conditions and the following disclaimer in the */
-/* documentation and/or other materials provided with the distribution. */
-
-/* Neither the name of the University nor the names of its contributors */
-/* may be used to endorse or promote products derived from this software */
-/* without specific prior written permission. */
-
-/* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR */
-/* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED */
-/* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */
-/* PURPOSE. */
-
-
-#include "flexdef.h"
-#include "version.h"
-#include "options.h"
-#include "tables.h"
-
-static char flex_version[] = FLEX_VERSION;
-
-/* declare functions that have forward references */
-
-void flexinit PROTO ((int, char **));
-void readin PROTO ((void));
-void set_up_initial_allocations PROTO ((void));
-static char *basename2 PROTO ((char *path, int should_strip_ext));
-
-
-/* these globals are all defined and commented in flexdef.h */
-int printstats, syntaxerror, eofseen, ddebug, trace, nowarn, spprdflt;
-int interactive, lex_compat, posix_compat, do_yylineno,
- useecs, fulltbl, usemecs;
-int fullspd, gen_line_dirs, performance_report, backing_up_report;
-int C_plus_plus, long_align, use_read, yytext_is_array, do_yywrap,
- csize;
-int reentrant, bison_bridge_lval, bison_bridge_lloc;
-int yymore_used, reject, real_reject, continued_action, in_rule;
-int yymore_really_used, reject_really_used;
-int datapos, dataline, linenum;
-FILE *skelfile = NULL;
-int skel_ind = 0;
-char *action_array;
-int action_size, defs1_offset, prolog_offset, action_offset,
- action_index;
-char *infilename = NULL, *outfilename = NULL, *headerfilename = NULL;
-int did_outfilename;
-char *prefix, *yyclass, *extra_type = NULL;
-int do_stdinit, use_stdout;
-int onestate[ONE_STACK_SIZE], onesym[ONE_STACK_SIZE];
-int onenext[ONE_STACK_SIZE], onedef[ONE_STACK_SIZE], onesp;
-int maximum_mns, current_mns, current_max_rules;
-int num_rules, num_eof_rules, default_rule, lastnfa;
-int *firstst, *lastst, *finalst, *transchar, *trans1, *trans2;
-int *accptnum, *assoc_rule, *state_type;
-int *rule_type, *rule_linenum, *rule_useful;
-int current_state_type;
-int variable_trailing_context_rules;
-int numtemps, numprots, protprev[MSP], protnext[MSP], prottbl[MSP];
-int protcomst[MSP], firstprot, lastprot, protsave[PROT_SAVE_SIZE];
-int numecs, nextecm[CSIZE + 1], ecgroup[CSIZE + 1], nummecs,
- tecfwd[CSIZE + 1];
-int tecbck[CSIZE + 1];
-int lastsc, *scset, *scbol, *scxclu, *sceof;
-int current_max_scs;
-char **scname;
-int current_max_dfa_size, current_max_xpairs;
-int current_max_template_xpairs, current_max_dfas;
-int lastdfa, *nxt, *chk, *tnxt;
-int *base, *def, *nultrans, NUL_ec, tblend, firstfree, **dss, *dfasiz;
-union dfaacc_union *dfaacc;
-int *accsiz, *dhash, numas;
-int numsnpairs, jambase, jamstate;
-int lastccl, *cclmap, *ccllen, *cclng, cclreuse;
-int current_maxccls, current_max_ccl_tbl_size;
-Char *ccltbl;
-char nmstr[MAXLINE];
-int sectnum, nummt, hshcol, dfaeql, numeps, eps2, num_reallocs;
-int tmpuses, totnst, peakpairs, numuniq, numdup, hshsave;
-int num_backing_up, bol_needed;
-FILE *backing_up_file;
-int end_of_buffer_state;
-char **input_files;
-int num_input_files;
-jmp_buf flex_main_jmp_buf;
-bool *rule_has_nl, *ccl_has_nl;
-int nlch = '\n';
-bool ansi_func_defs, ansi_func_protos;
-
-bool tablesext, tablesverify, gentables;
-char *tablesfilename=0,*tablesname=0;
-struct yytbl_writer tableswr;
-
-/* Make sure program_name is initialized so we don't crash if writing
- * out an error message before getting the program name from argv[0].
- */
-char *program_name = "flex";
-
-#ifndef SHORT_FILE_NAMES
-static char *outfile_template = "lex.%s.%s";
-static char *backing_name = "lex.backup";
-static char *tablesfile_template = "lex.%s.tables";
-#else
-static char *outfile_template = "lex%s.%s";
-static char *backing_name = "lex.bck";
-static char *tablesfile_template = "lex%s.tbl";
-#endif
-
-#ifdef MS_DOS
-extern unsigned _stklen = 16384;
-#endif
-
-/* From scan.l */
-extern FILE* yyout;
-
-static char outfile_path[MAXLINE];
-static int outfile_created = 0;
-static char *skelname = NULL;
-static int _stdout_closed = 0; /* flag to prevent double-fclose() on stdout. */
-const char *escaped_qstart = "[[]]M4_YY_NOOP[M4_YY_NOOP[M4_YY_NOOP[[]]";
-const char *escaped_qend = "[[]]M4_YY_NOOP]M4_YY_NOOP]M4_YY_NOOP[[]]";
-
-/* For debugging. The max number of filters to apply to skeleton. */
-static int preproc_level = 1000;
-
-int flex_main PROTO ((int argc, char *argv[]));
-int main PROTO ((int argc, char *argv[]));
-
-int flex_main (argc, argv)
- int argc;
- char *argv[];
-{
- int i, exit_status, child_status;
-
- /* Set a longjmp target. Yes, I know it's a hack, but it gets worse: The
- * return value of setjmp, if non-zero, is the desired exit code PLUS ONE.
- * For example, if you want 'main' to return with code '2', then call
- * longjmp() with an argument of 3. This is because it is invalid to
- * specify a value of 0 to longjmp. FLEX_EXIT(n) should be used instead of
- * exit(n);
- */
- exit_status = setjmp (flex_main_jmp_buf);
- if (exit_status){
- if (stdout && !_stdout_closed && !ferror(stdout)){
- fflush(stdout);
- fclose(stdout);
- }
- while (wait(&child_status) > 0){
- if (!WIFEXITED (child_status)
- || WEXITSTATUS (child_status) != 0){
- /* report an error of a child
- */
- if( exit_status <= 1 )
- exit_status = 2;
-
- }
- }
- return exit_status - 1;
- }
-
- flexinit (argc, argv);
-
- readin ();
-
- skelout ();
- /* %% [1.5] DFA */
- ntod ();
-
- for (i = 1; i <= num_rules; ++i)
- if (!rule_useful[i] && i != default_rule)
- line_warning (_("rule cannot be matched"),
- rule_linenum[i]);
-
- if (spprdflt && !reject && rule_useful[default_rule])
- line_warning (_
- ("-s option given but default rule can be matched"),
- rule_linenum[default_rule]);
-
- /* Generate the C state transition tables from the DFA. */
- make_tables ();
-
- /* Note, flexend does not return. It exits with its argument
- * as status.
- */
- flexend (0);
-
- return 0; /* keep compilers/lint happy */
-}
-
-/* Wrapper around flex_main, so flex_main can be built as a library. */
-int main (argc, argv)
- int argc;
- char *argv[];
-{
-#if ENABLE_NLS
-#if HAVE_LOCALE_H
- setlocale (LC_MESSAGES, "");
- setlocale (LC_CTYPE, "");
- textdomain (PACKAGE);
- bindtextdomain (PACKAGE, LOCALEDIR);
-#endif
-#endif
-
- return flex_main (argc, argv);
-}
-
-/* check_options - check user-specified options */
-
-void check_options ()
-{
- int i;
- const char * m4 = NULL;
-
- if (lex_compat) {
- if (C_plus_plus)
- flexerror (_("Can't use -+ with -l option"));
-
- if (fulltbl || fullspd)
- flexerror (_("Can't use -f or -F with -l option"));
-
- if (reentrant || bison_bridge_lval)
- flexerror (_
- ("Can't use --reentrant or --bison-bridge with -l option"));
-
- yytext_is_array = true;
- do_yylineno = true;
- use_read = false;
- }
-
-
-#if 0
- /* This makes no sense whatsoever. I'm removing it. */
- if (do_yylineno)
- /* This should really be "maintain_backup_tables = true" */
- reject_really_used = true;
-#endif
-
- if (csize == unspecified) {
- if ((fulltbl || fullspd) && !useecs)
- csize = DEFAULT_CSIZE;
- else
- csize = CSIZE;
- }
-
- if (interactive == unspecified) {
- if (fulltbl || fullspd)
- interactive = false;
- else
- interactive = true;
- }
-
- if (fulltbl || fullspd) {
- if (usemecs)
- flexerror (_
- ("-Cf/-CF and -Cm don't make sense together"));
-
- if (interactive)
- flexerror (_("-Cf/-CF and -I are incompatible"));
-
- if (lex_compat)
- flexerror (_
- ("-Cf/-CF are incompatible with lex-compatibility mode"));
-
-
- if (fulltbl && fullspd)
- flexerror (_
- ("-Cf and -CF are mutually exclusive"));
- }
-
- if (C_plus_plus && fullspd)
- flexerror (_("Can't use -+ with -CF option"));
-
- if (C_plus_plus && yytext_is_array) {
- warn (_("%array incompatible with -+ option"));
- yytext_is_array = false;
- }
-
- if (C_plus_plus && (reentrant))
- flexerror (_("Options -+ and --reentrant are mutually exclusive."));
-
- if (C_plus_plus && bison_bridge_lval)
- flexerror (_("bison bridge not supported for the C++ scanner."));
-
-
- if (useecs) { /* Set up doubly-linked equivalence classes. */
-
- /* We loop all the way up to csize, since ecgroup[csize] is
- * the position used for NUL characters.
- */
- ecgroup[1] = NIL;
-
- for (i = 2; i <= csize; ++i) {
- ecgroup[i] = i - 1;
- nextecm[i - 1] = i;
- }
-
- nextecm[csize] = NIL;
- }
-
- else {
- /* Put everything in its own equivalence class. */
- for (i = 1; i <= csize; ++i) {
- ecgroup[i] = i;
- nextecm[i] = BAD_SUBSCRIPT; /* to catch errors */
- }
- }
-
- if (!ansi_func_defs)
- buf_m4_define( &m4defs_buf, "M4_YY_NO_ANSI_FUNC_DEFS", NULL);
-
- if (!ansi_func_protos)
- buf_m4_define( &m4defs_buf, "M4_YY_NO_ANSI_FUNC_PROTOS", NULL);
-
- if (extra_type)
- buf_m4_define( &m4defs_buf, "M4_EXTRA_TYPE_DEFS", extra_type);
-
- if (!use_stdout) {
- FILE *prev_stdout;
-
- if (!did_outfilename) {
- char *suffix;
-
- if (C_plus_plus)
- suffix = "cc";
- else
- suffix = "c";
-
- snprintf (outfile_path, sizeof(outfile_path), outfile_template,
- prefix, suffix);
-
- outfilename = outfile_path;
- }
-
- prev_stdout = freopen (outfilename, "w+", stdout);
-
- if (prev_stdout == NULL)
- lerrsf (_("could not create %s"), outfilename);
-
- outfile_created = 1;
- }
-
-
- /* Setup the filter chain. */
- output_chain = filter_create_int(NULL, filter_tee_header, headerfilename);
- if ( !(m4 = getenv("M4")))
- m4 = M4;
- filter_create_ext(output_chain, m4, "-gP", 0);
- filter_create_int(output_chain, filter_fix_linedirs, NULL);
-
- /* For debugging, only run the requested number of filters. */
- if (preproc_level > 0) {
- filter_truncate(output_chain, preproc_level);
- filter_apply_chain(output_chain);
- }
- yyout = stdout;
-
-
- /* always generate the tablesverify flag. */
- buf_m4_define (&m4defs_buf, "M4_YY_TABLES_VERIFY", tablesverify ? "1" : "0");
- if (tablesext)
- gentables = false;
-
- if (tablesverify)
- /* force generation of C tables. */
- gentables = true;
-
-
- if (tablesext) {
- FILE *tablesout;
- struct yytbl_hdr hdr;
- char *pname = 0;
- int nbytes = 0;
-
- buf_m4_define (&m4defs_buf, "M4_YY_TABLES_EXTERNAL", NULL);
-
- if (!tablesfilename) {
- nbytes = strlen (prefix) + strlen (tablesfile_template) + 2;
- tablesfilename = pname = (char *) calloc (nbytes, 1);
- snprintf (pname, nbytes, tablesfile_template, prefix);
- }
-
- if ((tablesout = fopen (tablesfilename, "w")) == NULL)
- lerrsf (_("could not create %s"), tablesfilename);
- if (pname)
- free (pname);
- tablesfilename = 0;
-
- yytbl_writer_init (&tableswr, tablesout);
-
- nbytes = strlen (prefix) + strlen ("tables") + 2;
- tablesname = (char *) calloc (nbytes, 1);
- snprintf (tablesname, nbytes, "%stables", prefix);
- yytbl_hdr_init (&hdr, flex_version, tablesname);
-
- if (yytbl_hdr_fwrite (&tableswr, &hdr) <= 0)
- flexerror (_("could not write tables header"));
- }
-
- if (skelname && (skelfile = fopen (skelname, "r")) == NULL)
- lerrsf (_("can't open skeleton file %s"), skelname);
-
- if (reentrant) {
- buf_m4_define (&m4defs_buf, "M4_YY_REENTRANT", NULL);
- if (yytext_is_array)
- buf_m4_define (&m4defs_buf, "M4_YY_TEXT_IS_ARRAY", NULL);
- }
-
- if ( bison_bridge_lval)
- buf_m4_define (&m4defs_buf, "M4_YY_BISON_LVAL", NULL);
-
- if ( bison_bridge_lloc)
- buf_m4_define (&m4defs_buf, "<M4_YY_BISON_LLOC>", NULL);
-
- buf_m4_define(&m4defs_buf, "M4_YY_PREFIX", prefix);
-
- if (did_outfilename)
- line_directive_out (stdout, 0);
-
- if (do_yylineno)
- buf_m4_define (&m4defs_buf, "M4_YY_USE_LINENO", NULL);
-
- /* Create the alignment type. */
- buf_strdefine (&userdef_buf, "YY_INT_ALIGNED",
- long_align ? "long int" : "short int");
-
- /* Define the start condition macros. */
- {
- struct Buf tmpbuf;
- buf_init(&tmpbuf, sizeof(char));
- for (i = 1; i <= lastsc; i++) {
- char *str, *fmt = "#define %s %d\n";
- size_t strsz;
-
- str = (char*)flex_alloc(strsz = strlen(fmt) + strlen(scname[i]) + NUMCHARLINES + 2);
- if (!str)
- flexfatal(_("allocation of macro definition failed"));
- snprintf(str, strsz, fmt, scname[i], i - 1);
- buf_strappend(&tmpbuf, str);
- free(str);
- }
- buf_m4_define(&m4defs_buf, "M4_YY_SC_DEFS", tmpbuf.elts);
- buf_destroy(&tmpbuf);
- }
-
- /* This is where we begin writing to the file. */
-
- /* Dump the %top code. */
- if( top_buf.elts)
- outn((char*) top_buf.elts);
-
- /* Dump the m4 definitions. */
- buf_print_strings(&m4defs_buf, stdout);
- m4defs_buf.nelts = 0; /* memory leak here. */
-
- /* Place a bogus line directive, it will be fixed in the filter. */
- outn("#line 0 \"M4_YY_OUTFILE_NAME\"\n");
-
- /* Dump the user defined preproc directives. */
- if (userdef_buf.elts)
- outn ((char *) (userdef_buf.elts));
-
- skelout ();
- /* %% [1.0] */
-}
-
-/* flexend - terminate flex
- *
- * note
- * This routine does not return.
- */
-
-void flexend (exit_status)
- int exit_status;
-
-{
- static int called_before = -1; /* prevent infinite recursion. */
- int tblsiz;
-
- if (++called_before)
- FLEX_EXIT (exit_status);
-
- if (skelfile != NULL) {
- if (ferror (skelfile))
- lerrsf (_("input error reading skeleton file %s"),
- skelname);
-
- else if (fclose (skelfile))
- lerrsf (_("error closing skeleton file %s"),
- skelname);
- }
-
-#if 0
- fprintf (header_out,
- "#ifdef YY_HEADER_EXPORT_START_CONDITIONS\n");
- fprintf (header_out,
- "/* Beware! Start conditions are not prefixed. */\n");
-
- /* Special case for "INITIAL" */
- fprintf (header_out,
- "#undef INITIAL\n#define INITIAL 0\n");
- for (i = 2; i <= lastsc; i++)
- fprintf (header_out, "#define %s %d\n", scname[i], i - 1);
- fprintf (header_out,
- "#endif /* YY_HEADER_EXPORT_START_CONDITIONS */\n\n");
-
- /* Kill ALL flex-related macros. This is so the user
- * can #include more than one generated header file. */
- fprintf (header_out, "#ifndef YY_HEADER_NO_UNDEFS\n");
- fprintf (header_out,
- "/* Undefine all internal macros, etc., that do no belong in the header. */\n\n");
-
- {
- const char * undef_list[] = {
-
- "BEGIN",
- "ECHO",
- "EOB_ACT_CONTINUE_SCAN",
- "EOB_ACT_END_OF_FILE",
- "EOB_ACT_LAST_MATCH",
- "FLEX_SCANNER",
- "FLEX_STD",
- "REJECT",
- "YYFARGS0",
- "YYFARGS1",
- "YYFARGS2",
- "YYFARGS3",
- "YYLMAX",
- "YYSTATE",
- "YY_AT_BOL",
- "YY_BREAK",
- "YY_BUFFER_EOF_PENDING",
- "YY_BUFFER_NEW",
- "YY_BUFFER_NORMAL",
- "YY_BUF_SIZE",
- "M4_YY_CALL_LAST_ARG",
- "M4_YY_CALL_ONLY_ARG",
- "YY_CURRENT_BUFFER",
- "YY_DECL",
- "M4_YY_DECL_LAST_ARG",
- "M4_YY_DEF_LAST_ARG",
- "M4_YY_DEF_ONLY_ARG",
- "YY_DO_BEFORE_ACTION",
- "YY_END_OF_BUFFER",
- "YY_END_OF_BUFFER_CHAR",
- "YY_EXIT_FAILURE",
- "YY_EXTRA_TYPE",
- "YY_FATAL_ERROR",
- "YY_FLEX_DEFINED_ECHO",
- "YY_FLEX_LEX_COMPAT",
- "YY_FLEX_MAJOR_VERSION",
- "YY_FLEX_MINOR_VERSION",
- "YY_FLEX_SUBMINOR_VERSION",
- "YY_FLUSH_BUFFER",
- "YY_G",
- "YY_INPUT",
- "YY_INTERACTIVE",
- "YY_INT_ALIGNED",
- "YY_LAST_ARG",
- "YY_LESS_LINENO",
- "YY_LEX_ARGS",
- "YY_LEX_DECLARATION",
- "YY_LEX_PROTO",
- "YY_MAIN",
- "YY_MORE_ADJ",
- "YY_NEED_STRLEN",
- "YY_NEW_FILE",
- "YY_NULL",
- "YY_NUM_RULES",
- "YY_ONLY_ARG",
- "YY_PARAMS",
- "YY_PROTO",
- "M4_YY_PROTO_LAST_ARG",
- "M4_YY_PROTO_ONLY_ARG void",
- "YY_READ_BUF_SIZE",
- "YY_REENTRANT",
- "YY_RESTORE_YY_MORE_OFFSET",
- "YY_RULE_SETUP",
- "YY_SC_TO_UI",
- "YY_SKIP_YYWRAP",
- "YY_START",
- "YY_START_STACK_INCR",
- "YY_STATE_EOF",
- "YY_STDINIT",
- "YY_TRAILING_HEAD_MASK",
- "YY_TRAILING_MASK",
- "YY_USER_ACTION",
- "YY_USE_CONST",
- "YY_USE_PROTOS",
- "unput",
- "yyTABLES_NAME",
- "yy_create_buffer",
- "yy_delete_buffer",
- "yy_flex_debug",
- "yy_flush_buffer",
- "yy_init_buffer",
- "yy_load_buffer_state",
- "yy_new_buffer",
- "yy_scan_buffer",
- "yy_scan_bytes",
- "yy_scan_string",
- "yy_set_bol",
- "yy_set_interactive",
- "yy_switch_to_buffer",
- "yypush_buffer_state",
- "yypop_buffer_state",
- "yyensure_buffer_stack",
- "yyalloc",
- "yyconst",
- "yyextra",
- "yyfree",
- "yyget_debug",
- "yyget_extra",
- "yyget_in",
- "yyget_leng",
- "yyget_lineno",
- "yyget_lloc",
- "yyget_lval",
- "yyget_out",
- "yyget_text",
- "yyin",
- "yyleng",
- "yyless",
- "yylex",
- "yylex_destroy",
- "yylex_init",
- "yylex_init_extra",
- "yylineno",
- "yylloc",
- "yylval",
- "yymore",
- "yyout",
- "yyrealloc",
- "yyrestart",
- "yyset_debug",
- "yyset_extra",
- "yyset_in",
- "yyset_lineno",
- "yyset_lloc",
- "yyset_lval",
- "yyset_out",
- "yytables_destroy",
- "yytables_fload",
- "yyterminate",
- "yytext",
- "yytext_ptr",
- "yywrap",
-
- /* must be null-terminated */
- NULL};
-
-
- for (i=0; undef_list[i] != NULL; i++)
- fprintf (header_out, "#undef %s\n", undef_list[i]);
- }
-
- /* undef any of the auto-generated symbols. */
- for (i = 0; i < defs_buf.nelts; i++) {
-
- /* don't undef start conditions */
- if (sclookup (((char **) defs_buf.elts)[i]) > 0)
- continue;
- fprintf (header_out, "#undef %s\n",
- ((char **) defs_buf.elts)[i]);
- }
-
- fprintf (header_out,
- "#endif /* !YY_HEADER_NO_UNDEFS */\n");
- fprintf (header_out, "\n");
- fprintf (header_out, "#undef %sIN_HEADER\n", prefix);
- fprintf (header_out, "#endif /* %sHEADER_H */\n", prefix);
-
- if (ferror (header_out))
- lerrsf (_("error creating header file %s"),
- headerfilename);
- fflush (header_out);
- fclose (header_out);
-#endif
-
- if (exit_status != 0 && outfile_created) {
- if (ferror (stdout))
- lerrsf (_("error writing output file %s"),
- outfilename);
-
- else if ((_stdout_closed = 1) && fclose (stdout))
- lerrsf (_("error closing output file %s"),
- outfilename);
-
- else if (unlink (outfilename))
- lerrsf (_("error deleting output file %s"),
- outfilename);
- }
-
-
- if (backing_up_report && backing_up_file) {
- if (num_backing_up == 0)
- fprintf (backing_up_file, _("No backing up.\n"));
- else if (fullspd || fulltbl)
- fprintf (backing_up_file,
- _
- ("%d backing up (non-accepting) states.\n"),
- num_backing_up);
- else
- fprintf (backing_up_file,
- _("Compressed tables always back up.\n"));
-
- if (ferror (backing_up_file))
- lerrsf (_("error writing backup file %s"),
- backing_name);
-
- else if (fclose (backing_up_file))
- lerrsf (_("error closing backup file %s"),
- backing_name);
- }
-
- if (printstats) {
- fprintf (stderr, _("%s version %s usage statistics:\n"),
- program_name, flex_version);
-
- fprintf (stderr, _(" scanner options: -"));
-
- if (C_plus_plus)
- putc ('+', stderr);
- if (backing_up_report)
- putc ('b', stderr);
- if (ddebug)
- putc ('d', stderr);
- if (sf_case_ins())
- putc ('i', stderr);
- if (lex_compat)
- putc ('l', stderr);
- if (posix_compat)
- putc ('X', stderr);
- if (performance_report > 0)
- putc ('p', stderr);
- if (performance_report > 1)
- putc ('p', stderr);
- if (spprdflt)
- putc ('s', stderr);
- if (reentrant)
- fputs ("--reentrant", stderr);
- if (bison_bridge_lval)
- fputs ("--bison-bridge", stderr);
- if (bison_bridge_lloc)
- fputs ("--bison-locations", stderr);
- if (use_stdout)
- putc ('t', stderr);
- if (printstats)
- putc ('v', stderr); /* always true! */
- if (nowarn)
- putc ('w', stderr);
- if (interactive == false)
- putc ('B', stderr);
- if (interactive == true)
- putc ('I', stderr);
- if (!gen_line_dirs)
- putc ('L', stderr);
- if (trace)
- putc ('T', stderr);
-
- if (csize == unspecified)
- /* We encountered an error fairly early on, so csize
- * never got specified. Define it now, to prevent
- * bogus table sizes being written out below.
- */
- csize = 256;
-
- if (csize == 128)
- putc ('7', stderr);
- else
- putc ('8', stderr);
-
- fprintf (stderr, " -C");
-
- if (long_align)
- putc ('a', stderr);
- if (fulltbl)
- putc ('f', stderr);
- if (fullspd)
- putc ('F', stderr);
- if (useecs)
- putc ('e', stderr);
- if (usemecs)
- putc ('m', stderr);
- if (use_read)
- putc ('r', stderr);
-
- if (did_outfilename)
- fprintf (stderr, " -o%s", outfilename);
-
- if (skelname)
- fprintf (stderr, " -S%s", skelname);
-
- if (strcmp (prefix, "yy"))
- fprintf (stderr, " -P%s", prefix);
-
- putc ('\n', stderr);
-
- fprintf (stderr, _(" %d/%d NFA states\n"),
- lastnfa, current_mns);
- fprintf (stderr, _(" %d/%d DFA states (%d words)\n"),
- lastdfa, current_max_dfas, totnst);
- fprintf (stderr, _(" %d rules\n"),
- num_rules + num_eof_rules -
- 1 /* - 1 for def. rule */ );
-
- if (num_backing_up == 0)
- fprintf (stderr, _(" No backing up\n"));
- else if (fullspd || fulltbl)
- fprintf (stderr,
- _
- (" %d backing-up (non-accepting) states\n"),
- num_backing_up);
- else
- fprintf (stderr,
- _
- (" Compressed tables always back-up\n"));
-
- if (bol_needed)
- fprintf (stderr,
- _(" Beginning-of-line patterns used\n"));
-
- fprintf (stderr, _(" %d/%d start conditions\n"), lastsc,
- current_max_scs);
- fprintf (stderr,
- _
- (" %d epsilon states, %d double epsilon states\n"),
- numeps, eps2);
-
- if (lastccl == 0)
- fprintf (stderr, _(" no character classes\n"));
- else
- fprintf (stderr,
- _
- (" %d/%d character classes needed %d/%d words of storage, %d reused\n"),
- lastccl, current_maxccls,
- cclmap[lastccl] + ccllen[lastccl],
- current_max_ccl_tbl_size, cclreuse);
-
- fprintf (stderr, _(" %d state/nextstate pairs created\n"),
- numsnpairs);
- fprintf (stderr,
- _(" %d/%d unique/duplicate transitions\n"),
- numuniq, numdup);
-
- if (fulltbl) {
- tblsiz = lastdfa * numecs;
- fprintf (stderr, _(" %d table entries\n"),
- tblsiz);
- }
-
- else {
- tblsiz = 2 * (lastdfa + numtemps) + 2 * tblend;
-
- fprintf (stderr,
- _(" %d/%d base-def entries created\n"),
- lastdfa + numtemps, current_max_dfas);
- fprintf (stderr,
- _
- (" %d/%d (peak %d) nxt-chk entries created\n"),
- tblend, current_max_xpairs, peakpairs);
- fprintf (stderr,
- _
- (" %d/%d (peak %d) template nxt-chk entries created\n"),
- numtemps * nummecs,
- current_max_template_xpairs,
- numtemps * numecs);
- fprintf (stderr, _(" %d empty table entries\n"),
- nummt);
- fprintf (stderr, _(" %d protos created\n"),
- numprots);
- fprintf (stderr,
- _(" %d templates created, %d uses\n"),
- numtemps, tmpuses);
- }
-
- if (useecs) {
- tblsiz = tblsiz + csize;
- fprintf (stderr,
- _
- (" %d/%d equivalence classes created\n"),
- numecs, csize);
- }
-
- if (usemecs) {
- tblsiz = tblsiz + numecs;
- fprintf (stderr,
- _
- (" %d/%d meta-equivalence classes created\n"),
- nummecs, csize);
- }
-
- fprintf (stderr,
- _
- (" %d (%d saved) hash collisions, %d DFAs equal\n"),
- hshcol, hshsave, dfaeql);
- fprintf (stderr, _(" %d sets of reallocations needed\n"),
- num_reallocs);
- fprintf (stderr, _(" %d total table entries needed\n"),
- tblsiz);
- }
-
- FLEX_EXIT (exit_status);
-}
-
-
-/* flexinit - initialize flex */
-
-void flexinit (argc, argv)
- int argc;
- char **argv;
-{
- int i, sawcmpflag, rv, optind;
- char *arg;
- scanopt_t sopt;
-
- printstats = syntaxerror = trace = spprdflt = false;
- lex_compat = posix_compat = C_plus_plus = backing_up_report =
- ddebug = fulltbl = false;
- fullspd = long_align = nowarn = yymore_used = continued_action =
- false;
- do_yylineno = yytext_is_array = in_rule = reject = do_stdinit =
- false;
- yymore_really_used = reject_really_used = unspecified;
- interactive = csize = unspecified;
- do_yywrap = gen_line_dirs = usemecs = useecs = true;
- reentrant = bison_bridge_lval = bison_bridge_lloc = false;
- performance_report = 0;
- did_outfilename = 0;
- prefix = "yy";
- yyclass = 0;
- use_read = use_stdout = false;
- tablesext = tablesverify = false;
- gentables = true;
- tablesfilename = tablesname = NULL;
- ansi_func_defs = ansi_func_protos = true;
-
- sawcmpflag = false;
-
- /* Initialize dynamic array for holding the rule actions. */
- action_size = 2048; /* default size of action array in bytes */
- action_array = allocate_character_array (action_size);
- defs1_offset = prolog_offset = action_offset = action_index = 0;
- action_array[0] = '\0';
-
- /* Initialize any buffers. */
- buf_init (&userdef_buf, sizeof (char)); /* one long string */
- buf_init (&defs_buf, sizeof (char *)); /* list of strings */
- buf_init (&yydmap_buf, sizeof (char)); /* one long string */
- buf_init (&top_buf, sizeof (char)); /* one long string */
-
- {
- const char * m4defs_init_str[] = {"m4_changequote\n",
- "m4_changequote([[, ]])\n"};
- buf_init (&m4defs_buf, sizeof (char *));
- buf_append (&m4defs_buf, &m4defs_init_str, 2);
- }
-
- sf_init ();
-
- /* initialize regex lib */
- flex_init_regex();
-
- /* Enable C++ if program name ends with '+'. */
- program_name = basename2 (argv[0], 0);
-
- if (program_name[0] != '\0' &&
- program_name[strlen (program_name) - 1] == '+')
- C_plus_plus = true;
-
- /* read flags */
- sopt = scanopt_init (flexopts, argc, argv, 0);
- if (!sopt) {
- /* This will only happen when flexopts array is altered. */
- fprintf (stderr,
- _("Internal error. flexopts are malformed.\n"));
- FLEX_EXIT (1);
- }
-
- while ((rv = scanopt (sopt, &arg, &optind)) != 0) {
-
- if (rv < 0) {
- /* Scanopt has already printed an option-specific error message. */
- fprintf (stderr,
- _
- ("Try `%s --help' for more information.\n"),
- program_name);
- FLEX_EXIT (1);
- }
-
- switch ((enum flexopt_flag_t) rv) {
- case OPT_CPLUSPLUS:
- C_plus_plus = true;
- break;
-
- case OPT_BATCH:
- interactive = false;
- break;
-
- case OPT_BACKUP:
- backing_up_report = true;
- break;
-
- case OPT_DONOTHING:
- break;
-
- case OPT_COMPRESSION:
- if (!sawcmpflag) {
- useecs = false;
- usemecs = false;
- fulltbl = false;
- sawcmpflag = true;
- }
-
- for (i = 0; arg && arg[i] != '\0'; i++)
- switch (arg[i]) {
- case 'a':
- long_align = true;
- break;
-
- case 'e':
- useecs = true;
- break;
-
- case 'F':
- fullspd = true;
- break;
-
- case 'f':
- fulltbl = true;
- break;
-
- case 'm':
- usemecs = true;
- break;
-
- case 'r':
- use_read = true;
- break;
-
- default:
- lerrif (_
- ("unknown -C option '%c'"),
- (int) arg[i]);
- break;
- }
- break;
-
- case OPT_DEBUG:
- ddebug = true;
- break;
-
- case OPT_NO_DEBUG:
- ddebug = false;
- break;
-
- case OPT_FULL:
- useecs = usemecs = false;
- use_read = fulltbl = true;
- break;
-
- case OPT_FAST:
- useecs = usemecs = false;
- use_read = fullspd = true;
- break;
-
- case OPT_HELP:
- usage ();
- FLEX_EXIT (0);
-
- case OPT_INTERACTIVE:
- interactive = true;
- break;
-
- case OPT_CASE_INSENSITIVE:
- sf_set_case_ins(true);
- break;
-
- case OPT_LEX_COMPAT:
- lex_compat = true;
- break;
-
- case OPT_POSIX_COMPAT:
- posix_compat = true;
- break;
-
- case OPT_PREPROC_LEVEL:
- preproc_level = strtol(arg,NULL,0);
- break;
-
- case OPT_MAIN:
- buf_strdefine (&userdef_buf, "YY_MAIN", "1");
- do_yywrap = false;
- break;
-
- case OPT_NO_MAIN:
- buf_strdefine (&userdef_buf, "YY_MAIN", "0");
- break;
-
- case OPT_NO_LINE:
- gen_line_dirs = false;
- break;
-
- case OPT_OUTFILE:
- outfilename = arg;
- did_outfilename = 1;
- break;
-
- case OPT_PREFIX:
- prefix = arg;
- break;
-
- case OPT_PERF_REPORT:
- ++performance_report;
- break;
-
- case OPT_BISON_BRIDGE:
- bison_bridge_lval = true;
- break;
-
- case OPT_BISON_BRIDGE_LOCATIONS:
- bison_bridge_lval = bison_bridge_lloc = true;
- break;
-
- case OPT_REENTRANT:
- reentrant = true;
- break;
-
- case OPT_NO_REENTRANT:
- reentrant = false;
- break;
-
- case OPT_SKEL:
- skelname = arg;
- break;
-
- case OPT_DEFAULT:
- spprdflt = false;
- break;
-
- case OPT_NO_DEFAULT:
- spprdflt = true;
- break;
-
- case OPT_STDOUT:
- use_stdout = true;
- break;
-
- case OPT_NO_UNISTD_H:
- //buf_strdefine (&userdef_buf, "YY_NO_UNISTD_H", "1");
- buf_m4_define( &m4defs_buf, "M4_YY_NO_UNISTD_H",0);
- break;
-
- case OPT_TABLES_FILE:
- tablesext = true;
- tablesfilename = arg;
- break;
-
- case OPT_TABLES_VERIFY:
- tablesverify = true;
- break;
-
- case OPT_TRACE:
- trace = true;
- break;
-
- case OPT_VERBOSE:
- printstats = true;
- break;
-
- case OPT_VERSION:
- printf (_("%s %s\n"), program_name, flex_version);
- FLEX_EXIT (0);
-
- case OPT_WARN:
- nowarn = false;
- break;
-
- case OPT_NO_WARN:
- nowarn = true;
- break;
-
- case OPT_7BIT:
- csize = 128;
- break;
-
- case OPT_8BIT:
- csize = CSIZE;
- break;
-
- case OPT_ALIGN:
- long_align = true;
- break;
-
- case OPT_NO_ALIGN:
- long_align = false;
- break;
-
- case OPT_ALWAYS_INTERACTIVE:
- buf_m4_define (&m4defs_buf, "M4_YY_ALWAYS_INTERACTIVE", 0);
- break;
-
- case OPT_NEVER_INTERACTIVE:
- buf_m4_define( &m4defs_buf, "M4_YY_NEVER_INTERACTIVE", 0);
- break;
-
- case OPT_ARRAY:
- yytext_is_array = true;
- break;
-
- case OPT_POINTER:
- yytext_is_array = false;
- break;
-
- case OPT_ECS:
- useecs = true;
- break;
-
- case OPT_NO_ECS:
- useecs = false;
- break;
-
- case OPT_HEADER_FILE:
- headerfilename = arg;
- break;
-
- case OPT_META_ECS:
- usemecs = true;
- break;
-
- case OPT_NO_META_ECS:
- usemecs = false;
- break;
-
- case OPT_PREPROCDEFINE:
- {
- /* arg is "symbol" or "symbol=definition". */
- char *def;
-
- for (def = arg;
- *def != '\0' && *def != '='; ++def) ;
-
- buf_strappend (&userdef_buf, "#define ");
- if (*def == '\0') {
- buf_strappend (&userdef_buf, arg);
- buf_strappend (&userdef_buf,
- " 1\n");
- }
- else {
- buf_strnappend (&userdef_buf, arg,
- def - arg);
- buf_strappend (&userdef_buf, " ");
- buf_strappend (&userdef_buf,
- def + 1);
- buf_strappend (&userdef_buf, "\n");
- }
- }
- break;
-
- case OPT_READ:
- use_read = true;
- break;
-
- case OPT_STACK:
- //buf_strdefine (&userdef_buf, "YY_STACK_USED", "1");
- buf_m4_define( &m4defs_buf, "M4_YY_STACK_USED",0);
- break;
-
- case OPT_STDINIT:
- do_stdinit = true;
- break;
-
- case OPT_NO_STDINIT:
- do_stdinit = false;
- break;
-
- case OPT_YYCLASS:
- yyclass = arg;
- break;
-
- case OPT_YYLINENO:
- do_yylineno = true;
- break;
-
- case OPT_NO_YYLINENO:
- do_yylineno = false;
- break;
-
- case OPT_YYWRAP:
- do_yywrap = true;
- break;
-
- case OPT_NO_YYWRAP:
- do_yywrap = false;
- break;
-
- case OPT_YYMORE:
- yymore_really_used = true;
- break;
-
- case OPT_NO_YYMORE:
- yymore_really_used = false;
- break;
-
- case OPT_REJECT:
- reject_really_used = true;
- break;
-
- case OPT_NO_REJECT:
- reject_really_used = false;
- break;
-
- case OPT_NO_ANSI_FUNC_DEFS:
- ansi_func_defs = false;
- break;
-
- case OPT_NO_ANSI_FUNC_PROTOS:
- ansi_func_protos = false;
- break;
-
- case OPT_NO_YY_PUSH_STATE:
- //buf_strdefine (&userdef_buf, "YY_NO_PUSH_STATE", "1");
- buf_m4_define( &m4defs_buf, "M4_YY_NO_PUSH_STATE",0);
- break;
- case OPT_NO_YY_POP_STATE:
- //buf_strdefine (&userdef_buf, "YY_NO_POP_STATE", "1");
- buf_m4_define( &m4defs_buf, "M4_YY_NO_POP_STATE",0);
- break;
- case OPT_NO_YY_TOP_STATE:
- //buf_strdefine (&userdef_buf, "YY_NO_TOP_STATE", "1");
- buf_m4_define( &m4defs_buf, "M4_YY_NO_TOP_STATE",0);
- break;
- case OPT_NO_UNPUT:
- //buf_strdefine (&userdef_buf, "YY_NO_UNPUT", "1");
- buf_m4_define( &m4defs_buf, "M4_YY_NO_UNPUT",0);
- break;
- case OPT_NO_YY_SCAN_BUFFER:
- //buf_strdefine (&userdef_buf, "YY_NO_SCAN_BUFFER", "1");
- buf_m4_define( &m4defs_buf, "M4_YY_NO_SCAN_BUFFER",0);
- break;
- case OPT_NO_YY_SCAN_BYTES:
- //buf_strdefine (&userdef_buf, "YY_NO_SCAN_BYTES", "1");
- buf_m4_define( &m4defs_buf, "M4_YY_NO_SCAN_BYTES",0);
- break;
- case OPT_NO_YY_SCAN_STRING:
- //buf_strdefine (&userdef_buf, "YY_NO_SCAN_STRING", "1");
- buf_m4_define( &m4defs_buf, "M4_YY_NO_SCAN_STRING",0);
- break;
- case OPT_NO_YYGET_EXTRA:
- //buf_strdefine (&userdef_buf, "YY_NO_GET_EXTRA", "1");
- buf_m4_define( &m4defs_buf, "M4_YY_NO_GET_EXTRA",0);
- break;
- case OPT_NO_YYSET_EXTRA:
- //buf_strdefine (&userdef_buf, "YY_NO_SET_EXTRA", "1");
- buf_m4_define( &m4defs_buf, "M4_YY_NO_SET_EXTRA",0);
- break;
- case OPT_NO_YYGET_LENG:
- //buf_strdefine (&userdef_buf, "YY_NO_GET_LENG", "1");
- buf_m4_define( &m4defs_buf, "M4_YY_NO_GET_LENG",0);
- break;
- case OPT_NO_YYGET_TEXT:
- //buf_strdefine (&userdef_buf, "YY_NO_GET_TEXT", "1");
- buf_m4_define( &m4defs_buf, "M4_YY_NO_GET_TEXT",0);
- break;
- case OPT_NO_YYGET_LINENO:
- //buf_strdefine (&userdef_buf, "YY_NO_GET_LINENO", "1");
- buf_m4_define( &m4defs_buf, "M4_YY_NO_GET_LINENO",0);
- break;
- case OPT_NO_YYSET_LINENO:
- //buf_strdefine (&userdef_buf, "YY_NO_SET_LINENO", "1");
- buf_m4_define( &m4defs_buf, "M4_YY_NO_SET_LINENO",0);
- break;
- case OPT_NO_YYGET_IN:
- //buf_strdefine (&userdef_buf, "YY_NO_GET_IN", "1");
- buf_m4_define( &m4defs_buf, "M4_YY_NO_GET_IN",0);
- break;
- case OPT_NO_YYSET_IN:
- //buf_strdefine (&userdef_buf, "YY_NO_SET_IN", "1");
- buf_m4_define( &m4defs_buf, "M4_YY_NO_SET_IN",0);
- break;
- case OPT_NO_YYGET_OUT:
- //buf_strdefine (&userdef_buf, "YY_NO_GET_OUT", "1");
- buf_m4_define( &m4defs_buf, "M4_YY_NO_GET_OUT",0);
- break;
- case OPT_NO_YYSET_OUT:
- //buf_strdefine (&userdef_buf, "YY_NO_SET_OUT", "1");
- buf_m4_define( &m4defs_buf, "M4_YY_NO_SET_OUT",0);
- break;
- case OPT_NO_YYGET_LVAL:
- //buf_strdefine (&userdef_buf, "YY_NO_GET_LVAL", "1");
- buf_m4_define( &m4defs_buf, "M4_YY_NO_GET_LVAL",0);
- break;
- case OPT_NO_YYSET_LVAL:
- //buf_strdefine (&userdef_buf, "YY_NO_SET_LVAL", "1");
- buf_m4_define( &m4defs_buf, "M4_YY_NO_SET_LVAL",0);
- break;
- case OPT_NO_YYGET_LLOC:
- //buf_strdefine (&userdef_buf, "YY_NO_GET_LLOC", "1");
- buf_m4_define( &m4defs_buf, "M4_YY_NO_GET_LLOC",0);
- break;
- case OPT_NO_YYSET_LLOC:
- //buf_strdefine (&userdef_buf, "YY_NO_SET_LLOC", "1");
- buf_m4_define( &m4defs_buf, "M4_YY_NO_SET_LLOC",0);
- break;
-
- } /* switch */
- } /* while scanopt() */
-
- scanopt_destroy (sopt);
-
- num_input_files = argc - optind;
- input_files = argv + optind;
- set_input_file (num_input_files > 0 ? input_files[0] : NULL);
-
- lastccl = lastsc = lastdfa = lastnfa = 0;
- num_rules = num_eof_rules = default_rule = 0;
- numas = numsnpairs = tmpuses = 0;
- numecs = numeps = eps2 = num_reallocs = hshcol = dfaeql = totnst =
- 0;
- numuniq = numdup = hshsave = eofseen = datapos = dataline = 0;
- num_backing_up = onesp = numprots = 0;
- variable_trailing_context_rules = bol_needed = false;
-
- linenum = sectnum = 1;
- firstprot = NIL;
-
- /* Used in mkprot() so that the first proto goes in slot 1
- * of the proto queue.
- */
- lastprot = 1;
-
- set_up_initial_allocations ();
-}
-
-
-/* readin - read in the rules section of the input file(s) */
-
-void readin ()
-{
- static char yy_stdinit[] = "FILE *yyin = stdin, *yyout = stdout;";
- static char yy_nostdinit[] =
- "FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;";
-
- line_directive_out ((FILE *) 0, 1);
-
- if (yyparse ()) {
- pinpoint_message (_("fatal parse error"));
- flexend (1);
- }
-
- if (syntaxerror)
- flexend (1);
-
- /* If the user explicitly requested posix compatibility by specifing the
- * posix-compat option, then we check for conflicting options. However, if
- * the POSIXLY_CORRECT variable is set, then we quietly make flex as
- * posix-compatible as possible. This is the recommended behavior
- * according to the GNU Coding Standards.
- *
- * Note: The posix option was added to flex to provide the posix behavior
- * of the repeat operator in regular expressions, e.g., `ab{3}'
- */
- if (posix_compat) {
- /* TODO: This is where we try to make flex behave according to
- * posiz, AND check for conflicting options. How far should we go
- * with this? Should we disable all the neat-o flex features?
- */
- /* Update: Estes says no, since other flex features don't violate posix. */
- }
-
- if (getenv ("POSIXLY_CORRECT")) {
- posix_compat = true;
- }
-
- if (backing_up_report) {
- backing_up_file = fopen (backing_name, "w");
- if (backing_up_file == NULL)
- lerrsf (_
- ("could not create backing-up info file %s"),
- backing_name);
- }
-
- else
- backing_up_file = NULL;
-
- if (yymore_really_used == true)
- yymore_used = true;
- else if (yymore_really_used == false)
- yymore_used = false;
-
- if (reject_really_used == true)
- reject = true;
- else if (reject_really_used == false)
- reject = false;
-
- if (performance_report > 0) {
- if (lex_compat) {
- fprintf (stderr,
- _
- ("-l AT&T lex compatibility option entails a large performance penalty\n"));
- fprintf (stderr,
- _
- (" and may be the actual source of other reported performance penalties\n"));
- }
-
- else if (do_yylineno) {
- fprintf (stderr,
- _
- ("%%option yylineno entails a performance penalty ONLY on rules that can match newline characters\n"));
- }
-
- if (performance_report > 1) {
- if (interactive)
- fprintf (stderr,
- _
- ("-I (interactive) entails a minor performance penalty\n"));
-
- if (yymore_used)
- fprintf (stderr,
- _
- ("yymore() entails a minor performance penalty\n"));
- }
-
- if (reject)
- fprintf (stderr,
- _
- ("REJECT entails a large performance penalty\n"));
-
- if (variable_trailing_context_rules)
- fprintf (stderr,
- _
- ("Variable trailing context rules entail a large performance penalty\n"));
- }
-
- if (reject)
- real_reject = true;
-
- if (variable_trailing_context_rules)
- reject = true;
-
- if ((fulltbl || fullspd) && reject) {
- if (real_reject)
- flexerror (_
- ("REJECT cannot be used with -f or -F"));
- else if (do_yylineno)
- flexerror (_
- ("%option yylineno cannot be used with REJECT"));
- else
- flexerror (_
- ("variable trailing context rules cannot be used with -f or -F"));
- }
-
- if (reject){
- out_m4_define( "M4_YY_USES_REJECT", NULL);
- //outn ("\n#define YY_USES_REJECT");
- }
-
- if (!do_yywrap) {
- if (!C_plus_plus)
- if (reentrant)
- outn ("\n#define yywrap(yyscanner) 1");
- else
- outn ("\n#define yywrap() 1");
- outn ("#define YY_SKIP_YYWRAP");
- }
-
- if (ddebug)
- outn ("\n#define FLEX_DEBUG");
-
- OUT_BEGIN_CODE ();
- if (csize == 256)
- outn ("typedef unsigned char YY_CHAR;");
- else
- outn ("typedef char YY_CHAR;");
- OUT_END_CODE ();
-
- if (C_plus_plus) {
- outn ("#define yytext_ptr yytext");
-
- if (interactive)
- outn ("#define YY_INTERACTIVE");
- }
-
- else {
- OUT_BEGIN_CODE ();
- /* In reentrant scanner, stdinit is handled in flex.skl. */
- if (do_stdinit) {
- if (reentrant){
- outn ("#ifdef VMS");
- outn ("#ifdef __VMS_POSIX");
- outn ("#define YY_STDINIT");
- outn ("#endif");
- outn ("#else");
- outn ("#define YY_STDINIT");
- outn ("#endif");
- }
-
- outn ("#ifdef VMS");
- outn ("#ifndef __VMS_POSIX");
- outn (yy_nostdinit);
- outn ("#else");
- outn (yy_stdinit);
- outn ("#endif");
- outn ("#else");
- outn (yy_stdinit);
- outn ("#endif");
- }
-
- else {
- if(!reentrant)
- outn (yy_nostdinit);
- }
- OUT_END_CODE ();
- }
-
- OUT_BEGIN_CODE ();
- if (fullspd)
- outn ("typedef yyconst struct yy_trans_info *yy_state_type;");
- else if (!C_plus_plus)
- outn ("typedef int yy_state_type;");
- OUT_END_CODE ();
-
- if (lex_compat)
- outn ("#define YY_FLEX_LEX_COMPAT");
-
- if (!C_plus_plus && !reentrant) {
- outn ("extern int yylineno;");
- OUT_BEGIN_CODE ();
- outn ("int yylineno = 1;");
- OUT_END_CODE ();
- }
-
- if (C_plus_plus) {
- outn ("\n#include <FlexLexer.h>");
-
- if (!do_yywrap) {
- outn("\nint yyFlexLexer::yywrap() { return 1; }");
- }
-
- if (yyclass) {
- outn ("int yyFlexLexer::yylex()");
- outn ("\t{");
- outn ("\tLexerError( \"yyFlexLexer::yylex invoked but %option yyclass used\" );");
- outn ("\treturn 0;");
- outn ("\t}");
-
- out_str ("\n#define YY_DECL int %s::yylex()\n",
- yyclass);
- }
- }
-
- else {
-
- /* Watch out: yytext_ptr is a variable when yytext is an array,
- * but it's a macro when yytext is a pointer.
- */
- if (yytext_is_array) {
- if (!reentrant)
- outn ("extern char yytext[];\n");
- }
- else {
- if (reentrant) {
- outn ("#define yytext_ptr yytext_r");
- }
- else {
- outn ("extern char *yytext;");
- outn ("#define yytext_ptr yytext");
- }
- }
-
- if (yyclass)
- flexerror (_
- ("%option yyclass only meaningful for C++ scanners"));
- }
-
- if (useecs)
- numecs = cre8ecs (nextecm, ecgroup, csize);
- else
- numecs = csize;
-
- /* Now map the equivalence class for NUL to its expected place. */
- ecgroup[0] = ecgroup[csize];
- NUL_ec = ABS (ecgroup[0]);
-
- if (useecs)
- ccl2ecl ();
-}
-
-
-/* set_up_initial_allocations - allocate memory for internal tables */
-
-void set_up_initial_allocations ()
-{
- maximum_mns = (long_align ? MAXIMUM_MNS_LONG : MAXIMUM_MNS);
- current_mns = INITIAL_MNS;
- firstst = allocate_integer_array (current_mns);
- lastst = allocate_integer_array (current_mns);
- finalst = allocate_integer_array (current_mns);
- transchar = allocate_integer_array (current_mns);
- trans1 = allocate_integer_array (current_mns);
- trans2 = allocate_integer_array (current_mns);
- accptnum = allocate_integer_array (current_mns);
- assoc_rule = allocate_integer_array (current_mns);
- state_type = allocate_integer_array (current_mns);
-
- current_max_rules = INITIAL_MAX_RULES;
- rule_type = allocate_integer_array (current_max_rules);
- rule_linenum = allocate_integer_array (current_max_rules);
- rule_useful = allocate_integer_array (current_max_rules);
- rule_has_nl = allocate_bool_array (current_max_rules);
-
- current_max_scs = INITIAL_MAX_SCS;
- scset = allocate_integer_array (current_max_scs);
- scbol = allocate_integer_array (current_max_scs);
- scxclu = allocate_integer_array (current_max_scs);
- sceof = allocate_integer_array (current_max_scs);
- scname = allocate_char_ptr_array (current_max_scs);
-
- current_maxccls = INITIAL_MAX_CCLS;
- cclmap = allocate_integer_array (current_maxccls);
- ccllen = allocate_integer_array (current_maxccls);
- cclng = allocate_integer_array (current_maxccls);
- ccl_has_nl = allocate_bool_array (current_maxccls);
-
- current_max_ccl_tbl_size = INITIAL_MAX_CCL_TBL_SIZE;
- ccltbl = allocate_Character_array (current_max_ccl_tbl_size);
-
- current_max_dfa_size = INITIAL_MAX_DFA_SIZE;
-
- current_max_xpairs = INITIAL_MAX_XPAIRS;
- nxt = allocate_integer_array (current_max_xpairs);
- chk = allocate_integer_array (current_max_xpairs);
-
- current_max_template_xpairs = INITIAL_MAX_TEMPLATE_XPAIRS;
- tnxt = allocate_integer_array (current_max_template_xpairs);
-
- current_max_dfas = INITIAL_MAX_DFAS;
- base = allocate_integer_array (current_max_dfas);
- def = allocate_integer_array (current_max_dfas);
- dfasiz = allocate_integer_array (current_max_dfas);
- accsiz = allocate_integer_array (current_max_dfas);
- dhash = allocate_integer_array (current_max_dfas);
- dss = allocate_int_ptr_array (current_max_dfas);
- dfaacc = allocate_dfaacc_union (current_max_dfas);
-
- nultrans = (int *) 0;
-}
-
-
-/* extracts basename from path, optionally stripping the extension "\.*"
- * (same concept as /bin/sh `basename`, but different handling of extension). */
-static char *basename2 (path, strip_ext)
- char *path;
- int strip_ext; /* boolean */
-{
- char *b, *e = 0;
-
- b = path;
- for (b = path; *path; path++)
- if (*path == '/')
- b = path + 1;
- else if (*path == '.')
- e = path;
-
- if (strip_ext && e && e > b)
- *e = '\0';
- return b;
-}
-
-void usage ()
-{
- FILE *f = stdout;
-
- if (!did_outfilename) {
- snprintf (outfile_path, sizeof(outfile_path), outfile_template,
- prefix, C_plus_plus ? "cc" : "c");
- outfilename = outfile_path;
- }
-
- fprintf (f, _("Usage: %s [OPTIONS] [FILE]...\n"), program_name);
- fprintf (f,
- _
- ("Generates programs that perform pattern-matching on text.\n"
- "\n" "Table Compression:\n"
- " -Ca, --align trade off larger tables for better memory alignment\n"
- " -Ce, --ecs construct equivalence classes\n"
- " -Cf do not compress tables; use -f representation\n"
- " -CF do not compress tables; use -F representation\n"
- " -Cm, --meta-ecs construct meta-equivalence classes\n"
- " -Cr, --read use read() instead of stdio for scanner input\n"
- " -f, --full generate fast, large scanner. Same as -Cfr\n"
- " -F, --fast use alternate table representation. Same as -CFr\n"
- " -Cem default compression (same as --ecs --meta-ecs)\n"
- "\n" "Debugging:\n"
- " -d, --debug enable debug mode in scanner\n"
- " -b, --backup write backing-up information to %s\n"
- " -p, --perf-report write performance report to stderr\n"
- " -s, --nodefault suppress default rule to ECHO unmatched text\n"
- " -T, --trace %s should run in trace mode\n"
- " -w, --nowarn do not generate warnings\n"
- " -v, --verbose write summary of scanner statistics to stdout\n"
- "\n" "Files:\n"
- " -o, --outfile=FILE specify output filename\n"
- " -S, --skel=FILE specify skeleton file\n"
- " -t, --stdout write scanner on stdout instead of %s\n"
- " --yyclass=NAME name of C++ class\n"
- " --header-file=FILE create a C header file in addition to the scanner\n"
- " --tables-file[=FILE] write tables to FILE\n" "\n"
- "Scanner behavior:\n"
- " -7, --7bit generate 7-bit scanner\n"
- " -8, --8bit generate 8-bit scanner\n"
- " -B, --batch generate batch scanner (opposite of -I)\n"
- " -i, --case-insensitive ignore case in patterns\n"
- " -l, --lex-compat maximal compatibility with original lex\n"
- " -X, --posix-compat maximal compatibility with POSIX lex\n"
- " -I, --interactive generate interactive scanner (opposite of -B)\n"
- " --yylineno track line count in yylineno\n"
- "\n" "Generated code:\n"
- " -+, --c++ generate C++ scanner class\n"
- " -Dmacro[=defn] #define macro defn (default defn is '1')\n"
- " -L, --noline suppress #line directives in scanner\n"
- " -P, --prefix=STRING use STRING as prefix instead of \"yy\"\n"
- " -R, --reentrant generate a reentrant C scanner\n"
- " --bison-bridge scanner for bison pure parser.\n"
- " --bison-locations include yylloc support.\n"
- " --stdinit initialize yyin/yyout to stdin/stdout\n"
- " --noansi-definitions old-style function definitions\n"
- " --noansi-prototypes empty parameter list in prototypes\n"
- " --nounistd do not include <unistd.h>\n"
- " --noFUNCTION do not generate a particular FUNCTION\n"
- "\n" "Miscellaneous:\n"
- " -c do-nothing POSIX option\n"
- " -n do-nothing POSIX option\n"
- " -?\n"
- " -h, --help produce this help message\n"
- " -V, --version report %s version\n"),
- backing_name, program_name, outfile_path, program_name);
-
-}
Deleted: trunk/contrib/flex/scanflags.c
===================================================================
--- trunk/contrib/flex/scanflags.c 2018-09-12 01:37:07 UTC (rev 12025)
+++ trunk/contrib/flex/scanflags.c 2018-09-12 01:40:59 UTC (rev 12026)
@@ -1,69 +0,0 @@
-/* scanflags - flags used by scanning. */
-
-/* Copyright (c) 1990 The Regents of the University of California. */
-/* All rights reserved. */
-
-/* This code is derived from software contributed to Berkeley by */
-/* Vern Paxson. */
-
-/* The United States Government has rights in this work pursuant */
-/* to contract no. DE-AC03-76SF00098 between the United States */
-/* Department of Energy and the University of California. */
-
-/* This file is part of flex. */
-
-/* Redistribution and use in source and binary forms, with or without */
-/* modification, are permitted provided that the following conditions */
-/* are met: */
-
-/* 1. Redistributions of source code must retain the above copyright */
-/* notice, this list of conditions and the following disclaimer. */
-/* 2. Redistributions in binary form must reproduce the above copyright */
-/* notice, this list of conditions and the following disclaimer in the */
-/* documentation and/or other materials provided with the distribution. */
-
-/* Neither the name of the University nor the names of its contributors */
-/* may be used to endorse or promote products derived from this software */
-/* without specific prior written permission. */
-
-/* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR */
-/* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED */
-/* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */
-/* PURPOSE. */
-
-#include "flexdef.h"
-
-scanflags_t* _sf_stk = NULL;
-size_t _sf_top_ix=0, _sf_max=0;
-
-void
-sf_push (void)
-{
- if (_sf_top_ix + 1 >= _sf_max)
- _sf_stk = (scanflags_t*) flex_realloc ( (void*) _sf_stk, sizeof(scanflags_t) * (_sf_max += 32));
-
- // copy the top element
- _sf_stk[_sf_top_ix + 1] = _sf_stk[_sf_top_ix];
- ++_sf_top_ix;
-}
-
-void
-sf_pop (void)
-{
- assert(_sf_top_ix > 0);
- --_sf_top_ix;
-}
-
-/* one-time initialization. Should be called before any sf_ functions. */
-void
-sf_init (void)
-{
- assert(_sf_stk == NULL);
- _sf_stk = (scanflags_t*) flex_alloc ( sizeof(scanflags_t) * (_sf_max = 32));
- if (!_sf_stk)
- lerrsf_fatal(_("Unable to allocate %ld of stack"),
- (void *)(uintptr_t)sizeof(scanflags_t));
- _sf_stk[_sf_top_ix] = 0;
-}
-
-/* vim:set expandtab cindent tabstop=4 softtabstop=4 shiftwidth=4 textwidth=0: */
More information about the Midnightbsd-cvs
mailing list