示例#1
0
 public SSwitchStatement(SExpression condition, SStatement switchStatement,
                         SLabeledStatement[] jumpTargets, SStatement nextStatement)
     : base(condition != null ? "switch: " + condition.CodeString : "",
            new SLabeledStatement("switch break target", null, nextStatement) { Visible = false })
 {
     Condition       = condition;
     SwitchStatement = switchStatement;
     SwitchStatement.SetNextStatement(null);
     this.jumpTargets = (SLabeledStatement[])jumpTargets.Clone();
 }
示例#2
0
        public SConditionalStatement(SExpression condition, SStatement ifTrueStatement, SStatement elseStatement,
                                     SStatement nextStatement)
            : base(condition != null ? "if: " + condition.CodeString : "", nextStatement)
        {
            Condition = condition;

            IfTrueStatement = ifTrueStatement;
            ElseStatement   = elseStatement;

            IfTrueStatement.SetNextStatement(null);
            ElseStatement.SetNextStatement(null);
        }
示例#3
0
        public SJumpStatement(string codeString, SStatement nextStatement)
            : base(codeString, nextStatement)
        {
            var parts = codeString.Split(' ');

            if (parts[0] == "goto" && parts.Length > 1)
            {
                TargetIdentifier = parts[1];
            }
            else
            {
                TargetIdentifier = null;
            }

            ReturnedExpression = null;
        }
示例#4
0
 public SJumpStatement(SExpression returnedExpression, SStatement nextStatement)
     : base("return " + returnedExpression.CodeString, nextStatement)
 {
     TargetIdentifier   = null;
     ReturnedExpression = returnedExpression;
 }
示例#5
0
 public SExpressionStatement(SExpression expression, SStatement nextStatement)
     : base(expression.CodeString, nextStatement)
 {
     _expression = expression;
 }