Rename *.lex.c to *.lex.cpp and *.tab.c to *.tab.cpp.

master
Cyp 2010-12-06 12:59:40 +01:00
parent 0646b37603
commit 12e8e5bc80
18 changed files with 97 additions and 110 deletions

View File

@ -1,9 +1,8 @@
%.tab.h %.tab.c:: %.y
%.tab.hpp %.tab.cpp:: %.y
$(YACC) $(YFLAGS) $(AM_YFLAGS) -o$@ $<
%.lex.c:: %.l
%.lex.cpp:: %.l
$(LEX) $(LFLAGS) $(AM_LFLAGS) -o$@ $<
# sed -i 's/\(fwrite(.*)\)/abs(\1)/' $@
AM_CPPFLAGS = -DYY_NO_INPUT $(SDL_CFLAGS) $(WZ_CPPFLAGS)
AM_CFLAGS = $(WZ_CFLAGS)
@ -11,20 +10,20 @@ AM_CXXFLAGS = $(WZ_CXXFLAGS)
AM_LFLAGS = $(FLEX_FLAGS)
AM_YFLAGS = -d
BUILT_SOURCES = \
resource_lexer.lex.c \
resource_parser.tab.c \
resource_parser.tab.h \
strres_lexer.lex.c \
strres_parser.tab.c \
strres_parser.tab.h
resource_lexer.lex.cpp \
resource_parser.tab.cpp \
resource_parser.tab.hpp \
strres_lexer.lex.cpp \
strres_parser.tab.cpp \
strres_parser.tab.hpp
CLEANFILES = \
resource_lexer.lex.c \
resource_parser.tab.c \
resource_parser.tab.h \
strres_lexer.lex.c \
strres_parser.tab.c \
strres_parser.tab.h
resource_lexer.lex.cpp \
resource_parser.tab.cpp \
resource_parser.tab.hpp \
strres_lexer.lex.cpp \
strres_parser.tab.cpp \
strres_parser.tab.hpp
EXTRA_DIST = \
resource_lexer.l resource_parser.y \
@ -32,8 +31,8 @@ EXTRA_DIST = \
noinst_LIBRARIES = libframework.a
noinst_HEADERS = \
strres_parser.tab.h \
resource_parser.tab.h \
strres_parser.tab.hpp \
resource_parser.tab.hpp \
configfile.h \
crc.h \
cursors.h \
@ -70,10 +69,10 @@ noinst_HEADERS = \
wzglobal.h
libframework_a_SOURCES = \
resource_lexer.lex.c \
resource_parser.tab.c \
strres_lexer.lex.c \
strres_parser.tab.c \
resource_lexer.lex.cpp \
resource_parser.tab.cpp \
strres_lexer.lex.cpp \
strres_parser.tab.cpp \
configfile.cpp \
crc.cpp \
cursors16.cpp \

View File

@ -211,7 +211,7 @@
>
</File>
<File
RelativePath=".\resource_lexer.lex.c"
RelativePath=".\resource_lexer.lex.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@ -249,7 +249,7 @@
>
</File>
<File
RelativePath=".\strres_lexer.lex.c"
RelativePath=".\strres_lexer.lex.cpp"
>
</File>
<File

View File

@ -28,7 +28,7 @@
#include "lib/framework/resly.h"
/* Get the Yacc definitions */
#include "resource_parser.tab.h"
#include "resource_parser.tab.hpp"
extern void res_error(const char* msg);

View File

@ -34,7 +34,7 @@
#include <physfs.h>
/* Get the Yacc definitions */
#include "strres_parser.tab.h"
#include "strres_parser.tab.hpp"
#include "lib/framework/lexer_input.h"

View File

