Example #1
0
File: c++.cpp Project: mkut/aoj
	bool operator==(BinaryTree& b)
	{
		if(left.isNull() && b.left.isNull())
			return true;
		if(left.isNull() || b.left.isNull())
			return false;
		return (left == b.left && right == b.right) || (left == b.right && right == b.left);
	}
Example #2
0
 void
 Parser::yy_print_ (std::ostream& yyo,
                                    const basic_symbol<Base>& yysym) const
 {
   std::ostream& yyoutput = yyo;
   YYUSE (yyoutput);
   symbol_number_type yytype = yysym.type_get ();
   // Avoid a (spurious) G++ 4.8 warning about "array subscript is
   // below array bounds".
   if (yysym.empty ())
     std::abort ();
   yyo << (yytype < yyntokens_ ? "token" : "nterm")
       << ' ' << yytname_[yytype] << " (";
   YYUSE (yytype);
   yyo << ')';
 }
Example #3
0
File: c++.cpp Project: mkut/aoj
	string str(bool typeL)
	{
		if(left.isNull())
			return "x";
		else
		{
			return "(" + (typeL == *left < *right ? (*left).str(true) : (*right).str(true)) +
					" " + (typeL == *left < *right ? (*right).str(false) : (*left).str(false)) + ")";
		}
	}
Example #4
0
  inline
  void
  Parser::yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const
  {
    if (yymsg)
      YY_SYMBOL_PRINT (yymsg, yysym);

    // User destructor.
    YYUSE (yysym.type_get ());
  }
Example #5
0
 void
 Parser::yy_print_ (std::ostream& yyo,
                                    const basic_symbol<Base>& yysym) const
 {
   std::ostream& yyoutput = yyo;
   YYUSE (yyoutput);
   symbol_number_type yytype = yysym.type_get ();
   yyo << (yytype < yyntokens_ ? "token" : "nterm")
       << ' ' << yytname_[yytype] << " ("
       << yysym.location << ": ";
   YYUSE (yytype);
   yyo << ')';
 }
Example #6
0
  inline
  void
  Parser::yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const
  {
    if (yymsg)
      YY_SYMBOL_PRINT (yymsg, yysym);

    // User destructor.
    switch (yysym.type_get ())
    {
            case 5: // WORD

#line 44 "src/grammar/parser.yy" // lalr1.cc:617
        { if ((yysym.value.sval))  { delete ((yysym.value.sval)); ((yysym.value.sval)) = nullptr; } }
#line 342 "src/frontend/parser.tab.cpp" // lalr1.cc:617
        break;


      default:
        break;
    }
  }
Example #7
0
  inline
  void
  Parser::yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const
  {
    if (yymsg)
      YY_SYMBOL_PRINT (yymsg, yysym);

    // User destructor.
    switch (yysym.type_get ())
    {
            case 5: // STRING

#line 110 "src/grammar/parser.yy" // lalr1.cc:617
        { if ((yysym.value.sval))  { delete ((yysym.value.sval)); ((yysym.value.sval)) = nullptr; } }
#line 359 "src/frontend/parser.tab.cpp" // lalr1.cc:617
        break;

      case 7: // CONSTANT

#line 110 "src/grammar/parser.yy" // lalr1.cc:617
        { if ((yysym.value.sval))  { delete ((yysym.value.sval)); ((yysym.value.sval)) = nullptr; } }
#line 366 "src/frontend/parser.tab.cpp" // lalr1.cc:617
        break;

      case 8: // IDENTIFIER

#line 110 "src/grammar/parser.yy" // lalr1.cc:617
        { if ((yysym.value.sval))  { delete ((yysym.value.sval)); ((yysym.value.sval)) = nullptr; } }
#line 373 "src/frontend/parser.tab.cpp" // lalr1.cc:617
        break;

      case 23: // PLUS

#line 110 "src/grammar/parser.yy" // lalr1.cc:617
        { if ((yysym.value.sval))  { delete ((yysym.value.sval)); ((yysym.value.sval)) = nullptr; } }
#line 380 "src/frontend/parser.tab.cpp" // lalr1.cc:617
        break;

      case 24: // MINUS

#line 110 "src/grammar/parser.yy" // lalr1.cc:617
        { if ((yysym.value.sval))  { delete ((yysym.value.sval)); ((yysym.value.sval)) = nullptr; } }
#line 387 "src/frontend/parser.tab.cpp" // lalr1.cc:617
        break;

      case 25: // MULT

#line 110 "src/grammar/parser.yy" // lalr1.cc:617
        { if ((yysym.value.sval))  { delete ((yysym.value.sval)); ((yysym.value.sval)) = nullptr; } }
#line 394 "src/frontend/parser.tab.cpp" // lalr1.cc:617
        break;

      case 26: // DIV

#line 110 "src/grammar/parser.yy" // lalr1.cc:617
        { if ((yysym.value.sval))  { delete ((yysym.value.sval)); ((yysym.value.sval)) = nullptr; } }
#line 401 "src/frontend/parser.tab.cpp" // lalr1.cc:617
        break;

      case 27: // GT

#line 110 "src/grammar/parser.yy" // lalr1.cc:617
        { if ((yysym.value.sval))  { delete ((yysym.value.sval)); ((yysym.value.sval)) = nullptr; } }
#line 408 "src/frontend/parser.tab.cpp" // lalr1.cc:617
        break;

      case 28: // LT

#line 110 "src/grammar/parser.yy" // lalr1.cc:617
        { if ((yysym.value.sval))  { delete ((yysym.value.sval)); ((yysym.value.sval)) = nullptr; } }
#line 415 "src/frontend/parser.tab.cpp" // lalr1.cc:617
        break;

      case 29: // GE

#line 110 "src/grammar/parser.yy" // lalr1.cc:617
        { if ((yysym.value.sval))  { delete ((yysym.value.sval)); ((yysym.value.sval)) = nullptr; } }
#line 422 "src/frontend/parser.tab.cpp" // lalr1.cc:617
        break;

      case 30: // LE

#line 110 "src/grammar/parser.yy" // lalr1.cc:617
        { if ((yysym.value.sval))  { delete ((yysym.value.sval)); ((yysym.value.sval)) = nullptr; } }
#line 429 "src/frontend/parser.tab.cpp" // lalr1.cc:617
        break;

      case 31: // EQ

#line 110 "src/grammar/parser.yy" // lalr1.cc:617
        { if ((yysym.value.sval))  { delete ((yysym.value.sval)); ((yysym.value.sval)) = nullptr; } }
#line 436 "src/frontend/parser.tab.cpp" // lalr1.cc:617
        break;

      case 32: // AND

#line 110 "src/grammar/parser.yy" // lalr1.cc:617
        { if ((yysym.value.sval))  { delete ((yysym.value.sval)); ((yysym.value.sval)) = nullptr; } }
#line 443 "src/frontend/parser.tab.cpp" // lalr1.cc:617
        break;

      case 33: // OR

#line 110 "src/grammar/parser.yy" // lalr1.cc:617
        { if ((yysym.value.sval))  { delete ((yysym.value.sval)); ((yysym.value.sval)) = nullptr; } }
#line 450 "src/frontend/parser.tab.cpp" // lalr1.cc:617
        break;

      case 45: // Operators

#line 110 "src/grammar/parser.yy" // lalr1.cc:617
        { if ((yysym.value.sval))  { delete ((yysym.value.sval)); ((yysym.value.sval)) = nullptr; } }
#line 457 "src/frontend/parser.tab.cpp" // lalr1.cc:617
        break;


      default:
        break;
    }
  }