parsingprogramming-languagespeg

Does C11, C99 or C23 have a PEG specification?


Is there a PEG parser for C language?

Is there any list of programming languages with a PEG specification?


Solution

  • "Does C11, C99 or C23 have a PEG specification?"

    C specifications use BNF format, so officially no.

    "Is there a peg parser for the C language?"

    If by this you mean a library for parsing the grammars, yes, there are a few. packcc is one.

    "Is there a list of programming languages with a PEG specification?"

    I'm not aware of any extensive list, but you can find a Java and (very old) C grammar here. Later versions of CPython (a common python interpreter) use PEG specs too, see https://github.com/python/cpython/blob/main/Grammar/python.gram.