@ -1,9 +1,8 @@
%.tab.h %.tab.c:: %.y
%.tab.hpp %.tab.cpp:: %.y
$(YACC) $(YFLAGS) $(AM_YFLAGS) -o$@ $<
%.lex.c:: %.l
%.lex.cpp:: %.l
$(LEX) $(LFLAGS) $(AM_LFLAGS) -o$@ $<
# sed -i 's/\(fwrite(.*)\)/abs(\1)/' $@
AM_CPPFLAGS = -DYY_NO_INPUT $(SDL_CFLAGS) $(WZ_CPPFLAGS)
AM_CFLAGS = $(WZ_CFLAGS)
@ -12,21 +11,21 @@ AM_LFLAGS = $(FLEX_FLAGS)
AM_YFLAGS = -d
BUILT_SOURCES = \
audp_lexer.lex.c \
audp_parser.tab.c \
audp_parser.tab.h
audp_lexer.lex.cpp \
audp_parser.tab.cpp \
audp_parser.tab.hpp
CLEANFILES = \
audp_lexer.lex.c \
audp_parser.tab.c \
audp_parser.tab.h
audp_lexer.lex.cpp \
audp_parser.tab.cpp \
audp_parser.tab.hpp
EXTRA_DIST = \
audp_lexer.l audp_parser.y
noinst_LIBRARIES = libgamelib.a
noinst_HEADERS = \
audp_parser.tab.h \
audp_parser.tab.hpp \
anim.h \
animobj.h \
gtime.h \
@ -36,8 +35,8 @@ noinst_HEADERS = \
libgamelib_a_SOURCES = \
anim.cpp \
animobj.cpp \
audp_lexer.lex.c \
audp_parser.tab.c \
audp_lexer.lex.cpp \
audp_parser.tab.cpp \
gtime.cpp \
hashtable.cpp

View File

@ -27,7 +27,7 @@
#include "lib/gamelib/parser.h"
/* Get the Yacc definitions */
#include "audp_parser.tab.h"
#include "audp_parser.tab.hpp"
// fwrite declared with warn_unused_result, resulting in mysterious errors in "%%" on some distros.
static inline bool no_warn_unused_result(int ignore) { if (ignore) {} return true; }

View File

@ -175,7 +175,7 @@
>
</File>
<File
RelativePath=".\audp_lexer.lex.c"
RelativePath=".\audp_lexer.lex.cpp"
>
</File>
<File

View File

@ -1,9 +1,8 @@
%.tab.h %.tab.c:: %.y
%.tab.hpp %.tab.cpp:: %.y
$(YACC) $(YFLAGS) $(AM_YFLAGS) -o$@ $<
%.lex.c:: %.l
%.lex.cpp:: %.l
$(LEX) $(LFLAGS) $(AM_LFLAGS) -o$@ $<
# sed -i 's/\(fwrite(.*)\)/abs(\1)/' $@
AM_CPPFLAGS = -DYY_NO_INPUT $(SDL_CFLAGS) $(WZ_CPPFLAGS)
AM_CFLAGS = $(WZ_CFLAGS)
@ -12,20 +11,20 @@ AM_LFLAGS = $(FLEX_FLAGS)
AM_YFLAGS = -d
BUILT_SOURCES = \
chat_lexer.lex.c \
chat_parser.tab.c \
chat_parser.tab.h \
script_lexer.lex.c \
script_parser.tab.c \
script_parser.tab.h
chat_lexer.lex.cpp \
chat_parser.tab.cpp \
chat_parser.tab.hpp \
script_lexer.lex.cpp \
script_parser.tab.cpp \
script_parser.tab.hpp
CLEANFILES = \
chat_lexer.lex.c \
chat_parser.tab.c \
chat_parser.tab.h \
script_lexer.lex.c \
script_parser.tab.c \
script_parser.tab.h
chat_lexer.lex.cpp \
chat_parser.tab.cpp \
chat_parser.tab.hpp \
script_lexer.lex.cpp \
script_parser.tab.cpp \
script_parser.tab.hpp
EXTRA_DIST = \
chat_lexer.l chat_parser.y \
@ -33,8 +32,8 @@ EXTRA_DIST = \
noinst_LIBRARIES = libscript.a
noinst_HEADERS = \
chat_parser.tab.h \
script_parser.tab.h \
chat_parser.tab.hpp \
script_parser.tab.hpp \
chat_processing.h \
codeprint.h \
event.h \
@ -45,15 +44,15 @@ noinst_HEADERS = \
stack.h
libscript_a_SOURCES = \
chat_lexer.lex.c \
chat_parser.tab.c \
chat_lexer.lex.cpp \
chat_parser.tab.cpp \
codeprint.cpp \
event.cpp \
eventsave.cpp \
interpreter.cpp \
script.cpp \
script_lexer.lex.c \
script_parser.tab.c \
script_lexer.lex.cpp \
script_parser.tab.cpp \
stack.cpp
libscript_a_LIBADD = $(top_builddir)/lib/framework/libframework.a

