/* A Bison parser, made by GNU Bison 2.7. */ /* Skeleton implementation for Bison LALR(1) parsers in C++ Copyright (C) 2002-2012 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 3 of the License, 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, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* "%code top" blocks. */ /* Line 272 of lalr1.cc */ #line 1 "cfg.y" /* BNF Grammar for Configuration File DRAFT */ #include #include // std::cout, std::ostream, std::ios #include #include using namespace std; #include "cfg.tab.hh" #include "cfg.h" extern int yylex(void*); /* Line 272 of lalr1.cc */ #line 49 "cfg.tab.cc" /* First part of user declarations. */ /* Line 279 of lalr1.cc */ #line 55 "cfg.tab.cc" #include "cfg.tab.hh" /* User implementation prologue. */ /* Line 285 of lalr1.cc */ #line 63 "cfg.tab.cc" /* Unqualified %code blocks. */ /* Line 286 of lalr1.cc */ #line 19 "cfg.y" double width=0,height=0,crackLen=0,emis,windowArea=0,wallArea=0,length=0,cfpftc=0; int calCrack=0,debug=1; void yyerror(char const *); std::istream *yyin; std::ostream *yyout; struct Sensor *sensor=0; /* Line 286 of lalr1.cc */ #line 77 "cfg.tab.cc" # ifndef YY_NULL # if defined __cplusplus && 201103L <= __cplusplus # define YY_NULL nullptr # else # define YY_NULL 0 # endif # endif #ifndef YY_ # if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* FIXME: INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) # endif # endif # ifndef YY_ # define YY_(msgid) msgid # endif #endif #define YYRHSLOC(Rhs, K) ((Rhs)[K]) /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. If N is 0, then set CURRENT to the empty location which ends the previous symbol: RHS[0] (always defined). */ # ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ if (N) \ { \ (Current).begin = YYRHSLOC (Rhs, 1).begin; \ (Current).end = YYRHSLOC (Rhs, N).end; \ } \ else \ { \ (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \ } \ while (/*CONSTCOND*/ false) # endif /* Suppress unused-variable warnings by "using" E. */ #define YYUSE(e) ((void) (e)) /* Enable debugging if requested. */ #if YYDEBUG /* A pseudo ostream that takes yydebug_ into account. */ # define YYCDEBUG if (yydebug_) (*yycdebug_) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug_) \ { \ *yycdebug_ << Title << ' '; \ yy_symbol_print_ ((Type), (Value), (Location)); \ *yycdebug_ << std::endl; \ } \ } while (false) # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug_) \ yy_reduce_print_ (Rule); \ } while (false) # define YY_STACK_PRINT() \ do { \ if (yydebug_) \ yystack_print_ (); \ } while (false) #else /* !YYDEBUG */ # define YYCDEBUG if (false) std::cerr # define YY_SYMBOL_PRINT(Title, Type, Value, Location) YYUSE(Type) # define YY_REDUCE_PRINT(Rule) static_cast(0) # define YY_STACK_PRINT() static_cast(0) #endif /* !YYDEBUG */ #define yyerrok (yyerrstatus_ = 0) #define yyclearin (yychar = yyempty_) #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab #define YYRECOVERING() (!!yyerrstatus_) namespace yy { /* Line 353 of lalr1.cc */ #line 172 "cfg.tab.cc" /// Build a parser object. parser::parser () #if YYDEBUG :yydebug_ (false), yycdebug_ (&std::cerr) #endif { } parser::~parser () { } #if YYDEBUG /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ inline void parser::yy_symbol_value_print_ (int yytype, const semantic_type* yyvaluep, const location_type* yylocationp) { YYUSE (yylocationp); YYUSE (yyvaluep); std::ostream& yyo = debug_stream (); std::ostream& yyoutput = yyo; YYUSE (yyoutput); switch (yytype) { default: break; } } void parser::yy_symbol_print_ (int yytype, const semantic_type* yyvaluep, const location_type* yylocationp) { *yycdebug_ << (yytype < yyntokens_ ? "token" : "nterm") << ' ' << yytname_[yytype] << " (" << *yylocationp << ": "; yy_symbol_value_print_ (yytype, yyvaluep, yylocationp); *yycdebug_ << ')'; } #endif void parser::yydestruct_ (const char* yymsg, int yytype, semantic_type* yyvaluep, location_type* yylocationp) { YYUSE (yylocationp); YYUSE (yymsg); YYUSE (yyvaluep); if (yymsg) YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); switch (yytype) { default: break; } } void parser::yypop_ (unsigned int n) { yystate_stack_.pop (n); yysemantic_stack_.pop (n); yylocation_stack_.pop (n); } #if YYDEBUG std::ostream& parser::debug_stream () const { return *yycdebug_; } void parser::set_debug_stream (std::ostream& o) { yycdebug_ = &o; } parser::debug_level_type parser::debug_level () const { return yydebug_; } void parser::set_debug_level (debug_level_type l) { yydebug_ = l; } #endif inline bool parser::yy_pact_value_is_default_ (int yyvalue) { return yyvalue == yypact_ninf_; } inline bool parser::yy_table_value_is_error_ (int yyvalue) { return yyvalue == yytable_ninf_; } int parser::parse () { /// Lookahead and lookahead in internal form. int yychar = yyempty_; int yytoken = 0; // State. int yyn; int yylen = 0; int yystate = 0; // Error handling. int yynerrs_ = 0; int yyerrstatus_ = 0; /// Semantic value of the lookahead. static semantic_type yyval_default; semantic_type yylval = yyval_default; /// Location of the lookahead. location_type yylloc; /// The locations where the error started and ended. location_type yyerror_range[3]; /// $$. semantic_type yyval; /// @$. location_type yyloc; int yyresult; // FIXME: This shoud be completely indented. It is not yet to // avoid gratuitous conflicts when merging into the master branch. try { YYCDEBUG << "Starting parse" << std::endl; /* Initialize the stacks. The initial state will be pushed in yynewstate, since the latter expects the semantical and the location values to have been already stored, initialize these stacks with a primary value. */ yystate_stack_ = state_stack_type (0); yysemantic_stack_ = semantic_stack_type (0); yylocation_stack_ = location_stack_type (0); yysemantic_stack_.push (yylval); yylocation_stack_.push (yylloc); /* New state. */ yynewstate: yystate_stack_.push (yystate); YYCDEBUG << "Entering state " << yystate << std::endl; /* Accept? */ if (yystate == yyfinal_) goto yyacceptlab; goto yybackup; /* Backup. */ yybackup: /* Try to take a decision without lookahead. */ yyn = yypact_[yystate]; if (yy_pact_value_is_default_ (yyn)) goto yydefault; /* Read a lookahead token. */ if (yychar == yyempty_) { YYCDEBUG << "Reading a token: "; yychar = yylex (&yylval); } /* Convert token to internal form. */ if (yychar <= yyeof_) { yychar = yytoken = yyeof_; YYCDEBUG << "Now at end of input." << std::endl; } else { yytoken = yytranslate_ (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yytoken) goto yydefault; /* Reduce or error. */ yyn = yytable_[yyn]; if (yyn <= 0) { if (yy_table_value_is_error_ (yyn)) goto yyerrlab; yyn = -yyn; goto yyreduce; } /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the token being shifted. */ yychar = yyempty_; yysemantic_stack_.push (yylval); yylocation_stack_.push (yylloc); /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus_) --yyerrstatus_; yystate = yyn; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact_[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: yylen = yyr2_[yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, use the top of the stack. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. */ if (yylen) yyval = yysemantic_stack_[yylen - 1]; else yyval = yysemantic_stack_[0]; // Compute the default @$. { slice slice (yylocation_stack_, yylen); YYLLOC_DEFAULT (yyloc, slice, yylen); } // Perform the reduction. YY_REDUCE_PRINT (yyn); switch (yyn) { case 4: /* Line 670 of lalr1.cc */ #line 100 "cfg.y" {(yyval.ival)=(yysemantic_stack_[(1) - (1)].ival); dbg printf("SensorId: INTEGER=%d\n",(yysemantic_stack_[(1) - (1)].ival));} break; case 5: /* Line 670 of lalr1.cc */ #line 103 "cfg.y" {(yyval.sval)=(yysemantic_stack_[(1) - (1)].sval); dbg printf("SecurityCode: LETTERS=%s\n",(yysemantic_stack_[(1) - (1)].sval));} break; case 6: /* Line 670 of lalr1.cc */ #line 106 "cfg.y" {(yyval.ival)=(yysemantic_stack_[(1) - (1)].ival);} break; case 7: /* Line 670 of lalr1.cc */ #line 107 "cfg.y" {(yyval.ival)=(yysemantic_stack_[(1) - (1)].ival);} break; case 8: /* Line 670 of lalr1.cc */ #line 112 "cfg.y" { sensor->manuf=(yysemantic_stack_[(3) - (1)].ival); sensor->sensorId=(yysemantic_stack_[(3) - (2)].ival); sensor->securityCode=(yysemantic_stack_[(3) - (3)].sval); dbg printf("Sensor: Manuf=%s, SensorId=%d SecurityCode=%s\n",sensor->manuf,sensor->sensorId,sensor->securityCode); } break; case 9: /* Line 670 of lalr1.cc */ #line 120 "cfg.y" {(yyval.sval)=(yysemantic_stack_[(1) - (1)].sval); dbg printf("wsManufac: DAVIS, MODEL=%s\n",(yysemantic_stack_[(1) - (1)].sval));} break; case 10: /* Line 670 of lalr1.cc */ #line 121 "cfg.y" {(yyval.sval)=(yysemantic_stack_[(1) - (1)].sval); dbg printf("wsManufac: LACROSSE, MODEL=%s\n",(yysemantic_stack_[(1) - (1)].sval));} break; case 12: /* Line 670 of lalr1.cc */ #line 126 "cfg.y" {calCrack=1;} break; case 13: /* Line 670 of lalr1.cc */ #line 126 "cfg.y" {calCrack=0;} break; case 14: /* Line 670 of lalr1.cc */ #line 126 "cfg.y" { windowArea=(yysemantic_stack_[(7) - (3)].dval); wallArea=(yysemantic_stack_[(7) - (6)].dval); } break; case 21: /* Line 670 of lalr1.cc */ #line 140 "cfg.y" {(yyval.sval)=(yysemantic_stack_[(1) - (1)].sval);} break; case 22: /* Line 670 of lalr1.cc */ #line 141 "cfg.y" {(yyval.sval)=(yysemantic_stack_[(1) - (1)].sval);} break; case 23: /* Line 670 of lalr1.cc */ #line 145 "cfg.y" {(yyval.sval)=(yysemantic_stack_[(1) - (1)].sval);} break; case 28: /* Line 670 of lalr1.cc */ #line 154 "cfg.y" {if(calCrack) {crackLen+=width*3+height*2;calCrack=0;} width=0; length=0;} break; case 29: /* Line 670 of lalr1.cc */ #line 156 "cfg.y" {if(calCrack) {crackLen+=width*2+height*2;calCrack=0;} width=0; length=0;} break; case 30: /* Line 670 of lalr1.cc */ #line 158 "cfg.y" {emis=(yysemantic_stack_[(3) - (3)].dval);} break; case 31: /* Line 670 of lalr1.cc */ #line 159 "cfg.y" {cfpftc=(yysemantic_stack_[(3) - (3)].dval);} break; case 33: /* Line 670 of lalr1.cc */ #line 163 "cfg.y" {(yyval.dval)=(yysemantic_stack_[(4) - (2)].dval)*(yysemantic_stack_[(4) - (4)].dval); /* width * height */ if(calCrack) {width=(yysemantic_stack_[(4) - (2)].dval); height=(yysemantic_stack_[(4) - (4)].dval);}} break; case 34: /* Line 670 of lalr1.cc */ #line 165 "cfg.y" {(yyval.dval)+=(yysemantic_stack_[(4) - (2)].dval)*(yysemantic_stack_[(4) - (4)].dval); /* width * height */ if(calCrack) {width+=(yysemantic_stack_[(4) - (2)].dval); height+=(yysemantic_stack_[(4) - (4)].dval);}} break; case 35: /* Line 670 of lalr1.cc */ #line 167 "cfg.y" {(yyval.dval)*=(yysemantic_stack_[(3) - (3)].dval);} break; /* Line 670 of lalr1.cc */ #line 574 "cfg.tab.cc" default: break; } /* User semantic actions sometimes alter yychar, and that requires that yytoken be updated with the new translation. We take the approach of translating immediately before every use of yytoken. One alternative is translating here after every semantic action, but that translation would be missed if the semantic action invokes YYABORT, YYACCEPT, or YYERROR immediately after altering yychar. In the case of YYABORT or YYACCEPT, an incorrect destructor might then be invoked immediately. In the case of YYERROR, subsequent parser actions might lead to an incorrect destructor call or verbose syntax error message before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc); yypop_ (yylen); yylen = 0; YY_STACK_PRINT (); yysemantic_stack_.push (yyval); yylocation_stack_.push (yyloc); /* Shift the result of the reduction. */ yyn = yyr1_[yyn]; yystate = yypgoto_[yyn - yyntokens_] + yystate_stack_[0]; if (0 <= yystate && yystate <= yylast_ && yycheck_[yystate] == yystate_stack_[0]) yystate = yytable_[yystate]; else yystate = yydefgoto_[yyn - yyntokens_]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = yytranslate_ (yychar); /* If not already recovering from an error, report this error. */ if (!yyerrstatus_) { ++yynerrs_; if (yychar == yyempty_) yytoken = yyempty_; error (yylloc, yysyntax_error_ (yystate, yytoken)); } yyerror_range[1] = yylloc; if (yyerrstatus_ == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= yyeof_) { /* Return failure if at end of input. */ if (yychar == yyeof_) YYABORT; } else { yydestruct_ ("Error: discarding", yytoken, &yylval, &yylloc); yychar = yyempty_; } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers like GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (false) goto yyerrorlab; yyerror_range[1] = yylocation_stack_[yylen - 1]; /* Do not reclaim the symbols of the rule which action triggered this YYERROR. */ yypop_ (yylen); yylen = 0; yystate = yystate_stack_[0]; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus_ = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact_[yystate]; if (!yy_pact_value_is_default_ (yyn)) { yyn += yyterror_; if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_) { yyn = yytable_[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yystate_stack_.height () == 1) YYABORT; yyerror_range[1] = yylocation_stack_[0]; yydestruct_ ("Error: popping", yystos_[yystate], &yysemantic_stack_[0], &yylocation_stack_[0]); yypop_ (); yystate = yystate_stack_[0]; YY_STACK_PRINT (); } yyerror_range[2] = yylloc; // Using YYLLOC is tempting, but would change the location of // the lookahead. YYLOC is available though. YYLLOC_DEFAULT (yyloc, yyerror_range, 2); yysemantic_stack_.push (yylval); yylocation_stack_.push (yyloc); /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos_[yyn], &yysemantic_stack_[0], &yylocation_stack_[0]); yystate = yyn; goto yynewstate; /* Accept. */ yyacceptlab: yyresult = 0; goto yyreturn; /* Abort. */ yyabortlab: yyresult = 1; goto yyreturn; yyreturn: if (yychar != yyempty_) { /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = yytranslate_ (yychar); yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc); } /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ yypop_ (yylen); while (1 < yystate_stack_.height ()) { yydestruct_ ("Cleanup: popping", yystos_[yystate_stack_[0]], &yysemantic_stack_[0], &yylocation_stack_[0]); yypop_ (); } return yyresult; } catch (...) { YYCDEBUG << "Exception caught: cleaning lookahead and stack" << std::endl; // Do not try to display the values of the reclaimed symbols, // as their printer might throw an exception. if (yychar != yyempty_) { /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = yytranslate_ (yychar); yydestruct_ (YY_NULL, yytoken, &yylval, &yylloc); } while (1 < yystate_stack_.height ()) { yydestruct_ (YY_NULL, yystos_[yystate_stack_[0]], &yysemantic_stack_[0], &yylocation_stack_[0]); yypop_ (); } throw; } } // Generate an error message. std::string parser::yysyntax_error_ (int, int) { return YY_("syntax error"); } /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ const signed char parser::yypact_ninf_ = -24; const signed char parser::yypact_[] = { -24, 13, -24, -2, -1, 8, -5, -24, -24, 12, -24, -8, -24, -24, -24, -24, -24, -9, -24, -24, -24, -24, 4, 10, 19, 20, -24, 25, -24, 36, 11, 21, -24, 15, -24, -24, -24, -24, -24, -24, -24, 26, 23, -7, -23, -24, -24, -24, -24, -24, -24, 7, 27, 28, -24, -24, -24, 29, -24, -24, 14, 30, 31, -24, -24, 36, -24, 33, -24, -24, -10, -24, -24 }; /* YYDEFACT[S] -- default reduction number in state S. Performed when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ const unsigned char parser::yydefact_[] = { 2, 0, 1, 0, 3, 0, 36, 9, 10, 0, 38, 12, 39, 41, 40, 11, 21, 0, 22, 6, 7, 23, 0, 0, 0, 0, 37, 0, 16, 0, 0, 0, 19, 0, 15, 43, 42, 45, 46, 44, 4, 0, 0, 0, 25, 20, 18, 24, 17, 5, 8, 0, 0, 0, 26, 28, 13, 0, 27, 29, 0, 0, 0, 31, 32, 0, 30, 0, 35, 33, 0, 34, 14 }; /* YYPGOTO[NTERM-NUM]. */ const signed char parser::yypgoto_[] = { -24, -24, -24, -24, -24, -4, -24, -24, -24, -24, -24, -24, -24, -24, -24, -13, -24, -24, -24 }; /* YYDEFGOTO[NTERM-NUM]. */ const signed char parser::yydefgoto_[] = { -1, 1, 41, 50, 27, 28, 10, 11, 29, 65, 30, 31, 32, 33, 43, 44, 4, 6, 34 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If YYTABLE_NINF_, syntax error. */ const signed char parser::yytable_ninf_ = -1; const unsigned char parser::yytable_[] = { 16, 5, 52, 60, 53, 13, 72, 54, 55, 56, 17, 18, 7, 2, 61, 12, 60, 35, 57, 3, 19, 20, 21, 22, 23, 24, 46, 61, 25, 48, 36, 58, 59, 8, 15, 14, 37, 26, 45, 19, 20, 42, 9, 19, 20, 38, 39, 40, 47, 51, 49, 62, 70, 63, 64, 66, 68, 69, 67, 71 }; /* YYCHECK. */ const unsigned char parser::yycheck_[] = { 8, 3, 9, 26, 11, 10, 16, 14, 15, 16, 18, 19, 13, 0, 37, 7, 26, 26, 25, 6, 28, 29, 30, 31, 32, 33, 30, 37, 36, 33, 26, 38, 39, 34, 22, 40, 26, 45, 27, 28, 29, 5, 43, 28, 29, 26, 26, 22, 27, 26, 24, 44, 65, 26, 26, 26, 26, 26, 44, 26 }; /* STOS_[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ const unsigned char parser::yystos_[] = { 0, 47, 0, 6, 62, 3, 63, 13, 34, 43, 52, 53, 7, 10, 40, 22, 8, 18, 19, 28, 29, 30, 31, 32, 33, 36, 45, 50, 51, 54, 56, 57, 58, 59, 64, 26, 26, 26, 26, 26, 22, 48, 5, 60, 61, 27, 51, 27, 51, 24, 49, 26, 9, 11, 14, 15, 16, 25, 38, 39, 26, 37, 44, 26, 26, 55, 26, 44, 26, 26, 61, 26, 16 }; #if YYDEBUG /* TOKEN_NUMBER_[YYLEX-NUM] -- Internal symbol number corresponding to YYLEX-NUM. */ const unsigned short int parser::yytoken_number_[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 42, 59 }; #endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ const unsigned char parser::yyr1_[] = { 0, 46, 47, 47, 48, 49, 50, 50, 51, 52, 52, 53, 54, 55, 53, 53, 53, 53, 53, 56, 56, 57, 57, 58, 59, 60, 60, 60, 60, 60, 60, 60, 60, 61, 61, 61, 62, 62, 62, 63, 63, 63, 64, 64, 64, 64, 64 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ const unsigned char parser::yyr2_[] = { 0, 2, 0, 2, 1, 1, 1, 1, 3, 1, 1, 2, 0, 0, 7, 2, 2, 3, 3, 1, 2, 1, 1, 1, 2, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 3, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2 }; #if YYDEBUG /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at \a yyntokens_, nonterminals. */ const char* const parser::yytname_[] = { "$end", "error", "$undefined", "ADDRESS", "ALNUMS", "AREA", "BUILDING", "BUILDINGNAME_s", "CARRIER", "CFPFTC", "CITYSTATE_s", "CRACKLENGTH", "Number", "DAVIS_s", "DOUBLEGLASS", "DOUBLEHUNG", "ENDAREA", "FLOAT", "GASMETER", "HONEYWELL", "Hum", "Insolation", "INTEGER", "KwhPerPulse", "LETTERS_s", "LOW_E_s", "NUMBER", "MODEL_s", "MONNIT", "SENSOSCIENTIFIC", "PARKERBOILER_s", "ELECTRICMETER", "STEAMMETER", "WATERMETER", "LACROSSE_s", "MlbsPerPulse", "OILMETER", "RVALUE", "SINGLEGLASS", "SINGLEHUNG", "STREETADDR_s", "TEMP", "WindSpeed", "ZONE", "'*'", "';'", "$accept", "Grammar", "SensorId", "SecurityCode", "Manuf", "Sensor", "wsManufac", "HCzone", "address@hidden", "address@hidden", "Boiler", "ChillerManuf", "BoilerManuf", "Chiller", "Windows", "Area", "Building", "Address", "Meter", YY_NULL }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ const parser::rhs_number_type parser::yyrhs_[] = { 47, 0, -1, -1, 47, 62, -1, 22, -1, 24, -1, 28, -1, 29, -1, 50, 48, 49, -1, 13, -1, 34, -1, 43, 22, -1, -1, -1, 53, 54, 60, 16, 55, 61, 16, -1, 53, 64, -1, 53, 51, -1, 53, 59, 51, -1, 53, 56, 51, -1, 58, -1, 56, 27, -1, 8, -1, 19, -1, 30, -1, 57, 27, -1, 61, -1, 60, 14, -1, 60, 38, -1, 60, 15, -1, 60, 39, -1, 60, 25, 26, -1, 60, 9, 26, -1, 60, 11, 26, -1, 5, 26, 44, 26, -1, 61, 26, 44, 26, -1, 61, 37, 26, -1, 6, 63, -1, 62, 53, 45, -1, 62, 52, -1, 3, 7, -1, 63, 40, -1, 63, 10, -1, 31, 26, -1, 18, 26, -1, 36, 26, -1, 32, 26, -1, 33, 26, -1 }; /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ const unsigned char parser::yyprhs_[] = { 0, 0, 3, 4, 7, 9, 11, 13, 15, 19, 21, 23, 26, 27, 28, 36, 39, 42, 46, 50, 52, 55, 57, 59, 61, 64, 66, 69, 72, 75, 78, 82, 86, 90, 95, 100, 104, 107, 111, 114, 117, 120, 123, 126, 129, 132, 135 }; /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ const unsigned char parser::yyrline_[] = { 0, 96, 96, 97, 100, 103, 106, 107, 112, 120, 121, 124, 126, 126, 126, 129, 130, 131, 132, 135, 136, 140, 141, 145, 148, 151, 152, 153, 154, 156, 158, 159, 160, 163, 165, 167, 170, 171, 172, 175, 176, 177, 180, 181, 182, 183, 184 }; // Print the state stack on the debug stream. void parser::yystack_print_ () { *yycdebug_ << "Stack now"; for (state_stack_type::const_iterator i = yystate_stack_.begin (); i != yystate_stack_.end (); ++i) *yycdebug_ << ' ' << *i; *yycdebug_ << std::endl; } // Report on the debug stream that the rule \a yyrule is going to be reduced. void parser::yy_reduce_print_ (int yyrule) { unsigned int yylno = yyrline_[yyrule]; int yynrhs = yyr2_[yyrule]; /* Print the symbols being reduced, and their result. */ *yycdebug_ << "Reducing stack by rule " << yyrule - 1 << " (line " << yylno << "):" << std::endl; /* The symbols being reduced. */ for (int yyi = 0; yyi < yynrhs; yyi++) YY_SYMBOL_PRINT (" $" << yyi + 1 << " =", yyrhs_[yyprhs_[yyrule] + yyi], &(yysemantic_stack_[(yynrhs) - (yyi + 1)]), &(yylocation_stack_[(yynrhs) - (yyi + 1)])); } #endif // YYDEBUG /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ parser::token_number_type parser::yytranslate_ (int t) { static const token_number_type translate_table[] = { 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, 2, 2, 44, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 45, 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, 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, 2, 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, 36, 37, 38, 39, 40, 41, 42, 43 }; if ((unsigned int) t <= yyuser_token_number_max_) return translate_table[t]; else return yyundef_token_; } const int parser::yyeof_ = 0; const int parser::yylast_ = 59; const int parser::yynnts_ = 19; const int parser::yyempty_ = -2; const int parser::yyfinal_ = 2; const int parser::yyterror_ = 1; const int parser::yyerrcode_ = 256; const int parser::yyntokens_ = 46; const unsigned int parser::yyuser_token_number_max_ = 298; const parser::token_number_type parser::yyundef_token_ = 2; } // yy /* Line 1141 of lalr1.cc */ #line 1063 "cfg.tab.cc" /* Line 1142 of lalr1.cc */ #line 187 "cfg.y" /* ************************************************************ */ #include ".\flexBison\FlexLexer.h" int main(int argc,char** argv) { printf("argv[1]=%s\n",argv[1]); std::filebuf fbin; fbin.open (argv[1],std::ios::in); std::istream yyin(&fbin); /*yout=(std::ostream*)&cout; yyFlexLexer fl(yyin,yyout); while(1) {y=yylex(); printf(" yylex=%d\n",y); if(!y) break;} f1.yyparse();*/ } /* ************************************************************ */ void yyerror (char const *s) { fprintf(stderr, "%s\n", s); } /* cfg.y: In function 'int main(int, char**)': cfg.y:198:4: error: 'f1' was not declared in this scope lex.yy.cc:313:23: fatal error: FlexLexer.h: No such file or directory compilation terminated. */