]> icculus.org git repositories - divverent/netradiant.git/blob - tools/quake2/qdata_heretic2/common/token.h
initial
[divverent/netradiant.git] / tools / quake2 / qdata_heretic2 / common / token.h
1 /*
2 Copyright (C) 1999-2006 Id Software, Inc. and contributors.
3 For a list of contributors, see the accompanying CONTRIBUTORS file.
4
5 This file is part of GtkRadiant.
6
7 GtkRadiant is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 GtkRadiant is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GtkRadiant; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20 */
21
22
23 //**************************************************************************
24 //**
25 //** token.h
26 //**
27 //**************************************************************************
28
29 #ifndef __TOKEN_H__
30 #define __TOKEN_H__
31
32 #include "cmdlib.h"
33
34 #ifndef TRUE
35 #define TRUE 1
36 #endif
37 #ifndef FALSE
38 #define FALSE 0
39 #endif
40 #ifndef YES
41 #define YES 1
42 #endif
43 #ifndef NO
44 #define NO 0
45 #endif
46 #define ASCII_SPACE 32
47 #define ASCII_QUOTE 34
48 #define ASCII_UNDERSCORE 95
49 #define EOF_CHARACTER 127
50 #define MAX_IDENTIFIER_LENGTH 64
51 #define MAX_QUOTED_LENGTH 1024
52 #define MAX_FILE_NAME_LENGTH 1024
53
54 typedef enum
55 {
56         TK_NONE,
57         TK_UNKNOWNCHAR,
58         TK_EOF,
59         TK_IDENTIFIER,                  // VALUE: (char *) tk_String
60         TK_STRING,                              // VALUE: (char *) tk_String
61         TK_INTNUMBER,                   // VALUE: (int) tk_IntNumber
62         TK_FLOATNUMBER,                 // VALUE: (float) tk_FloatNumber
63         TK_LPAREN,
64         TK_RPAREN,
65         TK_LBRACE,
66         TK_RBRACE,                              // 10
67         TK_LBRACKET,                    
68         TK_RBRACKET,
69         TK_COLON,
70         TK_MESH,
71         TK_MODEL,                               // 15
72         TK_NODES,
73         TK_ROTATION,
74         TK_SCALING,
75         TK_TRANSLATION,
76         TK_POLYGONS,                    // 20
77         TK_POSITION,
78         TK_VERTEX,
79         TK_VERTICES,
80         TK_EDGES,
81         TK_HRCH,                                // 25
82         TK_SOFTIMAGE,
83         TK_MATERIAL,
84         TK_SPLINE,                              // 28
85
86         TK_C_NAMED,
87         TK_OBJECT,                              // 30
88         TK_C_TRI,                               
89         TK_C_VERTICES,
90         TK_C_FACES,
91         TK_C_VERTEX,
92         TK_LIST,                                // 35
93         TK_C_FACE,                              
94
95         TK_C_HEXEN,
96         TK_C_TRIANGLES,
97         TK_C_VERSION,
98         TK_FACES,                               // 40
99         TK_FACE,                                
100         TK_ORIGIN,
101
102         TK_CLUSTERS,
103         TK_NUM_CLUSTER_VERTICES,
104         TK_NAME,                                // 45
105         TK_CLUSTER_NAME,                
106         TK_CLUSTER_STATE,
107
108         TK_ACTOR_DATA,
109         TK_UVTEXTURE,
110 } tokenType_t;
111
112 void TK_Init(void);
113 void TK_OpenSource(char *fileName);
114 void TK_CloseSource(void);
115 tokenType_t TK_Fetch(void);
116 void TK_Require(tokenType_t tokType);
117 void TK_FetchRequire(tokenType_t tokType);
118 tokenType_t TK_RequireFetch(tokenType_t tokType);
119 tokenType_t TK_FetchRequireFetch(tokenType_t tokType);
120 tokenType_t TK_Beyond(tokenType_t tokType);
121 void TK_BeyondRequire(tokenType_t bTok, tokenType_t rTok);
122 tokenType_t TK_Search(tokenType_t tokType);
123 tokenType_t TK_Get(tokenType_t tokType);
124
125 extern tokenType_t tk_Token;
126 extern int tk_Line;
127 extern int tk_IntNumber;
128 extern float tk_FloatNumber;
129 extern char *tk_String;
130 extern char tk_SourceName[MAX_FILE_NAME_LENGTH];
131
132 #endif