~ubuntu-branches/ubuntu/vivid/dicelab/vivid

« back to all changes in this revision

Viewing changes to lex.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Lemmen
  • Date: 2009-11-25 12:30:05 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20091125123005-ylg50em2n998a232
Tags: 0.7-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#line 2 "lex.c"
1
2
 
2
 
#line 3 "lex.c"
 
3
#line 4 "lex.c"
3
4
 
4
5
#define  YY_INT_ALIGNED short int
5
6
 
8
9
#define FLEX_SCANNER
9
10
#define YY_FLEX_MAJOR_VERSION 2
10
11
#define YY_FLEX_MINOR_VERSION 5
11
 
#define YY_FLEX_SUBMINOR_VERSION 33
 
12
#define YY_FLEX_SUBMINOR_VERSION 35
12
13
#if YY_FLEX_SUBMINOR_VERSION > 0
13
14
#define FLEX_BETA
14
15
#endif
30
31
 
31
32
/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
32
33
 
33
 
#if __STDC_VERSION__ >= 199901L
 
34
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
34
35
 
35
36
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
36
37
 * if you want the limit (max/min) macros for int types. 
53
54
typedef unsigned char flex_uint8_t; 
54
55
typedef unsigned short int flex_uint16_t;
55
56
typedef unsigned int flex_uint32_t;
56
 
#endif /* ! C99 */
57
57
 
58
58
/* Limits of integral types. */
59
59
#ifndef INT8_MIN
84
84
#define UINT32_MAX             (4294967295U)
85
85
#endif
86
86
 
 
87
#endif /* ! C99 */
 
88
 
87
89
#endif /* ! FLEXINT_H */
88
90
 
89
91
#ifdef __cplusplus
93
95
 
94
96
#else   /* ! __cplusplus */
95
97
 
96
 
#if __STDC__
 
98
/* C99 requires __STDC__ to be defined as 1. */
 
99
#if defined (__STDC__)
97
100
 
98
101
#define YY_USE_CONST
99
102
 
100
 
#endif  /* __STDC__ */
 
103
#endif  /* defined (__STDC__) */
101
104
#endif  /* ! __cplusplus */
102
105
 
103
106
#ifdef YY_USE_CONST
139
142
 
140
143
/* Size of default input buffer. */
141
144
#ifndef YY_BUF_SIZE
 
145
#ifdef __ia64__
 
146
/* On IA-64, the buffer size is 16k, not 8k.
 
147
 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
 
148
 * Ditto for the __ia64__ case accordingly.
 
149
 */
 
150
#define YY_BUF_SIZE 32768
 
151
#else
142
152
#define YY_BUF_SIZE 16384
 
153
#endif /* __ia64__ */
143
154
#endif
144
155
 
145
156
/* The state buf must be large enough to hold one state per character in the main buffer.
190
201
 
191
202
#define unput(c) yyunput( c, (yytext_ptr)  )
192
203
 
193
 
/* The following is because we cannot portably get our hands on size_t
194
 
 * (without autoconf's help, which isn't available because we want
195
 
 * flex-generated scanners to compile on their own).
196
 
 */
197
 
 
198
204
#ifndef YY_TYPEDEF_YY_SIZE_T
199
205
#define YY_TYPEDEF_YY_SIZE_T
200
 
typedef unsigned int yy_size_t;
 
206
typedef size_t yy_size_t;
201
207
#endif
202
208
 
203
209
#ifndef YY_STRUCT_YY_BUFFER_STATE
346
352
 
347
353
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
348
354
 
349
 
#define yywrap() 1
 
355
#define yywrap(n) 1
350
356
#define YY_SKIP_YYWRAP
351
357
 
352
358
typedef unsigned char YY_CHAR;
386
392
        flex_int32_t yy_verify;
387
393
        flex_int32_t yy_nxt;
388
394
        };
389
 
static yyconst flex_int16_t yy_accept[101] =
 
