[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Visual Studio - win_bison creates tab.h file exceeding compiler limits

From: Jot Dot
Subject: Visual Studio - win_bison creates tab.h file exceeding compiler limits
Date: Mon, 9 Nov 2020 05:08:50 -0700 (MST)

This is a summary of: [ https://github.com/lexxmark/winflexbison/issues/67 | 
https://github.com/lexxmark/winflexbison/issues/67 ] 

bison generates the tab.h file using YY_ASSERT macros in many places. 
bison is generating lines longer than the microsoft compiler allows, which 
causes a C2026 error. (Line exceeds 16380 bytes). 

I am starting to write a SQL parser. I placed over 800 reserved words into the 
.y file as tokens. 
Obviously, as I am just starting off, I am no where near using all of them in 
the rules. 

bison is generating asserts to check for valid tokens but a couple lines are 
over 21700 bytes long. 
Since the compiler truncates the line, any YY_ASSERT() macro fails because the 
line is simply snipped. Thus it does not even encounter the trailing ')'. 
Naturally the compiler spits out gibberish at this point. 

Although I've known about lex/yacc and flex/bison for years, this is my first 
real attempt to use it. This means I could be doing something "non-standard". 
But my work so far was working with the standard C generation method. It is 
only now, converting it to C++, did I encounter this. 

It's easy enough to build, manually comment out the offending line, and then 
build again, but this is getting to be time consuming and highly annoying. 
Any fix or ideas would be greatly appreciated. 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]