Source-Changes archive

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

CVS commit: src/usr.bin/xlint/lint1



Module Name:    src
Committed By:   rillig
Date:           Fri Apr 29 22:44:44 UTC 2022

Modified Files:
        src/usr.bin/xlint/lint1: cgram.y

Log Message:
lint: make grammar compatible with Bison

Bison and BSD Yacc differ in how they translate the grammar into C code.

Bison:
        code above '%union' (YYDEBUG is either undefined or 1)
        #include "cgram.h" (which defines YYDEBUG to 0 if undefined)
        code from below '%union' until the first '%%'
        actions
        code below the second '%%'

BSD Yacc:
        code above the first '%%' (YYDEBUG is either undefined or 1)
        (no #include for "cgram.h")
        define YYDEBUG to 0 if undefined
        code below the second '%%' (YYDEBUG is either 0 or 1)
        actions

The easiest way around these differences is to remove the 'defined(...)'
around the conditionals YYDEBUG, YYBISON and YYBYACC.


To generate a diff of this commit:
cvs rdiff -u -r1.406 -r1.407 src/usr.bin/xlint/lint1/cgram.y

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index