parserDefs.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // Filename: parserDefs.h
  2. // Created by: drose (17Jan99)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. //
  6. // PANDA 3D SOFTWARE
  7. // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
  8. //
  9. // All use of this software is subject to the terms of the Panda 3d
  10. // Software license. You should have received a copy of this license
  11. // along with this source code; you will also find a current copy of
  12. // the license at http://www.panda3d.org/license.txt .
  13. //
  14. // To contact the maintainers of this program write to
  15. // [email protected] .
  16. //
  17. ////////////////////////////////////////////////////////////////////
  18. #ifndef PARSER_H
  19. #define PARSER_H
  20. #include <pandabase.h>
  21. #include "eggObject.h"
  22. #include <pointerTo.h>
  23. #include <pointerToArray.h>
  24. #include <pta_double.h>
  25. #include <string>
  26. class EggGroupNode;
  27. void egg_init_parser(istream &in, const string &filename,
  28. EggObject *tos, EggGroupNode *egg_top_node);
  29. void egg_cleanup_parser();
  30. // This structure holds the return value for each token.
  31. // Traditionally, this is a union, and is declared with the %union
  32. // declaration in the parser.y file, but unions are pretty worthless
  33. // in C++ (you can't include an object that has member functions in a
  34. // union), so we'll use a class instead. That means we need to
  35. // declare it externally, here.
  36. class EXPCL_PANDAEGG EggTokenType {
  37. public:
  38. double _number;
  39. string _string;
  40. PT(EggObject) _egg;
  41. PTA_double _number_list;
  42. };
  43. // The yacc-generated code expects to use the symbol 'YYSTYPE' to
  44. // refer to the above class.
  45. #define YYSTYPE EggTokenType
  46. #endif