~ubuntu-branches/ubuntu/raring/ibutils/raring-proposed

« back to all changes in this revision

Viewing changes to ibdm/ibdm/ibnl_parser.cc

  • Committer: Bazaar Package Importer
  • Author(s): Benoit Mortier
  • Date: 2010-01-11 22:22:00 UTC
  • Revision ID: james.westby@ubuntu.com-20100111222200-53kum2et5nh13rv3
Tags: upstream-1.2-OFED-1.4.2
ImportĀ upstreamĀ versionĀ 1.2-OFED-1.4.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* A Bison parser, made by GNU Bison 2.0.  */
 
2
 
 
3
/* Skeleton parser for Yacc-like parsing with Bison,
 
4
   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
5
 
 
6
   This program is free software; you can redistribute it and/or modify
 
7
   it under the terms of the GNU General Public License as published by
 
8
   the Free Software Foundation; either version 2, or (at your option)
 
9
   any later version.
 
10
 
 
11
   This program is distributed in the hope that it will be useful,
 
12
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
   GNU General Public License for more details.
 
15
 
 
16
   You should have received a copy of the GNU General Public License
 
17
   along with this program; if not, write to the Free Software
 
18
   Foundation, Inc., 59 Temple Place - Suite 330,
 
19
   Boston, MA 02111-1307, USA.  */
 
20
 
 
21
/* As a special exception, when this file is copied by Bison into a
 
22
   Bison output file, you may use that output file without restriction.
 
23
   This special exception was added by the Free Software Foundation
 
24
   in version 1.24 of Bison.  */
 
25
 
 
26
/* Written by Richard Stallman by simplifying the original so called
 
27
   ``semantic'' parser.  */
 
28
 
 
29
/* All symbols defined below should begin with yy or YY, to avoid
 
30
   infringing on user name space.  This should be done even for local
 
31
   variables, as they might otherwise be expanded by user macros.
 
32
   There are some unavoidable exceptions within include files to
 
33
   define necessary library symbols; they are noted "INFRINGES ON
 
34
   USER NAME SPACE" below.  */
 
35
 
 
36
/* Identify Bison output.  */
 
37
#define YYBISON 1
 
38
 
 
39
/* Skeleton name.  */
 
40
#define YYSKELETON_NAME "yacc.c"
 
41
 
 
42
/* Pure parsers.  */
 
43
#define YYPURE 0
 
44
 
 
45
/* Using locations.  */
 
46
#define YYLSP_NEEDED 0
 
47
 
 
48
 
 
49
 
 
50
/* Tokens.  */
 
51
#ifndef YYTOKENTYPE
 
52
# define YYTOKENTYPE
 
53
   /* Put the tokens into the symbol table, so that GDB and other debuggers
 
54
      know about them.  */
 
55
   enum yytokentype {
 
56
     INT = 258,
 
57
     SYSTEM = 259,
 
58
     TOPSYSTEM = 260,
 
59
     NODE = 261,
 
60
     SUBSYSTEM = 262,
 
61
     NODETYPE = 263,
 
62
     NAME = 264,
 
63
     SPEED = 265,
 
64
     WIDTH = 266,
 
65
     LINE = 267,
 
66
     CFG = 268
 
67
   };
 
68
#endif
 
69
#define INT 258
 
70
#define SYSTEM 259
 
71
#define TOPSYSTEM 260
 
72
#define NODE 261
 
73
#define SUBSYSTEM 262
 
74
#define NODETYPE 263
 
75
#define NAME 264
 
76
#define SPEED 265
 
77
#define WIDTH 266
 
78
#define LINE 267
 
79
#define CFG 268
 
80
 
 
81
 
 
82
 
 
83
 
 
84
/* Copy the first part of user declarations.  */
 
85
#line 40 "ibnl_parser.yy"
 
86
 
 
87
 
 
88
  /* header section */
 
89
#include <stdlib.h>
 
90
#include <stdio.h>
 
91
#include "SysDef.h"
 
92
#define YYERROR_VERBOSE 1
 
93
 
 
94
#define yymaxdepth ibnl_maxdepth
 
95
#define yyparse ibnl_parse
 
96
#define yylex   ibnl_lex
 
97
#define yyerror ibnl_error
 
98
#define yylval  ibnl_lval
 
99
#define yychar  ibnl_char
 
100
#define yydebug ibnl_debug
 
101
#define yypact  ibnl_pact
 
102
#define yyr1    ibnl_r1
 
103
#define yyr2    ibnl_r2
 
104
#define yydef   ibnl_def
 
105
#define yychk   ibnl_chk
 
106
#define yypgo   ibnl_pgo
 
107
#define yyact   ibnl_act
 
108
#define yyexca  ibnl_exca
 
109
#define  yyerrflag ibnl_errflag
 
110
#define  yynerrs        ibnl_nerrs
 
111
#define yyps    ibnl_ps
 
112
#define yypv    ibnl_pv
 
113
#define yys     ibnl_s
 
114
#define yy_yys  ibnl_yys
 
115
#define yystate ibnl_state
 
116
#define yytmp   ibnl_tmp
 
117
#define yyv     ibnl_v
 
118
#define yy_yyv  ibnl_yyv
 
119
#define yyval   ibnl_val
 
120
#define yylloc  ibnl_lloc
 
121
#define yyreds  ibnl_reds
 
122
#define yytoks  ibnl_toks
 
123
#define yylhs   ibnl_yylhs
 
124
#define yylen   ibnl_yylen
 
125
#define yydefred ibnl_yydefred
 
126
#define yydgoto ibnl_yydgoto
 
127
#define yysindex ibnl_yysindex
 
128
#define yyrindex ibnl_yyrindex
 
129
#define yygindex ibnl_yygindex
 
130
#define yytable  ibnl_yytable
 
131
#define yycheck  ibnl_yycheck
 
132
#define yyname   ibnl_yyname
 
133
#define yyrule   ibnl_yyrule
 
134
 
 
135
  extern int yyerror(char *msg);
 
136
  extern int yylex(void);
 
137
 
 
138
 
 
139
 
 
140
 
 
141
/* Enabling traces.  */
 
142
#ifndef YYDEBUG
 
143
# define YYDEBUG 0
 
144
#endif
 
145
 
 
146
/* Enabling verbose error messages.  */
 
147
#ifdef YYERROR_VERBOSE
 
148
# undef YYERROR_VERBOSE
 
149
# define YYERROR_VERBOSE 1
 
150
#else
 
151
# define YYERROR_VERBOSE 0
 
152
#endif
 
153
 
 
154
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
 
155
#line 96 "ibnl_parser.yy"
 
156
typedef union YYSTYPE {
 
157
  IBNodeType tval;
 
158
  int        ival;
 
159
  char      *sval;
 
160
} YYSTYPE;
 
161
/* Line 190 of yacc.c.  */
 
162
#line 163 "ibnl_parser.cc"
 
163
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
 
164
# define YYSTYPE_IS_DECLARED 1
 
165
# define YYSTYPE_IS_TRIVIAL 1
 
166
#endif
 
167
 
 
168
 
 
169
 
 
170
/* Copy the second part of user declarations.  */
 
171
#line 111 "ibnl_parser.yy"
 
172
 
 
173
 
 
174
  static int ibnlErr;
 
175
  long lineNum;
 
176
  static const char *gp_fileName;
 
177
  static int gIsTopSystem = 0;
 
178
  static list< char * > gSysNames;
 
179
  static IBSystemsCollection *gp_sysColl = 0;
 
180
  static IBSysDef *gp_curSysDef = 0;
 
181
  static IBSysInst *gp_curInstDef = 0;
 
182
 
 
183
  void ibnlMakeSystem(list< char * > &sysNames) {
 
184
#ifdef DEBUG
 
185
    printf("Making new system named:");
 
186
#endif
 
187
    gp_curSysDef = new IBSysDef(gp_fileName);
 
188
 
 
189
    for( list< char * >::iterator snI = sysNames.begin();
 
190
         snI != sysNames.end(); snI++) {
 
191
      char sname[1024];
 
192
      if (gIsTopSystem) {
 
193
        sprintf(sname, "%s", *snI);
 
194
      } else {
 
195
        sprintf(sname, "%s/%s", gp_fileName, *snI);
 
196
      }
 
197
      string sNameStr(sname);
 
198
      gp_sysColl->addSysDef(sNameStr, gp_curSysDef);
 
199
#ifdef DEBUG
 
200
      printf("%s ", sname);
 
201
#endif
 
202
    }
 
203
#ifdef DEBUG
 
204
    printf("\n");
 
205
#endif
 
206
 
 
207
    // cleanup for next systems.
 
208
    sysNames.erase(sysNames.begin(), sysNames.end());
 
209
  }
 
210
 
 
211
  void ibnlMakeSubInstAttribute(char *hInst, char *attr, char *value) {
 
212
#ifdef DEBUG
 
213
    printf("Making new sub instance attribute inst:%s %s=%s\n",
 
214
           hInst, attr, value);
 
215
#endif
 
216
    if (! gp_curSysDef) {
 
217
        printf("-E- How com e we got no system???\n");
 
218
        exit(3);
 
219
    }
 
220
    // append to existing attr or create new
 
221
    string hierInstName = string(hInst);
 
222
    string attrStr = string(attr);
 
223
    if (value)
 
224
       attrStr += "=" +  string(value);
 
225
    gp_curSysDef->setSubInstAttr(hierInstName, attrStr);
 
226
  }
 