View File

@ -32,7 +32,7 @@
#include "lib/script/chat_processing.h"
/* Get the Yacc definitions */
#include "chat_parser.tab.h"
#include "chat_parser.tab.hpp"
// fwrite declared with warn_unused_result, resulting in mysterious errors in "%%" on some distros.
static inline bool no_warn_unused_result(int ignore) { if (ignore) {} return true; }

View File

@ -167,7 +167,7 @@
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\chat_lexer.lex.c"
RelativePath=".\chat_lexer.lex.cpp"
>
</File>
<File
@ -195,7 +195,7 @@
>
</File>
<File
RelativePath=".\script_lexer.lex.c"
RelativePath=".\script_lexer.lex.cpp"
>
</File>
<File

View File

@ -31,7 +31,7 @@
#include "lib/script/script.h"
/* Get the Yacc definitions */
#include "script_parser.tab.h"
#include "script_parser.tab.hpp"
// fwrite declared with warn_unused_result, resulting in mysterious errors in "%%" on some distros.
static inline bool no_warn_unused_result(int ignore) { if (ignore) {} return true; }

View File

@ -1,9 +1,8 @@
%.tab.h %.tab.c:: %.y
%.tab.hpp %.tab.cpp:: %.y
$(YACC) $(YFLAGS) $(AM_YFLAGS) -o$@ $<
%.lex.h %.lex.c:: %.l
%.lex.hpp %.lex.cpp:: %.l
$(LEX) $(LFLAGS) $(AM_LFLAGS) -o$@ $<
# sed -i 's/\(fwrite(.*)\)/abs(\1)/' $@
# Required to force using a C++ linker
force-linker.cpp:
@ -17,23 +16,23 @@ AM_YFLAGS = -d
BUILT_SOURCES = \
force-linker.cpp \
level_lexer.lex.c \
message_lexer.lex.c \
message_parser.tab.c \
message_parser.tab.h \
scriptvals_lexer.lex.c \
scriptvals_parser.tab.c \
scriptvals_parser.tab.h
level_lexer.lex.cpp \
message_lexer.lex.cpp \
message_parser.tab.cpp \
message_parser.tab.hpp \
scriptvals_lexer.lex.cpp \
scriptvals_parser.tab.cpp \
scriptvals_parser.tab.hpp
CLEANFILES = \
force-linker.cpp \
level_lexer.lex.c \
message_lexer.lex.c \
message_parser.tab.c \
message_parser.tab.h \
scriptvals_lexer.lex.c \
scriptvals_parser.tab.c \
scriptvals_parser.tab.h
level_lexer.lex.cpp \
message_lexer.lex.cpp \
message_parser.tab.cpp \
message_parser.tab.hpp \
scriptvals_lexer.lex.cpp \
scriptvals_parser.tab.cpp \
scriptvals_parser.tab.hpp
EXTRA_DIST = \
autorevision.h \
@ -113,7 +112,7 @@ noinst_HEADERS = \
messagedef.h \
message.h \
messagely.h \
message_parser.tab.h \
message_parser.tab.hpp \
miscimd.h \
missiondef.h \
mission.h \
@ -153,7 +152,7 @@ noinst_HEADERS = \
scriptobj.h \
scripttabs.h \
scriptvals.h \
scriptvals_parser.tab.h \
scriptvals_parser.tab.hpp \
selection.h \
seqdisp.h \
statsdef.h \
@ -222,7 +221,7 @@ warzone2100_SOURCES = \
keybind.cpp \
keyedit.cpp \
keymap.cpp \
level_lexer.lex.c \
level_lexer.lex.cpp \
levels.cpp \
lighting.cpp \
loadsave.cpp \
@ -233,8 +232,8 @@ warzone2100_SOURCES = \
mapgrid.cpp \
mechanics.cpp \
message.cpp \
message_lexer.lex.c \
message_parser.tab.c \
message_lexer.lex.cpp \
message_parser.tab.cpp \
miscimd.cpp \
mission.cpp \
move.cpp \
@ -269,8 +268,8 @@ warzone2100_SOURCES = \
scriptobj.cpp \
scripttabs.cpp \
scriptvals.cpp \
scriptvals_lexer.lex.c \
scriptvals_parser.tab.c \
scriptvals_lexer.lex.cpp \
scriptvals_parser.tab.cpp \
selection.cpp \
seqdisp.cpp \
stats.cpp \

