Click here to Skip to main content
15,881,898 members
Articles / Programming Languages / C#

C# CodeDOM parser

Rate me:
Please Sign up or sign in to vote.
4.56/5 (14 votes)
27 Jun 20026 min read 247.7K   4.3K   70  
This is a utility which parses C# source code and creates the CODEDOM tree of the code.
Problems with the CodeDom:
CodeCompile unit do not have space for using directives or ns mebers, so they are placed now into first default NS
using_alias_directive - no support found
nested namespaces - no support found ( so parser is flattening ns hierarchy)
variable declaration list (int i,j,k;) - no support - transformend to individual var declarations
pointer_type - no support found
"jagged" array type (array of arrays) - MS CSharpCodeProvider reverses order of ranks 
params keyword - not supported - param is there as orinary array type param
private modifier on nested delagate is not shown by CSharpCodeProvider (all other nested types works fine)
unsafe modifier - no support found
readonly modifier - no support found
volatile modifier - no support found
explicit interface implementation - not implemented yet (I think this can be done)
add and remove accessors for Event - no support found
virtual and override modifiers do not work in MS CSharpCodeProvider for events
Operator members and Destructors - no support found
Expressions - no unary expressions at all !!!, only one dim arrays, some operators not supported and more
Attribute targets : no support found
Attributes on accessor : no support found
If CompileUnit contains custom attributes in global scope, CSSharpCodeProvider prints then before global using directives 
(it is due to that using has to be in the first ns)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Czech Republic Czech Republic
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions