~ubuntu-branches/ubuntu/gutsy/libapache2-mod-python/gutsy

« back to all changes in this revision

Viewing changes to src/psp_parser.c

  • Committer: Bazaar Package Importer
  • Author(s): Piotr Ożarowski
  • Date: 2007-04-12 20:52:05 UTC
  • mfrom: (1.2.4 upstream) (1.1.2 etch)
  • Revision ID: james.westby@ubuntu.com-20070412205205-j4qlsw3o4tl615iq
Tags: 3.3.1-1
* New upstream release
* Remove configure and mod_python.h files in clean rule to make the diff.gz
  file smaller
* Current Python version in libapache2-mod-pythonX.Y package name (Provides:
  field) filled in automatically.
* Added XS-Vcs-Browser field

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
#define FLEX_SCANNER
10
10
#define YY_FLEX_MAJOR_VERSION 2
11
11
#define YY_FLEX_MINOR_VERSION 5
12
 
#define YY_FLEX_SUBMINOR_VERSION 31
 
12
#define YY_FLEX_SUBMINOR_VERSION 33
13
13
#if YY_FLEX_SUBMINOR_VERSION > 0
14
14
#define FLEX_BETA
15
15
#endif
31
31
 
32
32
/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
33
33
 
34
 
#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
 
34
#if __STDC_VERSION__ >= 199901L
 
35
 
 
36
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
 
37
 * if you want the limit (max/min) macros for int types. 
 
38
 */
 
39
#ifndef __STDC_LIMIT_MACROS
 
40
#define __STDC_LIMIT_MACROS 1
 
41
#endif
 
42
 
35
43
#include <inttypes.h>
36
44
typedef int8_t flex_int8_t;
37
45
typedef uint8_t flex_uint8_t;
154
162
#define YY_BUF_SIZE 16384
155
163
#endif
156
164
 
 
165
/* The state buf must be large enough to hold one state per character in the main buffer.
 
166
 */
 
167
#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
 
168
 
157
169
#ifndef YY_TYPEDEF_YY_BUFFER_STATE
158
170
#define YY_TYPEDEF_YY_BUFFER_STATE
159
171
typedef struct yy_buffer_state *YY_BUFFER_STATE;
356
368
    {   0,
357
369
        0,    0,    0,    0,    0,    0,    0,   16,    0,    0,
358
370
        0,    0,   24,    2,    1,    2,   11,   10,   11,   11,
359
 
       11,   15,   12,   15,   15,   14,   19,   18,   19,   19,
 
371
       11,   15,   12,   12,   15,   14,   19,   18,   19,   19,
360
372
       16,   23,   23,   23,   23,    1,   10,    7,    3,    4,
361
373
        5,   12,   13,   18,   17,   16,   21,    0,    0,    0,
362
374
        6,    8,    0,    0,    9,    0,   22,    0,    0,    0,
485
497
 * implied.  See the License for the specific language governing
486
498
 * permissions and limitations under the License.
487
499
 *
488
 
 * $Id: psp_parser.c 332365 2005-11-10 20:19:36Z jgallacher $
 
500
 * $Id: psp_parser.c 398222 2006-04-29 19:20:50Z jgallacher $
489
501
 *
490
502
 * This file originally written by Sterling Hughes.
491
503
 * 
511
523
 
512
524
 
513
525
 
514
 
#line 515 "psp_parser.c"
 
526
#line 527 "psp_parser.c"
515
527
 
516
528
#define INITIAL 0
517
529
#define TEXT 1
566
578
 
567
579
    }; /* end struct yyguts_t */
568
580
 
 
581
static int yy_init_globals (yyscan_t yyscanner );
 
582
 
569
583
/* Accessor methods to globals.
570
584
   These are made visible to non-reentrant scanners for convenience. */
571
585
 
737
751
#line 47 "psp_parser.l"
738
752
 
739
753
 
740
 
#line 741 "psp_parser.c"
 
754
#line 755 "psp_parser.c"
741
755
 
742
 
        if ( yyg->yy_init )
 
756
        if ( !yyg->yy_init )
