cppExpressionParser.h 996 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // Filename: cppExpressionParser.h
  2. // Created by: drose (25Oct99)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. #ifndef CPPEXPRESSIONPARSER_H
  6. #define CPPEXPRESSIONPARSER_H
  7. #include <dtoolbase.h>
  8. #include "cppPreprocessor.h"
  9. class CPPExpression;
  10. class CPPScope;
  11. ///////////////////////////////////////////////////////////////////
  12. // Class : CPPExpressionParser
  13. // Description :
  14. ////////////////////////////////////////////////////////////////////
  15. class CPPExpressionParser : public CPPPreprocessor {
  16. public:
  17. CPPExpressionParser(CPPScope *current_scope, CPPScope *global_scope);
  18. ~CPPExpressionParser();
  19. bool parse_expr(const string &expr);
  20. bool parse_expr(const string &expr, const CPPPreprocessor &filepos);
  21. void output(ostream &out) const;
  22. CPPScope *_current_scope;
  23. CPPScope *_global_scope;
  24. CPPExpression *_expr;
  25. };
  26. inline ostream &
  27. operator << (ostream &out, const CPPExpressionParser &ep) {
  28. ep.output(out);
  29. return out;
  30. }
  31. #endif