Click here to Skip to main content
Click here to Skip to main content
Articles » Languages » C# » General » Downloads
 
Add your own
alternative version

CodeDom Assistant

, 21 Sep 2007
Generating CodeDom Code By Parsing C# or VB
codedomassistant_demo.zip
CodeDomAssistant_Demo
CodeDomAssistant.exe
ICSharpCode.NRefactory.dll
RemoteLoader.dll
SciLexer.dll
ScintillaNet.dll
codedomassistant_src.zip
sln.CodeDomAssistant
CodeDomAssistant
bin
Debug
SciLexer.dll
Properties
Settings.settings
NRefactory
NRefactoryASTGenerator
AST
Project
Configuration
Resources
ICSharpCode.NRefactory.snk
Src
Ast
General
Lexer
BuildKeywords.pl
CSharp
Special
VBNet
Parser
CSharp
cs.ATG
Frames
Parser.frame
Scanner.frame
SharpCoco.exe
VBNet
VBNET.ATG
PrettyPrinter
CSharp
VBNet
Visitors
Test
General
Lexer
CSharp
VBNet
Output
CodeDOM
CSharp
VBNet
Parser
Expressions
GlobalScope
Statements
TypeLevel
RemoteLoader
Properties
ScintillaNET
Configuration
Builtin
LexerKeywordListNames
LexerStyleNames
FindReplace
Printing
Properties
Resources
DeleteHS.png
GoToNextMessage - Copy.png
GoToNextMessage.png
GoToPreviousMessage.png
LineColorHS.png
Thumbs.db
ScintillaNET.csproj.vspscc
Snippets
// <file>
//     <copyright see="prj:///doc/copyright.txt"/>
//     <license see="prj:///doc/license.txt"/>
//     <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
//     <version>$Revision: 1703 $</version>
// </file>

using System;
using System.Collections.Generic;

namespace NRefactoryASTGenerator.Ast
{
	[CustomImplementation]
	abstract class Statement : AbstractNode, INullable {}
	
	[CustomImplementation]
	abstract class StatementWithEmbeddedStatement : Statement {
		Statement embeddedStatement;
	}
	
	[CustomImplementation, HasChildren]
	class BlockStatement : Statement {}
	
	class BreakStatement : Statement {}
	
	enum ContinueType {}
	
	class ContinueStatement : Statement {
		ContinueType continueType;
		
		public ContinueStatement() {}
		public ContinueStatement(ContinueType continueType) {}
	}
	
	enum ConditionType {}
	enum ConditionPosition {}
	
	class DoLoopStatement : StatementWithEmbeddedStatement {
		Expression        condition;
		ConditionType     conditionType;
		ConditionPosition conditionPosition;
		
		public DoLoopStatement(Expression condition, Statement embeddedStatement, ConditionType conditionType, ConditionPosition conditionPosition) {}
	}
	
	class ForeachStatement : StatementWithEmbeddedStatement {
		TypeReference typeReference;
		string        variableName;
		Expression    expression;
		Expression    nextExpression;
		
		public ForeachStatement(TypeReference typeReference, string variableName, Expression expression, Statement embeddedStatement) {}
		public ForeachStatement(TypeReference typeReference, string variableName, Expression expression, Statement embeddedStatement, Expression nextExpression) {}
	}
	
	class ForStatement : StatementWithEmbeddedStatement {
		List<Statement> initializers;
		Expression      condition;
		List<Statement> iterator;
		
		public ForStatement(List<Statement> initializers, Expression condition, List<Statement> iterator, Statement embeddedStatement) {}
	}
	
	class GotoStatement : Statement {
		string label;
		
		public GotoStatement(string label) {}
	}
	
	[IncludeMember(@"
			public IfElseStatement(Expression condition, Statement trueStatement)
				: this(condition) {
				this.trueStatement.Add(Statement.CheckNull(trueStatement));
			}")]
	[IncludeMember(@"
			public IfElseStatement(Expression condition, Statement trueStatement, Statement falseStatement)
				: this(condition) {
				this.trueStatement.Add(Statement.CheckNull(trueStatement));
				this.falseStatement.Add(Statement.CheckNull(falseStatement));
			}")]
	[IncludeBoolProperty("HasElseStatements", "return falseStatement.Count > 0;")]
	[IncludeBoolProperty("HasElseIfSections", "return elseIfSections.Count > 0;")]
	class IfElseStatement : Statement {
		Expression condition;
		List<Statement> trueStatement; // List for stmt : stmt : stmt ... in VB.NET
		List<Statement> falseStatement;
		List<ElseIfSection> elseIfSections;
		
		public IfElseStatement(Expression condition) {}
	}
	
	class ElseIfSection : StatementWithEmbeddedStatement {
		Expression condition;
		
		public ElseIfSection(Expression condition, Statement embeddedStatement) {}
	}
	
	class LabelStatement : Statement {
		string label;
		
		public LabelStatement(string label) {}
	}
	
	[CustomImplementation]
	class LocalVariableDeclaration : Statement {
		TypeReference             typeReference;
		Modifiers                  modifier;
		List<VariableDeclaration> variables;
	}
	
	class LockStatement : StatementWithEmbeddedStatement
	{
		Expression lockExpression;
		
		public LockStatement(Expression lockExpression, Statement embeddedStatement) {}
	}
	
	class ReturnStatement : Statement
	{
		Expression expression;
		
		public ReturnStatement(Expression expression) { }
	}
	
	class ExpressionStatement : Statement {
		Expression expression;
		
		public ExpressionStatement(Expression expression) {}
	}
	
	class SwitchStatement : Statement {
		Expression          switchExpression;
		List<SwitchSection> switchSections;
		
		public SwitchStatement(Expression switchExpression, List<SwitchSection> switchSections) {}
	}
	
	class SwitchSection : BlockStatement {
		List<CaseLabel> switchLabels;
		
		public SwitchSection() { }
		public SwitchSection(List<CaseLabel> switchLabels) { }
	}
	
	[IncludeBoolProperty("IsDefault", "return label.IsNull;")]
	class CaseLabel : AbstractNode {
		Expression         label;
		BinaryOperatorType binaryOperatorType;
		Expression         toExpression;
		
		public CaseLabel() {}
		public CaseLabel(Expression label) {}
		public CaseLabel(Expression label, Expression toExpression) {}
		public CaseLabel(BinaryOperatorType binaryOperatorType, Expression label) {}
	}
	
	class ThrowStatement : Statement {
		Expression expression;
		
		public ThrowStatement(Expression expression) {}
	}
	
	class TryCatchStatement : Statement {
		Statement         statementBlock;
		List<CatchClause> catchClauses;
		Statement         finallyBlock;
		
		public TryCatchStatement(Statement statementBlock, List<CatchClause> catchClauses, Statement finallyBlock) {}
	}
	
	class CatchClause : AbstractNode {
		TypeReference typeReference;
		string     variableName;
		Statement  statementBlock;
		Expression condition;
		
		public CatchClause(TypeReference typeReference, string variableName, Statement statementBlock) {}
		public CatchClause(TypeReference typeReference, string variableName, Statement statementBlock, Expression condition) {}
		public CatchClause(Statement statementBlock) {}
	}
	
	class CheckedStatement : Statement {
		Statement block;
		
		public CheckedStatement(Statement block) {}
	}
	
	class EmptyStatement : Statement {}
	
	class FixedStatement : StatementWithEmbeddedStatement {
		TypeReference             typeReference;
		List<VariableDeclaration> pointerDeclarators;
		
		public FixedStatement(TypeReference typeReference, List<VariableDeclaration> pointerDeclarators, Statement embeddedStatement) {}
	}
	
	[IncludeBoolProperty("IsDefaultCase", "return expression.IsNull;")]
	class GotoCaseStatement : Statement {
		Expression expression;
		
		public GotoCaseStatement(Expression expression) {}
	}
	
	class UncheckedStatement : Statement {
		Statement block;
		
		public UncheckedStatement(Statement block) {}
	}
	
	class UnsafeStatement : Statement {
		Statement block;
		
		public UnsafeStatement(Statement block) {}
	}
	
	class UsingStatement : StatementWithEmbeddedStatement {
		Statement resourceAcquisition;
		
		public UsingStatement(Statement resourceAcquisition, Statement embeddedStatement) {}
	}
	
	[IncludeBoolProperty("IsYieldReturn", "return statement is ReturnStatement;")]
	[IncludeBoolProperty("IsYieldBreak",  "return statement is BreakStatement;")]
	class YieldStatement : Statement {
		Statement statement;
		
		public YieldStatement(Statement statement) {}
	}
	
	class AddHandlerStatement : Statement {
		Expression eventExpression;
		Expression handlerExpression;
		
		public AddHandlerStatement(Expression eventExpression, Expression handlerExpression) {}
	}
	
	class EndStatement : Statement {}
	
	class EraseStatement : Statement {
		List<Expression> expressions;
		
		public EraseStatement() {}
		public EraseStatement(List<Expression> expressions) {}
	}
	
	class ErrorStatement : Statement {
		Expression expression;
		
		public ErrorStatement(Expression expression) {}
	}
	
	enum ExitType {}
	
	class ExitStatement : Statement {
		ExitType exitType;
		
		public ExitStatement(ExitType exitType) {}
	}
	
	class ForNextStatement : StatementWithEmbeddedStatement {
		Expression start;
		Expression end;
		Expression step;
		
		List<Expression> nextExpressions;
		TypeReference typeReference;
		string        variableName;
		
		public ForNextStatement(TypeReference typeReference, string variableName, Expression start, Expression end, Expression step, Statement embeddedStatement, List<Expression> nextExpressions) {}
	}
	
	class OnErrorStatement : StatementWithEmbeddedStatement {
		public OnErrorStatement(Statement embeddedStatement) {}
	}
	
	class RaiseEventStatement : Statement {
		string eventName;
		List<Expression> arguments;
		
		public RaiseEventStatement(string eventName, List<Expression> arguments) {}
	}
	
	class ReDimStatement : Statement {
		List<InvocationExpression> reDimClauses;
		bool isPreserve;
		
		public ReDimStatement(bool isPreserve) {}
	}
	
	class RemoveHandlerStatement : Statement {
		Expression eventExpression;
		Expression handlerExpression;
		
		public RemoveHandlerStatement(Expression eventExpression, Expression handlerExpression) {}
	}
	
	class ResumeStatement : Statement {
		string labelName;
		bool isResumeNext;
		
		public ResumeStatement(bool isResumeNext) {}
		
		public ResumeStatement(string labelName) {}
	}
	
	class StopStatement : Statement {}
	
	class WithStatement : Statement {
		Expression     expression;
		BlockStatement body;
		
		public WithStatement(Expression expression) {}
	}
}

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

Share

About the Author

raygilbert
Web Developer
Australia Australia
No Biography provided

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.141030.1 | Last Updated 21 Sep 2007
Article Copyright 2007 by raygilbert
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid