2 Copyright (C) 2005 Holger Hans Peter Freyther
4 Permission is hereby granted, free of charge, to any person obtaining a copy
5 of this software and associated documentation files (the "Software"), to deal
6 in the Software without restriction, including without limitation the rights
7 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 copies of the Software, and to permit persons to whom the Software is
9 furnished to do so, subject to the following conditions:
11 The above copyright notice and this permission notice shall be included in all
12 copies or substantial portions of the Software.
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
17 SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
20 THE USE OR OTHER DEALINGS IN THE SOFTWARE.
34 * Special Value for End Of File Handling. We set it to
35 * 1001 so we can have up to 1000 Terminal Symbols on
36 * grammar. Currenlty we have around 20
41 const char* string()const PURE_METHOD;
43 static char* concatString(const char* l, const char* r);
44 void assignString(char* str);
45 void copyString(const char* str);
54 inline const char* token_t::string()const
60 * append str to the current string
62 inline char* token_t::concatString(const char* l, const char* r)
64 size_t cb = (l ? strlen (l) : 0) + strlen (r) + 1;
65 char *r_sz = new char[cb];
75 inline void token_t::assignString(char* str)
78 m_stringLen = str ? strlen(str) : 0;
81 inline void token_t::copyString(const char* str)
84 m_stringLen = strlen(str);
85 m_string = new char[m_stringLen+1];
86 strcpy(m_string, str);
90 inline void token_t::release_this()