Esempio n. 1
0
 public override bool Render(RenderContext dest)
 {
     dest.Append("while(");
     Condition.Render(dest);
     dest.Append(")");
     return(Code.RenderIndented(dest));
 }
Esempio n. 2
0
 public override bool Render(RenderContext dest)
 {
     dest.Append("with(");
     Expression.Render(dest);
     dest.Append(")");
     return(Code.RenderIndented(dest));
 }
Esempio n. 3
0
        public override bool Render(RenderContext dest)
        {
            if (!Expression.RootNode.HasSideEffects())
            {
                dest.Compiler.RecordWarning(Bookmark, "expression has no side effects");
            }

            return(Expression.Render(dest));
        }
Esempio n. 4
0
 public override bool Render(RenderContext dest)
 {
     // Render the statement, need special handling to insert
     // a space if don't have a braced statement block
     dest.Append("do");
     if (Code.RenderIndented(dest))
     {
         dest.Append(';');
     }
     dest.StartLine();
     dest.Append("while(");
     Condition.Render(dest);
     dest.Append(')');
     return(false);
 }
Esempio n. 5
0
        public override bool Render(RenderContext dest)
        {
            if (Value == null)
            {
                dest.Append(Op.ToString().Substring(3));
                return(true);
            }


            dest.DisableLineBreaks();
            dest.Append(Op.ToString().Substring(3));
            dest.EnableLineBreaksAfterNextWrite();
            Value.Render(dest);
            return(true);
        }
Esempio n. 6
0
 public override bool Render(RenderContext dest)
 {
     dest.Append("for(");
     if (VariableDeclaration != null)
     {
         VariableDeclaration.Render(dest);
     }
     else
     {
         Iterator.Render(dest);
     }
     dest.Append("in");
     Collection.Render(dest);
     dest.Append(")");
     return(Code.RenderIndented(dest));
 }
Esempio n. 7
0
 public override bool Render(RenderContext dest)
 {
     dest.Append("for(");
     if (Initialize != null)
     {
         Initialize.Render(dest);
     }
     dest.Append(";");
     if (Condition != null)
     {
         Condition.Render(dest);
     }
     dest.Append(";");
     if (Increment != null)
     {
         Increment.Render(dest);
     }
     dest.Append(")");
     return(Code.RenderIndented(dest));
 }
Esempio n. 8
0
        public override bool Render(RenderContext dest)
        {
            // Statement
            dest.Append("if(");
            Condition.Render(dest);
            dest.Append(")");

            // True block
            bool retv;

            if (CheckForHangingElse())
            {
                dest.StartLine();
                dest.Append("{");
                TrueStatement.RenderIndented(dest);
                dest.StartLine();
                dest.Append("}");
                retv = false;
            }
            else
            {
                retv = TrueStatement.RenderIndented(dest);
            }

            // False block
            if (FalseStatement != null)
            {
                if (retv)
                {
                    dest.Append(';');
                }

                dest.StartLine();

                dest.Append("else");

                retv = FalseStatement.RenderIndented(dest);
            }

            return(retv);
        }
Esempio n. 9
0
        public override bool Render(RenderContext dest)
        {
            // Enter a new symbol scope since the exception variable
            // can be obfuscated
            dest.EnterScope(Scope);

            // Catch clause
            dest.StartLine();
            dest.Append("catch(");
            dest.Append(dest.Symbols.GetObfuscatedSymbol(ExceptionVariable));
            if (Condition != null)
            {
                dest.Append("if");
                Condition.Render(dest);
            }
            dest.Append(')');

            // Associated code
            Code.Render(dest);

            // Done
            dest.LeaveScope();
            return(false);
        }