- Main Page
- Namespaces
- Classes
- Files
- Related Pages

# /Users/fpy/titan-1-5-MBARI/Mers/Estimation/Discrete/CompiledME/CCMEReader/CCMEReader.tab.cpp

    00001 /* A Bison parser, made by GNU Bison 1.875b.  */
    00002
    00003 /* Skeleton parser for Yacc-like parsing with Bison,
    00004    Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
    00005
    00006    This program is free software; you can redistribute it and/or modify
    00007    it under the terms of the GNU General Public License as published by
    00008    the Free Software Foundation; either version 2, or (at your option)
    00009    any later version.
    00010
    00011    This program is distributed in the hope that it will be useful,
    00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
    00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00014    GNU General Public License for more details.
    00015
    00016    You should have received a copy of the GNU General Public License
    00017    along with this program; if not, write to the Free Software
    00018    Foundation, Inc., 59 Temple Place - Suite 330,
    00019    Boston, MA 02111-1307, USA.  */
    00020
    00021 /* As a special exception, when this file is copied by Bison into a
    00022    Bison output file, you may use that output file without restriction.
    00023    This special exception was added by the Free Software Foundation
    00024    in version 1.24 of Bison.  */
    00025
    00026 /* Written by Richard Stallman by simplifying the original so called
    00027    ``semantic'' parser.  */
    00028
    00029 /* All symbols defined below should begin with yy or YY, to avoid
    00030    infringing on user name space.  This should be done even for local
    00031    variables, as they might otherwise be expanded by user macros.
    00032    There are some unavoidable exceptions within include files to
    00033    define necessary library symbols; they are noted "INFRINGES ON
    00034    USER NAME SPACE" below.  */
    00035
    00036 /* Identify Bison output.  */
    00037 #define YYBISON 1
    00038
    00039 /* Skeleton name.  */
    00040 #define YYSKELETON_NAME "yacc.c"
    00041
    00042 /* Pure parsers.  */
    00043 #define YYPURE 0
    00044
    00045 /* Using locations.  */
    00046 #define YYLSP_NEEDED 0
    00047
    00048 /* If NAME_PREFIX is specified substitute the variables and functions
    00049    names.  */
    00050 #define yyparse yyCCMEReaderparse
    00051 #define yylex   yyCCMEReaderlex
    00052 #define yyerror yyCCMEReadererror
    00053 #define yylval  yyCCMEReaderlval
    00054 #define yychar  yyCCMEReaderchar
    00055 #define yydebug yyCCMEReaderdebug
    00056 #define yynerrs yyCCMEReadernerrs
    00057
    00058
    00059 /* Tokens.  */
    00060 #ifndef YYTOKENTYPE
    00061 # define YYTOKENTYPE
    00062    /* Put the tokens into the symbol table, so that GDB and other debuggers
    00063       know about them.  */
    00064    enum yytokentype {
    00065      TOK_CCME_FILE_HEADER_1 = 258,
    00066      TOK_DISSENTS = 259,
    00067      TOK_TRANSITIONS = 260,
    00068      TOK_PROBABILITY = 261,
    00069      TOK_NAME = 262,
    00070      TOK_ARROW = 263,
    00071      TOK_INTEGER = 264,
    00072      TOK_REAL = 265
    00073    };
    00074 #endif
    00075 #define TOK_CCME_FILE_HEADER_1 258
    00076 #define TOK_DISSENTS 259
    00077 #define TOK_TRANSITIONS 260
    00078 #define TOK_PROBABILITY 261
    00079 #define TOK_NAME 262
    00080 #define TOK_ARROW 263
    00081 #define TOK_INTEGER 264
    00082 #define TOK_REAL 265
    00083
    00084
    00085
    00086
    00087 /* Copy the first part of user declarations.  */
    00088 #line 1 "CCMEReader.y"
    00089
    00090
    00091 //=============================================================================
    00092 //
    00093 // Copyright (c) 2002           Model-based Embedded and Robotic Systems Group
    00094 // All Rights Reserved          Massachusetts Institute of Technology
    00095 //
    00096 // This software is provided as is. Model-based Embedded and Robotic Systems
    00097 // (MERS) group does not assume any responsibility.
    00098 //
    00099 // Author:                      Paul H. Elliott
    00100 // Organization:        Model-based Embedded and Robotic Systems Group
    00101 //                                      Massachusetts Institute of Technology
    00102 //
    00103 // CCMEReader bison file
    00104 //
    00105 //=============================================================================
    00106
    00107 #include "CCMEReader.h"
    00108
    00109 #include <Mers/Models/Base/BaseModel.h>
    00110 #include <Mers/Models/Base/BaseModelVariable.h>
    00111 #include <Mers/Models/Base/BaseModelAssignment.h>
    00112 #include <Mers/Models/Base/BaseModelAssignmentArray.h>
    00113 #include <Mers/Estimation/Discrete/Dissent.h>
    00114 #include <Mers/Estimation/Discrete/CompiledTransition.h>
    00115 #include <string>
    00116 #include <cstdio>
    00117 #include <cstdlib>
    00118 #include <cerrno>
    00119
    00120  using namespace std;
    00121
    00122 void yyCCMEReadererror(const char * s);
    00123 int yyCCMEReaderlex();
    00124
    00125 extern FILE * yyCCMEReaderin;
    00126
    00127  using namespace Mers::Estimation::Discrete::CompiledME::CCMEReader;
    00128  using namespace Mers::Estimation::Discrete;
    00129  using Mers::Models::Base::BaseModel;
    00130  using Mers::Models::Base::BaseModelAssignment;
    00131  using Mers::Models::Base::BaseModelAssignmentArray;
    00132  using Mers::Models::Base::BaseModelVariable;
    00133  using Mers::Models::Base::BaseModelValue;
    00134
    00135 BaseModel const * myCCMEBaseModel;
    00136 CCMEReader * myCCMEReader;
    00137
    00138 #define YYERROR_VERBOSE 1
    00139 extern int yyCCMEReaderline;
    00140
    00141
    00142
    00143 BaseModelVariable const * curCCMEVar;
    00144
    00145
    00146
    00147 /* Enabling traces.  */
    00148 #ifndef YYDEBUG
    00149 # define YYDEBUG 0
    00150 #endif
    00151
    00152 /* Enabling verbose error messages.  */
    00153 #ifdef YYERROR_VERBOSE
    00154 # undef YYERROR_VERBOSE
    00155 # define YYERROR_VERBOSE 1
    00156 #else
    00157 # define YYERROR_VERBOSE 0
    00158 #endif
    00159
    00160 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
    00161 #line 59 "CCMEReader.y"
    00162 typedef union YYSTYPE {
    00163         char * str;
    00164         int val;
    00165         double dbl;
    00166         Mers::Models::Base::BaseModelAssignmentArray * assignments;
    00167         Mers::Models::Base::BaseModelAssignment * assignment;
    00168         Mers::Models::Base::BaseModelVariable const * variable;
    00169         Mers::Models::Base::BaseModelValue const * value;
    00170 } YYSTYPE;
    00171 /* Line 191 of yacc.c.  */
    00172 #line 173 "CCMEReader.tab.cpp"
    00173 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
    00174 # define YYSTYPE_IS_DECLARED 1
    00175 # define YYSTYPE_IS_TRIVIAL 1
    00176 #endif
    00177
    00178
    00179
    00180 /* Copy the second part of user declarations.  */
    00181
    00182
    00183 /* Line 214 of yacc.c.  */
    00184 #line 185 "CCMEReader.tab.cpp"
    00185
    00186 #if ! defined (yyoverflow) || YYERROR_VERBOSE
    00187
    00188 /* The parser invokes alloca or malloc; define the necessary symbols.  */
    00189
    00190 # if YYSTACK_USE_ALLOCA
    00191 #  define YYSTACK_ALLOC alloca
    00192 # else
    00193 #  ifndef YYSTACK_USE_ALLOCA
    00194 #   if defined (alloca) || defined (_ALLOCA_H)
    00195 #    define YYSTACK_ALLOC alloca
    00196 #   else
    00197 #    ifdef __GNUC__
    00198 #     define YYSTACK_ALLOC __builtin_alloca
    00199 #    endif
    00200 #   endif
    00201 #  endif
    00202 # endif
    00203
    00204 # ifdef YYSTACK_ALLOC
    00205    /* Pacify GCC's `empty if-body' warning. */
    00206 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
    00207 # else
    00208 #  if defined (__STDC__) || defined (__cplusplus)
    00209 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
    00210 #   define YYSIZE_T size_t
    00211 #  endif
    00212 #  define YYSTACK_ALLOC malloc
    00213 #  define YYSTACK_FREE free
    00214 # endif
    00215 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
    00216
    00217
    00218 #if (! defined (yyoverflow) \
    00219      && (! defined (__cplusplus) \
    00220          || (YYSTYPE_IS_TRIVIAL)))
    00221
    00222 /* A type that is properly aligned for any stack member.  */
    00223 union yyalloc
    00224 {
    00225   short yyss;
    00226   YYSTYPE yyvs;
    00227   };
    00228
    00229 /* The size of the maximum gap between one aligned stack and the next.  */
    00230 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
    00231
    00232 /* The size of an array large to enough to hold all stacks, each with
    00233    N elements.  */
    00234 # define YYSTACK_BYTES(N) \
    00235      ((N) * (sizeof (short) + sizeof (YYSTYPE))                         \
    00236       + YYSTACK_GAP_MAXIMUM)
    00237
    00238 /* Copy COUNT objects from FROM to TO.  The source and destination do
    00239    not overlap.  */
    00240 # ifndef YYCOPY
    00241 #  if 1 < __GNUC__
    00242 #   define YYCOPY(To, From, Count) \
    00243       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
    00244 #  else
    00245 #   define YYCOPY(To, From, Count)              \
    00246       do                                        \
    00247         {                                       \
    00248           register YYSIZE_T yyi;                \
    00249           for (yyi = 0; yyi < (Count); yyi++)   \
    00250             (To)[yyi] = (From)[yyi];            \
    00251         }                                       \
    00252       while (0)
    00253 #  endif
    00254 # endif
    00255
    00256 /* Relocate STACK from its old location to the new one.  The
    00257    local variables YYSIZE and YYSTACKSIZE give the old and new number of
    00258    elements in the stack, and YYPTR gives the new location of the
    00259    stack.  Advance YYPTR to a properly aligned location for the next
    00260    stack.  */
    00261 # define YYSTACK_RELOCATE(Stack)                                        \
    00262     do                                                                  \
    00263       {                                                                 \
    00264         YYSIZE_T yynewbytes;                                            \
    00265         YYCOPY (&yyptr->Stack, Stack, yysize);                          \
    00266         Stack = &yyptr->Stack;                                          \
    00267         yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
    00268         yyptr += yynewbytes / sizeof (*yyptr);                          \
    00269       }                                                                 \
    00270     while (0)
    00271
    00272 #endif
    00273
    00274 #if defined (__STDC__) || defined (__cplusplus)
    00275    typedef signed char yysigned_char;
    00276 #else
    00277    typedef short yysigned_char;
    00278 #endif
    00279
    00280 /* YYFINAL -- State number of the termination state. */
    00281 #define YYFINAL  3
    00282 /* YYLAST -- Last index in YYTABLE.  */
    00283 #define YYLAST   35
    00284
    00285 /* YYNTOKENS -- Number of terminals. */
    00286 #define YYNTOKENS  16
    00287 /* YYNNTS -- Number of nonterminals. */
    00288 #define YYNNTS  18
    00289 /* YYNRULES -- Number of rules. */
    00290 #define YYNRULES  24
    00291 /* YYNRULES -- Number of states. */
    00292 #define YYNSTATES  47
    00293
    00294 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
    00295 #define YYUNDEFTOK  2
    00296 #define YYMAXUTOK   265
    00297
    00298 #define YYTRANSLATE(YYX)                                                \
    00299   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
    00300
    00301 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
    00302 static const unsigned char yytranslate[] =
    00303 {
    00304        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00305        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00306        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00307        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00308        2,     2,     2,     2,    14,     2,     2,     2,     2,     2,
    00309        2,     2,     2,     2,     2,     2,     2,     2,    11,     2,
    00310        2,    15,     2,     2,     2,     2,     2,     2,     2,     2,
    00311        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00312        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00313        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00314        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00315        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00316        2,     2,     2,    12,     2,    13,     2,     2,     2,     2,
    00317        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00318        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00319        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00320        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00321        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00322        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00323        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00324        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00325        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00326        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00327        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00328        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00329        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
    00330        5,     6,     7,     8,     9,    10
    00331 };
    00332
    00333 #if YYDEBUG
    00334 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
    00335    YYRHS.  */
    00336 static const unsigned char yyprhs[] =
    00337 {
    00338        0,     0,     3,     4,     8,    11,    13,    16,    18,    20,
    00339       23,    24,    35,    40,    45,    49,    52,    54,    56,    60,
    00340       61,    66,    69,    72,    74
    00341 };
    00342
    00343 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
    00344 static const yysigned_char yyrhs[] =
    00345 {
    00346       17,     0,    -1,    -1,    18,     3,    19,    -1,    20,    22,
    00347       -1,     4,    -1,    20,    21,    -1,    26,    -1,     5,    -1,
    00348       22,    23,    -1,    -1,    30,    24,    11,    31,     8,    31,
    00349       11,    25,    11,    26,    -1,     6,    12,     9,    13,    -1,
    00350        6,    12,    10,    13,    -1,    12,    27,    13,    -1,    12,
    00351       13,    -1,     7,    -1,    28,    -1,    27,    14,    28,    -1,
    00352       -1,    30,    29,    15,    31,    -1,    32,    33,    -1,    32,
    00353       33,    -1,     9,    -1,     7,    -1
    00354 };
    00355
    00356 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
    00357 static const unsigned short yyrline[] =
    00358 {
    00359        0,    89,    89,    89,    95,    98,    99,   102,   126,   127,
    00360      131,   130,   155,   159,   165,   169,   173,   183,   188,   196,
    00361      195,   204,   227,   252,   258
    00362 };
    00363 #endif
    00364
    00365 #if YYDEBUG || YYERROR_VERBOSE
    00366 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
    00367    First, the terminals, then, starting at YYNTOKENS, nonterminals. */
    00368 static const char *const yytname[] =
    00369 {
    00370   "$end", "error", "$undefined", "TOK_CCME_FILE_HEADER_1", "TOK_DISSENTS",
    00371   "TOK_TRANSITIONS", "TOK_PROBABILITY", "TOK_NAME", "TOK_ARROW",
    00372   "TOK_INTEGER", "TOK_REAL", "':'", "'{'", "'}'", "','", "'='", "$accept",
    00373   "file", "@1", "ccme1File", "dissents", "dissent", "transitions",
    00374   "transition", "@2", "probability", "constraint", "assignments",
    00375   "assignment", "@3", "variable", "value", "index", "name", 0
    00376 };
    00377 #endif
    00378
    00379 # ifdef YYPRINT
    00380 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
    00381    token YYLEX-NUM.  */
    00382 static const unsigned short yytoknum[] =
    00383 {
    00384        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
    00385      265,    58,   123,   125,    44,    61
    00386 };
    00387 # endif
    00388
    00389 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
    00390 static const unsigned char yyr1[] =
    00391 {
    00392        0,    16,    18,    17,    19,    20,    20,    21,    22,    22,
    00393       24,    23,    25,    25,    26,    26,    26,    27,    27,    29,
    00394       28,    30,    31,    32,    33
    00395 };
    00396
    00397 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
    00398 static const unsigned char yyr2[] =
    00399 {
    00400        0,     2,     0,     3,     2,     1,     2,     1,     1,     2,
    00401        0,    10,     4,     4,     3,     2,     1,     1,     3,     0,
    00402        4,     2,     2,     1,     1
    00403 };
    00404
    00405 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
    00406    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
    00407    means the default is an error.  */
    00408 static const unsigned char yydefact[] =
    00409 {
    00410        2,     0,     0,     1,     0,     5,     3,     0,     8,    16,
    00411        0,     6,     4,     7,    23,    15,     0,    17,    19,     0,
    00412        9,    10,    14,     0,     0,    24,    21,     0,    18,     0,
    00413        0,    20,     0,     0,    22,     0,     0,     0,     0,     0,
    00414        0,     0,     0,     0,    11,    12,    13
    00415 };
    00416
    00417 /* YYDEFGOTO[NTERM-NUM]. */
    00418 static const yysigned_char yydefgoto[] =
    00419 {
    00420       -1,     1,     2,     6,     7,    11,    12,    20,    27,    39,
    00421       13,    16,    17,    24,    18,    31,    19,    26
    00422 };
    00423
    00424 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
    00425    STATE-NUM.  */
    00426 #define YYPACT_NINF -27
    00427 static const yysigned_char yypact[] =
    00428 {
    00429      -27,    11,    14,   -27,    15,   -27,   -27,    -5,   -27,   -27,
    00430       -1,   -27,     9,   -27,   -27,   -27,     0,   -27,   -27,    13,
    00431      -27,   -27,   -27,     9,     7,   -27,   -27,    10,   -27,     9,
    00432        9,   -27,    13,    16,   -27,     9,    12,    19,    17,    20,
    00433        6,    -6,    21,    22,   -27,   -27,   -27
    00434 };
    00435
    00436 /* YYPGOTO[NTERM-NUM].  */
    00437 static const yysigned_char yypgoto[] =
    00438 {
    00439      -27,   -27,   -27,   -27,   -27,   -27,   -27,   -27,   -27,   -27,
    00440      -15,   -27,     4,   -27,    18,   -25,   -26,    -4
    00441 };
    00442
    00443 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
    00444    positive, shift that token.  If negative, reduce the rule which
    00445    number is the opposite.  If zero, do what YYDEFACT says.
    00446    If YYTABLE_NINF, syntax error.  */
    00447 #define YYTABLE_NINF -1
    00448 static const unsigned char yytable[] =
    00449 {
    00450        8,     9,     9,    32,    32,    33,    10,    10,    14,    32,
    00451       36,     3,    15,    22,    23,    42,    43,     4,    14,     5,
    00452       25,    30,    29,    37,    35,    38,    44,    28,    34,    40,
    00453       21,    41,     0,     0,    45,    46
    00454 };
    00455
    00456 static const yysigned_char yycheck[] =
    00457 {
    00458        5,     7,     7,    29,    30,    30,    12,    12,     9,    35,
    00459       35,     0,    13,    13,    14,     9,    10,     3,     9,     4,
    00460        7,    11,    15,    11,     8,     6,    41,    23,    32,    12,
    00461       12,    11,    -1,    -1,    13,    13
    00462 };
    00463
    00464 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
    00465    symbol of state STATE-NUM.  */
    00466 static const unsigned char yystos[] =
    00467 {
    00468        0,    17,    18,     0,     3,     4,    19,    20,     5,     7,
    00469       12,    21,    22,    26,     9,    13,    27,    28,    30,    32,
    00470       23,    30,    13,    14,    29,     7,    33,    24,    28,    15,
    00471       11,    31,    32,    31,    33,     8,    31,    11,     6,    25,
    00472       12,    11,     9,    10,    26,    13,    13
    00473 };
    00474
    00475 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
    00476 # define YYSIZE_T __SIZE_TYPE__
    00477 #endif
    00478 #if ! defined (YYSIZE_T) && defined (size_t)
    00479 # define YYSIZE_T size_t
    00480 #endif
    00481 #if ! defined (YYSIZE_T)
    00482 # if defined (__STDC__) || defined (__cplusplus)
    00483 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
    00484 #  define YYSIZE_T size_t
    00485 # endif
    00486 #endif
    00487 #if ! defined (YYSIZE_T)
    00488 # define YYSIZE_T unsigned int
    00489 #endif
    00490
    00491 #define yyerrok         (yyerrstatus = 0)
    00492 #define yyclearin       (yychar = YYEMPTY)
    00493 #define YYEMPTY         (-2)
    00494 #define YYEOF           0
    00495
    00496 #define YYACCEPT        goto yyacceptlab
    00497 #define YYABORT         goto yyabortlab
    00498 #define YYERROR         goto yyerrlab1
    00499
    00500
    00501 /* Like YYERROR except do call yyerror.  This remains here temporarily
    00502    to ease the transition to the new meaning of YYERROR, for GCC.
    00503    Once GCC version 2 has supplanted version 1, this can go.  */
    00504
    00505 #define YYFAIL          goto yyerrlab
    00506
    00507 #define YYRECOVERING()  (!!yyerrstatus)
    00508
    00509 #define YYBACKUP(Token, Value)                                  \
    00510 do                                                              \
    00511   if (yychar == YYEMPTY && yylen == 1)                          \
    00512     {                                                           \
    00513       yychar = (Token);                                         \
    00514       yylval = (Value);                                         \
    00515       yytoken = YYTRANSLATE (yychar);                           \
    00516       YYPOPSTACK;                                               \
    00517       goto yybackup;                                            \
    00518     }                                                           \
    00519   else                                                          \
    00520     {                                                           \
    00521       yyerror ("syntax error: cannot back up");\
    00522       YYERROR;                                                  \
    00523     }                                                           \
    00524 while (0)
    00525
    00526 #define YYTERROR        1
    00527 #define YYERRCODE       256
    00528
    00529 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
    00530    are run).  */
    00531
    00532 #ifndef YYLLOC_DEFAULT
    00533 # define YYLLOC_DEFAULT(Current, Rhs, N)         \
    00534   Current.first_line   = Rhs[1].first_line;      \
    00535   Current.first_column = Rhs[1].first_column;    \
    00536   Current.last_line    = Rhs[N].last_line;       \
    00537   Current.last_column  = Rhs[N].last_column;
    00538 #endif
    00539
    00540 /* YYLEX -- calling `yylex' with the right arguments.  */
    00541
    00542 #ifdef YYLEX_PARAM
    00543 # define YYLEX yylex (YYLEX_PARAM)
    00544 #else
    00545 # define YYLEX yylex ()
    00546 #endif
    00547
    00548 /* Enable debugging if requested.  */
    00549 #if YYDEBUG
    00550
    00551 # ifndef YYFPRINTF
    00552 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
    00553 #  define YYFPRINTF fprintf
    00554 # endif
    00555
    00556 # define YYDPRINTF(Args)                        \
    00557 do {                                            \
    00558   if (yydebug)                                  \
    00559     YYFPRINTF Args;                             \
    00560 } while (0)
    00561
    00562 # define YYDSYMPRINT(Args)                      \
    00563 do {                                            \
    00564   if (yydebug)                                  \
    00565     yysymprint Args;                            \
    00566 } while (0)
    00567
    00568 # define YYDSYMPRINTF(Title, Token, Value, Location)            \
    00569 do {                                                            \
    00570   if (yydebug)                                                  \
    00571     {                                                           \
    00572       YYFPRINTF (stderr, "%s ", Title);                         \
    00573       yysymprint (stderr,                                       \
    00574                   Token, Value);        \
    00575       YYFPRINTF (stderr, "\n");                                 \
    00576     }                                                           \
    00577 } while (0)
    00578
    00579 /*------------------------------------------------------------------.
    00580 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
    00581 | TOP (cinluded).                                                   |
    00582 `------------------------------------------------------------------*/
    00583
    00584 #if defined (__STDC__) || defined (__cplusplus)
    00585 static void
    00586 yy_stack_print (short *bottom, short *top)
    00587 #else
    00588 static void
    00589 yy_stack_print (bottom, top)
    00590     short *bottom;
    00591     short *top;
    00592 #endif
    00593 {
    00594   YYFPRINTF (stderr, "Stack now");
    00595   for (/* Nothing. */; bottom <= top; ++bottom)
    00596     YYFPRINTF (stderr, " %d", *bottom);
    00597   YYFPRINTF (stderr, "\n");
    00598 }
    00599
    00600 # define YY_STACK_PRINT(Bottom, Top)                            \
    00601 do {                                                            \
    00602   if (yydebug)                                                  \
    00603     yy_stack_print ((Bottom), (Top));                           \
    00604 } while (0)
    00605
    00606
    00607 /*------------------------------------------------.
    00608 | Report that the YYRULE is going to be reduced.  |
    00609 `------------------------------------------------*/
    00610
    00611 #if defined (__STDC__) || defined (__cplusplus)
    00612 static void
    00613 yy_reduce_print (int yyrule)
    00614 #else
    00615 static void
    00616 yy_reduce_print (yyrule)
    00617     int yyrule;
    00618 #endif
    00619 {
    00620   int yyi;
    00621   unsigned int yylno = yyrline[yyrule];
    00622   YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
    00623              yyrule - 1, yylno);
    00624   /* Print the symbols being reduced, and their result.  */
    00625   for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
    00626     YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
    00627   YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
    00628 }
    00629
    00630 # define YY_REDUCE_PRINT(Rule)          \
    00631 do {                                    \
    00632   if (yydebug)                          \
    00633     yy_reduce_print (Rule);             \
    00634 } while (0)
    00635
    00636 /* Nonzero means print parse trace.  It is left uninitialized so that
    00637    multiple parsers can coexist.  */
    00638 int yydebug;
    00639 #else /* !YYDEBUG */
    00640 # define YYDPRINTF(Args)
    00641 # define YYDSYMPRINT(Args)
    00642 # define YYDSYMPRINTF(Title, Token, Value, Location)
    00643 # define YY_STACK_PRINT(Bottom, Top)
    00644 # define YY_REDUCE_PRINT(Rule)
    00645 #endif /* !YYDEBUG */
    00646
    00647
    00648 /* YYINITDEPTH -- initial size of the parser's stacks.  */
    00649 #ifndef YYINITDEPTH
    00650 # define YYINITDEPTH 200
    00651 #endif
    00652
    00653 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
    00654    if the built-in stack extension method is used).
    00655
    00656    Do not make this value too large; the results are undefined if
    00657    SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
    00658    evaluated with infinite-precision integer arithmetic.  */
    00659
    00660 #if YYMAXDEPTH == 0
    00661 # undef YYMAXDEPTH
    00662 #endif
    00663
    00664 #ifndef YYMAXDEPTH
    00665 # define YYMAXDEPTH 10000
    00666 #endif
    00667
    00668
    00669
    00670 #if YYERROR_VERBOSE
    00671
    00672 # ifndef yystrlen
    00673 #  if defined (__GLIBC__) && defined (_STRING_H)
    00674 #   define yystrlen strlen
    00675 #  else
    00676 /* Return the length of YYSTR.  */
    00677 static YYSIZE_T
    00678 #   if defined (__STDC__) || defined (__cplusplus)
    00679 yystrlen (const char *yystr)
    00680 #   else
    00681 yystrlen (yystr)
    00682      const char *yystr;
    00683 #   endif
    00684 {
    00685   register const char *yys = yystr;
    00686
    00687   while (*yys++ != '\0')
    00688     continue;
    00689
    00690   return yys - yystr - 1;
    00691 }
    00692 #  endif
    00693 # endif
    00694
    00695 # ifndef yystpcpy
    00696 #  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
    00697 #   define yystpcpy stpcpy
    00698 #  else
    00699 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
    00700    YYDEST.  */
    00701 static char *
    00702 #   if defined (__STDC__) || defined (__cplusplus)
    00703 yystpcpy (char *yydest, const char *yysrc)
    00704 #   else
    00705 yystpcpy (yydest, yysrc)
    00706      char *yydest;
    00707      const char *yysrc;
    00708 #   endif
    00709 {
    00710   register char *yyd = yydest;
    00711   register const char *yys = yysrc;
    00712
    00713   while ((*yyd++ = *yys++) != '\0')
    00714     continue;
    00715
    00716   return yyd - 1;
    00717 }
    00718 #  endif
    00719 # endif
    00720
    00721 #endif /* !YYERROR_VERBOSE */
    00722
    00723
    00724
    00725 #if YYDEBUG
    00726 /*--------------------------------.
    00727 | Print this symbol on YYOUTPUT.  |
    00728 `--------------------------------*/
    00729
    00730 #if defined (__STDC__) || defined (__cplusplus)
    00731 static void
    00732 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
    00733 #else
    00734 static void
    00735 yysymprint (yyoutput, yytype, yyvaluep)
    00736     FILE *yyoutput;
    00737     int yytype;
    00738     YYSTYPE *yyvaluep;
    00739 #endif
    00740 {
    00741   /* Pacify ``unused variable'' warnings.  */
    00742   (void) yyvaluep;
    00743
    00744   if (yytype < YYNTOKENS)
    00745     {
    00746       YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
    00747 # ifdef YYPRINT
    00748       YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
    00749 # endif
    00750     }
    00751   else
    00752     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
    00753
    00754   switch (yytype)
    00755     {
    00756       default:
    00757         break;
    00758     }
    00759   YYFPRINTF (yyoutput, ")");
    00760 }
    00761
    00762 #endif /* ! YYDEBUG */
    00763 /*-----------------------------------------------.
    00764 | Release the memory associated to this symbol.  |
    00765 `-----------------------------------------------*/
    00766
    00767 #if defined (__STDC__) || defined (__cplusplus)
    00768 static void
    00769 yydestruct (int yytype, YYSTYPE *yyvaluep)
    00770 #else
    00771 static void
    00772 yydestruct (yytype, yyvaluep)
    00773     int yytype;
    00774     YYSTYPE *yyvaluep;
    00775 #endif
    00776 {
    00777   /* Pacify ``unused variable'' warnings.  */
    00778   (void) yyvaluep;
    00779
    00780   switch (yytype)
    00781     {
    00782
    00783       default:
    00784         break;
    00785     }
    00786 }
    00787
    00788
    00789 /* Prevent warnings from -Wmissing-prototypes.  */
    00790
    00791 #ifdef YYPARSE_PARAM
    00792 # if defined (__STDC__) || defined (__cplusplus)
    00793 int yyparse (void *YYPARSE_PARAM);
    00794 # else
    00795 int yyparse ();
    00796 # endif
    00797 #else /* ! YYPARSE_PARAM */
    00798 #if defined (__STDC__) || defined (__cplusplus)
    00799 int yyparse (void);
    00800 #else
    00801 int yyparse ();
    00802 #endif
    00803 #endif /* ! YYPARSE_PARAM */
    00804
    00805
    00806
    00807 /* The lookahead symbol.  */
    00808 int yychar;
    00809
    00810 /* The semantic value of the lookahead symbol.  */
    00811 YYSTYPE yylval;
    00812
    00813 /* Number of syntax errors so far.  */
    00814 int yynerrs;
    00815
    00816
    00817
    00818 /*----------.
    00819 | yyparse.  |
    00820 `----------*/
    00821
    00822 #ifdef YYPARSE_PARAM
    00823 # if defined (__STDC__) || defined (__cplusplus)
    00824 int yyparse (void *YYPARSE_PARAM)
    00825 # else
    00826 int yyparse (YYPARSE_PARAM)
    00827   void *YYPARSE_PARAM;
    00828 # endif
    00829 #else /* ! YYPARSE_PARAM */
    00830 #if defined (__STDC__) || defined (__cplusplus)
    00831 int
    00832 yyparse (void)
    00833 #else
    00834 int
    00835 yyparse ()
    00836
    00837 #endif
    00838 #endif
    00839 {
    00840
    00841   register int yystate;
    00842   register int yyn;
    00843   int yyresult;
    00844   /* Number of tokens to shift before error messages enabled.  */
    00845   int yyerrstatus;
    00846   /* Lookahead token as an internal (translated) token number.  */
    00847   int yytoken = 0;
    00848
    00849   /* Three stacks and their tools:
    00850      `yyss': related to states,
    00851      `yyvs': related to semantic values,
    00852      `yyls': related to locations.
    00853
    00854      Refer to the stacks thru separate pointers, to allow yyoverflow
    00855      to reallocate them elsewhere.  */
    00856
    00857   /* The state stack.  */
    00858   short yyssa[YYINITDEPTH];
    00859   short *yyss = yyssa;
    00860   register short *yyssp;
    00861
    00862   /* The semantic value stack.  */
    00863   YYSTYPE yyvsa[YYINITDEPTH];
    00864   YYSTYPE *yyvs = yyvsa;
    00865   register YYSTYPE *yyvsp;
    00866
    00867
    00868
    00869 #define YYPOPSTACK   (yyvsp--, yyssp--)
    00870
    00871   YYSIZE_T yystacksize = YYINITDEPTH;
    00872
    00873   /* The variables used to return semantic value and location from the
    00874      action routines.  */
    00875   YYSTYPE yyval;
    00876
    00877
    00878   /* When reducing, the number of symbols on the RHS of the reduced
    00879      rule.  */
    00880   int yylen;
    00881
    00882   YYDPRINTF ((stderr, "Starting parse\n"));
    00883
    00884   yystate = 0;
    00885   yyerrstatus = 0;
    00886   yynerrs = 0;
    00887   yychar = YYEMPTY;             /* Cause a token to be read.  */
    00888
    00889   /* Initialize stack pointers.
    00890      Waste one element of value and location stack
    00891      so that they stay on the same level as the state stack.
    00892      The wasted elements are never initialized.  */
    00893
    00894   yyssp = yyss;
    00895   yyvsp = yyvs;
    00896
    00897   goto yysetstate;
    00898
    00899 /*------------------------------------------------------------.
    00900 | yynewstate -- Push a new state, which is found in yystate.  |
    00901 `------------------------------------------------------------*/
    00902  yynewstate:
    00903   /* In all cases, when you get here, the value and location stacks
    00904      have just been pushed. so pushing a state here evens the stacks.
    00905      */
    00906   yyssp++;
    00907
    00908  yysetstate:
    00909   *yyssp = yystate;
    00910
    00911   if (yyss + yystacksize - 1 <= yyssp)
    00912     {
    00913       /* Get the current used size of the three stacks, in elements.  */
    00914       YYSIZE_T yysize = yyssp - yyss + 1;
    00915
    00916 #ifdef yyoverflow
    00917       {
    00918         /* Give user a chance to reallocate the stack. Use copies of
    00919            these so that the &'s don't force the real ones into
    00920            memory.  */
    00921         YYSTYPE *yyvs1 = yyvs;
    00922         short *yyss1 = yyss;
    00923
    00924
    00925         /* Each stack pointer address is followed by the size of the
    00926            data in use in that stack, in bytes.  This used to be a
    00927            conditional around just the two extra args, but that might
    00928            be undefined if yyoverflow is a macro.  */
    00929         yyoverflow ("parser stack overflow",
    00930                     &yyss1, yysize * sizeof (*yyssp),
    00931                     &yyvs1, yysize * sizeof (*yyvsp),
    00932
    00933                     &yystacksize);
    00934
    00935         yyss = yyss1;
    00936         yyvs = yyvs1;
    00937       }
    00938 #else /* no yyoverflow */
    00939 # ifndef YYSTACK_RELOCATE
    00940       goto yyoverflowlab;
    00941 # else
    00942       /* Extend the stack our own way.  */
    00943       if (YYMAXDEPTH <= yystacksize)
    00944         goto yyoverflowlab;
    00945       yystacksize *= 2;
    00946       if (YYMAXDEPTH < yystacksize)
    00947         yystacksize = YYMAXDEPTH;
    00948
    00949       {
    00950         short *yyss1 = yyss;
    00951         union yyalloc *yyptr =
    00952           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
    00953         if (! yyptr)
    00954           goto yyoverflowlab;
    00955         YYSTACK_RELOCATE (yyss);
    00956         YYSTACK_RELOCATE (yyvs);
    00957
    00958 #  undef YYSTACK_RELOCATE
    00959         if (yyss1 != yyssa)
    00960           YYSTACK_FREE (yyss1);
    00961       }
    00962 # endif
    00963 #endif /* no yyoverflow */
    00964
    00965       yyssp = yyss + yysize - 1;
    00966       yyvsp = yyvs + yysize - 1;
    00967
    00968
    00969       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
    00970                   (unsigned long int) yystacksize));
    00971
    00972       if (yyss + yystacksize - 1 <= yyssp)
    00973         YYABORT;
    00974     }
    00975
    00976   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
    00977
    00978   goto yybackup;
    00979
    00980 /*-----------.
    00981 | yybackup.  |
    00982 `-----------*/
    00983 yybackup:
    00984
    00985 /* Do appropriate processing given the current state.  */
    00986 /* Read a lookahead token if we need one and don't already have one.  */
    00987 /* yyresume: */
    00988
    00989   /* First try to decide what to do without reference to lookahead token.  */
    00990
    00991   yyn = yypact[yystate];
    00992   if (yyn == YYPACT_NINF)
    00993     goto yydefault;
    00994
    00995   /* Not known => get a lookahead token if don't already have one.  */
    00996
    00997   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
    00998   if (yychar == YYEMPTY)
    00999     {
    01000       YYDPRINTF ((stderr, "Reading a token: "));
    01001       yychar = YYLEX;
    01002     }
    01003
    01004   if (yychar <= YYEOF)
    01005     {
    01006       yychar = yytoken = YYEOF;
    01007       YYDPRINTF ((stderr, "Now at end of input.\n"));
    01008     }
    01009   else
    01010     {
    01011       yytoken = YYTRANSLATE (yychar);
    01012       YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
    01013     }
    01014
    01015   /* If the proper action on seeing token YYTOKEN is to reduce or to
    01016      detect an error, take that action.  */
    01017   yyn += yytoken;
    01018   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
    01019     goto yydefault;
    01020   yyn = yytable[yyn];
    01021   if (yyn <= 0)
    01022     {
    01023       if (yyn == 0 || yyn == YYTABLE_NINF)
    01024         goto yyerrlab;
    01025       yyn = -yyn;
    01026       goto yyreduce;
    01027     }
    01028
    01029   if (yyn == YYFINAL)
    01030     YYACCEPT;
    01031
    01032   /* Shift the lookahead token.  */
    01033   YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
    01034
    01035   /* Discard the token being shifted unless it is eof.  */
    01036   if (yychar != YYEOF)
    01037     yychar = YYEMPTY;
    01038
    01039   *++yyvsp = yylval;
    01040
    01041
    01042   /* Count tokens shifted since error; after three, turn off error
    01043      status.  */
    01044   if (yyerrstatus)
    01045     yyerrstatus--;
    01046
    01047   yystate = yyn;
    01048   goto yynewstate;
    01049
    01050
    01051 /*-----------------------------------------------------------.
    01052 | yydefault -- do the default action for the current state.  |
    01053 `-----------------------------------------------------------*/
    01054 yydefault:
    01055   yyn = yydefact[yystate];
    01056   if (yyn == 0)
    01057     goto yyerrlab;
    01058   goto yyreduce;
    01059
    01060
    01061 /*-----------------------------.
    01062 | yyreduce -- Do a reduction.  |
    01063 `-----------------------------*/
    01064 yyreduce:
    01065   /* yyn is the number of a rule to reduce with.  */
    01066   yylen = yyr2[yyn];
    01067
    01068   /* If YYLEN is nonzero, implement the default value of the action:
    01069      `$$ = $1'.
    01070
    01071      Otherwise, the following line sets YYVAL to garbage.
    01072      This behavior is undocumented and Bison
    01073      users should not rely upon it.  Assigning to YYVAL
    01074      unconditionally makes the parser a bit smaller, and it avoids a
    01075      GCC warning that YYVAL may be used uninitialized.  */
    01076   yyval = yyvsp[1-yylen];
    01077
    01078
    01079   YY_REDUCE_PRINT (yyn);
    01080   switch (yyn)
    01081     {
    01082         case 2:
    01083 #line 89 "CCMEReader.y"
    01084     {
    01085         yyCCMEReaderline = 1;
    01086 ;}
    01087     break;
    01088
    01089   case 7:
    01090 #line 103 "CCMEReader.y"
    01091     {
    01092         {
    01093                 BaseModelAssignmentArray * obs = new BaseModelAssignmentArray(true);
    01094                 BaseModelAssignmentArray * other = new BaseModelAssignmentArray(true);
    01095
    01096                 if(yyvsp[0].assignments != NULL) {
    01097                         while(!yyvsp[0].assignments->isEmpty()) {
    01098                                 BaseModelAssignment * asg = yyvsp[0].assignments->popBack();
    01099                                 if(asg->getVariable()->getVariableType() ==
    01100                                          BaseModelVariable::Observable) {
    01101                                         obs->pushBack(asg);
    01102                                 } else {
    01103                                         other->pushBack(asg);
    01104                                 }
    01105                         }
    01106                 }
    01107
    01108                 Dissent * diss = new Dissent(obs, other);
    01109                 myCCMEReader->addDissent(diss);
    01110         }
    01111 ;}
    01112     break;
    01113
    01114   case 10:
    01115 #line 131 "CCMEReader.y"
    01116     {
    01117         curCCMEVar = yyvsp[0].variable;
    01118 ;}
    01119     break;
    01120
    01121   case 11:
    01122 #line 134 "CCMEReader.y"
    01123     {
    01124         {
    01125                 BaseModelAssignment * src = new BaseModelAssignment(yyvsp[-9].variable, yyvsp[-6].value);
    01126                 BaseModelAssignment * dest = new BaseModelAssignment(yyvsp[-9].variable, yyvsp[-4].value);
    01127
    01128                 BaseModelAssignmentArray * guards = new BaseModelAssignmentArray(true);
    01129
    01130                 if(yyvsp[0].assignments != NULL) {
    01131                         while(!yyvsp[0].assignments->isEmpty()) {
    01132                                 BaseModelAssignment * asg = yyvsp[0].assignments->popBack();
    01133                                 guards->pushBack(asg);
    01134                         }
    01135                 }
    01136
    01137                 CompiledTransition * trans =
    01138                         new CompiledTransition(src, guards, dest, yyvsp[-2].dbl);
    01139                 myCCMEReader->addTransition(trans);
    01140         }
    01141 ;}
    01142     break;
    01143
    01144   case 12:
    01145 #line 156 "CCMEReader.y"
    01146     {
    01147         yyval.dbl = (double) yyvsp[-1].val;
    01148 ;}
    01149     break;
    01150
    01151   case 13:
    01152 #line 160 "CCMEReader.y"
    01153     {
    01154         yyval.dbl = yyvsp[-1].dbl;
    01155 ;}
    01156     break;
    01157
    01158   case 14:
    01159 #line 166 "CCMEReader.y"
    01160     {
    01161         yyval.assignments = yyvsp[-1].assignments;
    01162 ;}
    01163     break;
    01164
    01165   case 15:
    01166 #line 170 "CCMEReader.y"
    01167     {
    01168         yyval.assignments = new BaseModelAssignmentArray(true);
    01169 ;}
    01170     break;
    01171
    01172   case 16:
    01173 #line 174 "CCMEReader.y"
    01174     {
    01175         if(strcmp(yyvsp[0].str, "True") == 0) {
    01176                 yyval.assignments = new BaseModelAssignmentArray(true);
    01177         } else {
    01178                 yyval.assignments = NULL;
    01179         }
    01180 ;}
    01181     break;
    01182
    01183   case 17:
    01184 #line 184 "CCMEReader.y"
    01185     {
    01186         yyval.assignments = new BaseModelAssignmentArray(true);
    01187         yyval.assignments->pushBack(yyvsp[0].assignment);
    01188 ;}
    01189     break;
    01190
    01191   case 18:
    01192 #line 189 "CCMEReader.y"
    01193     {
    01194         yyvsp[-2].assignments->pushBack(yyvsp[0].assignment);
    01195         yyval.assignments = yyvsp[-2].assignments;
    01196 ;}
    01197     break;
    01198
    01199   case 19:
    01200 #line 196 "CCMEReader.y"
    01201     {
    01202         curCCMEVar = yyvsp[0].variable;
    01203 ;}
    01204     break;
    01205
    01206   case 20:
    01207 #line 199 "CCMEReader.y"
    01208     {
    01209         yyval.assignment = new BaseModelAssignment(yyvsp[-3].variable, yyvsp[0].value);
    01210 ;}
    01211     break;
    01212
    01213   case 21:
    01214 #line 205 "CCMEReader.y"
    01215     {
    01216         {
    01217                 BaseModelVariable const * varI = myCCMEBaseModel->getVariable(yyvsp[-1].val);
    01218                 BaseModelVariable const * varN = myCCMEBaseModel->getVariable(yyvsp[0].str);
    01219
    01220                 if(varN == NULL) {
    01221                         yyCCMEReadererror(yyvsp[0].str);
    01222                         fprintf(stderr, "Could not find a variable named %s\n", yyvsp[0].str);
    01223                         YYERROR;
    01224                 }
    01225
    01226                 if(varI != varN) {
    01227                         fprintf(stderr, "Warning, variable index %d did not match the "
    01228                                                         "variable named %s.  Assuming the name is correct.\n", yyvsp[-1].val, yyvsp[0].str);
    01229                 }
    01230                 yyval.variable = varN;
    01231
    01232                 delete[] yyvsp[0].str;
    01233         }
    01234 ;}
    01235     break;
    01236
    01237   case 22:
    01238 #line 228 "CCMEReader.y"
    01239     {
    01240         {
    01241                 BaseModelValue const * valI = curCCMEVar->getValue(yyvsp[-1].val);
    01242                 BaseModelValue const * valN = curCCMEVar->getValue(yyvsp[0].str);
    01243
    01244                 if(valN == NULL) {
    01245                         yyCCMEReadererror(yyvsp[0].str);
    01246                         fprintf(stderr, "Could not find a value named %s for the variable %s\n",
    01247                                                         yyvsp[0].str, curCCMEVar->getName());
    01248                         YYERROR;
    01249                 }
    01250
    01251                 if(valI != valN) {
    01252                         fprintf(stderr, "Warning, value index %d did not match the "
    01253                                                         "value named %s for the variable %s.  Assuming the "
    01254                                                         "name is correct.\n", yyvsp[-1].val, yyvsp[0].str, curCCMEVar->getName());
    01255                 }
    01256                 yyval.value = valN;
    01257
    01258                 delete[] yyvsp[0].str;
    01259         }
    01260 ;}
    01261     break;
    01262
    01263   case 23:
    01264 #line 253 "CCMEReader.y"
    01265     {
    01266         yyval.val = yyvsp[0].val;
    01267 ;}
    01268     break;
    01269
    01270   case 24:
    01271 #line 259 "CCMEReader.y"
    01272     {
    01273         yyval.str = yyvsp[0].str;
    01274 ;}
    01275     break;
    01276
    01277
    01278     }
    01279
    01280 /* Line 999 of yacc.c.  */
    01281 #line 1282 "CCMEReader.tab.cpp"
    01282
    01283   yyvsp -= yylen;
    01284   yyssp -= yylen;
    01285
    01286
    01287   YY_STACK_PRINT (yyss, yyssp);
    01288
    01289   *++yyvsp = yyval;
    01290
    01291
    01292   /* Now `shift' the result of the reduction.  Determine what state
    01293      that goes to, based on the state we popped back to and the rule
    01294      number reduced by.  */
    01295
    01296   yyn = yyr1[yyn];
    01297
    01298   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
    01299   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
    01300     yystate = yytable[yystate];
    01301   else
    01302     yystate = yydefgoto[yyn - YYNTOKENS];
    01303
    01304   goto yynewstate;
    01305
    01306
    01307 /*------------------------------------.
    01308 | yyerrlab -- here on detecting error |
    01309 `------------------------------------*/
    01310 yyerrlab:
    01311   /* If not already recovering from an error, report this error.  */
    01312   if (!yyerrstatus)
    01313     {
    01314       ++yynerrs;
    01315 #if YYERROR_VERBOSE
    01316       yyn = yypact[yystate];
    01317
    01318       if (YYPACT_NINF < yyn && yyn < YYLAST)
    01319         {
    01320           YYSIZE_T yysize = 0;
    01321           int yytype = YYTRANSLATE (yychar);
    01322           const char* yyprefix;
    01323           char *yymsg;
    01324           int yyx;
    01325
    01326           /* Start YYX at -YYN if negative to avoid negative indexes in
    01327              YYCHECK.  */
    01328           int yyxbegin = yyn < 0 ? -yyn : 0;
    01329
    01330           /* Stay within bounds of both yycheck and yytname.  */
    01331           int yychecklim = YYLAST - yyn;
    01332           int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
    01333           int yycount = 0;
    01334
    01335           yyprefix = ", expecting ";
    01336           for (yyx = yyxbegin; yyx < yyxend; ++yyx)
    01337             if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
    01338               {
    01339                 yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
    01340                 yycount += 1;
    01341                 if (yycount == 5)
    01342                   {
    01343                     yysize = 0;
    01344                     break;
    01345                   }
    01346               }
    01347           yysize += (sizeof ("syntax error, unexpected ")
    01348                      + yystrlen (yytname[yytype]));
    01349           yymsg = (char *) YYSTACK_ALLOC (yysize);
    01350           if (yymsg != 0)
    01351             {
    01352               char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
    01353               yyp = yystpcpy (yyp, yytname[yytype]);
    01354
    01355               if (yycount < 5)
    01356                 {
    01357                   yyprefix = ", expecting ";
    01358                   for (yyx = yyxbegin; yyx < yyxend; ++yyx)
    01359                     if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
    01360                       {
    01361                         yyp = yystpcpy (yyp, yyprefix);
    01362                         yyp = yystpcpy (yyp, yytname[yyx]);
    01363                         yyprefix = " or ";
    01364                       }
    01365                 }
    01366               yyerror (yymsg);
    01367               YYSTACK_FREE (yymsg);
    01368             }
    01369           else
    01370             yyerror ("syntax error; also virtual memory exhausted");
    01371         }
    01372       else
    01373 #endif /* YYERROR_VERBOSE */
    01374         yyerror ("syntax error");
    01375     }
    01376
    01377
    01378
    01379   if (yyerrstatus == 3)
    01380     {
    01381       /* If just tried and failed to reuse lookahead token after an
    01382          error, discard it.  */
    01383
    01384       /* Return failure if at end of input.  */
    01385       if (yychar == YYEOF)
    01386         {
    01387           /* Pop the error token.  */
    01388           YYPOPSTACK;
    01389           /* Pop the rest of the stack.  */
    01390           while (yyss < yyssp)
    01391             {
    01392               YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
    01393               yydestruct (yystos[*yyssp], yyvsp);
    01394               YYPOPSTACK;
    01395             }
    01396           YYABORT;
    01397         }
    01398
    01399       YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
    01400       yydestruct (yytoken, &yylval);
    01401       yychar = YYEMPTY;
    01402
    01403     }
    01404
    01405   /* Else will try to reuse lookahead token after shifting the error
    01406      token.  */
    01407   goto yyerrlab1;
    01408
    01409
    01410 /*----------------------------------------------------.
    01411 | yyerrlab1 -- error raised explicitly by an action.  |
    01412 `----------------------------------------------------*/
    01413 yyerrlab1:
    01414   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
    01415
    01416   for (;;)
    01417     {
    01418       yyn = yypact[yystate];
    01419       if (yyn != YYPACT_NINF)
    01420         {
    01421           yyn += YYTERROR;
    01422           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
    01423             {
    01424               yyn = yytable[yyn];
    01425               if (0 < yyn)
    01426                 break;
    01427             }
    01428         }
    01429
    01430       /* Pop the current state because it cannot handle the error token.  */
    01431       if (yyssp == yyss)
    01432         YYABORT;
    01433
    01434       YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
    01435       yydestruct (yystos[yystate], yyvsp);
    01436       yyvsp--;
    01437       yystate = *--yyssp;
    01438
    01439       YY_STACK_PRINT (yyss, yyssp);
    01440     }
    01441
    01442   if (yyn == YYFINAL)
    01443     YYACCEPT;
    01444
    01445   YYDPRINTF ((stderr, "Shifting error token, "));
    01446
    01447   *++yyvsp = yylval;
    01448
    01449
    01450   yystate = yyn;
    01451   goto yynewstate;
    01452
    01453
    01454 /*-------------------------------------.
    01455 | yyacceptlab -- YYACCEPT comes here.  |
    01456 `-------------------------------------*/
    01457 yyacceptlab:
    01458   yyresult = 0;
    01459   goto yyreturn;
    01460
    01461 /*-----------------------------------.
    01462 | yyabortlab -- YYABORT comes here.  |
    01463 `-----------------------------------*/
    01464 yyabortlab:
    01465   yyresult = 1;
    01466   goto yyreturn;
    01467
    01468 #ifndef yyoverflow
    01469 /*----------------------------------------------.
    01470 | yyoverflowlab -- parser overflow comes here.  |
    01471 `----------------------------------------------*/
    01472 yyoverflowlab:
    01473   yyerror ("parser stack overflow");
    01474   yyresult = 2;
    01475   /* Fall through.  */
    01476 #endif
    01477
    01478 yyreturn:
    01479 #ifndef yyoverflow
    01480   if (yyss != yyssa)
    01481     YYSTACK_FREE (yyss);
    01482 #endif
    01483   return yyresult;
    01484 }
    01485
    01486
    01487 #line 264 "CCMEReader.y"
    01488
    01489
    01490 void yyCCMEReadererror(const char * s)
    01491 {
    01492         fprintf(stderr, "Error on line %d: %s\n", yyCCMEReaderline, s);
    01493 }
    01494
    01495