View File

@ -48,21 +48,12 @@
#include "lib/framework/lexer_input.h"
#include "effects.h"
#ifdef __cplusplus
extern "C"
{
#endif //__cplusplus
extern int lev_get_lineno(void);
extern char* lev_get_text(void);
extern int lev_lex(void);
extern void lev_set_extra(YY_EXTRA_TYPE user_defined);
extern int lev_lex_destroy(void);
#ifdef __cplusplus
}
#endif //__cplusplus
// block ID number start for the current level data (as opposed to a dataset)
#define CURRENT_DATAID LEVEL_MAXFILES

View File

@ -28,7 +28,7 @@
#include "src/messagedef.h"
/* Get the Yacc definitions */
#include "message_parser.tab.h"
#include "message_parser.tab.hpp"
#include "lib/framework/lexer_input.h"
#include "src/messagely.h"

View File

@ -32,7 +32,7 @@
#include "src/scriptvals.h"
/* Get the Yacc definitions */
#include "scriptvals_parser.tab.h"
#include "scriptvals_parser.tab.hpp"
/* Maximum length for any TEXT value */

View File

@ -34,7 +34,7 @@
#include "src/scriptvals.h"
#include "lib/framework/lexer_input.h"
#include "scriptvals_parser.tab.h"
#include "scriptvals_parser.tab.hpp"
#include "src/scripttabs.h"
#include "src/objects.h"
#include "src/droid.h"

View File

@ -39,7 +39,7 @@
/>
<Tool
Name="FlexGenerator"
OutputFile="$(ProjectDir)..\src\$(InputName).lex.c"
OutputFile="$(ProjectDir)..\src\$(InputName).lex.cpp"
/>
<Tool
Name="VCXMLDataGeneratorTool"
@ -143,7 +143,7 @@
/>
<Tool
Name="FlexGenerator"
OutputFile="$(ProjectDir)..\src\$(InputName).lex.c"
OutputFile="$(ProjectDir)..\src\$(InputName).lex.cpp"
/>
<Tool
Name="VCXMLDataGeneratorTool"
@ -424,7 +424,7 @@
>
</File>
<File
RelativePath="..\src\level_lexer.lex.c"
RelativePath="..\src\level_lexer.lex.cpp"
>
</File>
<File
@ -468,7 +468,7 @@
>
</File>
<File
RelativePath="..\src\message_lexer.lex.c"
RelativePath="..\src\message_lexer.lex.cpp"
>
</File>
<File
@ -612,7 +612,7 @@
>
</File>
<File
RelativePath="..\src\scriptvals_lexer.lex.c"
RelativePath="..\src\scriptvals_lexer.lex.cpp"
>
</File>
<File

View File

@ -40,7 +40,7 @@
/>
<Tool
Name="FlexGenerator"
OutputFile="$(ProjectDir)..\src\$(InputName).lex.c"
OutputFile="$(ProjectDir)..\src\$(InputName).lex.cpp"
/>
<Tool
Name="VCCustomBuildTool"
@ -139,7 +139,7 @@
/>
<Tool
Name="FlexGenerator"
OutputFile="$(ProjectDir)..\src\$(InputName).lex.c"
OutputFile="$(ProjectDir)..\src\$(InputName).lex.cpp"
/>
<Tool
Name="VCCustomBuildTool"
@ -415,7 +415,7 @@
>
</File>
<File
RelativePath="..\src\level_lexer.lex.c"
RelativePath="..\src\level_lexer.lex.cpp"
>
</File>
<File
@ -459,7 +459,7 @@
>
</File>
<File
RelativePath="..\src\message_lexer.lex.c"
RelativePath="..\src\message_lexer.lex.cpp"
>
</File>
<File
@ -603,7 +603,7 @@
>
</File>
<File
RelativePath="..\src\scriptvals_lexer.lex.c"
RelativePath="..\src\scriptvals_lexer.lex.cpp"
>
</File>
<File