src/vParser.cpp File Reference

#include <stdlib.h>
#include <vector>
#include "tError.h"
#include "values/vCore.h"
#include "values/veComparison.h"
#include "values/veMath.h"
#include "values/vRegistry.h"
#include "values/vParser.h"
#include "tString.h"

Include dependency graph for vParser.cpp:

Go to the source code of this file.

Classes

union  YYSTYPE
union  yyalloc

Defines

#define YYBISON   1
#define YYBISON_VERSION   "2.3"
#define YYSKELETON_NAME   "yacc.c"
#define YYPURE   0
#define YYLSP_NEEDED   0
#define tINTEGER   258
#define tSTRING   259
#define tID   260
#define tNE   261
#define tEQ   262
#define tGT   263
#define tLT   264
#define tGE   265
#define tLE   266
#define tCOMPARE   267
#define tUNARYMINUS   268
#define YYINCLUDED_STDLIB_H
#define YYDEBUG   0
#define YYERROR_VERBOSE   0
#define YYTOKEN_TABLE   0
#define yystype   YYSTYPE
#define YYSTYPE_IS_DECLARED   1
#define YYSTYPE_IS_TRIVIAL   1
#define YYSIZE_T   unsigned int
#define YYSIZE_MAXIMUM   ((YYSIZE_T) -1)
#define YY_(msgid)   msgid
#define YYUSE(e)   ((void) (e))
#define YYID(n)   (n)
#define YYSTACK_ALLOC   YYMALLOC
#define YYSTACK_FREE   YYFREE
#define YYSTACK_ALLOC_MAXIMUM   YYSIZE_MAXIMUM
#define YYMALLOC   malloc
#define YYFREE   free
#define YYSTACK_GAP_MAXIMUM   (sizeof (union yyalloc) - 1)
#define YYSTACK_BYTES(N)
#define YYCOPY(To, From, Count)
#define YYSTACK_RELOCATE(Stack)
#define YYFINAL   12
#define YYLAST   38
#define YYNTOKENS   22
#define YYNNTS   5
#define YYNRULES   17
#define YYNSTATES   31
#define YYUNDEFTOK   2
#define YYMAXUTOK   268
#define YYTRANSLATE(YYX)   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
#define YYPACT_NINF   -14
#define YYTABLE_NINF   -1
#define yyerrok   (yyerrstatus = 0)
#define yyclearin   (yychar = YYEMPTY)
#define YYEMPTY   (-2)
#define YYEOF   0
#define YYACCEPT   goto yyacceptlab
#define YYABORT   goto yyabortlab
#define YYERROR   goto yyerrorlab
#define YYFAIL   goto yyerrlab
#define YYRECOVERING()   (!!yyerrstatus)
#define YYBACKUP(Token, Value)
#define YYTERROR   1
#define YYERRCODE   256
#define YYRHSLOC(Rhs, K)   ((Rhs)[K])
#define YYLLOC_DEFAULT(Current, Rhs, N)
#define YY_LOCATION_PRINT(File, Loc)   ((void) 0)
#define YYLEX   yylex ()
#define YYDPRINTF(Args)
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
#define YY_STACK_PRINT(Bottom, Top)
#define YY_REDUCE_PRINT(Rule)
#define YYINITDEPTH   200
#define YYMAXDEPTH   10000
#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))

Typedefs

typedef unsigned char yytype_uint8
typedef short int yytype_int8
typedef unsigned short int yytype_uint16
typedef short int yytype_int16

Enumerations

enum  yytokentype {
  tINTEGER = 258, tSTRING = 259, tID = 260, tNE = 261,
  tEQ = 262, tGT = 263, tLT = 264, tGE = 265,
  tLE = 266, tCOMPARE = 267, tUNARYMINUS = 268
}

Functions

int yylex (void)
void yyerror (char const *s)
static void yydestruct (yymsg, yytype, yyvaluep) const char *yymsg
int yyparse ()
int lex_getc (void)
static void lex_ungetc (int c)
static bool follow (int expect)

Variables

Expr::Base * rv
static const yytype_uint8 yytranslate []
static const yytype_uint8 yyr1 []
static const yytype_uint8 yyr2 []
static const yytype_uint8 yydefact []
static const yytype_int8 yydefgoto []
static const yytype_int8 yypact []
static const yytype_int8 yypgoto []
static const yytype_int8 yytable []
static const yytype_int8 yycheck []
static const yytype_uint8 yystos []
int yytype
YYSTYPEyyvaluep
int yychar
YYSTYPE yylval
int yynerrs
tString in
int pos
int buffer


Define Documentation

#define tCOMPARE   267

Definition at line 92 of file vParser.cpp.

#define tEQ   262

Definition at line 87 of file vParser.cpp.

#define tGE   265

Definition at line 90 of file vParser.cpp.

#define tGT   263

Definition at line 88 of file vParser.cpp.

#define tID   260

Definition at line 85 of file vParser.cpp.

#define tINTEGER   258

Definition at line 83 of file vParser.cpp.

#define tLE   266

Definition at line 91 of file vParser.cpp.

#define tLT   264

Definition at line 89 of file vParser.cpp.

#define tNE   261

Definition at line 86 of file vParser.cpp.

#define tSTRING   259

Definition at line 84 of file vParser.cpp.

#define tUNARYMINUS   268

