I ran across the SPECS alternate grammar for C++, and while I'm not sure I like some of the more gratuitous syntax changes they made (changing pointers from * to ^, for instance), it turned me on to the idea of tweaking and implementing the new syntax. SPECS claims to be semantically identical to C++, and Clang is pretty modular, so I figured it shouldn't be too hard to write to Clang's AST, and take advantage of all the preexisting code.
That being said, I'm not really sure how easy it would be to modify Clang's current Lexer and Parser to accept different tokens and orderings (thereby taking advantage of their great error messages), or whether it would be easier to do that instead of writing a separate parser that just makes calls to Clang's AST. I've been poking around with the documentation over the past couple days, but I was wondering if someone out here with more experience with the codebase could give me some input on whether I should be searching for
- APIs to change the lexing/parsing functionality
- classes to outright change/subclass for my desired functionality
- the best ways to write my own parsing to interface with the ASTs instead.