Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Test failures when using Bison 2.3

#20

On my Ubuntu Intrepid system, I get five test failures when building the csp0 library:

         41 - csp:compile:00-repl-intchoice0 (Failed)
        118 - csp:prenormalize-t:00-repl-intchoice0 (Failed)
        119 - csp:prenormalize-f:00-repl-intchoice0 (Failed)
        246 - csp:normalize-t:00-repl-intchoice0 (Failed)
        247 - csp:normalize-f:00-repl-intchoice0 (Failed)

On my Mac OS box, all tests pass.

It turns out these are currently the only tests that are supposed to cause a parse error. The error message that the testing harness expects includes the position of the syntax error in the input .csp0 file.

It looks like between Bison 2.3 (the version in Ubuntu) and 2.4.1 (the version in MacPorts), the Bison developers changed the position class. In 2.3, the column numbers are 0-based; in 2.4.1, they're 1-based. In both versions, line numbers are 1-based. This discrepancy means that with 2.3, the error message printed out by the CSP₀ compiler doesn't match what the test harness expects.

Reported by Douglas Creager · March 2nd, 2009 @ 02:11 PM

State: resolved
Milestone: 1.0-α4
Assigned to: Douglas Creager Douglas Creager

Activity

  1. Douglas Creager
    Douglas Creager

    More information. The position class is defined by /usr/share/bison/location.cc. In 2.3, the default constructor uses a hard-coded 0 for the initial value of the column field. In 2.4, this is configured by the b4_location_initial_column M4 variable, which is given an default value of 1 in /usr/share/bison/bison.m4.

    March 2nd, 2009 @ 02:40 PM

  2. Douglas Creager
    Douglas Creager

    Here is a thread on the Bison mailing list describing the change:

    http://www.mail-archive.com/bison-patches@gnu.org/msg01142.html

    March 2nd, 2009 @ 02:55 PM

  3. Douglas Creager
    Douglas Creager
    • State changed from new to open
    • Milestone set to 1.0-α4

    March 2nd, 2009 @ 03:58 PM

  4. Douglas Creager
    Douglas Creager
    • State changed from open to resolved

    (from [cfbf8e98479f1270f396db888adb9a01c8bc60dc]) Fixed column numbers when using Bison 2.3

    Bison 2.3 numbers the columns in an input file from 0, whereas 2.4 numbers them from 1. We want to consistently use 1-based column numbers. This was causing a problem with test cases that would generate (expected) parse errors — if the correct test result was generated using Bison 2.4, then that test would fail when using 2.3, and vice versa.

    I could not find an easy way to override the “column” field's default value, so instead, we add code in our Bison grammars to manually reset the column to 1 at the start of each file, and every time a new line is encountered.

    Lighthouse: [#20 Test failures when using Bison 2.3 state:resolved] http://github.com/hst/hst/commit...

    March 2nd, 2009 @ 04:16 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.