Definition at line 93 of file vParser.cpp.

#define YY_ ( msgid   )     msgid

Definition at line 224 of file vParser.cpp.

Referenced by yyparse().

#define YY_LOCATION_PRINT ( File,
Loc   )     ((void) 0)

Definition at line 630 of file vParser.cpp.

#define YY_REDUCE_PRINT ( Rule   ) 

Definition at line 794 of file vParser.cpp.

Referenced by yyparse().

#define YY_STACK_PRINT ( Bottom,
Top   ) 

Definition at line 793 of file vParser.cpp.

Referenced by yyparse().

#define YY_SYMBOL_PRINT ( Title,
Type,
Value,
Location   ) 

Definition at line 792 of file vParser.cpp.

Referenced by yyparse().

#define YYABORT   goto yyabortlab

Definition at line 559 of file vParser.cpp.

Referenced by yyparse().

#define YYACCEPT   goto yyacceptlab

Definition at line 558 of file vParser.cpp.

Referenced by yyparse().

#define YYBACKUP ( Token,
Value   ) 

Value:

do                                                              \
  if (yychar == YYEMPTY && yylen == 1)                          \
    {                                                           \
      yychar = (Token);                                         \
      yylval = (Value);                                         \
      yytoken = YYTRANSLATE (yychar);                           \
      YYPOPSTACK (1);                                           \
      goto yybackup;                                            \
    }                                                           \
  else                                                          \
    {                                                           \
      yyerror (YY_("syntax error: cannot back up")); \
      YYERROR;                                                  \
    }                                                           \
while (YYID (0))

Definition at line 571 of file vParser.cpp.

#define YYBISON   1

Definition at line 47 of file vParser.cpp.

#define YYBISON_VERSION   "2.3"

Definition at line 50 of file vParser.cpp.

#define yyclearin   (yychar = YYEMPTY)

Definition at line 554 of file vParser.cpp.

#define YYCOPY ( To,
From,
Count   ) 

Value:

do                                      \
        {                                       \
          YYSIZE_T yyi;                         \
          for (yyi = 0; yyi < (Count); yyi++)   \
            (To)[yyi] = (From)[yyi];            \
        }                                       \
      while (YYID (0))

Definition at line 346 of file vParser.cpp.

#define YYDEBUG   0

Definition at line 128 of file vParser.cpp.

#define YYDPRINTF ( Args   ) 

Definition at line 791 of file vParser.cpp.

Referenced by yyparse().

#define YYEMPTY   (-2)

Definition at line 555 of file vParser.cpp.

Referenced by yyparse().

#define YYEOF   0

Definition at line 556 of file vParser.cpp.

Referenced by yyparse().

#define YYERRCODE   256

Definition at line 590 of file vParser.cpp.

#define yyerrok   (yyerrstatus = 0)

Definition at line 553 of file vParser.cpp.

#define YYERROR   goto yyerrorlab

Definition at line 560 of file vParser.cpp.

#define YYERROR_VERBOSE   0

Definition at line 136 of file vParser.cpp.

#define YYFAIL   goto yyerrlab

Definition at line 567 of file vParser.cpp.

#define YYFINAL   12

Definition at line 376 of file vParser.cpp.

Referenced by yyparse().

#define YYFREE   free

Definition at line 309 of file vParser.cpp.

#define YYID (  )     (n)

Definition at line 236 of file vParser.cpp.

#define YYINCLUDED_STDLIB_H

Definition at line 106 of file vParser.cpp.

#define YYINITDEPTH   200

Definition at line 800 of file vParser.cpp.

Referenced by yyparse().

#define YYLAST   38

Definition at line 378 of file vParser.cpp.

Referenced by yyparse().

#define YYLEX   yylex ()

Definition at line 640 of file vParser.cpp.

Referenced by yyparse().

#define YYLLOC_DEFAULT ( Current,
Rhs,
 ) 

Value:

