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

            return trace;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
 }
Ejemplo n.º 5
0
        private TraceStatement VisitTrace(TraceStatement trace)
        {
            BasicBlock block = AddBlock(new BasicBlock(trace, CurrentContinuation));
            CurrentContinuation = block;

            return trace;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 7
0
 private TraceStatement VisitTrace(TraceStatement trace)
 {
     if (trace == null) return null;
     trace.Operands = this.VisitExpressionList(trace.Operands);
     return trace;
 }