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(); }
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); }
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; }
public SJumpStatement(SExpression returnedExpression, SStatement nextStatement) : base("return " + returnedExpression.CodeString, nextStatement) { TargetIdentifier = null; ReturnedExpression = returnedExpression; }
public SExpressionStatement(SExpression expression, SStatement nextStatement) : base(expression.CodeString, nextStatement) { _expression = expression; }