do                                                                      \
      if (YYID (N))                                                    \
        {                                                               \
          (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
          (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
          (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
          (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
        }                                                               \
      else                                                              \
        {                                                               \
          (Current).first_line   = (Current).last_line   =              \
            YYRHSLOC (Rhs, 0).last_line;                                \
          (Current).first_column = (Current).last_column =              \
            YYRHSLOC (Rhs, 0).last_column;                              \
        }                                                               \
    while (YYID (0))

Definition at line 599 of file vParser.cpp.

#define YYLSP_NEEDED   0

Definition at line 59 of file vParser.cpp.

#define YYMALLOC   malloc

Definition at line 302 of file vParser.cpp.

#define YYMAXDEPTH   10000

Definition at line 811 of file vParser.cpp.

Referenced by yyparse().

#define YYMAXUTOK   268

Definition at line 391 of file vParser.cpp.

#define YYNNTS   5

Definition at line 383 of file vParser.cpp.

#define YYNRULES   17

Definition at line 385 of file vParser.cpp.

#define YYNSTATES   31

Definition at line 387 of file vParser.cpp.

#define YYNTOKENS   22

Definition at line 381 of file vParser.cpp.

Referenced by yyparse().

#define YYPACT_NINF   -14

Definition at line 507 of file vParser.cpp.

Referenced by yyparse().

#define YYPOPSTACK (  )     (yyvsp -= (N), yyssp -= (N))

Referenced by yyparse().

#define YYPURE   0

Definition at line 56 of file vParser.cpp.

 
#define YYRECOVERING (  )     (!!yyerrstatus)

Definition at line 569 of file vParser.cpp.

#define YYRHSLOC ( Rhs,
 )     ((Rhs)[K])

Definition at line 597 of file vParser.cpp.

#define YYSIZE_MAXIMUM   ((YYSIZE_T) -1)

Definition at line 214 of file vParser.cpp.

#define YYSIZE_T   unsigned int

Definition at line 210 of file vParser.cpp.

Referenced by yyparse().

#define YYSKELETON_NAME   "yacc.c"

Definition at line 53 of file vParser.cpp.

#define YYSTACK_ALLOC   YYMALLOC

Definition at line 288 of file vParser.cpp.

Referenced by yyparse().

#define YYSTACK_ALLOC_MAXIMUM   YYSIZE_MAXIMUM

Definition at line 291 of file vParser.cpp.

Referenced by yyparse().

#define YYSTACK_BYTES (  ) 

Value:

((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
      + YYSTACK_GAP_MAXIMUM)

Definition at line 335 of file vParser.cpp.

Referenced by yyparse().

#define YYSTACK_FREE   YYFREE

Definition at line 289 of file vParser.cpp.

Referenced by yyparse().

#define YYSTACK_GAP_MAXIMUM   (sizeof (union yyalloc) - 1)

Definition at line 331 of file vParser.cpp.

#define YYSTACK_RELOCATE ( Stack   ) 

Value:

do                                                                      \
      {                                                                 \
        YYSIZE_T yynewbytes;                                            \
        YYCOPY (&yyptr->Stack, Stack, yysize);                          \
        Stack = &yyptr->Stack;                                          \
        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
        yyptr += yynewbytes / sizeof (*yyptr);                          \
      }                                                                 \
    while (YYID (0))

Definition at line 362 of file vParser.cpp.

Referenced by yyparse().

#define yystype   YYSTYPE

Definition at line 156 of file vParser.cpp.

#define YYSTYPE_IS_DECLARED   1

Definition at line 157 of file vParser.cpp.

#define YYSTYPE_IS_TRIVIAL   1

Definition at line 158 of file vParser.cpp.

#define YYTABLE_NINF   -1

Definition at line 526 of file vParser.cpp.

Referenced by yyparse().

#define YYTERROR   1

Definition at line 589 of file vParser.cpp.

Referenced by yyparse().

#define YYTOKEN_TABLE   0

Definition at line 141 of file vParser.cpp.

#define YYTRANSLATE ( YYX   )     ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)

Definition at line 393 of file vParser.cpp.

Referenced by yyparse().

#define YYUNDEFTOK   2

Definition at line 390 of file vParser.cpp.

#define YYUSE (  )     ((void) (e))

Definition at line 230 of file vParser.cpp.


Typedef Documentation

typedef short int yytype_int16

Definition at line 197 of file vParser.cpp.

typedef short int yytype_int8

Definition at line 185 of file vParser.cpp.

typedef unsigned short int yytype_uint16

Definition at line 191 of file vParser.cpp.

typedef unsigned char yytype_uint8

Definition at line 176 of file vParser.cpp.


Enumeration Type Documentation

enum yytokentype

Enumerator:
tINTEGER 
tSTRING 
tID 
tNE 
tEQ 
tGT 
tLT 
tGE 
tLE 
tCOMPARE 
tUNARYMINUS 

Definition at line 68 of file vParser.cpp.

00068                  {
00069     tINTEGER = 258,
00070     tSTRING = 259,
00071     tID = 260,
00072     tNE = 261,
00073     tEQ = 262,
00074     tGT = 263,
00075     tLT = 264,
00076     tGE = 265,
00077     tLE = 266,
00078     tCOMPARE = 267,
00079     tUNARYMINUS = 268
00080 };


Function Documentation

static bool follow ( int  expect  )  [static]

Definition at line 1764 of file vParser.cpp.

01767 {
01768     assert(buffer == -1);
01769     buffer = c;
01770 }
01771 #endif
01772 

int lex_getc ( void   ) 

Definition at line 1731 of file vParser.cpp.

01741 {
01742     pos = 0;
01743     buffer = -1;

static void lex_ungetc ( int  c  )  [static]

Definition at line 1746 of file vParser.cpp.

01752 {

static void yydestruct ( yymsg  ,
yytype  ,
yyvaluep   
) const [static]

Referenced by yyparse().

Here is the caller graph for this function:

void yyerror ( char const *  s  ) 

Definition at line 1754 of file vParser.cpp.

Referenced by yyparse().

01754     {
01755         int r = buffer;
01756         buffer = -1;
01757         return r;
01758     }
01759 
01760     if ((unsigned int)pos >= in.size())
01761         return EOF;

Here is the caller graph for this function:

int yylex ( void   ) 

Definition at line 1775 of file vParser.cpp.

References tERR_ERROR.

01775 {
01776     //puts(s);
01777     //exit(1);
01778     tString msg("vValue parse error: ");
01779     msg << s;
01780     tERR_ERROR(msg);
01781 }
01782 
01783 static bool
01784 follow(int expect)
01785 {
01786     int c = lex_getc();
01787 
01788     if (c == expect)
01789         return true;
01790     lex_ungetc(c);
01791     return false;
01792 }
01793 
01794 int
01795 yylex(void)
01796 {
01797     int c;
01798 
01799     /* Skip white space.  */
01800     while (isspace(c = lex_getc()))
01801 #ifdef tCodeParser_STANDALONE
01802         if (c == '\n')
01803             return c;
01804 #endif
01805     ;
01806 
01807     if (c == EOF)
01808         return 0;
01809 
01810     if (isdigit(c))
01811     {
01812         int n = 0;
01813 
01814         for ( ; isdigit(c); c = lex_getc())
01815             n = (n * 10) + (c - '0');
01816         lex_ungetc(c);
01817         yylval.integer = n;
01818         return tINTEGER;
01819     }
01820 
01821     if (isalpha(c))
01822     {
01823         tString *s = new tString;
01824         for ( ; isalnum(c); c = lex_getc())
01825             *s += (char)c;
01826         lex_ungetc(c);
01827         yylval.string = s;
01828         return tID;
01829     }
01830 
01831     if (c == '"')
01832     {
01833         tString *s = new tString;
01834         while ('"' != (c = lex_getc()))
01835         {
01836             switch (c) {
01837             case EOF:
01838                 yyerror("Missing quote! wtf?");
01839                 break;
01840             case '\\':
01841                 // Supported only to escape another backslash or quote
01842                 // in the future, this should handle \n and co
01843                 c = lex_getc();
01844                 break;
01845             }

int yyparse (  ) 

Definition at line 1133 of file vParser.cpp.

References YYSTYPE::arglist, YYSTYPE::expr, rv, YYSTYPE::string, Registry::theRegistry(), void(), YY_, YY_REDUCE_PRINT, YY_STACK_PRINT, YY_SYMBOL_PRINT, YYABORT, YYACCEPT, yydestruct(), YYDPRINTF, YYEMPTY, YYEOF, yyerror(), YYFINAL, YYINITDEPTH, YYLAST, YYLEX, YYMAXDEPTH, YYNTOKENS, YYPACT_NINF, YYPOPSTACK, YYSIZE_T, YYSTACK_ALLOC, YYSTACK_ALLOC_MAXIMUM, YYSTACK_BYTES, YYSTACK_FREE, YYSTACK_RELOCATE, YYTABLE_NINF, YYTERROR, and YYTRANSLATE.

01156 {
01157 
01158     int yystate;
01159     int yyn;
01160     int yyresult;
01161     /* Number of tokens to shift before error messages enabled.  */
01162     int yyerrstatus;
01163     /* Look-ahead token as an internal (translated) token number.  */
01164     int yytoken = 0;
01165 #if YYERROR_VERBOSE
01166     /* Buffer for error messages, and its allocated size.  */
01167     char yymsgbuf[128];
01168     char *yymsg = yymsgbuf;
01169     YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
01170 #endif
01171 
01172     /* Three stacks and their tools:
01173        `yyss': related to states,
01174        `yyvs': related to semantic values,
01175        `yyls': related to locations.
01176 
01177        Refer to the stacks thru separate pointers, to allow yyoverflow
01178        to reallocate them elsewhere.  */
01179 
01180     /* The state stack.  */
01181     yytype_int16 yyssa[YYINITDEPTH];
01182     yytype_int16 *yyss = yyssa;
01183     yytype_int16 *yyssp;
01184 
01185     /* The semantic value stack.  */
01186     YYSTYPE yyvsa[YYINITDEPTH];
01187     YYSTYPE *yyvs = yyvsa;
01188     YYSTYPE *yyvsp;
01189 
01190 
01191 
01192 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
01193 
01194     YYSIZE_T yystacksize = YYINITDEPTH;
01195 
01196     /* The variables used to return semantic value and location from the
01197        action routines.  */
01198     YYSTYPE yyval;
01199 
01200 
01201     /* The number of symbols on the RHS of the reduced rule.
01202        Keep to zero when no symbol should be popped.  */
01203     int yylen = 0;
01204 
01205     YYDPRINTF ((stderr, "Starting parse\n"));
01206 
01207     yystate = 0;
01208     yyerrstatus = 0;
01209     yynerrs = 0;
01210     yychar = YYEMPTY;           /* Cause a token to be read.  */
01211 
01212     /* Initialize stack pointers.
01213        Waste one element of value and location stack
01214        so that they stay on the same level as the state stack.
01215        The wasted elements are never initialized.  */
01216 
01217     yyssp = yyss;
01218     yyvsp = yyvs;
01219 
01220     goto yysetstate;
01221 
01222     /*------------------------------------------------------------.
01223     | yynewstate -- Push a new state, which is found in yystate.  |
01224     `------------------------------------------------------------*/
01225 yynewstate:
01226     /* In all cases, when you get here, the value and location stacks
01227        have just been pushed.  So pushing a state here evens the stacks.  */
01228     yyssp++;
01229 
01230 yysetstate:
01231     *yyssp = yystate;
01232 
01233     if (yyss + yystacksize - 1 <= yyssp)
01234     {
01235         /* Get the current used size of the three stacks, in elements.  */
01236         YYSIZE_T yysize = yyssp - yyss + 1;
01237 
01238 #ifdef yyoverflow
01239         {
01240             /* Give user a chance to reallocate the stack.  Use copies of
01241                these so that the &'s don't force the real ones into
01242                memory.  */
01243             YYSTYPE *yyvs1 = yyvs;
01244             yytype_int16 *yyss1 = yyss;
01245 
01246 
01247             /* Each stack pointer address is followed by the size of the
01248                data in use in that stack, in bytes.  This used to be a
01249                conditional around just the two extra args, but that might
01250                be undefined if yyoverflow is a macro.  */
01251             yyoverflow (YY_("memory exhausted"),
01252                         &yyss1, yysize * sizeof (*yyssp),
01253                         &yyvs1, yysize * sizeof (*yyvsp),
01254 
01255                         &yystacksize);
01256 
01257             yyss = yyss1;
01258             yyvs = yyvs1;
01259         }
01260 #else /* no yyoverflow */
01261 # ifndef YYSTACK_RELOCATE
01262         goto yyexhaustedlab;
01263 # else
01264         /* Extend the stack our own way.  */
01265         if (YYMAXDEPTH <= yystacksize)
01266             goto yyexhaustedlab;
01267         yystacksize *= 2;
01268         if (YYMAXDEPTH < yystacksize)
01269             yystacksize = YYMAXDEPTH;
01270 
01271         {
01272             yytype_int16 *yyss1 = yyss;
01273             union yyalloc *yyptr =
01274                             (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
01275             if (! yyptr)
01276                 goto yyexhaustedlab;
01277             YYSTACK_RELOCATE (yyss);
01278             YYSTACK_RELOCATE (yyvs);
01279 
01280 #  undef YYSTACK_RELOCATE
01281             if (yyss1 != yyssa)
01282                 YYSTACK_FREE (yyss1);
01283         }
01284 # endif
01285 #endif /* no yyoverflow */
01286 
01287         yyssp = yyss + yysize - 1;
01288         yyvsp = yyvs + yysize - 1;
01289 
01290 
01291         YYDPRINTF ((stderr, "Stack size increased to %lu\n",
01292                     (unsigned long int) yystacksize));
01293 
01294         if (yyss + yystacksize - 1 <= yyssp)
01295             YYABORT;
01296     }
01297 
01298     YYDPRINTF ((stderr, "Entering state %d\n", yystate));
01299 
01300     goto yybackup;
01301 
01302     /*-----------.
01303     | yybackup.  |
01304     `-----------*/
01305 yybackup:
01306 
01307     /* Do appropriate processing given the current state.  Read a
01308        look-ahead token if we need one and don't already have one.  */
01309 
01310     /* First try to decide what to do without reference to look-ahead token.  */
01311     yyn = yypact[yystate];
01312     if (yyn == YYPACT_NINF)
01313         goto yydefault;
01314 
01315     /* Not known => get a look-ahead token if don't already have one.  */
01316 
01317     /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
01318     if (yychar == YYEMPTY)
01319     {
01320         YYDPRINTF ((stderr, "Reading a token: "));
01321         yychar = YYLEX;
01322     }
01323 
01324     if (yychar <= YYEOF)
01325     {
01326         yychar = yytoken = YYEOF;
01327         YYDPRINTF ((stderr, "Now at end of input.\n"));
01328     }
01329     else
01330     {
01331         yytoken = YYTRANSLATE (yychar);
01332         YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
01333     }
01334 
01335     /* If the proper action on seeing token YYTOKEN is to reduce or to
01336        detect an error, take that action.  */
01337     yyn += yytoken;
01338     if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
01339         goto yydefault;
01340     yyn = yytable[yyn];
01341     if (yyn <= 0)
01342     {
01343         if (yyn == 0 || yyn == YYTABLE_NINF)
01344             goto yyerrlab;
01345         yyn = -yyn;
01346         goto yyreduce;
01347     }
01348 
01349     if (yyn == YYFINAL)
01350         YYACCEPT;
01351 
01352     /* Count tokens shifted since error; after three, turn off error
01353        status.  */
01354     if (yyerrstatus)
01355         yyerrstatus--;
01356 
01357     /* Shift the look-ahead token.  */
01358     YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
01359 
01360     /* Discard the shifted token unless it is eof.  */
01361     if (yychar != YYEOF)
01362         yychar = YYEMPTY;
01363 
01364     yystate = yyn;
01365     *++yyvsp = yylval;
01366 
01367     goto yynewstate;
01368 
01369 
01370     /*-----------------------------------------------------------.
01371     | yydefault -- do the default action for the current state.  |
01372     `-----------------------------------------------------------*/
01373 yydefault:
01374     yyn = yydefact[yystate];
01375     if (yyn == 0)
01376         goto yyerrlab;
01377     goto yyreduce;
01378 
01379 
01380     /*-----------------------------.
01381     | yyreduce -- Do a reduction.  |
01382     `-----------------------------*/
01383 yyreduce:
01384     /* yyn is the number of a rule to reduce with.  */
01385     yylen = yyr2[yyn];
01386 
01387     /* If YYLEN is nonzero, implement the default value of the action:
01388        `$$ = $1'.
01389 
01390        Otherwise, the following line sets YYVAL to garbage.
01391        This behavior is undocumented and Bison
01392        users should not rely upon it.  Assigning to YYVAL
01393        unconditionally makes the parser a bit smaller, and it avoids a
01394        GCC warning that YYVAL may be used uninitialized.  */
01395     yyval = yyvsp[1-yylen];
01396 
01397 
01398     YY_REDUCE_PRINT (yyn);
01399     switch (yyn)
01400     {
01401     case 2:
01402 #line 56 "vParser.ypp"
01403         {
01404             rv = (yyvsp[(1) - (1)].expr);
01405         }
01406         break;
01407 
01408     case 3:
01409 #line 82 "vParser.ypp"
01410         {
01411             (yyval.expr) = new Expr::Int((yyvsp[(1) - (1)].integer));
01412         }
01413         break;
01414 
01415     case 4:
01416 #line 87 "vParser.ypp"
01417         {
01418             (yyval.expr) = new Expr::String(*(yyvsp[(1) - (1)].string));
01419             delete (yyvsp[(1) - (1)].string);
01420         }
01421         break;
01422 
01423     case 6:
01424 #line 93 "vParser.ypp"
01425         {
01426             (yyval.expr) = new Expr::Math::Add(BasePtr((yyvsp[(1) - (3)].expr)), BasePtr((yyvsp[(3) - (3)].expr)));
01427         }
01428         break;
01429 
01430     case 7:
01431 #line 97 "vParser.ypp"
01432         {
01433             (yyval.expr) = new Expr::Math::Subtract(BasePtr((yyvsp[(1) - (3)].expr)), BasePtr((yyvsp[(3) - (3)].expr)));
01434         }
01435         break;
01436 
01437     case 8:
01438 #line 101 "vParser.ypp"
01439         {
01440             (yyval.expr) = new Expr::Math::Multiply(BasePtr((yyvsp[(1) - (3)].expr)), BasePtr((yyvsp[(3) - (3)].expr)));
01441         }
01442         break;
01443 
01444     case 9:
01445 #line 105 "vParser.ypp"
01446         {
01447             (yyval.expr) = new Expr::Math::Divide(BasePtr((yyvsp[(1) - (3)].expr)), BasePtr((yyvsp[(3) - (3)].expr)));
01448         }
01449         break;
01450 
01451     case 10:
01452 #line 109 "vParser.ypp"
01453         {
01454             (yyval.expr) = new Expr::Comparison::Compare(BasePtr((yyvsp[(1) - (3)].expr)), BasePtr((yyvsp[(3) - (3)].expr)));
01455         }
01456         break;
01457 
01458     case 11:
01459 #line 113 "vParser.ypp"
01460         {
01461             static BasePtr zero(new Expr::Int(0));
01462             (yyval.expr) = new Expr::Math::Subtract(zero, BasePtr((yyvsp[(2) - (2)].expr)));
01463         }
01464         break;
01465 
01466     case 12:
01467 #line 118 "vParser.ypp"
01468         {
01469             (yyval.expr) = (yyvsp[(2) - (3)].expr);
01470         }
01471         break;
01472 
01473     case 13:
01474 #line 126 "vParser.ypp"
01475         {
01476             std::vector<tString> flags;
01477             flags.push_back(tString("func"));
01478             (yyval.expr) = Registry::Registry::theRegistry().create(flags, *(yyvsp[(1) - (4)].string), *(yyvsp[(3) - (4)].arglist));
01479             delete (yyvsp[(1) - (4)].string);
01480             delete (yyvsp[(3) - (4)].arglist);
01481         }
01482         break;
01483 
01484     case 15:
01485 #line 137 "vParser.ypp"
01486         {
01487             (yyval.arglist) = new arglist();
01488         }
01489         break;
01490 
01491     case 16:
01492 #line 141 "vParser.ypp"
01493         {
01494             (yyval.arglist) = new arglist();
01495             (yyval.arglist)->push_back(BasePtr((yyvsp[(1) - (1)].expr)));
01496         }
01497         break;
01498 
01499     case 17:
01500 #line 146 "vParser.ypp"
01501         {
01502             (yyval.arglist) = (yyvsp[(1) - (3)].arglist);
01503             (yyval.arglist)->push_back(BasePtr((yyvsp[(3) - (3)].expr)));
01504         }
01505         break;
01506 
01507 
01508         /* Line 1267 of yacc.c.  */
01509 #line 1510 "vParser.cpp"
01510     default: break;
01511     }
01512     YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
01513 
01514     YYPOPSTACK (yylen);
01515     yylen = 0;
01516     YY_STACK_PRINT (yyss, yyssp);
01517 
01518     *++yyvsp = yyval;
01519 
01520 
01521     /* Now `shift' the result of the reduction.  Determine what state
01522        that goes to, based on the state we popped back to and the rule
01523        number reduced by.  */
01524 
01525     yyn = yyr1[yyn];
01526 
01527     yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
01528     if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
01529         yystate = yytable[yystate];
01530     else
01531         yystate = yydefgoto[yyn - YYNTOKENS];
01532 
01533     goto yynewstate;
01534 
01535 
01536     /*------------------------------------.
01537     | yyerrlab -- here on detecting error |
01538     `------------------------------------*/
01539 yyerrlab:
01540     /* If not already recovering from an error, report this error.  */
01541     if (!yyerrstatus)
01542     {
01543         ++yynerrs;
01544 #if ! YYERROR_VERBOSE
01545         yyerror (YY_("syntax error"));
01546 #else
01547         {
01548             YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
01549             if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
01550             {
01551                 YYSIZE_T yyalloc = 2 * yysize;
01552                 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
01553                     yyalloc = YYSTACK_ALLOC_MAXIMUM;
01554                 if (yymsg != yymsgbuf)
01555                     YYSTACK_FREE (yymsg);
01556                 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
01557                 if (yymsg)
01558                     yymsg_alloc = yyalloc;
01559                 else
01560                 {
01561                     yymsg = yymsgbuf;
01562                     yymsg_alloc = sizeof yymsgbuf;
01563                 }
01564             }
01565 
01566             if (0 < yysize && yysize <= yymsg_alloc)
01567             {
01568                 (void) yysyntax_error (yymsg, yystate, yychar);
01569                 yyerror (yymsg);
01570             }
01571             else
01572             {
01573                 yyerror (YY_("syntax error"));
01574                 if (yysize != 0)
01575                     goto yyexhaustedlab;
01576             }
01577         }
01578 #endif
01579     }
01580 
01581 
01582 
01583     if (yyerrstatus == 3)
01584     {
01585         /* If just tried and failed to reuse look-ahead token after an
01586         error, discard it.  */
01587 
01588         if (yychar <= YYEOF)
01589         {
01590             /* Return failure if at end of input.  */
01591             if (yychar == YYEOF)
01592                 YYABORT;
01593         }
01594         else
01595         {
01596             yydestruct ("Error: discarding",
01597                         yytoken, &yylval);
01598             yychar = YYEMPTY;
01599         }
01600     }
01601 
01602     /* Else will try to reuse look-ahead token after shifting the error
01603        token.  */
01604     goto yyerrlab1;
01605 
01606 
01607     /*---------------------------------------------------.
01608     | yyerrorlab -- error raised explicitly by YYERROR.  |
01609     `---------------------------------------------------*/
01610 yyerrorlab:
01611 
01612     /* Pacify compilers like GCC when the user code never invokes
01613        YYERROR and the label yyerrorlab therefore never appears in user
01614        code.  */
01615     if (/*CONSTCOND*/ 0)
01616         goto yyerrorlab;
01617 
01618     /* Do not reclaim the symbols of the rule which action triggered
01619        this YYERROR.  */
01620     YYPOPSTACK (yylen);
01621     yylen = 0;
01622     YY_STACK_PRINT (yyss, yyssp);
01623     yystate = *yyssp;
01624     goto yyerrlab1;
01625 
01626 
01627     /*-------------------------------------------------------------.
01628     | yyerrlab1 -- common code for both syntax error and YYERROR.  |
01629     `-------------------------------------------------------------*/
01630 yyerrlab1:
01631     yyerrstatus = 3;    /* Each real token shifted decrements this.  */
01632 
01633     for (;;)
01634     {
01635         yyn = yypact[yystate];
01636         if (yyn != YYPACT_NINF)
01637         {
01638             yyn += YYTERROR;
01639             if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
01640             {
01641                 yyn = yytable[yyn];
01642                 if (0 < yyn)
01643                     break;
01644             }
01645         }
01646 
01647         /* Pop the current state because it cannot handle the error token.  */
01648         if (yyssp == yyss)
01649             YYABORT;
01650 
01651 
01652         yydestruct ("Error: popping",
01653                     yystos[yystate], yyvsp);
01654         YYPOPSTACK (1);
01655         yystate = *yyssp;
01656         YY_STACK_PRINT (yyss, yyssp);
01657     }
01658 
01659     if (yyn == YYFINAL)
01660         YYACCEPT;
01661 
01662     *++yyvsp = yylval;
01663 
01664 
01665     /* Shift the error token.  */
01666     YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
01667 
01668     yystate = yyn;
01669     goto yynewstate;
01670 
01671 
01672     /*-------------------------------------.
01673     | yyacceptlab -- YYACCEPT comes here.  |
01674     `-------------------------------------*/
01675 yyacceptlab:
01676     yyresult = 0;
01677     goto yyreturn;
01678 
01679     /*-----------------------------------.
01680     | yyabortlab -- YYABORT comes here.  |
01681     `-----------------------------------*/
01682 yyabortlab:
01683     yyresult = 1;
01684     goto yyreturn;
01685 
01686 #ifndef yyoverflow
01687     /*-------------------------------------------------.
01688     | yyexhaustedlab -- memory exhaustion comes here.  |
01689     `-------------------------------------------------*/
01690 yyexhaustedlab:
01691     yyerror (YY_("memory exhausted"));
01692     yyresult = 2;
01693     /* Fall through.  */
01694 #endif
01695 
01696 yyreturn:
01697             if (yychar != YYEOF && yychar != YYEMPTY)
01698                 yydestruct ("Cleanup: discarding lookahead",
01699                             yytoken, &yylval);
01700     /* Do not reclaim the symbols of the rule which action triggered

Here is the call graph for this function:


Variable Documentation

int buffer

Definition at line 1717 of file vParser.cpp.

Referenced by ANET_AddrToString(), MacOSX_SetCWD(), tXmlParserNamespace::st_ErrorFunc(), NSString::stringByReplacingRange:with:, and tDECLARE_REFOBJ().

tString in

Definition at line 1716 of file vParser.cpp.

Referenced by nKrawall::EncodeString(), eGrid::FindSurroundingFace(), gCycleVisuals::LoadModelSafe(), main(), eGameObject::Move(), tPath::Open(), tConfItem_key::ReadVal(), rModel::rModel(), se_Clip(), and sn_Replace().

int pos

Definition at line 1717 of file vParser.cpp.

Referenced by gCycleChatBot::Activate(), ePath::Add(), memblock::Check(), tStatFile::flushWrites(), PDDisc::Generate(), PDSphere::Generate(), PDCone::Generate(), PDCylinder::Generate(), PDRectangle::Generate(), PDTriangle::Generate(), rGradient::GetColor(), eSoundMixer::GetCurrentSong(), tDirectories::GetFiles(), tDirectories::GetSpecList(), init_game_objects(), tResourceManager::locateResource(), tString::LongestLine(), tPolynomial< T >::parse(), tPathResource::Paths(), tPathScreenshot::Paths(), tPathVar::Paths(), tPathMusic::Paths(), tPathData::Paths(), tPathConfig::Paths(), cCockpit::ProcessWidgetCamera(), cCockpit::ProcessWidgets(), cWidget::Label::Render(), gWallRim::RenderReal(), reparseforbiddencallbacks(), se_DisplayChatLocallyClient(), sg_RespawnPlayer(), tDirectories::SortFiles(), gAIPlayer::ThinkPath(), tIsInList(), gParser::validateVersionRange(), tXmlParserNamespace::tXmlResource::ValidateXml(), and gParser::xmlCharSearchReplace().

Expr::Base* rv

Definition at line 123 of file vParser.cpp.

Referenced by tResourceManager::locateResource(), myFetch(), and yyparse().

int yychar

Definition at line 1095 of file vParser.cpp.

const yytype_int8 yycheck[] [static]

Initial value:

    {
        4,     5,     3,     4,     5,     9,     7,    20,    21,    13,
        14,    15,    16,    17,     6,     7,     8,     9,    19,     6,
        7,     8,     9,    19,    16,    29,     8,     9,    20,    16,
        0,     5,    18,    16,    16,    -1,    -1,    18,    18
    }

Definition at line 535 of file vParser.cpp.

const yytype_uint8 yydefact[] [static]

Initial value:

    {
        0,     3,     4,     0,     0,     0,     0,     2,     5,    15,
        11,     0,     1,     0,     0,     0,     0,     0,     0,    16,
        0,    12,     6,     7,     8,     9,    10,    14,    13,     0,
        17
    }

Definition at line 491 of file vParser.cpp.

const yytype_int8 yydefgoto[] [static]

Initial value:

    {
        -1,     6,     7,     8,    20
    }

Definition at line 500 of file vParser.cpp.

YYSTYPE yylval

Definition at line 1105 of file vParser.cpp.

int yynerrs

Definition at line 1108 of file vParser.cpp.

const yytype_int8 yypact[] [static]

Initial value:

    {
        -1,   -14,   -14,     4,    -1,    -1,    30,    13,    14,    -1,
        -14,     8,   -14,    -1,    -1,    -1,    -1,    -1,    26,    13,
        -13,   -14,    18,    18,    17,    17,   -14,    19,   -14,    -1,
        13
    }

Definition at line 508 of file vParser.cpp.

const yytype_int8 yypgoto[] [static]

Initial value:

    {
        -14,   -14,    -4,    20,   -14
    }

Definition at line 517 of file vParser.cpp.

const yytype_uint8 yyr1[] [static]

Initial value:

    {
        0,    22,    23,    24,    24,    24,    24,    24,    24,    24,
        24,    24,    24,    25,    25,    26,    26,    26
    }

Definition at line 475 of file vParser.cpp.

const yytype_uint8 yyr2[] [static]

Initial value:

    {
        0,     2,     1,     1,     1,     1,     3,     3,     3,     3,
        3,     2,     3,     4,     3,     0,     1,     3
    }

Definition at line 482 of file vParser.cpp.

const yytype_uint8 yystos[] [static]

Initial value:

    {
        0,     3,     4,     5,     7,    19,    23,    24,    25,    19,
        24,    24,     0,     6,     7,     8,     9,    16,    18,    24,
        26,    20,    24,    24,    24,    24,    24,    25,    20,    21,
        24
    }

Definition at line 545 of file vParser.cpp.

const yytype_int8 yytable[] [static]

Initial value:

    {
        10,    11,     1,     2,     3,    19,     4,    28,    29,    22,
        23,    24,    25,    26,    13,    14,    15,    16,     5,    13,
        14,    15,    16,     9,    17,    30,    15,    16,    21,    17,
        12,     3,    18,    17,    17,     0,     0,    -1,    27
    }

Definition at line 527 of file vParser.cpp.

const yytype_uint8 yytranslate[] [static]

Initial value:

    {
        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        19,    20,     8,     6,    21,     7,    18,     9,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
        5,    10,    11,    12,    13,    14,    15,    16,    17
    }

Definition at line 397 of file vParser.cpp.

int yytype

Definition at line 1036 of file vParser.cpp.

YYSTYPE* yyvaluep

Definition at line 1037 of file vParser.cpp.


Generated on Sat Mar 15 23:20:19 2008 for Armagetron Advanced by  doxygen 1.5.4