Пример #1
0
        public object VisitDoWhileStatement(DoWhileStatementAst doWhileStatementAst)
        {
            var condition = VisitAst(doWhileStatementAst.Condition);
            var body      = VisitAst(doWhileStatementAst.Body);

            return(new DoUntilStatementAst(doWhileStatementAst.Extent, doWhileStatementAst.Label, condition, body));
        }
        public object VisitDoWhileStatement(DoWhileStatementAst doWhileStatementAst)
        {
            var newCondition = VisitElement(doWhileStatementAst.Condition);
            var newBody      = VisitElement(doWhileStatementAst.Body);

            return(new DoWhileStatementAst(doWhileStatementAst.Extent, doWhileStatementAst.Label, newCondition, newBody));
        }
 public virtual StatementAst VisitDoWhileStatement(DoWhileStatementAst doWhileStatementAst)
 {
     return(new DoWhileStatementAst(
                doWhileStatementAst.Extent,
                doWhileStatementAst.Label,
                doWhileStatementAst.Condition.Rewrite(this),
                doWhileStatementAst.Body.Rewrite(this)));
 }
 public static DoWhileStatementAst Update(
     this DoWhileStatementAst ast,
     string label = null,
     PipelineBaseAst condition             = null,
     IEnumerable <StatementAst> statements = null)
 {
     return(new DoWhileStatementAst(
                ast.Extent,
                label ?? ast.Label,
                condition?.Clone() ?? ast.Condition.Clone(),
                ast.Body.Update(statements)));
 }
Пример #5
0
        public override AstVisitAction VisitDoWhileStatement(DoWhileStatementAst doWhileStatementAst)
        {
            explanations.Add(
                new Explanation()
            {
                CommandName     = "do-while statement",
                HelpResult      = HelpTableQuery("about_do"),
                Description     = $"A loop that runs as long as '{doWhileStatementAst.Condition.Extent.Text}' evaluates to true",
                TextToHighlight = "while"
            }.AddDefaults(doWhileStatementAst, explanations));

            return(base.VisitDoWhileStatement(doWhileStatementAst));
        }
Пример #6
0
 public override object VisitDoWhileStatement(DoWhileStatementAst doWhileStatementAst)
 {
     if (doWhileStatementAst.Label != null)
     {
         script_.Write(":" + doWhileStatementAst.Label + " ");
     }
     script_.Write("do{");
     VisitElement(doWhileStatementAst.Body);
     script_.Write("}while(");
     VisitElement(doWhileStatementAst.Condition);
     script_.Write(")");
     return(doWhileStatementAst);
 }
Пример #7
0
 /// <summary/>
 public virtual AstVisitAction VisitDoWhileStatement(DoWhileStatementAst doWhileStatementAst) => DefaultVisit(doWhileStatementAst);
 public object VisitDoWhileStatement(DoWhileStatementAst doWhileStatementAst)
 {
     throw PSTraceSource.NewArgumentException("ast");
 }
Пример #9
0
 public override AstVisitAction VisitDoWhileStatement(DoWhileStatementAst doWhileStatementAst)
 {
     throw new NotImplementedException(); //VisitDoWhileStatement(doWhileStatementAst);
 }
 public override AstVisitAction VisitDoWhileStatement(DoWhileStatementAst doWhileStatementAst)
 {
     return(Visit(doWhileStatementAst));
 }
Пример #11
0
 // DoWhileStatementAst Extension Methods
 // New Methods Available:
 // - CreateNodeFromAST(NodeDepth, NodePosition) => Creates a Node
 // - CreateChildNodes ($item in $collection) {} => Creates Child Nodes
 public static DoWhileNode CreateNodeFromAst(this DoWhileStatementAst _ast, int _depth, int _position, Node _parent, Tree _tree)
 {
     return(new DoWhileNode(_ast, _depth, _position, _parent, _tree));
 }
Пример #12
0
 public object VisitDoWhileStatement(DoWhileStatementAst doWhileStatementAst)
 {
     return(false);
 }
 public virtual TResult VisitDoWhileStatement(DoWhileStatementAst doWhileStatementAst) => default(TResult);
Пример #14
0
 public object VisitDoWhileStatement(DoWhileStatementAst doWhileStatementAst)
 {
     Console.WriteLine("Visited an DoWhileStatementAst.");
     return(doWhileStatementAst);
 }
Пример #15
0
 public object VisitDoWhileStatement(DoWhileStatementAst doWhileStatementAst)
 {
     throw new UnexpectedElementException();
 }
 object ICustomAstVisitor.VisitDoWhileStatement(DoWhileStatementAst doWhileStatementAst)
 => ProcessRewriter(VisitDoWhileStatement, doWhileStatementAst);
 public object VisitDoWhileStatement(DoWhileStatementAst doWhileStatementAst) => null;
Пример #18
0
 public object VisitDoWhileStatement(DoWhileStatementAst doWhileStatementAst)
 {
     throw new NotImplementedException();
 }
 object ICustomAstVisitor.VisitDoWhileStatement(DoWhileStatementAst doWhileStatementAst) => VisitDoWhileStatement(doWhileStatementAst);
Пример #20
0
 public override AstVisitAction VisitDoWhileStatement(DoWhileStatementAst doWhileStatementAst)
 {
     Console.WriteLine("Visited an DoWhileStatementAst.");
     Console.WriteLine("    " + doWhileStatementAst.ToString().Replace(Environment.NewLine, Environment.NewLine + "    "));
     return(AstVisitAction.Continue);
 }
Пример #21
0
 public override AstVisitAction VisitDoWhileStatement(DoWhileStatementAst ast)
 {
     return(AstVisitAction.Continue);
 }
Пример #22
0
 public virtual object VisitDoWhileStatement(DoWhileStatementAst doWhileStatementAst)
 {
     VisitElement(doWhileStatementAst.Condition);
     VisitElement(doWhileStatementAst.Body);
     return(doWhileStatementAst);
 }
Пример #23
0
 public override AstVisitAction VisitDoWhileStatement(DoWhileStatementAst ast)
 {
     return(DoNextAction(ast));
 }
Пример #24
0
 public override AstVisitAction VisitDoWhileStatement(DoWhileStatementAst doWhileStatementAst)
 {
     return(AstVisitAction.SkipChildren);
 }
Пример #25
0
 public override StatementAst VisitDoWhileStatement(DoWhileStatementAst doWhileStatementAst)
 => VisitStatement(base.VisitDoWhileStatement(doWhileStatementAst));
Пример #26
0
 public static IEnumerable <Ast> GetChildAst(this DoWhileStatementAst _ast)
 {
     return(_ast.Body.FindAll(Args => Args is Ast && Args.Parent == _ast.Body, false));
 }
Пример #27
0
 public override AstVisitAction VisitDoWhileStatement(DoWhileStatementAst doWhileStatementAst) => VisitAst(doWhileStatementAst);