[Ovmsdev] yacc/lex on component/dbc

Michael Balzer dexter at expeedo.de
Sun Nov 25 15:32:08 HKT 2018


Craig,

it seems you really have yacc, which doesn't have bisons C++ mode. Try replacing yacc with bison.

Regards,
Michael


Am 24.11.18 um 22:33 schrieb Craig Leres:
> On 11/22/18 8:38 PM, Mark Webb-Johnson wrote:
>> Could you guys check, and let me know if you see any issues? In particular, on windows. If no issues, I’ll proceed and finish up the grammar and implementation.
>
> I'm unable to compile this under FreeBSD.
>
> I think the first problem is really a FreeBSD bug. When !defined(__FreeBSD__) the generated code unconditionally defines __dead2 in flex.skl just before
> including stdio.h which includes sys/cdefs.h. But the toolchain version of sys/cdefs.h also defines __dead2. Here's the problem report I filed:
>
>     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=233481
>
> After solving that my build fails with:
>
>     CC /home/ice/u0/leres/src/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/build/dbc/yacclex/dbc_tokeniser.o
>
> /home/ice/u0/leres/src/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/dbc/src/dbc_tokeniser.l:38:26: fatal error: dbc_parser.hpp: No such file or
> directory
>     compilation terminated.
>     gmake[1]: *** [/home/ice/u0/leres/esp/openvehicles-xtensa-esp32-elf/make/component_wrapper.mk:286: yacclex/dbc_tokeniser.o] Error 1
>
> I suspect the makefile is assuming flex/lex will generate dbc_parser.hpp; mine generates dbc_parser.cpp. If i put in a symlink for dbc_parser.hppI can get
> incrementally further:
>
>     CC /home/ice/u0/leres/src/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/build/dbc/yacclex/dbc_tokeniser.o
>     In file included from /home/ice/u0/leres/src/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/dbc/src/dbc_tokeniser.l:38:0:
>
> /home/ice/u0/leres/src/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/dbc/src/dbc_parser.y:43:18: fatal error: string: No such file or directory
>     compilation terminated.
>     gmake[1]: *** [/home/ice/u0/leres/esp/openvehicles-xtensa-esp32-elf/make/component_wrapper.mk:286: yacclex/dbc_tokeniser.o] Error 1
>     gmake: *** [/home/ice/u0/leres/esp/esp-idf/make/project.mk:468: component-dbc-build] Error 2
>
> That looks c++ code in dbc_parser.y that's being compiled with the C compiler?
>
>     #include <string>
>
> If I change it to string.h then I have problems with dbc.h:
>
>     #include <string>
>     #include <map>
>     #include <list>
>
> And in this case it looks like dbc.h is included by both c++ and C sources.
>
>         Craig
> _______________________________________________
> OvmsDev mailing list
> OvmsDev at lists.openvehicles.com
> http://lists.openvehicles.com/mailman/listinfo/ovmsdev

-- 
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26




More information about the OvmsDev mailing list