示例#1
0
 public DeclarationNode(LeafParser.Var_def_vContext ctx)
 {
     Line      = ctx.Start.Line;
     _name     = ctx.Id().GetText();
     Mutable   = ctx.Var() != null;
     Reference = ctx.Ref() != null;
     Value     = ValueNode.Create(ctx.value());
     if (ctx.type(0) != null)
     {
         Type = TypeNode.Create(ctx.type(0));
     }
     if (ctx.type(1) != null)
     {
         Allocator = TypeNode.Create(ctx.type(1));
     }
 }
示例#2
0
        public ScopeNode(LeafParser.Function_scopeContext ctx)
        {
            Line = ctx.Start.Line;
            if (ctx.value() != null)
            {
                AppendStatement(new ReturnNode {
                    Value = ValueNode.Create(ctx.value())
                });
                return;
            }

            foreach (var statement in ctx.statement())
            {
                AppendStatement(StatementNode.Create(statement));
            }
        }
示例#3
0
        public IfNode(LeafParser.IfContext ctx)
        {
            Line  = ctx.Start.Line;
            Check = ValueNode.Create(ctx.value());
            Scope = new ScopeNode(ctx.conditional_scope(0));

            if (ctx.Else() != null)
            {
                if (ctx.conditional_scope(1) != null)
                {
                    Else = new ElseNode(ctx.conditional_scope(1));
                }
                else
                {
                    ElseIf = new ElseIfNode(ctx.@if());
                }
            }
        }
示例#4
0
        void debuggedProcess_DebuggingPaused(object sender, ProcessEventArgs e)
        {
            OnIsProcessRunningChanged(EventArgs.Empty);

            using (new PrintTimes("Jump to current line")) {
                JumpToCurrentLine();
            }
            if (currentTooltipRow != null && currentTooltipRow.IsShown)
            {
                using (new PrintTimes("Update tooltip")) {
                    try {
                        Utils.DoEvents(debuggedProcess);
                        AbstractNode updatedNode = ValueNode.Create(currentTooltipExpression);
                        currentTooltipRow.SetContentRecursive(updatedNode);
                    } catch (AbortedBecauseDebuggeeResumedException) {
                    }
                }
            }
        }
示例#5
0
 public WhileNode(LeafParser.WhileContext ctx)
 {
     Line  = ctx.Start.Line;
     Check = ValueNode.Create(ctx.value());
     Scope = new ScopeNode(ctx.conditional_scope());
 }
示例#6
0
 public AssignmentNode(LeafParser.Var_assContext ctx)
 {
     Line    = ctx.Start.Line;
     _lValue = ValueNode.Create(ctx.value(0));
     _rValue = ValueNode.Create(ctx.value(1));
 }
示例#7
0
 public ReturnNode(LeafParser.ReturnContext ctx)
 {
     Line  = ctx.Start.Line;
     Value = ValueNode.Create(ctx.value());
 }