227
 
 
228
  void ibnlMakeNode(IBNodeType type, int numPorts, char *devName, char* name) {
 
229
#ifdef DEBUG
 
230
    printf(" Making Node:%s dev:%s ports:%d\n", name, devName, numPorts);
 
231
#endif
 
232
    gp_curInstDef = new IBSysInst(name, devName, numPorts, type);
 
233
    gp_curSysDef->addInst(gp_curInstDef);
 
234
  }
 
235
 
 
236
  void ibnlMakeNodeToNodeConn(
 
237
    int fromPort, char *width, char *speed, char *toNode, int toPort) {
 
238
#ifdef DEBUG
 
239
    printf("  Connecting N-N port:%d to Node:%s/%d (w=%s,s=%s)\n",
 
240
           fromPort, toNode, toPort, width, speed);
 
241
#endif
 
242
    char buf1[8],buf2[8] ;
 
243
    sprintf(buf1, "%d", toPort);
 
244
    sprintf(buf2, "%d", fromPort);
 
245
    IBSysInstPort *p_port =
 
246
      new IBSysInstPort(buf2, toNode, buf1, char2width(width),
 
247
                        char2speed(speed));
 
248
    gp_curInstDef->addPort(p_port);
 
249
  }
 
250
 
 
251
  void ibnlMakeNodeToPortConn(
 
252
    int fromPort, char *width, char *speed, char *sysPortName) {
 
253
#ifdef DEBUG
 
254
    printf("  System port:%s on port:%d (w=%s,s=%s)\n",
 
255
           sysPortName, fromPort, width, speed);
 
256
#endif
 
257
    char buf[8];
 
258
    sprintf(buf,"%d",fromPort);
 
259
    IBSysPortDef *p_sysPort =
 
260
      new IBSysPortDef(sysPortName, gp_curInstDef->getName(), buf,
 
261
                       char2width(width), char2speed(speed));
 
262
    gp_curSysDef->addSysPort(p_sysPort);
 
263
  }
 
264
 
 
265
  void ibnlMakeSubsystem( char *masterName, char *instName) {
 
266
#ifdef DEBUG
 
267
    printf(" Making SubSystem:%s of type:%s\n", instName, masterName);
 
268
#endif
 
269
    gp_curInstDef = new IBSysInst(instName, masterName);
 
270
    gp_curSysDef->addInst(gp_curInstDef);
 
271
  }
 
272
 
 
273
  void ibnlRecordModification( char *subSystem, char *modifier) {
 
274
#ifdef DEBUG
 
275
    printf("  Using modifier:%s on %s\n", modifier, subSystem);
 
276
#endif
 
277
    gp_curInstDef->addInstMod(subSystem, modifier);
 
278
  }
 
279
 
 
280
  void ibnlMakeSubsystemToSubsystemConn(
 
281
    char *fromPort, char *width, char *speed, char *toSystem, char *toPort) {
 
282
#ifdef DEBUG
 
283
    printf("  Connecting S-S port:%s to SubSys:%s/%s\n",
 
284
         fromPort, toSystem, toPort);
 
285
#endif
 
286
    IBSysInstPort *p_port =
 
287
      new IBSysInstPort(fromPort, toSystem, toPort, char2width(width),
 
288
                        char2speed(speed));
 
289
    gp_curInstDef->addPort(p_port);
 
290
  }
 
291
 
 
292
  void ibnlMakeSubsystemToPortConn(
 
293
    char *fromPort, char *width, char *speed, char *toPort) {
 
294
#ifdef DEBUG
 
295
    printf("  Connecting port:%s to SysPort:%s\n",
 
296
         fromPort, toPort);
 
297
#endif
 
298
 
 
299
    IBSysPortDef *p_sysPort =
 
300
      new IBSysPortDef(toPort, gp_curInstDef->getName(), fromPort,
 
301
                       char2width(width), char2speed(speed));
 
302
    gp_curSysDef->addSysPort(p_sysPort);
 
303
  }
 
304
 
 
305
 
 
306
 
 
307
/* Line 213 of yacc.c.  */
 
308
#line 309 "ibnl_parser.cc"
 
309
 
 
310
#if ! defined (yyoverflow) || YYERROR_VERBOSE
 
311
 
 
312
# ifndef YYFREE
 
313
#  define YYFREE free
 
314
# endif
 
315
# ifndef YYMALLOC
 
316
#  define YYMALLOC malloc
 
317
# endif
 
318
 
 
319
/* The parser invokes alloca or malloc; define the necessary symbols.  */
 
320
 
 
321
# ifdef YYSTACK_USE_ALLOCA
 
322
#  if YYSTACK_USE_ALLOCA
 
323
#   ifdef __GNUC__
 
324
#    define YYSTACK_ALLOC __builtin_alloca
 
325
#   else
 
326
#    define YYSTACK_ALLOC alloca
 
327
#   endif
 
328
#  endif
 
329
# endif
 
330
 
 
331
# ifdef YYSTACK_ALLOC
 
332
   /* Pacify GCC's `empty if-body' warning. */
 
333
#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
 
334
# else
 
335
#  if defined (__STDC__) || defined (__cplusplus)
 
336
#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
 
337
#   define YYSIZE_T size_t
 
338
#  endif
 
339
#  define YYSTACK_ALLOC YYMALLOC
 
340
#  define YYSTACK_FREE YYFREE
 
341
# endif
 
342
#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
 
343
 
 
344
 
 
345
#if (! defined (yyoverflow) \
 
