public override object Visit (TryFinally tryFinallyStatement) { TryCatchStatement result; var location = LocationsBag.GetLocations (tryFinallyStatement); if (tryFinallyStatement.Stmt is TryCatch) { result = (TryCatchStatement)tryFinallyStatement.Stmt.Accept (this); } else { result = new TryCatchStatement (); result.AddChild (new CSharpTokenNode (Convert (tryFinallyStatement.loc), "try".Length), TryCatchStatement.TryKeywordRole); result.AddChild ((INode)tryFinallyStatement.Stmt.Accept (this), TryCatchStatement.TryBlockRole); } if (location != null) result.AddChild (new CSharpTokenNode (Convert (location[0]), "finally".Length), TryCatchStatement.FinallyKeywordRole); result.AddChild ((INode)tryFinallyStatement.Fini.Accept (this), TryCatchStatement.FinallyBlockRole); return result; }
public override object Visit (TryCatch tryCatchStatement) { var result = new TryCatchStatement (); result.AddChild (new CSharpTokenNode (Convert (tryCatchStatement.loc), "try".Length), TryCatchStatement.TryKeywordRole); result.AddChild ((INode)tryCatchStatement.Block.Accept (this), TryCatchStatement.TryBlockRole); foreach (Catch ctch in tryCatchStatement.Specific) { result.AddChild (ConvertCatch (ctch), TryCatchStatement.CatchClauseRole); } if (tryCatchStatement.General != null) result.AddChild (ConvertCatch (tryCatchStatement.General), TryCatchStatement.CatchClauseRole); return result; }
public override object Visit(TryCatch tryCatchStatement) { var result = new TryCatchStatement(); result.AddChild(new CSharpTokenNode(Convert(tryCatchStatement.loc), TryCatchStatement.TryKeywordRole), TryCatchStatement.TryKeywordRole); if (tryCatchStatement.Block != null) result.AddChild((BlockStatement)tryCatchStatement.Block.Accept(this), TryCatchStatement.TryBlockRole); if (tryCatchStatement.Clauses != null) { foreach (var ctch in tryCatchStatement.Clauses) { result.AddChild(ConvertCatch(ctch), TryCatchStatement.CatchClauseRole); } } // if (tryCatchStatement.General != null) // result.AddChild (ConvertCatch (tryCatchStatement.General), TryCatchStatement.CatchClauseRole); return result; }