Skip to content

Incorrect LL Parsing Table Entries #158

@MammarDr

Description

@MammarDr

I was working on my parser and wanted to validate my outputs but i may ended up finding a bug here, or.... my theory is just bad.

Grammar:

S: A B C;
A: a A |  /*eps*/ ;
B: b B | C d| /*eps*/ ;
C: c C | A e | /*eps*/ ;
D: S f | A D | g;

FIRST sets:
S = { a, b, c, d, e, ε }
A = { a, ε }
B = { a, b, c, d, e, ε }
C = { a, c, e, ε }
D = { a, b, c, d, e, f, g }

FOLLOW sets:
S = { $, f }
A = { a, b, c, d, e, f, g, $ }
B = { a, c, e, $, f }
C = { d, $, f }
D = {}

Wrong LL Parsing Table:

       a       b       c       d       e      f      g       $

S      1       1       1       1       1      -      -       -

S derives ε from First(ABC) so next it should be calculating Follow(S) ∈ {f, $}

Correct LL Parsing Table:

       a       b       c       d       e      f      g       $

S      1       1       1       1       1      1      -       1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions