Last change
on this file since 1621 was
1510,
checked in by sam, 9 years ago
|
easymesh: move the Mesh builder into the engine core.
|
File size:
1.2 KB
|
Line | |
---|
1 | // |
---|
2 | // Lol Engine |
---|
3 | // |
---|
4 | // Copyright: (c) 2010-2012 Sam Hocevar <sam@hocevar.net> |
---|
5 | // (c) 2009-2012 Cédric Lecacheur <jordx@free.fr> |
---|
6 | // (c) 2009-2012 Benjamin Huet <huet.benjamin@gmail.com> |
---|
7 | // This program is free software; you can redistribute it and/or |
---|
8 | // modify it under the terms of the Do What The Fuck You Want To |
---|
9 | // Public License, Version 2, as published by Sam Hocevar. See |
---|
10 | // http://sam.zoy.org/projects/COPYING.WTFPL for more details. |
---|
11 | // |
---|
12 | |
---|
13 | #if defined HAVE_CONFIG_H |
---|
14 | # include "config.h" |
---|
15 | #endif |
---|
16 | |
---|
17 | #include <string> |
---|
18 | |
---|
19 | #include "core.h" |
---|
20 | #include "easymesh/easymesh-compiler.h" |
---|
21 | |
---|
22 | namespace lol |
---|
23 | { |
---|
24 | |
---|
25 | EasyMeshCompiler::EasyMeshCompiler(EasyMesh &mesh) |
---|
26 | : m_mesh(mesh) |
---|
27 | { |
---|
28 | } |
---|
29 | |
---|
30 | bool EasyMeshCompiler::ParseString(char const *command) |
---|
31 | { |
---|
32 | EasyMeshScanner scanner(command); |
---|
33 | m_lexer = &scanner; |
---|
34 | EasyMeshParser parser(*this); |
---|
35 | if (parser.parse() != 0) |
---|
36 | return false; |
---|
37 | return true; |
---|
38 | } |
---|
39 | |
---|
40 | void EasyMeshCompiler::Error(const class location& l, const std::string& m) |
---|
41 | { |
---|
42 | Log::Error("Syntax error line %d column %d: %s", |
---|
43 | l.begin.line, l.begin.column, m.c_str()); |
---|
44 | } |
---|
45 | |
---|
46 | void EasyMeshCompiler::Error(const std::string& m) |
---|
47 | { |
---|
48 | Log::Error("Syntax error: %s", m.c_str()); |
---|
49 | } |
---|
50 | |
---|
51 | } /* namespace lol */ |
---|
52 | |
---|
Note: See
TracBrowser
for help on using the repository browser.