395
static yyconst flex_int16_t yy_accept[102] =
390
396
    {   0,
391
 
        0,    0,   37,   35,   34,   33,   35,   35,   35,   35,
 
397
        0,    0,   37,   35,   34,   34,   34,   35,   35,   35,
392
398
        3,   29,   35,   30,   32,   32,    4,   32,   32,   32,
393
399
       32,   32,   32,   32,   32,   32,   32,   32,   34,    2,
394
 
       34,   26,    3,   31,    1,   27,   25,   28,   32,   32,
395
 
       21,   32,   32,   32,   32,   32,   22,   20,   32,   32,
396
 
       32,   32,   32,   32,   32,   32,   32,   32,   32,   34,
397
 
        2,    2,    1,   32,   32,   32,   32,   32,   32,   32,
398
 
       32,   17,   13,   32,   32,   10,   32,    5,   32,   32,
399
 
       32,   11,   24,   32,   32,   14,   12,   16,    8,    6,
400
 
        9,   23,   32,    7,   15,   32,   18,   32,   19,    0
 
400
       34,   33,   26,   31,    1,    3,   27,   25,   28,   32,
 
401
       32,   21,   32,   32,   32,   32,   32,   22,   20,   32,
 
402
       32,   32,   32,   32,   32,   32,   32,   32,   32,   32,
 
403
       34,    2,    2,    1,   32,   32,   32,   32,   32,   32,
 
404
       32,   32,   17,   13,   32,   32,   10,   32,    5,   32,
 
405
       32,   32,   11,   24,   32,   32,   14,   12,   16,    8,
 
406
        6,    9,   23,   32,    7,   15,   32,   18,   32,   19,
401
407
 
 
408
        0
402
409
    } ;
403
410
 
404
411
static yyconst flex_int32_t yy_ec[256] =
405
412
    {   0,
406
413
        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
407
 
        4,    4,    4,    1,    1,    1,    1,    1,    1,    1,
 
414
        4,    4,    5,    1,    1,    1,    1,    1,    1,    1,
408
415
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
409
 
        1,    2,    5,    1,    6,    1,    1,    1,    1,    1,
410
 
        1,    1,    1,    1,    7,    8,    9,   10,   10,   10,
 
416
        1,    2,    6,    1,    7,    1,    1,    1,    1,    1,
 
417
        1,    1,    1,    1,    1,    8,    9,   10,   10,   10,
411
418
       10,   10,   10,   10,   10,   10,   10,    1,    1,   11,
412
419
       12,   13,    1,    1,   14,   14,   14,   14,   14,   14,
413
420
       14,   14,   14,   14,   14,   14,   14,   14,   14,   14,
441
448
        3,    3,    3,    3
442
449
    } ;
443
450
 
444
 
static yyconst flex_int16_t yy_base[104] =
445
 
    {   0,
446
 
        0,   33,  124,  125,   34,   38,  111,  112,  113,  111,
447
 
      109,  106,  105,  104,    0,   88,   16,   90,   22,   91,
448
 
       27,   94,   32,   33,   93,   25,   89,   88,   52,    0,
449
 
       61,  125,   98,  125,    0,  125,  125,  125,    0,   75,
450
 
        0,   79,   75,   75,   74,   82,    0,    0,   83,   70,
451
 
       68,   64,   68,   69,   62,   65,   68,   74,   69,   64,
452
 
        0,    0,    0,   64,   61,   70,   57,   68,   64,   56,
453
 
       52,    0,    0,   57,   64,    0,   49,    0,   53,   54,
454
 
       46,    0,    0,   44,   57,    0,    0,    0,    0,    0,
455
 
        0,    0,   51,    0,    0,   45,    0,   39,    0,  125,
456
 
 
457
 
       45,   70,   73
458
 
    } ;
459
 
 
460
 
static yyconst flex_int16_t yy_def[104] =
461
 
    {   0,
462
 
      100,    1,  100,  100,  100,  100,  100,  100,  100,  100,
463
 
      100,  100,  100,  100,  101,  101,  101,  101,  101,  101,
464
 
      101,  101,  101,  101,  101,  101,  101,  101,  100,  102,
465
 
      100,  100,  100,  100,  103,  100,  100,  100,  101,  101,
466
 
      101,  101,  101,  101,  101,  101,  101,  101,  101,  101,
467
 
      101,  101,  101,  101,  101,  101,  101,  101,  101,  100,
468
 
      102,  102,  103,  101,  101,  101,  101,  101,  101,  101,
469
 
      101,  101,  101,  101,  101,  101,  101,  101,  101,  101,
470
 
      101,  101,  101,  101,  101,  101,  101,  101,  101,  101,
471
 
      101,  101,  101,  101,  101,  101,  101,  101,  101,    0,
472
 
 
473
 
      100,  100,  100
474
 
    } ;
475
 
 
476
 
