| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439 |
- /* A Bison parser, made from dcParser.yxx
- by GNU Bison version 1.28 */
- #define YYBISON 1 /* Identify Bison output. */
- #define yyparse dcyyparse
- #define yylex dcyylex
- #define yyerror dcyyerror
- #define yylval dcyylval
- #define yychar dcyychar
- #define yydebug dcyydebug
- #define yynerrs dcyynerrs
- #define INTEGER 257
- #define REAL 258
- #define STRING 259
- #define HEX_STRING 260
- #define IDENTIFIER 261
- #define KW_DCLASS 262
- #define KW_INT8 263
- #define KW_INT16 264
- #define KW_INT32 265
- #define KW_INT64 266
- #define KW_UINT8 267
- #define KW_UINT16 268
- #define KW_UINT32 269
- #define KW_UINT64 270
- #define KW_FLOAT64 271
- #define KW_STRING 272
- #define KW_BLOB 273
- #define KW_INT8ARRAY 274
- #define KW_INT16ARRAY 275
- #define KW_INT32ARRAY 276
- #define KW_UINT8ARRAY 277
- #define KW_UINT16ARRAY 278
- #define KW_UINT32ARRAY 279
- #define KW_UINT32UINT8ARRAY 280
- #define KW_MOL 281
- #define KW_REQUIRED 282
- #define KW_BROADCAST 283
- #define KW_P2P 284
- #define KW_RAM 285
- #define KW_DB 286
- #define KW_CLSEND 287
- #define KW_CLRECV 288
- #define KW_OWNSEND 289
- #line 6 "dcParser.yxx"
- #include "dcLexerDefs.h"
- #include "dcParserDefs.h"
- #include "dcFile.h"
- #include "dcClass.h"
- #include "dcAtomicField.h"
- #include "dcMolecularField.h"
- // Because our token type contains objects of type string, which
- // require correct copy construction (and not simply memcpying), we
- // cannot use bison's built-in auto-stack-grow feature. As an easy
- // solution, we ensure here that we have enough yacc stack to start
- // with, and that it doesn't ever try to grow.
- #define YYINITDEPTH 1000
- #define YYMAXDEPTH 1000
- static DCFile *dc_file = (DCFile *)NULL;
- static DCClass *current_class = (DCClass *)NULL;
- static DCAtomicField *current_atomic = (DCAtomicField *)NULL;
- static DCMolecularField *current_molecular = (DCMolecularField *)NULL;
- static DCAtomicField::ElementType atomic_element;
- ////////////////////////////////////////////////////////////////////
- // Defining the interface to the parser.
- ////////////////////////////////////////////////////////////////////
- void
- dc_init_parser(istream &in, const string &filename, DCFile &file) {
- dc_file = &file;
- dc_init_lexer(in, filename);
- }
- void
- dc_cleanup_parser() {
- dc_file = (DCFile *)NULL;
- }
- #include <stdio.h>
- #ifndef __cplusplus
- #ifndef __STDC__
- #define const
- #endif
- #endif
- #define YYFINAL 101
- #define YYFLAG -32768
- #define YYNTBASE 46
- #define YYTRANSLATE(x) ((unsigned)(x) <= 289 ? yytranslate[x] : 71)
- static const char yytranslate[] = { 0,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 41,
- 42, 45, 2, 40, 2, 2, 43, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 39, 36, 2,
- 44, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 37, 2, 38, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
- 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
- 27, 28, 29, 30, 31, 32, 33, 34, 35
- };
- #if YYDEBUG != 0
- static const short yyprhs[] = { 0,
- 0, 2, 5, 8, 9, 17, 19, 21, 24, 26,
- 30, 32, 35, 38, 41, 42, 49, 51, 53, 55,
- 57, 61, 62, 66, 68, 72, 75, 79, 83, 87,
- 91, 97, 99, 102, 104, 106, 108, 112, 114, 116,
- 118, 120, 124, 128, 132, 134, 136, 138, 140, 142,
- 144, 146, 148, 150, 152, 154, 156, 158, 160, 162,
- 164, 166, 168, 170, 173, 176, 179, 182, 185, 188,
- 191, 194, 195, 200, 202, 206
- };
- static const short yyrhs[] = { 70,
- 0, 46, 36, 0, 46, 47, 0, 0, 8, 7,
- 48, 50, 37, 52, 38, 0, 7, 0, 70, 0,
- 39, 51, 0, 49, 0, 51, 40, 49, 0, 70,
- 0, 52, 36, 0, 52, 53, 0, 52, 67, 0,
- 0, 7, 41, 54, 56, 42, 66, 0, 7, 0,
- 70, 0, 57, 0, 58, 0, 57, 40, 58, 0,
- 0, 65, 59, 60, 0, 70, 0, 60, 43, 3,
- 0, 60, 7, 0, 60, 44, 3, 0, 60, 44,
- 4, 0, 60, 44, 5, 0, 60, 44, 6, 0,
- 60, 44, 37, 61, 38, 0, 70, 0, 63, 62,
- 0, 70, 0, 40, 0, 64, 0, 63, 40, 64,
- 0, 3, 0, 4, 0, 5, 0, 6, 0, 3,
- 45, 3, 0, 4, 45, 3, 0, 6, 45, 3,
- 0, 9, 0, 10, 0, 11, 0, 12, 0, 13,
- 0, 14, 0, 15, 0, 16, 0, 17, 0, 18,
- 0, 19, 0, 20, 0, 21, 0, 22, 0, 23,
- 0, 24, 0, 25, 0, 26, 0, 70, 0, 66,
- 28, 0, 66, 29, 0, 66, 30, 0, 66, 31,
- 0, 66, 32, 0, 66, 33, 0, 66, 34, 0,
- 66, 35, 0, 0, 7, 39, 68, 69, 0, 55,
- 0, 69, 40, 55, 0, 0
- };
- #endif
- #if YYDEBUG != 0
- static const short yyrline[] = { 0,
- 87, 89, 90, 93, 102, 105, 119, 121, 124, 131,
- 139, 141, 142, 143, 146, 155, 158, 174, 176, 179,
- 181, 184, 191, 196, 198, 202, 206, 212, 218, 224,
- 230, 240, 242, 245, 247, 250, 252, 255, 262, 268,
- 274, 280, 289, 298, 309, 314, 318, 322, 326, 330,
- 334, 338, 342, 346, 350, 354, 358, 362, 366, 370,
- 374, 378, 384, 386, 390, 394, 398, 402, 406, 410,
- 414, 420, 430, 432, 439, 452
- };
- #endif
- #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
- static const char * const yytname[] = { "$","error","$undefined.","INTEGER",
- "REAL","STRING","HEX_STRING","IDENTIFIER","KW_DCLASS","KW_INT8","KW_INT16","KW_INT32",
- "KW_INT64","KW_UINT8","KW_UINT16","KW_UINT32","KW_UINT64","KW_FLOAT64","KW_STRING",
- "KW_BLOB","KW_INT8ARRAY","KW_INT16ARRAY","KW_INT32ARRAY","KW_UINT8ARRAY","KW_UINT16ARRAY",
- "KW_UINT32ARRAY","KW_UINT32UINT8ARRAY","KW_MOL","KW_REQUIRED","KW_BROADCAST",
- "KW_P2P","KW_RAM","KW_DB","KW_CLSEND","KW_CLRECV","KW_OWNSEND","';'","'{'","'}'",
- "':'","','","'('","')'","'/'","'='","'*'","dc","dclass","@1","dclass_name","dclass_derivation",
- "base_list","dclass_fields","atomic_field","@2","atomic_name","parameter_list",
- "nonempty_parameter_list","atomic_element","@3","atomic_element_definition",
- "default_array","maybe_comma","default_array_def","default_array_element","type_token",
- "atomic_flags","molecular_field","@4","molecular_atom_list","empty", NULL
- };
- #endif
- static const short yyr1[] = { 0,
- 46, 46, 46, 48, 47, 49, 50, 50, 51, 51,
- 52, 52, 52, 52, 54, 53, 55, 56, 56, 57,
- 57, 59, 58, 60, 60, 60, 60, 60, 60, 60,
- 60, 61, 61, 62, 62, 63, 63, 64, 64, 64,
- 64, 64, 64, 64, 65, 65, 65, 65, 65, 65,
- 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
- 65, 65, 66, 66, 66, 66, 66, 66, 66, 66,
- 66, 68, 67, 69, 69, 70
- };
- static const short yyr2[] = { 0,
- 1, 2, 2, 0, 7, 1, 1, 2, 1, 3,
- 1, 2, 2, 2, 0, 6, 1, 1, 1, 1,
- 3, 0, 3, 1, 3, 2, 3, 3, 3, 3,
- 5, 1, 2, 1, 1, 1, 3, 1, 1, 1,
- 1, 3, 3, 3, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 2, 2, 2, 2, 2, 2, 2,
- 2, 0, 4, 1, 3, 0
- };
- static const short yydefact[] = { 76,
- 0, 1, 0, 2, 3, 4, 76, 0, 0, 7,
- 6, 9, 8, 76, 0, 0, 11, 10, 0, 12,
- 5, 13, 14, 72, 15, 0, 76, 17, 74, 73,
- 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
- 55, 56, 57, 58, 59, 60, 61, 62, 0, 19,
- 20, 22, 18, 0, 76, 0, 76, 75, 16, 63,
- 21, 23, 24, 64, 65, 66, 67, 68, 69, 70,
- 71, 26, 0, 0, 25, 27, 28, 29, 30, 76,
- 38, 39, 40, 41, 0, 76, 36, 32, 0, 0,
- 0, 31, 35, 33, 34, 42, 43, 44, 37, 0,
- 0
- };
- static const short yydefgoto[] = { 1,
- 5, 7, 12, 9, 13, 16, 22, 27, 29, 49,
- 50, 51, 57, 62, 85, 94, 86, 87, 52, 59,
- 23, 26, 30, 2
- };
- static const short yypact[] = {-32768,
- 3,-32768, -2,-32768,-32768,-32768, -31, 2, -27,-32768,
- -32768,-32768, -19,-32768, 2, -5,-32768,-32768, -35,-32768,
- -32768,-32768,-32768,-32768,-32768, 15, 42,-32768,-32768, -17,
- -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
- -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -18, -15,
- -32768,-32768,-32768, 15,-32768, 42,-32768,-32768, 52,-32768,
- -32768, -6,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
- -32768,-32768, 23, 9,-32768,-32768,-32768,-32768,-32768, 13,
- -16, -13,-32768, -11, -10, -4,-32768,-32768, 24, 27,
- 32,-32768, 13,-32768,-32768,-32768,-32768,-32768,-32768, 40,
- -32768
- };
- static const short yypgoto[] = {-32768,
- -32768,-32768, 26,-32768,-32768,-32768,-32768,-32768, -12,-32768,
- -32768, -9,-32768,-32768,-32768,-32768,-32768, -50,-32768,-32768,
- -32768,-32768,-32768, -7
- };
- #define YYLAST 87
- static const short yytable[] = { 10,
- 72, 19, 100, 24, 6, 25, 17, 8, 11, 14,
- 3, 76, 77, 78, 79, 81, 82, 83, 84, 53,
- 15, 28, 54, 55, 56, 75, 96, 92, 89, 97,
- 20, 90, 21, 91, 98, 93, 73, 74, 4, 101,
- 18, 58, 99, 0, 0, 80, 61, 60, 0, 63,
- 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
- 41, 42, 43, 44, 45, 46, 47, 48, 0, 0,
- 0, 0, 88, 0, 0, 0, 0, 0, 95, 64,
- 65, 66, 67, 68, 69, 70, 71
- };
- static const short yycheck[] = { 7,
- 7, 7, 0, 39, 7, 41, 14, 39, 7, 37,
- 8, 3, 4, 5, 6, 3, 4, 5, 6, 27,
- 40, 7, 40, 42, 40, 3, 3, 38, 45, 3,
- 36, 45, 38, 45, 3, 40, 43, 44, 36, 0,
- 15, 54, 93, -1, -1, 37, 56, 55, -1, 57,
- 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
- 19, 20, 21, 22, 23, 24, 25, 26, -1, -1,
- -1, -1, 80, -1, -1, -1, -1, -1, 86, 28,
- 29, 30, 31, 32, 33, 34, 35
- };
- /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
- #line 3 "/usr/share/bison.simple"
- /* This file comes from bison-1.28. */
- /* Skeleton output parser for bison,
- Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
- /* As a special exception, when this file is copied by Bison into a
- Bison output file, you may use that output file without restriction.
- This special exception was added by the Free Software Foundation
- in version 1.24 of Bison. */
- /* This is the parser code that is written into each bison parser
- when the %semantic_parser declaration is not specified in the grammar.
- It was written by Richard Stallman by simplifying the hairy parser
- used when %semantic_parser is specified. */
- #ifndef YYSTACK_USE_ALLOCA
- #ifdef alloca
- #define YYSTACK_USE_ALLOCA
- #else /* alloca not defined */
- #ifdef __GNUC__
- #define YYSTACK_USE_ALLOCA
- #define alloca __builtin_alloca
- #else /* not GNU C. */
- #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
- #define YYSTACK_USE_ALLOCA
- #include <alloca.h>
- #else /* not sparc */
- /* We think this test detects Watcom and Microsoft C. */
- /* This used to test MSDOS, but that is a bad idea
- since that symbol is in the user namespace. */
- #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
- #if 0 /* No need for malloc.h, which pollutes the namespace;
- instead, just don't use alloca. */
- #include <malloc.h>
- #endif
- #else /* not MSDOS, or __TURBOC__ */
- #if defined(_AIX)
- /* I don't know what this was needed for, but it pollutes the namespace.
- So I turned it off. rms, 2 May 1997. */
- /* #include <malloc.h> */
- #pragma alloca
- #define YYSTACK_USE_ALLOCA
- #else /* not MSDOS, or __TURBOC__, or _AIX */
- #if 0
- #ifdef __hpux /* [email protected] says this works for HPUX 9.05 and up,
- and on HPUX 10. Eventually we can turn this on. */
- #define YYSTACK_USE_ALLOCA
- #define alloca __builtin_alloca
- #endif /* __hpux */
- #endif
- #endif /* not _AIX */
- #endif /* not MSDOS, or __TURBOC__ */
- #endif /* not sparc */
- #endif /* not GNU C */
- #endif /* alloca not defined */
- #endif /* YYSTACK_USE_ALLOCA not defined */
- #ifdef YYSTACK_USE_ALLOCA
- #define YYSTACK_ALLOC alloca
- #else
- #define YYSTACK_ALLOC malloc
- #endif
- /* Note: there must be only one dollar sign in this file.
- It is replaced by the list of actions, each action
- as one case of the switch. */
- #define yyerrok (yyerrstatus = 0)
- #define yyclearin (yychar = YYEMPTY)
- #define YYEMPTY -2
- #define YYEOF 0
- #define YYACCEPT goto yyacceptlab
- #define YYABORT goto yyabortlab
- #define YYERROR goto yyerrlab1
- /* Like YYERROR except do call yyerror.
- This remains here temporarily to ease the
- transition to the new meaning of YYERROR, for GCC.
- Once GCC version 2 has supplanted version 1, this can go. */
- #define YYFAIL goto yyerrlab
- #define YYRECOVERING() (!!yyerrstatus)
- #define YYBACKUP(token, value) \
- do \
- if (yychar == YYEMPTY && yylen == 1) \
- { yychar = (token), yylval = (value); \
- yychar1 = YYTRANSLATE (yychar); \
- YYPOPSTACK; \
- goto yybackup; \
- } \
- else \
- { yyerror ("syntax error: cannot back up"); YYERROR; } \
- while (0)
- #define YYTERROR 1
- #define YYERRCODE 256
- #ifndef YYPURE
- #define YYLEX yylex()
- #endif
- #ifdef YYPURE
- #ifdef YYLSP_NEEDED
- #ifdef YYLEX_PARAM
- #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
- #else
- #define YYLEX yylex(&yylval, &yylloc)
- #endif
- #else /* not YYLSP_NEEDED */
- #ifdef YYLEX_PARAM
- #define YYLEX yylex(&yylval, YYLEX_PARAM)
- #else
- #define YYLEX yylex(&yylval)
- #endif
- #endif /* not YYLSP_NEEDED */
- #endif
- /* If nonreentrant, generate the variables here */
- #ifndef YYPURE
- int yychar; /* the lookahead symbol */
- YYSTYPE yylval; /* the semantic value of the */
- /* lookahead symbol */
- #ifdef YYLSP_NEEDED
- YYLTYPE yylloc; /* location data for the lookahead */
- /* symbol */
- #endif
- int yynerrs; /* number of parse errors so far */
- #endif /* not YYPURE */
- #if YYDEBUG != 0
- int yydebug; /* nonzero means print parse trace */
- /* Since this is uninitialized, it does not stop multiple parsers
- from coexisting. */
- #endif
- /* YYINITDEPTH indicates the initial size of the parser's stacks */
- #ifndef YYINITDEPTH
- #define YYINITDEPTH 200
- #endif
- /* YYMAXDEPTH is the maximum size the stacks can grow to
- (effective only if the built-in stack extension method is used). */
- #if YYMAXDEPTH == 0
- #undef YYMAXDEPTH
- #endif
- #ifndef YYMAXDEPTH
- #define YYMAXDEPTH 10000
- #endif
- /* Define __yy_memcpy. Note that the size argument
- should be passed with type unsigned int, because that is what the non-GCC
- definitions require. With GCC, __builtin_memcpy takes an arg
- of type size_t, but it can handle unsigned int. */
- #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
- #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
- #else /* not GNU C or C++ */
- #ifndef __cplusplus
- /* This is the most reliable way to avoid incompatibilities
- in available built-in functions on various systems. */
- static void
- __yy_memcpy (to, from, count)
- char *to;
- char *from;
- unsigned int count;
- {
- register char *f = from;
- register char *t = to;
- register int i = count;
- while (i-- > 0)
- *t++ = *f++;
- }
- #else /* __cplusplus */
- /* This is the most reliable way to avoid incompatibilities
- in available built-in functions on various systems. */
- static void
- __yy_memcpy (char *to, char *from, unsigned int count)
- {
- register char *t = to;
- register char *f = from;
- register int i = count;
- while (i-- > 0)
- *t++ = *f++;
- }
- #endif
- #endif
- #line 217 "/usr/share/bison.simple"
- /* The user can define YYPARSE_PARAM as the name of an argument to be passed
- into yyparse. The argument should have type void *.
- It should actually point to an object.
- Grammar actions can access the variable by casting it
- to the proper pointer type. */
- #ifdef YYPARSE_PARAM
- #ifdef __cplusplus
- #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
- #define YYPARSE_PARAM_DECL
- #else /* not __cplusplus */
- #define YYPARSE_PARAM_ARG YYPARSE_PARAM
- #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
- #endif /* not __cplusplus */
- #else /* not YYPARSE_PARAM */
- #define YYPARSE_PARAM_ARG
- #define YYPARSE_PARAM_DECL
- #endif /* not YYPARSE_PARAM */
- /* Prevent warning if -Wstrict-prototypes. */
- #ifdef __GNUC__
- #ifdef YYPARSE_PARAM
- int yyparse (void *);
- #else
- int yyparse (void);
- #endif
- #endif
- int
- yyparse(YYPARSE_PARAM_ARG)
- YYPARSE_PARAM_DECL
- {
- register int yystate;
- register int yyn;
- register short *yyssp;
- register YYSTYPE *yyvsp;
- int yyerrstatus; /* number of tokens to shift before error messages enabled */
- int yychar1 = 0; /* lookahead token as an internal (translated) token number */
- short yyssa[YYINITDEPTH]; /* the state stack */
- YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
- short *yyss = yyssa; /* refer to the stacks thru separate pointers */
- YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
- #ifdef YYLSP_NEEDED
- YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
- YYLTYPE *yyls = yylsa;
- YYLTYPE *yylsp;
- #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
- #else
- #define YYPOPSTACK (yyvsp--, yyssp--)
- #endif
- int yystacksize = YYINITDEPTH;
- int yyfree_stacks = 0;
- #ifdef YYPURE
- int yychar;
- YYSTYPE yylval;
- int yynerrs;
- #ifdef YYLSP_NEEDED
- YYLTYPE yylloc;
- #endif
- #endif
- YYSTYPE yyval; /* the variable used to return */
- /* semantic values from the action */
- /* routines */
- int yylen;
- #if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Starting parse\n");
- #endif
- yystate = 0;
- yyerrstatus = 0;
- yynerrs = 0;
- yychar = YYEMPTY; /* Cause a token to be read. */
- /* Initialize stack pointers.
- Waste one element of value and location stack
- so that they stay on the same level as the state stack.
- The wasted elements are never initialized. */
- yyssp = yyss - 1;
- yyvsp = yyvs;
- #ifdef YYLSP_NEEDED
- yylsp = yyls;
- #endif
- /* Push a new state, which is found in yystate . */
- /* In all cases, when you get here, the value and location stacks
- have just been pushed. so pushing a state here evens the stacks. */
- yynewstate:
- *++yyssp = yystate;
- if (yyssp >= yyss + yystacksize - 1)
- {
- /* Give user a chance to reallocate the stack */
- /* Use copies of these so that the &'s don't force the real ones into memory. */
- YYSTYPE *yyvs1 = yyvs;
- short *yyss1 = yyss;
- #ifdef YYLSP_NEEDED
- YYLTYPE *yyls1 = yyls;
- #endif
- /* Get the current used size of the three stacks, in elements. */
- int size = yyssp - yyss + 1;
- #ifdef yyoverflow
- /* Each stack pointer address is followed by the size of
- the data in use in that stack, in bytes. */
- #ifdef YYLSP_NEEDED
- /* This used to be a conditional around just the two extra args,
- but that might be undefined if yyoverflow is a macro. */
- yyoverflow("parser stack overflow",
- &yyss1, size * sizeof (*yyssp),
- &yyvs1, size * sizeof (*yyvsp),
- &yyls1, size * sizeof (*yylsp),
- &yystacksize);
- #else
- yyoverflow("parser stack overflow",
- &yyss1, size * sizeof (*yyssp),
- &yyvs1, size * sizeof (*yyvsp),
- &yystacksize);
- #endif
- yyss = yyss1; yyvs = yyvs1;
- #ifdef YYLSP_NEEDED
- yyls = yyls1;
- #endif
- #else /* no yyoverflow */
- /* Extend the stack our own way. */
- if (yystacksize >= YYMAXDEPTH)
- {
- yyerror("parser stack overflow");
- if (yyfree_stacks)
- {
- free (yyss);
- free (yyvs);
- #ifdef YYLSP_NEEDED
- free (yyls);
- #endif
- }
- return 2;
- }
- yystacksize *= 2;
- if (yystacksize > YYMAXDEPTH)
- yystacksize = YYMAXDEPTH;
- #ifndef YYSTACK_USE_ALLOCA
- yyfree_stacks = 1;
- #endif
- yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
- __yy_memcpy ((char *)yyss, (char *)yyss1,
- size * (unsigned int) sizeof (*yyssp));
- yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
- __yy_memcpy ((char *)yyvs, (char *)yyvs1,
- size * (unsigned int) sizeof (*yyvsp));
- #ifdef YYLSP_NEEDED
- yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
- __yy_memcpy ((char *)yyls, (char *)yyls1,
- size * (unsigned int) sizeof (*yylsp));
- #endif
- #endif /* no yyoverflow */
- yyssp = yyss + size - 1;
- yyvsp = yyvs + size - 1;
- #ifdef YYLSP_NEEDED
- yylsp = yyls + size - 1;
- #endif
- #if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Stack size increased to %d\n", yystacksize);
- #endif
- if (yyssp >= yyss + yystacksize - 1)
- YYABORT;
- }
- #if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Entering state %d\n", yystate);
- #endif
- goto yybackup;
- yybackup:
- /* Do appropriate processing given the current state. */
- /* Read a lookahead token if we need one and don't already have one. */
- /* yyresume: */
- /* First try to decide what to do without reference to lookahead token. */
- yyn = yypact[yystate];
- if (yyn == YYFLAG)
- goto yydefault;
- /* Not known => get a lookahead token if don't already have one. */
- /* yychar is either YYEMPTY or YYEOF
- or a valid token in external form. */
- if (yychar == YYEMPTY)
- {
- #if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Reading a token: ");
- #endif
- yychar = YYLEX;
- }
- /* Convert token to internal form (in yychar1) for indexing tables with */
- if (yychar <= 0) /* This means end of input. */
- {
- yychar1 = 0;
- yychar = YYEOF; /* Don't call YYLEX any more */
- #if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Now at end of input.\n");
- #endif
- }
- else
- {
- yychar1 = YYTRANSLATE(yychar);
- #if YYDEBUG != 0
- if (yydebug)
- {
- fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
- /* Give the individual parser a way to print the precise meaning
- of a token, for further debugging info. */
- #ifdef YYPRINT
- YYPRINT (stderr, yychar, yylval);
- #endif
- fprintf (stderr, ")\n");
- }
- #endif
- }
- yyn += yychar1;
- if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
- goto yydefault;
- yyn = yytable[yyn];
- /* yyn is what to do for this token type in this state.
- Negative => reduce, -yyn is rule number.
- Positive => shift, yyn is new state.
- New state is final state => don't bother to shift,
- just return success.
- 0, or most negative number => error. */
- if (yyn < 0)
- {
- if (yyn == YYFLAG)
- goto yyerrlab;
- yyn = -yyn;
- goto yyreduce;
- }
- else if (yyn == 0)
- goto yyerrlab;
- if (yyn == YYFINAL)
- YYACCEPT;
- /* Shift the lookahead token. */
- #if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
- #endif
- /* Discard the token being shifted unless it is eof. */
- if (yychar != YYEOF)
- yychar = YYEMPTY;
- *++yyvsp = yylval;
- #ifdef YYLSP_NEEDED
- *++yylsp = yylloc;
- #endif
- /* count tokens shifted since error; after three, turn off error status. */
- if (yyerrstatus) yyerrstatus--;
- yystate = yyn;
- goto yynewstate;
- /* Do the default action for the current state. */
- yydefault:
- yyn = yydefact[yystate];
- if (yyn == 0)
- goto yyerrlab;
- /* Do a reduction. yyn is the number of a rule to reduce with. */
- yyreduce:
- yylen = yyr2[yyn];
- if (yylen > 0)
- yyval = yyvsp[1-yylen]; /* implement default value of the action */
- #if YYDEBUG != 0
- if (yydebug)
- {
- int i;
- fprintf (stderr, "Reducing via rule %d (line %d), ",
- yyn, yyrline[yyn]);
- /* Print the symbols being reduced, and their result. */
- for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
- fprintf (stderr, "%s ", yytname[yyrhs[i]]);
- fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
- }
- #endif
- switch (yyn) {
- case 4:
- #line 95 "dcParser.yxx"
- {
- current_class = new DCClass;
- current_class->_name = yyvsp[0].str;
- if (!dc_file->add_class(current_class)) {
- yyerror("Duplicate class name: " + current_class->_name);
- }
- ;
- break;}
- case 6:
- #line 107 "dcParser.yxx"
- {
- DCFile::ClassesByName::const_iterator ni;
- ni = dc_file->_classes_by_name.find(yyvsp[0].str);
- if (ni == dc_file->_classes_by_name.end()) {
- yyerror("Unknown class: " + yyvsp[0].str);
- yyval.u.dclass = (DCClass *)NULL;
- } else {
- yyval.u.dclass = (*ni).second;
- }
- ;
- break;}
- case 9:
- #line 126 "dcParser.yxx"
- {
- if (yyvsp[0].u.dclass != (DCClass *)NULL) {
- current_class->_parents.push_back(yyvsp[0].u.dclass);
- }
- ;
- break;}
- case 10:
- #line 132 "dcParser.yxx"
- {
- if (yyvsp[0].u.dclass != (DCClass *)NULL) {
- current_class->_parents.push_back(yyvsp[0].u.dclass);
- }
- ;
- break;}
- case 15:
- #line 148 "dcParser.yxx"
- {
- current_atomic = new DCAtomicField;
- current_atomic->_name = yyvsp[-1].str;
- if (!current_class->add_field(current_atomic)) {
- yyerror("Duplicate field name: " + current_atomic->_name);
- }
- ;
- break;}
- case 17:
- #line 160 "dcParser.yxx"
- {
- DCField *field = current_class->get_field_by_name(yyvsp[0].str);
- yyval.u.atomic = (DCAtomicField *)NULL;
- if (field == (DCField *)NULL) {
- yyerror("Unknown field: " + yyvsp[0].str);
- } else {
- yyval.u.atomic = field->as_atomic_field();
- if (yyval.u.atomic == (DCAtomicField *)NULL) {
- yyerror("Not an atomic field: " + yyvsp[0].str);
- }
- }
- ;
- break;}
- case 22:
- #line 186 "dcParser.yxx"
- {
- atomic_element = DCAtomicField::ElementType();
- atomic_element._type = yyvsp[0].u.subatomic;
- ;
- break;}
- case 23:
- #line 191 "dcParser.yxx"
- {
- current_atomic->_elements.push_back(atomic_element);
- ;
- break;}
- case 25:
- #line 199 "dcParser.yxx"
- {
- atomic_element._divisor = yyvsp[0].u.integer;
- ;
- break;}
- case 26:
- #line 203 "dcParser.yxx"
- {
- atomic_element._name = yyvsp[0].str;
- ;
- break;}
- case 27:
- #line 207 "dcParser.yxx"
- {
- if (!atomic_element.set_default_value(yyvsp[0].u.integer)) {
- yyerror("Invalid default value: " + yyvsp[0].str);
- }
- ;
- break;}
- case 28:
- #line 213 "dcParser.yxx"
- {
- if (!atomic_element.set_default_value(yyvsp[0].u.real)) {
- yyerror("Invalid default value: " + yyvsp[0].str);
- }
- ;
- break;}
- case 29:
- #line 219 "dcParser.yxx"
- {
- if (!atomic_element.set_default_value(yyvsp[0].str)) {
- yyerror("Invalid default value: \"" + yyvsp[0].str + "\"");
- }
- ;
- break;}
- case 30:
- #line 225 "dcParser.yxx"
- {
- if (!atomic_element.set_default_value_literal(yyvsp[0].str)) {
- yyerror("Invalid default hex string value");
- }
- ;
- break;}
- case 31:
- #line 231 "dcParser.yxx"
- {
- if (!atomic_element.end_array()) {
- yyerror("Array default value inappropriate");
- } else {
- atomic_element._has_default_value = true;
- }
- ;
- break;}
- case 38:
- #line 257 "dcParser.yxx"
- {
- if (!atomic_element.add_default_value(yyvsp[0].u.integer)) {
- yyerror("Invalid default value: " + yyvsp[0].str);
- }
- ;
- break;}
- case 39:
- #line 263 "dcParser.yxx"
- {
- if (!atomic_element.add_default_value(yyvsp[0].u.real)) {
- yyerror("Invalid default value: " + yyvsp[0].str);
- }
- ;
- break;}
- case 40:
- #line 269 "dcParser.yxx"
- {
- if (!atomic_element.add_default_value(yyvsp[0].str)) {
- yyerror("Invalid default value: " + yyvsp[0].str);
- }
- ;
- break;}
- case 41:
- #line 275 "dcParser.yxx"
- {
- if (!atomic_element.add_default_value_literal(yyvsp[0].str)) {
- yyerror("Invalid hex literal in default array");
- }
- ;
- break;}
- case 42:
- #line 281 "dcParser.yxx"
- {
- for (int i = 0; i < yyvsp[0].u.integer; i++) {
- if (!atomic_element.add_default_value(yyvsp[-2].u.integer)) {
- yyerror("Invalid default value: " + yyvsp[-2].str);
- break;
- }
- }
- ;
- break;}
- case 43:
- #line 290 "dcParser.yxx"
- {
- for (int i = 0; i < yyvsp[0].u.integer; i++) {
- if (!atomic_element.add_default_value(yyvsp[-2].u.real)) {
- yyerror("Invalid default value: " + yyvsp[-2].str);
- break;
- }
- }
- ;
- break;}
- case 44:
- #line 299 "dcParser.yxx"
- {
- for (int i = 0; i < yyvsp[0].u.integer; i++) {
- if (!atomic_element.add_default_value_literal(yyvsp[-2].str)) {
- yyerror("Invalid hex literal in default array");
- break;
- }
- }
- ;
- break;}
- case 45:
- #line 311 "dcParser.yxx"
- {
- yyval.u.subatomic = ST_int8;
- ;
- break;}
- case 46:
- #line 315 "dcParser.yxx"
- {
- yyval.u.subatomic = ST_int16;
- ;
- break;}
- case 47:
- #line 319 "dcParser.yxx"
- {
- yyval.u.subatomic = ST_int32;
- ;
- break;}
- case 48:
- #line 323 "dcParser.yxx"
- {
- yyval.u.subatomic = ST_int64;
- ;
- break;}
- case 49:
- #line 327 "dcParser.yxx"
- {
- yyval.u.subatomic = ST_uint8;
- ;
- break;}
- case 50:
- #line 331 "dcParser.yxx"
- {
- yyval.u.subatomic = ST_uint16;
- ;
- break;}
- case 51:
- #line 335 "dcParser.yxx"
- {
- yyval.u.subatomic = ST_uint32;
- ;
- break;}
- case 52:
- #line 339 "dcParser.yxx"
- {
- yyval.u.subatomic = ST_uint64;
- ;
- break;}
- case 53:
- #line 343 "dcParser.yxx"
- {
- yyval.u.subatomic = ST_float64;
- ;
- break;}
- case 54:
- #line 347 "dcParser.yxx"
- {
- yyval.u.subatomic = ST_string;
- ;
- break;}
- case 55:
- #line 351 "dcParser.yxx"
- {
- yyval.u.subatomic = ST_blob;
- ;
- break;}
- case 56:
- #line 355 "dcParser.yxx"
- {
- yyval.u.subatomic = ST_int8array;
- ;
- break;}
- case 57:
- #line 359 "dcParser.yxx"
- {
- yyval.u.subatomic = ST_int16array;
- ;
- break;}
- case 58:
- #line 363 "dcParser.yxx"
- {
- yyval.u.subatomic = ST_int32array;
- ;
- break;}
- case 59:
- #line 367 "dcParser.yxx"
- {
- yyval.u.subatomic = ST_uint8array;
- ;
- break;}
- case 60:
- #line 371 "dcParser.yxx"
- {
- yyval.u.subatomic = ST_uint16array;
- ;
- break;}
- case 61:
- #line 375 "dcParser.yxx"
- {
- yyval.u.subatomic = ST_uint32array;
- ;
- break;}
- case 62:
- #line 379 "dcParser.yxx"
- {
- yyval.u.subatomic = ST_uint32uint8array;
- ;
- break;}
- case 64:
- #line 387 "dcParser.yxx"
- {
- current_atomic->_flags |= DCAtomicField::F_required;
- ;
- break;}
- case 65:
- #line 391 "dcParser.yxx"
- {
- current_atomic->_flags |= DCAtomicField::F_broadcast;
- ;
- break;}
- case 66:
- #line 395 "dcParser.yxx"
- {
- current_atomic->_flags |= DCAtomicField::F_p2p;
- ;
- break;}
- case 67:
- #line 399 "dcParser.yxx"
- {
- current_atomic->_flags |= DCAtomicField::F_ram;
- ;
- break;}
- case 68:
- #line 403 "dcParser.yxx"
- {
- current_atomic->_flags |= DCAtomicField::F_db;
- ;
- break;}
- case 69:
- #line 407 "dcParser.yxx"
- {
- current_atomic->_flags |= DCAtomicField::F_clsend;
- ;
- break;}
- case 70:
- #line 411 "dcParser.yxx"
- {
- current_atomic->_flags |= DCAtomicField::F_clrecv;
- ;
- break;}
- case 71:
- #line 415 "dcParser.yxx"
- {
- current_atomic->_flags |= DCAtomicField::F_ownsend;
- ;
- break;}
- case 72:
- #line 422 "dcParser.yxx"
- {
- current_molecular = new DCMolecularField;
- current_molecular->_name = yyvsp[-1].str;
- if (!current_class->add_field(current_molecular)) {
- yyerror("Duplicate field name: " + current_molecular->_name);
- }
- ;
- break;}
- case 74:
- #line 434 "dcParser.yxx"
- {
- if (yyvsp[0].u.atomic != (DCAtomicField *)NULL) {
- current_molecular->_fields.push_back(yyvsp[0].u.atomic);
- }
- ;
- break;}
- case 75:
- #line 440 "dcParser.yxx"
- {
- if (yyvsp[0].u.atomic != (DCAtomicField *)NULL) {
- current_molecular->_fields.push_back(yyvsp[0].u.atomic);
- if (current_molecular->_fields[0]->_flags != yyvsp[0].u.atomic->_flags) {
- yyerror("Mismatched flags in molecule between " +
- current_molecular->_fields[0]->_name + " and " +
- yyvsp[0].u.atomic->_name);
- }
- }
- ;
- break;}
- }
- /* the action file gets copied in in place of this dollarsign */
- #line 543 "/usr/share/bison.simple"
- yyvsp -= yylen;
- yyssp -= yylen;
- #ifdef YYLSP_NEEDED
- yylsp -= yylen;
- #endif
- #if YYDEBUG != 0
- if (yydebug)
- {
- short *ssp1 = yyss - 1;
- fprintf (stderr, "state stack now");
- while (ssp1 != yyssp)
- fprintf (stderr, " %d", *++ssp1);
- fprintf (stderr, "\n");
- }
- #endif
- *++yyvsp = yyval;
- #ifdef YYLSP_NEEDED
- yylsp++;
- if (yylen == 0)
- {
- yylsp->first_line = yylloc.first_line;
- yylsp->first_column = yylloc.first_column;
- yylsp->last_line = (yylsp-1)->last_line;
- yylsp->last_column = (yylsp-1)->last_column;
- yylsp->text = 0;
- }
- else
- {
- yylsp->last_line = (yylsp+yylen-1)->last_line;
- yylsp->last_column = (yylsp+yylen-1)->last_column;
- }
- #endif
- /* Now "shift" the result of the reduction.
- Determine what state that goes to,
- based on the state we popped back to
- and the rule number reduced by. */
- yyn = yyr1[yyn];
- yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
- if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
- yystate = yytable[yystate];
- else
- yystate = yydefgoto[yyn - YYNTBASE];
- goto yynewstate;
- yyerrlab: /* here on detecting error */
- if (! yyerrstatus)
- /* If not already recovering from an error, report this error. */
- {
- ++yynerrs;
- #ifdef YYERROR_VERBOSE
- yyn = yypact[yystate];
- if (yyn > YYFLAG && yyn < YYLAST)
- {
- int size = 0;
- char *msg;
- int x, count;
- count = 0;
- /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
- for (x = (yyn < 0 ? -yyn : 0);
- x < (sizeof(yytname) / sizeof(char *)); x++)
- if (yycheck[x + yyn] == x)
- size += strlen(yytname[x]) + 15, count++;
- msg = (char *) malloc(size + 15);
- if (msg != 0)
- {
- strcpy(msg, "parse error");
- if (count < 5)
- {
- count = 0;
- for (x = (yyn < 0 ? -yyn : 0);
- x < (sizeof(yytname) / sizeof(char *)); x++)
- if (yycheck[x + yyn] == x)
- {
- strcat(msg, count == 0 ? ", expecting `" : " or `");
- strcat(msg, yytname[x]);
- strcat(msg, "'");
- count++;
- }
- }
- yyerror(msg);
- free(msg);
- }
- else
- yyerror ("parse error; also virtual memory exceeded");
- }
- else
- #endif /* YYERROR_VERBOSE */
- yyerror("parse error");
- }
- goto yyerrlab1;
- yyerrlab1: /* here on error raised explicitly by an action */
- if (yyerrstatus == 3)
- {
- /* if just tried and failed to reuse lookahead token after an error, discard it. */
- /* return failure if at end of input */
- if (yychar == YYEOF)
- YYABORT;
- #if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
- #endif
- yychar = YYEMPTY;
- }
- /* Else will try to reuse lookahead token
- after shifting the error token. */
- yyerrstatus = 3; /* Each real token shifted decrements this */
- goto yyerrhandle;
- yyerrdefault: /* current state does not do anything special for the error token. */
- #if 0
- /* This is wrong; only states that explicitly want error tokens
- should shift them. */
- yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
- if (yyn) goto yydefault;
- #endif
- yyerrpop: /* pop the current state because it cannot handle the error token */
- if (yyssp == yyss) YYABORT;
- yyvsp--;
- yystate = *--yyssp;
- #ifdef YYLSP_NEEDED
- yylsp--;
- #endif
- #if YYDEBUG != 0
- if (yydebug)
- {
- short *ssp1 = yyss - 1;
- fprintf (stderr, "Error: state stack now");
- while (ssp1 != yyssp)
- fprintf (stderr, " %d", *++ssp1);
- fprintf (stderr, "\n");
- }
- #endif
- yyerrhandle:
- yyn = yypact[yystate];
- if (yyn == YYFLAG)
- goto yyerrdefault;
- yyn += YYTERROR;
- if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
- goto yyerrdefault;
- yyn = yytable[yyn];
- if (yyn < 0)
- {
- if (yyn == YYFLAG)
- goto yyerrpop;
- yyn = -yyn;
- goto yyreduce;
- }
- else if (yyn == 0)
- goto yyerrpop;
- if (yyn == YYFINAL)
- YYACCEPT;
- #if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Shifting error token, ");
- #endif
- *++yyvsp = yylval;
- #ifdef YYLSP_NEEDED
- *++yylsp = yylloc;
- #endif
- yystate = yyn;
- goto yynewstate;
- yyacceptlab:
- /* YYACCEPT comes here. */
- if (yyfree_stacks)
- {
- free (yyss);
- free (yyvs);
- #ifdef YYLSP_NEEDED
- free (yyls);
- #endif
- }
- return 0;
- yyabortlab:
- /* YYABORT comes here. */
- if (yyfree_stacks)
- {
- free (yyss);
- free (yyvs);
- #ifdef YYLSP_NEEDED
- free (yyls);
- #endif
- }
- return 1;
- }
- #line 454 "dcParser.yxx"
|