예제 #1
0
        Expression bitwise()
        {
            Token      temp = next;
            Expression x    = shift();

            while (true)
            {
                switch (t)
                {
                case TokenKind.BitwiseAnd:
                    move(); x = new BitwiseAnd(x, shift(), temp.line, temp.col); continue;

                case TokenKind.BitwiseOr:
                    move(); x = new BitwiseOr(x, shift(), temp.line, temp.col); continue;

                case TokenKind.BitwiseXor:
                    move(); x = new BitwiseXor(x, shift(), temp.line, temp.col); continue;

                default:
                    return(x);
                }
            }
        }
예제 #2
0
 Expression bitwise()
 {
     Token temp = next;
     Expression x = shift();
     while (true)
     {
         switch (t)
         {
             case TokenKind.BitwiseAnd:
                 move(); x = new BitwiseAnd(x, shift(), temp.line, temp.col); continue;
             case TokenKind.BitwiseOr:
                 move(); x = new BitwiseOr(x, shift(), temp.line, temp.col); continue;
             case TokenKind.BitwiseXor:
                 move(); x = new BitwiseXor(x, shift(), temp.line, temp.col); continue;
             default:
                 return x;
         }
     }
 }