[vtk-developers] Need some help with vtkParse.y

Prabhu Ramachandran prabhu at aero.iitm.ernet.in
Sat Apr 28 13:02:17 EDT 2001


hi,

I made the necessary changes to vtkSetGet.h to add the
Get##name##MinValue and MaxValue to the SetClampMacro.  It works fine
for the C++ code but is not parsed by the wrapper generator and hence
the method is not available under Python/Tcl/Java.  I know absolutely
no yacc/bison but kind of kludged my way through and actually added
the methods to vtkParse.y.  However I ran into two problems

Under GNU Bison version 1.28, while running yacc through the
vtkParse.y I got the foll error.

$ yacc -b vtkParse vtkParse.y
vtkParse.y:854: type clash (`' `str') on default action
vtkParse.y:854: type clash (`' `integer') on default action
$

I then downloaded yacc version 1.25 (the oldest I could lay my hands
on) and it still had the same problem.  I tried on an ancient linux
machine and it finally worked.  Unfortunately that machine is down now
so I cant test anymore. :(

I then removed the offending STRING and NUM in line 854 and tried
running yacc again.  yacc worked and I then used the vtkPrint
executable to parse a sample header.  It didnt work and I would get

"*** SYNTAX ERROR found in parsing the header file... ***\n" 

this error instead.  However, I removed the return from the function
that generated this and then atleast some output was generated after
which I would get the same "SYNTAX ERROR ..." message.  Using this, I
somehow got the Get%sMinValue and Get%sMaxValue working.  Ad Hoc
programming indeed. :)

Anyway, the problem now is that I cant really test the new parser
stuff.  I do have a patch for the vtkParse.y that does the job.  So
can someone help me with either 

  (1) running yacc -b vtkParse vtkParse.y for my modified vtkParse.y
  and sending me the resulting vtkParse.tab.c which I will test here.

  (2) Or doing (1) and testing it yourselves.  I can mail you the
  modified vtkSetGet.h too.


thanks,
prabhu




More information about the vtk-developers mailing list