diff --git a/code/game/entityDefParser/LICENSE b/code/game/entityDefParser/LICENSE new file mode 100644 index 0000000..aa46ecc --- /dev/null +++ b/code/game/entityDefParser/LICENSE @@ -0,0 +1,24 @@ +Copyright (c) 2012 Walter Julius Hennecke, Ubergames + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including without +limitation the rights to use, copy, modify, merge, publish, distribute, +sublicense, and/or sell copies of the Software, and to permit persons to +whom the Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT +WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/code/tools/entityDefParser/README b/code/game/entityDefParser/README similarity index 100% rename from code/tools/entityDefParser/README rename to code/game/entityDefParser/README diff --git a/code/game/entityDefParser/quaked.l b/code/game/entityDefParser/quaked.l new file mode 100644 index 0000000..b465099 --- /dev/null +++ b/code/game/entityDefParser/quaked.l @@ -0,0 +1,88 @@ +/* + Copyright (c) 2012 Walter Julius Hennecke, Ubergames + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including without + limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to + whom the Software is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT + WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +*/ + +%{ +#include + +FILE *in, *out; + +#define YY_DECL int yylex() +%} + +%x C_QUAKED +%% +"/*QUAKED" { BEGIN(C_QUAKED); fprintf(out, "/*QUAKED"); } +"*/" { BEGIN(INITIAL); fprintf(out, "*/\n\n"); } +"\t" { fprintf(out, "\t"); } +"\n" { fprintf(out, "\n"); } +. { fprintf(out, "%s", yytext); } +[\n] ; +. ; +%% + +main(int argc, char *argv[]) { + char *buf; + long len; + + if(argc < 2) { + printf("Usage: %s \n", argv[0]); + } + + in = fopen(argv[1], "r"); + if(!in) { + return; + } + + out = fopen(argv[2], "r"); + if(out) { + fseek(out, 0, SEEK_END); + len = ftell(out); + fseek(out, 0, SEEK_SET); + + buf = (char *)malloc(len+1); + if(!buf) { + fclose(out); + return; + } + fgets(buf, len, out); + fclose(out); + } + + out = fopen(argv[2], "a"); + if(!out) { + return; + } + + if(buf != NULL) { + fprintf(out, "%s", buf); + free(buf); + } + + yyin = in; + + yylex(); +} diff --git a/code/game/luaDefParser/LICENSE b/code/game/luaDefParser/LICENSE new file mode 100644 index 0000000..aa46ecc --- /dev/null +++ b/code/game/luaDefParser/LICENSE @@ -0,0 +1,24 @@ +Copyright (c) 2012 Walter Julius Hennecke, Ubergames + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including without +limitation the rights to use, copy, modify, merge, publish, distribute, +sublicense, and/or sell copies of the Software, and to permit persons to +whom the Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT +WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/code/tools/luaDefParser/README b/code/game/luaDefParser/README similarity index 100% rename from code/tools/luaDefParser/README rename to code/game/luaDefParser/README diff --git a/code/tools/luaDefParser/export_lyx.c b/code/game/luaDefParser/export_lyx.c similarity index 69% rename from code/tools/luaDefParser/export_lyx.c rename to code/game/luaDefParser/export_lyx.c index 4ed5383..147809d 100644 --- a/code/tools/luaDefParser/export_lyx.c +++ b/code/game/luaDefParser/export_lyx.c @@ -1,3 +1,30 @@ +/* + Copyright (c) 2012 Walter Julius Hennecke, Ubergames + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including without + limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to + whom the Software is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT + WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +*/ + #include "export_lyx.h" #include diff --git a/code/tools/luaDefParser/export_lyx.h b/code/game/luaDefParser/export_lyx.h similarity index 59% rename from code/tools/luaDefParser/export_lyx.h rename to code/game/luaDefParser/export_lyx.h index 919c8a4..c370d00 100644 --- a/code/tools/luaDefParser/export_lyx.h +++ b/code/game/luaDefParser/export_lyx.h @@ -1,3 +1,30 @@ +/* + Copyright (c) 2012 Walter Julius Hennecke, Ubergames + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including without + limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to + whom the Software is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT + WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +*/ + #ifndef EXPORT_LYX_H_ #define EXPORT_LYX_H_ diff --git a/code/tools/luaDefParser/luadef.l b/code/game/luaDefParser/luadef.l similarity index 68% rename from code/tools/luaDefParser/luadef.l rename to code/game/luaDefParser/luadef.l index 0b1cada..f67d8f9 100644 --- a/code/tools/luaDefParser/luadef.l +++ b/code/game/luaDefParser/luadef.l @@ -1,3 +1,31 @@ +/* + Copyright (c) 2012 Walter Julius Hennecke, Ubergames + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including without + limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to + whom the Software is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT + WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +*/ + + %{ #include #include diff --git a/code/tools/luaDefParser/test.c b/code/game/luaDefParser/test.c similarity index 100% rename from code/tools/luaDefParser/test.c rename to code/game/luaDefParser/test.c diff --git a/code/tools/entityDefParser/quaked.l b/code/tools/entityDefParser/quaked.l deleted file mode 100644 index 7c46316..0000000 --- a/code/tools/entityDefParser/quaked.l +++ /dev/null @@ -1,61 +0,0 @@ -%{ -#include - -FILE *in, *out; - -#define YY_DECL int yylex() -%} - -%x C_QUAKED -%% -"/*QUAKED" { BEGIN(C_QUAKED); fprintf(out, "/*QUAKED"); } -"*/" { BEGIN(INITIAL); fprintf(out, "*/\n\n"); } -"\t" { fprintf(out, "\t"); } -"\n" { fprintf(out, "\n"); } -. { fprintf(out, "%s", yytext); } -[\n] ; -. ; -%% - -main(int argc, char *argv[]) { - char *buf; - long len; - - if(argc < 2) { - printf("Usage: %s \n", argv[0]); - } - - in = fopen(argv[1], "r"); - if(!in) { - return; - } - - out = fopen(argv[2], "r"); - if(out) { - fseek(out, 0, SEEK_END); - len = ftell(out); - fseek(out, 0, SEEK_SET); - - buf = (char *)malloc(len+1); - if(!buf) { - fclose(out); - return; - } - fgets(buf, len, out); - fclose(out); - } - - out = fopen(argv[2], "a"); - if(!out) { - return; - } - - if(buf != NULL) { - fprintf(out, "%s", buf); - free(buf); - } - - yyin = in; - - yylex(); -}