Esempio n. 1
0
        ArithmeticExpression ParseArithmeticExpression()
        {
            var expr = new ArithmeticExpression();

            expr.Operator = AcceptElement(Token.Mul, Token.Sdiv, Token.Add, Token.Sub, Token.Srem, Token.Xor, Token.Zext, Token.And, Token.Or,
                                          Token.Ashr, Token.Lshr).Type;

            if (AcceptElementIfNext(Token.Nuw))
            {
                expr.NoUnsignedWrap = true;
            }
            if (AcceptElementIfNext(Token.Nsw))
            {
                expr.NoSignedWrap = true;
            }

            expr.Type     = ParseType();
            expr.Operand1 = ParseExpression();

            if (PeekElement().Type == Token.Comma)
            {
                AcceptElement(Token.Comma);
                expr.Operand2 = ParseExpression();
            }
            else
            {
                AcceptElement(Token.To);
                expr.To = ParseType();
            }
            return(expr);
        }
Esempio n. 2
0
 public object Visit(ArithmeticExpression arithmeticExpression)
 {
     return(null);
 }