示例#1
0
        public void LogicalNotExpression()
        {
            var e = new LogicalNotExpression(new StringLiteral("lol"));

            Assert.IsFalse(e.IsTrivial);
            Assert.AreEqual("(!\"lol\")", e.ToString());
            Assert.AreEqual("LogicalNot", e.Name);
        }
示例#2
0
        public string Visit(LogicalNotExpression node)
        {
            var codeWriter = new XzaarCodeWriter();
            var indent     = IsInsideExpression ? 0 : currentIndent;

            insideExpressionCount++;
            codeWriter.Write("!", indent);
            codeWriter.Write(Visit(node.Expression));
            insideExpressionCount--;
            if (!IsInsideExpression)
            {
                codeWriter.NewLine();
            }
            return(codeWriter.ToString());
        }
示例#3
0
 internal Expression ParseLogicNot() // E -> !E E'
 {
     if (this.input.Read() is LogicalNotToken)
     {
         Expression ex = this.ParseEx();
         if (ex != null)
         {
             Expression res;
             if (ex is UnaryExpression)
             {
                 res = new LogicalNotExpression()
                 {
                     Oprand = ex
                 };
                 return(this.ParseExPrime(res));
             }
             else
             {
                 // BinaryExpression
                 BinaryExpression be = (BinaryExpression)ex;
                 res = new LogicalNotExpression()
                 {
                     Oprand = be.Lhs
                 };
                 be.Lhs = res;
                 return(be);
             }
         }
         else
         {
             throw new ArgumentException("Failed parse LogicNot");
         }
     }
     else
     {
         this.input.Unread();
         return(null);
     }
 }
示例#4
0
 public override void Visit(LogicalNotExpression node)
 {
     Visit((UnaryExpression)node);
 }
示例#5
0
 public override void Visit(LogicalNotExpression node)
 {
     unfinishedClone = new LogicalNotExpression(GetCloneOf(node.Expression));
     base.Visit(node);
 }
示例#6
0
 public override void Visit(LogicalNotExpression node)
 {
     UpdateType(node, TypeCalculator.GetType(node));
 }
示例#7
0
 public override void Visit(LogicalNotExpression node)
 {
     AssignToImplicitReturn(node);
 }
 public object Visit(LogicalNotExpression expr)
 {
     return(null);
 }
 public object Visit(LogicalNotExpression expr)
 {
     throw new System.NotImplementedException();
 }