346
     && (! defined (__cplusplus) \
 
347
         || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
 
348
 
 
349
/* A type that is properly aligned for any stack member.  */
 
350
union yyalloc
 
351
{
 
352
  short int yyss;
 
353
  YYSTYPE yyvs;
 
354
  };
 
355
 
 
356
/* The size of the maximum gap between one aligned stack and the next.  */
 
357
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
 
358
 
 
359
/* The size of an array large to enough to hold all stacks, each with
 
360
   N elements.  */
 
361
# define YYSTACK_BYTES(N) \
 
362
     ((N) * (sizeof (short int) + sizeof (YYSTYPE))                     \
 
363
      + YYSTACK_GAP_MAXIMUM)
 
364
 
 
365
/* Copy COUNT objects from FROM to TO.  The source and destination do
 
366
   not overlap.  */
 
367
# ifndef YYCOPY
 
368
#  if defined (__GNUC__) && 1 < __GNUC__
 
369
#   define YYCOPY(To, From, Count) \
 
370
      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
 
371
#  else
 
372
#   define YYCOPY(To, From, Count)              \
 
373
      do                                        \
 
374
        {                                       \
 
375
          register YYSIZE_T yyi;                \
 
376
          for (yyi = 0; yyi < (Count); yyi++)   \
 
377
            (To)[yyi] = (From)[yyi];            \
 
378
        }                                       \
 
379
      while (0)
 
380
#  endif
 
381
# endif
 
382
 
 
383
/* Relocate STACK from its old location to the new one.  The
 
384
   local variables YYSIZE and YYSTACKSIZE give the old and new number of
 
385
   elements in the stack, and YYPTR gives the new location of the
 
386
   stack.  Advance YYPTR to a properly aligned location for the next
 
387
   stack.  */
 
388
# define YYSTACK_RELOCATE(Stack)                                        \
 
389
    do                                                                  \
 
390
      {                                                                 \
 
391
        YYSIZE_T yynewbytes;                                            \
 
392
        YYCOPY (&yyptr->Stack, Stack, yysize);                          \
 
393
        Stack = &yyptr->Stack;                                          \
 
394
        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
 
395
        yyptr += yynewbytes / sizeof (*yyptr);                          \
 
396
      }                                                                 \
 
397
    while (0)
 
398
 
 
399
#endif
 
400
 
 
401
#if defined (__STDC__) || defined (__cplusplus)
 
402
   typedef signed char yysigned_char;
 
403
#else
 
404
   typedef short int yysigned_char;
 
405
#endif
 
406
 
 
407
/* YYFINAL -- State number of the termination state. */
 
408
#define YYFINAL  7
 
409
/* YYLAST -- Last index in YYTABLE.  */
 
410
#define YYLAST   82
 
411
 
 
412
/* YYNTOKENS -- Number of terminals. */
 
413
#define YYNTOKENS  18
 
414
/* YYNNTS -- Number of nonterminals. */
 
415
#define YYNNTS  30
 
416
/* YYNRULES -- Number of rules. */
 
417
#define YYNRULES  57
 
418
/* YYNRULES -- Number of states. */
 
419
#define YYNSTATES  107
 
420
 
 
421
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
 
422
#define YYUNDEFTOK  2
 
423
#define YYMAXUTOK   268
 
424
 
 
425
#define YYTRANSLATE(YYX)                                                \
 
426
  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
 
427
 
 
428
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
 
429
static const unsigned char yytranslate[] =
 
430
{
 
431
       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
432
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
433
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
434
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
435
       2,     2,     2,     2,    15,    16,     2,     2,     2,     2,
 
436
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
437
       2,    14,    17,     2,     2,     2,     2,     2,     2,     2,
 
438
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
439
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
440
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
441
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
442
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
443
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
444
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
445
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
446
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
447
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
448
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
449
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
450
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
451
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
452
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
453
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
454
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
455
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
456
       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
 
457
       5,     6,     7,     8,     9,    10,    11,    12,    13
 
458
};
 
459
 
 
460
#if YYDEBUG
 
461
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
 
462
   YYRHS.  */
 
463
static const unsigned char yyprhs[] =
 
464
{
 
465
       0,     0,     3,     5,     8,     9,    11,    15,    16,    19,
 
466
      20,    24,    30,    36,    40,    41,    42,    50,    51,    52,
 
467
      59,    61,    65,    67,    68,    71,    74,    78,    84,    85,
 
468
      89,    91,    93,   103,   111,   119,   125,   134,   141,   148,
 
469
     153,   157,   164,   168,   169,   172,   176,   177,   181,   183,
 
470
     185,   195,   203,   211,   217,   226,   233,   240
 
471
};
 
472
 
 
473
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
 
474
static const yysigned_char yyrhs[] =
 
475
{
 
476
      21,     0,    -1,    12,    -1,    19,    12,    -1,    -1,    19,
 
477
      -1,    20,    22,    25,    -1,    -1,    22,    28,    -1,    -1,
 
478
      23,    24,    19,    -1,     9,    14,     9,    14,     9,    -1,
 
479
       9,    14,     9,    14,     3,    -1,     9,    14,     9,    -1,
 
480
      -1,    -1,     5,    26,    31,    27,    19,    23,    33,    -1,
 
481
      -1,    -1,     4,    29,    31,    30,    19,    33,    -1,    32,
 
482
      -1,    31,    15,    32,    -1,     9,    -1,    -1,    33,    34,
 
483
      -1,    33,    40,    -1,    35,    19,    36,    -1,     6,     8,
 
484
       3,     9,     9,    -1,    -1,    36,    37,    19,    -1,    38,
 
485
      -1,    39,    -1,     3,    16,    11,    16,    10,    16,    17,
 
486
       9,     3,    -1,     3,    16,    11,    16,    17,     9,     3,
 
487
      -1,     3,    16,    10,    16,    17,     9,     3,    -1,     3,
 
488
      16,    17,     9,     3,    -1,     3,    16,    11,    16,    10,
 
489
      16,    17,     9,    -1,     3,    16,    11,    16,    17,     9,
 
490
      -1,     3,    16,    10,    16,    17,     9,    -1,     3,    16,
 
491
      17,     9,    -1,    41,    19,    44,    -1,    41,    19,    13,
 
492
      42,    19,    44,    -1,     7,     9,     9,    -1,    -1,    42,
 
493
      43,    -1,     9,    14,     9,    -1,    -1,    44,    45,    19,
 
494
      -1,    46,    -1,    47,    -1,     9,    16,    11,    16,    10,
 
495
      16,    17,     9,     9,    -1,     9,    16,    11,    16,    17,
 
496
       9,     9,    -1,     9,    16,    10,    16,    17,     9,     9,
 
497
      -1,     9,    16,    17,     9,     9,    -1,     9,    16,    11,
 
498
      16,    10,    16,    17,     9,    -1,     9,    16,    11,    16,
 
499
      17,     9,    -1,     9,    16,    10,    16,    17,     9,    -1,
 
500
       9,    16,    17,     9,    -1
 
501
};
 
502
 
 
503
/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
 
504
static const unsigned short int yyrline[] =
 
505
{
 
506
       0,   248,   248,   249,   251,   252,   254,   256,   257,   260,
 
507
     261,   265,   266,   271,   275,   276,   275,   282,   283,   282,
 
508
     287,   288,   292,   295,   296,   297,   301,   305,   308,   309,
 
509
     313,   314,   318,   321,   324,   327,   333,   336,   339,   342,
 
510
     348,   349,   353,   356,   357,   361,   364,   365,   369,   370,
 
511
     374,   377,   380,   383,   389,   392,   395,   398
 
512
};
 
513
#endif
 
514
 
 
515
#if YYDEBUG || YYERROR_VERBOSE
 
516
/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
 
517
   First, the terminals, then, starting at YYNTOKENS, nonterminals. */
 
518
static const char *const yytname[] =
 
519
{
 
520
  "$end", "error", "$undefined", "INT", "SYSTEM", "TOPSYSTEM", "NODE",
 
521
  "SUBSYSTEM", "NODETYPE", "NAME", "SPEED", "WIDTH", "LINE", "CFG", "'='",
 
522
  "','", "'-'", "'>'", "$accept", "NL", "ONL", "ibnl", "systems",
 
523
  "sub_inst_attributes", "sub_inst_attribute", "topsystem", "@1", "@2",
 
524
  "system", "@3", "@4", "system_names", "system_name", "insts", "node",
 
525
  "node_header", "node_connections", "node_connection",
 
526
  "node_to_node_link", "node_to_port_link", "subsystem",
 
527
  "subsystem_header", "insts_modifications", "modification",
 
528
  "subsystem_connections", "subsystem_connection",
 
529
  "subsystem_to_subsystem_link", "subsystem_to_port_link", 0
 
530
};
 
531
#endif
 
532
 
 
533
# ifdef YYPRINT
 
534
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
 
535
   token YYLEX-NUM.  */
 
536
static const unsigned short int yytoknum[] =
 
537
{
 
538
       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
 
539
     265,   266,   267,   268,    61,    44,    45,    62
 
540
};
 
541
# endif
 
542
 
 
543
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
 
544
static const unsigned char yyr1[] =
 
545
{
 
546
       0,    18,    19,    19,    20,    20,    21,    22,    22,    23,
 
547
      23,    24,    24,    24,    26,    27,    25,    29,    30,    28,
 
548
      31,    31,    32,    33,    33,    33,    34,    35,    36,    36,
 
549
      37,    37,    38,    38,    38,    38,    39,    39,    39,    39,
 
550
      40,    40,    41,    42,    42,    43,    44,    44,    45,    45,
 
551
      46,    46,    46,    46,    47,    47,    47,    47
 
552
};
 
553
 
 
554
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
 
555
static const unsigned char yyr2[] =
 
556
{
 
557
       0,     2,     1,     2,     0,     1,     3,     0,     2,     0,
 
558
       3,     5,     5,     3,     0,     0,     7,     0,     0,     6,
 
559
       1,     3,     1,     0,     2,     2,     3,     5,     0,     3,
 
560
       1,     1,     9,     7,     7,     5,     8,     6,     6,     4,
 
561
       3,     6,     3,     0,     2,     3,     0,     3,     1,     1,
 
562
       9,     7,     7,     5,     8,     6,     6,     4
 
563
};
 
564
 
 
565
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
 
566
   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
 
567
   means the default is an error.  */
 
568
static const unsigned char yydefact[] =
 
569
{
 
570
       4,     2,     5,     7,     0,     3,     0,     1,    17,    14,
 
571
       6,     8,     0,     0,    22,    18,    20,    15,     0,     0,
 
572
       0,    21,    23,     9,    19,    23,     0,     0,    24,     0,
 
573
      25,     0,     0,     0,    16,     0,     0,    28,    46,     0,
 
574
      10,     0,    42,    26,    43,    40,    13,     0,     0,     0,
 
575
      30,    31,     0,     0,     0,    48,    49,     0,    27,     0,
 
576
      29,     0,    46,    44,     0,    47,    12,    11,     0,     0,
 
577
       0,     0,    41,     0,     0,     0,     0,     0,    39,    45,
 
578
       0,     0,    57,     0,     0,     0,    35,     0,     0,     0,
 
579
      53,    38,     0,    37,    56,     0,    55,    34,     0,    33,
 
580
      52,     0,    51,    36,    54,    32,    50
 
581
};
 
582
 
 
583
/* YYDEFGOTO[NTERM-NUM]. */
 
584
static const yysigned_char yydefgoto[] =
 
585
{
 
586
      -1,     2,     3,     4,     6,    25,    33,    10,    13,    20,
 
587
      11,    12,    19,    15,    16,    24,    28,    29,    43,    49,
 
588
      50,    51,    30,    31,    52,    63,    45,    54,    55,    56
 
589
};
 
590
 
 
591
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
 
592
   STATE-NUM.  */
 
593
#define YYPACT_NINF -20
 
594
static const yysigned_char yypact[] =
 
595
{
 
596
      -5,   -20,     9,   -20,    25,   -20,    14,   -20,   -20,   -20,
 
597
     -20,   -20,    20,    20,   -20,    11,   -20,    11,    20,    -5,
 
598
      -5,   -20,     9,     9,    17,    22,    24,    27,   -20,    -5,
 
599
     -20,    -5,    23,    -5,    17,    31,    29,     9,    15,    30,
 
600
       9,    32,   -20,    37,   -20,    33,    34,    35,    36,    -5,
 
601
     -20,   -20,     8,    38,    -5,   -20,   -20,    13,   -20,    -8,
 
602
       9,    39,     9,   -20,    -6,     9,   -20,   -20,    40,    41,
 
603
      42,    46,    33,    43,    44,    49,    26,    -4,    47,   -20,
 
604
      28,    -2,    52,    53,    48,    54,   -20,    56,    50,    58,
 
605
     -20,    65,    55,    66,    61,    57,    62,   -20,    64,   -20,
 
606
     -20,    67,   -20,    72,    68,   -20,   -20
 
607
};
 
608
 
 
609
/* YYPGOTO[NTERM-NUM].  */
 
610
static const yysigned_char yypgoto[] =
 
611
{
 
612
     -20,   -19,   -20,   -20,   -20,   -20,   -20,   -20,   -20,   -20,
 
613
     -20,   -20,   -20,    69,    60,    21,   -20,   -20,   -20,   -20,
 
614
     -20,   -20,   -20,   -20,   -20,   -20,   -15,   -20,   -20,   -20
 
615
};
 
616
 
 
617
/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
 
618
   positive, shift that token.  If negative, reduce the rule which
 
619
   number is the opposite.  If zero, do what YYDEFACT says.
 
620
   If YYTABLE_NINF, syntax error.  */
 
621
#define YYTABLE_NINF -1
 
622
static const unsigned char yytable[] =
 
623
{
 
624
      22,    23,    68,    69,    73,    74,    84,     1,    88,    70,
 
625
      37,    75,    38,    85,    40,    89,    66,    61,     8,     9,
 
626
       1,     5,    67,    26,    27,     7,    18,     5,    44,    14,
 
627
      60,    32,    35,    62,    41,    65,    36,    39,    42,    46,
 
628
      48,    47,    53,    83,    58,    87,    34,    72,    57,     0,
 
629
      86,    78,    59,    71,    64,    79,    76,    77,    82,    80,
 
630
      81,    90,    91,    93,    92,    94,    95,    96,    97,    99,
 
631
     100,   102,    98,   103,   101,   105,   104,   106,    21,     0,
 
632
       0,     0,    17
 
633
};
 
634
 
 
635
static const yysigned_char yycheck[] =
 
636
{
 
637
      19,    20,    10,    11,    10,    11,    10,    12,    10,    17,
 
638
      29,    17,    31,    17,    33,    17,     3,     9,     4,     5,
 
639
      12,    12,     9,     6,     7,     0,    15,    12,    13,     9,
 
640
      49,     9,     8,    52,     3,    54,     9,    14,     9,     9,
 
641
       3,     9,     9,    17,     9,    17,    25,    62,    14,    -1,
 
642
       3,     9,    16,    14,    16,     9,    16,    16,     9,    16,
 
643
      16,     9,     9,     9,    16,     9,    16,     9,     3,     3,
 
644
       9,     9,    17,     9,    17,     3,     9,     9,    18,    -1,
 
645
      -1,    -1,    13
 
646
};
 
647
 
 
648
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
 
649
   symbol of state STATE-NUM.  */
 
650
static const unsigned char yystos[] =
 
651
{
 
652
       0,    12,    19,    20,    21,    12,    22,     0,     4,     5,
 
653
      25,    28,    29,    26,     9,    31,    32,    31,    15,    30,
 
654
      27,    32,    19,    19,    33,    23,     6,     7,    34,    35,
 
655
      40,    41,     9,    24,    33,     8,     9,    19,    19,    14,
 
656
      19,     3,     9,    36,    13,    44,     9,     9,     3,    37,
 
657
      38,    39,    42,     9,    45,    46,    47,    14,     9,    16,
 
658
      19,     9,    19,    43,    16,    19,     3,     9,    10,    11,
 
659
      17,    14,    44,    10,    11,    17,    16,    16,     9,     9,
 
660
      16,    16,     9,    17,    10,    17,     3,    17,    10,    17,
 
661
       9,     9,    16,     9,     9,    16,     9,     3,    17,     3,
 
662
       9,    17,     9,     9,     9,     3,     9
 
663
};
 
664
 
 
665
#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
 
666
# define YYSIZE_T __SIZE_TYPE__
 
667
#endif
 
668
#if ! defined (YYSIZE_T) && defined (size_t)
 
669
# define YYSIZE_T size_t
 
670
#endif
 
671
#if ! defined (YYSIZE_T)
 
672
# if defined (__STDC__) || defined (__cplusplus)
 
673
#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
 
674
#  define YYSIZE_T size_t
 
675
# endif
 
676
#endif
 
677
#if ! defined (YYSIZE_T)
 
678
# define YYSIZE_T unsigned int
 
679
#endif
 
680
 
 
681
#define yyerrok         (yyerrstatus = 0)
 
682
#define yyclearin       (yychar = YYEMPTY)
 
683
#define YYEMPTY         (-2)
 
684
#define YYEOF           0
 
685
 
 
686
#define YYACCEPT        goto yyacceptlab
 
687
#define YYABORT         goto yyabortlab
 
688
#define YYERROR         goto yyerrorlab
 
689
 
 
690
 
 
691
/* Like YYERROR except do call yyerror.  This remains here temporarily
 
692
   to ease the transition to the new meaning of YYERROR, for GCC.
 
693
   Once GCC version 2 has supplanted version 1, this can go.  */
 
694
 
 
695
#define YYFAIL          goto yyerrlab
 
696
 
 
697
#define YYRECOVERING()  (!!yyerrstatus)
 
698
 
 
699
#define YYBACKUP(Token, Value)                                  \
 
700
do                                                              \
 
701
  if (yychar == YYEMPTY && yylen == 1)                          \
 
702
    {                                                           \
 
703
      yychar = (Token);                                         \
 
704
      yylval = (Value);                                         \
 
705
      yytoken = YYTRANSLATE (yychar);                           \
 
706
      YYPOPSTACK;                                               \
 
707
      goto yybackup;                                            \
 
708
    }                                                           \
 
709
  else                                                          \
 
710
    {                                                           \
 
711
      yyerror ("syntax error: cannot back up");\
 
712
      YYERROR;                                                  \
 
713
    }                                                           \
 
714
while (0)
 
715
 
 
716
 
 
717
#define YYTERROR        1
 
718
#define YYERRCODE       256
 
719
 
 
720
 
 
721
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
 
722
   If N is 0, then set CURRENT to the empty location which ends
 
723
   the previous symbol: RHS[0] (always defined).  */
 
724
 
 
725
#define YYRHSLOC(Rhs, K) ((Rhs)[K])
 
726
#ifndef YYLLOC_DEFAULT
 
727
# define YYLLOC_DEFAULT(Current, Rhs, N)                                \
 
728
    do                                                                  \
 
729
      if (N)                                                            \
 
730
        {                                                               \
 
731
          (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
 
732
          (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
 
733
          (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
 
734
          (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
 
735
        }                                                               \
 
736
      else                                                              \
 
737
        {                                                               \
 
738
          (Current).first_line   = (Current).last_line   =              \
 
739
            YYRHSLOC (Rhs, 0).last_line;                                \
 
740
          (Current).first_column = (Current).last_column =              \
 
741
            YYRHSLOC (Rhs, 0).last_column;                              \
 
742
        }                                                               \
 
743
    while (0)
 
744
#endif
 
745
 
 
746
 
 
747
/* YY_LOCATION_PRINT -- Print the location on the stream.
 
748
   This macro was not mandated originally: define only if we know
 
749
   we won't break user code: when these are the locations we know.  */
 
750
 
 
751
#ifndef YY_LOCATION_PRINT
 
752
# if YYLTYPE_IS_TRIVIAL
 
753
#  define YY_LOCATION_PRINT(File, Loc)                  \
 
754
     fprintf (File, "%d.%d-%d.%d",                      \
 
755
              (Loc).first_line, (Loc).first_column,     \
 
756
              (Loc).last_line,  (Loc).last_column)
 
757
# else
 
758
#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
 
759
# endif
 
760
#endif
 
761
 
 
762
 
 
763
/* YYLEX -- calling `yylex' with the right arguments.  */
 
764
 
 
765
#ifdef YYLEX_PARAM
 
766
# define YYLEX yylex (YYLEX_PARAM)
 
767
#else
 
768
# define YYLEX yylex ()
 
769
#endif
 
770
 
 
771
/* Enable debugging if requested.  */
 
772
#if YYDEBUG
 
773
 
 
774
# ifndef YYFPRINTF
 
775
#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
 
776
#  define YYFPRINTF fprintf
 
777
# endif
 
778
 
 
779
# define YYDPRINTF(Args)                        \
 
780
do {                                            \
 
781
  if (yydebug)                                  \
 
782
    YYFPRINTF Args;                             \
 
783
} while (0)
 
784
 
 
785
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)          \
 
786
do {                                                            \
 
787
  if (yydebug)                                                  \
 
788
    {                                                           \
 
789
      YYFPRINTF (stderr, "%s ", Title);                         \
 
790
      yysymprint (stderr,                                       \
 
791
                  Type, Value); \
 
792
      YYFPRINTF (stderr, "\n");                                 \
 
793
    }                                                           \
 
794
} while (0)
 
795
 
 
796
/*------------------------------------------------------------------.
 
797
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
 
798
| TOP (included).                                                   |
 
799
`------------------------------------------------------------------*/
 
800
 
 
801
#if defined (__STDC__) || defined (__cplusplus)
 
802
static void
 
803
yy_stack_print (short int *bottom, short int *top)
 
804
#else
 
805
static void
 
806
yy_stack_print (bottom, top)
 
807
    short int *bottom;
 
808
    short int *top;
 
809
#endif
 
810
{
 
811
  YYFPRINTF (stderr, "Stack now");
 
812
  for (/* Nothing. */; bottom <= top; ++bottom)
 
813
    YYFPRINTF (stderr, " %d", *bottom);
 
814
  YYFPRINTF (stderr, "\n");
 
815
}
 
816
 
 
817
# define YY_STACK_PRINT(Bottom, Top)                            \
 
818
do {                                                            \
 
819
  if (yydebug)                                                  \
 
820
    yy_stack_print ((Bottom), (Top));                           \
 
821
} while (0)
 
822
 
 
823
 
 
824
/*------------------------------------------------.
 
825
| Report that the YYRULE is going to be reduced.  |
 
826
`------------------------------------------------*/
 
827
 
 
828
#if defined (__STDC__) || defined (__cplusplus)
 
829
static void
 
830
yy_reduce_print (int yyrule)
 
831
#else
 
832
static void
 
833
yy_reduce_print (yyrule)
 
834
    int yyrule;
 
835
#endif
 
836
{
 
837
  int yyi;
 
838
  unsigned int yylno = yyrline[yyrule];
 
839
  YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
 
840
             yyrule - 1, yylno);
 
841
  /* Print the symbols being reduced, and their result.  */
 
842
  for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
 
843
    YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
 
844
  YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
 
845
}
 
846
 
 
847
# define YY_REDUCE_PRINT(Rule)          \
 
848
do {                                    \
 
849
  if (yydebug)                          \
 
850
    yy_reduce_print (Rule);             \
 
851
} while (0)
 
852
 
 
853
/* Nonzero means print parse trace.  It is left uninitialized so that
 
854
   multiple parsers can coexist.  */
 
855
int yydebug;
 
856
#else /* !YYDEBUG */
 
857
# define YYDPRINTF(Args)
 
858
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
 
859
# define YY_STACK_PRINT(Bottom, Top)
 
860
# define YY_REDUCE_PRINT(Rule)
 
861
#endif /* !YYDEBUG */
 
862
 
 
863
 
 
864
/* YYINITDEPTH -- initial size of the parser's stacks.  */
 
865
#ifndef YYINITDEPTH
 
866
# define YYINITDEPTH 200
 
867
#endif
 
868
 
 
869
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
 
870
   if the built-in stack extension method is used).
 
871
 
 
872
   Do not make this value too large; the results are undefined if
 
873
   SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
 
874
   evaluated with infinite-precision integer arithmetic.  */
 
875
 
 
876
#ifndef YYMAXDEPTH
 
877
# define YYMAXDEPTH 10000
 
878
#endif
 
879
 
 
880
 
 
881
 
 
882
#if YYERROR_VERBOSE
 
883
 
 
884
# ifndef yystrlen
 
885
#  if defined (__GLIBC__) && defined (_STRING_H)
 
886
#   define yystrlen strlen
 
887
#  else
 
888
/* Return the length of YYSTR.  */
 
889
static YYSIZE_T
 
890
#   if defined (__STDC__) || defined (__cplusplus)
 
891
yystrlen (const char *yystr)
 
892
#   else
 
893
yystrlen (yystr)
 
894
     const char *yystr;
 
895
#   endif
 
896
{
 
897
  register const char *yys = yystr;
 
898
 
 
899
  while (*yys++ != '\0')
 
900
    continue;
 
901
 
 
902
  return yys - yystr - 1;
 
903
}
 
904
#  endif
 
905
# endif
 
906
 
 
907
# ifndef yystpcpy
 
908
#  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
 
909
#   define yystpcpy stpcpy
 
910
#  else
 
911
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
 
912
   YYDEST.  */
 
913
static char *
 
914
#   if defined (__STDC__) || defined (__cplusplus)
 
915
yystpcpy (char *yydest, const char *yysrc)
 
916
#   else
 
917
yystpcpy (yydest, yysrc)
 
918
     char *yydest;
 
919
     const char *yysrc;
 
920
#   endif
 
921
{
 
922
  register char *yyd = yydest;
 
923
  register const char *yys = yysrc;
 
924
 
 
925
  while ((*yyd++ = *yys++) != '\0')
 
926
    continue;
 
927
 
 
928
  return yyd - 1;
 
929
}
 
930
#  endif
 
931
# endif
 
932
 
 
933
#endif /* !YYERROR_VERBOSE */
 
934
 
 
935
 
 
936
 
 
937
#if YYDEBUG
 
938
/*--------------------------------.
 
939
| Print this symbol on YYOUTPUT.  |
 
940
`--------------------------------*/
 
941
 
 
942
#if defined (__STDC__) || defined (__cplusplus)
 
943
static void
 
944
yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
 
945
#else
 
946
static void
 
947
yysymprint (yyoutput, yytype, yyvaluep)
 
948
    FILE *yyoutput;
 
949
    int yytype;
 
950
    YYSTYPE *yyvaluep;
 
951
#endif
 
952
{
 
953
  /* Pacify ``unused variable'' warnings.  */
 
954
  (void) yyvaluep;
 
955
 
 
956
  if (yytype < YYNTOKENS)
 
957
    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
 
958
  else
 
959
    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
 
960
 
 
961
 
 
962
# ifdef YYPRINT
 
963
  if (yytype < YYNTOKENS)
 
964
    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
 
965
# endif
 
966
  switch (yytype)
 
967
    {
 
968
      default:
 
969
        break;
 
970
    }
 
971
  YYFPRINTF (yyoutput, ")");
 
972
}
 
973
 
 
974
#endif /* ! YYDEBUG */
 
975
/*-----------------------------------------------.
 
976
| Release the memory associated to this symbol.  |
 
977
`-----------------------------------------------*/
 
978
 
 
979
#if defined (__STDC__) || defined (__cplusplus)
 
980
static void
 
981
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
 
982
#else
 
983
static void
 
984
yydestruct (yymsg, yytype, yyvaluep)
 
985
    const char *yymsg;
 
986
    int yytype;
 
987
    YYSTYPE *yyvaluep;
 
988
#endif
 
989
{
 
990
  /* Pacify ``unused variable'' warnings.  */
 
991
  (void) yyvaluep;
 
992
 
 
993
  if (!yymsg)
 
994
    yymsg = "Deleting";
 
995
  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
 
996
 
 
997
  switch (yytype)
 
998
    {
 
999
 
 
1000
      default:
 
1001
        break;
 
1002
    }
 
1003
}
 
1004
 
 
1005
 
 
1006
/* Prevent warnings from -Wmissing-prototypes.  */
 
1007
 
 
1008
#ifdef YYPARSE_PARAM
 
1009
# if defined (__STDC__) || defined (__cplusplus)
 
1010
int yyparse (void *YYPARSE_PARAM);
 
1011
# else
 
1012
int yyparse ();
 
1013
# endif
 
1014
#else /* ! YYPARSE_PARAM */
 
1015
#if defined (__STDC__) || defined (__cplusplus)
 
1016
int yyparse (void);
 
1017
#else
 
1018
int yyparse ();
 
1019
#endif
 
1020
#endif /* ! YYPARSE_PARAM */
 
1021
 
 
1022
 
 
1023
 
 
1024
/* The look-ahead symbol.  */
 
1025
int yychar;
 
1026
 
 
1027
/* The semantic value of the look-ahead symbol.  */
 
1028
YYSTYPE yylval;
 
1029
 
 
1030
/* Number of syntax errors so far.  */
 
1031
int yynerrs;
 
1032
 
 
1033
 
 
1034
 
 
1035
/*----------.
 
1036
| yyparse.  |
 
1037
`----------*/
 
1038
 
 
1039
#ifdef YYPARSE_PARAM
 
1040
# if defined (__STDC__) || defined (__cplusplus)
 
1041
int yyparse (void *YYPARSE_PARAM)
 
1042
# else
 
1043
int yyparse (YYPARSE_PARAM)
 
1044
  void *YYPARSE_PARAM;
 
1045
# endif
 
1046
#else /* ! YYPARSE_PARAM */
 
1047
#if defined (__STDC__) || defined (__cplusplus)
 
1048
int
 
1049
yyparse (void)
 
1050
#else
 
1051
int
 
1052
yyparse ()
 
1053
 
 
1054
#endif
 
1055
#endif
 
1056
{
 
1057
 
 
1058
  register int yystate;
 
1059
  register int yyn;
 
1060
  int yyresult;
 
1061
  /* Number of tokens to shift before error messages enabled.  */
 
1062
  int yyerrstatus;
 
1063
  /* Look-ahead token as an internal (translated) token number.  */
 
1064
  int yytoken = 0;
 
1065
 
 
1066
  /* Three stacks and their tools:
 
1067
     `yyss': related to states,
 
1068
     `yyvs': related to semantic values,
 
1069
     `yyls': related to locations.
 
1070
 
 
1071
     Refer to the stacks thru separate pointers, to allow yyoverflow
 
1072
     to reallocate them elsewhere.  */
 
1073
 
 
1074
  /* The state stack.  */
 
1075
  short int yyssa[YYINITDEPTH];
 
1076
  short int *yyss = yyssa;
 
1077
  register short int *yyssp;
 
1078
 
 
1079
  /* The semantic value stack.  */
 
1080
  YYSTYPE yyvsa[YYINITDEPTH];
 
1081
  YYSTYPE *yyvs = yyvsa;
 
1082
  register YYSTYPE *yyvsp;
 
1083
 
 
1084
 
 
1085
 
 
1086
#define YYPOPSTACK   (yyvsp--, yyssp--)
 
1087
 
 
1088
  YYSIZE_T yystacksize = YYINITDEPTH;
 
1089
 
 
1090
  /* The variables used to return semantic value and location from the
 
1091
     action routines.  */
 
1092
  YYSTYPE yyval;
 
1093
 
 
1094
 
 
1095
  /* When reducing, the number of symbols on the RHS of the reduced
 
1096
     rule.  */
 
1097
  int yylen;
 
1098
 
 
1099
  YYDPRINTF ((stderr, "Starting parse\n"));
 
1100
 
 
1101
  yystate = 0;
 
1102
  yyerrstatus = 0;
 
1103
  yynerrs = 0;
 
1104
  yychar = YYEMPTY;             /* Cause a token to be read.  */
 
1105
 
 
1106
  /* Initialize stack pointers.
 
1107
     Waste one element of value and location stack
 
1108
     so that they stay on the same level as the state stack.
 
1109
     The wasted elements are never initialized.  */
 
1110
 
 
1111
  yyssp = yyss;
 
1112
  yyvsp = yyvs;
 
1113
 
 
1114
 
 
1115
  yyvsp[0] = yylval;
 
1116
 
 
1117
  goto yysetstate;
 
1118
 
 
1119
/*------------------------------------------------------------.
 
1120
| yynewstate -- Push a new state, which is found in yystate.  |
 
1121
`------------------------------------------------------------*/
 
1122
 yynewstate:
 
1123
  /* In all cases, when you get here, the value and location stacks
 
1124
     have just been pushed. so pushing a state here evens the stacks.
 
1125
     */
 
1126
  yyssp++;
 
1127
 
 
1128
 yysetstate:
 
1129
  *yyssp = yystate;
 
1130
 
 
1131
  if (yyss + yystacksize - 1 <= yyssp)
 
1132
    {
 
1133
      /* Get the current used size of the three stacks, in elements.  */
 
1134
      YYSIZE_T yysize = yyssp - yyss + 1;
 
1135
 
 
1136
#ifdef yyoverflow
 
1137
      {
 
1138
        /* Give user a chance to reallocate the stack. Use copies of
 
1139
           these so that the &'s don't force the real ones into
 
1140
           memory.  */
 
1141
        YYSTYPE *yyvs1 = yyvs;
 
1142
        short int *yyss1 = yyss;
 
1143
 
 
1144
 
 
1145
        /* Each stack pointer address is followed by the size of the
 
1146
           data in use in that stack, in bytes.  This used to be a
 
1147
           conditional around just the two extra args, but that might
 
1148
           be undefined if yyoverflow is a macro.  */
 
1149
        yyoverflow ("parser stack overflow",
 
1150
                    &yyss1, yysize * sizeof (*yyssp),
 
1151
                    &yyvs1, yysize * sizeof (*yyvsp),
 
1152
 
 
1153
                    &yystacksize);
 
1154
 
 
1155
        yyss = yyss1;
 
1156
        yyvs = yyvs1;
 
1157
      }
 
1158
#else /* no yyoverflow */
 
1159
# ifndef YYSTACK_RELOCATE
 
1160
      goto yyoverflowlab;
 
1161
# else
 
1162
      /* Extend the stack our own way.  */
 
1163
      if (YYMAXDEPTH <= yystacksize)
 
1164
        goto yyoverflowlab;
 
1165
      yystacksize *= 2;
 
1166
      if (YYMAXDEPTH < yystacksize)
 
1167
        yystacksize = YYMAXDEPTH;
 
1168
 
 
1169
      {
 
1170
        short int *yyss1 = yyss;
 
1171
        union yyalloc *yyptr =
 
1172
          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
 
1173
        if (! yyptr)
 
1174
          goto yyoverflowlab;
 
1175
        YYSTACK_RELOCATE (yyss);
 
1176
        YYSTACK_RELOCATE (yyvs);
 
1177
 
 
1178
#  undef YYSTACK_RELOCATE
 
1179
        if (yyss1 != yyssa)
 
1180
          YYSTACK_FREE (yyss1);
 
1181
      }
 
1182
# endif
 
1183
#endif /* no yyoverflow */
 
1184
 
 
1185
      yyssp = yyss + yysize - 1;
 
1186
      yyvsp = yyvs + yysize - 1;
 
1187
 
 
1188
 
 
1189
      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
 
1190
                  (unsigned long int) yystacksize));
 
1191
 
 
1192
      if (yyss + yystacksize - 1 <= yyssp)
 
1193
        YYABORT;
 
1194
    }
 
1195
 
 
1196
  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
 
1197
 
 
1198
  goto yybackup;
 
1199
 
 
1200
/*-----------.
 
1201
| yybackup.  |
 
1202
`-----------*/
 
1203
yybackup:
 
1204
 
 
1205
/* Do appropriate processing given the current state.  */
 
1206
/* Read a look-ahead token if we need one and don't already have one.  */
 
1207
/* yyresume: */
 
1208
 
 
1209
  /* First try to decide what to do without reference to look-ahead token.  */
 
1210
 
 
1211
  yyn = yypact[yystate];
 
1212
  if (yyn == YYPACT_NINF)
 
1213
    goto yydefault;
 
1214
 
 
1215
  /* Not known => get a look-ahead token if don't already have one.  */
 
1216
 
 
1217
  /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
 
1218
  if (yychar == YYEMPTY)
 
1219
    {
 
1220
      YYDPRINTF ((stderr, "Reading a token: "));
 
1221
      yychar = YYLEX;
 
1222
    }
 
1223
 
 
1224
  if (yychar <= YYEOF)
 
1225
    {
 
1226
      yychar = yytoken = YYEOF;
 
1227
      YYDPRINTF ((stderr, "Now at end of input.\n"));
 
1228
    }
 
1229
  else
 
1230
    {
 
1231
      yytoken = YYTRANSLATE (yychar);
 
1232
      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
 
1233
    }
 
1234
 
 
1235
  /* If the proper action on seeing token YYTOKEN is to reduce or to
 
1236
     detect an error, take that action.  */
 
1237
  yyn += yytoken;
 
1238
  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
 
1239
    goto yydefault;
 
1240
  yyn = yytable[yyn];
 
1241
  if (yyn <= 0)
 
1242
    {
 
1243
      if (yyn == 0 || yyn == YYTABLE_NINF)
 
1244
        goto yyerrlab;
 
1245
      yyn = -yyn;
 
1246
      goto yyreduce;
 
1247
    }
 
1248
 
 
1249
  if (yyn == YYFINAL)
 
1250
    YYACCEPT;
 
1251
 
 
1252
  /* Shift the look-ahead token.  */
 
1253
  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
 
1254
 
 
1255
  /* Discard the token being shifted unless it is eof.  */
 
1256
  if (yychar != YYEOF)
 
1257
    yychar = YYEMPTY;
 
1258
 
 
1259
  *++yyvsp = yylval;
 
1260
 
 
1261
 
 
1262
  /* Count tokens shifted since error; after three, turn off error
 
1263
     status.  */
 
1264
  if (yyerrstatus)
 
1265
    yyerrstatus--;
 
1266
 
 
1267
  yystate = yyn;
 
1268
  goto yynewstate;
 
1269
 
 
1270
 
 
1271
/*-----------------------------------------------------------.
 
1272
| yydefault -- do the default action for the current state.  |
 
1273
`-----------------------------------------------------------*/
 
1274
yydefault:
 
1275
  yyn = yydefact[yystate];
 
1276
  if (yyn == 0)
 
1277
    goto yyerrlab;
 
1278
  goto yyreduce;
 
1279
 
 
1280
 
 
1281
/*-----------------------------.
 
1282
| yyreduce -- Do a reduction.  |
 
1283
`-----------------------------*/
 
1284
yyreduce:
 
1285
  /* yyn is the number of a rule to reduce with.  */
 
1286
  yylen = yyr2[yyn];
 
1287
 
 
1288
  /* If YYLEN is nonzero, implement the default value of the action:
 
1289
     `$$ = $1'.
 
1290
 
 
1291
     Otherwise, the following line sets YYVAL to garbage.
 
1292
     This behavior is undocumented and Bison
 
1293
     users should not rely upon it.  Assigning to YYVAL
 
1294
     unconditionally makes the parser a bit smaller, and it avoids a
 
1295
     GCC warning that YYVAL may be used uninitialized.  */
 
1296
  yyval = yyvsp[1-yylen];
 
1297
 
 
1298
 
 
1299
  YY_REDUCE_PRINT (yyn);
 
1300
  switch (yyn)
 
1301
    {
 
1302
        case 11:
 
1303
#line 265 "ibnl_parser.yy"
 
1304
    { ibnlMakeSubInstAttribute((yyvsp[-4].sval),(yyvsp[-2].sval),(yyvsp[0].sval)); }
 
1305
    break;
 
1306
 
 
1307
  case 12:
 
1308
#line 266 "ibnl_parser.yy"
 
1309
    {
 
1310
      char buf[16];
 
1311
      sprintf(buf, "%d", (yyvsp[0].ival));
 
1312
      ibnlMakeSubInstAttribute((yyvsp[-4].sval),(yyvsp[-2].sval),buf);
 
1313
   }
 
1314
    break;
 
1315
 
 
1316
  case 13:
 
1317
#line 271 "ibnl_parser.yy"
 
1318
    {ibnlMakeSubInstAttribute((yyvsp[-2].sval),(yyvsp[0].sval),NULL); }
 
1319
    break;
 
1320
 
 
1321
  case 14:
 
1322
#line 275 "ibnl_parser.yy"
 
1323
    { gIsTopSystem = 1; }
 
1324
    break;
 
1325
 
 
1326
  case 15:
 
1327
#line 276 "ibnl_parser.yy"
 
1328
    { ibnlMakeSystem(gSysNames); }
 
1329
    break;
 
1330
 
 
1331
  case 17:
 
1332
#line 282 "ibnl_parser.yy"
 
1333
    { gIsTopSystem = 0; }
 
1334
    break;
 
1335
 
 
1336
  case 18:
 
1337
#line 283 "ibnl_parser.yy"
 
1338
    { ibnlMakeSystem(gSysNames); }
 
1339
    break;
 
1340
 
 
1341
  case 22:
 
1342
#line 292 "ibnl_parser.yy"
 
1343
    { gSysNames.push_back((yyvsp[0].sval)); }
 
1344
    break;
 
1345
 
 
1346
  case 27:
 
1347
#line 305 "ibnl_parser.yy"
 
1348
    { ibnlMakeNode((yyvsp[-3].tval),(yyvsp[-2].ival),(yyvsp[-1].sval),(yyvsp[0].sval)); }
 
1349
    break;
 
1350
 
 
1351
  case 32:
 
1352
#line 318 "ibnl_parser.yy"
 
1353
    {
 
1354
      ibnlMakeNodeToNodeConn((yyvsp[-8].ival), (yyvsp[-6].sval), (yyvsp[-4].sval), (yyvsp[-1].sval), (yyvsp[0].ival));
 
1355
    }
 
1356
    break;
 
1357
 
 
1358
  case 33:
 
1359
#line 321 "ibnl_parser.yy"
 
1360
    {
 
1361
      ibnlMakeNodeToNodeConn((yyvsp[-6].ival), (yyvsp[-4].sval), "2.5", (yyvsp[-1].sval), (yyvsp[0].ival));
 
1362
    }
 
1363
    break;
 
1364
 
 
1365
  case 34:
 
1366
#line 324 "ibnl_parser.yy"
 
1367
    {
 
1368
      ibnlMakeNodeToNodeConn((yyvsp[-6].ival), "4x", (yyvsp[-4].sval), (yyvsp[-1].sval), (yyvsp[0].ival));
 
1369
    }
 
1370
    break;
 
1371
 
 
1372
  case 35:
 
1373
#line 327 "ibnl_parser.yy"
 
1374
    {
 
1375
      ibnlMakeNodeToNodeConn((yyvsp[-4].ival), "4x", "2.5", (yyvsp[-1].sval), (yyvsp[0].ival));
 
1376
    }
 
1377
    break;
 
1378
 
 
1379
  case 36:
 
1380
#line 333 "ibnl_parser.yy"
 
1381
    {
 
1382
      ibnlMakeNodeToPortConn((yyvsp[-7].ival), (yyvsp[-5].sval), (yyvsp[-3].sval), (yyvsp[0].sval));
 
1383
    }
 
1384
    break;
 
1385
 
 
1386
  case 37:
 
1387
#line 336 "ibnl_parser.yy"
 
1388
    {
 
1389
      ibnlMakeNodeToPortConn((yyvsp[-5].ival), (yyvsp[-3].sval), "2.5", (yyvsp[0].sval));
 
1390
    }
 
1391
    break;
 
1392
 
 
1393
  case 38:
 
1394
#line 339 "ibnl_parser.yy"
 
1395
    {
 
1396
      ibnlMakeNodeToPortConn((yyvsp[-5].ival), "4x", (yyvsp[-3].sval), (yyvsp[0].sval));
 
1397
    }
 
1398
    break;
 
1399
 
 
1400
  case 39:
 
1401
#line 342 "ibnl_parser.yy"
 
1402
    {
 
1403
      ibnlMakeNodeToPortConn((yyvsp[-3].ival), "4x", "2.5", (yyvsp[0].sval));
 
1404
    }
 
1405
    break;
 
1406
 
 
1407
  case 42:
 
1408
#line 353 "ibnl_parser.yy"
 
1409
    { ibnlMakeSubsystem((yyvsp[-1].sval),(yyvsp[0].sval)); }
 
1410
    break;
 
1411
 
 
1412
  case 45:
 
1413
#line 361 "ibnl_parser.yy"
 
1414
    { ibnlRecordModification((yyvsp[-2].sval),(yyvsp[0].sval)); }
 
1415
    break;
 
1416
 
 
1417
  case 50:
 
1418
#line 374 "ibnl_parser.yy"
 
1419
    {
 
1420
      ibnlMakeSubsystemToSubsystemConn((yyvsp[-8].sval), (yyvsp[-6].sval), (yyvsp[-4].sval), (yyvsp[-1].sval), (yyvsp[0].sval));
 
1421
    }
 
1422
    break;
 
1423
 
 
1424
  case 51:
 
1425
#line 377 "ibnl_parser.yy"
 
1426
    {
 
1427
      ibnlMakeSubsystemToSubsystemConn((yyvsp[-6].sval), (yyvsp[-4].sval), "2.5", (yyvsp[-1].sval), (yyvsp[0].sval));
 
1428
    }
 
1429
    break;
 
1430
 
 
1431
  case 52:
 
1432
#line 380 "ibnl_parser.yy"
 
1433
    {
 
1434
      ibnlMakeSubsystemToSubsystemConn((yyvsp[-6].sval), "4x", (yyvsp[-4].sval), (yyvsp[-1].sval), (yyvsp[0].sval));
 
1435
    }
 
1436
    break;
 
1437
 
 
1438
  case 53:
 
1439
#line 383 "ibnl_parser.yy"
 
1440
    {
 
1441
      ibnlMakeSubsystemToSubsystemConn((yyvsp[-4].sval), "4x", "2.5", (yyvsp[-1].sval), (yyvsp[0].sval));
 
1442
    }
 
1443
    break;
 
1444
 
 
1445
  case 54:
 
1446
#line 389 "ibnl_parser.yy"
 
1447
    {
 
1448
      ibnlMakeSubsystemToPortConn((yyvsp[-7].sval), (yyvsp[-5].sval), (yyvsp[-3].sval), (yyvsp[0].sval));
 
1449
    }
 
1450
    break;
 
1451
 
 
1452
  case 55:
 
1453
#line 392 "ibnl_parser.yy"
 
1454
    {
 
1455
      ibnlMakeSubsystemToPortConn((yyvsp[-5].sval), (yyvsp[-3].sval), "2.5", (yyvsp[0].sval));
 
1456
    }
 
1457
    break;
 
1458
 
 
1459
  case 56:
 
1460
#line 395 "ibnl_parser.yy"
 
1461
    {
 
1462
      ibnlMakeSubsystemToPortConn((yyvsp[-5].sval), "4x", (yyvsp[-3].sval), (yyvsp[0].sval));
 
1463
    }
 
1464
    break;
 
1465
 
 
1466
  case 57:
 
1467
#line 398 "ibnl_parser.yy"
 
1468
    {
 
1469
      ibnlMakeSubsystemToPortConn((yyvsp[-3].sval), "4x", "2.5", (yyvsp[0].sval));
 
1470
    }
 
1471
    break;
 
1472
 
 
1473
 
 
1474
    }
 
1475
 
 
1476
/* Line 1037 of yacc.c.  */
 
1477
#line 1478 "ibnl_parser.cc"
 
1478
 
 
1479
  yyvsp -= yylen;
 
1480
  yyssp -= yylen;
 
1481
 
 
1482
 
 
1483
  YY_STACK_PRINT (yyss, yyssp);
 
1484
 
 
1485
  *++yyvsp = yyval;
 
1486
 
 
1487
 
 
1488
  /* Now `shift' the result of the reduction.  Determine what state
 
1489
     that goes to, based on the state we popped back to and the rule
 
1490
     number reduced by.  */
 
1491
 
 
1492
  yyn = yyr1[yyn];
 
1493
 
 
1494
  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
 
1495
  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
 
1496
    yystate = yytable[yystate];
 
1497
  else
 
1498
    yystate = yydefgoto[yyn - YYNTOKENS];
 
1499
 
 
1500
  goto yynewstate;
 
1501
 
 
1502
 
 
1503
/*------------------------------------.
 
1504
| yyerrlab -- here on detecting error |
 
1505
`------------------------------------*/
 
1506
yyerrlab:
 
1507
  /* If not already recovering from an error, report this error.  */
 
1508
  if (!yyerrstatus)
 
1509
    {
 
1510
      ++yynerrs;
 
1511
#if YYERROR_VERBOSE
 
1512
      yyn = yypact[yystate];
 
1513
 
 
1514
      if (YYPACT_NINF < yyn && yyn < YYLAST)
 
1515
        {
 
1516
          YYSIZE_T yysize = 0;
 
1517
          int yytype = YYTRANSLATE (yychar);
 
1518
          const char* yyprefix;
 
1519
          char *yymsg;
 
1520
          int yyx;
 
1521
 
 
1522
          /* Start YYX at -YYN if negative to avoid negative indexes in
 
1523
             YYCHECK.  */
 
1524
          int yyxbegin = yyn < 0 ? -yyn : 0;
 
1525
 
 
1526
          /* Stay within bounds of both yycheck and yytname.  */
 
1527
          int yychecklim = YYLAST - yyn;
 
1528
          int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
 
1529
          int yycount = 0;
 
1530
 
 
1531
          yyprefix = ", expecting ";
 
1532
          for (yyx = yyxbegin; yyx < yyxend; ++yyx)
 
1533
            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
 
1534
              {
 
1535
                yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
 
1536
                yycount += 1;
 
1537
                if (yycount == 5)
 
1538
                  {
 
1539
                    yysize = 0;
 
1540
                    break;
 
1541
                  }
 
1542
              }
 
1543
          yysize += (sizeof ("syntax error, unexpected ")
 
1544
                     + yystrlen (yytname[yytype]));
 
1545
          yymsg = (char *) YYSTACK_ALLOC (yysize);
 
1546
          if (yymsg != 0)
 
1547
            {
 
1548
              char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
 
1549
              yyp = yystpcpy (yyp, yytname[yytype]);
 
1550
 
 
1551
              if (yycount < 5)
 
1552
                {
 
1553
                  yyprefix = ", expecting ";
 
1554
                  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
 
1555
                    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
 
1556
                      {
 
1557
                        yyp = yystpcpy (yyp, yyprefix);
 
1558
                        yyp = yystpcpy (yyp, yytname[yyx]);
 
1559
                        yyprefix = " or ";
 
1560
                      }
 
1561
                }
 
1562
              yyerror (yymsg);
 
1563
              YYSTACK_FREE (yymsg);
 
1564
            }
 
1565
          else
 
1566
            yyerror ("syntax error; also virtual memory exhausted");
 
1567
        }
 
1568
      else
 
1569
#endif /* YYERROR_VERBOSE */
 
1570
        yyerror ("syntax error");
 
1571
    }
 
1572
 
 
1573
 
 
1574
 
 
1575
  if (yyerrstatus == 3)
 
1576
    {
 
1577
      /* If just tried and failed to reuse look-ahead token after an
 
1578
         error, discard it.  */
 
1579
 
 
1580
      if (yychar <= YYEOF)
 
1581
        {
 
1582
          /* If at end of input, pop the error token,
 
1583
             then the rest of the stack, then return failure.  */
 
1584
          if (yychar == YYEOF)
 
1585
             for (;;)
 
1586
               {
 
1587
 
 
1588
                 YYPOPSTACK;
 
1589
                 if (yyssp == yyss)
 
1590
                   YYABORT;
 
1591
                 yydestruct ("Error: popping",
 
1592
                             yystos[*yyssp], yyvsp);
 
1593
               }
 
1594
        }
 
1595
      else
 
1596
        {
 
1597
          yydestruct ("Error: discarding", yytoken, &yylval);
 
1598
          yychar = YYEMPTY;
 
1599
        }
 
1600
    }
 
1601
 
 
1602
  /* Else will try to reuse look-ahead token after shifting the error
 
1603
     token.  */
 
1604
  goto yyerrlab1;
 
1605
 
 
1606
 
 
1607
/*---------------------------------------------------.
 
1608
| yyerrorlab -- error raised explicitly by YYERROR.  |
 
1609
`---------------------------------------------------*/
 
1610
yyerrorlab:
 
1611
 
 
1612
#ifdef __GNUC__
 
1613
  /* Pacify GCC when the user code never invokes YYERROR and the label
 
1614
     yyerrorlab therefore never appears in user code.  */
 
1615
  if (0)
 
1616
     goto yyerrorlab;
 
1617
#endif
 
1618
 
 
1619
yyvsp -= yylen;
 
1620
  yyssp -= yylen;
 
1621
  yystate = *yyssp;
 
1622
  goto yyerrlab1;
 
1623
 
 
1624
 
 
1625
/*-------------------------------------------------------------.
 
1626
| yyerrlab1 -- common code for both syntax error and YYERROR.  |
 
1627
`-------------------------------------------------------------*/
 
1628
yyerrlab1:
 
1629
  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
 
1630
 
 
1631
  for (;;)
 
1632
    {
 
1633
      yyn = yypact[yystate];
 
1634
      if (yyn != YYPACT_NINF)
 
1635
        {
 
1636
          yyn += YYTERROR;
 
1637
          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
 
1638
            {
 
1639
              yyn = yytable[yyn];
 
1640
              if (0 < yyn)
 
1641
                break;
 
1642
            }
 
1643
        }
 
1644
 
 
1645
      /* Pop the current state because it cannot handle the error token.  */
 
1646
      if (yyssp == yyss)
 
1647
        YYABORT;
 
1648
 
 
1649
 
 
1650
      yydestruct ("Error: popping", yystos[yystate], yyvsp);
 
1651
      YYPOPSTACK;
 
1652
      yystate = *yyssp;
 
1653
      YY_STACK_PRINT (yyss, yyssp);
 
1654
    }
 
1655
 
 
1656
  if (yyn == YYFINAL)
 
1657
    YYACCEPT;
 
1658
 
 
1659
  *++yyvsp = yylval;
 
1660
 
 
1661
 
 
1662
  /* Shift the error token. */
 
1663
  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
 
1664
 
 
1665
  yystate = yyn;
 
1666
  goto yynewstate;
 
1667
 
 
1668
 
 
1669
/*-------------------------------------.
 
1670
| yyacceptlab -- YYACCEPT comes here.  |
 
1671
`-------------------------------------*/
 
1672
yyacceptlab:
 
1673
  yyresult = 0;
 
1674
  goto yyreturn;
 
1675
 
 
1676
/*-----------------------------------.
 
1677
| yyabortlab -- YYABORT comes here.  |
 
1678
`-----------------------------------*/
 
1679
yyabortlab:
 
1680
  yydestruct ("Error: discarding lookahead",
 
1681
              yytoken, &yylval);
 
1682
  yychar = YYEMPTY;
 
1683
  yyresult = 1;
 
1684
  goto yyreturn;
 
1685
 
 
1686
#ifndef yyoverflow
 
1687
/*----------------------------------------------.
 
1688
| yyoverflowlab -- parser overflow comes here.  |
 
1689
`----------------------------------------------*/
 
1690
yyoverflowlab:
 
1691
  yyerror ("parser stack overflow");
 
1692
  yyresult = 2;
 
1693
  /* Fall through.  */
 
1694
#endif
 
1695
 
 
1696
yyreturn:
 
1697
#ifndef yyoverflow
 
1698
  if (yyss != yyssa)
 
1699
    YYSTACK_FREE (yyss);
 
1700
#endif
 
1701
  return yyresult;
 
1702
}
 
