Our DMS Software Reengineering Toolkit with its C Front End can parse "incomplete code".
In particular, given a DMS-based parser, DMS provides both
- nonterminal pattern parsers (that is, DMS will parse any string which is a nonterminal such as expression, statement, declaration. Such parses if successful produce an AST for a designate nonterminal.
- arbitrary substring parsers, which parse just that. The result is a sequence of ASTs that cover the substring. If the substring turns out to be a nonterminal, you get just one tree.
Complications ensue if the fragment uses macros or preprocessor conditionals. You can preconfigure the context of a parse with the necessary macro definitions.
Of course DMS will parse complete compilation units, has a full preprocessor (for which you can control how much of it "expands" vs. is retained by parsing), as well as symbol table construction and control and data flow analysis. The latter bits apply only to whole programs, but could be adapted for program fragments with some effort.
- C# based parser: NO
- Parses C (and other language) fragments: YES