[vtk-developers] vtkParse.l : allowing a more flexible class name syntax

Sebastien BARRE sebastien at barre.nom.fr
Sun Sep 16 11:18:42 EDT 2001


Hi

I'd like to use the VTK Tcl/Python parsers on my own classes (sometimes in 
the future :)...

For the moment, the parsers will only parse a class which name starts with 
"vtk".
Would it be possible to slightly modify vtkParse.l to allow a broader syntax ?

I don't know anything about lexers, but I guess this line :
	"class "[\t\n ]*"vtk"[a-zA-Z0-9_]*[\t\n ]*";"  return(CLASS_REF);
could be changed to :
	"class "[\t\n ]*[a-zA-Z0-9_]*[\t\n ]*";"  return(CLASS_REF);

These lines look suspects too, but I'm not sure... :
	"vtk"[0-9a-zA-Z_]*  { yylval.str = (char *)malloc(yyleng + 1);
                      memcpy(yylval.str,yytext,yyleng);
                      yylval.str[yyleng] = '\0';
                      return(VTK_ID);
                     }

Sadly, I don't have any robust win32 tool to modify and update the lexer... 
Prabhu :) ?
Of course I'd rebuild VTK first to test if everything is still wrapped 
correctly...




More information about the vtk-developers mailing list