static yyconst flex_int16_t yy_nxt[160] =
477
 
    {   0,
478
 
        4,    5,    6,    5,    7,    4,    8,    9,   10,   11,
 
451
static yyconst flex_int16_t yy_base[105] =
 
452
    {   0,
 
453
        0,   33,  136,  137,   34,   39,   43,  123,  126,  124,
 
454
      122,  119,  118,  117,    0,  101,   22,  103,   28,  104,
 
455
       33,  107,   38,   39,  106,   31,  102,  101,   67,    0,
 
456
       73,   77,  137,  137,    0,  111,  137,  137,  137,    0,
 
457
       88,    0,   92,   88,   88,   87,   95,    0,    0,   96,
 
458
       83,   81,   77,   81,   82,   75,   78,   81,   87,   82,
 
459
       81,    0,    0,    0,   77,   74,   83,   70,   81,   77,
 
460
       69,   65,    0,    0,   70,   76,    0,   59,    0,   61,
 
461
       49,   36,    0,    0,   35,   49,    0,    0,    0,    0,
 
462
        0,    0,    0,   44,    0,    0,   45,    0,   39,    0,
 
463
 
 
464
      137,   51,   88,   91
 
465
    } ;
 
466
 
 
467
static yyconst flex_int16_t yy_def[105] =
 
468
    {   0,
 
469
      101,    1,  101,  101,  101,  101,  101,  101,  101,  101,
 
470
      101,  101,  101,  101,  102,  102,  102,  102,  102,  102,
 
471
      102,  102,  102,  102,  102,  102,  102,  102,  101,  103,
 
472
      101,  101,  101,  101,  104,  101,  101,  101,  101,  102,
 
473
      102,  102,  102,  102,  102,  102,  102,  102,  102,  102,
 
474
      102,  102,  102,  102,  102,  102,  102,  102,  102,  102,
 
475
      101,  103,  103,  104,  102,  102,  102,  102,  102,  102,
 
476
      102,  102,  102,  102,  102,  102,  102,  102,  102,  102,
 
477
      102,  102,  102,  102,  102,  102,  102,  102,  102,  102,
 
478
      102,  102,  102,  102,  102,  102,  102,  102,  102,  102,
 
479
 
 
480
        0,  101,  101,  101
 
481
    } ;
 
482
 
 
483
static yyconst flex_int16_t yy_nxt[172] =
 
484
    {   0,
 
485
        4,    5,    6,    5,    7,    8,    4,    9,   10,   11,
479
486
       12,   13,   14,   15,   15,   16,   17,   18,   19,   15,
480
487
       20,   21,   22,   23,   15,   15,   15,   24,   25,   26,
481
 
       27,   15,   15,   28,   29,   31,   31,   31,   30,   31,
482
 
       31,   31,   41,   44,   42,   47,   50,   39,   45,   51,
483
 
       53,   56,   48,   60,   31,   31,   57,   61,   52,   99,
484
 
       98,   54,   31,   31,   31,   60,   31,   31,   97,   61,
485
 
       62,   96,   62,   63,   95,   63,   94,   93,   92,   91,
486
 
       90,   89,   88,   87,   86,   85,   84,   83,   82,   81,
487
 
       80,   79,   78,   77,   76,   75,   74,   73,   72,   71,
 
488
       27,   15,   15,   28,   29,   31,   31,   31,   31,   30,
 
489
       31,   31,   31,   31,   31,   32,   31,   31,   42,   45,
 
490
       43,   48,   51,   40,   46,   52,   54,   57,   49,  100,
 
491
       99,   98,   58,   97,   53,   96,   95,   55,   61,   31,
 
492
       31,   31,   94,   62,   31,   31,   31,   31,   31,   31,
 
493
       31,   31,   61,   31,   31,   31,   93,   62,   63,   92,
 
494
       63,   64,   91,   64,   90,   89,   88,   87,   86,   85,
488
495
 
489
 
       70,   69,   68,   67,   66,   65,   64,   33,   59,   58,
490
 
       55,   49,   46,   43,   40,   38,   37,   36,   33,   35,
491
 
       34,   33,   32,  100,    3,  100,  100,  100,  100,  100,
492
 
      100,  100,  100,  100,  100,  100,  100,  100,  100,  100,
493
 
      100,  100,  100,  100,  100,  100,  100,  100,  100,  100,
494
 
      100,  100,  100,  100,  100,  100,  100,  100,  100
 
496
       84,   83,   82,   81,   80,   79,   78,   77,   76,   75,
 
497
       74,   73,   72,   71,   70,   69,   68,   67,   66,   65,
 
498
       36,   60,   59,   56,   50,   47,   44,   41,   39,   38,
 
499
       37,   36,   35,   34,   33,  101,    3,  101,  101,  101,
 
500
      101,  101,  101,  101,  101,  101,  101,  101,  101,  101,
 
501
      101,  101,  101,  101,  101,  101,  101,  101,  101,  101,
 
502
      101,  101,  101,  101,  101,  101,  101,  101,  101,  101,
 
503
      101
495
504
    } ;
496
505
 
497
 
static yyconst flex_int16_t yy_chk[160] =
 
506
static yyconst flex_int16_t yy_chk[172] =
498
507
    {   0,
499
508
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
500
509
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
501
510
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
502
 
        1,    1,    1,    1,    2,    5,    5,    5,    2,    6,
503
 
        6,    6,   17,   19,   17,   21,   23,  101,   19,   23,
504
 
       24,   26,   21,   29,   29,   29,   26,   29,   23,   98,
505
 
       96,   24,   31,   31,   31,   60,   60,   60,   93,   60,
506
 
      102,   85,  102,  103,   84,  103,   81,   80,   79,   77,
507
 
       75,   74,   71,   70,   69,   68,   67,   66,   65,   64,
508
 
       59,   58,   57,   56,   55,   54,   53,   52,   51,   50,
 
511
        1,    1,    1,    1,    2,    5,    5,    5,    5,    2,
 
512
        6,    6,    6,    6,    7,    7,    7,    7,   17,   19,
 
513
       17,   21,   23,  102,   19,   23,   24,   26,   21,   99,
 
514
       97,   94,   26,   86,   23,   85,   82,   24,   29,   29,
 
515
       29,   29,   81,   29,   31,   31,   31,   31,   32,   32,
 
516
       32,   32,   61,   61,   61,   61,   80,   61,  103,   78,
 
517
      103,  104,   76,  104,   75,   72,   71,   70,   69,   68,
509
518
 
510
 
       49,   46,   45,   44,   43,   42,   40,   33,   28,   27,
511
 
       25,   22,   20,   18,   16,   14,   13,   12,   11,   10,
512
 
        9,    8,    7,    3,  100,  100,  100,  100,  100,  100,
513
 
      100,  100,  100,  100,  100,  100,  100,  100,  100,  100,
514
 
      100,  100,  100,  100,  100,  100,  100,  100,  100,  100,
515
 
      100,  100,  100,  100,  100,  100,  100,  100,  100
 
519
       67,   66,   65,   60,   59,   58,   57,   56,   55,   54,
 
520
       53,   52,   51,   50,   47,   46,   45,   44,   43,   41,
 
521
       36,   28,   27,   25,   22,   20,   18,   16,   14,   13,
 
522
       12,   11,   10,    9,    8,    3,  101,  101,  101,  101,
 
523
      101,  101,  101,  101,  101,  101,  101,  101,  101,  101,
 
524
      101,  101,  101,  101,  101,  101,  101,  101,  101,  101,
 
525
      101,  101,  101,  101,  101,  101,  101,  101,  101,  101,
 
526
      101
516
527
    } ;
517
528
 
518
529
/* Table of booleans, true if rule could match eol. */
540
551
#include "tree.h"
541
552
#include "par.h"
542
553
 
543
 
#line 544 "lex.c"
 
554
#line 555 "lex.c"
544
555
 
545
556
#define INITIAL 0
546
557
 
558
569
 
559
570
static int yy_init_globals (void );
560
571
 
 
572
/* Accessor methods to globals.
 
573
   These are made visible to non-reentrant scanners for convenience. */
 
574
 
 
575
int yylex_destroy (void );
 
576
 
 
577
int yyget_debug (void );
 
578
 
 
579
void yyset_debug (int debug_flag  );
 
580
 
 
581
YY_EXTRA_TYPE yyget_extra (void );
 
582
 
 
583
void yyset_extra (YY_EXTRA_TYPE user_defined  );
 
584
 
 
585
FILE *yyget_in (void );
 
586
 
 
587
void yyset_in  (FILE * in_str  );
 
588
 
 
589
FILE *yyget_out (void );
 
590
 
 
591
void yyset_out  (FILE * out_str  );
 
592
 
 
593
int yyget_leng (void );
 
594
 
 
595
char *yyget_text (void );
 
596
 
 
597
int yyget_lineno (void );
 
598
 
 
599
void yyset_lineno (int line_number  );
 
600
 
561
601
/* Macros after this point can all be overridden by user definitions in
562
602
 * section 1.
563
603
 */
590
630
 
591
631
/* Amount of stuff to slurp up with each read. */
592
632
#ifndef YY_READ_BUF_SIZE
 
633
#ifdef __ia64__
 
634
/* On IA-64, the buffer size is 16k, not 8k */
 
635
#define YY_READ_BUF_SIZE 16384
 
636
#else
593
637
#define YY_READ_BUF_SIZE 8192
 
638
#endif /* __ia64__ */
594
639
#endif
595
640
 
596
641
/* Copy whatever the last rule matched to the standard output. */
598
643
/* This used to be an fputs(), but since the string might contain NUL's,
599
644
 * we now use fwrite().
600
645
 */
601
 
#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
 
646
#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
602
647
#endif
603
648
 
604
649
/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
697
742
#line 10 "lex.l"
698
743
 
699
744
        /* remove comments */
700
 
#line 701 "lex.c"
 
745
#line 746 "lex.c"
701
746
 
702
747
        if ( !(yy_init) )
703
748
                {
751
796
                        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
752
797
                                {
753
798
                                yy_current_state = (int) yy_def[yy_current_state];
754
 
                                if ( yy_current_state >= 101 )
 
799
                                if ( yy_current_state >= 102 )
755
800
                                        yy_c = yy_meta[(unsigned int) yy_c];
756
801
                                }
757
802
                        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
758
803
                        ++yy_cp;
759
804
                        }
760
 
                while ( yy_base[yy_current_state] != 125 );
 
805
                while ( yy_base[yy_current_state] != 137 );
761
806
 
762
807
yy_find_action:
763
808
                yy_act = yy_accept[yy_current_state];
983
1028
#line 59 "lex.l"
984
1029
ECHO;
985
1030
        YY_BREAK
986
 
#line 987 "lex.c"
 
1031
#line 1032 "lex.c"
987
1032
case YY_STATE_EOF(INITIAL):
988
1033
        yyterminate();
989
1034
 
1238
1283
        else
1239
1284
                ret_val = EOB_ACT_CONTINUE_SCAN;
1240
1285
 
 
1286
        if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
 
1287
                /* Extend the array by 50%, plus the number we really need. */
 
1288
                yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
 
1289
                YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
 
1290
                if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
 
1291
                        YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
 
1292
        }
 
