2,018 changes: 2,018 additions & 0 deletions lib/framework/resource_lexer.cpp

Large diffs are not rendered by default.

1,686 changes: 1,686 additions & 0 deletions lib/framework/resource_parser.cpp

Large diffs are not rendered by default.

63 changes: 63 additions & 0 deletions lib/framework/resource_parser.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
This file is part of Warzone 2100.
Copyright (C) 2005-2013 Warzone 2100 Project
Warzone 2100 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Warzone 2100 is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Warzone 2100; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/


/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
TEXT_T = 258,
QTEXT_T = 259,
DIRECTORY = 260,
FILETOKEN = 261
};
#endif
/* Tokens. */
#define TEXT_T 258
#define QTEXT_T 259
#define DIRECTORY 260
#define FILETOKEN 261




#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
{

/* Line 2068 of yacc.c */
#line 52 "resource_parser.ypp"

char *sval;



/* Line 2068 of yacc.c */
#line 68 "resource_parser.h"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
#endif

extern YYSTYPE res_lval;


1,988 changes: 1,988 additions & 0 deletions lib/framework/strres_lexer.cpp

Large diffs are not rendered by default.

1,675 changes: 1,675 additions & 0 deletions lib/framework/strres_parser.cpp

Large diffs are not rendered by default.

59 changes: 59 additions & 0 deletions lib/framework/strres_parser.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
This file is part of Warzone 2100.
Copyright (C) 2005-2013 Warzone 2100 Project
Warzone 2100 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Warzone 2100 is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Warzone 2100; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/


/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
TEXT_T = 258,
QTEXT_T = 259
};
#endif
/* Tokens. */
#define TEXT_T 258
#define QTEXT_T 259




