예제 #1
0
 public virtual ICodeNode VisitCatchClause(CatchClause node)
 {
     node.Body     = (BlockStatement)Visit(node.Body);
     node.Variable = (VariableDeclarationExpression)Visit(node.Variable);
     return(node);
 }
		public override void VisitCatchClause (CatchClause node)
		{
			WriteKeyword ("catch");

			if (node.Type.FullName != "System.Object") {
				WriteSpace ();
				WriteToken ("(");
				if (node.Variable != null)
					Visit (node.Variable);
				else
					WriteReference (node.Type);
				WriteToken (")");
			}

			WriteLine ();
			Visit (node.Body);
		}
예제 #3
0
		public virtual void VisitCatchClause (CatchClause node)
		{
			Visit (node.Body);
			Visit (node.Variable);
		}
		CatchClause CreateCatchHandler (CatchHandlerData catch_data)
		{
			var range = catch_data.Range;

			var variable = GetCatchVariable (range.Start.First);

			RemoveVariable (variable);

			var clause = new CatchClause (
				new BlockStatement (),
				catch_data.Type,
				new VariableDeclarationExpression (variable));

			MoveStatementsToBlock (range.Start, range.End, clause.Body);

			return clause;
		}
예제 #5
0
 public virtual void VisitCatchClause(CatchClause node)
 {
     Visit(node.Body);
     Visit(node.Variable);
 }