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.
 
 
 

49 wiersze
1.0 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. #include <lol/engine-internal.h>
  11. #include <string>
  12. #include "gpu/lolfx-compiler.h"
  13. namespace lol
  14. {
  15. LolFxCompiler::LolFxCompiler(LolFx &lolfx)
  16. : m_lolfx(lolfx)
  17. {
  18. }
  19. bool LolFxCompiler::ParseString(char const *command)
  20. {
  21. LolFxScanner scanner(command);
  22. m_lexer = &scanner;
  23. LolFxParser parser(*this);
  24. //parser.set_debug_level(1);
  25. if (parser.parse() != 0)
  26. return false;
  27. return true;
  28. }
  29. void LolFxCompiler::Error(const class location& l, const std::string& m)
  30. {
  31. Log::Error("LolFx syntax error line %d column %d: %s\n",
  32. l.begin.line, l.begin.column, m.c_str());
  33. }
  34. void LolFxCompiler::Error(const std::string& m)
  35. {
  36. Log::Error("LolFx syntax error: %s\n", m.c_str());
  37. }
  38. } /* namespace lol */