Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

source/toolbox/inputdb/Grammar.C File Reference

#include "SAMRAI_config.h"
#include <math.h>
#include <STL_SSTREAM_HEADER_FILE>
#include "tbox/Array.h"
#include "tbox/Complex.h"
#include "tbox/Database.h"
#include "tbox/Parser.h"
#include <string>

Namespaces

namespace  tbox

Defines

#define YYBISON   1
#define YYSKELETON_NAME   "yacc.c"
#define YYPURE   0
#define YYLSP_NEEDED   0
#define T_AND   258
#define T_ASSIGN   259
#define T_CHAR   260
#define T_CLOSE_CURLY   261
#define T_CLOSE_PAREN   262
#define T_CLOSE_SQBKT   263
#define T_COMMA   264
#define T_DIV   265
#define T_DOUBLE   266
#define T_ELSE   267
#define T_EXP   268
#define T_EQUALS   269
#define T_GREATER_EQUALS   270
#define T_GREATER   271
#define T_LESS_EQUALS   272
#define T_LESS   273
#define T_FALSE   274
#define T_INTEGER   275
#define T_KEYWORD   276
#define T_MINUS   277
#define T_MULT   278
#define T_NOT   279
#define T_NOT_EQUALS   280
#define T_OR   281
#define T_OPEN_CURLY   282
#define T_OPEN_PAREN   283
#define T_OPEN_SQBKT   284
#define T_PLUS   285
#define T_QUESTION   286
#define T_SEMI   287
#define T_STRING   288
#define T_TRUE   289
#define T_NEGATION   290
#define NULL   (0)
#define KEY_COMPLEX   (0)
#define KEY_DOUBLE   (1)
#define KEY_INTEGER   (2)
#define KEY_BOOL   (3)
#define KEY_BOX   (4)
#define KEY_CHAR   (5)
#define KEY_STRING   (6)
#define IS_NUMBER(X)   (((X) >= 0) && ((X) < KEY_BOOL))
#define PROMOTE(X, Y)   ((X) < (Y) ? (X) : (Y))
#define YYDEBUG   0
#define YYERROR_VERBOSE   0
#define yystype   YYSTYPE
#define YYSTYPE_IS_DECLARED   1
#define YYSTYPE_IS_TRIVIAL   1
#define YYSTACK_ALLOC   malloc
#define YYSTACK_FREE   free
#define YYSTACK_GAP_MAXIMUM   (sizeof (union yyalloc) - 1)
#define YYSTACK_BYTES(N)
#define YYCOPY(To, From, Count)
#define YYSTACK_RELOCATE(Stack)
#define YYFINAL   3
#define YYLAST   249
#define YYNTOKENS   36
#define YYNNTS   13
#define YYNRULES   44
#define YYNSTATES   83
#define YYUNDEFTOK   2
#define YYMAXUTOK   290
#define YYTRANSLATE(YYX)   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
#define YYPACT_NINF   -21
#define YYTABLE_NINF   -1
#define YYSIZE_T   unsigned int
#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 YYLLOC_DEFAULT(Current, Rhs, N)
#define YYLEX   yylex ()
#define YYDPRINTF(Args)   do {} while (0)
#define YYDSYMPRINT(Args)   do {} while (0)
#define YYDSYMPRINTF(Title, Token, Value, Location)   do {} while (0)
#define YY_STACK_PRINT(Bottom, Top)   do {} while (0)
#define YY_REDUCE_PRINT(Rule)   do {} while (0)
#define YYINITDEPTH   200
#define YYMAXDEPTH   10000
#define YYPOPSTACK   (yyvsp--, yyssp--)

Typedefs

typedef YYSTYPE YYSTYPE
typedef short yysigned_char

Enumerations