743
757
                {
744
 
                yyg->yy_init = 0;
 
758
                yyg->yy_init = 1;
745
759
 
746
760
#ifdef YY_USER_INIT
747
761
                YY_USER_INIT;
1089
1103
#line 240 "psp_parser.l"
1090
1104
ECHO;
1091
1105
        YY_BREAK
1092
 
#line 1093 "psp_parser.c"
 
1106
#line 1107 "psp_parser.c"
1093
1107
case YY_STATE_EOF(INITIAL):
1094
1108
case YY_STATE_EOF(PYCODE):
1095
1109
case YY_STATE_EOF(INDENT):
1280
1294
 
1281
1295
        else
1282
1296
                {
1283
 
                        size_t num_to_read =
 
1297
                        int num_to_read =
1284
1298
                        YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1285
1299
 
1286
1300
                while ( num_to_read <= 0 )
1325
1339
 
1326
1340
                /* Read in more data. */
1327
1341
                YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1328
 
                        yyg->yy_n_chars, num_to_read );
 
1342
                        yyg->yy_n_chars, (size_t) num_to_read );
1329
1343
 
1330
1344
                YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1331
1345
                }
1397
1411
    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state , yyscan_t yyscanner)
1398
1412
{
1399
1413
        register int yy_is_jam;
1400
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
1414
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
1401
1415
        register char *yy_cp = yyg->yy_c_buf_p;
1402
1416
 
1403
1417
        register YY_CHAR yy_c = 1;
1842
1856
 
1843
1857
/** Setup the input buffer state to scan a string. The next call to yylex() will
1844
1858
 * scan from a @e copy of @a str.
1845
 
 * @param str a NUL-terminated string to scan
1846
 
 * @param yy_str a NUL-terminated string to scan
 
1859
 * @param yystr a NUL-terminated string to scan
1847
1860
 * @param yyscanner The scanner object.
1848
1861
 * @return the newly allocated buffer state object.
1849
1862
 * @note If you want to scan bytes that may contain NUL values, then use
1850
1863
 *       yy_scan_bytes() instead.
1851
1864
 */
1852
 
YY_BUFFER_STATE yy_scan_string (yyconst char * yy_str , yyscan_t yyscanner)
 
1865
YY_BUFFER_STATE yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
1853
1866
{
1854
1867
    
1855
 
        return yy_scan_bytes(yy_str,strlen(yy_str) ,yyscanner);
 
1868
        return yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
1856
1869
}
1857
1870
 
1858
1871
/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1862
1875
 * @param yyscanner The scanner object.
1863
1876
 * @return the newly allocated buffer state object.
1864
1877
 */
1865
 
YY_BUFFER_STATE yy_scan_bytes  (yyconst char * bytes, int  len , yyscan_t yyscanner)
 
1878
YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len , yyscan_t yyscanner)
1866
1879
{
1867
1880
        YY_BUFFER_STATE b;
1868
1881
        char *buf;
1870
1883
        int i;
1871
1884
    
1872
1885
        /* Get memory for full buffer, including space for trailing EOB's. */
1873
 
        n = len + 2;
 
1886
        n = _yybytes_len + 2;
1874
1887
        buf = (char *) yyalloc(n ,yyscanner );
1875
1888
        if ( ! buf )
1876
1889
                YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1877
1890
 
1878
 
        for ( i = 0; i < len; ++i )
1879
 
                buf[i] = bytes[i];
 
1891
        for ( i = 0; i < _yybytes_len; ++i )
 
1892
                buf[i] = yybytes[i];
1880
1893
 
1881
 
        buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
 
1894
        buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1882
1895
 
1883
1896
        b = yy_scan_buffer(buf,n ,yyscanner);
1884
1897
        if ( ! b )
2065
2078
 
2066
2079
/* Accessor methods for yylval and yylloc */
2067
2080
 
 
2081
/* User-visible API */
 
2082
 
 
2083
/* yylex_init is special because it creates the scanner itself, so it is
 
2084
 * the ONLY reentrant function that doesn't take the scanner as the last argument.
 
2085
 * That's why we explicitly handle the declaration, instead of using our macros.
 
2086
 */
 
2087
 
 
2088
int yylex_init(yyscan_t* ptr_yy_globals)
 
2089
 
 
2090
{
 
2091
    if (ptr_yy_globals == NULL){
 
2092
        errno = EINVAL;
 
2093
        return 1;
 
2094
    }
 
2095
 
 
2096
    *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
 
2097
 
 
2098
    if (*ptr_yy_globals == NULL){
 
2099
        errno = ENOMEM;
 
2100
        return 1;
 
2101
    }
 
2102
 
 
2103
    /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
 
2104
    memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
 
2105
 
 
2106
    return yy_init_globals ( *ptr_yy_globals );
 
2107
}
 
2108
 
2068
2109
static int yy_init_globals (yyscan_t yyscanner)
2069
2110
{
2070
2111
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2071
2112
    /* Initialization is the same as for the non-reentrant scanner.
2072
 
       This function is called once per scanner lifetime. */
 
2113
     * This function is called from yylex_destroy(), so don't allocate here.
 
2114
     */
2073
2115
 
2074
2116
    yyg->yy_buffer_stack = 0;
2075
2117
    yyg->yy_buffer_stack_top = 0;
2076
2118
    yyg->yy_buffer_stack_max = 0;
2077
2119
    yyg->yy_c_buf_p = (char *) 0;
2078
 
    yyg->yy_init = 1;
 
2120
    yyg->yy_init = 0;
2079
2121
    yyg->yy_start = 0;
 
2122
 
2080
2123
    yyg->yy_start_stack_ptr = 0;
2081
2124
    yyg->yy_start_stack_depth = 0;
2082
 
    yyg->yy_start_stack = (int *) 0;
 
2125
    yyg->yy_start_stack =  NULL;
2083
2126
 
2084
2127
/* Defined in main.c */
2085
2128
#ifdef YY_STDINIT
2096
2139
    return 0;
2097
2140
}
2098
2141
 
2099
 
/* User-visible API */
2100
 
 
2101
 
/* yylex_init is special because it creates the scanner itself, so it is
2102
 
 * the ONLY reentrant function that doesn't take the scanner as the last argument.
2103
 
 * That's why we explicitly handle the declaration, instead of using our macros.
2104
 
 */
2105
 
 
2106
 
int yylex_init(yyscan_t* ptr_yy_globals)
2107
 
 
2108
 
{
2109
 
    if (ptr_yy_globals == NULL){
2110
 
        errno = EINVAL;
2111
 
        return 1;
2112
 
    }
2113
 
 
2114
 
    *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
2115
 
 
2116
 
    if (*ptr_yy_globals == NULL){
2117
 
        errno = ENOMEM;
2118
 
        return 1;
2119
 
    }
2120
 
 
2121
 
    memset(*ptr_yy_globals,0,sizeof(struct yyguts_t));
2122
 
 
2123
 
    return yy_init_globals ( *ptr_yy_globals );
2124
 
}
2125
 
 
2126
2142
/* yylex_destroy is for both reentrant and non-reentrant scanners. */
2127
2143
int yylex_destroy  (yyscan_t yyscanner)
2128
2144
{
2143
2159
        yyfree(yyg->yy_start_stack ,yyscanner );
2144
2160
        yyg->yy_start_stack = NULL;
2145
2161
 
 
2162
    /* Reset the globals. This is important in a non-reentrant scanner so the next time
 
2163
     * yylex() is called, initialization will occur. */
 
2164
    yy_init_globals( yyscanner);
 
2165
 
2146
2166
    /* Destroy the main struct (reentrant only). */
2147
2167
    yyfree ( yyscanner , yyscanner );
 
2168
    yyscanner = NULL;
2148
2169
    return 0;
2149
2170
}
2150
2171
 
2156
2177
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
2157
2178
{
2158
2179
        register int i;
2159
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2160
2180
        for ( i = 0; i < n; ++i )
2161
2181
                s1[i] = s2[i];
2162
2182
}
2166
2186
static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
2167
2187
{
2168
2188
        register int n;
2169
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2170
2189
        for ( n = 0; s[n]; ++n )
2171
2190
                ;
2172
2191
 
2198
2217
 
2199
2218
#define YYTABLES_NAME "yytables"
2200
2219
 
2201
 
#undef YY_NEW_FILE
2202
 
#undef YY_FLUSH_BUFFER
2203
 
#undef yy_set_bol
2204
 
#undef yy_new_buffer
2205
 
#undef yy_set_interactive
2206
 
#undef yytext_ptr
2207
 
#undef YY_DO_BEFORE_ACTION
2208
 
 
2209
 
#ifdef YY_DECL_IS_OURS
2210
 
#undef YY_DECL_IS_OURS
2211
 
#undef YY_DECL
2212
 
#endif
2213
2220
#line 240 "psp_parser.l"
2214
2221
 
2215
2222