source: trunk/src/easymesh/easymesh-compiler.cpp @ 2183

Last change on this file since 2183 was 2183, checked in by sam, 7 years ago

build: fix the WTFPL site URL in all code comments.

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://www.wtfpl.net/ 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
22namespace lol
23{
24
25EasyMeshCompiler::EasyMeshCompiler(EasyMesh &mesh)
26    : m_mesh(mesh)
27{
28}
29
30bool 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
40void EasyMeshCompiler::Error(const class location& l, const std::string& m)
41{
42    Log::Error("EasyMesh syntax error line %d column %d: %s\n",
43               l.begin.line, l.begin.column, m.c_str());
44}
45
46void EasyMeshCompiler::Error(const std::string& m)
47{
48    Log::Error("EasyMesh syntax error: %s\n", m.c_str());
49}
50
51} /* namespace lol */
52
Note: See TracBrowser for help on using the repository browser.