antlr / grammars-v4

Grammars written for ANTLR v4; expectation that the grammars are free of actions.
MIT License
9.95k stars 3.68k forks source link

Specification CPP #1891

Open warzunder21 opened 3 years ago

warzunder21 commented 3 years ago

please give a link to the specification that you are using

mycroft8 commented 3 years ago

For what's it's worth, as the files are named CPP14*, I've been assuming that they might correspond to a __cplusplus value of "201402". With that setting (and other settings + other code) my "c/c++ preprocessor" built around the Antlr4 nextToken() methods is somewhat working now; to the point of correctly processing chunks of c/c++ header files from glibc. Now looking at tweaking the parser grammar to get one for the GCC dialects of C/C++. I think the Antlr4 examples are closer to the Clang dialects. Just guessing on that though.

Marti2203 commented 3 years ago

While working on the grammar, I had used the official CPP14 ISO specification

rusefillc commented 2 years ago

https://github.com/antlr/grammars-v4/issues/2475 for newer specification version :)