/ Check-in [818bdba5]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add an extra assert() to lemon.c to make debugging easier. Ticket #692. (CVS 1305)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:818bdba5dc25cda56716fdda1781a3d4ecb3a111
User & Date: drh 2004-04-23 23:38:42
Context
2004-04-23
23:43
Begin modifying the BTree code for the new version-3 file format. This is a work-in-progress. As of this check-in, SQLite will not build. (CVS 1306) check-in: ce0bbd3a user: drh tags: trunk
23:38
Add an extra assert() to lemon.c to make debugging easier. Ticket #692. (CVS 1305) check-in: 818bdba5 user: drh tags: trunk
23:20
Branch version_2. Code for version 3 is on the trunk. (CVS 1303) check-in: db84ddf5 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tool/lemon.c.

2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892


2893
2894
2895
2896
2897
2898
2899
*/
void emit_destructor_code(out,sp,lemp,lineno)
FILE *out;
struct symbol *sp;
struct lemon *lemp;
int *lineno;
{
 char *cp;

 int linecnt = 0;
 if( sp->type==TERMINAL ){
   cp = lemp->tokendest;
   if( cp==0 ) return;
   fprintf(out,"#line %d \"%s\"\n{",lemp->tokendestln,lemp->filename);
 }else if( sp->destructor ){
   cp = sp->destructor;
   fprintf(out,"#line %d \"%s\"\n{",sp->destructorln,lemp->filename);
 }else if( lemp->vardest ){
   cp = lemp->vardest;
   if( cp==0 ) return;
   fprintf(out,"#line %d \"%s\"\n{",lemp->vardestln,lemp->filename);


 }
 for(; *cp; cp++){
   if( *cp=='$' && cp[1]=='$' ){
     fprintf(out,"(yypminor->yy%d)",sp->dtnum);
     cp++;
     continue;
   }







|













>
>







2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
*/
void emit_destructor_code(out,sp,lemp,lineno)
FILE *out;
struct symbol *sp;
struct lemon *lemp;
int *lineno;
{
 char *cp = 0;

 int linecnt = 0;
 if( sp->type==TERMINAL ){
   cp = lemp->tokendest;
   if( cp==0 ) return;
   fprintf(out,"#line %d \"%s\"\n{",lemp->tokendestln,lemp->filename);
 }else if( sp->destructor ){
   cp = sp->destructor;
   fprintf(out,"#line %d \"%s\"\n{",sp->destructorln,lemp->filename);
 }else if( lemp->vardest ){
   cp = lemp->vardest;
   if( cp==0 ) return;
   fprintf(out,"#line %d \"%s\"\n{",lemp->vardestln,lemp->filename);
 }else{
   assert( 0 );  /* Cannot happen */
 }
 for(; *cp; cp++){
   if( *cp=='$' && cp[1]=='$' ){
     fprintf(out,"(yypminor->yy%d)",sp->dtnum);
     cp++;
     continue;
   }