enum  yytokentype {
  T_AND = 258, T_ASSIGN = 259, T_CHAR = 260, T_CLOSE_CURLY = 261,
  T_CLOSE_PAREN = 262, T_CLOSE_SQBKT = 263, T_COMMA = 264, T_DIV = 265,
  T_DOUBLE = 266, T_ELSE = 267, T_EXP = 268, T_EQUALS = 269,
  T_GREATER_EQUALS = 270, T_GREATER = 271, T_LESS_EQUALS = 272, T_LESS = 273,
  T_FALSE = 274, T_INTEGER = 275, T_KEYWORD = 276, T_MINUS = 277,
  T_MULT = 278, T_NOT = 279, T_NOT_EQUALS = 280, T_OR = 281,
  T_OPEN_CURLY = 282, T_OPEN_PAREN = 283, T_OPEN_SQBKT = 284, T_PLUS = 285,
  T_QUESTION = 286, T_SEMI = 287, T_STRING = 288, T_TRUE = 289,
  T_NEGATION = 290
}

Functions

int yylex ()
void yyerror (const char *const error)
static void delete_list (KeyData *)
static void to_boolean (KeyData *)
static void to_integer (KeyData *)
static void to_double (KeyData *)
static void to_complex (KeyData *)
static KeyDatabinary_op (KeyData *, KeyData *, const int)
static KeyDatacompare_op (KeyData *, KeyData *, const int)
static KeyDataeval_function (KeyData *, const string &)
static KeyDatalookup_variable (const string &, const int, const bool)
static void yydestruct (int yytype, YYSTYPE *yyvaluep)
int yyparse ()
static KeyDatabinary_op (KeyData *a, KeyData *b, const int op)
static KeyDatacompare_op (KeyData *a, KeyData *b, const int op)
static double imag_thunk (const dcomplex &a)
static double real_thunk (const dcomplex &a)
void parser_static_table_initialize ()
static KeyDatalookup_variable (const string &key, const int index, const bool is_array)

Variables

static string type_names []
static const unsigned char yytranslate []
static const unsigned char yyr1 []
static const unsigned char yyr2 []
static const unsigned char yydefact []
static const yysigned_char yydefgoto []
static const short yypact []
static const yysigned_char yypgoto []
static const unsigned char yytable []
static const yysigned_char yycheck []
static const unsigned char yystos []
int yychar
YYSTYPE yylval
int yynerrs
static arith_functions af [20]

Define Documentation

#define YYBISON   1
 

#define YYSKELETON_NAME   "yacc.c"
 

#define YYPURE   0
 

#define YYLSP_NEEDED   0
 

#define T_AND   258
 

#define T_ASSIGN   259
 

#define T_CHAR   260
 

#define T_CLOSE_CURLY   261
 

#define T_CLOSE_PAREN   262
 

#define T_CLOSE_SQBKT   263
 

#define T_COMMA   264
 

#define T_DIV   265
 

#define T_DOUBLE   266
 

#define T_ELSE   267
 

#define T_EXP   268
 

#define T_EQUALS   269
 

#define T_GREATER_EQUALS   270
 

#define T_GREATER   271
 

#define T_LESS_EQUALS   272
 

#define T_LESS   273
 

#define T_FALSE   274
 

#define T_INTEGER   275
 

#define T_KEYWORD   276
 

#define T_MINUS   277
 

#define T_MULT   278
 

#define T_NOT   279
 

#define T_NOT_EQUALS   280
 

#define T_OR   281
 

#define T_OPEN_CURLY   282
 

#define T_OPEN_PAREN   283
 

#define T_OPEN_SQBKT   284
 

#define T_PLUS   285
 

#define T_QUESTION   286
 

#define T_SEMI   287
 

#define T_STRING   288
 

#define T_TRUE   289
 

#define T_NEGATION   290
 

#define NULL   (0)
 

#define KEY_COMPLEX   (0)
 

#define KEY_DOUBLE   (1)
 

#define KEY_INTEGER   (2)
 

#define KEY_BOOL   (3)
 

#define KEY_BOX   (4)
 

#define KEY_CHAR   (5)
 

#define KEY_STRING   (6)
 

