Skip to content

yacc -Wconflicts-sr and -Wconflicts-srr warnings #25

@crobinso

Description

@crobinso

Build on f43 has these yacc warnings:

...
index-parse.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr]
index-parse.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr]
index-parse.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
...
updating index-parse.h
/usr/bin/make  all-am
  LEX      index-scan.c

Running with -Wcounterexamples gives this output. I have not attempted to make sense of it, so I'm just documenting it here

/home/crobinso/src/guestfs-tools/builder/index-parse.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr]
/home/crobinso/src/guestfs-tools/builder/index-parse.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr]
/home/crobinso/src/guestfs-tools/builder/index-parse.y: warning: shift/reduce conflict on token EMPTY_LINE [-Wcounterexamples]
  First example: emptylines section EMPTY_LINE • EMPTY_LINE emptylines emptylines sections $end
  Shift derivation
    $accept
    ↳ 0: index                                                                                           $end
         ↳ 1: sections
              ↳ 4: emptylines section emptylines                                     emptylines sections
                                      ↳ 13: EMPTY_LINE emptylines
                                                       ↳ 13: • EMPTY_LINE emptylines
  Second example: emptylines section EMPTY_LINE EMPTY_LINE • EMPTY_LINE emptylines section emptylines $end
  Reduce derivation
    $accept
    ↳ 0: index                                                                                                                   $end
         ↳ 1: sections
              ↳ 4: emptylines section EMPTY_LINE emptylines                  sections
                                                 ↳ 13: EMPTY_LINE emptylines ↳ 3: emptylines                  section emptylines
                                                                  ↳ 12: ε •       ↳ 13: EMPTY_LINE emptylines
/home/crobinso/src/guestfs-tools/builder/index-parse.y: warning: shift/reduce conflict on token EMPTY_LINE [-Wcounterexamples]
  Example: emptylines section EMPTY_LINE • EMPTY_LINE emptylines section
  Shift derivation
    sections
    ↳ 4: emptylines section EMPTY_LINE emptylines                    sections
                                       ↳ 13: • EMPTY_LINE emptylines ↳ 3: emptylines section emptylines
                                                          ↳ 13: ε                            ↳ 3: ε
  Reduce derivation
    sections
    ↳ 4: emptylines section EMPTY_LINE emptylines sections
                                       ↳ 12: ε •  ↳ 3: emptylines                  section emptylines
                                                       ↳ 13: EMPTY_LINE emptylines         ↳ 3: ε
/home/crobinso/src/guestfs-tools/builder/index-parse.y: warning: reduce/reduce conflict on tokens $end, PGP_EPILOGUE [-Wcounterexamples]
  Example: emptylines section EMPTY_LINE emptylines •
  First reduce derivation
    sections
    ↳ 4: emptylines section EMPTY_LINE emptylines sections
                                                  ↳ 5: emptylines
                                                       ↳ 12: ε •
  Second reduce derivation
    sections
    ↳ 3: emptylines section emptylines
                            ↳ 13: EMPTY_LINE emptylines •
updating index-parse.h

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions