예제 #1
0
 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));
		}
예제 #3
0
		public virtual void VisitSwitchStatement (SwitchStatement node)
		{
			Visit (node.Expression);
			Visit (node.Cases);
		}
예제 #4
0
		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);
		}
예제 #5
0
 public virtual void VisitSwitchStatement(SwitchStatement node)
 {
     Visit(node.Expression);
     Visit(node.Cases);
 }