removed sign in number tokenizer
pass floats and integer as strings
This commit is contained in:
parent
7e06e5ade7
commit
e8bfc348be
|
@ -76,9 +76,9 @@
|
||||||
"extsupport" return(FunExtsupport);
|
"extsupport" return(FunExtsupport);
|
||||||
|
|
||||||
[a-zA-Z_]+ { yylval.string = strdup(yytext); return(Ident); };
|
[a-zA-Z_]+ { yylval.string = strdup(yytext); return(Ident); };
|
||||||
[-+]?[0-9]+ { yylval.num = atoi(yytext); return(ValInt); };
|
[0-9]+ { yylval.string = strdup(yytext); return(ValInt); };
|
||||||
\"([^\"\n])*\" {yylval.string = strdup(yytext); return(ValStr);};
|
\"([^\"\n])*\" {yylval.string = strdup(yytext); return(ValStr);};
|
||||||
\"\"\"([^\"\n]|\\\n)*\"\"\" {yylval.string = strdup(yytext); return(ValMultistr);};
|
\"\"\"([^\"\n]|\\\n)*\"\"\" {yylval.string = strdup(yytext); return(ValMultistr);};
|
||||||
[-+]?[0-9]*\.[0-9]+ {yylval.real = atof(yytext); return(ValFloat);};
|
[0-9]*\.[0-9]+ {yylval.string = strdup(yytext); return(ValFloat);};
|
||||||
.;
|
.;
|
||||||
%%
|
%%
|
||||||
|
|
|
@ -8,16 +8,14 @@
|
||||||
|
|
||||||
%union {
|
%union {
|
||||||
char *string;
|
char *string;
|
||||||
int num;
|
|
||||||
float real;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
%token KeyInt
|
%token KeyInt
|
||||||
%token KeyFloat
|
%token KeyFloat
|
||||||
%token KeyAs
|
%token KeyAs
|
||||||
%token <num> ValInt
|
%token <string> ValInt
|
||||||
%token <string> Ident
|
%token <string> Ident
|
||||||
%token <real> ValFloat
|
%token <string> ValFloat
|
||||||
%token <string> ValStr
|
%token <string> ValStr
|
||||||
%token <string> ValMultistr
|
%token <string> ValMultistr
|
||||||
%token KeyShort
|
%token KeyShort
|
||||||
|
|
Loading…
Reference in New Issue