Branch: refs/heads/master
  Home:   https://github.com/tianocore/edk2
  Commit: ae240285120b7249a8ce1cae7fa49c7341583c3b
      
https://github.com/tianocore/edk2/commit/ae240285120b7249a8ce1cae7fa49c7341583c3b
  Author: Michael Kubacki <[email protected]>
  Date:   2026-02-27 (Fri, 27 Feb 2026)

  Changed paths:
    M BaseTools/Source/Python/Ecc/CParser4/CLexer.py
    M BaseTools/Source/Python/Ecc/CParser4/CListener.py
    M BaseTools/Source/Python/Ecc/CParser4/CParser.py

  Log Message:
  -----------
  BaseTools/Ecc: Regenerate CParser4 files with ANTLR 4.9

The CParser4 Python parser files (CLexer.py, CParser.py, CListener.py)
were generated 7 years ago with ANTLR 4.7.1.

Meanwhile, pip-requirements.txt pins antlr4-python3-runtime to version
4.9 in commit 4a7dd50, but the files were patched, not fully
regenerated. This version mismatch produced two failures when running
EccMain.py against non-trivial C code:

1. A runtime warning on every file parsed:
   "ANTLR runtime and generated code versions disagree: 4.9!=4.7.1"

2. A crash when parsing complex C constructs that exercise the
   struct/union definition rule in CParser.py:

   TypeError: '<' not supported between instances of 'tuple' and 'int'

   This occurs in antlr4/BufferedTokenStream.py getText() because the
   4.9 runtime changed the expected argument types for that method,
   and the 4.7.1-generated parser was passing a tuple where an int is
   now required.

This change regenerates the CParser4 files with ANTLR 4.9 to resolve
the version mismatch.

Steps used to regenerate the files:

  1. Download the ANTLR 4.9 complete tool JAR:
     - `https://www.antlr.org/download/antlr-4.9-complete.jar`

  2. Generate Python3 parser files from the grammar:

     ```
     java -jar antlr-4.9-complete.jar `
       -Dlanguage=Python3 -visitor `
       -o BaseTools/Source/Python/Ecc/CParser4_new `
       BaseTools/Source/Python/Ecc/CParser4/C.g4
     ```

Signed-off-by: Michael Kubacki <[email protected]>


  Commit: ba8010bc6c04af4932f69acd1cbf6afa2a423a91
      
https://github.com/tianocore/edk2/commit/ba8010bc6c04af4932f69acd1cbf6afa2a423a91
  Author: Michael Kubacki <[email protected]>
  Date:   2026-02-27 (Fri, 27 Feb 2026)

  Changed paths:
    M BaseTools/Source/Python/Ecc/CParser4/CLexer.py
    M BaseTools/Source/Python/Ecc/CParser4/CListener.py
    M BaseTools/Source/Python/Ecc/CParser4/CParser.py

  Log Message:
  -----------
  BaseTools/Ecc: Apply CParser4 ANTLR 4.9 regeneration whitespace changes

Whitespace-only changes produced by the ANTLR 4.9 code generator.

Signed-off-by: Michael Kubacki <[email protected]>


  Commit: 0cdbc92544909d1843605ba0561eb4e4519ded34
      
https://github.com/tianocore/edk2/commit/0cdbc92544909d1843605ba0561eb4e4519ded34
  Author: Michael Kubacki <[email protected]>
  Date:   2026-02-27 (Fri, 27 Feb 2026)

  Changed paths:
    M BaseTools/Source/Python/Eot/CParser4/CLexer.py
    M BaseTools/Source/Python/Eot/CParser4/CListener.py
    M BaseTools/Source/Python/Eot/CParser4/CParser.py

  Log Message:
  -----------
  BaseTools/Eot: Regenerate CParser4 files with ANTLR 4.9

The CParser4 Python parser files (CLexer.py, CParser.py, CListener.py)
were generated 7 years ago with ANTLR 4.7.1.

Meanwhile, pip-requirements.txt pins antlr4-python3-runtime to version
4.9 in commit 4a7dd50, but the files were patched, not fully
regenerated. This version mismatch could result in failures when
running against non-trivial C code.

This change regenerates the CParser4 files with ANTLR 4.9 to resolve
the version mismatch. It also updates import statements to correctly
reference Eot instead of Ecc.

Steps used to regenerate the files:

  1. Download the ANTLR 4.9 complete tool JAR:
     - `https://www.antlr.org/download/antlr-4.9-complete.jar`

  2. Generate Python3 parser files

Signed-off-by: Michael Kubacki <[email protected]>


  Commit: 801abc03cd9e75a8a3085bfd9661da113b6f9a5d
      
https://github.com/tianocore/edk2/commit/801abc03cd9e75a8a3085bfd9661da113b6f9a5d
  Author: Michael Kubacki <[email protected]>
  Date:   2026-02-27 (Fri, 27 Feb 2026)

  Changed paths:
    M BaseTools/Source/Python/Eot/CParser4/CLexer.py
    M BaseTools/Source/Python/Eot/CParser4/CListener.py
    M BaseTools/Source/Python/Eot/CParser4/CParser.py

  Log Message:
  -----------
  BaseTools/Eot: Apply CParser4 ANTLR 4.9 regeneration whitespace changes

Whitespace-only changes produced by the ANTLR 4.9 code generator.

Signed-off-by: Michael Kubacki <[email protected]>


Compare: https://github.com/tianocore/edk2/compare/a1abc3032cd2...801abc03cd9e

To unsubscribe from these emails, change your notification settings at 
https://github.com/tianocore/edk2/settings/notifications


_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to