#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
{

/* Line 2068 of yacc.c */
#line 49 "strres_parser.ypp"

char *sval;



/* Line 2068 of yacc.c */
#line 64 "strres_parser.h"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
#endif

extern YYSTYPE strres_lval;


9 changes: 3 additions & 6 deletions lib/gamelib/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
AM_CPPFLAGS = -DYY_NO_INPUT $(SDL_CFLAGS) $(WZ_CPPFLAGS) $(QT4_CFLAGS)
AM_CFLAGS = $(WZ_CFLAGS)
AM_CXXFLAGS = $(WZ_CXXFLAGS) $(QT4_CFLAGS)
AM_LFLAGS = $(FLEX_FLAGS)
AM_YFLAGS = -d

BUILT_SOURCES = \
audp_parser.h

noinst_LIBRARIES = libgamelib.a
noinst_HEADERS = \
anim.h \
animobj.h \
audp_parser.h \
gtime.h \
hashtable.h \
parser.h

libgamelib_a_SOURCES = \
anim.cpp \
animobj.cpp \
audp_lexer.lpp \
audp_parser.ypp \
audp_lexer.cpp \
audp_parser.cpp \
gtime.cpp \
hashtable.cpp

2,099 changes: 2,099 additions & 0 deletions lib/gamelib/audp_lexer.cpp

Large diffs are not rendered by default.

1,852 changes: 1,852 additions & 0 deletions lib/gamelib/audp_parser.cpp

Large diffs are not rendered by default.

82 changes: 82 additions & 0 deletions lib/gamelib/audp_parser.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/*
This file is part of Warzone 2100.
Copyright (C) 2005-2013 Warzone 2100 Project
Warzone 2100 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Warzone 2100 is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Warzone 2100; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/


/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
FLOAT_T = 258,
INTEGER = 259,
QTEXT = 260,
ONESHOT = 261,
LOOP = 262,
AUDIO = 263,
ANIM3DFRAMES = 264,
ANIM3DTRANS = 265,
ANIM3DFILE = 266,
AUDIO_MODULE = 267,
ANIM_MODULE = 268,
ANIMOBJECT = 269
};
#endif
/* Tokens. */
#define FLOAT_T 258
#define INTEGER 259
#define QTEXT 260
#define ONESHOT 261
#define LOOP 262
#define AUDIO 263
#define ANIM3DFRAMES 264
#define ANIM3DTRANS 265
#define ANIM3DFILE 266
#define AUDIO_MODULE 267
#define ANIM_MODULE 268
#define ANIMOBJECT 269




#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
{

/* Line 2068 of yacc.c */
#line 44 "audp_parser.ypp"

float fval;
long ival;
bool bval;
char* sval;



/* Line 2068 of yacc.c */
#line 87 "audp_parser.h"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
#endif

extern YYSTYPE audp_lval;


18 changes: 3 additions & 15 deletions lib/gamelib/gamelib.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
<Import Project="..\..\devpkg\FlexBison.props" />
</ImportGroup>
<ImportGroup Label="ExtensionSettings" />
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
Expand Down Expand Up @@ -235,21 +233,11 @@
<ItemGroup>
<ClInclude Include="anim.h" />
<ClInclude Include="animobj.h" />
<ClInclude Include="audp_parser.hpp" />
<ClInclude Include="audp_parser.h" />
<ClInclude Include="gtime.h" />
<ClInclude Include="hashtable.h" />
<ClInclude Include="parser.h" />
</ItemGroup>
<ItemGroup>
<FlexGenerator Include="audp_lexer.lpp">
<FileType>Document</FileType>
</FlexGenerator>
<BisonParser Include="audp_parser.ypp">
<FileType>Document</FileType>
</BisonParser>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\..\devpkg\FlexBison.targets" />
</ImportGroup>
<ImportGroup Label="ExtensionTargets" />
</Project>
19 changes: 3 additions & 16 deletions lib/gamelib/gamelib.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="FlexBison">
<UniqueIdentifier>{d9ee26c1-75fa-4dc9-bd73-146c94d60e3e}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="anim.cpp">
Expand Down Expand Up @@ -40,9 +37,6 @@
<ClInclude Include="animobj.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="audp_parser.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="gtime.h">
<Filter>Header Files</Filter>
</ClInclude>
Expand All @@ -52,15 +46,8 @@
<ClInclude Include="parser.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<BisonParser Include="audp_parser.ypp">
<Filter>FlexBison</Filter>
</BisonParser>
</ItemGroup>
<ItemGroup>
<FlexGenerator Include="audp_lexer.lpp">
<Filter>FlexBison</Filter>
</FlexGenerator>
<ClInclude Include="audp_parser.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
15 changes: 6 additions & 9 deletions lib/script/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,33 +1,30 @@
AM_CPPFLAGS = -DYY_NO_INPUT $(WZ_CPPFLAGS) $(QT4_CFLAGS)
AM_CFLAGS = $(WZ_CFLAGS)
AM_CXXFLAGS = $(WZ_CXXFLAGS) $(QT4_CFLAGS)
AM_LFLAGS = $(FLEX_FLAGS)
AM_YFLAGS = -d

BUILT_SOURCES = \
chat_parser.h \
script_parser.h

noinst_LIBRARIES = libscript.a
noinst_HEADERS = \
chat_parser.h \
chat_processing.h \
codeprint.h \
event.h \
eventsave.h \
interpreter.h \
parse.h \
script.h \
script_parser.h \
stack.h

libscript_a_SOURCES = \
chat_lexer.lpp \
chat_parser.ypp \
chat_lexer.cpp \
chat_parser.cpp \
codeprint.cpp \
event.cpp \
eventsave.cpp \
interpreter.cpp \
script.cpp \
script_lexer.lpp \
script_parser.ypp \
script_lexer.cpp \
script_parser.cpp \
stack.cpp

2,535 changes: 2,535 additions & 0 deletions lib/script/chat_lexer.cpp

Large diffs are not rendered by default.

2,604 changes: 2,604 additions & 0 deletions lib/script/chat_parser.cpp

Large diffs are not rendered by default.

229 changes: 229 additions & 0 deletions lib/script/chat_parser.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@
/*
This file is part of Warzone 2100.
Copyright (C) 2005-2013 Warzone 2100 Project
Warzone 2100 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Warzone 2100 is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Warzone 2100; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
_T_EOF = 0,
BRACKET_OPEN = 258,
BRACKET_CLOSE = 259,
SQ_BRACKET_OPEN = 260,
SQ_BRACKET_CLOSE = 261,
PIPE = 262,
T_WORD = 263,
R_POSSESSION = 264,
_T_QM = 265,
_T_EM = 266,
_T_FULLSTOP = 267,
_T_COLON = 268,
_T_SEMICOLON = 269,
_T_COMMA = 270,
_T_A = 271,
_T_AFFIRMATIVE = 272,
_T_AFTER = 273,
_T_ALLY = 274,
_T_AM = 275,
_T_AN = 276,
_T_AND = 277,
_T_ANY = 278,
_T_ATTACK = 279,
_T_ATTACKING = 280,
_T_ARMY = 281,
_T_BEACON = 282,
_T_BUILDING = 283,
_T_CANT = 284,
_T_CENTER = 285,
_T_DEAD = 286,
_T_DERRICK = 287,
_T_DO = 288,
_T_DROP = 289,
_T_FINE = 290,
_T_FOR = 291,
_T_FORCE = 292,
_T_GET = 293,
_T_GETTING = 294,
_T_GO = 295,
_T_GOING = 296,
_T_GONNA = 297,
_T_GOT = 298,
_T_GREAT = 299,
_T_HAVE = 300,
_T_HAS = 301,
_T_HELP = 302,
_T_HOLD = 303,
_T_I = 304,
_T_IM = 305,
_T_IS = 306,
_T_LASSAT = 307,
_T_LETS = 308,
_T_ME = 309,
_T_MORE = 310,
_T_NEED = 311,
_T_NO = 312,
_T_NOW = 313,
_T_OFCOURSE = 314,
_T_OK = 315,
_T_ON = 316,
_T_PLACE = 317,
_T_POSSESSION = 318,
_T_POWER = 319,
_T_PUMPING = 320,
_T_PUT = 321,
_T_READY = 322,
_T_REQUIRE = 323,
_T_ROGER = 324,
_T_RUSH = 325,
_T_SEC = 326,
_T_SEE = 327,
_T_SOME = 328,
_T_STATUS = 329,
_T_STOP = 330,
_T_SURE = 331,
_T_THANK_YOU = 332,
_T_THANKS = 333,
_T_THE = 334,
_T_U = 335,
_T_UNITS = 336,
_T_VTOLS = 337,
_T_WAIT = 338,
_T_WHERE = 339,
_T_YES = 340,
_T_YOU = 341,
R_PLAYER = 342,
R_INTEGER = 343
};
#endif
/* Tokens. */
#define _T_EOF 0
#define BRACKET_OPEN 258
#define BRACKET_CLOSE 259
#define SQ_BRACKET_OPEN 260
#define SQ_BRACKET_CLOSE 261
#define PIPE 262
#define T_WORD 263
#define R_POSSESSION 264
#define _T_QM 265
#define _T_EM 266
#define _T_FULLSTOP 267
#define _T_COLON 268
#define _T_SEMICOLON 269
#define _T_COMMA 270
#define _T_A 271
#define _T_AFFIRMATIVE 272
#define _T_AFTER 273
#define _T_ALLY 274
#define _T_AM 275
#define _T_AN 276
#define _T_AND 277
#define _T_ANY 278
#define _T_ATTACK 279
#define _T_ATTACKING 280
#define _T_ARMY 281
#define _T_BEACON 282
#define _T_BUILDING 283
#define _T_CANT 284
#define _T_CENTER 285
#define _T_DEAD 286
#define _T_DERRICK 287
#define _T_DO 288
#define _T_DROP 289
#define _T_FINE 290
#define _T_FOR 291
#define _T_FORCE 292
#define _T_GET 293
#define _T_GETTING 294
#define _T_GO 295
#define _T_GOING 296
#define _T_GONNA 297
#define _T_GOT 298
#define _T_GREAT 299
#define _T_HAVE 300
#define _T_HAS 301
#define _T_HELP 302
#define _T_HOLD 303
#define _T_I 304
#define _T_IM 305
#define _T_IS 306
#define _T_LASSAT 307
#define _T_LETS 308
#define _T_ME 309
#define _T_MORE 310
#define _T_NEED 311
#define _T_NO 312
#define _T_NOW 313
#define _T_OFCOURSE 314
#define _T_OK 315
#define _T_ON 316
#define _T_PLACE 317
#define _T_POSSESSION 318
#define _T_POWER 319
#define _T_PUMPING 320
#define _T_PUT 321
#define _T_READY 322
#define _T_REQUIRE 323
#define _T_ROGER 324
#define _T_RUSH 325
#define _T_SEC 326
#define _T_SEE 327
#define _T_SOME 328
#define _T_STATUS 329
#define _T_STOP 330
#define _T_SURE 331
#define _T_THANK_YOU 332
#define _T_THANKS 333
#define _T_THE 334
#define _T_U 335
#define _T_UNITS 336
#define _T_VTOLS 337
#define _T_WAIT 338
#define _T_WHERE 339
#define _T_YES 340
#define _T_YOU 341
#define R_PLAYER 342
#define R_INTEGER 343




#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
{

/* Line 2068 of yacc.c */
#line 178 "chat_parser.ypp"

int32_t bval;
SDWORD ival;



/* Line 2068 of yacc.c */
#line 235 "chat_parser.h"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
#endif

extern YYSTYPE chat_lval;


26 changes: 4 additions & 22 deletions lib/script/script.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
<Import Project="..\..\devpkg\FlexBison.props" />
</ImportGroup>
<ImportGroup Label="ExtensionSettings" />
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
Expand Down Expand Up @@ -237,33 +235,17 @@
<ClCompile Include="stack.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="chat_parser.hpp" />
<ClInclude Include="chat_parser.h" />
<ClInclude Include="chat_processing.h" />
<ClInclude Include="codeprint.h" />
<ClInclude Include="event.h" />
<ClInclude Include="eventsave.h" />
<ClInclude Include="interpreter.h" />
<ClInclude Include="parse.h" />
<ClInclude Include="script.h" />
<ClInclude Include="script_parser.hpp" />
<ClInclude Include="script_parser.h" />
<ClInclude Include="stack.h" />
</ItemGroup>
<ItemGroup>
<FlexGenerator Include="chat_lexer.lpp">
<FileType>Document</FileType>
</FlexGenerator>
<BisonParser Include="chat_parser.ypp">
<FileType>Document</FileType>
</BisonParser>
<FlexGenerator Include="script_lexer.lpp">
<FileType>Document</FileType>
</FlexGenerator>
<BisonParser Include="script_parser.ypp">
<FileType>Document</FileType>
</BisonParser>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\..\devpkg\FlexBison.targets" />
</ImportGroup>
<ImportGroup Label="ExtensionTargets" />
</Project>
23 changes: 2 additions & 21 deletions lib/script/script.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="FlexBison">
<UniqueIdentifier>{30be94dd-96c4-473b-a323-e6bf6f278b9d}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="codeprint.cpp">
Expand Down Expand Up @@ -70,27 +67,11 @@
<ClInclude Include="stack.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="chat_parser.hpp">
<ClInclude Include="chat_parser.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="script_parser.hpp">
<ClInclude Include="script_parser.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<FlexGenerator Include="chat_lexer.lpp">
<Filter>FlexBison</Filter>
</FlexGenerator>
<FlexGenerator Include="script_lexer.lpp">
<Filter>FlexBison</Filter>
</FlexGenerator>
</ItemGroup>
<ItemGroup>
<BisonParser Include="chat_parser.ypp">
<Filter>FlexBison</Filter>
</BisonParser>
<BisonParser Include="script_parser.ypp">
<Filter>FlexBison</Filter>
</BisonParser>
</ItemGroup>
</Project>
3,053 changes: 3,053 additions & 0 deletions lib/script/script_lexer.cpp

Large diffs are not rendered by default.

9,583 changes: 9,583 additions & 0 deletions lib/script/script_parser.cpp

Large diffs are not rendered by default.

227 changes: 227 additions & 0 deletions lib/script/script_parser.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
/*
This file is part of Warzone 2100.
Copyright (C) 2005-2013 Warzone 2100 Project
Warzone 2100 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Warzone 2100 is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Warzone 2100; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/


/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
lexFUNCTION = 258,
TRIGGER = 259,
EVENT = 260,
WAIT = 261,
EVERY = 262,
INACTIVE = 263,
INITIALISE = 264,
LINK = 265,
REF = 266,
RET = 267,
_VOID = 268,
WHILE = 269,
IF = 270,
ELSE = 271,
EXIT = 272,
PAUSE = 273,
BOOLEQUAL = 274,
NOTEQUAL = 275,
GREATEQUAL = 276,
LESSEQUAL = 277,
GREATER = 278,
LESS = 279,
_AND = 280,
_OR = 281,
_NOT = 282,
_INC = 283,
_DEC = 284,
TO_INT_CAST = 285,
TO_FLOAT_CAST = 286,
UMINUS = 287,
BOOLEAN_T = 288,
FLOAT_T = 289,
INTEGER = 290,
QTEXT = 291,
TYPE = 292,
STORAGE = 293,
IDENT = 294,
VAR = 295,
BOOL_VAR = 296,
NUM_VAR = 297,
FLOAT_VAR = 298,
OBJ_VAR = 299,
STRING_VAR = 300,
VAR_ARRAY = 301,
BOOL_ARRAY = 302,
NUM_ARRAY = 303,
FLOAT_ARRAY = 304,
OBJ_ARRAY = 305,
BOOL_OBJVAR = 306,
NUM_OBJVAR = 307,
USER_OBJVAR = 308,
OBJ_OBJVAR = 309,
BOOL_CONSTANT = 310,
NUM_CONSTANT = 311,
USER_CONSTANT = 312,
OBJ_CONSTANT = 313,
STRING_CONSTANT = 314,
FUNC = 315,
BOOL_FUNC = 316,
NUM_FUNC = 317,
FLOAT_FUNC = 318,
USER_FUNC = 319,
OBJ_FUNC = 320,
STRING_FUNC = 321,
VOID_FUNC_CUST = 322,
BOOL_FUNC_CUST = 323,
NUM_FUNC_CUST = 324,
FLOAT_FUNC_CUST = 325,
USER_FUNC_CUST = 326,
OBJ_FUNC_CUST = 327,
STRING_FUNC_CUST = 328,
TRIG_SYM = 329,
EVENT_SYM = 330,
CALLBACK_SYM = 331
};
#endif
/* Tokens. */
#define lexFUNCTION 258
#define TRIGGER 259
#define EVENT 260
#define WAIT 261
#define EVERY 262
#define INACTIVE 263
#define INITIALISE 264
#define LINK 265
#define REF 266
#define RET 267
#define _VOID 268
#define WHILE 269
#define IF 270
#define ELSE 271
#define EXIT 272
#define PAUSE 273
#define BOOLEQUAL 274
#define NOTEQUAL 275
#define GREATEQUAL 276
#define LESSEQUAL 277
#define GREATER 278
#define LESS 279
#define _AND 280
#define _OR 281
#define _NOT 282
#define _INC 283
#define _DEC 284
#define TO_INT_CAST 285
#define TO_FLOAT_CAST 286
#define UMINUS 287
#define BOOLEAN_T 288
#define FLOAT_T 289
#define INTEGER 290
#define QTEXT 291
#define TYPE 292
#define STORAGE 293
#define IDENT 294
#define VAR 295
#define BOOL_VAR 296
#define NUM_VAR 297
#define FLOAT_VAR 298
#define OBJ_VAR 299
#define STRING_VAR 300
#define VAR_ARRAY 301
#define BOOL_ARRAY 302
#define NUM_ARRAY 303
#define FLOAT_ARRAY 304
#define OBJ_ARRAY 305
#define BOOL_OBJVAR 306
#define NUM_OBJVAR 307
#define USER_OBJVAR 308
#define OBJ_OBJVAR 309
#define BOOL_CONSTANT 310
#define NUM_CONSTANT 311
#define USER_CONSTANT 312
#define OBJ_CONSTANT 313
#define STRING_CONSTANT 314
#define FUNC 315
#define BOOL_FUNC 316
#define NUM_FUNC 317
#define FLOAT_FUNC 318
#define USER_FUNC 319
#define OBJ_FUNC 320
#define STRING_FUNC 321
#define VOID_FUNC_CUST 322
#define BOOL_FUNC_CUST 323
#define NUM_FUNC_CUST 324
#define FLOAT_FUNC_CUST 325
#define USER_FUNC_CUST 326
#define OBJ_FUNC_CUST 327
#define STRING_FUNC_CUST 328
#define TRIG_SYM 329
#define EVENT_SYM 330
#define CALLBACK_SYM 331




#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
{

/* Line 2068 of yacc.c */
#line 1559 "script_parser.ypp"

/* Types returned by the lexer */
int32_t bval;
float fval;
SDWORD ival;
char *sval;
INTERP_TYPE tval;
STORAGE_TYPE stype;
VAR_SYMBOL *vSymbol;
CONST_SYMBOL *cSymbol;
FUNC_SYMBOL *fSymbol;
TRIGGER_SYMBOL *tSymbol;
EVENT_SYMBOL *eSymbol;
CALLBACK_SYMBOL *cbSymbol;

/* Types only returned by rules */
CODE_BLOCK *cblock;
COND_BLOCK *condBlock;
OBJVAR_BLOCK *objVarBlock;
ARRAY_BLOCK *arrayBlock;
PARAM_BLOCK *pblock;
PARAM_DECL *pdecl;
TRIGGER_DECL *tdecl;
UDWORD integer_val;
VAR_DECL *vdecl;
VAR_IDENT_DECL *videcl;



/* Line 2068 of yacc.c */
#line 232 "script_parser.h"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
#endif

extern YYSTYPE scr_lval;


12 changes: 5 additions & 7 deletions src/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
AM_CPPFLAGS = -DYY_NO_INPUT $(SDL_CFLAGS) $(PHYSFS_CFLAGS) $(PNG_CFLAGS) $(VORBISFILE_CFLAGS) $(VORBIS_CFLAGS) $(OPENAL_CFLAGS) $(OPENGLC_CFLAGS) $(OPENGL_CFLAGS) $(WZ_CPPFLAGS) $(GLEW_CFLAGS)
AM_CFLAGS = $(WZ_CFLAGS)
AM_CXXFLAGS = $(WZ_CXXFLAGS) $(QT4_CFLAGS)
AM_LFLAGS = $(FLEX_FLAGS)
AM_YFLAGS = -d

.PHONY: autorevision.h

Expand All @@ -16,8 +14,7 @@ CLEANFILES = \
autorevision.h.new

BUILT_SOURCES = \
autorevision.h \
scriptvals_parser.h
autorevision.h

EXTRA_DIST = \
autorevision.cache \
Expand Down Expand Up @@ -133,6 +130,7 @@ noinst_HEADERS = \
scriptobj.h \
scripttabs.h \
scriptvals.h \
scriptvals_parser.h \
selection.h \
seqdisp.h \
statsdef.h \
Expand Down Expand Up @@ -200,7 +198,7 @@ warzone2100_SOURCES = \
keybind.cpp \
keyedit.cpp \
keymap.cpp \
level_lexer.lpp \
level_lexer.cpp \
levels.cpp \
lighting.cpp \
loadsave.cpp \
Expand Down Expand Up @@ -246,8 +244,8 @@ warzone2100_SOURCES = \
scriptobj.cpp \
scripttabs.cpp \
scriptvals.cpp \
scriptvals_lexer.lpp \
scriptvals_parser.ypp \
scriptvals_lexer.cpp \
scriptvals_parser.cpp \
selection.cpp \
seqdisp.cpp \
stats.cpp \
Expand Down
79 changes: 41 additions & 38 deletions src/Warzone2100.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@
<BisonParserAfterTargets>CustomBuild</BisonParserAfterTargets>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
<Import Project="..\devpkg\FlexBison.props" />
</ImportGroup>
<ImportGroup Label="ExtensionSettings" />
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
Expand All @@ -90,9 +88,9 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug_SDL_STLport_x32|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug_QT_STLport_x32|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\data</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug_SDL_STLport_x32|Win32'">..\data</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug_QT_STLport_x32|Win32'">..\data</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug_SDL_STLport_x32|Win32'">$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug_QT_STLport_x32|Win32'">$(Configuration)\</IntDir>
Expand All @@ -103,9 +101,9 @@
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug_SDL_STLport_x32|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug_QT_STLport_x32|Win32'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release_SDL_STLport_x32|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release_QT_STLport_x32|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\data</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release_SDL_STLport_x32|Win32'">..\data</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release_QT_STLport_x32|Win32'">..\data</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release_SDL_STLport_x32|Win32'">$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release_QT_STLport_x32|Win32'">$(Configuration)\</IntDir>
Expand Down Expand Up @@ -133,12 +131,18 @@
<LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\devpkg\libsx86;$(Qtdir)\lib;$(LibraryPath)</LibraryPath>
<LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release_SDL_STLport_x32|Win32'">..\devpkg\libsx86;$(Qtdir)\lib;$(LibraryPath)</LibraryPath>
<LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release_QT_STLport_x32|Win32'">..\devpkg\libsx86;$(Qtdir)\lib;$(LibraryPath)</LibraryPath>
<ExtensionsToDeleteOnClean Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">*.lex.cpp;*.tab.cpp;*.tab.hpp;$(ExtensionsToDeleteOnClean)</ExtensionsToDeleteOnClean>
<ExtensionsToDeleteOnClean Condition="'$(Configuration)|$(Platform)'=='Debug_SDL_STLport_x32|Win32'">*.lex.cpp;*.tab.cpp;*.tab.hpp;$(ExtensionsToDeleteOnClean)</ExtensionsToDeleteOnClean>
<ExtensionsToDeleteOnClean Condition="'$(Configuration)|$(Platform)'=='Debug_QT_STLport_x32|Win32'">*.lex.cpp;*.tab.cpp;*.tab.hpp;$(ExtensionsToDeleteOnClean)</ExtensionsToDeleteOnClean>
<ExtensionsToDeleteOnClean Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ExtensionsToDeleteOnClean)</ExtensionsToDeleteOnClean>
<ExtensionsToDeleteOnClean Condition="'$(Configuration)|$(Platform)'=='Debug_SDL_STLport_x32|Win32'">$(ExtensionsToDeleteOnClean)</ExtensionsToDeleteOnClean>
<ExtensionsToDeleteOnClean Condition="'$(Configuration)|$(Platform)'=='Debug_QT_STLport_x32|Win32'">$(ExtensionsToDeleteOnClean)</ExtensionsToDeleteOnClean>
<BisonParserBeforeTargets Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Midl</BisonParserBeforeTargets>
<BisonParserBeforeTargets Condition="'$(Configuration)|$(Platform)'=='Release_SDL_STLport_x32|Win32'">Midl</BisonParserBeforeTargets>
<BisonParserBeforeTargets Condition="'$(Configuration)|$(Platform)'=='Release_QT_STLport_x32|Win32'">Midl</BisonParserBeforeTargets>
<PostBuildEventUseInBuild Condition="'$(Configuration)|$(Platform)'=='Debug_QT_STLport_x32|Win32'">false</PostBuildEventUseInBuild>
<PostBuildEventUseInBuild Condition="'$(Configuration)|$(Platform)'=='Debug_SDL_STLport_x32|Win32'">false</PostBuildEventUseInBuild>
<PostBuildEventUseInBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</PostBuildEventUseInBuild>
<PostBuildEventUseInBuild Condition="'$(Configuration)|$(Platform)'=='Release_QT_STLport_x32|Win32'">false</PostBuildEventUseInBuild>
<PostBuildEventUseInBuild Condition="'$(Configuration)|$(Platform)'=='Release_SDL_STLport_x32|Win32'">false</PostBuildEventUseInBuild>
<PostBuildEventUseInBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</PostBuildEventUseInBuild>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<PreBuildEvent>
Expand Down Expand Up @@ -184,8 +188,10 @@
<ShowProgress>NotSet</ShowProgress>
</Link>
<PostBuildEvent>
<Message>*** Copying $(TargetPath) to $(SolutionDir)..\data\$(TargetFileName) ***</Message>
<Command>copy /Y /B $(TargetPath) $(ProjectDir)..\data\</Command>
<Message>
</Message>
<Command>
</Command>
</PostBuildEvent>
<ProjectReference>
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
Expand Down Expand Up @@ -235,8 +241,10 @@
<ShowProgress>NotSet</ShowProgress>
</Link>
<PostBuildEvent>
<Message>*** Copying $(TargetPath) to $(SolutionDir)..\data\$(TargetFileName) ***</Message>
<Command>copy /Y /B $(TargetPath) $(ProjectDir)..\data\</Command>
<Message>
</Message>
<Command>
</Command>
</PostBuildEvent>
<ProjectReference>
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
Expand Down Expand Up @@ -286,8 +294,10 @@
<ShowProgress>NotSet</ShowProgress>
</Link>
<PostBuildEvent>
<Message>*** Copying $(TargetPath) to $(SolutionDir)..\data\$(TargetFileName) ***</Message>
<Command>copy /Y /B $(TargetPath) $(ProjectDir)..\data\</Command>
<Message>
</Message>
<Command>
</Command>
</PostBuildEvent>
<ProjectReference>
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
Expand Down Expand Up @@ -327,8 +337,10 @@
<TargetMachine>MachineX86</TargetMachine>
</Link>
<PostBuildEvent>
<Message>*** Copying $(TargetPath) to $(SolutionDir)..\data\$(TargetFileName) ***</Message>
<Command>copy /Y /B $(TargetPath) $(ProjectDir)..\data\</Command>
<Message>
</Message>
<Command>
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_SDL_STLport_x32|Win32'">
Expand Down Expand Up @@ -364,8 +376,10 @@
<TargetMachine>MachineX86</TargetMachine>
</Link>
<PostBuildEvent>
<Message>*** Copying $(TargetPath) to $(SolutionDir)..\data\$(TargetFileName) ***</Message>
<Command>copy /Y /B $(TargetPath) $(ProjectDir)..\data\</Command>
<Message>
</Message>
<Command>
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_QT_STLport_x32|Win32'">
Expand Down Expand Up @@ -401,8 +415,10 @@
<TargetMachine>MachineX86</TargetMachine>
</Link>
<PostBuildEvent>
<Message>*** Copying $(TargetPath) to $(SolutionDir)..\data\$(TargetFileName) ***</Message>
<Command>copy /Y /B $(TargetPath) $(ProjectDir)..\data\</Command>
<Message>
</Message>
<Command>
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down Expand Up @@ -689,19 +705,6 @@
<ItemGroup>
<ResourceCompile Include="..\win32\warzone2100.rc" />
</ItemGroup>
<ItemGroup>
<FlexGenerator Include="level_lexer.lpp">
<FileType>Document</FileType>
</FlexGenerator>
<FlexGenerator Include="scriptvals_lexer.lpp">
<FileType>Document</FileType>
</FlexGenerator>
<BisonParser Include="scriptvals_parser.ypp">
<FileType>Document</FileType>
</BisonParser>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\devpkg\FlexBison.targets" />
</ImportGroup>
<ImportGroup Label="ExtensionTargets" />
</Project>
16 changes: 0 additions & 16 deletions src/Warzone2100.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
</Filter>
<Filter Include="FlexBison">
<UniqueIdentifier>{4af8247e-eb4a-428b-9177-04f2c30a3675}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="action.cpp">
Expand Down Expand Up @@ -728,17 +725,4 @@
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<FlexGenerator Include="level_lexer.lpp">
<Filter>FlexBison</Filter>
</FlexGenerator>
<FlexGenerator Include="scriptvals_lexer.lpp">
<Filter>FlexBison</Filter>
</FlexGenerator>
</ItemGroup>
<ItemGroup>
<BisonParser Include="scriptvals_parser.ypp">
<Filter>FlexBison</Filter>
</BisonParser>
</ItemGroup>
</Project>
2,138 changes: 2,138 additions & 0 deletions src/level_lexer.cpp

Large diffs are not rendered by default.

2,124 changes: 2,124 additions & 0 deletions src/scriptvals_lexer.cpp

Large diffs are not rendered by default.

2,497 changes: 2,497 additions & 0 deletions src/scriptvals_parser.cpp

Large diffs are not rendered by default.

81 changes: 81 additions & 0 deletions src/scriptvals_parser.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*
This file is part of Warzone 2100.
Copyright (C) 2005-2013 Warzone 2100 Project
Warzone 2100 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Warzone 2100 is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Warzone 2100; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/


/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
BOOLEAN_T = 258,
INTEGER = 259,
IDENT = 260,
QTEXT = 261,
TYPE = 262,
VAR = 263,
ARRAY = 264,
SCRIPT = 265,
STORE = 266,
RUN = 267
};
#endif
/* Tokens. */
#define BOOLEAN_T 258
#define INTEGER 259
#define IDENT 260
#define QTEXT 261
#define TYPE 262
#define VAR 263
#define ARRAY 264
#define SCRIPT 265
#define STORE 266
#define RUN 267




#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
{

/* Line 2068 of yacc.c */
#line 120 "scriptvals_parser.ypp"

bool bval;
INTERP_TYPE tval;
char *sval;
UDWORD vindex;
SDWORD ival;
VAR_INIT sInit;
ARRAY_INDEXES *arrayIndex;



/* Line 2068 of yacc.c */
#line 86 "scriptvals_parser.h"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
#endif

extern YYSTYPE scrv_lval;


23 changes: 0 additions & 23 deletions win32/MSVCdelparser.bat

This file was deleted.