1 /* 2 * Copyright 2006-2008 The FLWOR Foundation. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 #pragma once 17 #ifndef ZORBA_PARSENODE_VISITOR_H 18 #define ZORBA_PARSENODE_VISITOR_H 19 20 #include "common/shared_types.h" 21 22 // Any file that includes parsenode_visitor.h will need to access the 23 // actual parsendoe classes. 24 #include "compiler/parsetree/parsenodes.h" 25 26 namespace zorba 27 { 28 29 /*______________________________________________________________________ 30 | 31 | Design note: Visitor pattern. See, for example: 32 | "Modern C++ Design" by Andrei Alexandrescu, Addison Wesley (2001), 33 | Chapter 10. 34 |_______________________________________________________________________*/ 35 36 class parsenode_visitor 37 { 38 public: ~parsenode_visitor()39 virtual ~parsenode_visitor() { } 40 41 static void *no_state; 42 43 # define DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( NODE ) \ 44 virtual void* begin_visit( NODE const& ) = 0; \ 45 virtual void end_visit( NODE const&, void *visit_state ) = 0; 46 47 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( AbbrevForwardStep ); 48 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( AnyKindTest ); 49 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( AnnotationParsenode ); 50 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( AnnotationListParsenode ); 51 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( AnnotationLiteralListParsenode ); 52 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( AposAttrContentList ); 53 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( AposAttrValueContent ); 54 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( ArgList ); 55 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( AtomicType ); 56 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( AttributeTest ); 57 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( BaseURIDecl ); 58 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( BoundarySpaceDecl ); 59 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( CaseClause ); 60 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( CaseClauseList ); 61 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( CommentTest ); 62 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( ConstructionDecl ); 63 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( CopyNamespacesDecl ); 64 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( DefaultCollationDecl ); 65 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( DefaultNamespaceDecl ); 66 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( DirAttr ); 67 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( DirAttributeList ); 68 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( DirAttributeValue ); 69 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( DirElemContentList ); 70 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( DocumentTest ); 71 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( ElementTest ); 72 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( EmptyOrderDecl ); 73 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( ForClause ); 74 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FLWORClauseList ); 75 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( ForwardAxis ); 76 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( ForwardStep ); 77 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FunctionDecl ); 78 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( GeneralComp ); 79 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( ItemType ); 80 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( StructuredItemType ); 81 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( LetClause ); 82 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( LibraryModule ); 83 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( Literal ); 84 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( MainModule ); 85 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( ModuleDecl ); 86 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( ModuleImport ); 87 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( NameTest ); 88 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( NamespaceDecl ); 89 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( NodeComp ); 90 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( OccurrenceIndicator ); 91 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( OptionDecl ); 92 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( GroupByClause ); 93 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( GroupSpecList ); 94 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( GroupSpec ); 95 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( GroupCollationSpec ); 96 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( OrderByClause ); 97 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( OrderCollationSpec ); 98 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( OrderDirSpec ); 99 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( OrderEmptySpec ); 100 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( OrderModifierPN ); 101 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( OrderSpec ); 102 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( OrderSpecList ); 103 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( OrderingModeDecl ); 104 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( PITest ); 105 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( Param ); 106 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( ParamList ); 107 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( PositionalVar ); 108 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( Pragma ); 109 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( PragmaList ); 110 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( PredicateList ); 111 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( Prolog ); 112 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( QVarInDecl ); 113 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( QVarInDeclList ); 114 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( QuoteAttrValueContent ); 115 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( QuoteAttrContentList ); 116 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( ReverseAxis ); 117 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( ReverseStep ); 118 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( SIND_DeclList ); 119 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( SchemaAttributeTest ); 120 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( SchemaElementTest ); 121 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( SchemaImport ); 122 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( SchemaPrefix ); 123 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( SequenceType ); 124 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( SignList ); 125 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( SingleType ); 126 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( TextTest ); 127 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( TypeName ); 128 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( URILiteralList ); 129 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( ValueComp ); 130 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( CtxItemDecl ); 131 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( CollectionDecl ); 132 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( AST_IndexDecl ); 133 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( IndexKeySpec ); 134 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( IndexKeyList ); 135 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( IntegrityConstraintDecl ); 136 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( GlobalVarDecl ); 137 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( LocalVarDecl ); 138 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( VarGetsDecl ); 139 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( VarGetsDeclList ); 140 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( VarInDecl ); 141 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( VarInDeclList ); 142 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( VersionDecl ); 143 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( VFO_DeclList ); 144 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( WhereClause ); 145 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( CountClause ); 146 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( Wildcard ); 147 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( QName ); 148 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( DecimalFormatNode ); 149 150 /* expressions */ 151 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( AdditiveExpr ); 152 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( AndExpr ); 153 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( AxisStep ); 154 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( CDataSection ); 155 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( CastExpr ); 156 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( CastableExpr ); 157 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( CommonContent ); 158 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( ComparisonExpr ); 159 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( CompAttrConstructor ); 160 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( CompCommentConstructor ); 161 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( CompDocConstructor ); 162 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( CompElemConstructor ); 163 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( CompPIConstructor ); 164 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( CompTextConstructor ); 165 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( ContextItemExpr ); 166 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( DirCommentConstructor ); 167 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( DirElemConstructor ); 168 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( DirElemContent ); 169 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( DirPIConstructor ); 170 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( EnclosedExpr ); 171 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( BlockBody ); 172 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( ApplyExpr ); 173 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( Expr ); 174 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( ExtensionExpr ); 175 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FLWORExpr ); 176 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( WindowClause ); 177 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( WindowVarDecl ); 178 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FLWORWinCond ); 179 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( WindowVars ); 180 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FilterExpr ); 181 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FunctionCall ); 182 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( IfExpr ); 183 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( InstanceofExpr ); 184 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( IntersectExceptExpr ); 185 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( MultiplicativeExpr ); 186 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( NumericLiteral ); 187 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( OrExpr ); 188 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( OrderedExpr ); 189 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( ParenthesizedExpr ); 190 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( PathExpr ); 191 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( QuantifiedExpr ); 192 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( QueryBody ); 193 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( RangeExpr ); 194 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( RelativePathExpr ); 195 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( SimpleMapExpr ); 196 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( StringLiteral ); 197 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( StringConcatExpr ); 198 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( TreatExpr ); 199 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( SwitchExpr ); 200 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( SwitchCaseClause ); 201 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( SwitchCaseClauseList ); 202 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( SwitchCaseOperandList ); 203 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( TypeswitchExpr ); 204 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( UnaryExpr ); 205 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( UnionExpr ); 206 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( UnorderedExpr ); 207 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( ValidateExpr ); 208 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( VarRef ); 209 210 /* update-related */ 211 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( DeleteExpr ); 212 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( InsertExpr ); 213 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( RenameExpr ); 214 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( ReplaceExpr ); 215 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( RevalidationDecl ); 216 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( TransformExpr ); 217 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( CopyVarList ); 218 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( VarBinding ); 219 220 /* try-catch-related */ 221 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( TryExpr ); 222 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( CatchListExpr ); 223 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( CatchExpr ); 224 225 /* full-text-related */ 226 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FTAnd ); 227 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FTAnyallOption ); 228 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FTBigUnit ); 229 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FTCaseOption ); 230 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FTContainsExpr ); 231 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FTContent ); 232 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FTDiacriticsOption ); 233 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FTDistance ); 234 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FTExtensionOption ); 235 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FTExtensionSelection ); 236 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FTIgnoreOption ); 237 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FTLanguageOption ); 238 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FTMatchOptions ); 239 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FTMildNot ); 240 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FTOptionDecl ); 241 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FTOr ); 242 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FTOrder ); 243 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FTPrimaryWithOptions ); 244 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FTRange ); 245 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FTScope ); 246 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FTScoreVar ); 247 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FTSelection ); 248 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FTStemOption ); 249 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FTStopWordOption ); 250 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FTStopWords ); 251 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FTStopWordsInclExcl ); 252 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FTThesaurusID ); 253 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FTThesaurusOption ); 254 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FTTimes ); 255 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FTUnaryNot ); 256 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FTUnit ); 257 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FTWeight ); 258 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FTWildCardOption ); 259 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FTWindow ); 260 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FTWords ); 261 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FTWordsTimes ); 262 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FTWordsValue ); 263 264 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( AssignExpr ); 265 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( ExitExpr ); 266 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( WhileExpr ); 267 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( FlowCtlStatement ); 268 269 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( ParseErrorNode ); 270 271 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( LiteralFunctionItem ); 272 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( InlineFunction ); 273 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( AnyFunctionTest ); 274 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( TypeList ); 275 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( TypedFunctionTest ); 276 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( DynamicFunctionInvocation ); 277 278 /* JSON */ 279 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( JSONArrayConstructor ); 280 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( JSONObjectConstructor ); 281 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( JSONDirectObjectConstructor ); 282 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( JSONPairConstructor ); 283 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( JSONPairList ); 284 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( JSON_Test ); 285 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( JSONObjectInsertExpr ); 286 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( JSONArrayInsertExpr ); 287 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( JSONArrayAppendExpr ); 288 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( JSONDeleteExpr ); 289 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( JSONReplaceExpr ); 290 DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( JSONRenameExpr ); 291 292 # undef DECL_PARSENODE_VISITOR_VISIT_MEM_FNS 293 # define DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( NODE ) \ 294 void* begin_visit( NODE const& ); \ 295 void end_visit( NODE const&, void *visit_state ); 296 297 /* Methods that deviate from the visitor pattern that are 298 * needed in various situations. 299 */ intermediate_visit(RelativePathExpr const &,void *)300 virtual void intermediate_visit(RelativePathExpr const&, void*) { } intermediate_visit(WindowClause const &,void *)301 virtual void intermediate_visit(WindowClause const&, void*) { } post_axis_visit(AxisStep const &,void *)302 virtual void post_axis_visit(AxisStep const&, void *) { } post_predicate_visit(PredicateList const &,void *)303 virtual void post_predicate_visit(PredicateList const&, void*) { } post_primary_visit(FilterExpr const &,void *)304 virtual void post_primary_visit(FilterExpr const&, void *) { } pre_predicate_visit(PredicateList const &,void *)305 virtual void pre_predicate_visit(PredicateList const&, void*) { } 306 307 /** 308 * Methods are used in the translator to check if a DirElemContent is 309 * boundary whitespace. 310 */ begin_check_boundary_whitespace()311 virtual void begin_check_boundary_whitespace() {} check_boundary_whitespace(const DirElemContent &)312 virtual void check_boundary_whitespace(const DirElemContent&) {} end_check_boundary_whitespace()313 virtual void end_check_boundary_whitespace() {} 314 is_root_rpe(const RelativePathExpr *)315 virtual bool is_root_rpe(const RelativePathExpr*) { return true; } 316 317 }; 318 319 } /* namespace zorba */ 320 #endif /* ZORBA_PARSENODE_VISITOR_H */ 321 /* vim:set et sw=2 ts=2: */ 322