Inheritance: System.Compiler.Statement
Example #1
0
 private TraceStatement VisitTrace(TraceStatement trace)
 {
     trace.Operands = this.VisitExpressionList(trace.Operands);
     return trace;
 }
Example #2
0
        private TraceStatement VisitTrace(TraceStatement trace)
        {
            WriteStart("trace(");
            this.VisitExpressionList(trace.Operands);
            WriteFinish(");");

            return trace;
        }
Example #3
0
        private Statement VisitTrace(TraceStatement trace)
        {
            Statement traceStmt = Templates.GetStatementTemplate("Trace");

            Replacer.Replace(traceStmt, "_context", splicer.SourceContextConstructor(trace.SourceContext));
            Replacer.Replace(traceStmt, "_contextAttr", splicer.ContextAttributeConstructor(this.attributes));

            // Append the user's arguments to the call to StateImpl.Trace

            ExpressionStatement exprStmt = traceStmt as ExpressionStatement;
            Debug.Assert(exprStmt != null);

            MethodCall mcall = exprStmt.Expression as MethodCall;
            Debug.Assert(mcall != null);

            ExpressionList operands = this.VisitExpressionList(trace.Operands);

            for (int i = 0, n = operands.Count; i < n; i++)
                mcall.Operands.Add(operands[i]);

            return traceStmt;
        }
Example #4
0
 private TraceStatement VisitTrace(TraceStatement trace)
 {
     if (trace == null) return null;
     TraceStatement result = (TraceStatement)trace.Clone();
     result.Operands = this.VisitExpressionList(trace.Operands);
     return result;
 }
Example #5
0
        private TraceStatement VisitTrace(TraceStatement trace)
        {
            BasicBlock block = AddBlock(new BasicBlock(trace, CurrentContinuation));
            CurrentContinuation = block;

            return trace;
        }
Example #6
0
        private TraceStatement VisitTrace(TraceStatement trace)
        {
            trace.Operands = base.VisitExpressionList(trace.Operands);

            if (trace.Operands == null || trace.Operands.Count == 0)
            {
                this.HandleError(trace, Error.TraceExpectedArguments);
                return null;
            }

            Expression arg0 = trace.Operands[0];
            Literal lit0 = arg0 as Literal;
            if (lit0 == null)
            {
                this.HandleError(trace, Error.ExpectedStringLiteral);
                return null;
            }

            if (!(lit0.Value is string))
            {
                this.HandleError(lit0, Error.ExpectedStringLiteral);
                return null;
            }

            return trace;
        }
Example #7
0
 private TraceStatement VisitTrace(TraceStatement trace)
 {
     if (trace == null) return null;
     trace.Operands = this.VisitExpressionList(trace.Operands);
     return trace;
 }