scanner.l

changeset 34
8d7bd2fa5db6
parent 32
3aac131058da
child 48
3d0be1c1c1b2
     1.1 diff -r 44d823824a46 -r 8d7bd2fa5db6 scanner.l
     1.2 --- a/scanner.l	Tue Jan 01 10:18:33 2002 +0000
     1.3 +++ b/scanner.l	Wed Jan 02 10:17:24 2002 +0000
     1.4 @@ -1,5 +1,5 @@
     1.5  /*
     1.6 -$Id: scanner.l,v 1.14 2002/01/01 02:16:50 eric Exp $
     1.7 +$Id: scanner.l,v 1.15 2002/01/02 02:17:24 eric Exp $
     1.8  */
     1.9  
    1.10  %option case-insensitive
    1.11 @@ -29,8 +29,13 @@
    1.12  [\,;{}]		{ return (yytext [0]); }
    1.13  {dot}{dot}	{ LDBG(("elipsis\n")); return (ELIPSIS); }
    1.14  
    1.15 +  /* decimal integer */
    1.16  {digit}+	{ yylval.integer = atoi (yytext); LDBG(("integer %d\n", yylval.integer)); return (INTEGER); }
    1.17 -{digit}+\.{digit}+ { yylval.fp = atof (yytext); return (FLOAT); }
    1.18 +
    1.19 +  /* floating point number - tricky to make sure it doesn't grab an integer
    1.20 +     followed by an elipsis */
    1.21 +-?{digit}+\.{digit}+ { yylval.fp = atof (yytext); return (FLOAT); }
    1.22 +-?{digit}+\./[^.] { yylval.fp = atof (yytext); return (FLOAT); }
    1.23  
    1.24  a		{ yylval.size.width = 8.5;
    1.25  		  yylval.size.height = 11.0;