Context-free grammar for C

前端 未结 2 562
清歌不尽
清歌不尽 2020-12-28 16:31

I\'m working on a parser for C. I\'m trying to find a list of all of the context-free derivations for C. Ideally it would be in BNF or similar. I\'m sure such a thing is out

相关标签:
2条回答
  • 2020-12-28 17:12

    You could always use Annex A of the C11 standard itself. The freely available draft standard will work for your purposes, at http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf .

    0 讨论(0)
  • 2020-12-28 17:18

    This is an ANSI-C grammar, updated to C11 standard. Should serve your purpose.

    http://www.quut.com/c/ANSI-C-grammar-y.html

    0 讨论(0)
提交回复
热议问题