Advertisement
Guest User

Untitled

a guest
Apr 29th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.37 KB | None | 0 0
  1. kifejezes:
  2.     SZAM
  3.     {
  4.         $$ = new type(natural);
  5.     }
  6. |
  7.     AZONOSITO
  8.     {
  9.         $$ = new type(szimbolumtabla[*$1].var_type);
  10.     }
  11. |
  12.     kifejezes PLUSZ kifejezes
  13.     {
  14.         if( *$1 != *$3 || *$1 != natural )
  15.         {
  16.              std::stringstream ss;
  17.             ss << "csak egesz lehet " << std::endl;
  18.             error( ss.str().c_str() );
  19.         }
  20.         $$ = new type(natural);
  21.     }
  22. |
  23.     kifejezes MINUSZ kifejezes
  24.     {
  25.         if( *$1 != *$3 || *$1 != natural )
  26.         {
  27.              std::stringstream ss;
  28.             ss << "csak egesz lehet " << std::endl;
  29.             error( ss.str().c_str() );
  30.         }
  31.         $$ = new type(natural);
  32.     }
  33. |
  34.     kifejezes SZORZAS kifejezes
  35.     {
  36.     if( *$1 != *$3 || *$1 != natural )
  37.         {
  38.              std::stringstream ss;
  39.             ss << "csak egesz lehet " << std::endl;
  40.             error( ss.str().c_str() );
  41.         }
  42.         $$ = new type(natural);
  43.     }
  44. |
  45.     kifejezes OSZTAS kifejezes
  46.     {
  47.       if( *$1 != *$3 || *$1 != natural )
  48.         {
  49.              std::stringstream ss;
  50.             ss << "csak egesz lehet " << std::endl;
  51.             error( ss.str().c_str() );
  52.         }
  53.         $$ = new type(natural);
  54.     }
  55. |
  56.     kifejezes MARADEK kifejezes
  57.     {
  58.        if( *$1 != *$3 || *$1 != natural )
  59.         {
  60.              std::stringstream ss;
  61.             ss << "csak egesz lehet " << std::endl;
  62.             error( ss.str().c_str() );
  63.         }
  64.         $$ = new type(natural);
  65.     }
  66. |
  67.     kifejezes KISEBB kifejezes
  68.     {
  69.         if( *$1 != *$3 || *$1 != boolean )
  70.         {
  71.              std::stringstream ss;
  72.             ss << "csak egesz lehet " << std::endl;
  73.             error( ss.str().c_str() );
  74.         }
  75.        $$ = new type(boolean);
  76.     }
  77. |
  78.     kifejezes NAGYOBB kifejezes
  79.     {
  80.         if( *$1 != *$3 || *$1 != boolean )
  81.         {
  82.              std::stringstream ss;
  83.             ss << "csak egesz lehet " << std::endl;
  84.             error( ss.str().c_str() );
  85.         }
  86.        $$ = new type(boolean);
  87.     }
  88. |
  89.     kifejezes EGYENLO kifejezes
  90.     {
  91.        if( *$1 != *$3  )
  92.         {
  93.              std::stringstream ss;
  94.             ss << "csak egesz lehet " << std::endl;
  95.             error( ss.str().c_str() );
  96.         }
  97.        $$ = new type(boolean);
  98.     }
  99. |
  100.     kifejezes KISEBBEGYENLO kifejezes
  101.     {
  102.         if( *$1 != *$3  )
  103.         {
  104.              std::stringstream ss;
  105.             ss << "csak egesz lehet " << std::endl;
  106.             error( ss.str().c_str() );
  107.         }
  108.        $$ = new type(boolean);
  109.     }
  110. |
  111.     kifejezes NAGYOBBEGYENLO kifejezes
  112.     {
  113.         if( *$1 != *$3  )
  114.         {
  115.              std::stringstream ss;
  116.             ss << "csak egesz lehet " << std::endl;
  117.             error( ss.str().c_str() );
  118.         }
  119.        $$ = new type(boolean);
  120.     }
  121. |
  122.     kifejezes ES kifejezes
  123.     {
  124.         if( *$1 != *$3 || *$1 != boolean )
  125.         {
  126.              std::stringstream ss;
  127.             ss << "csak egesz lehet " << std::endl;
  128.             error( ss.str().c_str() );
  129.         }
  130.        $$ = new type(boolean);
  131.     }
  132. |
  133.     kifejezes VAGY kifejezes
  134.     {
  135.         if( *$1 != *$3 || *$1 != boolean )
  136.         {
  137.              std::stringstream ss;
  138.             ss << "csak egesz lehet " << std::endl;
  139.             error( ss.str().c_str() );
  140.         }
  141.        $$ = new type(boolean);
  142.     }
  143. |
  144.     NEM kifejezes
  145.     {
  146.         if( *$2 != boolean )
  147.         {
  148.              std::stringstream ss;
  149.             ss << "csak egesz lehet " << std::endl;
  150.             error( ss.str().c_str() );
  151.         }
  152.        $$ = new type(boolean);
  153.     }
  154. |
  155.     BALZAROJEL kifejezes JOBBZAROJEL
  156.     {
  157.         $$ = $2;
  158.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement