[Chapel Merge] Add a flag to c2chapel to use GNU parser from pycp

Branch: refs/heads/main
Revision: b521dc9
Author: bmcdonald3
Log Message:

Merge pull request #18189 from bmcdonald3/c2chapelgnu

Add a flag to c2chapel to use GNU parser from pycparserext

This PR adds a --gnu-extensions flag to c2chapel to use the GNU parser instead of the
default pycparser. This enables c2chapel to behave the same as before by default,
but also allows you to handle GNUisms if necessary by using the new flag.

The following features are added to c2chapel:

  • --gnu-extensions flag added to switch to GNU parser
    • enables handling of gnuisms
  • void typedefs are now blank
    • Before, they were left with an = ;, which was causing an error
  • New types that hadn't been seen before are now included
    • Old c2chapel (outdated?) code that generated Chapel types that don't exist fixed
  • New reserved words that hadn't been seen yet are now included
    • And also work for general variables, where before it was only arguments to functions
  • Testing added for the GNU parser

Related issue https://github.com/Cray/chapel-private/issues/2309
Longer term effort/motivated by: https://github.com/Cray/chapel-private/issues/2294
Discussion issue: Should c2chapel use the GNU parser by default? · Issue #18209 · chapel-lang/chapel · GitHub

Modified Files:
M doc/rst/tools/c2chapel/c2chapel.rst

M third-party/chpl-venv/c2chapel-requirements.txt
M tools/c2chapel/c2chapel.py
M tools/c2chapel/test/help.good
M tools/c2chapel/test/no-args.2.good
M tools/c2chapel/test/no-args.good
M tools/c2chapel/test/tester.sh

Compare: https://github.com/chapel-lang/chapel/compare/ed69244ce7cd...b521dc98825e