2 // Copyright (C) 2006 Matthias Braun <matze@braunis.de>
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #ifndef HEADER_SUPERTUX_LISP_LEXER_HPP
18 #define HEADER_SUPERTUX_LISP_LEXER_HPP
39 Lexer(std::istream& stream);
42 TokenType getNextToken();
43 const char* getString() const
44 { return token_string; }
45 int getLineNumber() const
46 { return linenumber; }
50 MAX_TOKEN_LENGTH = 16384,
54 inline void nextChar();
55 inline void addChar();
61 char buffer[BUFFER_SIZE+1];
65 char token_string[MAX_TOKEN_LENGTH + 1];
70 Lexer & operator=(const Lexer&);
73 } // end of namespace lisp