15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// 25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// ANTLRTreeVisitorAction.h 35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// ANTLR 45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// 55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Created by Alan Condit on 6/18/10. 65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// [The "BSD licence"] 72a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Copyright (c) 2010 Alan Condit 82a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// All rights reserved. 92a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// 102a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Redistribution and use in source and binary forms, with or without 115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// modification, are permitted provided that the following conditions 122a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// are met: 13c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// 1. Redistributions of source code must retain the above copyright 145d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// notice, this list of conditions and the following disclaimer. 155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// 2. Redistributions in binary form must reproduce the above copyright 165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// notice, this list of conditions and the following disclaimer in the 17c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// documentation and/or other materials provided with the distribution. 185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// 3. The name of the author may not be used to endorse or promote products 195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// derived from this software without specific prior written permission. 205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// 21effb81e5f8246d0db0270817048dc992db66e9fbBen Murdoch// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 22effb81e5f8246d0db0270817048dc992db66e9fbBen Murdoch// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 23effb81e5f8246d0db0270817048dc992db66e9fbBen Murdoch// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 24effb81e5f8246d0db0270817048dc992db66e9fbBen Murdoch// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 25effb81e5f8246d0db0270817048dc992db66e9fbBen Murdoch// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 26effb81e5f8246d0db0270817048dc992db66e9fbBen Murdoch// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 30effb81e5f8246d0db0270817048dc992db66e9fbBen Murdoch// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#import <Cocoa/Cocoa.h> 33c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) 34ba5b9a6411cb1792fd21f0a078d7a25cd1ceec16Ben Murdoch 35a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)@interface ANTLRTreeVisitorAction : NSObject 36116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch{ 37effb81e5f8246d0db0270817048dc992db66e9fbBen Murdoch 38effb81e5f8246d0db0270817048dc992db66e9fbBen Murdoch} 39116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch 405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)+ (ANTLRTreeVisitorAction *)newANTLRTreeVisitorAction; 41116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch- (id) init; 42116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch 43116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch/** Execute an action before visiting children of t. Return t or 44116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch * a rewritten t. It is up to the visitor to decide what to do 45116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch * with the return value. Children of returned value will be 46116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch * visited if using TreeVisitor.visit(). 47116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch */ 48116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch- (ANTLRTreeVisitorAction *)pre:(ANTLRTreeVisitorAction *) t; 49116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch 50116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch/** Execute an action after visiting children of t. Return t or 51116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch * a rewritten t. It is up to the visitor to decide what to do 52116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch * with the return value. 53116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch */ 54116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch- (ANTLRTreeVisitorAction *)post:(ANTLRTreeVisitorAction *) t; 55116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch 56116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch@end 5746d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)