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

# /Users/fpy/titan-1-5-MBARI/Mers/Models/CCA/Io/Mof/MOFReader.tab.cpp

    00001 /* A Bison parser, made by GNU Bison 2.1.  */
    00002
    00003 /* Skeleton parser for Yacc-like parsing with Bison,
    00004    Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor,
    00019    Boston, MA 02110-1301, 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 /* Bison version.  */
    00040 #define YYBISON_VERSION "2.1"
    00041
    00042 /* Skeleton name.  */
    00043 #define YYSKELETON_NAME "yacc.c"
    00044
    00045 /* Pure parsers.  */
    00046 #define YYPURE 0
    00047
    00048 /* Using locations.  */
    00049 #define YYLSP_NEEDED 0
    00050
    00051 /* Substitute the variable and function names.  */
    00052 #define yyparse yyMOFReaderparse
    00053 #define yylex   yyMOFReaderlex
    00054 #define yyerror yyMOFReadererror
    00055 #define yylval  yyMOFReaderlval
    00056 #define yychar  yyMOFReaderchar
    00057 #define yydebug yyMOFReaderdebug
    00058 #define yynerrs yyMOFReadernerrs
    00059
    00060
    00061 /* Tokens.  */
    00062 #ifndef YYTOKENTYPE
    00063 # define YYTOKENTYPE
    00064    /* Put the tokens into the symbol table, so that GDB and other debuggers
    00065       know about them.  */
    00066    enum yytokentype {
    00067      TOK_NAME = 258,
    00068      TOK_FLOAT = 259,
    00069      TOK_VARIABLE_DOMAIN_TYPE_DEFINITIONS = 260,
    00070      TOK_VARIABLE_DOMAIN_TYPE = 261,
    00071      TOK_VARIABLE_DEFINITIONS = 262,
    00072      TOK_MODEL_DEFINITIONS = 263,
    00073      TOK_VARIABLE = 264,
    00074      TOK_TYPE = 265,
    00075      TOK_INSTANCE = 266,
    00076      TOK_OF_TYPE = 267,
    00077      TOK_WITH_RANGE = 268,
    00078      TOK_AND = 269,
    00079      TOK_OR = 270,
    00080      TOK_NOT = 271,
    00081      TOK_CONSTRAINTS = 272,
    00082      TOK_NIL = 273,
    00083      TOK_TRANSITION = 274,
    00084      TOK_FROM_VALUE = 275,
    00085      TOK_TO_VALUE = 276,
    00086      TOK_GUARD = 277,
    00087      TOK_PROBABILITY = 278,
    00088      TOK_WITH_NUM = 279,
    00089      TOK_CCAFILEV2 = 280,
    00090      TOK_INCLUDE = 281,
    00091      TOK_GLOBAL_STATE_CONSTRAINT = 282,
    00092      TOK_STATE_VARIABLE_BINDING = 283,
    00093      TOK_TOPOLOGICAL_NUMBER = 284,
    00094      TOK_STATE_CLOCK_VARIABLE = 285,
    00095      TOK_STATE_TYPE_AND_CONSTRAINT = 286,
    00096      TOK_TRANSITION_GUARD_PROB = 287
    00097    };
    00098 #endif
    00099 /* Tokens.  */
    00100 #define TOK_NAME 258
    00101 #define TOK_FLOAT 259
    00102 #define TOK_VARIABLE_DOMAIN_TYPE_DEFINITIONS 260
    00103 #define TOK_VARIABLE_DOMAIN_TYPE 261
    00104 #define TOK_VARIABLE_DEFINITIONS 262
    00105 #define TOK_MODEL_DEFINITIONS 263
    00106 #define TOK_VARIABLE 264
    00107 #define TOK_TYPE 265
    00108 #define TOK_INSTANCE 266
    00109 #define TOK_OF_TYPE 267
    00110 #define TOK_WITH_RANGE 268
    00111 #define TOK_AND 269
    00112 #define TOK_OR 270
    00113 #define TOK_NOT 271
    00114 #define TOK_CONSTRAINTS 272
    00115 #define TOK_NIL 273
    00116 #define TOK_TRANSITION 274
    00117 #define TOK_FROM_VALUE 275
    00118 #define TOK_TO_VALUE 276
    00119 #define TOK_GUARD 277
    00120 #define TOK_PROBABILITY 278
    00121 #define TOK_WITH_NUM 279
    00122 #define TOK_CCAFILEV2 280
    00123 #define TOK_INCLUDE 281
    00124 #define TOK_GLOBAL_STATE_CONSTRAINT 282
    00125 #define TOK_STATE_VARIABLE_BINDING 283
    00126 #define TOK_TOPOLOGICAL_NUMBER 284
    00127 #define TOK_STATE_CLOCK_VARIABLE 285
    00128 #define TOK_STATE_TYPE_AND_CONSTRAINT 286
    00129 #define TOK_TRANSITION_GUARD_PROB 287
    00130
    00131
    00132
    00133
    00134 /* Copy the first part of user declarations.  */
    00135 #line 1 "MOFReader.y"
    00136
    00137
    00139 //
    00140 // Copyright (c) 2004           Model-based Embedded and Robotic Systems Group
    00141 // All Rights Reserved          Massachusetts Institute of Technology
    00142 //
    00143 // This software is provided as is. Model-based Embedded and Robotic Systems
    00144 // (MERS) group does not assume any responsibility.
    00145 //
    00146 // Organization:        Model-based Embedded and Robotic Systems Group
    00147 //                                      Massachusetts Institute of Technology
    00148 //
    00150
    00157 #include <Mers/Models/CCA/CCAModel.h>
    00158 #include <Mers/Models/CCA/CCAValues.h>
    00159 #include <Mers/Models/Base/Io/Mof/BaseModelReader.h>
    00160 #include <Mers/Utils/Lang/String.h>
    00161
    00162 #include <cstdio>
    00163 using namespace std;
    00164
    00165 void yyMOFReadererror(const char * s);
    00166 int yyMOFReaderlex();
    00167
    00168 extern FILE * yyin;
    00169
    00170 //#define YYDEBUG 1
    00171 //#define VERBOSE 1
    00172 #define YYERROR_VERBOSE 1
    00173
    00174 extern int MOFReaderLineNumber;
    00175
    00176  using namespace Mers::Models::CCA;
    00177  using Mers::Models::Base::BaseModelValueArray;
    00178  using Mers::Models::Base::BaseModel;
    00179  using Mers::Models::Base::Io::Mof::BaseModelReader;
    00180  using Mers::Utils::Lang::String;
    00181
    00182 CCAModel * myCCAModel;
    00183 CCAVariable * activeVariable;
    00184 CCATransition * activeTransition;
    00185
    00186
    00187
    00188 /* Enabling traces.  */
    00189 #ifndef YYDEBUG
    00190 # define YYDEBUG 0
    00191 #endif
    00192
    00193 /* Enabling verbose error messages.  */
    00194 #ifdef YYERROR_VERBOSE
    00195 # undef YYERROR_VERBOSE
    00196 # define YYERROR_VERBOSE 1
    00197 #else
    00198 # define YYERROR_VERBOSE 0
    00199 #endif
    00200
    00201 /* Enabling the token table.  */
    00202 #ifndef YYTOKEN_TABLE
    00203 # define YYTOKEN_TABLE 0
    00204 #endif
    00205
    00206 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
    00207 #line 53 "MOFReader.y"
    00208 typedef union YYSTYPE {
    00209   double flt;
    00210   int i;
    00211   String * str;
    00212   BaseModelValueArray * val;
    00213   CCASentence * sentence;
    00214   CCAClause * clause;
    00215   CCAAssignment * assignment;
    00216   } YYSTYPE;
    00217 /* Line 196 of yacc.c.  */
    00218 #line 219 "MOFReader.tab.cpp"
    00219 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
    00220 # define YYSTYPE_IS_DECLARED 1
    00221 # define YYSTYPE_IS_TRIVIAL 1
    00222 #endif
    00223
    00224
    00225
    00226 /* Copy the second part of user declarations.  */
    00227
    00228
    00229 /* Line 219 of yacc.c.  */
    00230 #line 231 "MOFReader.tab.cpp"
    00231
    00232 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
    00233 # define YYSIZE_T __SIZE_TYPE__
    00234 #endif
    00235 #if ! defined (YYSIZE_T) && defined (size_t)
    00236 # define YYSIZE_T size_t
    00237 #endif
    00238 #if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
    00239 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
    00240 # define YYSIZE_T size_t
    00241 #endif
    00242 #if ! defined (YYSIZE_T)
    00243 # define YYSIZE_T unsigned int
    00244 #endif
    00245
    00246 #ifndef YY_
    00247 # if YYENABLE_NLS
    00248 #  if ENABLE_NLS
    00249 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
    00250 #   define YY_(msgid) dgettext ("bison-runtime", msgid)
    00251 #  endif
    00252 # endif
    00253 # ifndef YY_
    00254 #  define YY_(msgid) msgid
    00255 # endif
    00256 #endif
    00257
    00258 #if ! defined (yyoverflow) || YYERROR_VERBOSE
    00259
    00260 /* The parser invokes alloca or malloc; define the necessary symbols.  */
    00261
    00262 # ifdef YYSTACK_USE_ALLOCA
    00263 #  if YYSTACK_USE_ALLOCA
    00264 #   ifdef __GNUC__
    00265 #    define YYSTACK_ALLOC __builtin_alloca
    00266 #   else
    00267 #    define YYSTACK_ALLOC alloca
    00268 #    if defined (__STDC__) || defined (__cplusplus)
    00269 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
    00270 #     define YYINCLUDED_STDLIB_H
    00271 #    endif
    00272 #   endif
    00273 #  endif
    00274 # endif
    00275
    00276 # ifdef YYSTACK_ALLOC
    00277    /* Pacify GCC's `empty if-body' warning. */
    00278 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
    00279 #  ifndef YYSTACK_ALLOC_MAXIMUM
    00280     /* The OS might guarantee only one guard page at the bottom of the stack,
    00281        and a page size can be as small as 4096 bytes.  So we cannot safely
    00282        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
    00283        to allow for a few compiler-allocated temporary stack slots.  */
    00284 #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
    00285 #  endif
    00286 # else
    00287 #  define YYSTACK_ALLOC YYMALLOC
    00288 #  define YYSTACK_FREE YYFREE
    00289 #  ifndef YYSTACK_ALLOC_MAXIMUM
    00290 #   define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
    00291 #  endif
    00292 #  ifdef __cplusplus
    00293 extern "C" {
    00294 #  endif
    00295 #  ifndef YYMALLOC
    00296 #   define YYMALLOC malloc
    00297 #   if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
    00298         && (defined (__STDC__) || defined (__cplusplus)))
    00299 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
    00300 #   endif
    00301 #  endif
    00302 #  ifndef YYFREE
    00303 #   define YYFREE free
    00304 #   if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
    00305         && (defined (__STDC__) || defined (__cplusplus)))
    00306 void free (void *); /* INFRINGES ON USER NAME SPACE */
    00307 #   endif
    00308 #  endif
    00309 #  ifdef __cplusplus
    00310 }
    00311 #  endif
    00312 # endif
    00313 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
    00314
    00315
    00316 #if (! defined (yyoverflow) \
    00317      && (! defined (__cplusplus) \
    00318          || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
    00319
    00320 /* A type that is properly aligned for any stack member.  */
    00321 union yyalloc
    00322 {
    00323   short int yyss;
    00324   YYSTYPE yyvs;
    00325   };
    00326
    00327 /* The size of the maximum gap between one aligned stack and the next.  */
    00328 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
    00329
    00330 /* The size of an array large to enough to hold all stacks, each with
    00331    N elements.  */
    00332 # define YYSTACK_BYTES(N) \
    00333      ((N) * (sizeof (short int) + sizeof (YYSTYPE))                     \
    00334       + YYSTACK_GAP_MAXIMUM)
    00335
    00336 /* Copy COUNT objects from FROM to TO.  The source and destination do
    00337    not overlap.  */
    00338 # ifndef YYCOPY
    00339 #  if defined (__GNUC__) && 1 < __GNUC__
    00340 #   define YYCOPY(To, From, Count) \
    00341       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
    00342 #  else
    00343 #   define YYCOPY(To, From, Count)              \
    00344       do                                        \
    00345         {                                       \
    00346           YYSIZE_T yyi;                         \
    00347           for (yyi = 0; yyi < (Count); yyi++)   \
    00348             (To)[yyi] = (From)[yyi];            \
    00349         }                                       \
    00350       while (0)
    00351 #  endif
    00352 # endif
    00353
    00354 /* Relocate STACK from its old location to the new one.  The
    00355    local variables YYSIZE and YYSTACKSIZE give the old and new number of
    00356    elements in the stack, and YYPTR gives the new location of the
    00357    stack.  Advance YYPTR to a properly aligned location for the next
    00358    stack.  */
    00359 # define YYSTACK_RELOCATE(Stack)                                        \
    00360     do                                                                  \
    00361       {                                                                 \
    00362         YYSIZE_T yynewbytes;                                            \
    00363         YYCOPY (&yyptr->Stack, Stack, yysize);                          \
    00364         Stack = &yyptr->Stack;                                          \
    00365         yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
    00366         yyptr += yynewbytes / sizeof (*yyptr);                          \
    00367       }                                                                 \
    00368     while (0)
    00369
    00370 #endif
    00371
    00372 #if defined (__STDC__) || defined (__cplusplus)
    00373    typedef signed char yysigned_char;
    00374 #else
    00375    typedef short int yysigned_char;
    00376 #endif
    00377
    00378 /* YYFINAL -- State number of the termination state. */
    00379 #define YYFINAL  3
    00380 /* YYLAST -- Last index in YYTABLE.  */
    00381 #define YYLAST   201
    00382
    00383 /* YYNTOKENS -- Number of terminals. */
    00384 #define YYNTOKENS  41
    00385 /* YYNNTS -- Number of nonterminals. */
    00386 #define YYNNTS  40
    00387 /* YYNRULES -- Number of rules. */
    00388 #define YYNRULES  92
    00389 /* YYNRULES -- Number of states. */
    00390 #define YYNSTATES  198
    00391
    00392 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
    00393 #define YYUNDEFTOK  2
    00394 #define YYMAXUTOK   287
    00395
    00396 #define YYTRANSLATE(YYX)                                                \
    00397   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
    00398
    00399 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
    00400 static const unsigned char yytranslate[] =
    00401 {
    00402        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00403        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00404        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00405        2,     2,     2,    36,     2,     2,     2,     2,     2,     2,
    00406       33,    34,     2,     2,     2,     2,     2,     2,     2,     2,
    00407        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00408       37,    35,    38,     2,     2,     2,     2,     2,     2,     2,
    00409        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00410        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00411        2,    39,     2,    40,     2,     2,     2,     2,     2,     2,
    00412        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00413        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00414        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00415        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00416        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00417        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00418        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00419        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00420        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00421        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00422        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00423        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00424        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00425        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00426        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    00427        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
    00428        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
    00429       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
    00430       25,    26,    27,    28,    29,    30,    31,    32
    00431 };
    00432
    00433 #if YYDEBUG
    00434 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
    00435    YYRHS.  */
    00436 static const unsigned short int yyprhs[] =
    00437 {
    00438        0,     0,     3,     4,     7,    14,    19,    24,    26,    28,
    00439       31,    33,    36,    41,    43,    45,    50,    52,    54,    56,
    00440       59,    61,    64,    73,    80,    86,    92,    98,   105,   112,
    00441      113,   116,   122,   123,   126,   129,   132,   134,   136,   138,
    00442      140,   142,   144,   146,   148,   150,   152,   154,   156,   158,
    00443      160,   162,   164,   166,   167,   170,   173,   181,   182,   185,
    00444      186,   189,   191,   195,   199,   203,   205,   215,   218,   220,
    00445      222,   226,   232,   243,   254,   267,   270,   275,   276,   279,
    00446      280,   288,   293,   295,   298,   303,   310,   311,   320,   322,
    00447      324,   326,   329
    00448 };
    00449
    00450 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
    00451 static const yysigned_char yyrhs[] =
    00452 {
    00453       42,     0,    -1,    -1,    43,    44,    -1,     5,    54,     7,
    00454       59,     8,    62,    -1,    25,    69,    70,    71,    -1,    33,
    00455       14,    47,    34,    -1,    45,    -1,    49,    -1,    33,    34,
    00456       -1,    49,    -1,    47,    49,    -1,    33,    15,    52,    34,
    00457       -1,    48,    -1,    53,    -1,    33,    14,    52,    34,    -1,
    00458       50,    -1,    48,    -1,    53,    -1,    33,    34,    -1,    53,
    00459       -1,    52,    53,    -1,    33,    16,    33,     3,    35,     3,
    00460       34,    34,    -1,    33,     3,    36,    35,     3,    34,    -1,
    00461       33,     3,    35,     3,    34,    -1,    33,     3,    37,     3,
    00462       34,    -1,    33,     3,    38,     3,    34,    -1,    33,     3,
    00463       37,    35,     3,    34,    -1,    33,     3,    38,    35,     3,
    00464       34,    -1,    -1,    54,    55,    -1,     6,     3,    33,    56,
    00465       34,    -1,    -1,    56,     3,    -1,    56,     4,    -1,    11,
    00466       58,    -1,     3,    -1,     4,    -1,     9,    -1,    10,    -1,
    00467       12,    -1,    13,    -1,    14,    -1,    15,    -1,    16,    -1,
    00468       17,    -1,    18,    -1,    19,    -1,    20,    -1,    21,    -1,
    00469       22,    -1,    23,    -1,    24,    -1,    -1,    59,    60,    -1,
    00470       59,    57,    -1,     9,     3,    12,     3,    13,     3,    61,
    00471       -1,    -1,    24,     4,    -1,    -1,    62,    63,    -1,    57,
    00472       -1,    33,    64,    34,    -1,    33,    65,    34,    -1,    33,
    00473       68,    34,    -1,    66,    -1,     3,    33,     3,    35,     3,
    00474       34,    10,     3,    66,    -1,    17,    67,    -1,    18,    -1,
    00475       46,    -1,    33,    47,    34,    -1,    33,    33,    52,    34,
    00476       34,    -1,    19,     3,    20,     3,    21,     3,    22,    18,
    00477       23,     4,    -1,    19,     3,    20,     3,    21,     3,    22,
    00478       51,    23,     4,    -1,    19,     3,    20,     3,    21,     3,
    00479       22,    33,    53,    34,    23,     4,    -1,    26,     3,    -1,
    00480       33,    27,    46,    34,    -1,    -1,    71,    72,    -1,    -1,
    00481       33,    28,     3,    73,    74,    75,    34,    -1,    33,    29,
    00482        4,    34,    -1,    76,    -1,    75,    76,    -1,    33,    30,
    00483        3,    34,    -1,    33,    31,     3,     3,    46,    34,    -1,
    00484       -1,    33,    32,     3,     3,    51,    77,    78,    34,    -1,
    00485        4,    -1,    79,    -1,    80,    -1,    79,    80,    -1,    39,
    00486        4,     4,    40,    -1
    00487 };
    00488
    00489 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
    00490 static const unsigned short int yyrline[] =
    00491 {
    00492        0,   110,   110,   110,   114,   116,   124,   130,   134,   143,
    00493      202,   211,   217,   223,   227,   252,   272,   276,   280,   289,
    00494      294,   303,   309,   322,   335,   348,   360,   371,   382,   400,
    00495      401,   404,   418,   425,   441,   461,   463,   467,   468,   469,
    00496      470,   471,   472,   473,   474,   475,   476,   477,   478,   479,
    00497      480,   481,   482,   484,   485,   486,   488,   541,   544,   549,
    00498      550,   552,   553,   554,   555,   558,   576,   619,   625,   632,
    00499      639,   649,   672,   687,   711,   739,   751,   762,   763,   766,
    00500      765,   784,   794,   795,   797,   803,   834,   832,   903,   907,
    00501      909,   910,   912
    00502 };
    00503 #endif
    00504
    00505 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
    00506 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
    00507    First, the terminals, then, starting at YYNTOKENS, nonterminals. */
    00508 static const char *const yytname[] =
    00509 {
    00510   "$end", "error", "$undefined", "TOK_NAME", "TOK_FLOAT",
    00511   "TOK_VARIABLE_DOMAIN_TYPE_DEFINITIONS", "TOK_VARIABLE_DOMAIN_TYPE",
    00512   "TOK_VARIABLE_DEFINITIONS", "TOK_MODEL_DEFINITIONS", "TOK_VARIABLE",
    00513   "TOK_TYPE", "TOK_INSTANCE", "TOK_OF_TYPE", "TOK_WITH_RANGE", "TOK_AND",
    00514   "TOK_OR", "TOK_NOT", "TOK_CONSTRAINTS", "TOK_NIL", "TOK_TRANSITION",
    00515   "TOK_FROM_VALUE", "TOK_TO_VALUE", "TOK_GUARD", "TOK_PROBABILITY",
    00516   "TOK_WITH_NUM", "TOK_CCAFILEV2", "TOK_INCLUDE",
    00517   "TOK_GLOBAL_STATE_CONSTRAINT", "TOK_STATE_VARIABLE_BINDING",
    00518   "TOK_TOPOLOGICAL_NUMBER", "TOK_STATE_CLOCK_VARIABLE",
    00519   "TOK_STATE_TYPE_AND_CONSTRAINT", "TOK_TRANSITION_GUARD_PROB", "'('",
    00520   "')'", "'='", "'!'", "'<'", "'>'", "'['", "']'", "$accept", "file", "@1",
    00521   "restOfFile", "gen_cnf_sentence_simple", "gen_cnf_sentence",
    00522   "gen_dj_clauses", "gen_dj_clause_simple", "gen_dj_clause",
    00523   "gen_cj_clause_simple", "gen_clause", "gen_assignments",
    00524   "gen_assignment", "domains", "domain", "domain_values", "instance",
    00525   "instanceSymbol", "variables", "variable", "get_tp_num", "models",
    00526   "model", "model_level_constraint", "state_constraint", "constraints_tag",
    00527   "constraints_or_nil", "transition", "baseModelInclude",
    00528   "globalConstraint", "statesBindings", "statesBinding", "@2",
    00529   "topologicalNumber", "bindings", "binding", "@3", "probability",
    00530   "probPieces", "probPiece", 0
    00531 };
    00532 #endif
    00533
    00534 # ifdef YYPRINT
    00535 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
    00536    token YYLEX-NUM.  */
    00537 static const unsigned short int yytoknum[] =
    00538 {
    00539        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
    00540      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
    00541      275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
    00542      285,   286,   287,    40,    41,    61,    33,    60,    62,    91,
    00543       93
    00544 };
    00545 # endif
    00546
    00547 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
    00548 static const unsigned char yyr1[] =
    00549 {
    00550        0,    41,    43,    42,    44,    44,    45,    46,    46,    46,
    00551       47,    47,    48,    49,    49,    50,    51,    51,    51,    51,
    00552       52,    52,    53,    53,    53,    53,    53,    53,    53,    54,
    00553       54,    55,    56,    56,    56,    57,    58,    58,    58,    58,
    00554       58,    58,    58,    58,    58,    58,    58,    58,    58,    58,
    00555       58,    58,    58,    59,    59,    59,    60,    61,    61,    62,
    00556       62,    63,    63,    63,    63,    64,    65,    66,    67,    67,
    00557       67,    67,    68,    68,    68,    69,    70,    71,    71,    73,
    00558       72,    74,    75,    75,    76,    76,    77,    76,    78,    78,
    00559       79,    79,    80
    00560 };
    00561
    00562 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
    00563 static const unsigned char yyr2[] =
    00564 {
    00565        0,     2,     0,     2,     6,     4,     4,     1,     1,     2,
    00566        1,     2,     4,     1,     1,     4,     1,     1,     1,     2,
    00567        1,     2,     8,     6,     5,     5,     5,     6,     6,     0,
    00568        2,     5,     0,     2,     2,     2,     1,     1,     1,     1,
    00569        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
    00570        1,     1,     1,     0,     2,     2,     7,     0,     2,     0,
    00571        2,     1,     3,     3,     3,     1,     9,     2,     1,     1,
    00572        3,     5,    10,    10,    12,     2,     4,     0,     2,     0,
    00573        7,     4,     1,     2,     4,     6,     0,     8,     1,     1,
    00574        1,     2,     4
    00575 };
    00576
    00577 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
    00578    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
    00579    means the default is an error.  */
    00580 static const unsigned char yydefact[] =
    00581 {
    00582        2,     0,     0,     1,    29,     0,     3,     0,     0,     0,
    00583        0,    53,    30,    75,     0,    77,     0,     0,     0,     5,
    00584       32,    59,     0,     0,    55,    54,     0,     7,     0,    13,
    00585        8,    14,     0,    78,     0,     4,     0,    36,    37,    38,
    00586       39,    40,    41,    42,    43,    44,    45,    46,    47,    48,
    00587       49,    50,    51,    52,    35,     0,     0,     0,     0,     9,
    00588       76,     0,    33,    34,    31,     0,    61,    60,     0,     0,
    00589        0,     0,     0,     0,     0,    10,     0,     0,    20,     0,
    00590       79,     0,     0,     0,     0,     0,    65,     0,     0,     0,
    00591        0,     0,     0,     0,     0,     6,    11,    12,    21,     0,
    00592        0,     0,    68,     0,    69,    67,     0,    62,    63,    64,
    00593        0,    24,     0,    25,     0,    26,     0,     0,     0,     0,
    00594        0,     0,     0,     0,    57,    23,    27,    28,     0,     0,
    00595        0,     0,    82,     0,     0,    70,     0,     0,    56,     0,
    00596        0,     0,     0,     0,    80,    83,     0,     0,     0,    58,
    00597       22,    81,     0,     0,     0,     0,    71,     0,    84,     0,
    00598        0,     0,     0,     0,     0,    17,    16,    86,    18,     0,
    00599        0,     0,     0,    85,     0,    19,     0,    66,     0,     0,
    00600        0,     0,    88,     0,     0,    89,    90,    72,     0,    73,
    00601       15,     0,    87,    91,     0,     0,    74,    92
    00602 };
    00603
    00604 /* YYDEFGOTO[NTERM-NUM]. */
    00605 static const short int yydefgoto[] =
    00606 {
    00607       -1,     1,     2,     6,    27,    28,    74,    29,    30,   166,
    00608      167,    77,    31,     7,    12,    34,    24,    54,    17,    25,
    00609      138,    35,    67,    84,    85,    86,   105,    87,     9,    15,
    00610       19,    33,   100,   119,   131,   132,   176,   184,   185,   186
    00611 };
    00612
    00613 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
    00614    STATE-NUM.  */
    00615 #define YYPACT_NINF -145
    00616 static const short int yypact[] =
    00617 {
    00618     -145,    33,    10,  -145,  -145,    21,  -145,    92,    62,    35,
    00619       99,  -145,  -145,  -145,    91,  -145,    71,    50,    86,    87,
    00620     -145,  -145,   118,    70,  -145,  -145,    14,  -145,    36,  -145,
    00621     -145,  -145,    94,  -145,     9,    23,    24,  -145,  -145,  -145,
    00622     -145,  -145,  -145,  -145,  -145,  -145,  -145,  -145,  -145,  -145,
    00623     -145,  -145,  -145,  -145,  -145,   -28,    90,    93,    95,  -145,
    00624     -145,   122,  -145,  -145,  -145,    43,  -145,  -145,   124,   126,
    00625       96,     2,     3,    60,    67,  -145,    51,    73,  -145,   127,
    00626     -145,   100,    39,   129,   101,   102,  -145,   103,   121,   104,
    00627      136,   106,   138,   108,   140,  -145,  -145,  -145,  -145,   109,
    00628      112,   143,  -145,     8,  -145,  -145,   128,  -145,  -145,  -145,
    00629      144,  -145,   115,  -145,   116,  -145,   117,   149,   125,   120,
    00630      123,    16,    75,   152,   132,  -145,  -145,  -145,   130,   153,
    00631       65,    77,  -145,   156,    79,  -145,   139,   157,  -145,   131,
    00632      133,   159,   160,   163,  -145,  -145,   134,   135,   167,  -145,
    00633     -145,  -145,   137,   169,   170,   164,  -145,   154,  -145,    86,
    00634      142,   174,    48,   145,    37,  -145,  -145,  -145,  -145,   161,
    00635      158,    11,   162,  -145,    93,  -145,     0,  -145,   176,   148,
    00636      179,    82,  -145,   180,   155,   147,  -145,  -145,   165,  -145,
    00637     -145,   183,  -145,  -145,   186,   151,  -145,  -145
    00638 };
    00639
    00640 /* YYPGOTO[NTERM-NUM].  */
    00641 static const short int yypgoto[] =
    00642 {
    00643     -145,  -145,  -145,  -145,  -145,   -81,    89,  -144,   -53,  -145,
    00644       31,  -119,   -57,  -145,  -145,  -145,   166,  -145,  -145,  -145,
    00645     -145,  -145,  -145,  -145,  -145,    25,  -145,  -145,  -145,  -145,
    00646     -145,  -145,  -145,  -145,  -145,    64,  -145,  -145,  -145,    12
    00647 };
    00648
    00649 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
    00650    positive, shift that token.  If negative, reduce the rule which
    00651    number is the opposite.  If zero, do what YYDEFACT says.
    00652    If YYTABLE_NINF, syntax error.  */
    00653 #define YYTABLE_NINF -1
    00654 static const unsigned char yytable[] =
    00655 {
    00656       78,   104,   134,    75,   182,    91,    93,    69,    70,    71,
    00657       72,    55,    62,    63,    55,     4,   165,    55,   165,    55,
    00658       98,    96,    56,    57,    58,   174,    57,    58,    56,    57,
    00659       58,    57,    58,     3,    23,     5,    68,    92,    94,   183,
    00660       55,   121,    59,    64,    76,   175,    81,     8,    59,    76,
    00661       75,   174,    57,    58,    55,   181,    65,   102,    21,    22,
    00662       82,    23,    83,    55,    78,    13,   170,    58,    14,    96,
    00663       60,   175,   103,    37,    38,    57,    58,    98,   163,    39,
    00664       40,   171,    41,    42,    43,    44,    45,    46,    47,    48,
    00665       49,    50,    51,    52,    53,   141,   142,   143,    10,    11,
    00666       73,    95,    16,   168,    20,   168,    76,    97,    73,   135,
    00667      130,   144,    76,   147,   179,    76,   190,    78,    18,    26,
    00668       32,    36,    61,    73,    98,    80,    76,    88,    79,    89,
    00669       99,    90,   106,   101,   110,   107,   108,   109,   111,   112,
    00670      113,   114,   115,   116,   117,   118,   120,   124,   123,   125,
    00671      126,   127,   128,   130,   129,   136,   137,   140,   133,   146,
    00672      148,   149,   152,   153,   139,   150,   154,   151,   155,   156,
    00673      157,   158,   159,   160,   161,   164,   162,   169,    82,   173,
    00674      187,   178,   188,   189,   191,   180,   183,   195,   194,   192,
    00675      196,   197,   122,   172,   177,   145,     0,   193,     0,     0,
    00676        0,    66
    00677 };
    00678
    00679 static const short int yycheck[] =
    00680 {
    00681       57,    82,   121,    56,     4,     3,     3,    35,    36,    37,
    00682       38,     3,     3,     4,     3,     5,   160,     3,   162,     3,
    00683       77,    74,    14,    15,    16,    14,    15,    16,    14,    15,
    00684       16,    15,    16,     0,    11,    25,    12,    35,    35,    39,
    00685        3,    33,    34,    34,    33,    34,     3,    26,    34,    33,
    00686      103,    14,    15,    16,     3,   174,    33,    18,     8,     9,
    00687       17,    11,    19,     3,   121,     3,    18,    16,    33,   122,
    00688       34,    34,    33,     3,     4,    15,    16,   134,   159,     9,
    00689       10,    33,    12,    13,    14,    15,    16,    17,    18,    19,
    00690       20,    21,    22,    23,    24,    30,    31,    32,     6,     7,
    00691       33,    34,     3,   160,    33,   162,    33,    34,    33,    34,
    00692       33,    34,    33,    34,   171,    33,    34,   174,    27,    33,
    00693       33,     3,    28,    33,   181,     3,    33,     3,    33,     3,
    00694        3,    35,     3,    33,    13,    34,    34,    34,    34,     3,
    00695       34,     3,    34,     3,    35,    33,     3,     3,    20,    34,
    00696       34,    34,     3,    33,    29,     3,    24,     4,    35,     3,
    00697       21,     4,     3,     3,    34,    34,     3,    34,    34,    34,
    00698        3,    34,     3,     3,    10,    33,    22,     3,    17,    34,
    00699        4,    23,    34,     4,     4,    23,    39,     4,    23,    34,
    00700        4,    40,   103,   162,   169,   131,    -1,   185,    -1,    -1,
    00701       -1,    35
    00702 };
    00703
    00704 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
    00705    symbol of state STATE-NUM.  */
    00706 static const unsigned char yystos[] =
    00707 {
    00708        0,    42,    43,     0,     5,    25,    44,    54,    26,    69,
    00709        6,     7,    55,     3,    33,    70,     3,    59,    27,    71,
    00710       33,     8,     9,    11,    57,    60,    33,    45,    46,    48,
    00711       49,    53,    33,    72,    56,    62,     3,     3,     4,     9,
    00712       10,    12,    13,    14,    15,    16,    17,    18,    19,    20,
    00713       21,    22,    23,    24,    58,     3,    14,    15,    16,    34,
    00714       34,    28,     3,     4,    34,    33,    57,    63,    12,    35,
    00715       36,    37,    38,    33,    47,    49,    33,    52,    53,    33,
    00716        3,     3,    17,    19,    64,    65,    66,    68,     3,     3,
    00717       35,     3,    35,     3,    35,    34,    49,    34,    53,     3,
    00718       73,    33,    18,    33,    46,    67,     3,    34,    34,    34,
    00719       13,    34,     3,    34,     3,    34,     3,    35,    33,    74,
    00720        3,    33,    47,    20,     3,    34,    34,    34,     3,    29,
    00721       33,    75,    76,    35,    52,    34,     3,    24,    61,    34,
    00722        4,    30,    31,    32,    34,    76,     3,    34,    21,     4,
    00723       34,    34,     3,     3,     3,    34,    34,     3,    34,     3,
    00724        3,    10,    22,    46,    33,    48,    50,    51,    53,     3,
    00725       18,    33,    51,    34,    14,    34,    77,    66,    23,    53,
    00726       23,    52,     4,    39,    78,    79,    80,     4,    34,     4,
    00727       34,     4,    34,    80,    23,     4,     4,    40
    00728 };
    00729
    00730 #define yyerrok         (yyerrstatus = 0)
    00731 #define yyclearin       (yychar = YYEMPTY)
    00732 #define YYEMPTY         (-2)
    00733 #define YYEOF           0
    00734
    00735 #define YYACCEPT        goto yyacceptlab
    00736 #define YYABORT         goto yyabortlab
    00737 #define YYERROR         goto yyerrorlab
    00738
    00739
    00740 /* Like YYERROR except do call yyerror.  This remains here temporarily
    00741    to ease the transition to the new meaning of YYERROR, for GCC.
    00742    Once GCC version 2 has supplanted version 1, this can go.  */
    00743
    00744 #define YYFAIL          goto yyerrlab
    00745
    00746 #define YYRECOVERING()  (!!yyerrstatus)
    00747
    00748 #define YYBACKUP(Token, Value)                                  \
    00749 do                                                              \
    00750   if (yychar == YYEMPTY && yylen == 1)                          \
    00751     {                                                           \
    00752       yychar = (Token);                                         \
    00753       yylval = (Value);                                         \
    00754       yytoken = YYTRANSLATE (yychar);                           \
    00755       YYPOPSTACK;                                               \
    00756       goto yybackup;                                            \
    00757     }                                                           \
    00758   else                                                          \
    00759     {                                                           \
    00760       yyerror (YY_("syntax error: cannot back up")); \
    00761       YYERROR;                                                  \
    00762     }                                                           \
    00763 while (0)
    00764
    00765
    00766 #define YYTERROR        1
    00767 #define YYERRCODE       256
    00768
    00769
    00770 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
    00771    If N is 0, then set CURRENT to the empty location which ends
    00772    the previous symbol: RHS[0] (always defined).  */
    00773
    00774 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
    00775 #ifndef YYLLOC_DEFAULT
    00776 # define YYLLOC_DEFAULT(Current, Rhs, N)                                \
    00777     do                                                                  \
    00778       if (N)                                                            \
    00779         {                                                               \
    00780           (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
    00781           (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
    00782           (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
    00783           (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
    00784         }                                                               \
    00785       else                                                              \
    00786         {                                                               \
    00787           (Current).first_line   = (Current).last_line   =              \
    00788             YYRHSLOC (Rhs, 0).last_line;                                \
    00789           (Current).first_column = (Current).last_column =              \
    00790             YYRHSLOC (Rhs, 0).last_column;                              \
    00791         }                                                               \
    00792     while (0)
    00793 #endif
    00794
    00795
    00796 /* YY_LOCATION_PRINT -- Print the location on the stream.
    00797    This macro was not mandated originally: define only if we know
    00798    we won't break user code: when these are the locations we know.  */
    00799
    00800 #ifndef YY_LOCATION_PRINT
    00801 # if YYLTYPE_IS_TRIVIAL
    00802 #  define YY_LOCATION_PRINT(File, Loc)                  \
    00803      fprintf (File, "%d.%d-%d.%d",                      \
    00804               (Loc).first_line, (Loc).first_column,     \
    00805               (Loc).last_line,  (Loc).last_column)
    00806 # else
    00807 #  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
    00808 # endif
    00809 #endif
    00810
    00811
    00812 /* YYLEX -- calling `yylex' with the right arguments.  */
    00813
    00814 #ifdef YYLEX_PARAM
    00815 # define YYLEX yylex (YYLEX_PARAM)
    00816 #else
    00817 # define YYLEX yylex ()
    00818 #endif
    00819
    00820 /* Enable debugging if requested.  */
    00821 #if YYDEBUG
    00822
    00823 # ifndef YYFPRINTF
    00824 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
    00825 #  define YYFPRINTF fprintf
    00826 # endif
    00827
    00828 # define YYDPRINTF(Args)                        \
    00829 do {                                            \
    00830   if (yydebug)                                  \
    00831     YYFPRINTF Args;                             \
    00832 } while (0)
    00833
    00834 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)          \
    00835 do {                                                            \
    00836   if (yydebug)                                                  \
    00837     {                                                           \
    00838       YYFPRINTF (stderr, "%s ", Title);                         \
    00839       yysymprint (stderr,                                       \
    00840                   Type, Value); \
    00841       YYFPRINTF (stderr, "\n");                                 \
    00842     }                                                           \
    00843 } while (0)
    00844
    00845 /*------------------------------------------------------------------.
    00846 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
    00847 | TOP (included).                                                   |
    00848 `------------------------------------------------------------------*/
    00849
    00850 #if defined (__STDC__) || defined (__cplusplus)
    00851 static void
    00852 yy_stack_print (short int *bottom, short int *top)
    00853 #else
    00854 static void
    00855 yy_stack_print (bottom, top)
    00856     short int *bottom;
    00857     short int *top;
    00858 #endif
    00859 {
    00860   YYFPRINTF (stderr, "Stack now");
    00861   for (/* Nothing. */; bottom <= top; ++bottom)
    00862     YYFPRINTF (stderr, " %d", *bottom);
    00863   YYFPRINTF (stderr, "\n");
    00864 }
    00865
    00866 # define YY_STACK_PRINT(Bottom, Top)                            \
    00867 do {                                                            \
    00868   if (yydebug)                                                  \
    00869     yy_stack_print ((Bottom), (Top));                           \
    00870 } while (0)
    00871
    00872
    00873 /*------------------------------------------------.
    00874 | Report that the YYRULE is going to be reduced.  |
    00875 `------------------------------------------------*/
    00876
    00877 #if defined (__STDC__) || defined (__cplusplus)
    00878 static void
    00879 yy_reduce_print (int yyrule)
    00880 #else
    00881 static void
    00882 yy_reduce_print (yyrule)
    00883     int yyrule;
    00884 #endif
    00885 {
    00886   int yyi;
    00887   unsigned long int yylno = yyrline[yyrule];
    00888   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ",
    00889              yyrule - 1, yylno);
    00890   /* Print the symbols being reduced, and their result.  */
    00891   for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
    00892     YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
    00893   YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]);
    00894 }
    00895
    00896 # define YY_REDUCE_PRINT(Rule)          \
    00897 do {                                    \
    00898   if (yydebug)                          \
    00899     yy_reduce_print (Rule);             \
    00900 } while (0)
    00901
    00902 /* Nonzero means print parse trace.  It is left uninitialized so that
    00903    multiple parsers can coexist.  */
    00904 int yydebug;
    00905 #else /* !YYDEBUG */
    00906 # define YYDPRINTF(Args)
    00907 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
    00908 # define YY_STACK_PRINT(Bottom, Top)
    00909 # define YY_REDUCE_PRINT(Rule)
    00910 #endif /* !YYDEBUG */
    00911
    00912
    00913 /* YYINITDEPTH -- initial size of the parser's stacks.  */
    00914 #ifndef YYINITDEPTH
    00915 # define YYINITDEPTH 200
    00916 #endif
    00917
    00918 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
    00919    if the built-in stack extension method is used).
    00920
    00921    Do not make this value too large; the results are undefined if
    00922    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
    00923    evaluated with infinite-precision integer arithmetic.  */
    00924
    00925 #ifndef YYMAXDEPTH
    00926 # define YYMAXDEPTH 10000
    00927 #endif
    00928
    00929
    00930
    00931 #if YYERROR_VERBOSE
    00932
    00933 # ifndef yystrlen
    00934 #  if defined (__GLIBC__) && defined (_STRING_H)
    00935 #   define yystrlen strlen
    00936 #  else
    00937 /* Return the length of YYSTR.  */
    00938 static YYSIZE_T
    00939 #   if defined (__STDC__) || defined (__cplusplus)
    00940 yystrlen (const char *yystr)
    00941 #   else
    00942 yystrlen (yystr)
    00943      const char *yystr;
    00944 #   endif
    00945 {
    00946   const char *yys = yystr;
    00947
    00948   while (*yys++ != '\0')
    00949     continue;
    00950
    00951   return yys - yystr - 1;
    00952 }
    00953 #  endif
    00954 # endif
    00955
    00956 # ifndef yystpcpy
    00957 #  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
    00958 #   define yystpcpy stpcpy
    00959 #  else
    00960 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
    00961    YYDEST.  */
    00962 static char *
    00963 #   if defined (__STDC__) || defined (__cplusplus)
    00964 yystpcpy (char *yydest, const char *yysrc)
    00965 #   else
    00966 yystpcpy (yydest, yysrc)
    00967      char *yydest;
    00968      const char *yysrc;
    00969 #   endif
    00970 {
    00971   char *yyd = yydest;
    00972   const char *yys = yysrc;
    00973
    00974   while ((*yyd++ = *yys++) != '\0')
    00975     continue;
    00976
    00977   return yyd - 1;
    00978 }
    00979 #  endif
    00980 # endif
    00981
    00982 # ifndef yytnamerr
    00983 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
    00984    quotes and backslashes, so that it's suitable for yyerror.  The
    00985    heuristic is that double-quoting is unnecessary unless the string
    00986    contains an apostrophe, a comma, or backslash (other than
    00987    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
    00988    null, do not copy; instead, return the length of what the result
    00989    would have been.  */
    00990 static YYSIZE_T
    00991 yytnamerr (char *yyres, const char *yystr)
    00992 {
    00993   if (*yystr == '"')
    00994     {
    00995       size_t yyn = 0;
    00996       char const *yyp = yystr;
    00997
    00998       for (;;)
    00999         switch (*++yyp)
    01000           {
    01001           case '\'':
    01002           case ',':
    01003             goto do_not_strip_quotes;
    01004
    01005           case '\\':
    01006             if (*++yyp != '\\')
    01007               goto do_not_strip_quotes;
    01008             /* Fall through.  */
    01009           default:
    01010             if (yyres)
    01011               yyres[yyn] = *yyp;
    01012             yyn++;
    01013             break;
    01014
    01015           case '"':
    01016             if (yyres)
    01017               yyres[yyn] = '\0';
    01018             return yyn;
    01019           }
    01020     do_not_strip_quotes: ;
    01021     }
    01022
    01023   if (! yyres)
    01024     return yystrlen (yystr);
    01025
    01026   return yystpcpy (yyres, yystr) - yyres;
    01027 }
    01028 # endif
    01029
    01030 #endif /* YYERROR_VERBOSE */
    01031
    01032
    01033
    01034 #if YYDEBUG
    01035 /*--------------------------------.
    01036 | Print this symbol on YYOUTPUT.  |
    01037 `--------------------------------*/
    01038
    01039 #if defined (__STDC__) || defined (__cplusplus)
    01040 static void
    01041 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
    01042 #else
    01043 static void
    01044 yysymprint (yyoutput, yytype, yyvaluep)
    01045     FILE *yyoutput;
    01046     int yytype;
    01047     YYSTYPE *yyvaluep;
    01048 #endif
    01049 {
    01050   /* Pacify ``unused variable'' warnings.  */
    01051   (void) yyvaluep;
    01052
    01053   if (yytype < YYNTOKENS)
    01054     YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
    01055   else
    01056     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
    01057
    01058
    01059 # ifdef YYPRINT
    01060   if (yytype < YYNTOKENS)
    01061     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
    01062 # endif
    01063   switch (yytype)
    01064     {
    01065       default:
    01066         break;
    01067     }
    01068   YYFPRINTF (yyoutput, ")");
    01069 }
    01070
    01071 #endif /* ! YYDEBUG */
    01072 /*-----------------------------------------------.
    01073 | Release the memory associated to this symbol.  |
    01074 `-----------------------------------------------*/
    01075
    01076 #if defined (__STDC__) || defined (__cplusplus)
    01077 static void
    01078 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
    01079 #else
    01080 static void
    01081 yydestruct (yymsg, yytype, yyvaluep)
    01082     const char *yymsg;
    01083     int yytype;
    01084     YYSTYPE *yyvaluep;
    01085 #endif
    01086 {
    01087   /* Pacify ``unused variable'' warnings.  */
    01088   (void) yyvaluep;
    01089
    01090   if (!yymsg)
    01091     yymsg = "Deleting";
    01092   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
    01093
    01094   switch (yytype)
    01095     {
    01096
    01097       default:
    01098         break;
    01099     }
    01100 }
    01101
    01102
    01103 /* Prevent warnings from -Wmissing-prototypes.  */
    01104
    01105 #ifdef YYPARSE_PARAM
    01106 # if defined (__STDC__) || defined (__cplusplus)
    01107 int yyparse (void *YYPARSE_PARAM);
    01108 # else
    01109 int yyparse ();
    01110 # endif
    01111 #else /* ! YYPARSE_PARAM */
    01112 #if defined (__STDC__) || defined (__cplusplus)
    01113 int yyparse (void);
    01114 #else
    01115 int yyparse ();
    01116 #endif
    01117 #endif /* ! YYPARSE_PARAM */
    01118
    01119
    01120
    01121 /* The look-ahead symbol.  */
    01122 int yychar;
    01123
    01124 /* The semantic value of the look-ahead symbol.  */
    01125 YYSTYPE yylval;
    01126
    01127 /* Number of syntax errors so far.  */
    01128 int yynerrs;
    01129
    01130
    01131
    01132 /*----------.
    01133 | yyparse.  |
    01134 `----------*/
    01135
    01136 #ifdef YYPARSE_PARAM
    01137 # if defined (__STDC__) || defined (__cplusplus)
    01138 int yyparse (void *YYPARSE_PARAM)
    01139 # else
    01140 int yyparse (YYPARSE_PARAM)
    01141   void *YYPARSE_PARAM;
    01142 # endif
    01143 #else /* ! YYPARSE_PARAM */
    01144 #if defined (__STDC__) || defined (__cplusplus)
    01145 int
    01146 yyparse (void)
    01147 #else
    01148 int
    01149 yyparse ()
    01150     ;
    01151 #endif
    01152 #endif
    01153 {
    01154
    01155   int yystate;
    01156   int yyn;
    01157   int yyresult;
    01158   /* Number of tokens to shift before error messages enabled.  */
    01159   int yyerrstatus;
    01160   /* Look-ahead token as an internal (translated) token number.  */
    01161   int yytoken = 0;
    01162
    01163   /* Three stacks and their tools:
    01164      `yyss': related to states,
    01165      `yyvs': related to semantic values,
    01166      `yyls': related to locations.
    01167
    01168      Refer to the stacks thru separate pointers, to allow yyoverflow
    01169      to reallocate them elsewhere.  */
    01170
    01171   /* The state stack.  */
    01172   short int yyssa[YYINITDEPTH];
    01173   short int *yyss = yyssa;
    01174   short int *yyssp;
    01175
    01176   /* The semantic value stack.  */
    01177   YYSTYPE yyvsa[YYINITDEPTH];
    01178   YYSTYPE *yyvs = yyvsa;
    01179   YYSTYPE *yyvsp;
    01180
    01181
    01182
    01183 #define YYPOPSTACK   (yyvsp--, yyssp--)
    01184
    01185   YYSIZE_T yystacksize = YYINITDEPTH;
    01186
    01187   /* The variables used to return semantic value and location from the
    01188      action routines.  */
    01189   YYSTYPE yyval;
    01190
    01191
    01192   /* When reducing, the number of symbols on the RHS of the reduced
    01193      rule.  */
    01194   int yylen;
    01195
    01196   YYDPRINTF ((stderr, "Starting parse\n"));
    01197
    01198   yystate = 0;
    01199   yyerrstatus = 0;
    01200   yynerrs = 0;
    01201   yychar = YYEMPTY;             /* Cause a token to be read.  */
    01202
    01203   /* Initialize stack pointers.
    01204      Waste one element of value and location stack
    01205      so that they stay on the same level as the state stack.
    01206      The wasted elements are never initialized.  */
    01207
    01208   yyssp = yyss;
    01209   yyvsp = yyvs;
    01210
    01211   goto yysetstate;
    01212
    01213 /*------------------------------------------------------------.
    01214 | yynewstate -- Push a new state, which is found in yystate.  |
    01215 `------------------------------------------------------------*/
    01216  yynewstate:
    01217   /* In all cases, when you get here, the value and location stacks
    01218      have just been pushed. so pushing a state here evens the stacks.
    01219      */
    01220   yyssp++;
    01221
    01222  yysetstate:
    01223   *yyssp = yystate;
    01224
    01225   if (yyss + yystacksize - 1 <= yyssp)
    01226     {
    01227       /* Get the current used size of the three stacks, in elements.  */
    01228       YYSIZE_T yysize = yyssp - yyss + 1;
    01229
    01230 #ifdef yyoverflow
    01231       {
    01232         /* Give user a chance to reallocate the stack. Use copies of
    01233            these so that the &'s don't force the real ones into
    01234            memory.  */
    01235         YYSTYPE *yyvs1 = yyvs;
    01236         short int *yyss1 = yyss;
    01237
    01238
    01239         /* Each stack pointer address is followed by the size of the
    01240            data in use in that stack, in bytes.  This used to be a
    01241            conditional around just the two extra args, but that might
    01242            be undefined if yyoverflow is a macro.  */
    01243         yyoverflow (YY_("memory exhausted"),
    01244                     &yyss1, yysize * sizeof (*yyssp),
    01245                     &yyvs1, yysize * sizeof (*yyvsp),
    01246
    01247                     &yystacksize);
    01248
    01249         yyss = yyss1;
    01250         yyvs = yyvs1;
    01251       }
    01252 #else /* no yyoverflow */
    01253 # ifndef YYSTACK_RELOCATE
    01254       goto yyexhaustedlab;
    01255 # else
    01256       /* Extend the stack our own way.  */
    01257       if (YYMAXDEPTH <= yystacksize)
    01258         goto yyexhaustedlab;
    01259       yystacksize *= 2;
    01260       if (YYMAXDEPTH < yystacksize)
    01261         yystacksize = YYMAXDEPTH;
    01262
    01263       {
    01264         short int *yyss1 = yyss;
    01265         union yyalloc *yyptr =
    01266           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
    01267         if (! yyptr)
    01268           goto yyexhaustedlab;
    01269         YYSTACK_RELOCATE (yyss);
    01270         YYSTACK_RELOCATE (yyvs);
    01271
    01272 #  undef YYSTACK_RELOCATE
    01273         if (yyss1 != yyssa)
    01274           YYSTACK_FREE (yyss1);
    01275       }
    01276 # endif
    01277 #endif /* no yyoverflow */
    01278
    01279       yyssp = yyss + yysize - 1;
    01280       yyvsp = yyvs + yysize - 1;
    01281
    01282
    01283       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
    01284                   (unsigned long int) yystacksize));
    01285
    01286       if (yyss + yystacksize - 1 <= yyssp)
    01287         YYABORT;
    01288     }
    01289
    01290   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
    01291
    01292   goto yybackup;
    01293
    01294 /*-----------.
    01295 | yybackup.  |
    01296 `-----------*/
    01297 yybackup:
    01298
    01299 /* Do appropriate processing given the current state.  */
    01300 /* Read a look-ahead token if we need one and don't already have one.  */
    01301 /* yyresume: */
    01302
    01303   /* First try to decide what to do without reference to look-ahead token.  */
    01304
    01305   yyn = yypact[yystate];
    01306   if (yyn == YYPACT_NINF)
    01307     goto yydefault;
    01308
    01309   /* Not known => get a look-ahead token if don't already have one.  */
    01310
    01311   /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
    01312   if (yychar == YYEMPTY)
    01313     {
    01314       YYDPRINTF ((stderr, "Reading a token: "));
    01315       yychar = YYLEX;
    01316     }
    01317
    01318   if (yychar <= YYEOF)
    01319     {
    01320       yychar = yytoken = YYEOF;
    01321       YYDPRINTF ((stderr, "Now at end of input.\n"));
    01322     }
    01323   else
    01324     {
    01325       yytoken = YYTRANSLATE (yychar);
    01326       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
    01327     }
    01328
    01329   /* If the proper action on seeing token YYTOKEN is to reduce or to
    01330      detect an error, take that action.  */
    01331   yyn += yytoken;
    01332   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
    01333     goto yydefault;
    01334   yyn = yytable[yyn];
    01335   if (yyn <= 0)
    01336     {
    01337       if (yyn == 0 || yyn == YYTABLE_NINF)
    01338         goto yyerrlab;
    01339       yyn = -yyn;
    01340       goto yyreduce;
    01341     }
    01342
    01343   if (yyn == YYFINAL)
    01344     YYACCEPT;
    01345
    01346   /* Shift the look-ahead token.  */
    01347   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
    01348
    01349   /* Discard the token being shifted unless it is eof.  */
    01350   if (yychar != YYEOF)
    01351     yychar = YYEMPTY;
    01352
    01353   *++yyvsp = yylval;
    01354
    01355
    01356   /* Count tokens shifted since error; after three, turn off error
    01357      status.  */
    01358   if (yyerrstatus)
    01359     yyerrstatus--;
    01360
    01361   yystate = yyn;
    01362   goto yynewstate;
    01363
    01364
    01365 /*-----------------------------------------------------------.
    01366 | yydefault -- do the default action for the current state.  |
    01367 `-----------------------------------------------------------*/
    01368 yydefault:
    01369   yyn = yydefact[yystate];
    01370   if (yyn == 0)
    01371     goto yyerrlab;
    01372   goto yyreduce;
    01373
    01374
    01375 /*-----------------------------.
    01376 | yyreduce -- Do a reduction.  |
    01377 `-----------------------------*/
    01378 yyreduce:
    01379   /* yyn is the number of a rule to reduce with.  */
    01380   yylen = yyr2[yyn];
    01381
    01382   /* If YYLEN is nonzero, implement the default value of the action:
    01383      `$$ = $1'.
    01384
    01385      Otherwise, the following line sets YYVAL to garbage.
    01386      This behavior is undocumented and Bison
    01387      users should not rely upon it.  Assigning to YYVAL
    01388      unconditionally makes the parser a bit smaller, and it avoids a
    01389      GCC warning that YYVAL may be used uninitialized.  */
    01390   yyval = yyvsp[1-yylen];
    01391
    01392
    01393   YY_REDUCE_PRINT (yyn);
    01394   switch (yyn)
    01395     {
    01396         case 2:
    01397 #line 110 "MOFReader.y"
    01398     {
    01399         MOFReaderLineNumber = 1;
    01400 ;}
    01401     break;
    01402
    01403   case 6:
    01404 #line 125 "MOFReader.y"
    01405     {
    01406         (yyval.sentence) = (yyvsp[-1].sentence);
    01407         (yyval.sentence)->setSentenceType(CCASentence::CNF);
    01408 ;}
    01409     break;
    01410
    01411   case 7:
    01412 #line 131 "MOFReader.y"
    01413     {
    01414         (yyval.sentence) = (yyvsp[0].sentence);
    01415 ;}
    01416     break;
    01417
    01418   case 8:
    01419 #line 135 "MOFReader.y"
    01420     {
    01421         (yyval.sentence) = new CCASentence(true, CCASentence::CNF);
    01422         if(!(yyval.sentence)){
    01423                 yyMOFReadererror("Unable to create a new sentence");
    01424                 YYERROR;
    01425         }
    01426         (yyval.sentence)->pushBack((yyvsp[0].clause));
    01427 ;}
    01428     break;
    01429
    01430   case 9:
    01431 #line 144 "MOFReader.y"
    01432     {
    01433         (yyval.sentence) = NULL;
    01434 ;}
    01435     break;
    01436
    01437   case 10:
    01438 #line 203 "MOFReader.y"
    01439     {
    01440         (yyval.sentence) = new CCASentence(true, CCASentence::CNF);
    01441         if(!(yyval.sentence)){
    01442                 yyMOFReadererror("Unable to create a new sentence");
    01443                 YYERROR;
    01444         }
    01445         (yyval.sentence)->pushBack((yyvsp[0].clause));
    01446 ;}
    01447     break;
    01448
    01449   case 11:
    01450 #line 212 "MOFReader.y"
    01451     {
    01452         (yyval.sentence) = (yyvsp[-1].sentence);
    01453         (yyval.sentence)->pushBack((yyvsp[0].clause));
    01454 ;}
    01455     break;
    01456
    01457   case 12:
    01458 #line 218 "MOFReader.y"
    01459     {
    01460         (yyval.clause) = (yyvsp[-1].clause);
    01461         (yyval.clause)->setClauseType(CCAClause::DISJUNCTIVE);
    01462 ;}
    01463     break;
    01464
    01465   case 13:
    01466 #line 224 "MOFReader.y"
    01467     {
    01468         (yyval.clause) = (yyvsp[0].clause);
    01469 ;}
    01470     break;
    01471
    01472   case 14:
    01473 #line 228 "MOFReader.y"
    01474     {
    01475         (yyval.clause) = new CCAClause(true, CCAClause::DISJUNCTIVE);
    01476         if(!(yyval.clause)){
    01477                 yyMOFReadererror("Unable to create a new sentence");
    01478                 YYERROR;
    01479         }
    01480         (yyval.clause)->pushBack((yyvsp[0].assignment));
    01481 ;}
    01482     break;
    01483
    01484   case 15:
    01485 #line 253 "MOFReader.y"
    01486     {
    01487         (yyval.clause) = (yyvsp[-1].clause);
    01488         (yyval.clause)->setClauseType(CCAClause::CONJUNCTIVE);
    01489 ;}
    01490     break;
    01491
    01492   case 16:
    01493 #line 273 "MOFReader.y"
    01494     {
    01495         (yyval.clause) = (yyvsp[0].clause);
    01496 ;}
    01497     break;
    01498
    01499   case 17:
    01500 #line 277 "MOFReader.y"
    01501     {
    01502         (yyval.clause) = (yyvsp[0].clause);
    01503 ;}
    01504     break;
    01505
    01506   case 18:
    01507 #line 281 "MOFReader.y"
    01508     {
    01509         (yyval.clause) = new CCAClause(true, CCAClause::DISJUNCTIVE);
    01510         if(!(yyval.clause)){
    01511                 yyMOFReadererror("Unable to create a new clause");
    01512                 YYERROR;
    01513         }
    01514         (yyval.clause)->pushBack((yyvsp[0].assignment));
    01515 ;}
    01516     break;
    01517
    01518   case 19:
    01519 #line 290 "MOFReader.y"
    01520     {
    01521         (yyval.clause) = NULL;
    01522 ;}
    01523     break;
    01524
    01525   case 20:
    01526 #line 295 "MOFReader.y"
    01527     {
    01528         (yyval.clause) = new CCAClause(true, CCAClause::CONJUNCTIVE);
    01529         if(!(yyval.clause)){
    01530                 yyMOFReadererror("Unable to create a new clause");
    01531                 YYERROR;
    01532         }
    01533         (yyval.clause)->pushBack((yyvsp[0].assignment));
    01534 ;}
    01535     break;
    01536
    01537   case 21:
    01538 #line 304 "MOFReader.y"
    01539     {
    01540         (yyval.clause) = (yyvsp[-1].clause);
    01541         (yyval.clause)->pushBack((yyvsp[0].assignment));
    01542 ;}
    01543     break;
    01544
    01545   case 22:
    01546 #line 310 "MOFReader.y"
    01547     {
    01548         (yyval.assignment) = myCCAModel->getAssignment((yyvsp[-4].str)->c_str(), (yyvsp[-2].str)->c_str(),
    01549                 CCAAssignment::Negative);
    01550         if(!(yyval.assignment)){
    01551                 yyMOFReadererror("Unable to find assignment");
    01552                 fprintf(stderr, "Assignment between %s and %s was not possible\n",
    01553                         (yyvsp[-4].str)->c_str(), (yyvsp[-2].str)->c_str());
    01554                 YYERROR;
    01555         }
    01556         delete (yyvsp[-4].str);
    01557         delete (yyvsp[-2].str);
    01558 ;}
    01559     break;
    01560
    01561   case 23:
    01562 #line 323 "MOFReader.y"
    01563     {
    01564         (yyval.assignment) = myCCAModel->getAssignment((yyvsp[-4].str)->c_str(), (yyvsp[-1].str)->c_str(),
    01565                 CCAAssignment::NotEqualTo);
    01566         if(!(yyval.assignment)){
    01567                 yyMOFReadererror("Unable to find assignment");
    01568                 fprintf(stderr, "Assignment between %s and %s was not possible\n",
    01569                         (yyvsp[-4].str)->c_str(), (yyvsp[-1].str)->c_str());
    01570                 YYERROR;
    01571         }
    01572         delete (yyvsp[-4].str);
    01573         delete (yyvsp[-1].str);
    01574 ;}
    01575     break;
    01576
    01577   case 24:
    01578 #line 336 "MOFReader.y"
    01579     {
    01580         (yyval.assignment) = myCCAModel->getAssignment((yyvsp[-3].str)->c_str(), (yyvsp[-1].str)->c_str(),
    01581                 CCAAssignment::Positive);
    01582         if(!(yyval.assignment)){
    01583                 yyMOFReadererror("Unable to find assignment");
    01584                 fprintf(stderr, "Assignment between %s and %s was not possible\n",
    01585                         (yyvsp[-3].str)->c_str(), (yyvsp[-1].str)->c_str());
    01586                 YYERROR;
    01587         }
    01588         delete (yyvsp[-3].str);
    01589         delete (yyvsp[-1].str);
    01590 ;}
    01591     break;
    01592
    01593   case 25:
    01594 #line 349 "MOFReader.y"
    01595     {
    01596         (yyval.assignment) = myCCAModel->getAssignment((yyvsp[-3].str)->c_str(), (yyvsp[-1].str)->c_str(),
    01597                 CCAAssignment::LessThan);
    01598         if(!(yyval.assignment)){
    01599                 yyMOFReadererror("Unable to find assignment");
    01600                 fprintf(stderr, "Assignment between %s and %s was not possible\n", (yyvsp[-3].str)->c_str(), (yyvsp[-1].str)->c_str());
    01601                 YYERROR;
    01602         }
    01603         delete (yyvsp[-3].str);
    01604         delete (yyvsp[-1].str);
    01605 ;}
    01606     break;
    01607
    01608   case 26:
    01609 #line 361 "MOFReader.y"
    01610     {
    01611         (yyval.assignment) = myCCAModel->getAssignment((yyvsp[-3].str)->c_str(), (yyvsp[-1].str)->c_str(), CCAAssignment::GreaterThan);
    01612         if(!(yyval.assignment)){
    01613                 yyMOFReadererror("Unable to find assignment");
    01614                 fprintf(stderr, "Assignment between %s and %s was not possible\n", (yyvsp[-3].str)->c_str(), (yyvsp[-1].str)->c_str());
    01615                 YYERROR;
    01616         }
    01617         delete (yyvsp[-3].str);
    01618         delete (yyvsp[-1].str);
    01619 ;}
    01620     break;
    01621
    01622   case 27:
    01623 #line 372 "MOFReader.y"
    01624     {
    01625         (yyval.assignment) = myCCAModel->getAssignment((yyvsp[-4].str)->c_str(), (yyvsp[-1].str)->c_str(), CCAAssignment::LessThanOrEqualTo);
    01626         if(!(yyval.assignment)){
    01627                 yyMOFReadererror("Unable to find assignment");
    01628                 fprintf(stderr, "Assignment between %s and %s was not possible\n", (yyvsp[-4].str)->c_str(), (yyvsp[-1].str)->c_str());
    01629                 YYERROR;
    01630         }
    01631         delete (yyvsp[-4].str);
    01632         delete (yyvsp[-1].str);
    01633 ;}
    01634     break;
    01635
    01636   case 28:
    01637 #line 383 "MOFReader.y"
    01638     {
    01639         (yyval.assignment) = myCCAModel->getAssignment((yyvsp[-4].str)->c_str(), (yyvsp[-1].str)->c_str(), CCAAssignment::GreaterThanOrEqualTo);
    01640         if(!(yyval.assignment)){
    01641                 yyMOFReadererror("Unable to find assignment");
    01642                 fprintf(stderr, "Assignment between %s and %s was not possible\n", (yyvsp[-4].str)->c_str(), (yyvsp[-1].str)->c_str());
    01643                 YYERROR;
    01644         }
    01645         delete (yyvsp[-4].str);
    01646         delete (yyvsp[-1].str);
    01647 ;}
    01648     break;
    01649
    01650   case 31:
    01651 #line 405 "MOFReader.y"
    01652     {
    01653 #ifdef VERBOSE
    01654   cout << "Domain_def: domain defined for " << *((yyvsp[-3].str)) << endl;
    01655   //cout << "Inserting Domain values:" << endl
    01656   //     << *($4) << endl
    01657   //     << "into the domain name \"" << *($2) << "\" in myCCAModel" << endl;
    01658 #endif
    01659   myCCAModel->addDomain((yyvsp[-3].str)->c_str(), *((yyvsp[-1].val)));
    01660   delete (yyvsp[-3].str);
    01661   delete (yyvsp[-1].val);
    01662 ;}
    01663     break;
    01664
    01665   case 32:
    01666 #line 418 "MOFReader.y"
    01667     {
    01668         (yyval.val) = new BaseModelValueArray(true);
    01669         if(!(yyval.val)){
    01670                 yyMOFReadererror("Unable to create a new value list");
    01671                 YYERROR;
    01672         }
    01673 ;}
    01674     break;
    01675
    01676   case 33:
    01677 #line 426 "MOFReader.y"
    01678     {
    01679 #ifdef VERBOSE
    01680   //cout << "Adding \"" << *($2) << "\" to the domain" << endl;
    01681 #endif
    01682   (yyval.val) = (yyvsp[-1].val);
    01683         {
    01684                 CCAValue * val = new CCAValue((yyvsp[0].str)->c_str());
    01685                 if(!val){
    01686                         yyMOFReadererror("Unable to create a new value");
    01687                         YYERROR;
    01688                 }
    01689                 (yyval.val)->pushBack(val);
    01690         }
    01691   delete (yyvsp[0].str);
    01692 ;}
    01693     break;
    01694
    01695   case 34:
    01696 #line 442 "MOFReader.y"
    01697     {
    01698 #ifdef VERBOSE
    01699   //cout << "Adding \"" << *($2) << "\" to the domain" << endl;
    01700 #endif
    01701   (yyval.val) = (yyvsp[-1].val);
    01702         {
    01703                 char buf[24];
    01704                 sprintf(buf, "%f", (yyvsp[0].flt));
    01705                 CCAValue * val = new CCAValue(buf);
    01706                 if(!val){
    01707                         yyMOFReadererror("Unable to create a new value");
    01708                         YYERROR;
    01709                 }
    01710                 (yyval.val)->pushBack(val);
    01711         }
    01712 ;}
    01713     break;
    01714
    01715   case 36:
    01716 #line 464 "MOFReader.y"
    01717     {
    01718   delete (yyvsp[0].str);
    01719 ;}
    01720     break;
    01721
    01722   case 37:
    01723 #line 467 "MOFReader.y"
    01724     {;}
    01725     break;
    01726
    01727   case 56:
    01728 #line 490 "MOFReader.y"
    01729     {
    01730 #ifdef VERBOSE
    01731   cout << "Variable: Adding variable " << *((yyvsp[-5].str)) << endl;
    01732 #endif
    01733   //cout << "Adding variable \"" << *($2) << "\" to myCCAModel" << endl
    01734   //     << "   with type " << *($4) << " and domain \"" << *($6)
    01735   //     << "\"" << endl;
    01736         {
    01737                 CCAVariable::VariableType varType;
    01738
    01739                 if(FAILED(CCAVariable::stringToVariableType((yyvsp[-3].str)->c_str(), varType))){
    01740                         yyMOFReadererror("Variable Type not found");
    01741                         fprintf(stderr, "Unable to convert %s into a valid variable type\n",
    01742                                                         (yyvsp[-3].str)->c_str());
    01743                         fprintf(stderr, "If it should be valid, check that it has been\n");
    01744                         fprintf(stderr, "added to BaseModelVariable::stringToVariableType()\n");
    01745                         YYERROR;
    01746                 }
    01747
    01748                 CCADomain * domain = myCCAModel->getDomain((yyvsp[-1].str)->c_str());
    01749
    01750                 if(NULL == domain){
    01751                         yyMOFReadererror("Error locating domain");
    01752                         fprintf(stderr, "Unable to find the domain %s\n", (yyvsp[-1].str)->c_str());
    01753                         YYERROR;
    01754                 }
    01755
    01756                 char const * variableName = (yyvsp[-5].str)->c_str();
    01757
    01758                 if(FAILED(((BaseModel *) myCCAModel)->addVariable(
    01759                                 variableName, varType, domain))){
    01760                         yyMOFReadererror("Error adding variable");
    01761                         fprintf(stderr, "Unable to add the variable %s\n", (yyvsp[-5].str)->c_str());
    01762                         YYERROR;
    01763                 }
    01764
    01765                 if(varType == CCAVariable::State){
    01766                         if(FAILED(myCCAModel->addAutomaton(*((yyvsp[-5].str)), (yyvsp[0].i)))){
    01767                                 yyMOFReadererror("Error adding automaton");
    01768                                 fprintf(stderr, "An automaton for variable %s could not be added\n",
    01769                                                                 (yyvsp[-5].str)->c_str());
    01770                                 YYERROR;
    01771                         }
    01772                 }
    01773         }
    01774   delete (yyvsp[-5].str);
    01775   delete (yyvsp[-3].str);
    01776   delete (yyvsp[-1].str);
    01777 ;}
    01778     break;
    01779
    01780   case 57:
    01781 #line 541 "MOFReader.y"
    01782     {
    01783         (yyval.i) = 0;
    01784 ;}
    01785     break;
    01786
    01787   case 58:
    01788 #line 545 "MOFReader.y"
    01789     {
    01790         (yyval.i) = (int)(yyvsp[0].flt);
    01791 ;}
    01792     break;
    01793
    01794   case 65:
    01795 #line 559 "MOFReader.y"
    01796     {
    01797 #ifdef VERBOSE
    01798   cout << "model_level_constraint: Global constraint added" << endl;
    01799 #endif
    01800   if((yyvsp[0].sentence) != NULL){
    01801     myCCAModel->insert_global_constraint(*((yyvsp[0].sentence)));
    01802     delete (yyvsp[0].sentence);
    01803   }
    01804 ;}
    01805     break;
    01806
    01807   case 66:
    01808 #line 578 "MOFReader.y"
    01809     {
    01810   if(!(*((yyvsp[-8].str)) == "STATE"))
    01811   {
    01812     yyMOFReadererror("State Constraint::ERROR first token was not STATE");
    01813     YYERROR;
    01814   }
    01815 #ifdef VERBOSE
    01816   cout << "State Constraint: " << *((yyvsp[-6].str)) << " = " << *((yyvsp[-4].str)) << endl;
    01817   //cout << "For state \"" << *($3) << "\" set to value \"" << *($5)
    01818   //     << '\"' << endl
    01819   //     << "    Type = " << *($8) << endl
    01820   //     << "    Constraint = " << *($9) << endl;
    01821 #endif
    01822         {
    01823                 CCAState::StateType stateType;
    01824                 if(FAILED(CCAState::stringToStateType(((yyvsp[-1].str))->c_str(), stateType))){
    01825                         yyMOFReadererror("State type unrecognized");
    01826                         fprintf(stderr, "%s is not a valid state type\n", (yyvsp[-1].str)->c_str());
    01827                         fprintf(stderr,
    01828                                                         "Perhaps CCAState::stringToStateType has not been updated\n");
    01829                         YYERROR;
    01830                 }
    01831
    01832                 if(myCCAModel->set_state_type(*((yyvsp[-6].str)), *((yyvsp[-4].str)), stateType) == false){
    01833                         yyMOFReadererror("Unable to set state type");
    01834                         fprintf(stderr, "Could not set the type of the state (%s = %s)\n",
    01835                                 (yyvsp[-6].str)->c_str(), (yyvsp[-4].str)->c_str());
    01836                         YYERROR;
    01837                 }
    01838         }
    01839
    01840   if((yyvsp[0].sentence) != NULL){
    01841     myCCAModel->set_state_constraint(*((yyvsp[-6].str)), *((yyvsp[-4].str)), *((yyvsp[0].sentence)));
    01842     delete (yyvsp[0].sentence);
    01843   }
    01844   delete (yyvsp[-8].str);
    01845   delete (yyvsp[-6].str);
    01846   delete (yyvsp[-4].str);
    01847   delete (yyvsp[-1].str);
    01848 ;}
    01849     break;
    01850
    01851   case 67:
    01852 #line 620 "MOFReader.y"
    01853     {
    01854   //*($$) = temp_sentance;
    01855   (yyval.sentence) = (yyvsp[0].sentence);
    01856 ;}
    01857     break;
    01858
    01859   case 68:
    01860 #line 626 "MOFReader.y"
    01861     {
    01862 #ifdef VERBOSE
    01863   cout << "Constraint or nil: NIL" << endl;
    01864 #endif
    01865         (yyval.sentence) = NULL;
    01866 ;}
    01867     break;
    01868
    01869   case 69:
    01870 #line 633 "MOFReader.y"
    01871     {
    01872 #ifdef VERBOSE
    01873   cout << "Constraint or nil: Constraint" << endl;
    01874 #endif
    01875   (yyval.sentence) = (yyvsp[0].sentence);
    01876 ;}
    01877     break;
    01878
    01879   case 70:
    01880 #line 640 "MOFReader.y"
    01881     {
    01882 #ifdef VERBOSE
    01883   cout << "Constraint or nil: Constraint" << endl;
    01884 #endif
    01885         if((yyvsp[-1].sentence) != NULL){
    01886                 (yyvsp[-1].sentence)->setSentenceType(CCASentence::CNF);
    01887         }
    01888         (yyval.sentence) = (yyvsp[-1].sentence);
    01889 ;}
    01890     break;
    01891
    01892   case 71:
    01893 #line 650 "MOFReader.y"
    01894     {
    01895 #ifdef VERBOSE
    01896   cout << "Constraint or nil: Constraint" << endl;
    01897 #endif
    01898         {
    01899                 if((yyvsp[-2].clause) != NULL){
    01900                         CCAClause * clause = (yyvsp[-2].clause);
    01901                         clause->setClauseType(CCAClause::DISJUNCTIVE);
    01902                         CCASentence * sentence = new CCASentence(true, CCASentence::CNF);
    01903                         if(!sentence){
    01904                                 yyMOFReadererror("Unable to create a new sentence\n");
    01905                                 YYERROR;
    01906                         }
    01907                         // clause gets deleted by sentence
    01908                         sentence->pushBack(clause);
    01909                         (yyval.sentence) = sentence;
    01910                 }else{
    01911                         (yyval.sentence) = NULL;
    01912                 }
    01913         }
    01914 ;}
    01915     break;
    01916
    01917   case 72:
    01918 #line 674 "MOFReader.y"
    01919     {
    01920 #ifdef VERBOSE
    01921         cout << "Transition: State(" << *((yyvsp[-8].str)) << ") ("
    01922                 << *((yyvsp[-6].str)) << ")->(" << *((yyvsp[-4].str)) << ")" << endl;
    01923 #endif
    01924         {
    01925                 CCAClause clause(CCAClause::CONJUNCTIVE);
    01926                 myCCAModel->insert_transition(*((yyvsp[-8].str)), *((yyvsp[-6].str)), *((yyvsp[-4].str)), clause, (yyvsp[0].flt));
    01927         }
    01928         delete (yyvsp[-8].str);
    01929         delete (yyvsp[-6].str);
    01930         delete (yyvsp[-4].str);
    01931 ;}
    01932     break;
    01933
    01934   case 73:
    01935 #line 689 "MOFReader.y"
    01936     {
    01937 #ifdef VERBOSE
    01938         cout << "Transition: State(" << *((yyvsp[-8].str)) << ") ("
    01939                 << *((yyvsp[-6].str)) << ")->(" << *((yyvsp[-4].str)) << ")" << endl;
    01940         //cout << "Transition for state \"" << *($2) << "\" from \""
    01941         //     << *($4) << "\" to \"" << *($6) << "\"" << endl
    01942         //     << "   Guard = " << *($8) << endl
    01943         //     << "   Prob = " << $10 << endl;
    01944 #endif
    01945         {
    01946                 if((yyvsp[-2].clause) != NULL){
    01947                         myCCAModel->insert_transition(*((yyvsp[-8].str)), *((yyvsp[-6].str)), *((yyvsp[-4].str)), *((yyvsp[-2].clause)), (yyvsp[0].flt));
    01948                         delete (yyvsp[-2].clause);
    01949                 }else{
    01950                         CCAClause clause(CCAClause::CONJUNCTIVE);
    01951                         myCCAModel->insert_transition(*((yyvsp[-8].str)), *((yyvsp[-6].str)), *((yyvsp[-4].str)), clause, (yyvsp[0].flt));
    01952                 }
    01953         }
    01954         delete (yyvsp[-8].str);
    01955         delete (yyvsp[-6].str);
    01956         delete (yyvsp[-4].str);
    01957 ;}
    01958     break;
    01959
    01960   case 74:
    01961 #line 713 "MOFReader.y"
    01962     {
    01963 #ifdef VERBOSE
    01964         cout << "Transition: State(" << *((yyvsp[-10].str)) << ") ("
    01965                 << *((yyvsp[-8].str)) << ")->(" << *((yyvsp[-6].str)) << ")" << endl;
    01966         //cout << "Transition for state \"" << *($2) << "\" from \""
    01967         //     << *($4) << "\" to \"" << *($6) << "\"" << endl
    01968         //     << "   Guard = " << *($8) << endl
    01969         //     << "   Prob = " << $10 << endl;
    01970 #endif
    01971   {
    01972                 CCAClause clause(CCAClause::CONJUNCTIVE);
    01973                 if((yyvsp[-3].assignment) != NULL){
    01974                         // clause will delete this when it's deleted
    01975                         clause.pushBack((yyvsp[-3].assignment));
    01976                 }
    01977                 myCCAModel->insert_transition(*((yyvsp[-10].str)), *((yyvsp[-8].str)), *((yyvsp[-6].str)), clause, (yyvsp[0].flt));
    01978         }
    01979         delete (yyvsp[-10].str);
    01980         delete (yyvsp[-8].str);
    01981         delete (yyvsp[-6].str);
    01982 ;}
    01983     break;
    01984
    01985   case 75:
    01986 #line 740 "MOFReader.y"
    01987     {
    01988         fprintf(stderr, "Warning, looking for Base Model file from the current directory\n");
    01989         if(FAILED(BaseModelReader::loadBaseModel((yyvsp[0].str)->c_str(), (BaseModel *&) myCCAModel))){
    01990                 yyMOFReadererror("Error with loading Base Model Data");
    01991                 fprintf(stderr, "Error, unable to load the Base Model File:\n%s\n", (yyvsp[0].str)->c_str());
    01992                 delete (yyvsp[0].str);
    01993                 YYERROR;
    01994         }
    01995         delete (yyvsp[0].str);
    01996 ;}
    01997     break;
    01998
    01999   case 76:
    02000 #line 752 "MOFReader.y"
    02001     {
    02002 #ifdef VERBOSE
    02003   cout << "model_level_constraint: Global constraint added" << endl;
    02004 #endif
    02005   if((yyvsp[-1].sentence) != NULL){
    02006     myCCAModel->insert_global_constraint(*((yyvsp[-1].sentence)));
    02007     delete (yyvsp[-1].sentence);
    02008   }
    02009 ;}
    02010     break;
    02011
    02012   case 79:
    02013 #line 766 "MOFReader.y"
    02014     {
    02015         activeVariable = myCCAModel->getVariable((yyvsp[0].str)->c_str());
    02016         if(activeVariable == NULL){
    02017                 cout << "Unable to find the state variable: " << *((yyvsp[0].str)) << endl;
    02018                 yyMOFReadererror("Unknown Variable");
    02019                 YYERROR;
    02020         }
    02021         if(activeVariable->getVariableType() != CCAVariable::State){
    02022                 cout << "Error, not a state variable: " << *activeVariable << endl;
    02023                 yyMOFReadererror("Cannot bind states to non-state variables");
    02024                 YYERROR;
    02025         }
    02026         delete (yyvsp[0].str);
    02027 ;}
    02028     break;
    02029
    02030   case 80:
    02031 #line 780 "MOFReader.y"
    02032     {
    02033         activeVariable = NULL;
    02034 ;}
    02035     break;
    02036
    02037   case 81:
    02038 #line 785 "MOFReader.y"
    02039     {
    02040         if(FAILED(myCCAModel->addAutomaton(activeVariable, (int)(yyvsp[-1].flt)))){
    02041                 yyMOFReadererror("Error adding automaton");
    02042                 fprintf(stderr, "An automaton for variable %s could not be added\n",
    02043                                                 activeVariable->getName());
    02044                 YYERROR;
    02045         }
    02046 ;}
    02047     break;
    02048
    02049   case 84:
    02050 #line 798 "MOFReader.y"
    02051     {
    02052         fprintf(stderr, "Ignoring Clock Variable binding between\n"
    02053                 "State %s and Clock %s\n", activeVariable->getName(), (yyvsp[-1].str)->c_str());
    02054         delete (yyvsp[-1].str);
    02055 ;}
    02056     break;
    02057
    02058   case 85:
    02059 #line 805 "MOFReader.y"
    02060     {
    02061         {
    02062                 CCAState::StateType stateType;
    02063                 String aVarName(activeVariable->getName());
    02064                 if(FAILED(CCAState::stringToStateType(((yyvsp[-2].str))->c_str(), stateType))){
    02065                         yyMOFReadererror("State type unrecognized");
    02066                         fprintf(stderr, "%s is not a valid state type\n", (yyvsp[-2].str)->c_str());
    02067                         fprintf(stderr,
    02068                                                         "Perhaps CCAState::stringToStateType has not been updated\n");
    02069                         YYERROR;
    02070                 }
    02071
    02072                 if(myCCAModel->set_state_type(aVarName, *((yyvsp[-3].str)), stateType) == false){
    02073                         yyMOFReadererror("Unable to set state type");
    02074                         fprintf(stderr, "Could not set the type of the state (%s = %s)\n",
    02075                                 activeVariable->getName(), (yyvsp[-3].str)->c_str());
    02076                         YYERROR;
    02077                 }
    02078
    02079                 if((yyvsp[-1].sentence) != NULL){
    02080                         myCCAModel->set_state_constraint(aVarName, *((yyvsp[-3].str)), *((yyvsp[-1].sentence)));
    02081                         delete (yyvsp[-1].sentence);
    02082                 }
    02083         }
    02084         delete (yyvsp[-3].str);
    02085         delete (yyvsp[-2].str);
    02086 ;}
    02087     break;
    02088
    02089   case 86:
    02090 #line 834 "MOFReader.y"
    02091     {
    02092         {
    02093                 CCAAutomaton const * automaton =
    02094                         myCCAModel->get_automaton_p(*activeVariable);
    02095
    02096                 if(automaton == NULL){
    02097                         yyMOFReadererror("Automaton not found");
    02098                         fprintf(stderr, "Error, variable %s did not have an automaton\n",
    02099                                 activeVariable->getName());
    02100                         YYERROR;
    02101                 }
    02102
    02103                 CCAValue * fromValue = activeVariable->getValue((yyvsp[-2].str)->c_str());
    02104                 CCAValue * toValue = activeVariable->getValue((yyvsp[-1].str)->c_str());
    02105
    02106                 if(fromValue == NULL){
    02107                         yyMOFReadererror("State Value not found");
    02108                         fprintf(stderr, "Unable to find value %s in variable %s\n",
    02109                                                         (yyvsp[-2].str)->c_str(), activeVariable->getName());
    02110                         YYERROR;
    02111                 }
    02112
    02113                 if(toValue == NULL){
    02114                         yyMOFReadererror("State Value not found");
    02115                         fprintf(stderr, "Unable to find value %s in variable %s\n",
    02116                                                         (yyvsp[-2].str)->c_str(), activeVariable->getName());
    02117                         YYERROR;
    02118                 }
    02119
    02120                 CCAState const * fromState = automaton->state_p(*fromValue);
    02121                 CCAState const * toState = automaton->state_p(*toValue);
    02122
    02123                 if(NULL == fromState){
    02124                         yyMOFReadererror("State not found");
    02125                         fprintf(stderr, "Unable to find the state %s in automaton %s\n",
    02126                                                         (yyvsp[-2].str)->c_str(), activeVariable->getName());
    02127                         YYERROR;
    02128                 }
    02129
    02130                 if(NULL == toState){
    02131                         yyMOFReadererror("State Value not found");
    02132                         fprintf(stderr, "Unable to find the state %s in automaton %s\n",
    02133                                                         (yyvsp[-1].str)->c_str(), activeVariable->getName());
    02134                         YYERROR;
    02135                 }
    02136
    02137                 if((yyvsp[0].clause) != NULL){
    02138                         activeTransition = new CCATransition(*fromState, *toState, *((yyvsp[0].clause)));
    02139                 }else{
    02140                         CCAClause clause(CCAClause::CONJUNCTIVE);
    02141                         activeTransition = new CCATransition(*fromState, *toState, clause);
    02142                 }
    02143
    02144                 if(activeTransition == NULL){
    02145                         yyMOFReadererror("Unable to create new transition");
    02146                         YYERROR;
    02147                 }
    02148         }
    02149         delete (yyvsp[-2].str);
    02150         delete (yyvsp[-1].str);
    02151 ;}
    02152     break;
    02153
    02154   case 87:
    02155 #line 895 "MOFReader.y"
    02156     {
    02157         if(FAILED(myCCAModel->addTransition(activeTransition))){
    02158                 yyMOFReadererror("Unable to add a transition into the model");
    02159                 YYERROR;
    02160         }
    02161         activeTransition = NULL;
    02162 ;}
    02163     break;
    02164
    02165   case 88:
    02166 #line 904 "MOFReader.y"
    02167     {
    02168         activeTransition->setProbability((yyvsp[0].flt));
    02169 ;}
    02170     break;
    02171
    02172   case 92:
    02173 #line 913 "MOFReader.y"
    02174     {
    02175         // [ <Clock Time> <Probability> ]
    02176         fprintf(stderr, "Ignoring probability data: [%f %f]\n"
    02177                                         "  For transition [%s: %s -> %s]\n", (yyvsp[-2].flt), (yyvsp[-1].flt),
    02178                                         activeVariable->getName(),
    02179                                         activeTransition->from_state_p()->getName(),
    02180                                         activeTransition->to_state_p()->getName());
    02181         activeTransition->setProbability((yyvsp[-1].flt));
    02182 ;}
    02183     break;
    02184
    02185
    02186       default: break;
    02187     }
    02188
    02189 /* Line 1126 of yacc.c.  */
    02190 #line 2191 "MOFReader.tab.cpp"
    02191
    02192   yyvsp -= yylen;
    02193   yyssp -= yylen;
    02194
    02195
    02196   YY_STACK_PRINT (yyss, yyssp);
    02197
    02198   *++yyvsp = yyval;
    02199
    02200
    02201   /* Now `shift' the result of the reduction.  Determine what state
    02202      that goes to, based on the state we popped back to and the rule
    02203      number reduced by.  */
    02204
    02205   yyn = yyr1[yyn];
    02206
    02207   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
    02208   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
    02209     yystate = yytable[yystate];
    02210   else
    02211     yystate = yydefgoto[yyn - YYNTOKENS];
    02212
    02213   goto yynewstate;
    02214
    02215
    02216 /*------------------------------------.
    02217 | yyerrlab -- here on detecting error |
    02218 `------------------------------------*/
    02219 yyerrlab:
    02220   /* If not already recovering from an error, report this error.  */
    02221   if (!yyerrstatus)
    02222     {
    02223       ++yynerrs;
    02224 #if YYERROR_VERBOSE
    02225       yyn = yypact[yystate];
    02226
    02227       if (YYPACT_NINF < yyn && yyn < YYLAST)
    02228         {
    02229           int yytype = YYTRANSLATE (yychar);
    02230           YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
    02231           YYSIZE_T yysize = yysize0;
    02232           YYSIZE_T yysize1;
    02233           int yysize_overflow = 0;
    02234           char *yymsg = 0;
    02235 #         define YYERROR_VERBOSE_ARGS_MAXIMUM 5
    02236           char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
    02237           int yyx;
    02238
    02239 #if 0
    02240           /* This is so xgettext sees the translatable formats that are
    02241              constructed on the fly.  */
    02242           YY_("syntax error, unexpected %s");
    02243           YY_("syntax error, unexpected %s, expecting %s");
    02244           YY_("syntax error, unexpected %s, expecting %s or %s");
    02245           YY_("syntax error, unexpected %s, expecting %s or %s or %s");
    02246           YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
    02247 #endif
    02248           char *yyfmt;
    02249           char const *yyf;
    02250           static char const yyunexpected[] = "syntax error, unexpected %s";
    02251           static char const yyexpecting[] = ", expecting %s";
    02252           static char const yyor[] = " or %s";
    02253           char yyformat[sizeof yyunexpected
    02254                         + sizeof yyexpecting - 1
    02255                         + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
    02256                            * (sizeof yyor - 1))];
    02257           char const *yyprefix = yyexpecting;
    02258
    02259           /* Start YYX at -YYN if negative to avoid negative indexes in
    02260              YYCHECK.  */
    02261           int yyxbegin = yyn < 0 ? -yyn : 0;
    02262
    02263           /* Stay within bounds of both yycheck and yytname.  */
    02264           int yychecklim = YYLAST - yyn;
    02265           int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
    02266           int yycount = 1;
    02267
    02268           yyarg[0] = yytname[yytype];
    02269           yyfmt = yystpcpy (yyformat, yyunexpected);
    02270
    02271           for (yyx = yyxbegin; yyx < yyxend; ++yyx)
    02272             if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
    02273               {
    02274                 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
    02275                   {
    02276                     yycount = 1;
    02277                     yysize = yysize0;
    02278                     yyformat[sizeof yyunexpected - 1] = '\0';
    02279                     break;
    02280                   }
    02281                 yyarg[yycount++] = yytname[yyx];
    02282                 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
    02283                 yysize_overflow |= yysize1 < yysize;
    02284                 yysize = yysize1;
    02285                 yyfmt = yystpcpy (yyfmt, yyprefix);
    02286                 yyprefix = yyor;
    02287               }
    02288
    02289           yyf = YY_(yyformat);
    02290           yysize1 = yysize + yystrlen (yyf);
    02291           yysize_overflow |= yysize1 < yysize;
    02292           yysize = yysize1;
    02293
    02294           if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM)
    02295             yymsg = (char *) YYSTACK_ALLOC (yysize);
    02296           if (yymsg)
    02297             {
    02298               /* Avoid sprintf, as that infringes on the user's name space.
    02299                  Don't have undefined behavior even if the translation
    02300                  produced a string with the wrong number of "%s"s.  */
    02301               char *yyp = yymsg;
    02302               int yyi = 0;
    02303               while ((*yyp = *yyf))
    02304                 {
    02305                   if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
    02306                     {
    02307                       yyp += yytnamerr (yyp, yyarg[yyi++]);
    02308                       yyf += 2;
    02309                     }
    02310                   else
    02311                     {
    02312                       yyp++;
    02313                       yyf++;
    02314                     }
    02315                 }
    02316               yyerror (yymsg);
    02317               YYSTACK_FREE (yymsg);
    02318             }
    02319           else
    02320             {
    02321               yyerror (YY_("syntax error"));
    02322               goto yyexhaustedlab;
    02323             }
    02324         }
    02325       else
    02326 #endif /* YYERROR_VERBOSE */
    02327         yyerror (YY_("syntax error"));
    02328     }
    02329
    02330
    02331
    02332   if (yyerrstatus == 3)
    02333     {
    02334       /* If just tried and failed to reuse look-ahead token after an
    02335          error, discard it.  */
    02336
    02337       if (yychar <= YYEOF)
    02338         {
    02339           /* Return failure if at end of input.  */
    02340           if (yychar == YYEOF)
    02341             YYABORT;
    02342         }
    02343       else
    02344         {
    02345           yydestruct ("Error: discarding", yytoken, &yylval);
    02346           yychar = YYEMPTY;
    02347         }
    02348     }
    02349
    02350   /* Else will try to reuse look-ahead token after shifting the error
    02351      token.  */
    02352   goto yyerrlab1;
    02353
    02354
    02355 /*---------------------------------------------------.
    02356 | yyerrorlab -- error raised explicitly by YYERROR.  |
    02357 `---------------------------------------------------*/
    02358 yyerrorlab:
    02359
    02360   /* Pacify compilers like GCC when the user code never invokes
    02361      YYERROR and the label yyerrorlab therefore never appears in user
    02362      code.  */
    02363   if (0)
    02364      goto yyerrorlab;
    02365
    02366 yyvsp -= yylen;
    02367   yyssp -= yylen;
    02368   yystate = *yyssp;
    02369   goto yyerrlab1;
    02370
    02371
    02372 /*-------------------------------------------------------------.
    02373 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
    02374 `-------------------------------------------------------------*/
    02375 yyerrlab1:
    02376   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
    02377
    02378   for (;;)
    02379     {
    02380       yyn = yypact[yystate];
    02381       if (yyn != YYPACT_NINF)
    02382         {
    02383           yyn += YYTERROR;
    02384           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
    02385             {
    02386               yyn = yytable[yyn];
    02387               if (0 < yyn)
    02388                 break;
    02389             }
    02390         }
    02391
    02392       /* Pop the current state because it cannot handle the error token.  */
    02393       if (yyssp == yyss)
    02394         YYABORT;
    02395
    02396
    02397       yydestruct ("Error: popping", yystos[yystate], yyvsp);
    02398       YYPOPSTACK;
    02399       yystate = *yyssp;
    02400       YY_STACK_PRINT (yyss, yyssp);
    02401     }
    02402
    02403   if (yyn == YYFINAL)
    02404     YYACCEPT;
    02405
    02406   *++yyvsp = yylval;
    02407
    02408
    02409   /* Shift the error token. */
    02410   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
    02411
    02412   yystate = yyn;
    02413   goto yynewstate;
    02414
    02415
    02416 /*-------------------------------------.
    02417 | yyacceptlab -- YYACCEPT comes here.  |
    02418 `-------------------------------------*/
    02419 yyacceptlab:
    02420   yyresult = 0;
    02421   goto yyreturn;
    02422
    02423 /*-----------------------------------.
    02424 | yyabortlab -- YYABORT comes here.  |
    02425 `-----------------------------------*/
    02426 yyabortlab:
    02427   yyresult = 1;
    02428   goto yyreturn;
    02429
    02430 #ifndef yyoverflow
    02431 /*-------------------------------------------------.
    02432 | yyexhaustedlab -- memory exhaustion comes here.  |
    02433 `-------------------------------------------------*/
    02434 yyexhaustedlab:
    02435   yyerror (YY_("memory exhausted"));
    02436   yyresult = 2;
    02437   /* Fall through.  */
    02438 #endif
    02439
    02440 yyreturn:
    02441   if (yychar != YYEOF && yychar != YYEMPTY)
    02442      yydestruct ("Cleanup: discarding lookahead",
    02443                  yytoken, &yylval);
    02444   while (yyssp != yyss)
    02445     {
    02446       yydestruct ("Cleanup: popping",
    02447                   yystos[*yyssp], yyvsp);
    02448       YYPOPSTACK;
    02449     }
    02450 #ifndef yyoverflow
    02451   if (yyss != yyssa)
    02452     YYSTACK_FREE (yyss);
    02453 #endif
    02454   return yyresult;
    02455 }
    02456
    02457
    02458 #line 923 "MOFReader.y"
    02459
    02460
    02461 void yyMOFReadererror(const char * s)
    02462 {
    02463   cerr << "Error: " << s << endl;
    02464         cerr << "On line " << MOFReaderLineNumber << endl;
    02465 }
    02466
    02467
    02468 /*
    02469 int main(int argc, char * argv[])
    02470 {
    02471   model m("Test Model");
    02472
    02473   myCCAModel = &m;
    02474
    02475   if(argc == 2)
    02476   {
    02477     yyin = fopen(argv[1], "r");
    02478     if(!yyin)
    02479     {
    02480       perror("Error opening the file");
    02481       return 1;
    02482     }
    02483   }else{
    02484     cout << "Use: " << argv[0] << " <filename.mof>" << endl;
    02485     return 1;
    02486   }
    02487   yyparse();
    02488
    02489   return 0;
    02490 }
    02491 */
    02492