No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 

60 líneas
1.3 KiB

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