Advertisement
Guest User

kusok

a guest
Mar 31st, 2015
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1.     while(lex_queue.isEmpty()!=NULL)
  2.     {
  3.         Lexem a=lex_queue.dequeue();
  4.         if( a.priority=0)
  5.         {
  6.             making.enqueue(a);
  7.         }
  8.         else
  9.         {
  10.             if(!operators.isEmpty())
  11.             {
  12.                 Lexem cur = operators.pop();
  13.                 if (a.priority<=cur.priority)
  14.                 {
  15.                     making.enqueue(cur);
  16.                     operators.push(a);
  17.                 }
  18.                 else
  19.                 {
  20.                     operators.push(cur);
  21.                     operators.push(a);
  22.                 }
  23.             }
  24.         }
  25.     }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement