C# Parser and CodeDOM (semantic object model)
A complete C# 5.0 parser, resolver, object model, formatter, metrics generator, code analyzer, etc.
This is a 100% managed code library (Nova.CodeDOM.dll) that can be used to load and parse any C# solution, project, or source file(s),
create a semantic object model in memory, and resolve all symbolic references. The code object tree can then be inspected, searched,
modified, and saved back to the original input files with controllable formatting. Also includes documentation, examples, a WPF-based
test tool (Nova.Studio), and a command-line tool (Nova.CLI). Online Documentation
We've invested a lot of time and effort to implement a clean, efficient, and easy-to-use C# parser and CodeDOM.
We've implemented all of the details of the massive C# 5.0 language specification, so that you don't have to.
Features include:
- This library is basically a C# Parser, C# CodeDOM, C# Formatter, C# Metrics Tool, and C# Analyzer all-in-one!
- Full support for all C# 5.0 features, including the new async functionality.
- Provides a clean, consistent, and complete semantic object model ("CodeDOM") for C#, including project and solution files.
- Loads any C# sources: Solution files, Project files, C# source files, or code fragments.
- Retains comments and formatting information, but is not a messy syntax tree (AST) - there's no need to deal with tree nodes for parens, braces, commas, etc.
Also, the tree is not read-only - it's fully modifiable and savable.
- Memory-efficient code model can handle over 2,000,000 code objects in less than 150 MB.
- Loads referenced assemblies and resolves symbolic references, handling type inference, overload resolution, implicit conversions,
and the other gritty details of the 500+ page C# language specification (plus some undocumented or incorrect items).
- Runs on .NET or Mono, using either Mono Cecil or .NET Reflection (on either platform) to load metadata from assemblies.
- Fully compliant with ECMA-334 and ECMA-335 standards. Passes all Mono tests.
- Reports any parse and resolve errors, and optionally all "TODO" and "HACK" type comments in the code.
- Supports use of the Visitor design pattern to traverse the code object tree, and includes visitors to search for
code objects by type, reference, or text with various options including regular expressions.
- Supports use of LINQ queries on the code object tree, to find patterns of code or generate metrics.
- The resulting CodeDOM tree can be analyzed, modified, and saved back to the input files as desired.
- Cleanly and consistently formats output C# source with various formatting options.
- Also allows for easy manual programmatic code creation, including project and solution files.
- Manually created objects are formatted according to configured defaults, but can be overridden if desired.
- Handles and preserves conditional compilation directives.
- Includes support for generating code Metrics, and can also be used for Analysis and Refactoring.
- Supports undocumented C# language features such as: __arglist, __makeref, __reftype, __refvalue.
- Can be used to analyze sources, clean-up formatting, detect coding guideline deviations, generate metrics, translate or obfuscate sources,
refactor code, or any other programmatic manipulation of C# source code.
- Create your own tool to augment your build process, or create the next great C# development tool!
Ready to try it out? Downloads
Is your credit card already in your hand? Purchase