Click here to Skip to main content
15,893,564 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 248.1K   4.3K   70  
This is a utility which parses C# source code and creates the CODEDOM tree of the code.
// SupportTypes.cs: Contains different additional classes, which agregate some for 
//CODEDOM object creation 
//
// Written by IZ for purposes of CS CODEDOM Parser, 2002
//(c) 2002 Ivan Zderadicka (ivan.zderadicka@seznam.cz)
using System;
using System.CodeDom;

namespace IvanZ.CSParser
{
	/// <summary>
	/// Summary description for SupportTypes.
	/// </summary>
	public class IndexerDecl
	{
		
		public string Name;
		public CodeParameterDeclarationExpressionCollection Params;
		public CodeTypeReference Type;
		public IndexerDecl(string name,
							CodeParameterDeclarationExpressionCollection pars,
							CodeTypeReference type)
		{
			Name=name;
			Params=pars;
			Type=type;
		}
	}

	public class ConstructorInit
	{
		public bool IsBase;
		public CodeExpressionCollection Params;

		public ConstructorInit(bool isBase, CodeExpressionCollection pars)
		{
			IsBase=isBase;
			Params=pars;
		}

	}

	public class ConstructorDecl
	{
		public string Name;
		public CodeParameterDeclarationExpressionCollection Params;
		public ConstructorInit Initializer;

		public ConstructorDecl(string name, 
			CodeParameterDeclarationExpressionCollection pars, 
			ConstructorInit initializer)
		{
			Name=name;
			Params=pars;
			Initializer=initializer;
		}

	}
}

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