[GRASS5] PATCH: sql expression parser

Michael Tiemann tiemann at redhat.com
Sun Jun 12 18:45:35 EDT 2005


To me this shows that the original lex, written and released before ANSI
C was standardized, generates code that is now, 30 years later, so
anachronistic that it's no longer a reasonable reference point.  flex
and byacc (or bison) forever!  (Forever because, as open source, they
are still maintained.)

M

On Sun, 2005-06-12 at 18:27, Paul Kelly wrote:
> On Sat, 11 Jun 2005, Daniel Calvelo Aros wrote:
> 
> > Paul, could you try moving the comments within the "C" part of the code?
> 
> Surrounding all the comments that weren't within a section of C-code like 
> this:
> %{
>     /*******************
>      ** Comments Here **
>      *******************/
> %}
> worked and got lex to generate lex.yy.c OK. Although I'd imagine there 
> might be a better way of doing it and as Glynn suggested do the comments 
> really need to be there?
> 
> When we go to compile lex.yy.c however there are further errors:
> 
> /usr/ccs/bin/lex lex.l
> 494/1200 nodes(%e), 1064/2500 positions(%p), 145/500 (%n), 8347 
> transitions,
> 448/10000 packed char classes(%k),  1318/2000 packed transitions(%a), 
> 1655/12000 output slots(%o)
> gcc -I/home/pkelly/grass/grass6/include 
> -I/home/pkelly/grass/grass6/dist.sparc-sun-solaris2.8/include/grass  -O2 
> -Wall -Wconversion -Wno-implicit-int   -fPIC    -DPACKAGE=\""grasslibs"\" 
> -DPACKAGE=\""grasslibs"\"  -I/home/pkelly/grass/grass6/include 
> -I/home/pkelly/grass/grass6/dist.sparc-sun-solaris2.8/include/grass \
>          -o OBJ.sparc-sun-solaris2.8/lex.yy.o -c lex.yy.c
> lex.l:40: warning: return type defaults to `int'
> lex.l: In function `yylex':
> lex.l:41: warning: unused variable `yyprevious'
> lex.l:54: warning: label `yyfussy' defined but not used
> lex.l: In function `my_yyinput':
> lex.l:238: warning: passing arg 3 of `memcpy' as unsigned due to prototype
> lex.l: In function `yyerror':
> lex.l:256: warning: implicit declaration of function `yy_flush_buffer'
> lex.l:256: error: `YY_CURRENT_BUFFER' undeclared (first use in this 
> function)
> lex.l:256: error: (Each undeclared identifier is reported only once
> lex.l:256: error: for each function it appears in.)
> lex.l: At top level:
> lex.l:716: warning: missing braces around initializer
> lex.l:716: warning: (near initialization for `yycrank[0]')
> lex.l:1132: warning: missing braces around initializer
> lex.l:1132: warning: (near initialization for `yysvec[0]')
> lex.l:1331: warning: ignoring #pragma ident
> make: *** [OBJ.sparc-sun-solaris2.8/lex.yy.o] Error 1
> 
> _______________________________________________
> grass5 mailing list
> grass5 at grass.itc.it
> http://grass.itc.it/mailman/listinfo/grass5




More information about the grass-dev mailing list