Exemplo n.º 1
0
 private bool ReadUnaryPosOp(StringReader p, out OperationExpr op)
 {
     op = null;
     int i;
     if (p.ThisText(new[] { "++", "--" }, out i))
         switch (i)
         {
             case 0:
                 op = new PosIncExpr();
                 break;
             case 1:
                 op = new PosDecExpr();
                 break;
         }
     return op != null;
 }
Exemplo n.º 2
0
 private bool ReadUnaryPreOp(StringReader p, out OperationExpr op)
 {
     op = null;
     int i;
     if (p.ThisText(new[] { "++", "--", "+", "-", "!", "~" }, out i))
     {
         if (i == 0)
             op = new PreIncExpr();
         else if (i == 1)
             op = new PreDecExpr();
         else if (i == 2)
             op = new PlusExpr();
         else if (i == 3)
             op = new NegExpr();
         else if (i == 4)
             op = new BoolNotExpr();
         else if (i == 5)
             op = new BitNotExpr();
     }
     return op != null;
 }
Exemplo n.º 3
0
 private bool ReadBinaryOp(StringReader p, out OperationExpr bin)
 {
     bin = null;
     int i;
     if (p.ThisText(BinaryOpStrings, out i))
     {
         bin = (OperationExpr)Activator.CreateInstance(BinaryOpTypes[i]);
         return true;
     }
     return false;
 }