grammars-v4
grammars-v4 copied to clipboard
[golang] Fix for #4469: Add symbol table.
This is a fix for #4488.
This PR fixes all ambiguity in the grammar with the addition of explicit actions and predicates. This is likely the first grammar in grammars-v4 with a full-scale symbol table.
The reason for the symbol table is that the Go language is not context-free. The EBNF grammar from the Go Language Specification is ambiguous. The semantics to disambiguate the EBNF grammar is given in the Spec, but it is not in the EBNF itself. This PR adds that part of the semantics explicitly into the grammar using actions and predicates in target-agnostic format.
In addition, some parts of the grammar were just incorrect, somehow erroneously copied from the Spec.
This PR is being tested against the Go runtime.
Current status of testing of the Go runtime: 2835 success out of 3058 total .go files.
This is the test suite. goroot-src.tar.gz