#define IS_NUMBER  )     (((X) >= 0) && ((X) < KEY_BOOL))
 

#define PROMOTE X,
 )     ((X) < (Y) ? (X) : (Y))
 

#define YYDEBUG   0
 

#define YYERROR_VERBOSE   0
 

#define yystype   YYSTYPE
 

#define YYSTYPE_IS_DECLARED   1
 

#define YYSTYPE_IS_TRIVIAL   1
 

#define YYSTACK_ALLOC   malloc
 

#define YYSTACK_FREE   free
 

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

#define YYSTACK_BYTES  ) 
 

Value:

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

#define YYCOPY To,
From,
Count   ) 
 

Value:

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

#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 (0)

#define YYFINAL   3
 

#define YYLAST   249
 

#define YYNTOKENS   36
 

#define YYNNTS   13
 

#define YYNRULES   44
 

#define YYNSTATES   83
 

#define YYUNDEFTOK   2
 

#define YYMAXUTOK   290
 

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

#define YYPACT_NINF   -21
 

#define YYTABLE_NINF   -1
 

#define YYSIZE_T   unsigned int
 

#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   ) 
 

Value:

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

#define YYTERROR   1
 

#define YYERRCODE   256
 

#define YYLLOC_DEFAULT Current,
Rhs,
 ) 
 

Value:

((Current).first_line   = (Rhs)[1].first_line,  \
    (Current).first_column = (Rhs)[1].first_column,     \
    (Current).last_line    = (Rhs)[N].last_line,        \
    (Current).last_column  = (Rhs)[N].last_column)

#define YYLEX   yylex ()
 

#define YYDPRINTF Args   )     do {} while (0)
 

#define YYDSYMPRINT Args   )     do {} while (0)
 

#define YYDSYMPRINTF Title,
Token,
Value,
Location   )     do {} while (0)
 

#define YY_STACK_PRINT Bottom,
Top   )     do {} while (0)
 

#define YY_REDUCE_PRINT Rule   )     do {} while (0)
 

#define YYINITDEPTH   200
 

#define YYMAXDEPTH   10000
 

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


Typedef Documentation

typedef union YYSTYPE YYSTYPE
 

typedef short yysigned_char
 


Enumeration Type Documentation

enum yytokentype
 

Enumeration values:
T_AND 
T_ASSIGN 
T_CHAR 
T_CLOSE_CURLY 
T_CLOSE_PAREN 
T_CLOSE_SQBKT 
T_COMMA 
T_DIV 
T_DOUBLE 
T_ELSE 
T_EXP 
T_EQUALS 
T_GREATER_EQUALS 
T_GREATER 
T_LESS_EQUALS 
T_LESS 
T_FALSE 
T_INTEGER 
T_KEYWORD 
T_MINUS 
T_MULT 
T_NOT 
T_NOT_EQUALS 
T_OR 
T_OPEN_CURLY 
T_OPEN_PAREN 
T_OPEN_SQBKT 
T_PLUS 
T_QUESTION 
T_SEMI 
T_STRING 
T_TRUE 
T_NEGATION 


Function Documentation

int yylex  ) 
 

void yyerror const char *const   error  ) 
 

static void delete_list KeyData  )  [static]
 

static void to_boolean KeyData  )  [static]
 

static void to_integer KeyData  )  [static]
 

static void to_double KeyData  )  [static]
 

static void to_complex KeyData  )  [static]
 

static KeyData* binary_op KeyData ,
KeyData ,
const   int
[static]
 

static KeyData* compare_op KeyData ,
KeyData ,
const   int
[static]
 

static KeyData * eval_function KeyData ,
const string & 
[static]
 

static KeyData* lookup_variable const string &  ,
const   int,
const   bool
[static]
 

static void yydestruct int  yytype,
YYSTYPE yyvaluep
[static]
 

int yyparse  ) 
 

static KeyData* binary_op KeyData a,
KeyData b,
const int  op
[static]
 

static KeyData* compare_op KeyData a,
KeyData b,
const int  op
[static]
 

static double imag_thunk const dcomplex a  )  [static]
 

static double real_thunk const dcomplex a  )  [static]
 

void parser_static_table_initialize  ) 
 

static KeyData* lookup_variable const string &  key,
const int  index,
const bool  is_array
[static]
 


Variable Documentation

string type_names[] [static]
 

Initial value:

 {
   "complex", "double", "int", "bool", "box", "char", "string"
}

const unsigned char yytranslate[] [static]
 

const unsigned char yyr1[] [static]
 

Initial value:

{
       0,    36,    37,    38,    38,    40,    39,    41,    39,    39,
      42,    42,    43,    43,    43,    43,    43,    44,    43,    43,
      43,    43,    43,    43,    43,    43,    43,    43,    43,    43,
      43,    43,    43,    43,    45,    45,    45,    45,    45,    45,
      45,    45,    46,    47,    48
}

const unsigned char yyr2[] [static]
 

Initial value:

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

const unsigned char yydefact[] [static]
 

Initial value:

{
       3,     0,     2,     1,     0,     9,     4,     7,     5,     0,
       3,    37,    39,    35,    40,    13,     0,     0,     0,     0,
      41,    34,     8,    10,    12,    38,    36,     0,     0,     0,
      33,    19,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     6,
       0,     0,    15,     0,    17,     0,     0,    11,    21,    31,
      32,    22,    24,    25,    26,    27,    29,    30,    23,    20,
      28,    16,    14,     0,     0,    44,     0,    42,     0,    43,
       0,     0,    18
}

const yysigned_char yydefgoto[] [static]
 

Initial value:

{
      -1,     1,     2,     6,    10,     9,    22,    23,    74,    24,
      25,    26,    34
}

const short yypact[] [static]
 

Initial value:

{
     -21,    10,   -17,   -21,     7,   -21,   -21,   -21,   -21,    28,
     -21,   -21,   -21,   -21,   -21,   -20,    28,    28,    28,   -14,
     -21,   -21,     8,   183,   -21,   -21,   -21,    69,    28,    28,
     -21,   219,    56,    28,     9,    28,    28,    28,    28,    28,
      28,    28,    28,    28,    28,    28,    28,    28,    28,   -21,
      81,   102,   -21,    28,   -21,    -2,   -14,   183,   219,    22,
      22,    70,    70,    70,    70,    70,    -7,    22,    70,   201,
      -7,   -21,   -21,   123,    28,   -21,    30,   -21,   144,   -21,
      28,   165,   -21
}

const yysigned_char yypgoto[] [static]
 

Initial value:

{
     -21,   -21,    26,   -21,   -21,   -21,    11,   -16,   -21,   -21,
     -21,   -21,   -15
}

const unsigned char yytable[] [static]
 

Initial value:

{
      30,    31,    32,    37,     4,    75,    38,    35,    28,    29,
       3,     7,    50,    51,    33,     5,    45,    35,    56,    57,
      58,    59,    60,    61,    62,    63,    64,    65,    66,    67,
      68,    69,    70,    11,     8,    38,    27,    73,    79,    12,
       0,    76,     0,     0,    55,     0,     0,    13,    14,    15,
      16,     0,    17,     0,     0,     0,    18,    19,    78,    36,
       0,    20,    21,    52,    81,    53,    37,     0,     0,    38,
      39,    40,    41,    42,    43,    49,     0,     0,    44,    45,
      37,    46,    47,    38,    36,     0,    48,    54,    71,     0,
       4,    37,    44,    45,    38,    39,    40,    41,    42,    43,
      48,     5,     0,    44,    45,    36,    46,    47,     0,     0,
      72,    48,    37,     0,     0,    38,    39,    40,    41,    42,
      43,     0,     0,     0,    44,    45,    36,    46,    47,     0,
      77,     0,    48,    37,     0,     0,    38,    39,    40,    41,
      42,    43,     0,     0,     0,    44,    45,    36,    46,    47,
       0,     0,     0,    48,    37,     0,    80,    38,    39,    40,
      41,    42,    43,     0,     0,     0,    44,    45,    36,    46,
      47,     0,    82,     0,    48,    37,     0,     0,    38,    39,
      40,    41,    42,    43,     0,     0,    36,    44,    45,     0,
      46,    47,     0,    37,     0,    48,    38,    39,    40,    41,
      42,    43,     0,     0,    36,    44,    45,     0,    46,    47,
       0,    37,     0,    48,    38,    39,    40,    41,    42,    43,
       0,     0,     0,    44,    45,     0,    46,     0,     0,    37,
       0,    48,    38,    39,    40,    41,    42,    43,     0,     0,
       0,    44,    45,     0,    46,     0,     0,     0,     0,    48
}

const yysigned_char yycheck[] [static]
 

Initial value:

{
      16,    17,    18,    10,    21,     7,    13,     9,    28,    29,
       0,     4,    28,    29,    28,    32,    23,     9,     9,    35,
      36,    37,    38,    39,    40,    41,    42,    43,    44,    45,
      46,    47,    48,     5,    27,    13,    10,    53,     8,    11,
      -1,    56,    -1,    -1,    33,    -1,    -1,    19,    20,    21,
      22,    -1,    24,    -1,    -1,    -1,    28,    29,    74,     3,
      -1,    33,    34,     7,    80,     9,    10,    -1,    -1,    13,
      14,    15,    16,    17,    18,     6,    -1,    -1,    22,    23,
      10,    25,    26,    13,     3,    -1,    30,    31,     7,    -1,
      21,    10,    22,    23,    13,    14,    15,    16,    17,    18,
      30,    32,    -1,    22,    23,     3,    25,    26,    -1,    -1,
       8,    30,    10,    -1,    -1,    13,    14,    15,    16,    17,
      18,    -1,    -1,    -1,    22,    23,     3,    25,    26,    -1,
       7,    -1,    30,    10,    -1,    -1,    13,    14,    15,    16,
      17,    18,    -1,    -1,    -1,    22,    23,     3,    25,    26,
      -1,    -1,    -1,    30,    10,    -1,    12,    13,    14,    15,
      16,    17,    18,    -1,    -1,    -1,    22,    23,     3,    25,
      26,    -1,     7,    -1,    30,    10,    -1,    -1,    13,    14,
      15,    16,    17,    18,    -1,    -1,     3,    22,    23,    -1,
      25,    26,    -1,    10,    -1,    30,    13,    14,    15,    16,
      17,    18,    -1,    -1,     3,    22,    23,    -1,    25,    26,
      -1,    10,    -1,    30,    13,    14,    15,    16,    17,    18,
      -1,    -1,    -1,    22,    23,    -1,    25,    -1,    -1,    10,
      -1,    30,    13,    14,    15,    16,    17,    18,    -1,    -1,
      -1,    22,    23,    -1,    25,    -1,    -1,    -1,    -1,    30
}

const unsigned char yystos[] [static]
 

Initial value:

{
       0,    37,    38,     0,    21,    32,    39,     4,    27,    41,
      40,     5,    11,    19,    20,    21,    22,    24,    28,    29,
      33,    34,    42,    43,    45,    46,    47,    38,    28,    29,
      43,    43,    43,    28,    48,     9,     3,    10,    13,    14,
      15,    16,    17,    18,    22,    23,    25,    26,    30,     6,
      43,    43,     7,     9,    31,    42,     9,    43,    43,    43,
      43,    43,    43,    43,    43,    43,    43,    43,    43,    43,
      43,     7,     8,    43,    44,     7,    48,     7,    43,     8,
      12,    43,     7
}

int yychar
 

YYSTYPE yylval
 

int yynerrs
 

arith_functions af[20] [static]
 


Generated on Fri Dec 2 11:19:11 2005 for SAMRAI by  doxygen 1.4.2