1703
 
 
1704
 
 
1705
#line 403 "ibnl_parser.yy"
 
1706
 
 
1707
 
 
1708
int yyerror(char *msg)
 
1709
{
 
1710
  printf("-E-ibnlParse:%s at line:%ld\n", msg, lineNum);
 
1711
  ibnlErr = 1;
 
1712
  return 1;
 
1713
}
 
1714
 
 
1715
/* parse apollo route dump file */
 
1716
int ibnlParseSysDefs (IBSystemsCollection *p_sysColl, const char *fileName) {
 
1717
  extern FILE * yyin;
 
1718
 
 
1719
  gp_sysColl = p_sysColl;
 
1720
  gp_fileName = fileName;
 
1721
 
 
1722
  /* open the file */
 
1723
  yyin = fopen(fileName,"r");
 
1724
  if (!yyin) {
 
1725
         printf("-E- Fail to Open File:%s\n", fileName);
 
1726
         return(1);
 
1727
  }
 
1728
  if (FabricUtilsVerboseLevel & FABU_LOG_VERBOSE)
 
1729
     printf("-I- Parsing:%s\n", fileName);
 
1730
 
 
1731
  ibnlErr = 0;
 
1732
  lineNum = 1;
 
1733
  /* parse it */
 
1734
  yyparse();
 
1735
 
 
1736
  fclose(yyin);
 
1737
  return(ibnlErr);
 
1738
}
 
1739
 
 
1740
 
 
1741