Incomplete instructions to build vtkParse.tab.c
I ran into inconsistencies when generating vtkParse.tab.c
from vtkParse.y
. I followed all instructions in https://gitlab.kitware.com/vtk/vtk/-/tree/master/Wrapping/Tools?ref_type=heads#vtkparsey. It suggests a series of patches that must be manually applied. Even after all those patches, vtkParse.tab.c
fails to compile successfully. Most of these are a case of garbage-in-garbage-out.
As a reminder, vtkParse.y contains the rules for parsing a C++ header file. This is a core part of the python/java wrapping tools.
Here's what I found inconsitent/missing:
- There is a wrong use of
==
operator instead of=
op invtkParse.y
. Generates
static const char** MacroIncludes == NULL;
when it should be
static const char** MacroIncludes = NULL;
- Instructions don't ask to add
// NOLINTNEXTLINE(bugprone-suspicious-include)
before#include "lex.yy.c"
. - Invokes
vtkParsePreprocess_Init
with incorrect args.vtkParsePreprocess_Init
doesn't takedt
. - Doesn't address the prologue docstring containing copyright from FSF.
- There are more static inlines in
vtkParse.tab.c
, which could mean somebody skipped runingbison
onvtkParse.y
or didn't follow the instructions correctly.
I ran these commands with bison 3.8.2
$ bison --no-lines -b vtkParse vtkParse.y
$ clang-format-8 -i ./vtkParse.tab.c
It would be nice if vtkParse.tab.c
is configure-time generated from vtkParse.y
, patched and styled in CMake, but that needs bison on windows, which is not readily available.