Exemple #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);
        }
Exemple #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());
        }
 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);
     }
 }
Exemple #4
0
 public override void Visit(LogicalNotExpression node)
 {
     Visit((UnaryExpression)node);
 }
Exemple #5
0
 public override void Visit(LogicalNotExpression node)
 {
     unfinishedClone = new LogicalNotExpression(GetCloneOf(node.Expression));
     base.Visit(node);
 }
Exemple #6
0
 public override void Visit(LogicalNotExpression node)
 {
     UpdateType(node, TypeCalculator.GetType(node));
 }
Exemple #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();
 }