SymbolVisitor.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. // Copyright (c) 2008 Roberto Raggi <[email protected]>
  2. //
  3. // Permission is hereby granted, free of charge, to any person obtaining a copy
  4. // of this software and associated documentation files (the "Software"), to deal
  5. // in the Software without restriction, including without limitation the rights
  6. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7. // copies of the Software, and to permit persons to whom the Software is
  8. // furnished to do so, subject to the following conditions:
  9. //
  10. // The above copyright notice and this permission notice shall be included in
  11. // all copies or substantial portions of the Software.
  12. //
  13. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19. // THE SOFTWARE.
  20. #ifndef SYMBOLVISITOR_H
  21. #define SYMBOLVISITOR_H
  22. #include "CPlusPlusForwardDeclarations.h"
  23. namespace CPlusPlus {
  24. class CPLUSPLUS_EXPORT SymbolVisitor
  25. {
  26. SymbolVisitor(const SymbolVisitor &other);
  27. void operator =(const SymbolVisitor &other);
  28. public:
  29. SymbolVisitor();
  30. virtual ~SymbolVisitor();
  31. void accept(Symbol *symbol);
  32. virtual bool preVisit(Symbol *) { return true; }
  33. virtual void postVisit(Symbol *) {}
  34. virtual bool visit(UsingNamespaceDirective *) { return true; }
  35. virtual bool visit(UsingDeclaration *) { return true; }
  36. virtual bool visit(NamespaceAlias *) { return true; }
  37. virtual bool visit(Declaration *) { return true; }
  38. virtual bool visit(Argument *) { return true; }
  39. virtual bool visit(TypenameArgument *) { return true; }
  40. virtual bool visit(BaseClass *) { return true; }
  41. virtual bool visit(Enum *) { return true; }
  42. virtual bool visit(Function *) { return true; }
  43. virtual bool visit(Namespace *) { return true; }
  44. virtual bool visit(Template *) { return true; }
  45. virtual bool visit(Class *) { return true; }
  46. virtual bool visit(Block *) { return true; }
  47. virtual bool visit(ForwardClassDeclaration *) { return true; }
  48. // Qt
  49. virtual bool visit(QtPropertyDeclaration *) { return true; }
  50. virtual bool visit(QtEnum *) { return true; }
  51. // Objective-C
  52. virtual bool visit(ObjCBaseClass *) { return true; }
  53. virtual bool visit(ObjCBaseProtocol *) { return true; }
  54. virtual bool visit(ObjCClass *) { return true; }
  55. virtual bool visit(ObjCForwardClassDeclaration *) { return true; }
  56. virtual bool visit(ObjCProtocol *) { return true; }
  57. virtual bool visit(ObjCForwardProtocolDeclaration *) { return true; }
  58. virtual bool visit(ObjCMethod *) { return true; }
  59. virtual bool visit(ObjCPropertyDeclaration *) { return true; }
  60. };
  61. } // namespace CPlusPlus
  62. #endif // SYMBOLVISITOR_H