1293
 
1241
1294
        (yy_n_chars) += number_to_move;
1242
1295
        YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1243
1296
        YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1268
1321
                while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1269
1322
                        {
1270
1323
                        yy_current_state = (int) yy_def[yy_current_state];
1271
 
                        if ( yy_current_state >= 101 )
 
1324
                        if ( yy_current_state >= 102 )
1272
1325
                                yy_c = yy_meta[(unsigned int) yy_c];
1273
1326
                        }
1274
1327
                yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1296
1349
        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1297
1350
                {
1298
1351
                yy_current_state = (int) yy_def[yy_current_state];
1299
 
                if ( yy_current_state >= 101 )
 
1352
                if ( yy_current_state >= 102 )
1300
1353
                        yy_c = yy_meta[(unsigned int) yy_c];
1301
1354
                }
1302
1355
        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1303
 
        yy_is_jam = (yy_current_state == 100);
 
1356
        yy_is_jam = (yy_current_state == 101);
1304
1357
 
1305
1358
        return yy_is_jam ? 0 : yy_current_state;
1306
1359
}
1623
1676
                (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1624
1677
                                                                (num_to_alloc * sizeof(struct yy_buffer_state*)
1625
1678
                                                                );
1626
 
                
 
1679
                if ( ! (yy_buffer_stack) )
 
1680
                        YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
 
1681
                                                                  
1627
1682
                memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1628
1683
                                
1629
1684
                (yy_buffer_stack_max) = num_to_alloc;
1641
1696
                                                                ((yy_buffer_stack),
1642
1697
                                                                num_to_alloc * sizeof(struct yy_buffer_state*)
1643
1698
                                                                );
 
1699
                if ( ! (yy_buffer_stack) )
 
1700
                        YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1644
1701
 
1645
1702
                /* zero only the new slots.*/
1646
1703
                memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1699
1756
 
1700
1757
/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1701
1758
 * scan from a @e copy of @a bytes.
1702
 
 * @param bytes the byte buffer to scan
1703
 
 * @param len the number of bytes in the buffer pointed to by @a bytes.
 
1759
 * @param yybytes the byte buffer to scan
 
1760
 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1704
1761
 * 
1705
1762
 * @return the newly allocated buffer state object.
1706
1763
 */