public virtual ICodeNode VisitSwitchStatement(SwitchStatement node) { node.Expression = (Expression)Visit(node.Expression); node.Cases = (SwitchCaseCollection)Visit(node.Cases); return(node); }
public override void VisitSwitchStatement (SwitchStatement node) { WriteKeyword ("switch"); WriteSpace (); WriteToken ("("); Visit (node.Expression); WriteToken (")"); WriteLine (); WriteBlock (() => Visit (node.Cases)); }
public virtual void VisitSwitchStatement (SwitchStatement node) { Visit (node.Expression); Visit (node.Cases); }
public override void OnSwitch (Instruction instruction) { //AddOptimizedSwitch (instruction); var @switch = new SwitchStatement (Pop ()); var targets = (Instruction []) instruction.Operand; for (int i = 0; i < targets.Length; i++) { var target = targets [i]; var body = new BlockStatement (); var condition = new ConditionCase (new LiteralExpression (i), body); body.Statements.Add ( new GotoStatement (GetLabelName (target))); @switch.Cases.Add (condition); } Add (@switch); }
public virtual void VisitSwitchStatement(SwitchStatement node) { Visit(node.Expression); Visit(node.Cases); }