Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

64 wiersze
1.5 KiB

  1. //
  2. // Lol Engine
  3. //
  4. // Copyright: (c) 2013 Benjamin "Touky" Huet <huet.benjamin@gmail.com>
  5. // (c) 2013 Sam Hocevar <sam@hocevar.net>
  6. // This program is free software; you can redistribute it and/or
  7. // modify it under the terms of the Do What The Fuck You Want To
  8. // Public License, Version 2, as published by Sam Hocevar. See
  9. // http://www.wtfpl.net/ for more details.
  10. //
  11. #ifndef __SCENESETUP_COMPILER_H__
  12. #define __SCENESETUP_COMPILER_H__
  13. #include <string>
  14. #ifndef __FLEX_LEXER_H
  15. # define yyFlexLexer SceneSetupFlexLexer
  16. # include "FlexLexer.h"
  17. # undef yyFlexLexer
  18. #endif
  19. #include "generated/scenesetup-parser.h"
  20. class SceneSetup;
  21. namespace lol
  22. {
  23. //----
  24. class SceneSetupScanner : public SceneSetupFlexLexer
  25. {
  26. public:
  27. SceneSetupScanner(char const *command);
  28. virtual ~SceneSetupScanner();
  29. virtual int LexerInput(char* buf, int max_size);
  30. virtual SceneSetupParser::token_type lex(SceneSetupParser::semantic_type* yylval,
  31. SceneSetupParser::location_type* yylloc);
  32. private:
  33. char const *m_input;
  34. };
  35. //----
  36. class SceneSetupCompiler
  37. {
  38. public:
  39. SceneSetupCompiler(class SceneSetup &uro);
  40. bool ParseString(char const *command);
  41. void Error(const class location& l, const std::string& m);
  42. void Error(const std::string& m);
  43. class SceneSetupScanner* m_lexer;
  44. class SceneSetup& m_sstp;
  45. String m_last_cmd;
  46. };
  47. } /* namespace lol */
  48. #endif /* __SCENESETUP_COMPILER_H__ */