diff --git a/code/game/bg_lex.h b/code/game/bg_lex.h index a5f3508..e3ff55d 100644 --- a/code/game/bg_lex.h +++ b/code/game/bg_lex.h @@ -1,139 +1,153 @@ -#ifndef BG_LEX_H -#define BG_LEX_H - -#include "q_shared.h" - -#define LEX_DEBUG -#ifdef LEX_DEBUG -extern char *yyget_text (void* yyscanner); -#endif - -#ifndef YY_TYPEDEF_YY_SCANNER_T -#define YY_TYPEDEF_YY_SCANNER_T -typedef void* yyscan_t; -#endif - -typedef enum { - LSYM_OBRACE, /* ( */ - LSYM_OBRACEC, /* { */ - LSYM_OBRACESQ, /* [ */ - LSYM_CBRACE, /* ) */ - LSYM_CBRACEC, /* } */ - LSYM_CBRACESQ, /* ] */ - LSYM_TRUE, - LSYM_FALSE, - LSYM_SERVER_CHANGE_CONFIG, - LSYM_SERVER, - LSYM_HOLODECK_DATA, - LSYM_PROGRAM, - LSYM_MAP_CHANGE_CONFIG, - LSYM_MAP, - LSYM_LOCATIONS_LIST, - LSYM_LOCATIONS_LIST_2, - LSYM_MESSAGE, - LSYM_CONSOLE_NAME, - LSYM_FORMAL_NAME, - LSYM_RADAR_COLOR, - LSYM_ICON_COLOR, - LSYM_NULL, - LSYM_MODEL_SKIN, - LSYM_WEAPONS, - LSYM_HAS_RANKS, - LSYM_TEAL, - LSYM_MEDICAL, - LSYM_GOLD, - LSYM_GREEN, - LSYM_MARINE, - LSYM_RED, - LSYM_WP_NULL, - LSYM_WP_NULL_HANDS, - LSYM_WP_TRICORDER, - LSYM_WP_PADD, - LSYM_WP_COFFEE, - LSYM_WP_PHASER, - LSYM_WP_COMPRESSION_RIFLE, - LSYM_WP_TR116, - LSYM_WP_GRENADE_LAUNCHER, - LSYM_WP_QUANTUM_BURST, - LSYM_WP_MEDKIT, - LSYM_WP_DISRUPTOR, - LSYM_WP_VOYAGER_HYPO, - LSYM_WP_DERMAL_REGEN, - LSYM_WP_TOOLKIT, - LSYM_WP_HYPERSPANNER, - LSYM_WP_0, - LSYM_WP_1, - LSYM_WP_2, - LSYM_WP_3, - LSYM_WP_4, - LSYM_WP_5, - LSYM_WP_6, - LSYM_WP_7, - LSYM_WP_8, - LSYM_WP_9, - LSYM_WP_10, - LSYM_WP_11, - LSYM_WP_12, - LSYM_WP_13, - LSYM_WP_14, - LSYM_WP_15, - LSYM_ADMIN, - LSYM_BORG, - LSYM_N00B, - LSYM_NO_SHOW, - LSYM_MENU_TEXTURE_DEF, - LSYM_MENU_TEXTURE_RED, - LSYM_MENU_TEXTURE_TEAL, - LSYM_MENU_TEXTURE_GOLD, - LSYM_MENU_TEXTURE_GREEN, - LSYM_BOLT_MODEL, - LSYM_BOLT_SHADER, - LSYM_ADMIRAL_RANK, - LSYM_SEMICOLON, - - LSYM_UNKNOWN -} bgLexSymbol; - -typedef enum { - LMT_EOF, - LMT_STRING = 1, - LMT_INT, - LMT_DOUBLE, - LMT_VECTOR3, - LMT_VECTOR4, - LMT_SYMBOL, - LMT_IGNORE -} bgLexMorphemType; - -typedef struct bgLexMorphemData_s bgLexMorphemData; -struct bgLexMorphemData_s { - char* str; - bgLexSymbol symbol; - int numInteger; - double numDouble; - vec3_t vector3; - vec4_t vector4; -}; - -typedef struct bgLexMorphem_s bgLexMorphem; -struct bgLexMorphem_s { - bgLexMorphemType type; - bgLexMorphemData data; - int line; - int column; -}; - -typedef struct bgLex_s bgLex; -struct bgLex_s { - yyscan_t lex; - bgLexMorphem morphem; - void* buf; -}; - -bgLex* bgLex_create(char* data); -void bgLex_destroy(/*@only@*/ /*@out@*/ /*@null@*/ bgLex* lex); -int bgLex_lex(bgLex* lex); -bgLexSymbol bgLex_textToSymbol(char* text); -void bgLexFatalError(const char* msg, void* lex); - -#endif /* BG_LEX_H */ +#ifndef BG_LEX_H +#define BG_LEX_H + +#include "q_shared.h" + +#define LEX_DEBUG +#ifdef LEX_DEBUG +extern char *yyget_text (void* yyscanner); +#endif + +#ifndef YY_TYPEDEF_YY_SCANNER_T +#define YY_TYPEDEF_YY_SCANNER_T +typedef void* yyscan_t; +#endif + +typedef enum { + LSYM_OBRACE, /* ( */ + LSYM_OBRACEC, /* { */ + LSYM_OBRACESQ, /* [ */ + LSYM_CBRACE, /* ) */ + LSYM_CBRACEC, /* } */ + LSYM_CBRACESQ, /* ] */ + LSYM_TRUE, + LSYM_FALSE, + LSYM_SERVER_CHANGE_CONFIG, + LSYM_SERVER, + LSYM_HOLODECK_DATA, + LSYM_PROGRAM, + LSYM_MAP_CHANGE_CONFIG, + LSYM_MAP, + LSYM_LOCATIONS_LIST, + LSYM_LOCATIONS_LIST_2, + LSYM_MESSAGE, + LSYM_CONSOLE_NAME, + LSYM_FORMAL_NAME, + LSYM_RADAR_COLOR, + LSYM_ICON_COLOR, + LSYM_NULL, + LSYM_MODEL_SKIN, + LSYM_WEAPONS, + LSYM_HAS_RANKS, + LSYM_TEAL, + LSYM_MEDICAL, + LSYM_GOLD, + LSYM_GREEN, + LSYM_MARINE, + LSYM_RED, + LSYM_WP_NULL, + LSYM_WP_NULL_HANDS, + LSYM_WP_TRICORDER, + LSYM_WP_PADD, + LSYM_WP_COFFEE, + LSYM_WP_PHASER, + LSYM_WP_COMPRESSION_RIFLE, + LSYM_WP_TR116, + LSYM_WP_GRENADE_LAUNCHER, + LSYM_WP_QUANTUM_BURST, + LSYM_WP_MEDKIT, + LSYM_WP_DISRUPTOR, + LSYM_WP_VOYAGER_HYPO, + LSYM_WP_DERMAL_REGEN, + LSYM_WP_TOOLKIT, + LSYM_WP_HYPERSPANNER, + LSYM_WP_0, + LSYM_WP_1, + LSYM_WP_2, + LSYM_WP_3, + LSYM_WP_4, + LSYM_WP_5, + LSYM_WP_6, + LSYM_WP_7, + LSYM_WP_8, + LSYM_WP_9, + LSYM_WP_10, + LSYM_WP_11, + LSYM_WP_12, + LSYM_WP_13, + LSYM_WP_14, + LSYM_WP_15, + LSYM_ADMIN, + LSYM_BORG, + LSYM_N00B, + LSYM_NO_SHOW, + LSYM_MENU_TEXTURE_DEF, + LSYM_MENU_TEXTURE_RED, + LSYM_MENU_TEXTURE_TEAL, + LSYM_MENU_TEXTURE_GOLD, + LSYM_MENU_TEXTURE_GREEN, + LSYM_BOLT_MODEL, + LSYM_BOLT_SHADER, + LSYM_ADMIRAL_RANK, + LSYM_SEMICOLON, + LSYM_WCONF_PHASER, + LSYM_WCONF_CRIFLE, + LSYM_WCONF_DISRUPTOR, + LSYM_WCONF_GRENADE, + LSYM_WCONF_TR116, + LSYM_WCONF_QUANTUM, + LSYM_WCONF_HYPERSPANNER, + LSYM_WCONF_PRIMARY, + LSYM_WCONF_SECONDARY, + LSYM_WCONF_RANGE, + LSYM_WCONF_DAMAGE, + LSYM_WCONF_VARIATION, + LSYM_WCONF_RADIUS, + LSYM_POINT, + + LSYM_UNKNOWN +} bgLexSymbol; + +typedef enum { + LMT_EOF, + LMT_STRING = 1, + LMT_INT, + LMT_DOUBLE, + LMT_VECTOR3, + LMT_VECTOR4, + LMT_SYMBOL, + LMT_IGNORE +} bgLexMorphemType; + +typedef struct bgLexMorphemData_s bgLexMorphemData; +struct bgLexMorphemData_s { + char* str; + bgLexSymbol symbol; + int numInteger; + double numDouble; + vec3_t vector3; + vec4_t vector4; +}; + +typedef struct bgLexMorphem_s bgLexMorphem; +struct bgLexMorphem_s { + bgLexMorphemType type; + bgLexMorphemData data; + int line; + int column; +}; + +typedef struct bgLex_s bgLex; +struct bgLex_s { + yyscan_t lex; + bgLexMorphem morphem; + void* buf; +}; + +bgLex* bgLex_create(char* data); +void bgLex_destroy(/*@only@*/ /*@out@*/ /*@null@*/ bgLex* lex); +int bgLex_lex(bgLex* lex); +bgLexSymbol bgLex_textToSymbol(char* text); +void bgLexFatalError(const char* msg, void* lex); + +#endif /* BG_LEX_H */ diff --git a/code/game/bg_lex.lex b/code/game/bg_lex.lex index 341e94b..cd35500 100644 --- a/code/game/bg_lex.lex +++ b/code/game/bg_lex.lex @@ -1,1079 +1,1129 @@ -%top { -#include "q_shared.h" -#include "bg_lex.h" - -#define YY_FATAL_ERROR(msg) bgLexFatalError(msg, yyscanner) -#define UNUSED(x) ((void)(x)) -} - -DIGIT [0-9] -INT "-"?{DIGIT}+ -DOUBLE "-"?{DIGIT}+"."?{DIGIT}* -KEYWORD [a-zA-Z]+[a-zA-Z0-9]* - -%option reentrant -%option noyywrap -%option extra-type="bgLexMorphem*" - -%% -\"[^\"]*\" { - char *s = yytext; s++; - yyextra->type = LMT_STRING; - yytext[strlen(yytext)-1] = '\0'; - yyextra->data.str = yytext + 1; - yyextra->column += strlen(yytext); - return LMT_STRING; -} -{INT} { - yyextra->type = LMT_INT; - yyextra->data.numInteger = atoi(yytext); - yyextra->column += strlen(yytext); - return LMT_INT; -} -{DOUBLE} { - yyextra->type = LMT_DOUBLE; - yyextra->data.numDouble = atof(yytext); - yyextra->column += strlen(yytext); - return LMT_DOUBLE; -} -{KEYWORD} { - yyextra->type = LMT_SYMBOL; - yyextra->data.symbol = bgLex_textToSymbol(yytext); - yyextra->column += strlen(yytext); - return LMT_SYMBOL; -} -"{"" "+{INT}" "+{INT}" "+{INT}" "+"}" { - double a, b, c; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf }", &a, &b, &c); - yyextra->data.vector3[0] = a; - yyextra->data.vector3[1] = b; - yyextra->data.vector3[2] = c; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR3; - return LMT_VECTOR3; -} - -"{"" "+{INT}" "+{INT}" "+{DOUBLE}" "+"}" { - double a, b, c; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf }", &a, &b, &c); - yyextra->data.vector3[0] = a; - yyextra->data.vector3[1] = b; - yyextra->data.vector3[2] = c; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR3; - return LMT_VECTOR3; -} -"{"" "+{INT}" "+{DOUBLE}" "+{INT}" "+"}" { - double a, b, c; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf }", &a, &b, &c); - yyextra->data.vector3[0] = a; - yyextra->data.vector3[1] = b; - yyextra->data.vector3[2] = c; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR3; - return LMT_VECTOR3; -} -"{"" "+{INT}" "+{DOUBLE}" "+{DOUBLE}" "+"}" { - double a, b, c; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf }", &a, &b, &c); - yyextra->data.vector3[0] = a; - yyextra->data.vector3[1] = b; - yyextra->data.vector3[2] = c; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR3; - return LMT_VECTOR3; -} -"{"" "+{DOUBLE}" "+{INT}" "+{INT}" "+"}" { - double a, b, c; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf }", &a, &b, &c); - yyextra->data.vector3[0] = a; - yyextra->data.vector3[1] = b; - yyextra->data.vector3[2] = c; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR3; - return LMT_VECTOR3; -} -"{"" "+{DOUBLE}" "+{INT}" "+{DOUBLE}" "+"}" { - double a, b, c; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf }", &a, &b, &c); - yyextra->data.vector3[0] = a; - yyextra->data.vector3[1] = b; - yyextra->data.vector3[2] = c; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR3; - return LMT_VECTOR3; -} -"{"" "+{DOUBLE}" "+{DOUBLE}" "+{INT}" "+"}" { - double a, b, c; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf }", &a, &b, &c); - yyextra->data.vector3[0] = a; - yyextra->data.vector3[1] = b; - yyextra->data.vector3[2] = c; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR3; - return LMT_VECTOR3; -} -"{"" "+{DOUBLE}" "+{DOUBLE}" "+{DOUBLE}" "+"}" { - double a, b, c; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf }", &a, &b, &c); - yyextra->data.vector3[0] = a; - yyextra->data.vector3[1] = b; - yyextra->data.vector3[2] = c; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR3; - return LMT_VECTOR3; -} -"{"" "+{INT}" "*","" "+{INT}" "*","" "+{INT}" "+"}" { - double a, b, c; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf }", &a, &b, &c); - yyextra->data.vector3[0] = a; - yyextra->data.vector3[1] = b; - yyextra->data.vector3[2] = c; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR3; - return LMT_VECTOR3; -} - -"{"" "+{INT}" "*","" "+{INT}" "*","" "+{DOUBLE}" "+"}" { - double a, b, c; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf }", &a, &b, &c); - yyextra->data.vector3[0] = a; - yyextra->data.vector3[1] = b; - yyextra->data.vector3[2] = c; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR3; - return LMT_VECTOR3; -} -"{"" "+{INT}" "*","" "+{DOUBLE}" "*","" "+{INT}" "+"}" { - double a, b, c; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf }", &a, &b, &c); - yyextra->data.vector3[0] = a; - yyextra->data.vector3[1] = b; - yyextra->data.vector3[2] = c; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR3; - return LMT_VECTOR3; -} -"{"" "+{INT}" "*","" "+{DOUBLE}" "*","" "+{DOUBLE}" "+"}" { - double a, b, c; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf }", &a, &b, &c); - yyextra->data.vector3[0] = a; - yyextra->data.vector3[1] = b; - yyextra->data.vector3[2] = c; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR3; - return LMT_VECTOR3; -} -"{"" "+{DOUBLE}" "*","" "+{INT}" "*","" "+{INT}" "+"}" { - double a, b, c; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf }", &a, &b, &c); - yyextra->data.vector3[0] = a; - yyextra->data.vector3[1] = b; - yyextra->data.vector3[2] = c; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR3; - return LMT_VECTOR3; -} -"{"" "+{DOUBLE}" "*","" "+{INT}" "*","" "+{DOUBLE}" "+"}" { - double a, b, c; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf }", &a, &b, &c); - yyextra->data.vector3[0] = a; - yyextra->data.vector3[1] = b; - yyextra->data.vector3[2] = c; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR3; - return LMT_VECTOR3; -} -"{"" "+{DOUBLE}" "*","" "+{DOUBLE}" "*","" "+{INT}" "+"}" { - double a, b, c; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf }", &a, &b, &c); - yyextra->data.vector3[0] = a; - yyextra->data.vector3[1] = b; - yyextra->data.vector3[2] = c; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR3; - return LMT_VECTOR3; -} -"{"" "+{DOUBLE}" "*","" "+{DOUBLE}" "*","" "+{DOUBLE}" "+"}" { - double a, b, c; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf }", &a, &b, &c); - yyextra->data.vector3[0] = a; - yyextra->data.vector3[1] = b; - yyextra->data.vector3[2] = c; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR3; - return LMT_VECTOR3; -} -"{"" "+{INT}" "+{INT}" "+{INT}" "+{INT}" "+"}" { - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} -"{"" "+{INT}" "+{INT}" "+{INT}" "+{DOUBLE}" "+"}" { - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} -"{"" "+{INT}" "+{INT}" "+{DOUBLE}" "+{INT}" "+"}" { - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} -"{"" "+{INT}" "+{INT}" "+{DOUBLE}" "+{DOUBLE}" "+"}" { - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} -"{"" "+{INT}" "+{DOUBLE}" "+{INT}" "+{INT}" "+"}" { - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} -"{"" "+{INT}" "+{DOUBLE}" "+{INT}" "+{DOUBLE}" "+"}" { - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} -"{"" "+{INT}" "+{DOUBLE}" "+{DOUBLE}" "+{INT}" "+"}" { - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} -"{"" "+{INT}" "+{DOUBLE}" "+{DOUBLE}" "+{DOUBLE}" "+"}" { - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} -"{"" "+{DOUBLE}" "+{INT}" "+{INT}" "+{INT}" "+"}" { - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} -"{"" "+{DOUBLE}" "+{INT}" "+{INT}" "+{DOUBLE}" "+"}" { - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} -"{"" "+{DOUBLE}" "+{INT}" "+{DOUBLE}" "+{INT}" "+"}" { - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} -"{"" "+{DOUBLE}" "+{INT}" "+{DOUBLE}" "+{DOUBLE}" "+"}" { - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} -"{"" "+{DOUBLE}" "+{DOUBLE}" "+{INT}" "+{INT}" "+"}" { - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} -"{"" "+{DOUBLE}" "+{DOUBLE}" "+{INT}" "+{DOUBLE}" "+"}" { - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} -"{"" "+{DOUBLE}" "+{DOUBLE}" "+{DOUBLE}" "+{INT}" "+"}" { - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} -"{"" "+{DOUBLE}" "+{DOUBLE}" "+{DOUBLE}" "+{DOUBLE}" "+"}" { - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} -"{"" "+{INT}" "*","" "+{INT}" "*","" "+{INT}" "*","" "+{INT}" "+"}" { - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} -"{"" "+{INT}" "*","" "+{INT}" "*","" "+{INT}" "*","" "+{DOUBLE}" "+"}" { - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} -"{"" "+{INT}" "*","" "+{INT}" "*","" "+{DOUBLE}" "*","" "+{INT}" "+"}" { - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} -"{"" "+{INT}" "*","" "+{INT}" "*","" "+{DOUBLE}" "*","" "+{DOUBLE}" "+"}" { - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} -"{"" "+{INT}" "*","" "+{DOUBLE}" "*","" "+{INT}" "*","" "+{INT}" "+"}" { - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} -"{"" "+{INT}" "*","" "+{DOUBLE}" "*","" "+{INT}" "*","" "+{DOUBLE}" "+"}" { - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} -"{"" "+{INT}" "*","" "+{DOUBLE}" "*","" "+{DOUBLE}" "*","" "+{INT}" "+"}" { - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} -"{"" "+{INT}" "*","" "+{DOUBLE}" "*","" "+{DOUBLE}" "*","" "+{DOUBLE}" "+"}" { - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} -"{"" "+{DOUBLE}" "*","" "+{INT}" "*","" "+{INT}" "*","" "+{INT}" "+"}" { - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} -"{"" "+{DOUBLE}" "*","" "+{INT}" "*","" "+{INT}" "*","" "+{DOUBLE}" "+"}" { - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} -"{"" "+{DOUBLE}" "*","" "+{INT}" "*","" "+{DOUBLE}" "*","" "+{INT}" "+"}" { - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} -"{"" "+{DOUBLE}" "*","" "+{INT}" "*","" "+{DOUBLE}" "*","" "+{DOUBLE}" "+"}" { - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} -"{"" "+{DOUBLE}" "*","" "+{DOUBLE}" "*","" "+{INT}" "*","" "+{INT}" "+"}" { - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} -"{"" "+{DOUBLE}" "*","" "+{DOUBLE}" "*","" "+{INT}" "*","" "+{DOUBLE}" "+"}" { - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} -"{"" "+{DOUBLE}" "*","" "+{DOUBLE}" "*","" "+{DOUBLE}" "*","" "+{INT}" "+"}" { - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} -"{"" "+{DOUBLE}" "*","" "+{DOUBLE}" "*","" "+{DOUBLE}" "*","" "+{DOUBLE}" "+"}" { - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} -"{" { - yyextra->type = LMT_SYMBOL; - yyextra->data.symbol = LSYM_OBRACEC; - yyextra->column++; - return LMT_SYMBOL; -} -"}" { - yyextra->type = LMT_SYMBOL; - yyextra->data.symbol = LSYM_CBRACEC; - yyextra->column++; - return LMT_SYMBOL; -} -"(" { - yyextra->type = LMT_SYMBOL; - yyextra->data.symbol = LSYM_OBRACE; - yyextra->column++; - return LMT_SYMBOL; -} -")" { - yyextra->type = LMT_SYMBOL; - yyextra->data.symbol = LSYM_CBRACE; - yyextra->column++; - return LMT_SYMBOL; -} -"[" { - yyextra->type = LMT_SYMBOL; - yyextra->data.symbol = LSYM_OBRACESQ; - yyextra->column++; - return LMT_SYMBOL; -} -"]" { - yyextra->type = LMT_SYMBOL; - yyextra->data.symbol = LSYM_CBRACESQ; - yyextra->column++; - return LMT_SYMBOL; -} -";" { - yyextra->type = LMT_SYMBOL; - yyextra->data.symbol = LSYM_SEMICOLON; - yyextra->column++; - return LMT_SYMBOL; -} -[ \t] { - yyextra->column++; - yyextra->type = LMT_IGNORE; - return LMT_IGNORE; -} -\n { - yyextra->line++; - yyextra->column = 0; - yyextra->type = LMT_IGNORE; - return LMT_IGNORE; -} -<> { - yyextra->type = LMT_EOF; - return LMT_EOF; -} -. { - yyextra->column++; - yyextra->type = LMT_IGNORE; - return LMT_IGNORE; -} -%% - -#ifdef LEX_TEXT -int main(int argc, char* argv[]) { - char buff[4096]; - yyscan_t scanner; - FILE* f; - bgLex* lex; - - f = fopen("test.txt", "r"); - fread(buff, 4096, 1, f); - fclose(f); - - lex = bgLex_create(buff); - while(bgLex_lex(lex)) { - printf("type=%i symbol=%i yytext=%s\n", lex->morphem.type, lex->morphem.data.symbol, yyget_text(lex->lex)); - } - bgLex_destroy(lex); - - return EXIT_SUCCESS; -} -#endif - -bgLex* bgLex_create(char* data) { - bgLex* l = malloc(sizeof(bgLex)); - - /* HACK: prevent compiler warnings */ - UNUSED(yyunput); - UNUSED(input); - - if(l != NULL) { - l->morphem.line = 0; - l->morphem.column = 0; - - yylex_init_extra(&l->morphem, &l->lex); - l->buf = yy_scan_string(data,l->lex); - } - - return l; -} - -void bgLex_destroy(bgLex* lex) { - if(lex == NULL) { - return; - } - - if(lex->buf != NULL) { - yy_delete_buffer(lex->buf, lex->lex); - } - - if(lex->lex != NULL) { - yylex_destroy(lex->lex); - } - - free(lex); -} - -int bgLex_lex(bgLex* lex) { - int res; - - /* skip LMT_IGNORE */ - while(1) { - res = yylex(lex->lex); - if(lex->morphem.type != LMT_IGNORE) { - break; - } - } - - return res; -} - -bgLexSymbol bgLex_textToSymbol(char* text) { - if(strcmp("ServerChangeConfig", text) == 0) { - return LSYM_SERVER_CHANGE_CONFIG; - } - - if(strcmp("Server", text) == 0) { - return LSYM_SERVER; - } - - if(strcmp("HolodeckData", text) == 0) { - return LSYM_HOLODECK_DATA; - } - - if(strcmp("Program", text) == 0) { - return LSYM_PROGRAM; - } - - if(strcmp("MapChangeConfig", text) == 0) { - return LSYM_MAP_CHANGE_CONFIG; - } - - if(strcmp("Map", text) == 0) { - return LSYM_MAP; - } - - if(strcmp("LocationsList2", text) == 0) { - return LSYM_LOCATIONS_LIST_2; - } - - if(strcmp("LocationsList", text) == 0) { - return LSYM_LOCATIONS_LIST; - } - - if(strcmp("message", text) == 0) { - return LSYM_MESSAGE; - } - - if(strcmp("consoleName", text) == 0) { - return LSYM_CONSOLE_NAME; - } - - if(strcmp("formalName", text) == 0) { - return LSYM_FORMAL_NAME; - } - - if(strcmp("radarColor", text) == 0) { - return LSYM_RADAR_COLOR; - } - - if(strcmp("iconColor", text) == 0) { - return LSYM_ICON_COLOR; - } - - if(strcmp("NULL", text) == 0) { - return LSYM_NULL; - } - - if(strcmp("modelSkin", text) == 0) { - return LSYM_MODEL_SKIN; - } - - if(strcmp("weapons", text) == 0) { - return LSYM_WEAPONS; - } - - if(strcmp("hasRanks", text) == 0) { - return LSYM_HAS_RANKS; - } - - if(strcmp("teal", text) == 0) { - return LSYM_TEAL; - } - - if(strcmp("medical", text) == 0) { - return LSYM_MEDICAL; - } - - if(strcmp("gold", text) == 0) { - return LSYM_GOLD; - } - - if(strcmp("green", text) == 0) { - return LSYM_GREEN; - } - - if(strcmp("marine", text) == 0) { - return LSYM_MARINE; - } - - if(strcmp("red", text) == 0) { - return LSYM_RED; - } - - if(strcmp("WP_TRICORDER", text) == 0) { - return LSYM_WP_TRICORDER; - } - - if(strcmp("WP_PADD", text) == 0) { - return LSYM_WP_PADD; - } - - if(strcmp("WP_COFFEE", text) == 0) { - return LSYM_WP_COFFEE; - } - - if(strcmp("WP_PHASER", text) == 0) { - return LSYM_WP_PHASER; - } - - if(strcmp("WP_COMPRESSION_RIFLE", text) == 0) { - return LSYM_WP_COMPRESSION_RIFLE; - } - - if(strcmp("WP_TR116", text) == 0) { - return LSYM_WP_TR116; - } - - if(strcmp("WP_GRENADE_LAUNCHER", text) == 0) { - return LSYM_WP_GRENADE_LAUNCHER; - } - - if(strcmp("WP_QUANTUM_BURST", text) == 0) { - return LSYM_WP_QUANTUM_BURST; - } - - if(strcmp("WP_MEDKIT", text) == 0) { - return LSYM_WP_MEDKIT; - } - - if(strcmp("WP_VOYAGER_HYPO", text) == 0) { - return LSYM_WP_VOYAGER_HYPO; - } - - if(strcmp("WP_DERMAL_REGEN", text) == 0) { - return LSYM_WP_DERMAL_REGEN; - } - - if(strcmp("WP_TOOLKIT", text) == 0) { - return LSYM_WP_TOOLKIT; - } - - if(strcmp("WP_HYPERSPANNER", text) == 0) { - return LSYM_WP_HYPERSPANNER; - } - - if(strcmp("WP_DISRUPTOR", text) == 0) { - return LSYM_WP_DISRUPTOR; - } - - if(strcmp("WP_NULL", text) == 0) { - return LSYM_WP_NULL; - } - - if(strcmp("WP_NULL_HANDS", text) == 0) { - return LSYM_WP_NULL_HANDS; - } - - if(strcmp("WP_0", text) == 0) { - return LSYM_WP_0; - } - - if(strcmp("WP_1", text) == 0) { - return LSYM_WP_1; - } - - if(strcmp("WP_2", text) == 0) { - return LSYM_WP_2; - } - - if(strcmp("WP_3", text) == 0) { - return LSYM_WP_3; - } - - if(strcmp("WP_4", text) == 0) { - return LSYM_WP_4; - } - - if(strcmp("WP_5", text) == 0) { - return LSYM_WP_5; - } - - if(strcmp("WP_6", text) == 0) { - return LSYM_WP_6; - } - - if(strcmp("WP_7", text) == 0) { - return LSYM_WP_7; - } - - if(strcmp("WP_8", text) == 0) { - return LSYM_WP_8; - } - - if(strcmp("WP_9", text) == 0) { - return LSYM_WP_9; - } - - if(strcmp("WP_10", text) == 0) { - return LSYM_WP_10; - } - - if(strcmp("WP_11", text) == 0) { - return LSYM_WP_11; - } - - if(strcmp("WP_12", text) == 0) { - return LSYM_WP_12; - } - - if(strcmp("WP_13", text) == 0) { - return LSYM_WP_13; - } - - if(strcmp("WP_14", text) == 0) { - return LSYM_WP_14; - } - - if(strcmp("WP_15", text) == 0) { - return LSYM_WP_15; - } - - if(strcmp("admin", text) == 0) { - return LSYM_ADMIN; - } - - if(strcmp("borg", text) == 0) { - return LSYM_BORG; - } - - if(strcmp("n00b", text) == 0) { - return LSYM_N00B; - } - - if(strcmp("noShow", text) == 0) { - return LSYM_NO_SHOW; - } - - if(strcmp("MenuTextureDef", text) == 0) { - return LSYM_MENU_TEXTURE_DEF; - } - - if(strcmp("ConsoleName", text) == 0) { - return LSYM_CONSOLE_NAME; - } - - if(strcmp("FormalName", text) == 0) { - return LSYM_FORMAL_NAME; - } - - if(strcmp("MenuTextureRed", text) == 0) { - return LSYM_MENU_TEXTURE_RED; - } - - if(strcmp("MenuTextureTeal", text) == 0) { - return LSYM_MENU_TEXTURE_TEAL; - } - - if(strcmp("MenuTextureGold", text) == 0) { - return LSYM_MENU_TEXTURE_GOLD; - } - - if(strcmp("MenuTextureGreen", text) == 0) { - return LSYM_MENU_TEXTURE_GREEN; - } - - if(strcmp("BoltModel", text) == 0) { - return LSYM_BOLT_MODEL; - } - - if(strcmp("BoltShader", text) == 0) { - return LSYM_BOLT_SHADER; - } - - if(strcmp("AdmiralRank", text) == 0) { - return LSYM_ADMIRAL_RANK; - } - - if(strcmp("true", text) == 0) { - return LSYM_TRUE; - } - - if(strcmp("false", text) == 0) { - return LSYM_FALSE; - } - - return LSYM_UNKNOWN; -} - -void bgLexFatalError(const char* msg, void* lex) { - Com_Printf("LEXER ERROR: %s\n", msg); -} - +%top { +#include "q_shared.h" +#include "bg_lex.h" + +#define YY_FATAL_ERROR(msg) bgLexFatalError(msg, yyscanner) +#define UNUSED(x) ((void)(x)) +} + +DIGIT [0-9] +INT "-"?{DIGIT}+ +DOUBLE "-"?{DIGIT}+"."?{DIGIT}* +KEYWORD [a-zA-Z]+[a-zA-Z0-9]* + +%option reentrant +%option noyywrap +%option extra-type="bgLexMorphem*" + +%% +\"[^\"]*\" { + char *s = yytext; s++; + yyextra->type = LMT_STRING; + yytext[strlen(yytext)-1] = '\0'; + yyextra->data.str = yytext + 1; + yyextra->column += strlen(yytext); + return LMT_STRING; +} +{INT} { + yyextra->type = LMT_INT; + yyextra->data.numInteger = atoi(yytext); + yyextra->column += strlen(yytext); + return LMT_INT; +} +{DOUBLE} { + yyextra->type = LMT_DOUBLE; + yyextra->data.numDouble = atof(yytext); + yyextra->column += strlen(yytext); + return LMT_DOUBLE; +} +{KEYWORD} { + yyextra->type = LMT_SYMBOL; + yyextra->data.symbol = bgLex_textToSymbol(yytext); + yyextra->column += strlen(yytext); + return LMT_SYMBOL; +} +"{"" "+{INT}" "+{INT}" "+{INT}" "+"}" { + double a, b, c; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf }", &a, &b, &c); + yyextra->data.vector3[0] = a; + yyextra->data.vector3[1] = b; + yyextra->data.vector3[2] = c; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR3; + return LMT_VECTOR3; +} + +"{"" "+{INT}" "+{INT}" "+{DOUBLE}" "+"}" { + double a, b, c; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf }", &a, &b, &c); + yyextra->data.vector3[0] = a; + yyextra->data.vector3[1] = b; + yyextra->data.vector3[2] = c; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR3; + return LMT_VECTOR3; +} +"{"" "+{INT}" "+{DOUBLE}" "+{INT}" "+"}" { + double a, b, c; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf }", &a, &b, &c); + yyextra->data.vector3[0] = a; + yyextra->data.vector3[1] = b; + yyextra->data.vector3[2] = c; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR3; + return LMT_VECTOR3; +} +"{"" "+{INT}" "+{DOUBLE}" "+{DOUBLE}" "+"}" { + double a, b, c; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf }", &a, &b, &c); + yyextra->data.vector3[0] = a; + yyextra->data.vector3[1] = b; + yyextra->data.vector3[2] = c; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR3; + return LMT_VECTOR3; +} +"{"" "+{DOUBLE}" "+{INT}" "+{INT}" "+"}" { + double a, b, c; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf }", &a, &b, &c); + yyextra->data.vector3[0] = a; + yyextra->data.vector3[1] = b; + yyextra->data.vector3[2] = c; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR3; + return LMT_VECTOR3; +} +"{"" "+{DOUBLE}" "+{INT}" "+{DOUBLE}" "+"}" { + double a, b, c; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf }", &a, &b, &c); + yyextra->data.vector3[0] = a; + yyextra->data.vector3[1] = b; + yyextra->data.vector3[2] = c; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR3; + return LMT_VECTOR3; +} +"{"" "+{DOUBLE}" "+{DOUBLE}" "+{INT}" "+"}" { + double a, b, c; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf }", &a, &b, &c); + yyextra->data.vector3[0] = a; + yyextra->data.vector3[1] = b; + yyextra->data.vector3[2] = c; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR3; + return LMT_VECTOR3; +} +"{"" "+{DOUBLE}" "+{DOUBLE}" "+{DOUBLE}" "+"}" { + double a, b, c; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf }", &a, &b, &c); + yyextra->data.vector3[0] = a; + yyextra->data.vector3[1] = b; + yyextra->data.vector3[2] = c; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR3; + return LMT_VECTOR3; +} +"{"" "+{INT}" "*","" "+{INT}" "*","" "+{INT}" "+"}" { + double a, b, c; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf }", &a, &b, &c); + yyextra->data.vector3[0] = a; + yyextra->data.vector3[1] = b; + yyextra->data.vector3[2] = c; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR3; + return LMT_VECTOR3; +} + +"{"" "+{INT}" "*","" "+{INT}" "*","" "+{DOUBLE}" "+"}" { + double a, b, c; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf }", &a, &b, &c); + yyextra->data.vector3[0] = a; + yyextra->data.vector3[1] = b; + yyextra->data.vector3[2] = c; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR3; + return LMT_VECTOR3; +} +"{"" "+{INT}" "*","" "+{DOUBLE}" "*","" "+{INT}" "+"}" { + double a, b, c; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf }", &a, &b, &c); + yyextra->data.vector3[0] = a; + yyextra->data.vector3[1] = b; + yyextra->data.vector3[2] = c; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR3; + return LMT_VECTOR3; +} +"{"" "+{INT}" "*","" "+{DOUBLE}" "*","" "+{DOUBLE}" "+"}" { + double a, b, c; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf }", &a, &b, &c); + yyextra->data.vector3[0] = a; + yyextra->data.vector3[1] = b; + yyextra->data.vector3[2] = c; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR3; + return LMT_VECTOR3; +} +"{"" "+{DOUBLE}" "*","" "+{INT}" "*","" "+{INT}" "+"}" { + double a, b, c; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf }", &a, &b, &c); + yyextra->data.vector3[0] = a; + yyextra->data.vector3[1] = b; + yyextra->data.vector3[2] = c; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR3; + return LMT_VECTOR3; +} +"{"" "+{DOUBLE}" "*","" "+{INT}" "*","" "+{DOUBLE}" "+"}" { + double a, b, c; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf }", &a, &b, &c); + yyextra->data.vector3[0] = a; + yyextra->data.vector3[1] = b; + yyextra->data.vector3[2] = c; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR3; + return LMT_VECTOR3; +} +"{"" "+{DOUBLE}" "*","" "+{DOUBLE}" "*","" "+{INT}" "+"}" { + double a, b, c; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf }", &a, &b, &c); + yyextra->data.vector3[0] = a; + yyextra->data.vector3[1] = b; + yyextra->data.vector3[2] = c; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR3; + return LMT_VECTOR3; +} +"{"" "+{DOUBLE}" "*","" "+{DOUBLE}" "*","" "+{DOUBLE}" "+"}" { + double a, b, c; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf }", &a, &b, &c); + yyextra->data.vector3[0] = a; + yyextra->data.vector3[1] = b; + yyextra->data.vector3[2] = c; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR3; + return LMT_VECTOR3; +} +"{"" "+{INT}" "+{INT}" "+{INT}" "+{INT}" "+"}" { + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} +"{"" "+{INT}" "+{INT}" "+{INT}" "+{DOUBLE}" "+"}" { + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} +"{"" "+{INT}" "+{INT}" "+{DOUBLE}" "+{INT}" "+"}" { + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} +"{"" "+{INT}" "+{INT}" "+{DOUBLE}" "+{DOUBLE}" "+"}" { + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} +"{"" "+{INT}" "+{DOUBLE}" "+{INT}" "+{INT}" "+"}" { + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} +"{"" "+{INT}" "+{DOUBLE}" "+{INT}" "+{DOUBLE}" "+"}" { + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} +"{"" "+{INT}" "+{DOUBLE}" "+{DOUBLE}" "+{INT}" "+"}" { + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} +"{"" "+{INT}" "+{DOUBLE}" "+{DOUBLE}" "+{DOUBLE}" "+"}" { + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} +"{"" "+{DOUBLE}" "+{INT}" "+{INT}" "+{INT}" "+"}" { + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} +"{"" "+{DOUBLE}" "+{INT}" "+{INT}" "+{DOUBLE}" "+"}" { + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} +"{"" "+{DOUBLE}" "+{INT}" "+{DOUBLE}" "+{INT}" "+"}" { + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} +"{"" "+{DOUBLE}" "+{INT}" "+{DOUBLE}" "+{DOUBLE}" "+"}" { + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} +"{"" "+{DOUBLE}" "+{DOUBLE}" "+{INT}" "+{INT}" "+"}" { + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} +"{"" "+{DOUBLE}" "+{DOUBLE}" "+{INT}" "+{DOUBLE}" "+"}" { + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} +"{"" "+{DOUBLE}" "+{DOUBLE}" "+{DOUBLE}" "+{INT}" "+"}" { + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} +"{"" "+{DOUBLE}" "+{DOUBLE}" "+{DOUBLE}" "+{DOUBLE}" "+"}" { + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} +"{"" "+{INT}" "*","" "+{INT}" "*","" "+{INT}" "*","" "+{INT}" "+"}" { + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} +"{"" "+{INT}" "*","" "+{INT}" "*","" "+{INT}" "*","" "+{DOUBLE}" "+"}" { + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} +"{"" "+{INT}" "*","" "+{INT}" "*","" "+{DOUBLE}" "*","" "+{INT}" "+"}" { + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} +"{"" "+{INT}" "*","" "+{INT}" "*","" "+{DOUBLE}" "*","" "+{DOUBLE}" "+"}" { + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} +"{"" "+{INT}" "*","" "+{DOUBLE}" "*","" "+{INT}" "*","" "+{INT}" "+"}" { + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} +"{"" "+{INT}" "*","" "+{DOUBLE}" "*","" "+{INT}" "*","" "+{DOUBLE}" "+"}" { + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} +"{"" "+{INT}" "*","" "+{DOUBLE}" "*","" "+{DOUBLE}" "*","" "+{INT}" "+"}" { + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} +"{"" "+{INT}" "*","" "+{DOUBLE}" "*","" "+{DOUBLE}" "*","" "+{DOUBLE}" "+"}" { + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} +"{"" "+{DOUBLE}" "*","" "+{INT}" "*","" "+{INT}" "*","" "+{INT}" "+"}" { + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} +"{"" "+{DOUBLE}" "*","" "+{INT}" "*","" "+{INT}" "*","" "+{DOUBLE}" "+"}" { + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} +"{"" "+{DOUBLE}" "*","" "+{INT}" "*","" "+{DOUBLE}" "*","" "+{INT}" "+"}" { + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} +"{"" "+{DOUBLE}" "*","" "+{INT}" "*","" "+{DOUBLE}" "*","" "+{DOUBLE}" "+"}" { + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} +"{"" "+{DOUBLE}" "*","" "+{DOUBLE}" "*","" "+{INT}" "*","" "+{INT}" "+"}" { + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} +"{"" "+{DOUBLE}" "*","" "+{DOUBLE}" "*","" "+{INT}" "*","" "+{DOUBLE}" "+"}" { + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} +"{"" "+{DOUBLE}" "*","" "+{DOUBLE}" "*","" "+{DOUBLE}" "*","" "+{INT}" "+"}" { + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} +"{"" "+{DOUBLE}" "*","" "+{DOUBLE}" "*","" "+{DOUBLE}" "*","" "+{DOUBLE}" "+"}" { + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} +"{" { + yyextra->type = LMT_SYMBOL; + yyextra->data.symbol = LSYM_OBRACEC; + yyextra->column++; + return LMT_SYMBOL; +} +"}" { + yyextra->type = LMT_SYMBOL; + yyextra->data.symbol = LSYM_CBRACEC; + yyextra->column++; + return LMT_SYMBOL; +} +"(" { + yyextra->type = LMT_SYMBOL; + yyextra->data.symbol = LSYM_OBRACE; + yyextra->column++; + return LMT_SYMBOL; +} +")" { + yyextra->type = LMT_SYMBOL; + yyextra->data.symbol = LSYM_CBRACE; + yyextra->column++; + return LMT_SYMBOL; +} +"[" { + yyextra->type = LMT_SYMBOL; + yyextra->data.symbol = LSYM_OBRACESQ; + yyextra->column++; + return LMT_SYMBOL; +} +"]" { + yyextra->type = LMT_SYMBOL; + yyextra->data.symbol = LSYM_CBRACESQ; + yyextra->column++; + return LMT_SYMBOL; +} +";" { + yyextra->type = LMT_SYMBOL; + yyextra->data.symbol = LSYM_SEMICOLON; + yyextra->column++; + return LMT_SYMBOL; +} +"\." { + yyextra->type = LMT_SYMBOL; + yyextra->data.symbol = LSYM_POINT; + yyextra->column += 1; + return LMT_SYMBOL; +} +[ \t] { + yyextra->column++; + yyextra->type = LMT_IGNORE; + return LMT_IGNORE; +} +\n { + yyextra->line++; + yyextra->column = 0; + yyextra->type = LMT_IGNORE; + return LMT_IGNORE; +} +<> { + yyextra->type = LMT_EOF; + return LMT_EOF; +} +. { + yyextra->column++; + yyextra->type = LMT_IGNORE; + return LMT_IGNORE; +} +%% + +#ifdef LEX_TEXT +int main(int argc, char* argv[]) { + char buff[4096]; + yyscan_t scanner; + FILE* f; + bgLex* lex; + + f = fopen("test.txt", "r"); + fread(buff, 4096, 1, f); + fclose(f); + + lex = bgLex_create(buff); + while(bgLex_lex(lex)) { + printf("type=%i symbol=%i yytext=%s\n", lex->morphem.type, lex->morphem.data.symbol, yyget_text(lex->lex)); + } + bgLex_destroy(lex); + + return EXIT_SUCCESS; +} +#endif + +bgLex* bgLex_create(char* data) { + bgLex* l = malloc(sizeof(bgLex)); + + /* HACK: prevent compiler warnings */ + UNUSED(yyunput); + UNUSED(input); + + if(l != NULL) { + l->morphem.line = 0; + l->morphem.column = 0; + + yylex_init_extra(&l->morphem, &l->lex); + l->buf = yy_scan_string(data,l->lex); + } + + return l; +} + +void bgLex_destroy(bgLex* lex) { + if(lex == NULL) { + return; + } + + if(lex->buf != NULL) { + yy_delete_buffer(lex->buf, lex->lex); + } + + if(lex->lex != NULL) { + yylex_destroy(lex->lex); + } + + free(lex); +} + +int bgLex_lex(bgLex* lex) { + int res; + + /* skip LMT_IGNORE */ + while(1) { + res = yylex(lex->lex); + if(lex->morphem.type != LMT_IGNORE) { + break; + } + } + + return res; +} + +bgLexSymbol bgLex_textToSymbol(char* text) { + if(strcmp("ServerChangeConfig", text) == 0) { + return LSYM_SERVER_CHANGE_CONFIG; + } + + if(strcmp("Server", text) == 0) { + return LSYM_SERVER; + } + + if(strcmp("HolodeckData", text) == 0) { + return LSYM_HOLODECK_DATA; + } + + if(strcmp("Program", text) == 0) { + return LSYM_PROGRAM; + } + + if(strcmp("MapChangeConfig", text) == 0) { + return LSYM_MAP_CHANGE_CONFIG; + } + + if(strcmp("Map", text) == 0) { + return LSYM_MAP; + } + + if(strcmp("LocationsList2", text) == 0) { + return LSYM_LOCATIONS_LIST_2; + } + + if(strcmp("LocationsList", text) == 0) { + return LSYM_LOCATIONS_LIST; + } + + if(strcmp("message", text) == 0) { + return LSYM_MESSAGE; + } + + if(strcmp("consoleName", text) == 0) { + return LSYM_CONSOLE_NAME; + } + + if(strcmp("formalName", text) == 0) { + return LSYM_FORMAL_NAME; + } + + if(strcmp("radarColor", text) == 0) { + return LSYM_RADAR_COLOR; + } + + if(strcmp("iconColor", text) == 0) { + return LSYM_ICON_COLOR; + } + + if(strcmp("NULL", text) == 0) { + return LSYM_NULL; + } + + if(strcmp("modelSkin", text) == 0) { + return LSYM_MODEL_SKIN; + } + + if(strcmp("weapons", text) == 0) { + return LSYM_WEAPONS; + } + + if(strcmp("hasRanks", text) == 0) { + return LSYM_HAS_RANKS; + } + + if(strcmp("teal", text) == 0) { + return LSYM_TEAL; + } + + if(strcmp("medical", text) == 0) { + return LSYM_MEDICAL; + } + + if(strcmp("gold", text) == 0) { + return LSYM_GOLD; + } + + if(strcmp("green", text) == 0) { + return LSYM_GREEN; + } + + if(strcmp("marine", text) == 0) { + return LSYM_MARINE; + } + + if(strcmp("red", text) == 0) { + return LSYM_RED; + } + + if(strcmp("WP_TRICORDER", text) == 0) { + return LSYM_WP_TRICORDER; + } + + if(strcmp("WP_PADD", text) == 0) { + return LSYM_WP_PADD; + } + + if(strcmp("WP_COFFEE", text) == 0) { + return LSYM_WP_COFFEE; + } + + if(strcmp("WP_PHASER", text) == 0) { + return LSYM_WP_PHASER; + } + + if(strcmp("WP_COMPRESSION_RIFLE", text) == 0) { + return LSYM_WP_COMPRESSION_RIFLE; + } + + if(strcmp("WP_TR116", text) == 0) { + return LSYM_WP_TR116; + } + + if(strcmp("WP_GRENADE_LAUNCHER", text) == 0) { + return LSYM_WP_GRENADE_LAUNCHER; + } + + if(strcmp("WP_QUANTUM_BURST", text) == 0) { + return LSYM_WP_QUANTUM_BURST; + } + + if(strcmp("WP_MEDKIT", text) == 0) { + return LSYM_WP_MEDKIT; + } + + if(strcmp("WP_VOYAGER_HYPO", text) == 0) { + return LSYM_WP_VOYAGER_HYPO; + } + + if(strcmp("WP_DERMAL_REGEN", text) == 0) { + return LSYM_WP_DERMAL_REGEN; + } + + if(strcmp("WP_TOOLKIT", text) == 0) { + return LSYM_WP_TOOLKIT; + } + + if(strcmp("WP_HYPERSPANNER", text) == 0) { + return LSYM_WP_HYPERSPANNER; + } + + if(strcmp("WP_DISRUPTOR", text) == 0) { + return LSYM_WP_DISRUPTOR; + } + + if(strcmp("WP_NULL", text) == 0) { + return LSYM_WP_NULL; + } + + if(strcmp("WP_NULL_HANDS", text) == 0) { + return LSYM_WP_NULL_HANDS; + } + + if(strcmp("WP_0", text) == 0) { + return LSYM_WP_0; + } + + if(strcmp("WP_1", text) == 0) { + return LSYM_WP_1; + } + + if(strcmp("WP_2", text) == 0) { + return LSYM_WP_2; + } + + if(strcmp("WP_3", text) == 0) { + return LSYM_WP_3; + } + + if(strcmp("WP_4", text) == 0) { + return LSYM_WP_4; + } + + if(strcmp("WP_5", text) == 0) { + return LSYM_WP_5; + } + + if(strcmp("WP_6", text) == 0) { + return LSYM_WP_6; + } + + if(strcmp("WP_7", text) == 0) { + return LSYM_WP_7; + } + + if(strcmp("WP_8", text) == 0) { + return LSYM_WP_8; + } + + if(strcmp("WP_9", text) == 0) { + return LSYM_WP_9; + } + + if(strcmp("WP_10", text) == 0) { + return LSYM_WP_10; + } + + if(strcmp("WP_11", text) == 0) { + return LSYM_WP_11; + } + + if(strcmp("WP_12", text) == 0) { + return LSYM_WP_12; + } + + if(strcmp("WP_13", text) == 0) { + return LSYM_WP_13; + } + + if(strcmp("WP_14", text) == 0) { + return LSYM_WP_14; + } + + if(strcmp("WP_15", text) == 0) { + return LSYM_WP_15; + } + + if(strcmp("admin", text) == 0) { + return LSYM_ADMIN; + } + + if(strcmp("borg", text) == 0) { + return LSYM_BORG; + } + + if(strcmp("n00b", text) == 0) { + return LSYM_N00B; + } + + if(strcmp("noShow", text) == 0) { + return LSYM_NO_SHOW; + } + + if(strcmp("MenuTextureDef", text) == 0) { + return LSYM_MENU_TEXTURE_DEF; + } + + if(strcmp("ConsoleName", text) == 0) { + return LSYM_CONSOLE_NAME; + } + + if(strcmp("FormalName", text) == 0) { + return LSYM_FORMAL_NAME; + } + + if(strcmp("MenuTextureRed", text) == 0) { + return LSYM_MENU_TEXTURE_RED; + } + + if(strcmp("MenuTextureTeal", text) == 0) { + return LSYM_MENU_TEXTURE_TEAL; + } + + if(strcmp("MenuTextureGold", text) == 0) { + return LSYM_MENU_TEXTURE_GOLD; + } + + if(strcmp("MenuTextureGreen", text) == 0) { + return LSYM_MENU_TEXTURE_GREEN; + } + + if(strcmp("BoltModel", text) == 0) { + return LSYM_BOLT_MODEL; + } + + if(strcmp("BoltShader", text) == 0) { + return LSYM_BOLT_SHADER; + } + + if(strcmp("AdmiralRank", text) == 0) { + return LSYM_ADMIRAL_RANK; + } + + if(strcmp("true", text) == 0) { + return LSYM_TRUE; + } + + if(strcmp("false", text) == 0) { + return LSYM_FALSE; + } + + if(strcmp("phaser", text) == 0) { + return LSYM_WCONF_PHASER; + } + + if(strcmp("crifle", text) == 0) { + return LSYM_WCONF_CRIFLE; + } + + if(strcmp("disruptor", text) == 0) { + return LSYM_WCONF_DISRUPTOR; + } + + if(strcmp("grenade", text) == 0) { + return LSYM_WCONF_GRENADE; + } + + if(strcmp("tr116", text) == 0) { + return LSYM_WCONF_TR116; + } + + if(strcmp("quantum", text) == 0) { + return LSYM_WCONF_QUANTUM; + } + + if(strcmp("hyperspanner", text) == 0) { + return LSYM_WCONF_HYPERSPANNER; + } + + if(strcmp("damage", text) == 0) { + return LSYM_WCONF_DAMAGE; + } + + if(strcmp("range", text) == 0) { + return LSYM_WCONF_RANGE; + } + + if(strcmp("variation", text) == 0) { + return LSYM_WCONF_VARIATION; + } + + if(strcmp("radius", text) == 0) { + return LSYM_WCONF_RADIUS; + } + + return LSYM_UNKNOWN; +} + +void bgLexFatalError(const char* msg, void* lex) { + Com_Printf("LEXER ERROR: %s\n", msg); +} + diff --git a/code/game/bg_lex.yy.c b/code/game/bg_lex.yy.c index bdd1ada..c7b10f3 100644 --- a/code/game/bg_lex.yy.c +++ b/code/game/bg_lex.yy.c @@ -1,10 +1,10 @@ #line 2 "code/game/bg_lex.yy.c" #line 2 "code/game/bg_lex.lex" -#include "q_shared.h" -#include "bg_lex.h" - -#define YY_FATAL_ERROR(msg) bgLexFatalError(msg, yyscanner) -#define UNUSED(x) ((void)(x)) +#include "q_shared.h" +#include "bg_lex.h" + +#define YY_FATAL_ERROR(msg) bgLexFatalError(msg, yyscanner) +#define UNUSED(x) ((void)(x)) @@ -366,8 +366,8 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 63 -#define YY_END_OF_BUFFER 64 +#define YY_NUM_RULES 64 +#define YY_END_OF_BUFFER 65 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -375,42 +375,42 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[307] = +static yyconst flex_int16_t yy_accept[308] = { 0, - 0, 0, 64, 62, 60, 61, 62, 55, 56, 62, - 2, 59, 4, 57, 58, 53, 54, 0, 1, 2, - 3, 2, 4, 4, 0, 3, 0, 0, 0, 0, + 0, 0, 65, 63, 61, 62, 63, 55, 56, 63, + 60, 2, 59, 4, 57, 58, 53, 54, 0, 1, + 2, 3, 2, 4, 4, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 6, 0, 0, 7, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, - 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 8, 13, 0, 0, 0, + 0, 0, 6, 0, 0, 7, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 8, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 10, 0, 0, 11, 0, 0, 0, 0, 0, 0, - 0, 0, 22, 23, 0, 0, 25, 0, 0, 0, - 0, 0, 0, 0, 14, 0, 15, 0, 0, 0, - 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 12, 17, 0, 0, 0, 0, 0, 0, - - 0, 0, 24, 26, 27, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 16, 0, 30, 31, 0, 0, - 33, 0, 0, 0, 0, 0, 0, 0, 18, 0, - 19, 0, 0, 0, 0, 28, 37, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 32, 34, 35, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, - 0, 38, 39, 0, 0, 41, 0, 0, 0, 0, - 0, 36, 45, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 40, 42, 43, 0, 0, 46, 47, - 0, 0, 49, 0, 0, 0, 0, 0, 44, 48, - - 50, 51, 0, 0, 52, 0 + 0, 10, 0, 0, 11, 0, 0, 0, 0, 0, + 0, 0, 0, 22, 23, 0, 0, 25, 0, 0, + 0, 0, 0, 0, 0, 14, 0, 15, 0, 0, + 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 12, 17, 0, 0, 0, 0, 0, + + 0, 0, 0, 24, 26, 27, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 16, 0, 30, 31, 0, + 0, 33, 0, 0, 0, 0, 0, 0, 0, 18, + 0, 19, 0, 0, 0, 0, 28, 37, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 32, 34, + 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 20, 0, 38, 39, 0, 0, 41, 0, 0, 0, + 0, 0, 36, 45, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 40, 42, 43, 0, 0, 46, + 47, 0, 0, 49, 0, 0, 0, 0, 0, 44, + + 48, 50, 51, 0, 0, 52, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -451,246 +451,246 @@ static yyconst flex_int32_t yy_meta[18] = 1, 1, 1, 1, 1, 1, 1 } ; -static yyconst flex_int16_t yy_base[308] = +static yyconst flex_int16_t yy_base[309] = { 0, 0, 0, 364, 703, 703, 703, 358, 703, 703, 350, - 8, 703, 9, 703, 703, 355, 703, 353, 703, 13, - 346, 15, 16, 17, 27, 345, 341, 35, 43, 347, - 51, 0, 339, 59, 67, 23, 345, 0, 75, 29, - 0, 337, 83, 333, 91, 99, 331, 107, 115, 31, - 33, 337, 123, 0, 131, 45, 0, 329, 139, 147, - 46, 0, 326, 161, 169, 40, 332, 0, 323, 177, - 185, 49, 57, 329, 193, 0, 321, 201, 703, 209, - 62, 223, 63, 0, 318, 237, 245, 253, 64, 0, - 317, 267, 275, 73, 323, 0, 68, 78, 0, 315, - - 283, 703, 314, 291, 703, 299, 79, 313, 320, 327, - 0, 312, 335, 311, 343, 703, 351, 88, 365, 93, - 0, 309, 379, 387, 703, 92, 94, 96, 103, 0, - 108, 111, 0, 308, 395, 703, 703, 403, 411, 314, - 0, 425, 311, 439, 0, 112, 117, 0, 303, 447, - 703, 300, 455, 703, 463, 119, 477, 305, 491, 0, - 296, 499, 703, 703, 116, 128, 703, 137, 133, 142, - 134, 0, 295, 507, 703, 515, 703, 523, 531, 277, - 0, 703, 144, 149, 151, 158, 0, 153, 163, 0, - 252, 545, 703, 703, 553, 561, 217, 0, 575, 188, - - 589, 0, 703, 703, 703, 159, 171, 162, 173, 0, - 180, 597, 141, 605, 703, 613, 703, 703, 181, 179, - 703, 182, 189, 191, 198, 0, 125, 621, 703, 629, - 703, 637, 645, 102, 0, 703, 703, 199, 203, 202, - 206, 0, 211, 218, 0, 77, 659, 703, 703, 703, - 219, 220, 221, 226, 0, 69, 667, 53, 675, 703, - 683, 703, 703, 229, 231, 703, 235, 239, 249, 240, - 0, 703, 703, 251, 254, 255, 256, 0, 257, 265, - 0, 47, 691, 703, 703, 703, 271, 269, 703, 703, - 279, 278, 703, 281, 286, 287, 288, 0, 703, 703, - - 703, 703, 296, 301, 703, 703, 20 + 703, 8, 703, 9, 703, 703, 355, 703, 353, 703, + 13, 346, 15, 16, 17, 27, 345, 341, 35, 43, + 347, 51, 0, 339, 59, 67, 23, 345, 0, 75, + 29, 0, 337, 83, 333, 91, 99, 331, 107, 115, + 31, 33, 337, 123, 0, 131, 45, 0, 329, 139, + 147, 46, 0, 326, 161, 169, 40, 332, 0, 323, + 177, 185, 49, 57, 329, 193, 0, 321, 201, 703, + 209, 62, 223, 63, 0, 318, 237, 245, 253, 64, + 0, 317, 267, 275, 73, 323, 0, 68, 78, 0, + + 315, 283, 703, 314, 291, 703, 299, 79, 313, 320, + 327, 0, 312, 335, 311, 343, 703, 351, 88, 365, + 93, 0, 309, 379, 387, 703, 92, 94, 96, 103, + 0, 108, 111, 0, 308, 395, 703, 703, 403, 411, + 314, 0, 425, 311, 439, 0, 112, 117, 0, 303, + 447, 703, 300, 455, 703, 463, 119, 477, 305, 491, + 0, 296, 499, 703, 703, 116, 128, 703, 137, 133, + 142, 134, 0, 295, 507, 703, 515, 703, 523, 531, + 277, 0, 703, 144, 149, 151, 158, 0, 153, 163, + 0, 252, 545, 703, 703, 553, 561, 217, 0, 575, + + 188, 589, 0, 703, 703, 703, 159, 171, 162, 173, + 0, 180, 597, 141, 605, 703, 613, 703, 703, 181, + 179, 703, 182, 189, 191, 198, 0, 125, 621, 703, + 629, 703, 637, 645, 102, 0, 703, 703, 199, 203, + 202, 206, 0, 211, 218, 0, 77, 659, 703, 703, + 703, 219, 220, 221, 226, 0, 69, 667, 53, 675, + 703, 683, 703, 703, 229, 231, 703, 235, 239, 249, + 240, 0, 703, 703, 251, 254, 255, 256, 0, 257, + 265, 0, 47, 691, 703, 703, 703, 271, 269, 703, + 703, 279, 278, 703, 281, 286, 287, 288, 0, 703, + + 703, 703, 703, 296, 301, 703, 703, 20 } ; -static yyconst flex_int16_t yy_def[308] = +static yyconst flex_int16_t yy_def[309] = { 0, - 306, 1, 306, 306, 306, 306, 307, 306, 306, 306, - 306, 306, 306, 306, 306, 306, 306, 307, 306, 306, - 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, - 306, 28, 306, 306, 306, 31, 306, 31, 306, 306, - 34, 306, 306, 306, 306, 306, 306, 306, 306, 306, - 306, 306, 306, 43, 306, 306, 45, 306, 306, 306, - 306, 48, 306, 306, 306, 306, 306, 53, 306, 306, - 306, 306, 306, 306, 306, 59, 306, 306, 306, 306, - 306, 306, 306, 64, 306, 306, 306, 306, 306, 70, - 306, 306, 306, 306, 306, 75, 306, 306, 78, 306, - - 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, - 86, 306, 306, 306, 306, 306, 306, 306, 306, 306, - 92, 306, 306, 306, 306, 306, 306, 306, 306, 101, - 306, 306, 104, 306, 306, 306, 306, 306, 306, 306, - 110, 306, 306, 306, 113, 306, 306, 115, 306, 306, - 306, 306, 306, 306, 306, 306, 306, 306, 306, 123, - 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, - 306, 135, 306, 306, 306, 306, 306, 306, 306, 306, - 144, 306, 306, 306, 306, 306, 150, 306, 306, 153, - 306, 306, 306, 306, 306, 306, 306, 159, 306, 306, - - 306, 162, 306, 306, 306, 306, 306, 306, 306, 174, - 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, - 306, 306, 306, 306, 306, 192, 306, 306, 306, 306, - 306, 306, 306, 306, 201, 306, 306, 306, 306, 306, - 306, 212, 306, 306, 214, 306, 306, 306, 306, 306, - 306, 306, 306, 306, 228, 306, 306, 306, 306, 306, - 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, - 247, 306, 306, 306, 306, 306, 306, 257, 306, 306, - 259, 306, 306, 306, 306, 306, 306, 306, 306, 306, - 306, 306, 306, 306, 306, 306, 306, 283, 306, 306, - - 306, 306, 306, 306, 306, 0, 306 + 307, 1, 307, 307, 307, 307, 308, 307, 307, 307, + 307, 307, 307, 307, 307, 307, 307, 307, 308, 307, + 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, + 307, 307, 29, 307, 307, 307, 32, 307, 32, 307, + 307, 35, 307, 307, 307, 307, 307, 307, 307, 307, + 307, 307, 307, 307, 44, 307, 307, 46, 307, 307, + 307, 307, 49, 307, 307, 307, 307, 307, 54, 307, + 307, 307, 307, 307, 307, 307, 60, 307, 307, 307, + 307, 307, 307, 307, 65, 307, 307, 307, 307, 307, + 71, 307, 307, 307, 307, 307, 76, 307, 307, 79, + + 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, + 307, 87, 307, 307, 307, 307, 307, 307, 307, 307, + 307, 93, 307, 307, 307, 307, 307, 307, 307, 307, + 102, 307, 307, 105, 307, 307, 307, 307, 307, 307, + 307, 111, 307, 307, 307, 114, 307, 307, 116, 307, + 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, + 124, 307, 307, 307, 307, 307, 307, 307, 307, 307, + 307, 307, 136, 307, 307, 307, 307, 307, 307, 307, + 307, 145, 307, 307, 307, 307, 307, 151, 307, 307, + 154, 307, 307, 307, 307, 307, 307, 307, 160, 307, + + 307, 307, 163, 307, 307, 307, 307, 307, 307, 307, + 175, 307, 307, 307, 307, 307, 307, 307, 307, 307, + 307, 307, 307, 307, 307, 307, 193, 307, 307, 307, + 307, 307, 307, 307, 307, 202, 307, 307, 307, 307, + 307, 307, 213, 307, 307, 215, 307, 307, 307, 307, + 307, 307, 307, 307, 307, 229, 307, 307, 307, 307, + 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, + 307, 248, 307, 307, 307, 307, 307, 307, 258, 307, + 307, 260, 307, 307, 307, 307, 307, 307, 307, 307, + 307, 307, 307, 307, 307, 307, 307, 307, 284, 307, + + 307, 307, 307, 307, 307, 307, 0, 307 } ; static yyconst flex_int16_t yy_nxt[721] = { 0, - 4, 5, 6, 5, 7, 8, 9, 4, 10, 4, - 11, 12, 13, 14, 15, 16, 17, 21, 22, 23, - 18, 24, 21, 22, 21, 22, 23, 23, 23, 24, - 25, 44, 49, 45, 49, 27, 51, 28, 29, 50, - 52, 50, 30, 66, 31, 32, 29, 67, 71, 80, - 30, 33, 71, 34, 36, 72, 81, 283, 37, 72, - 73, 38, 39, 259, 74, 80, 106, 117, 40, 41, - 35, 97, 81, 107, 118, 42, 94, 43, 39, 257, - 95, 126, 106, 47, 125, 48, 51, 247, 127, 107, - 52, 117, 53, 54, 55, 126, 155, 126, 118, 128, - - 56, 57, 46, 156, 127, 261, 165, 58, 163, 59, - 60, 131, 164, 166, 168, 146, 61, 62, 49, 165, - 183, 169, 155, 63, 167, 64, 66, 184, 182, 156, - 67, 165, 203, 68, 55, 228, 168, 206, 166, 69, - 168, 70, 73, 169, 207, 170, 74, 183, 75, 76, - 60, 214, 183, 204, 185, 77, 188, 78, 205, 184, - 217, 219, 206, 79, 82, 208, 222, 218, 220, 221, - 83, 84, 65, 223, 206, 236, 238, 85, 237, 86, - 88, 207, 219, 239, 219, 222, 89, 90, 71, 220, - 212, 232, 222, 91, 224, 92, 94, 248, 249, 223, - - 95, 251, 238, 96, 97, 240, 238, 250, 252, 264, - 98, 99, 80, 239, 243, 262, 265, 100, 263, 101, - 230, 267, 251, 251, 253, 102, 82, 266, 268, 274, - 252, 103, 264, 104, 264, 272, 275, 273, 267, 105, - 108, 265, 267, 287, 109, 284, 110, 111, 87, 268, - 288, 285, 269, 112, 274, 113, 88, 274, 276, 291, - 279, 114, 192, 115, 275, 286, 292, 289, 294, 116, - 119, 290, 287, 293, 287, 295, 120, 121, 93, 288, - 216, 291, 291, 122, 294, 123, 128, 299, 292, 294, - 296, 303, 129, 130, 131, 300, 295, 301, 304, 303, - - 132, 133, 106, 302, 303, 174, 162, 134, 195, 135, - 153, 304, 305, 150, 178, 136, 108, 176, 135, 123, - 109, 115, 113, 138, 104, 101, 124, 92, 86, 137, - 139, 78, 93, 70, 140, 87, 64, 141, 142, 59, - 65, 48, 143, 45, 144, 145, 146, 43, 46, 34, - 35, 28, 147, 148, 117, 26, 26, 19, 25, 149, - 20, 150, 19, 306, 306, 306, 306, 151, 119, 306, - 306, 306, 306, 152, 306, 153, 306, 306, 306, 306, - 306, 154, 157, 306, 306, 306, 158, 306, 159, 160, - 124, 306, 306, 306, 306, 161, 306, 162, 170, 306, - - 306, 306, 306, 306, 171, 172, 138, 306, 306, 306, - 306, 173, 306, 174, 139, 306, 306, 306, 140, 306, - 306, 306, 306, 306, 306, 306, 306, 175, 142, 306, - 306, 306, 143, 306, 306, 306, 306, 306, 306, 306, - 306, 177, 179, 306, 306, 306, 180, 306, 306, 181, - 185, 306, 306, 306, 306, 306, 186, 187, 188, 306, - 306, 306, 306, 306, 189, 190, 155, 306, 306, 306, - 306, 191, 306, 192, 306, 306, 306, 306, 306, 193, - 157, 306, 306, 306, 158, 306, 306, 306, 306, 306, - 306, 306, 306, 194, 196, 306, 306, 306, 197, 306, - - 306, 198, 199, 306, 306, 306, 200, 306, 201, 202, - 208, 306, 306, 306, 306, 306, 209, 210, 176, 306, - 306, 306, 306, 211, 306, 212, 178, 306, 306, 306, - 306, 213, 306, 214, 179, 306, 306, 306, 180, 306, - 306, 306, 306, 306, 306, 306, 306, 215, 224, 306, - 306, 306, 306, 306, 225, 226, 195, 306, 306, 306, - 306, 227, 306, 228, 196, 306, 306, 306, 197, 306, - 306, 306, 306, 306, 306, 306, 306, 229, 199, 306, - 306, 306, 200, 306, 306, 306, 306, 306, 306, 306, - 306, 231, 233, 306, 306, 306, 234, 306, 306, 235, - - 240, 306, 306, 306, 306, 306, 241, 242, 243, 306, - 306, 306, 306, 306, 244, 245, 216, 306, 306, 306, - 306, 246, 306, 247, 253, 306, 306, 306, 306, 306, - 254, 255, 230, 306, 306, 306, 306, 256, 306, 257, - 232, 306, 306, 306, 306, 258, 306, 259, 233, 306, - 306, 306, 234, 306, 306, 306, 306, 306, 306, 306, - 306, 260, 269, 306, 306, 306, 306, 306, 270, 271, - 276, 306, 306, 306, 306, 306, 277, 278, 279, 306, - 306, 306, 306, 306, 280, 281, 261, 306, 306, 306, - 306, 282, 306, 283, 296, 306, 306, 306, 306, 306, - - 297, 298, 3, 306, 306, 306, 306, 306, 306, 306, - 306, 306, 306, 306, 306, 306, 306, 306, 306, 306 + 4, 5, 6, 5, 7, 8, 9, 4, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 22, 23, 24, + 19, 25, 22, 23, 22, 23, 24, 24, 24, 25, + 26, 45, 50, 46, 50, 28, 52, 29, 30, 51, + 53, 51, 31, 67, 32, 33, 30, 68, 72, 81, + 31, 34, 72, 35, 37, 73, 82, 284, 38, 73, + 74, 39, 40, 260, 75, 81, 107, 118, 41, 42, + 36, 98, 82, 108, 119, 43, 95, 44, 40, 258, + 96, 127, 107, 48, 126, 49, 52, 248, 128, 108, + 53, 118, 54, 55, 56, 127, 156, 127, 119, 129, + + 57, 58, 47, 157, 128, 262, 166, 59, 164, 60, + 61, 132, 165, 167, 169, 147, 62, 63, 50, 166, + 184, 170, 156, 64, 168, 65, 67, 185, 183, 157, + 68, 166, 204, 69, 56, 229, 169, 207, 167, 70, + 169, 71, 74, 170, 208, 171, 75, 184, 76, 77, + 61, 215, 184, 205, 186, 78, 189, 79, 206, 185, + 218, 220, 207, 80, 83, 209, 223, 219, 221, 222, + 84, 85, 66, 224, 207, 237, 239, 86, 238, 87, + 89, 208, 220, 240, 220, 223, 90, 91, 72, 221, + 213, 233, 223, 92, 225, 93, 95, 249, 250, 224, + + 96, 252, 239, 97, 98, 241, 239, 251, 253, 265, + 99, 100, 81, 240, 244, 263, 266, 101, 264, 102, + 231, 268, 252, 252, 254, 103, 83, 267, 269, 275, + 253, 104, 265, 105, 265, 273, 276, 274, 268, 106, + 109, 266, 268, 288, 110, 285, 111, 112, 88, 269, + 289, 286, 270, 113, 275, 114, 89, 275, 277, 292, + 280, 115, 193, 116, 276, 287, 293, 290, 295, 117, + 120, 291, 288, 294, 288, 296, 121, 122, 94, 289, + 217, 292, 292, 123, 295, 124, 129, 300, 293, 295, + 297, 304, 130, 131, 132, 301, 296, 302, 305, 304, + + 133, 134, 107, 303, 304, 175, 163, 135, 196, 136, + 154, 305, 306, 151, 179, 137, 109, 177, 136, 124, + 110, 116, 114, 139, 105, 102, 125, 93, 87, 138, + 140, 79, 94, 71, 141, 88, 65, 142, 143, 60, + 66, 49, 144, 46, 145, 146, 147, 44, 47, 35, + 36, 29, 148, 149, 118, 27, 27, 20, 26, 150, + 21, 151, 20, 307, 307, 307, 307, 152, 120, 307, + 307, 307, 307, 153, 307, 154, 307, 307, 307, 307, + 307, 155, 158, 307, 307, 307, 159, 307, 160, 161, + 125, 307, 307, 307, 307, 162, 307, 163, 171, 307, + + 307, 307, 307, 307, 172, 173, 139, 307, 307, 307, + 307, 174, 307, 175, 140, 307, 307, 307, 141, 307, + 307, 307, 307, 307, 307, 307, 307, 176, 143, 307, + 307, 307, 144, 307, 307, 307, 307, 307, 307, 307, + 307, 178, 180, 307, 307, 307, 181, 307, 307, 182, + 186, 307, 307, 307, 307, 307, 187, 188, 189, 307, + 307, 307, 307, 307, 190, 191, 156, 307, 307, 307, + 307, 192, 307, 193, 307, 307, 307, 307, 307, 194, + 158, 307, 307, 307, 159, 307, 307, 307, 307, 307, + 307, 307, 307, 195, 197, 307, 307, 307, 198, 307, + + 307, 199, 200, 307, 307, 307, 201, 307, 202, 203, + 209, 307, 307, 307, 307, 307, 210, 211, 177, 307, + 307, 307, 307, 212, 307, 213, 179, 307, 307, 307, + 307, 214, 307, 215, 180, 307, 307, 307, 181, 307, + 307, 307, 307, 307, 307, 307, 307, 216, 225, 307, + 307, 307, 307, 307, 226, 227, 196, 307, 307, 307, + 307, 228, 307, 229, 197, 307, 307, 307, 198, 307, + 307, 307, 307, 307, 307, 307, 307, 230, 200, 307, + 307, 307, 201, 307, 307, 307, 307, 307, 307, 307, + 307, 232, 234, 307, 307, 307, 235, 307, 307, 236, + + 241, 307, 307, 307, 307, 307, 242, 243, 244, 307, + 307, 307, 307, 307, 245, 246, 217, 307, 307, 307, + 307, 247, 307, 248, 254, 307, 307, 307, 307, 307, + 255, 256, 231, 307, 307, 307, 307, 257, 307, 258, + 233, 307, 307, 307, 307, 259, 307, 260, 234, 307, + 307, 307, 235, 307, 307, 307, 307, 307, 307, 307, + 307, 261, 270, 307, 307, 307, 307, 307, 271, 272, + 277, 307, 307, 307, 307, 307, 278, 279, 280, 307, + 307, 307, 307, 307, 281, 282, 262, 307, 307, 307, + 307, 283, 307, 284, 297, 307, 307, 307, 307, 307, + + 298, 299, 3, 307, 307, 307, 307, 307, 307, 307, + 307, 307, 307, 307, 307, 307, 307, 307, 307, 307 } ; static yyconst flex_int16_t yy_chk[721] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 11, 11, 13, - 307, 13, 20, 20, 22, 22, 23, 24, 23, 24, - 25, 36, 40, 36, 50, 25, 51, 25, 28, 40, - 51, 50, 28, 66, 28, 28, 29, 66, 56, 61, - 29, 29, 72, 29, 31, 56, 61, 282, 31, 72, - 73, 31, 34, 258, 73, 81, 83, 89, 34, 34, - 35, 97, 81, 83, 89, 35, 94, 35, 39, 256, - 94, 98, 107, 39, 97, 39, 43, 246, 98, 107, - 43, 118, 43, 43, 45, 126, 120, 127, 118, 128, - - 45, 45, 46, 120, 127, 234, 129, 46, 126, 46, - 48, 131, 128, 129, 132, 146, 48, 48, 49, 165, - 147, 132, 156, 49, 131, 49, 53, 147, 146, 156, - 53, 166, 165, 53, 55, 227, 169, 171, 166, 55, - 168, 55, 59, 169, 171, 170, 59, 183, 59, 59, - 60, 213, 184, 168, 185, 60, 188, 60, 170, 184, - 183, 186, 206, 60, 64, 208, 189, 185, 186, 188, - 64, 64, 65, 189, 207, 206, 209, 65, 208, 65, - 70, 207, 220, 209, 219, 222, 70, 70, 71, 220, - 211, 200, 223, 71, 224, 71, 75, 219, 222, 223, - - 75, 225, 238, 75, 78, 240, 239, 224, 225, 241, - 78, 78, 80, 239, 243, 238, 241, 80, 240, 80, - 197, 244, 251, 252, 253, 80, 82, 243, 244, 254, - 252, 82, 264, 82, 265, 251, 254, 253, 267, 82, - 86, 265, 268, 270, 86, 264, 86, 86, 87, 268, - 270, 267, 269, 87, 274, 87, 88, 275, 276, 277, - 279, 88, 191, 88, 275, 269, 277, 274, 280, 88, - 92, 276, 288, 279, 287, 280, 92, 92, 93, 288, - 180, 292, 291, 93, 294, 93, 101, 287, 292, 295, - 296, 297, 101, 101, 104, 291, 295, 294, 297, 303, - - 104, 104, 106, 296, 304, 173, 161, 106, 158, 106, - 152, 304, 303, 149, 143, 106, 108, 140, 134, 122, - 108, 114, 112, 109, 103, 100, 95, 91, 85, 108, - 110, 77, 74, 69, 110, 67, 63, 110, 113, 58, - 52, 47, 113, 44, 113, 113, 115, 42, 37, 33, - 30, 27, 115, 115, 117, 26, 21, 18, 16, 117, - 10, 117, 7, 3, 0, 0, 0, 117, 119, 0, - 0, 0, 0, 119, 0, 119, 0, 0, 0, 0, - 0, 119, 123, 0, 0, 0, 123, 0, 123, 123, - 124, 0, 0, 0, 0, 124, 0, 124, 135, 0, - - 0, 0, 0, 0, 135, 135, 138, 0, 0, 0, - 0, 138, 0, 138, 139, 0, 0, 0, 139, 0, - 0, 0, 0, 0, 0, 0, 0, 139, 142, 0, - 0, 0, 142, 0, 0, 0, 0, 0, 0, 0, - 0, 142, 144, 0, 0, 0, 144, 0, 0, 144, - 150, 0, 0, 0, 0, 0, 150, 150, 153, 0, - 0, 0, 0, 0, 153, 153, 155, 0, 0, 0, - 0, 155, 0, 155, 0, 0, 0, 0, 0, 155, - 157, 0, 0, 0, 157, 0, 0, 0, 0, 0, - 0, 0, 0, 157, 159, 0, 0, 0, 159, 0, - - 0, 159, 162, 0, 0, 0, 162, 0, 162, 162, - 174, 0, 0, 0, 0, 0, 174, 174, 176, 0, - 0, 0, 0, 176, 0, 176, 178, 0, 0, 0, - 0, 178, 0, 178, 179, 0, 0, 0, 179, 0, - 0, 0, 0, 0, 0, 0, 0, 179, 192, 0, - 0, 0, 0, 0, 192, 192, 195, 0, 0, 0, - 0, 195, 0, 195, 196, 0, 0, 0, 196, 0, - 0, 0, 0, 0, 0, 0, 0, 196, 199, 0, - 0, 0, 199, 0, 0, 0, 0, 0, 0, 0, - 0, 199, 201, 0, 0, 0, 201, 0, 0, 201, - - 212, 0, 0, 0, 0, 0, 212, 212, 214, 0, - 0, 0, 0, 0, 214, 214, 216, 0, 0, 0, - 0, 216, 0, 216, 228, 0, 0, 0, 0, 0, - 228, 228, 230, 0, 0, 0, 0, 230, 0, 230, - 232, 0, 0, 0, 0, 232, 0, 232, 233, 0, - 0, 0, 233, 0, 0, 0, 0, 0, 0, 0, - 0, 233, 247, 0, 0, 0, 0, 0, 247, 247, - 257, 0, 0, 0, 0, 0, 257, 257, 259, 0, - 0, 0, 0, 0, 259, 259, 261, 0, 0, 0, - 0, 261, 0, 261, 283, 0, 0, 0, 0, 0, - - 283, 283, 306, 306, 306, 306, 306, 306, 306, 306, - 306, 306, 306, 306, 306, 306, 306, 306, 306, 306 + 1, 1, 1, 1, 1, 1, 1, 12, 12, 14, + 308, 14, 21, 21, 23, 23, 24, 25, 24, 25, + 26, 37, 41, 37, 51, 26, 52, 26, 29, 41, + 52, 51, 29, 67, 29, 29, 30, 67, 57, 62, + 30, 30, 73, 30, 32, 57, 62, 283, 32, 73, + 74, 32, 35, 259, 74, 82, 84, 90, 35, 35, + 36, 98, 82, 84, 90, 36, 95, 36, 40, 257, + 95, 99, 108, 40, 98, 40, 44, 247, 99, 108, + 44, 119, 44, 44, 46, 127, 121, 128, 119, 129, + + 46, 46, 47, 121, 128, 235, 130, 47, 127, 47, + 49, 132, 129, 130, 133, 147, 49, 49, 50, 166, + 148, 133, 157, 50, 132, 50, 54, 148, 147, 157, + 54, 167, 166, 54, 56, 228, 170, 172, 167, 56, + 169, 56, 60, 170, 172, 171, 60, 184, 60, 60, + 61, 214, 185, 169, 186, 61, 189, 61, 171, 185, + 184, 187, 207, 61, 65, 209, 190, 186, 187, 189, + 65, 65, 66, 190, 208, 207, 210, 66, 209, 66, + 71, 208, 221, 210, 220, 223, 71, 71, 72, 221, + 212, 201, 224, 72, 225, 72, 76, 220, 223, 224, + + 76, 226, 239, 76, 79, 241, 240, 225, 226, 242, + 79, 79, 81, 240, 244, 239, 242, 81, 241, 81, + 198, 245, 252, 253, 254, 81, 83, 244, 245, 255, + 253, 83, 265, 83, 266, 252, 255, 254, 268, 83, + 87, 266, 269, 271, 87, 265, 87, 87, 88, 269, + 271, 268, 270, 88, 275, 88, 89, 276, 277, 278, + 280, 89, 192, 89, 276, 270, 278, 275, 281, 89, + 93, 277, 289, 280, 288, 281, 93, 93, 94, 289, + 181, 293, 292, 94, 295, 94, 102, 288, 293, 296, + 297, 298, 102, 102, 105, 292, 296, 295, 298, 304, + + 105, 105, 107, 297, 305, 174, 162, 107, 159, 107, + 153, 305, 304, 150, 144, 107, 109, 141, 135, 123, + 109, 115, 113, 110, 104, 101, 96, 92, 86, 109, + 111, 78, 75, 70, 111, 68, 64, 111, 114, 59, + 53, 48, 114, 45, 114, 114, 116, 43, 38, 34, + 31, 28, 116, 116, 118, 27, 22, 19, 17, 118, + 10, 118, 7, 3, 0, 0, 0, 118, 120, 0, + 0, 0, 0, 120, 0, 120, 0, 0, 0, 0, + 0, 120, 124, 0, 0, 0, 124, 0, 124, 124, + 125, 0, 0, 0, 0, 125, 0, 125, 136, 0, + + 0, 0, 0, 0, 136, 136, 139, 0, 0, 0, + 0, 139, 0, 139, 140, 0, 0, 0, 140, 0, + 0, 0, 0, 0, 0, 0, 0, 140, 143, 0, + 0, 0, 143, 0, 0, 0, 0, 0, 0, 0, + 0, 143, 145, 0, 0, 0, 145, 0, 0, 145, + 151, 0, 0, 0, 0, 0, 151, 151, 154, 0, + 0, 0, 0, 0, 154, 154, 156, 0, 0, 0, + 0, 156, 0, 156, 0, 0, 0, 0, 0, 156, + 158, 0, 0, 0, 158, 0, 0, 0, 0, 0, + 0, 0, 0, 158, 160, 0, 0, 0, 160, 0, + + 0, 160, 163, 0, 0, 0, 163, 0, 163, 163, + 175, 0, 0, 0, 0, 0, 175, 175, 177, 0, + 0, 0, 0, 177, 0, 177, 179, 0, 0, 0, + 0, 179, 0, 179, 180, 0, 0, 0, 180, 0, + 0, 0, 0, 0, 0, 0, 0, 180, 193, 0, + 0, 0, 0, 0, 193, 193, 196, 0, 0, 0, + 0, 196, 0, 196, 197, 0, 0, 0, 197, 0, + 0, 0, 0, 0, 0, 0, 0, 197, 200, 0, + 0, 0, 200, 0, 0, 0, 0, 0, 0, 0, + 0, 200, 202, 0, 0, 0, 202, 0, 0, 202, + + 213, 0, 0, 0, 0, 0, 213, 213, 215, 0, + 0, 0, 0, 0, 215, 215, 217, 0, 0, 0, + 0, 217, 0, 217, 229, 0, 0, 0, 0, 0, + 229, 229, 231, 0, 0, 0, 0, 231, 0, 231, + 233, 0, 0, 0, 0, 233, 0, 233, 234, 0, + 0, 0, 234, 0, 0, 0, 0, 0, 0, 0, + 0, 234, 248, 0, 0, 0, 0, 0, 248, 248, + 258, 0, 0, 0, 0, 0, 258, 258, 260, 0, + 0, 0, 0, 0, 260, 260, 262, 0, 0, 0, + 0, 262, 0, 262, 284, 0, 0, 0, 0, 0, + + 284, 284, 307, 307, 307, 307, 307, 307, 307, 307, + 307, 307, 307, 307, 307, 307, 307, 307, 307, 307 } ; /* The intent behind this definition is that it'll catch @@ -701,7 +701,7 @@ static yyconst flex_int16_t yy_chk[721] = #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET #line 1 "code/game/bg_lex.lex" - + #line 706 "code/game/bg_lex.yy.c" #define INITIAL 0 @@ -981,7 +981,7 @@ YY_DECL while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 307 ) + if ( yy_current_state >= 308 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1015,957 +1015,967 @@ case 1: /* rule 1 can match eol */ YY_RULE_SETUP #line 19 "code/game/bg_lex.lex" -{ - char *s = yytext; s++; - yyextra->type = LMT_STRING; - yytext[strlen(yytext)-1] = '\0'; - yyextra->data.str = yytext + 1; - yyextra->column += strlen(yytext); - return LMT_STRING; -} +{ + char *s = yytext; s++; + yyextra->type = LMT_STRING; + yytext[strlen(yytext)-1] = '\0'; + yyextra->data.str = yytext + 1; + yyextra->column += strlen(yytext); + return LMT_STRING; +} YY_BREAK case 2: YY_RULE_SETUP #line 27 "code/game/bg_lex.lex" -{ - yyextra->type = LMT_INT; - yyextra->data.numInteger = atoi(yytext); - yyextra->column += strlen(yytext); - return LMT_INT; -} +{ + yyextra->type = LMT_INT; + yyextra->data.numInteger = atoi(yytext); + yyextra->column += strlen(yytext); + return LMT_INT; +} YY_BREAK case 3: YY_RULE_SETUP #line 33 "code/game/bg_lex.lex" -{ - yyextra->type = LMT_DOUBLE; - yyextra->data.numDouble = atof(yytext); - yyextra->column += strlen(yytext); - return LMT_DOUBLE; -} +{ + yyextra->type = LMT_DOUBLE; + yyextra->data.numDouble = atof(yytext); + yyextra->column += strlen(yytext); + return LMT_DOUBLE; +} YY_BREAK case 4: YY_RULE_SETUP #line 39 "code/game/bg_lex.lex" -{ - yyextra->type = LMT_SYMBOL; - yyextra->data.symbol = bgLex_textToSymbol(yytext); - yyextra->column += strlen(yytext); - return LMT_SYMBOL; -} +{ + yyextra->type = LMT_SYMBOL; + yyextra->data.symbol = bgLex_textToSymbol(yytext); + yyextra->column += strlen(yytext); + return LMT_SYMBOL; +} YY_BREAK case 5: YY_RULE_SETUP #line 45 "code/game/bg_lex.lex" -{ - double a, b, c; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf }", &a, &b, &c); - yyextra->data.vector3[0] = a; - yyextra->data.vector3[1] = b; - yyextra->data.vector3[2] = c; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR3; - return LMT_VECTOR3; -} +{ + double a, b, c; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf }", &a, &b, &c); + yyextra->data.vector3[0] = a; + yyextra->data.vector3[1] = b; + yyextra->data.vector3[2] = c; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR3; + return LMT_VECTOR3; +} YY_BREAK case 6: YY_RULE_SETUP #line 58 "code/game/bg_lex.lex" -{ - double a, b, c; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf }", &a, &b, &c); - yyextra->data.vector3[0] = a; - yyextra->data.vector3[1] = b; - yyextra->data.vector3[2] = c; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR3; - return LMT_VECTOR3; -} +{ + double a, b, c; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf }", &a, &b, &c); + yyextra->data.vector3[0] = a; + yyextra->data.vector3[1] = b; + yyextra->data.vector3[2] = c; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR3; + return LMT_VECTOR3; +} YY_BREAK case 7: YY_RULE_SETUP #line 70 "code/game/bg_lex.lex" -{ - double a, b, c; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf }", &a, &b, &c); - yyextra->data.vector3[0] = a; - yyextra->data.vector3[1] = b; - yyextra->data.vector3[2] = c; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR3; - return LMT_VECTOR3; -} +{ + double a, b, c; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf }", &a, &b, &c); + yyextra->data.vector3[0] = a; + yyextra->data.vector3[1] = b; + yyextra->data.vector3[2] = c; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR3; + return LMT_VECTOR3; +} YY_BREAK case 8: YY_RULE_SETUP #line 82 "code/game/bg_lex.lex" -{ - double a, b, c; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf }", &a, &b, &c); - yyextra->data.vector3[0] = a; - yyextra->data.vector3[1] = b; - yyextra->data.vector3[2] = c; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR3; - return LMT_VECTOR3; -} +{ + double a, b, c; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf }", &a, &b, &c); + yyextra->data.vector3[0] = a; + yyextra->data.vector3[1] = b; + yyextra->data.vector3[2] = c; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR3; + return LMT_VECTOR3; +} YY_BREAK case 9: YY_RULE_SETUP #line 94 "code/game/bg_lex.lex" -{ - double a, b, c; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf }", &a, &b, &c); - yyextra->data.vector3[0] = a; - yyextra->data.vector3[1] = b; - yyextra->data.vector3[2] = c; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR3; - return LMT_VECTOR3; -} +{ + double a, b, c; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf }", &a, &b, &c); + yyextra->data.vector3[0] = a; + yyextra->data.vector3[1] = b; + yyextra->data.vector3[2] = c; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR3; + return LMT_VECTOR3; +} YY_BREAK case 10: YY_RULE_SETUP #line 106 "code/game/bg_lex.lex" -{ - double a, b, c; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf }", &a, &b, &c); - yyextra->data.vector3[0] = a; - yyextra->data.vector3[1] = b; - yyextra->data.vector3[2] = c; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR3; - return LMT_VECTOR3; -} +{ + double a, b, c; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf }", &a, &b, &c); + yyextra->data.vector3[0] = a; + yyextra->data.vector3[1] = b; + yyextra->data.vector3[2] = c; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR3; + return LMT_VECTOR3; +} YY_BREAK case 11: YY_RULE_SETUP #line 118 "code/game/bg_lex.lex" -{ - double a, b, c; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf }", &a, &b, &c); - yyextra->data.vector3[0] = a; - yyextra->data.vector3[1] = b; - yyextra->data.vector3[2] = c; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR3; - return LMT_VECTOR3; -} +{ + double a, b, c; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf }", &a, &b, &c); + yyextra->data.vector3[0] = a; + yyextra->data.vector3[1] = b; + yyextra->data.vector3[2] = c; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR3; + return LMT_VECTOR3; +} YY_BREAK case 12: YY_RULE_SETUP #line 130 "code/game/bg_lex.lex" -{ - double a, b, c; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf }", &a, &b, &c); - yyextra->data.vector3[0] = a; - yyextra->data.vector3[1] = b; - yyextra->data.vector3[2] = c; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR3; - return LMT_VECTOR3; -} +{ + double a, b, c; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf }", &a, &b, &c); + yyextra->data.vector3[0] = a; + yyextra->data.vector3[1] = b; + yyextra->data.vector3[2] = c; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR3; + return LMT_VECTOR3; +} YY_BREAK case 13: YY_RULE_SETUP #line 142 "code/game/bg_lex.lex" -{ - double a, b, c; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf }", &a, &b, &c); - yyextra->data.vector3[0] = a; - yyextra->data.vector3[1] = b; - yyextra->data.vector3[2] = c; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR3; - return LMT_VECTOR3; -} +{ + double a, b, c; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf }", &a, &b, &c); + yyextra->data.vector3[0] = a; + yyextra->data.vector3[1] = b; + yyextra->data.vector3[2] = c; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR3; + return LMT_VECTOR3; +} YY_BREAK case 14: YY_RULE_SETUP #line 155 "code/game/bg_lex.lex" -{ - double a, b, c; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf }", &a, &b, &c); - yyextra->data.vector3[0] = a; - yyextra->data.vector3[1] = b; - yyextra->data.vector3[2] = c; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR3; - return LMT_VECTOR3; -} +{ + double a, b, c; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf }", &a, &b, &c); + yyextra->data.vector3[0] = a; + yyextra->data.vector3[1] = b; + yyextra->data.vector3[2] = c; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR3; + return LMT_VECTOR3; +} YY_BREAK case 15: YY_RULE_SETUP #line 167 "code/game/bg_lex.lex" -{ - double a, b, c; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf }", &a, &b, &c); - yyextra->data.vector3[0] = a; - yyextra->data.vector3[1] = b; - yyextra->data.vector3[2] = c; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR3; - return LMT_VECTOR3; -} +{ + double a, b, c; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf }", &a, &b, &c); + yyextra->data.vector3[0] = a; + yyextra->data.vector3[1] = b; + yyextra->data.vector3[2] = c; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR3; + return LMT_VECTOR3; +} YY_BREAK case 16: YY_RULE_SETUP #line 179 "code/game/bg_lex.lex" -{ - double a, b, c; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf }", &a, &b, &c); - yyextra->data.vector3[0] = a; - yyextra->data.vector3[1] = b; - yyextra->data.vector3[2] = c; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR3; - return LMT_VECTOR3; -} +{ + double a, b, c; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf }", &a, &b, &c); + yyextra->data.vector3[0] = a; + yyextra->data.vector3[1] = b; + yyextra->data.vector3[2] = c; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR3; + return LMT_VECTOR3; +} YY_BREAK case 17: YY_RULE_SETUP #line 191 "code/game/bg_lex.lex" -{ - double a, b, c; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf }", &a, &b, &c); - yyextra->data.vector3[0] = a; - yyextra->data.vector3[1] = b; - yyextra->data.vector3[2] = c; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR3; - return LMT_VECTOR3; -} +{ + double a, b, c; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf }", &a, &b, &c); + yyextra->data.vector3[0] = a; + yyextra->data.vector3[1] = b; + yyextra->data.vector3[2] = c; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR3; + return LMT_VECTOR3; +} YY_BREAK case 18: YY_RULE_SETUP #line 203 "code/game/bg_lex.lex" -{ - double a, b, c; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf }", &a, &b, &c); - yyextra->data.vector3[0] = a; - yyextra->data.vector3[1] = b; - yyextra->data.vector3[2] = c; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR3; - return LMT_VECTOR3; -} +{ + double a, b, c; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf }", &a, &b, &c); + yyextra->data.vector3[0] = a; + yyextra->data.vector3[1] = b; + yyextra->data.vector3[2] = c; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR3; + return LMT_VECTOR3; +} YY_BREAK case 19: YY_RULE_SETUP #line 215 "code/game/bg_lex.lex" -{ - double a, b, c; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf }", &a, &b, &c); - yyextra->data.vector3[0] = a; - yyextra->data.vector3[1] = b; - yyextra->data.vector3[2] = c; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR3; - return LMT_VECTOR3; -} +{ + double a, b, c; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf }", &a, &b, &c); + yyextra->data.vector3[0] = a; + yyextra->data.vector3[1] = b; + yyextra->data.vector3[2] = c; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR3; + return LMT_VECTOR3; +} YY_BREAK case 20: YY_RULE_SETUP #line 227 "code/game/bg_lex.lex" -{ - double a, b, c; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf }", &a, &b, &c); - yyextra->data.vector3[0] = a; - yyextra->data.vector3[1] = b; - yyextra->data.vector3[2] = c; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR3; - return LMT_VECTOR3; -} +{ + double a, b, c; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf }", &a, &b, &c); + yyextra->data.vector3[0] = a; + yyextra->data.vector3[1] = b; + yyextra->data.vector3[2] = c; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR3; + return LMT_VECTOR3; +} YY_BREAK case 21: YY_RULE_SETUP #line 239 "code/game/bg_lex.lex" -{ - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} +{ + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} YY_BREAK case 22: YY_RULE_SETUP #line 252 "code/game/bg_lex.lex" -{ - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} +{ + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} YY_BREAK case 23: YY_RULE_SETUP #line 265 "code/game/bg_lex.lex" -{ - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} +{ + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} YY_BREAK case 24: YY_RULE_SETUP #line 278 "code/game/bg_lex.lex" -{ - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} +{ + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} YY_BREAK case 25: YY_RULE_SETUP #line 291 "code/game/bg_lex.lex" -{ - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} +{ + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} YY_BREAK case 26: YY_RULE_SETUP #line 304 "code/game/bg_lex.lex" -{ - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} +{ + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} YY_BREAK case 27: YY_RULE_SETUP #line 317 "code/game/bg_lex.lex" -{ - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} +{ + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} YY_BREAK case 28: YY_RULE_SETUP #line 330 "code/game/bg_lex.lex" -{ - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} +{ + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} YY_BREAK case 29: YY_RULE_SETUP #line 343 "code/game/bg_lex.lex" -{ - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} +{ + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} YY_BREAK case 30: YY_RULE_SETUP #line 356 "code/game/bg_lex.lex" -{ - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} +{ + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} YY_BREAK case 31: YY_RULE_SETUP #line 369 "code/game/bg_lex.lex" -{ - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} +{ + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} YY_BREAK case 32: YY_RULE_SETUP #line 382 "code/game/bg_lex.lex" -{ - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} +{ + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} YY_BREAK case 33: YY_RULE_SETUP #line 395 "code/game/bg_lex.lex" -{ - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} +{ + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} YY_BREAK case 34: YY_RULE_SETUP #line 408 "code/game/bg_lex.lex" -{ - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} +{ + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} YY_BREAK case 35: YY_RULE_SETUP #line 421 "code/game/bg_lex.lex" -{ - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} +{ + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} YY_BREAK case 36: YY_RULE_SETUP #line 434 "code/game/bg_lex.lex" -{ - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} +{ + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf %lf %lf %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} YY_BREAK case 37: YY_RULE_SETUP #line 447 "code/game/bg_lex.lex" -{ - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} +{ + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} YY_BREAK case 38: YY_RULE_SETUP #line 460 "code/game/bg_lex.lex" -{ - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} +{ + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} YY_BREAK case 39: YY_RULE_SETUP #line 473 "code/game/bg_lex.lex" -{ - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} +{ + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} YY_BREAK case 40: YY_RULE_SETUP #line 486 "code/game/bg_lex.lex" -{ - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} +{ + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} YY_BREAK case 41: YY_RULE_SETUP #line 499 "code/game/bg_lex.lex" -{ - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} +{ + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} YY_BREAK case 42: YY_RULE_SETUP #line 512 "code/game/bg_lex.lex" -{ - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} +{ + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} YY_BREAK case 43: YY_RULE_SETUP #line 525 "code/game/bg_lex.lex" -{ - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} +{ + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} YY_BREAK case 44: YY_RULE_SETUP #line 538 "code/game/bg_lex.lex" -{ - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} +{ + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} YY_BREAK case 45: YY_RULE_SETUP #line 551 "code/game/bg_lex.lex" -{ - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} +{ + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} YY_BREAK case 46: YY_RULE_SETUP #line 564 "code/game/bg_lex.lex" -{ - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} +{ + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} YY_BREAK case 47: YY_RULE_SETUP #line 577 "code/game/bg_lex.lex" -{ - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} +{ + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} YY_BREAK case 48: YY_RULE_SETUP #line 590 "code/game/bg_lex.lex" -{ - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} +{ + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} YY_BREAK case 49: YY_RULE_SETUP #line 603 "code/game/bg_lex.lex" -{ - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} +{ + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} YY_BREAK case 50: YY_RULE_SETUP #line 616 "code/game/bg_lex.lex" -{ - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} +{ + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} YY_BREAK case 51: YY_RULE_SETUP #line 629 "code/game/bg_lex.lex" -{ - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} +{ + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} YY_BREAK case 52: YY_RULE_SETUP #line 642 "code/game/bg_lex.lex" -{ - double a, b, c, d; - - // cppcheck-suppress invalidscanf - sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); - yyextra->data.vector4[0] = a; - yyextra->data.vector4[1] = b; - yyextra->data.vector4[2] = c; - yyextra->data.vector4[3] = d; - yyextra->column += strlen(yytext); - yyextra->type = LMT_VECTOR4; - return LMT_VECTOR4; -} +{ + double a, b, c, d; + + // cppcheck-suppress invalidscanf + sscanf(yytext, "{ %lf, %lf, %lf, %lf }", &a, &b, &c, &d); + yyextra->data.vector4[0] = a; + yyextra->data.vector4[1] = b; + yyextra->data.vector4[2] = c; + yyextra->data.vector4[3] = d; + yyextra->column += strlen(yytext); + yyextra->type = LMT_VECTOR4; + return LMT_VECTOR4; +} YY_BREAK case 53: YY_RULE_SETUP #line 655 "code/game/bg_lex.lex" -{ - yyextra->type = LMT_SYMBOL; - yyextra->data.symbol = LSYM_OBRACEC; - yyextra->column++; - return LMT_SYMBOL; -} +{ + yyextra->type = LMT_SYMBOL; + yyextra->data.symbol = LSYM_OBRACEC; + yyextra->column++; + return LMT_SYMBOL; +} YY_BREAK case 54: YY_RULE_SETUP #line 661 "code/game/bg_lex.lex" -{ - yyextra->type = LMT_SYMBOL; - yyextra->data.symbol = LSYM_CBRACEC; - yyextra->column++; - return LMT_SYMBOL; -} +{ + yyextra->type = LMT_SYMBOL; + yyextra->data.symbol = LSYM_CBRACEC; + yyextra->column++; + return LMT_SYMBOL; +} YY_BREAK case 55: YY_RULE_SETUP #line 667 "code/game/bg_lex.lex" -{ - yyextra->type = LMT_SYMBOL; - yyextra->data.symbol = LSYM_OBRACE; - yyextra->column++; - return LMT_SYMBOL; -} +{ + yyextra->type = LMT_SYMBOL; + yyextra->data.symbol = LSYM_OBRACE; + yyextra->column++; + return LMT_SYMBOL; +} YY_BREAK case 56: YY_RULE_SETUP #line 673 "code/game/bg_lex.lex" -{ - yyextra->type = LMT_SYMBOL; - yyextra->data.symbol = LSYM_CBRACE; - yyextra->column++; - return LMT_SYMBOL; -} +{ + yyextra->type = LMT_SYMBOL; + yyextra->data.symbol = LSYM_CBRACE; + yyextra->column++; + return LMT_SYMBOL; +} YY_BREAK case 57: YY_RULE_SETUP #line 679 "code/game/bg_lex.lex" -{ - yyextra->type = LMT_SYMBOL; - yyextra->data.symbol = LSYM_OBRACESQ; - yyextra->column++; - return LMT_SYMBOL; -} +{ + yyextra->type = LMT_SYMBOL; + yyextra->data.symbol = LSYM_OBRACESQ; + yyextra->column++; + return LMT_SYMBOL; +} YY_BREAK case 58: YY_RULE_SETUP #line 685 "code/game/bg_lex.lex" -{ - yyextra->type = LMT_SYMBOL; - yyextra->data.symbol = LSYM_CBRACESQ; - yyextra->column++; - return LMT_SYMBOL; -} +{ + yyextra->type = LMT_SYMBOL; + yyextra->data.symbol = LSYM_CBRACESQ; + yyextra->column++; + return LMT_SYMBOL; +} YY_BREAK case 59: YY_RULE_SETUP #line 691 "code/game/bg_lex.lex" -{ - yyextra->type = LMT_SYMBOL; - yyextra->data.symbol = LSYM_SEMICOLON; - yyextra->column++; - return LMT_SYMBOL; -} +{ + yyextra->type = LMT_SYMBOL; + yyextra->data.symbol = LSYM_SEMICOLON; + yyextra->column++; + return LMT_SYMBOL; +} YY_BREAK case 60: YY_RULE_SETUP #line 697 "code/game/bg_lex.lex" -{ - yyextra->column++; - yyextra->type = LMT_IGNORE; - return LMT_IGNORE; -} +{ + yyextra->type = LMT_SYMBOL; + yyextra->data.symbol = LSYM_POINT; + yyextra->column += 1; + return LMT_SYMBOL; +} YY_BREAK case 61: -/* rule 61 can match eol */ YY_RULE_SETUP -#line 702 "code/game/bg_lex.lex" -{ - yyextra->line++; - yyextra->column = 0; - yyextra->type = LMT_IGNORE; - return LMT_IGNORE; -} - YY_BREAK -case YY_STATE_EOF(INITIAL): -#line 708 "code/game/bg_lex.lex" -{ - yyextra->type = LMT_EOF; - return LMT_EOF; -} +#line 703 "code/game/bg_lex.lex" +{ + yyextra->column++; + yyextra->type = LMT_IGNORE; + return LMT_IGNORE; +} YY_BREAK case 62: +/* rule 62 can match eol */ YY_RULE_SETUP -#line 712 "code/game/bg_lex.lex" -{ - yyextra->column++; - yyextra->type = LMT_IGNORE; - return LMT_IGNORE; -} +#line 708 "code/game/bg_lex.lex" +{ + yyextra->line++; + yyextra->column = 0; + yyextra->type = LMT_IGNORE; + return LMT_IGNORE; +} + YY_BREAK +case YY_STATE_EOF(INITIAL): +#line 714 "code/game/bg_lex.lex" +{ + yyextra->type = LMT_EOF; + return LMT_EOF; +} YY_BREAK case 63: YY_RULE_SETUP -#line 717 "code/game/bg_lex.lex" +#line 718 "code/game/bg_lex.lex" +{ + yyextra->column++; + yyextra->type = LMT_IGNORE; + return LMT_IGNORE; +} + YY_BREAK +case 64: +YY_RULE_SETUP +#line 723 "code/game/bg_lex.lex" ECHO; YY_BREAK -#line 1969 "code/game/bg_lex.yy.c" +#line 1979 "code/game/bg_lex.yy.c" case YY_END_OF_BUFFER: { @@ -2257,7 +2267,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 307 ) + if ( yy_current_state >= 308 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -2286,11 +2296,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 307 ) + if ( yy_current_state >= 308 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 306); + yy_is_jam = (yy_current_state == 307); return yy_is_jam ? 0 : yy_current_state; } @@ -3118,369 +3128,413 @@ void yyfree (void * ptr , yyscan_t yyscanner) #define YYTABLES_NAME "yytables" -#line 717 "code/game/bg_lex.lex" - - - -#ifdef LEX_TEXT -int main(int argc, char* argv[]) { - char buff[4096]; - yyscan_t scanner; - FILE* f; - bgLex* lex; - - f = fopen("test.txt", "r"); - fread(buff, 4096, 1, f); - fclose(f); - - lex = bgLex_create(buff); - while(bgLex_lex(lex)) { - printf("type=%i symbol=%i yytext=%s\n", lex->morphem.type, lex->morphem.data.symbol, yyget_text(lex->lex)); - } - bgLex_destroy(lex); - - return EXIT_SUCCESS; -} -#endif - -bgLex* bgLex_create(char* data) { - bgLex* l = malloc(sizeof(bgLex)); - - /* HACK: prevent compiler warnings */ - UNUSED(yyunput); - UNUSED(input); - - if(l != NULL) { - l->morphem.line = 0; - l->morphem.column = 0; - - yylex_init_extra(&l->morphem,&l->lex); - l->buf = yy_scan_string(data,l->lex); - } - - return l; -} - -void bgLex_destroy(bgLex* lex) { - if(lex == NULL) { - return; - } - - if(lex->buf != NULL) { - yy_delete_buffer(lex->buf,lex->lex); - } - - if(lex->lex != NULL) { - yylex_destroy(lex->lex); - } - - free(lex); -} - -int bgLex_lex(bgLex* lex) { - int res; - - /* skip LMT_IGNORE */ - while(1) { - res = yylex(lex->lex); - if(lex->morphem.type != LMT_IGNORE) { - break; - } - } - - return res; -} - -bgLexSymbol bgLex_textToSymbol(char* text) { - if(strcmp("ServerChangeConfig", text) == 0) { - return LSYM_SERVER_CHANGE_CONFIG; - } - - if(strcmp("Server", text) == 0) { - return LSYM_SERVER; - } - - if(strcmp("HolodeckData", text) == 0) { - return LSYM_HOLODECK_DATA; - } - - if(strcmp("Program", text) == 0) { - return LSYM_PROGRAM; - } - - if(strcmp("MapChangeConfig", text) == 0) { - return LSYM_MAP_CHANGE_CONFIG; - } - - if(strcmp("Map", text) == 0) { - return LSYM_MAP; - } - - if(strcmp("LocationsList2", text) == 0) { - return LSYM_LOCATIONS_LIST_2; - } - - if(strcmp("LocationsList", text) == 0) { - return LSYM_LOCATIONS_LIST; - } - - if(strcmp("message", text) == 0) { - return LSYM_MESSAGE; - } - - if(strcmp("consoleName", text) == 0) { - return LSYM_CONSOLE_NAME; - } - - if(strcmp("formalName", text) == 0) { - return LSYM_FORMAL_NAME; - } - - if(strcmp("radarColor", text) == 0) { - return LSYM_RADAR_COLOR; - } - - if(strcmp("iconColor", text) == 0) { - return LSYM_ICON_COLOR; - } - - if(strcmp("NULL", text) == 0) { - return LSYM_NULL; - } - - if(strcmp("modelSkin", text) == 0) { - return LSYM_MODEL_SKIN; - } - - if(strcmp("weapons", text) == 0) { - return LSYM_WEAPONS; - } - - if(strcmp("hasRanks", text) == 0) { - return LSYM_HAS_RANKS; - } - - if(strcmp("teal", text) == 0) { - return LSYM_TEAL; - } - - if(strcmp("medical", text) == 0) { - return LSYM_MEDICAL; - } - - if(strcmp("gold", text) == 0) { - return LSYM_GOLD; - } - - if(strcmp("green", text) == 0) { - return LSYM_GREEN; - } - - if(strcmp("marine", text) == 0) { - return LSYM_MARINE; - } - - if(strcmp("red", text) == 0) { - return LSYM_RED; - } - - if(strcmp("WP_TRICORDER", text) == 0) { - return LSYM_WP_TRICORDER; - } - - if(strcmp("WP_PADD", text) == 0) { - return LSYM_WP_PADD; - } - - if(strcmp("WP_COFFEE", text) == 0) { - return LSYM_WP_COFFEE; - } - - if(strcmp("WP_PHASER", text) == 0) { - return LSYM_WP_PHASER; - } - - if(strcmp("WP_COMPRESSION_RIFLE", text) == 0) { - return LSYM_WP_COMPRESSION_RIFLE; - } - - if(strcmp("WP_TR116", text) == 0) { - return LSYM_WP_TR116; - } - - if(strcmp("WP_GRENADE_LAUNCHER", text) == 0) { - return LSYM_WP_GRENADE_LAUNCHER; - } - - if(strcmp("WP_QUANTUM_BURST", text) == 0) { - return LSYM_WP_QUANTUM_BURST; - } - - if(strcmp("WP_MEDKIT", text) == 0) { - return LSYM_WP_MEDKIT; - } - - if(strcmp("WP_VOYAGER_HYPO", text) == 0) { - return LSYM_WP_VOYAGER_HYPO; - } - - if(strcmp("WP_DERMAL_REGEN", text) == 0) { - return LSYM_WP_DERMAL_REGEN; - } - - if(strcmp("WP_TOOLKIT", text) == 0) { - return LSYM_WP_TOOLKIT; - } - - if(strcmp("WP_HYPERSPANNER", text) == 0) { - return LSYM_WP_HYPERSPANNER; - } - - if(strcmp("WP_DISRUPTOR", text) == 0) { - return LSYM_WP_DISRUPTOR; - } - - if(strcmp("WP_NULL", text) == 0) { - return LSYM_WP_NULL; - } - - if(strcmp("WP_NULL_HANDS", text) == 0) { - return LSYM_WP_NULL_HANDS; - } - - if(strcmp("WP_0", text) == 0) { - return LSYM_WP_0; - } - - if(strcmp("WP_1", text) == 0) { - return LSYM_WP_1; - } - - if(strcmp("WP_2", text) == 0) { - return LSYM_WP_2; - } - - if(strcmp("WP_3", text) == 0) { - return LSYM_WP_3; - } - - if(strcmp("WP_4", text) == 0) { - return LSYM_WP_4; - } - - if(strcmp("WP_5", text) == 0) { - return LSYM_WP_5; - } - - if(strcmp("WP_6", text) == 0) { - return LSYM_WP_6; - } - - if(strcmp("WP_7", text) == 0) { - return LSYM_WP_7; - } - - if(strcmp("WP_8", text) == 0) { - return LSYM_WP_8; - } - - if(strcmp("WP_9", text) == 0) { - return LSYM_WP_9; - } - - if(strcmp("WP_10", text) == 0) { - return LSYM_WP_10; - } - - if(strcmp("WP_11", text) == 0) { - return LSYM_WP_11; - } - - if(strcmp("WP_12", text) == 0) { - return LSYM_WP_12; - } - - if(strcmp("WP_13", text) == 0) { - return LSYM_WP_13; - } - - if(strcmp("WP_14", text) == 0) { - return LSYM_WP_14; - } - - if(strcmp("WP_15", text) == 0) { - return LSYM_WP_15; - } - - if(strcmp("admin", text) == 0) { - return LSYM_ADMIN; - } - - if(strcmp("borg", text) == 0) { - return LSYM_BORG; - } - - if(strcmp("n00b", text) == 0) { - return LSYM_N00B; - } - - if(strcmp("noShow", text) == 0) { - return LSYM_NO_SHOW; - } - - if(strcmp("MenuTextureDef", text) == 0) { - return LSYM_MENU_TEXTURE_DEF; - } - - if(strcmp("ConsoleName", text) == 0) { - return LSYM_CONSOLE_NAME; - } - - if(strcmp("FormalName", text) == 0) { - return LSYM_FORMAL_NAME; - } - - if(strcmp("MenuTextureRed", text) == 0) { - return LSYM_MENU_TEXTURE_RED; - } - - if(strcmp("MenuTextureTeal", text) == 0) { - return LSYM_MENU_TEXTURE_TEAL; - } - - if(strcmp("MenuTextureGold", text) == 0) { - return LSYM_MENU_TEXTURE_GOLD; - } - - if(strcmp("MenuTextureGreen", text) == 0) { - return LSYM_MENU_TEXTURE_GREEN; - } - - if(strcmp("BoltModel", text) == 0) { - return LSYM_BOLT_MODEL; - } - - if(strcmp("BoltShader", text) == 0) { - return LSYM_BOLT_SHADER; - } - - if(strcmp("AdmiralRank", text) == 0) { - return LSYM_ADMIRAL_RANK; - } - - if(strcmp("true", text) == 0) { - return LSYM_TRUE; - } - - if(strcmp("false", text) == 0) { - return LSYM_FALSE; - } - - return LSYM_UNKNOWN; -} - -void bgLexFatalError(const char* msg, void* lex) { - Com_Printf("LEXER ERROR: %s\n", msg); -} - +#line 723 "code/game/bg_lex.lex" + + + +#ifdef LEX_TEXT +int main(int argc, char* argv[]) { + char buff[4096]; + yyscan_t scanner; + FILE* f; + bgLex* lex; + + f = fopen("test.txt", "r"); + fread(buff, 4096, 1, f); + fclose(f); + + lex = bgLex_create(buff); + while(bgLex_lex(lex)) { + printf("type=%i symbol=%i yytext=%s\n", lex->morphem.type, lex->morphem.data.symbol, yyget_text(lex->lex)); + } + bgLex_destroy(lex); + + return EXIT_SUCCESS; +} +#endif + +bgLex* bgLex_create(char* data) { + bgLex* l = malloc(sizeof(bgLex)); + + /* HACK: prevent compiler warnings */ + UNUSED(yyunput); + UNUSED(input); + + if(l != NULL) { + l->morphem.line = 0; + l->morphem.column = 0; + + yylex_init_extra(&l->morphem,&l->lex); + l->buf = yy_scan_string(data,l->lex); + } + + return l; +} + +void bgLex_destroy(bgLex* lex) { + if(lex == NULL) { + return; + } + + if(lex->buf != NULL) { + yy_delete_buffer(lex->buf,lex->lex); + } + + if(lex->lex != NULL) { + yylex_destroy(lex->lex); + } + + free(lex); +} + +int bgLex_lex(bgLex* lex) { + int res; + + /* skip LMT_IGNORE */ + while(1) { + res = yylex(lex->lex); + if(lex->morphem.type != LMT_IGNORE) { + break; + } + } + + return res; +} + +bgLexSymbol bgLex_textToSymbol(char* text) { + if(strcmp("ServerChangeConfig", text) == 0) { + return LSYM_SERVER_CHANGE_CONFIG; + } + + if(strcmp("Server", text) == 0) { + return LSYM_SERVER; + } + + if(strcmp("HolodeckData", text) == 0) { + return LSYM_HOLODECK_DATA; + } + + if(strcmp("Program", text) == 0) { + return LSYM_PROGRAM; + } + + if(strcmp("MapChangeConfig", text) == 0) { + return LSYM_MAP_CHANGE_CONFIG; + } + + if(strcmp("Map", text) == 0) { + return LSYM_MAP; + } + + if(strcmp("LocationsList2", text) == 0) { + return LSYM_LOCATIONS_LIST_2; + } + + if(strcmp("LocationsList", text) == 0) { + return LSYM_LOCATIONS_LIST; + } + + if(strcmp("message", text) == 0) { + return LSYM_MESSAGE; + } + + if(strcmp("consoleName", text) == 0) { + return LSYM_CONSOLE_NAME; + } + + if(strcmp("formalName", text) == 0) { + return LSYM_FORMAL_NAME; + } + + if(strcmp("radarColor", text) == 0) { + return LSYM_RADAR_COLOR; + } + + if(strcmp("iconColor", text) == 0) { + return LSYM_ICON_COLOR; + } + + if(strcmp("NULL", text) == 0) { + return LSYM_NULL; + } + + if(strcmp("modelSkin", text) == 0) { + return LSYM_MODEL_SKIN; + } + + if(strcmp("weapons", text) == 0) { + return LSYM_WEAPONS; + } + + if(strcmp("hasRanks", text) == 0) { + return LSYM_HAS_RANKS; + } + + if(strcmp("teal", text) == 0) { + return LSYM_TEAL; + } + + if(strcmp("medical", text) == 0) { + return LSYM_MEDICAL; + } + + if(strcmp("gold", text) == 0) { + return LSYM_GOLD; + } + + if(strcmp("green", text) == 0) { + return LSYM_GREEN; + } + + if(strcmp("marine", text) == 0) { + return LSYM_MARINE; + } + + if(strcmp("red", text) == 0) { + return LSYM_RED; + } + + if(strcmp("WP_TRICORDER", text) == 0) { + return LSYM_WP_TRICORDER; + } + + if(strcmp("WP_PADD", text) == 0) { + return LSYM_WP_PADD; + } + + if(strcmp("WP_COFFEE", text) == 0) { + return LSYM_WP_COFFEE; + } + + if(strcmp("WP_PHASER", text) == 0) { + return LSYM_WP_PHASER; + } + + if(strcmp("WP_COMPRESSION_RIFLE", text) == 0) { + return LSYM_WP_COMPRESSION_RIFLE; + } + + if(strcmp("WP_TR116", text) == 0) { + return LSYM_WP_TR116; + } + + if(strcmp("WP_GRENADE_LAUNCHER", text) == 0) { + return LSYM_WP_GRENADE_LAUNCHER; + } + + if(strcmp("WP_QUANTUM_BURST", text) == 0) { + return LSYM_WP_QUANTUM_BURST; + } + + if(strcmp("WP_MEDKIT", text) == 0) { + return LSYM_WP_MEDKIT; + } + + if(strcmp("WP_VOYAGER_HYPO", text) == 0) { + return LSYM_WP_VOYAGER_HYPO; + } + + if(strcmp("WP_DERMAL_REGEN", text) == 0) { + return LSYM_WP_DERMAL_REGEN; + } + + if(strcmp("WP_TOOLKIT", text) == 0) { + return LSYM_WP_TOOLKIT; + } + + if(strcmp("WP_HYPERSPANNER", text) == 0) { + return LSYM_WP_HYPERSPANNER; + } + + if(strcmp("WP_DISRUPTOR", text) == 0) { + return LSYM_WP_DISRUPTOR; + } + + if(strcmp("WP_NULL", text) == 0) { + return LSYM_WP_NULL; + } + + if(strcmp("WP_NULL_HANDS", text) == 0) { + return LSYM_WP_NULL_HANDS; + } + + if(strcmp("WP_0", text) == 0) { + return LSYM_WP_0; + } + + if(strcmp("WP_1", text) == 0) { + return LSYM_WP_1; + } + + if(strcmp("WP_2", text) == 0) { + return LSYM_WP_2; + } + + if(strcmp("WP_3", text) == 0) { + return LSYM_WP_3; + } + + if(strcmp("WP_4", text) == 0) { + return LSYM_WP_4; + } + + if(strcmp("WP_5", text) == 0) { + return LSYM_WP_5; + } + + if(strcmp("WP_6", text) == 0) { + return LSYM_WP_6; + } + + if(strcmp("WP_7", text) == 0) { + return LSYM_WP_7; + } + + if(strcmp("WP_8", text) == 0) { + return LSYM_WP_8; + } + + if(strcmp("WP_9", text) == 0) { + return LSYM_WP_9; + } + + if(strcmp("WP_10", text) == 0) { + return LSYM_WP_10; + } + + if(strcmp("WP_11", text) == 0) { + return LSYM_WP_11; + } + + if(strcmp("WP_12", text) == 0) { + return LSYM_WP_12; + } + + if(strcmp("WP_13", text) == 0) { + return LSYM_WP_13; + } + + if(strcmp("WP_14", text) == 0) { + return LSYM_WP_14; + } + + if(strcmp("WP_15", text) == 0) { + return LSYM_WP_15; + } + + if(strcmp("admin", text) == 0) { + return LSYM_ADMIN; + } + + if(strcmp("borg", text) == 0) { + return LSYM_BORG; + } + + if(strcmp("n00b", text) == 0) { + return LSYM_N00B; + } + + if(strcmp("noShow", text) == 0) { + return LSYM_NO_SHOW; + } + + if(strcmp("MenuTextureDef", text) == 0) { + return LSYM_MENU_TEXTURE_DEF; + } + + if(strcmp("ConsoleName", text) == 0) { + return LSYM_CONSOLE_NAME; + } + + if(strcmp("FormalName", text) == 0) { + return LSYM_FORMAL_NAME; + } + + if(strcmp("MenuTextureRed", text) == 0) { + return LSYM_MENU_TEXTURE_RED; + } + + if(strcmp("MenuTextureTeal", text) == 0) { + return LSYM_MENU_TEXTURE_TEAL; + } + + if(strcmp("MenuTextureGold", text) == 0) { + return LSYM_MENU_TEXTURE_GOLD; + } + + if(strcmp("MenuTextureGreen", text) == 0) { + return LSYM_MENU_TEXTURE_GREEN; + } + + if(strcmp("BoltModel", text) == 0) { + return LSYM_BOLT_MODEL; + } + + if(strcmp("BoltShader", text) == 0) { + return LSYM_BOLT_SHADER; + } + + if(strcmp("AdmiralRank", text) == 0) { + return LSYM_ADMIRAL_RANK; + } + + if(strcmp("true", text) == 0) { + return LSYM_TRUE; + } + + if(strcmp("false", text) == 0) { + return LSYM_FALSE; + } + + if(strcmp("phaser", text) == 0) { + return LSYM_WCONF_PHASER; + } + + if(strcmp("crifle", text) == 0) { + return LSYM_WCONF_CRIFLE; + } + + if(strcmp("disruptor", text) == 0) { + return LSYM_WCONF_DISRUPTOR; + } + + if(strcmp("grenade", text) == 0) { + return LSYM_WCONF_GRENADE; + } + + if(strcmp("tr116", text) == 0) { + return LSYM_WCONF_TR116; + } + + if(strcmp("quantum", text) == 0) { + return LSYM_WCONF_QUANTUM; + } + + if(strcmp("hyperspanner", text) == 0) { + return LSYM_WCONF_HYPERSPANNER; + } + + if(strcmp("damage", text) == 0) { + return LSYM_WCONF_DAMAGE; + } + + if(strcmp("range", text) == 0) { + return LSYM_WCONF_RANGE; + } + + if(strcmp("variation", text) == 0) { + return LSYM_WCONF_VARIATION; + } + + if(strcmp("radius", text) == 0) { + return LSYM_WCONF_RADIUS; + } + + return LSYM_UNKNOWN; +} + +void bgLexFatalError(const char* msg, void* lex) { + Com_Printf("LEXER ERROR: %s\n", msg); +} + diff --git a/code/game/g_weapon.c b/code/game/g_weapon.c index 16f87cc..ecbfcb0 100644 --- a/code/game/g_weapon.c +++ b/code/game/g_weapon.c @@ -12,10 +12,286 @@ #include "g_lua.h" #include "g_combat.h" #include "q_math.h" +#include "bg_lex.h" -#define MAX_BEAM_HITS 4 +weaponConfig_t weaponConfig; -#define DMG_VAR (flrandom(0.8,1.2)) +static void G_Weapon_DefaultConfig(void) { + G_LogFuncBegin(); + weaponConfig.phaser.primary.damage = 55; + weaponConfig.phaser.primary.range = 2048; + weaponConfig.phaser.primary.variation = 6; + weaponConfig.phaser.secondary.damage = 55; + weaponConfig.phaser.secondary.range = 2048; + weaponConfig.phaser.secondary.variation = 6; + weaponConfig.phaser.secondary.radius = 80; + weaponConfig.crifle.primary.damage = 75; + weaponConfig.crifle.primary.range = 8192; + weaponConfig.crifle.secondary.damage = 16; + weaponConfig.crifle.secondary.range = 8192; + weaponConfig.crifle.secondary.size = 1; + weaponConfig.disruptor.primary.damage = 150; + weaponConfig.disruptor.primary.range = 2048; + weaponConfig.disruptor.secondary.damage = 150; + weaponConfig.disruptor.secondary.size = 6; + weaponConfig.grenade.primary.damage = 75; + weaponConfig.grenade.primary.size = 4; + weaponConfig.grenade.primary.splash.damage = 100; + weaponConfig.grenade.primary.splash.radius = 190; + weaponConfig.grenade.primary.time = 2000; + weaponConfig.grenade.primary.velocity = 1000; + weaponConfig.grenade.secondary.damage = 80; + weaponConfig.grenade.secondary.splash.damage = 100; + weaponConfig.grenade.secondary.splash.radius = 190; + weaponConfig.grenade.secondary.time = 2500; + weaponConfig.hyperspanner.primary.rate = 2; + weaponConfig.hyperspanner.secondary.rate = 4; + weaponConfig.quantum.primary.damage = 140; + weaponConfig.quantum.primary.size = 1; + weaponConfig.quantum.primary.splash.damage = 140; + weaponConfig.quantum.primary.splash.radius = 160; + weaponConfig.quantum.secondary.damage = 140; + weaponConfig.quantum.secondary.size = 1; + weaponConfig.quantum.secondary.splash.damage = 140; + weaponConfig.quantum.secondary.splash.radius = 160; + weaponConfig.quantum.secondary.think.time = 300; + weaponConfig.quantum.secondary.think.search.distance = 4096; + weaponConfig.quantum.secondary.think.search.time = 100; + weaponConfig.tr116.primary.damage = 150; + weaponConfig.tr116.primary.range = 8192; + G_LogFuncEnd(); +} + +static qboolean G_Weapon_ParseWeaponConfig(bgLex* lexer) { + G_Assert(lexer, qfalse); + bgLexSymbol weapon = lexer->morphem.data.symbol; + + bgLex_lex(lexer); + if (lexer->morphem.type != LMT_SYMBOL || lexer->morphem.data.symbol != LSYM_OBRACE) { + G_Logger(LL_ERROR, "Expected { at weapons.cfg:%d:%d!\n", lexer->morphem.line, lexer->morphem.column); + G_LogFuncEnd(); + return qfalse; + } + + switch (weapon) + { + case LSYM_WCONF_PHASER: + while (bgLex_lex(lexer) != 0) { + if (lexer->morphem.type != LMT_SYMBOL) { + G_Logger(LL_ERROR, "Unexpected token at weapons.cfg:%d:%d!\n", lexer->morphem.line, lexer->morphem.column); + G_LogFuncEnd(); + return qfalse; + } else { + if (lexer->morphem.data.symbol == LSYM_WCONF_PRIMARY) { + bgLex_lex(lexer); + if (lexer->morphem.type != LMT_SYMBOL || lexer->morphem.data.symbol != LSYM_POINT) { + G_Logger(LL_ERROR, "Expected '.' at weapons.cfg:%d:%d!\n", lexer->morphem.line, lexer->morphem.column); + G_LogFuncEnd(); + return qfalse; + } + bgLex_lex(lexer); + if (lexer->morphem.type != LMT_SYMBOL) { + G_Logger(LL_ERROR, "Unexpected token at weapons.cfg.%d:%d!\n", lexer->morphem.line, lexer->morphem.column); + G_LogFuncEnd(); + return qfalse; + } + switch (lexer->morphem.data.symbol) { + case LSYM_WCONF_DAMAGE: + bgLex_lex(lexer); + if (lexer->morphem.type == LMT_INT) { + weaponConfig.phaser.primary.damage = lexer->morphem.data.numInteger; + } else { + G_Logger(LL_ERROR, "Expected integer value at weapons.cfg:%d:%d!\n", lexer->morphem.line, lexer->morphem.column); + G_LogFuncEnd(); + return qfalse; + } + break; + case LSYM_WCONF_RANGE: + bgLex_lex(lexer); + if (lexer->morphem.type == LMT_DOUBLE) { + weaponConfig.phaser.primary.range = lexer->morphem.data.numDouble; + } else { + G_Logger(LL_ERROR, "Expected double value at weapons.cfg:%d:%d!\n", lexer->morphem.line, lexer->morphem.column); + G_LogFuncEnd(); + return qfalse; + } + break; + case LSYM_WCONF_VARIATION: + bgLex_lex(lexer); + if (lexer->morphem.type == LMT_INT) { + weaponConfig.phaser.primary.variation = lexer->morphem.data.numInteger; + } else { + G_Logger(LL_ERROR, "Expected integer value at weapons.cfg:%d:%d!\n", lexer->morphem.line, lexer->morphem.column); + G_LogFuncEnd(); + return qfalse; + } + break; + default: + G_Logger(LL_ERROR, "Unexpected token at weapons.cfg.%d:%d!\n", lexer->morphem.line, lexer->morphem.column); + G_LogFuncEnd(); + return qfalse; + } + } else if (lexer->morphem.data.symbol == LSYM_WCONF_SECONDARY) { + bgLex_lex(lexer); + if (lexer->morphem.type != LMT_SYMBOL || lexer->morphem.data.symbol != LSYM_POINT) { + G_Logger(LL_ERROR, "Expected '.' at weapons.cfg:%d:%d!\n", lexer->morphem.line, lexer->morphem.column); + G_LogFuncEnd(); + return qfalse; + } + bgLex_lex(lexer); + if (lexer->morphem.type != LMT_SYMBOL) { + G_Logger(LL_ERROR, "Unexpected token at weapons.cfg.%d:%d!\n", lexer->morphem.line, lexer->morphem.column); + G_LogFuncEnd(); + return qfalse; + } + switch (lexer->morphem.data.symbol) { + case LSYM_WCONF_DAMAGE: + bgLex_lex(lexer); + if (lexer->morphem.type == LMT_INT) { + weaponConfig.phaser.secondary.damage = lexer->morphem.data.numInteger; + } else { + G_Logger(LL_ERROR, "Expected integer value at weapons.cfg:%d:%d!\n", lexer->morphem.line, lexer->morphem.column); + G_LogFuncEnd(); + return qfalse; + } + break; + case LSYM_WCONF_RANGE: + bgLex_lex(lexer); + if (lexer->morphem.type == LMT_DOUBLE) { + weaponConfig.phaser.secondary.range = lexer->morphem.data.numDouble; + } else { + G_Logger(LL_ERROR, "Expected double value at weapons.cfg:%d:%d!\n", lexer->morphem.line, lexer->morphem.column); + G_LogFuncEnd(); + return qfalse; + } + break; + case LSYM_WCONF_VARIATION: + bgLex_lex(lexer); + if (lexer->morphem.type == LMT_INT) { + weaponConfig.phaser.secondary.variation = lexer->morphem.data.numInteger; + } else { + G_Logger(LL_ERROR, "Expected integer value at weapons.cfg:%d:%d!\n", lexer->morphem.line, lexer->morphem.column); + G_LogFuncEnd(); + return qfalse; + } + break; + case LSYM_WCONF_RADIUS: + bgLex_lex(lexer); + if (lexer->morphem.type == LMT_DOUBLE) { + weaponConfig.phaser.secondary.radius = lexer->morphem.data.numDouble; + } else { + G_Logger(LL_ERROR, "Expected double value at weapons.cfg:%d:%d!\n", lexer->morphem.line, lexer->morphem.column); + G_LogFuncEnd(); + return qfalse; + } + break; + default: + G_Logger(LL_ERROR, "Unexpected token at weapons.cfg.%d:%d!\n", lexer->morphem.line, lexer->morphem.column); + G_LogFuncEnd(); + return qfalse; + } + } else { + G_Logger(LL_ERROR, "Expected 'primary' or 'secondary' at weapons.cfg:%d:%d!\n", lexer->morphem.line, lexer->morphem.column); + G_LogFuncEnd(); + return qfalse; + } + } + } + break; + case LSYM_WCONF_CRIFLE: + + break; + case LSYM_WCONF_DISRUPTOR: + + break; + case LSYM_WCONF_GRENADE: + + break; + + case LSYM_WCONF_HYPERSPANNER: + + break; + case LSYM_WCONF_QUANTUM: + + break; + case LSYM_WCONF_TR116: + + break; + default: + G_LocLogger(LL_ERROR, "Unexpected token at weapons.cfg:%d:%d!\n", lexer->morphem.line, lexer->morphem.column); + G_LogFuncEnd(); + return qfalse; + } + + bgLex_lex(lexer); + if (lexer->morphem.type != LMT_SYMBOL || lexer->morphem.data.symbol != LSYM_CBRACE) { + G_Logger(LL_ERROR, "Expected } at weapons.cfg:%d:%d!\n", lexer->morphem.line, lexer->morphem.column); + G_LogFuncEnd(); + return qfalse; + } + + G_LogFuncEnd(); + return qtrue; +} + +void G_Weapon_LoadConfig(void) { + fileHandle_t f = 0; + bgLex* lexer = NULL; + char* buffer = NULL; + int32_t len = 0; + + G_LogFuncBegin(); + + len = trap_FS_FOpenFile("weapon.cfg", &f, FS_READ); + if (len == 0) { + G_LocLogger(LL_ERROR, "weapon.cfg not found or empty! Using defaults.\n"); + G_Weapon_DefaultConfig(); + G_LogFuncEnd(); + return; + } + + buffer = (char*)malloc(len + 1); + if (buffer == NULL) { + G_LocLogger(LL_ERROR, "Was unable to allocate %i byte.\n", (len + 1)); + trap_FS_FCloseFile(f); + G_LogFuncEnd(); + return; + } + memset(buffer, 0, len + 1); + + trap_FS_Read(buffer, len, f); + trap_FS_FCloseFile(f); + + lexer = bgLex_create(buffer); + if (lexer == NULL) { + G_LocLogger(LL_ERROR, "Could not create new bgLex to lex weapons.cfg! Using defauls.\n"); + G_Weapon_DefaultConfig(); + free(buffer); + G_LogFuncEnd(); + return; + } + + while (bgLex_lex(lexer) != 0) { + if (lexer->morphem.type == LMT_SYMBOL) { + if (G_Weapon_ParseWeaponConfig(lexer) == qfalse) { + G_Logger(LL_ERROR, "Parsing weapon configuration has failed!\n"); + G_LogFuncEnd(); + return; + } + } else { + G_LocLogger(LL_ERROR, "Unexpected token in weapons.cfg:%d:%d!\n", lexer->morphem.line, lexer->morphem.column); + G_Weapon_DefaultConfig(); + bgLex_destroy(lexer); + free(buffer); + G_LogFuncEnd(); + return; + } + } +} + +#define MAX_BEAM_HITS 4 + +#define DMG_VAR (flrandom(0.8,1.2)) /* Phaser */ /* I'll keep this comment just because it's funny lol :D */ @@ -27,11 +303,7 @@ /* Compression Rifle */ #define CRIFLE_DAMAGE rpg_rifleDamage.integer -#define CRIFLE_MAIN_SPLASH_RADIUS 64 -#define CRIFLE_MAIN_SPLASH_DMG 0 #define CRIFLE_ALTDAMAGE rpg_rifleAltDamage.integer -#define CRIFLE_ALT_SPLASH_RADIUS 32 -#define CRIFLE_ALT_SPLASH_DMG 0 /* Stasis Weapon */ #define STASIS_DAMAGE rpg_disruptorDamage.integer @@ -311,7 +583,6 @@ static void WP_FirePhaser( gentity_t* ent, qboolean alt_fire ) ---------------------------------------------- */ -#define COMPRESSION_SPREAD 100 #define MAXRANGE_CRIFLE 8192 #define CRIFLE_SIZE 1 /* RPG-X | Marcin | 04/12/2008 */ @@ -457,13 +728,7 @@ static void WP_FireCompressionRifle ( gentity_t* ent, qboolean alt_fire ) ---------------------------------------------- */ -#define STASIS_SPREAD 0.085f /* Roughly equivalent to sin(5 deg).*/ -#define STASIS_MAIN_MISSILE_BIG 1 -#define STASIS_MAIN_MISSILE_SMALL 1 -#define STASIS_ALT_RIGHT_OFS 0.10 -#define STASIS_ALT_UP_OFS 0.02 -#define STASIS_ALT_MUZZLE_OFS 1 -#define MAXRANGE_ALT_STASIS 4096 +#define STASIS_MAIN_MISSILE_BIG 1 /** * \brief Fires a disruptor missile. @@ -606,15 +871,8 @@ static void WP_FireDisruptor( gentity_t* ent, qboolean alt_fire ) #define GRENADE_VELOCITY 1000 #define GRENADE_TIME 2000 #define GRENADE_SIZE 4 -#define GRENADE_ALT_VELOCITY 1200 #define GRENADE_ALT_TIME 2500 -#define SHRAPNEL_DAMAGE 30 -#define SHRAPNEL_DISTANCE 4096 -#define SHRAPNEL_BITS 6 -#define SHRAPNEL_RANDOM 3 -#define SHRAPNEL_SPREAD 0.75 - /** * \brief Exploding a grenade. * diff --git a/code/game/g_weapon.h b/code/game/g_weapon.h index e3f1713..82773dc 100644 --- a/code/game/g_weapon.h +++ b/code/game/g_weapon.h @@ -1,11 +1,146 @@ -#ifndef _G_WEAPON_H -#define _G_WEAPON_H - -#include "g_local.h" - -vec3_t forward; -vec3_t right; -vec3_t up; -vec3_t muzzle; - -#endif /* _G_WEAPON_H */ +#ifndef _G_WEAPON_H +#define _G_WEAPON_H + +#include "g_local.h" + +vec3_t forward; +vec3_t right; +vec3_t up; +vec3_t muzzle; + +struct weaponConfigPhaserP_s { + int32_t damage; + double range; + int32_t variation; +}; +struct weaponConfigPhaserS_s { + int32_t damage; + double radius; + double range; + int32_t variation; +}; + +struct weaponConfigPhaser_s { + struct weaponConfigPhaserP_s primary; + struct weaponConfigPhaserS_s secondary; +}; + +struct weaponConfigCRifleP_s { + int32_t damage; + double range; +}; + +struct weaponConfigCRifleS_s { + int32_t damage; + double range; + int32_t size; +}; + +struct weaponConfigCRifle_s { + struct weaponConfigCRifleP_s primary; + struct weaponConfigCRifleS_s secondary; +}; + +struct weaponConfigDisruptorP_s { + int32_t damage; + int32_t range; +}; + +struct weaponConfigDisruptorS_s { + int32_t damage; + int32_t size; +}; + +struct weaponConfigDisruptor_s { + struct weaponConfigDisruptorP_s primary; + struct weaponConfigDisruptorS_s secondary; +}; + +struct weaponConfigSplash_s { + int32_t radius; + int32_t damage; +}; + +struct weaponConfigGrenadeP_s { + int32_t damage; + double velocity; + int32_t time; + double size; + struct weaponConfigSplash_s splash; +}; + +struct weaponConfigGrenadeS_s { + int32_t damage; + int32_t time; + struct weaponConfigSplash_s splash; +}; + +struct weaponConfigGrenade_s { + struct weaponConfigGrenadeP_s primary; + struct weaponConfigGrenadeS_s secondary; +}; + +struct weaponConfigTR116P_s { + int32_t damage; + int32_t range; +}; + +struct weaponConfigTR116_s { + struct weaponConfigTR116P_s primary; +}; + +struct weaponConfigQuantumP_s { + int32_t damage; + double size; + struct weaponConfigSplash_s splash; +}; + +struct weaponConfigQuantumSThinkSearch_s { + int32_t time; + double distance; +}; + +struct weaponConfigQuantumSThink_s { + int32_t time; + struct weaponConfigQuantumSThinkSearch_s search; +}; + +struct weaponConfigQuantumS_s { + int32_t damage; + double size; + struct weaponConfigSplash_s splash; + struct weaponConfigQuantumSThink_s think; +}; + +struct weaponConfigQuantum_s { + struct weaponConfigQuantumP_s primary; + struct weaponConfigQuantumS_s secondary; +}; + +struct weaponConfigHyperspannerP_s { + int32_t rate; +}; + +struct weaponConfigHyperspannerS_s { + int32_t rate; +}; + +struct weaponConfigHyperspanner_s { + struct weaponConfigHyperspannerP_s primary; + struct weaponConfigHyperspannerS_s secondary; +}; + +typedef struct weaponConfig_s weaponConfig_t; +struct weaponConfig_s { + struct weaponConfigPhaser_s phaser; + struct weaponConfigCRifle_s crifle; + struct weaponConfigDisruptor_s disruptor; + struct weaponConfigGrenade_s grenade; + struct weaponConfigTR116_s tr116; + struct weaponConfigQuantum_s quantum; + struct weaponConfigHyperspanner_s hyperspanner; +}; + +void G_Weapon_LoadConfig(void); + +#endif /* _G_WEAPON_H */