[Monodevelop-patches-list] r1213 - in trunk/MonoDevelop/src: AddIns/BackendBindings/CSharpBinding AddIns/BackendBindings/CSharpBinding/Parser AddIns/BackendBindings/CSharpBinding/Parser/SharpDevelopTree Libraries/SharpRefactory Libraries/SharpRefactory/src Libraries/SharpRefactory/src/CodeDOM Libraries/SharpRefactory/src/Lexer Libraries/SharpRefactory/src/Lexer/Reader Libraries/SharpRefactory/src/Lexer/Specials Libraries/SharpRefactory/src/Parser/AST Libraries/SharpRefactory/src/Parser/AST/Expressions Libraries/SharpRefactory/src/Parser/AST/GlobalScope Libraries/SharpRefactory/src/Parser/AST/Statements Libraries/SharpRefactory/src/Parser/AST/TypeLevel Libraries/SharpRefactory/src/Parser/generated Libraries/SharpRefactory/src/Parser/generated/keywordlist Libraries/SharpRefactory/src/PrettyPrinter Libraries/SharpRefactory/src/VBConverter Main/Base Main/Base/Commands/VBConverter Main/Base/Services

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Sun Mar 21 01:22:29 EST 2004


Author: tberman
Date: 2004-03-21 01:22:28 -0500 (Sun, 21 Mar 2004)
New Revision: 1213

Added:
   trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/ChangeLog
   trunk/MonoDevelop/src/Libraries/SharpRefactory/ChangeLog
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/keywordlist/
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/keywordlist/ATGTokensSection.gen
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/keywordlist/BuildKeywords.pl
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/keywordlist/CSharpKeywordList.txt
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/keywordlist/Keywords.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/keywordlist/Tokens.cs
   trunk/MonoDevelop/src/Main/Base/ChangeLog
Modified:
   trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/CSharpVisitor.cs
   trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/Parser.cs
   trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/Resolver.cs
   trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/SharpDevelopTree/Class.cs
   trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/SharpDevelopTree/Constructor.cs
   trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/SharpDevelopTree/Event.cs
   trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/SharpDevelopTree/Field.cs
   trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/SharpDevelopTree/Indexer.cs
   trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/SharpDevelopTree/Method.cs
   trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/SharpDevelopTree/Property.cs
   trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/SharpDevelopTree/ReturnType.cs
   trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/TypeVisitor.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/Makefile.am
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/CodeDOM/CodeDOMVisitor.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Lexer.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Reader/FileReader.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Reader/IReader.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Reader/StringReader.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Specials/BlankLine.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Specials/Comment.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Specials/CommentType.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Specials/PreProcessingDirective.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Specials/SpecialTracker.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Specials/SpecialType.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Main.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/AbstractASTVisitor.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/AbstractNode.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/AttributeTargets.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/CompilationUnit.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/DebugASTVisitor.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Enums.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/ArrayCreateExpression.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/ArrayInitializerExpression.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/AssignmentExpression.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/BaseReferenceExpression.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/BinaryOperatorExpression.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/CastExpression.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/CheckedExpression.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/ConditionalExpression.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/DirectionExpression.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/Expression.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/FieldReferenceExpression.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/IdentifierExpression.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/IndexerExpression.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/InvocationExpression.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/ObjectCreateExpression.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/ParenthesizedExpression.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/PointerReferenceExpression.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/PrimitiveExpression.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/SizeOfExpression.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/StackAllocExpression.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/ThisReferenceExpression.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/TypeOfExpression.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/TypeReferenceExpression.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/UnaryOperatorExpression.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/UncheckedExpression.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/GlobalScope/AttributeSection.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/GlobalScope/DelegateDeclaration.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/GlobalScope/NamespaceDeclaration.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/GlobalScope/TypeDeclaration.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/GlobalScope/UsingAliasDeclaration.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/GlobalScope/UsingDeclaration.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/IASTVisitor.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/INode.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/LookupTableVisitor.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Modifier.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/BlockStatement.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/BreakStatement.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/CheckedStatement.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/ContinueStatement.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/DoWhileStatement.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/EmptyStatement.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/FixedStatement.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/ForStatement.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/ForeachStatement.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/GotoCaseStatement.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/GotoStatement.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/IfElseStatement.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/IfStatement.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/LabelStatement.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/LocalVariableDeclaration.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/LockStatement.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/ReturnStatement.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/Statement.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/StatementExpression.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/SwitchStatement.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/ThrowStatement.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/TryCatchStatement.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/UncheckedStatement.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/UnsafeStatement.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/UsingStatement.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/WhileStatement.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/ConstructorDeclaration.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/DestructorDeclaration.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/EventAddRegion.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/EventDeclaration.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/EventRemoveRegion.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/FieldDeclaration.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/IndexerDeclaration.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/MethodDeclaration.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/OperatorDeclaration.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/ParameterDeclarationExpression.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/PropertyDeclaration.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/PropertyGetRegion.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/PropertySetRegion.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/TypeReference.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/VariableDeclaration.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/Error.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/Modifiers.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/Parser.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/ParserUtil.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/cs.ATG
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/PrettyPrinter/OutputFormatter.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/PrettyPrinter/PrettyPrintData.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/PrettyPrinter/PrettyPrintUtil.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/PrettyPrinter/PrettyPrintVisitor.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/PrettyPrinter/SpecialVisitor.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/SharpRefactory.prjx
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/VBConverter/VBNetRefactory.cs
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/VBConverter/VBNetVisitor.cs
   trunk/MonoDevelop/src/Main/Base/Commands/VBConverter/ConvertBuffer.cs
   trunk/MonoDevelop/src/Main/Base/Commands/VBConverter/ConvertProject.cs
   trunk/MonoDevelop/src/Main/Base/Services/MonodocService.cs
Log:
merged over new parser stuff from #D, should be working, report bugs pronto


Added: trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/ChangeLog
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/ChangeLog	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/ChangeLog	2004-03-21 06:22:28 UTC (rev 1213)
@@ -0,0 +1,15 @@
+2004-04-21  Todd Berman <tberman at sevenl.net>
+
+	* Parser/Parser.cs:
+	* Parser/CSharpVisitor.cs:
+	* Parser/Resolver.cs:
+	* Parser/TypeVisitor.cs:
+	* Parser/SharpDevelopTree/Indexer.cs:
+	* Parser/SharpDevelopTree/Method.cs:
+	* Parser/SharpDevelopTree/Event.cs:
+	* Parser/SharpDevelopTree/ReturnType.cs:
+	* Parser/SharpDevelopTree/Field.cs:
+	* Parser/SharpDevelopTree/Property.cs:
+	* Parser/SharpDevelopTree/Constructor.cs:
+	* Parser/SharpDevelopTree/Class.cs: changes to reflect brand spankin
+	new parser. (from #D)

Modified: trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/CSharpVisitor.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/CSharpVisitor.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/CSharpVisitor.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -4,8 +4,8 @@
 using System.Diagnostics;
 using System.Collections;
 
-using RefParser = MonoDevelop.SharpRefactory.Parser;
-using AST = MonoDevelop.SharpRefactory.Parser.AST;
+using RefParser = ICSharpCode.SharpRefactory.Parser;
+using AST = ICSharpCode.SharpRefactory.Parser.AST;
 using SharpDevelop.Internal.Parser;
 using CSharpBinding.Parser.SharpDevelopTree;
 

Modified: trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/Parser.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/Parser.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/Parser.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -8,7 +8,7 @@
 using MonoDevelop.Services;
 using SharpDevelop.Internal.Parser;
 using CSharpBinding.Parser.SharpDevelopTree;
-using MonoDevelop.SharpRefactory.Parser;
+using ICSharpCode.SharpRefactory.Parser;
 
 namespace CSharpBinding.Parser
 {
@@ -24,7 +24,7 @@
 		
 		public ICompilationUnitBase Parse(string fileName)
 		{
-			MonoDevelop.SharpRefactory.Parser.Parser p = new MonoDevelop.SharpRefactory.Parser.Parser();
+			ICSharpCode.SharpRefactory.Parser.Parser p = new ICSharpCode.SharpRefactory.Parser.Parser();
 			
 			p.Parse(new Lexer(new FileReader(fileName)));
 			
@@ -36,7 +36,7 @@
 		
 		public ICompilationUnitBase Parse(string fileName, string fileContent)
 		{
-			MonoDevelop.SharpRefactory.Parser.Parser p = new MonoDevelop.SharpRefactory.Parser.Parser();
+			ICSharpCode.SharpRefactory.Parser.Parser p = new ICSharpCode.SharpRefactory.Parser.Parser();
 			p.Parse(new Lexer(new StringReader(fileContent)));
 			
 			CSharpVisitor visitor = new CSharpVisitor();

Modified: trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/Resolver.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/Resolver.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/Resolver.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -12,8 +12,8 @@
 using MonoDevelop.Services;
 using SharpDevelop.Internal.Parser;
 using CSharpBinding.Parser.SharpDevelopTree;
-using MonoDevelop.SharpRefactory.Parser.AST;
-using MonoDevelop.SharpRefactory.Parser;
+using ICSharpCode.SharpRefactory.Parser.AST;
+using ICSharpCode.SharpRefactory.Parser;
 
 namespace CSharpBinding.Parser
 {
@@ -96,7 +96,7 @@
 			this.parserService = parserService;
 			IParseInformation parseInfo = parserService.GetParseInformation (fileName, fileContent);
 			
-			MonoDevelop.SharpRefactory.Parser.AST.CompilationUnit fileCompilationUnit = parseInfo.MostRecentCompilationUnit.Tag as MonoDevelop.SharpRefactory.Parser.AST.CompilationUnit;
+			ICSharpCode.SharpRefactory.Parser.AST.CompilationUnit fileCompilationUnit = parseInfo.MostRecentCompilationUnit.Tag as ICSharpCode.SharpRefactory.Parser.AST.CompilationUnit;
 			if (fileCompilationUnit == null) {
 //				MonoDevelop.SharpRefactory.Parser.Parser fileParser = new MonoDevelop.SharpRefactory.Parser.Parser();
 //				fileParser.Parse(new Lexer(new StringReader(fileContent)));
@@ -106,7 +106,7 @@
 			
 			
 			Lexer l = new Lexer(new StringReader(expression));
-			MonoDevelop.SharpRefactory.Parser.Parser p = new MonoDevelop.SharpRefactory.Parser.Parser();
+			ICSharpCode.SharpRefactory.Parser.Parser p = new ICSharpCode.SharpRefactory.Parser.Parser();
 			Expression expr = p.ParseExpression(l);
 			
 			

Modified: trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/SharpDevelopTree/Class.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/SharpDevelopTree/Class.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/SharpDevelopTree/Class.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -3,7 +3,7 @@
 using System.Diagnostics;
 
 using SharpDevelop.Internal.Parser;
-using MonoDevelop.SharpRefactory.Parser;
+using ICSharpCode.SharpRefactory.Parser;
 
 namespace CSharpBinding.Parser.SharpDevelopTree
 {

Modified: trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/SharpDevelopTree/Constructor.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/SharpDevelopTree/Constructor.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/SharpDevelopTree/Constructor.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 // created on 06.08.2003 at 12:35
 
 using SharpDevelop.Internal.Parser;
-using MonoDevelop.SharpRefactory.Parser;
+using ICSharpCode.SharpRefactory.Parser;
 
 namespace CSharpBinding.Parser.SharpDevelopTree
 {

Modified: trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/SharpDevelopTree/Event.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/SharpDevelopTree/Event.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/SharpDevelopTree/Event.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 // created on 06.08.2003 at 12:30
 
 using SharpDevelop.Internal.Parser;
-using MonoDevelop.SharpRefactory.Parser;
+using ICSharpCode.SharpRefactory.Parser;
 
 namespace CSharpBinding.Parser.SharpDevelopTree
 {

Modified: trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/SharpDevelopTree/Field.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/SharpDevelopTree/Field.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/SharpDevelopTree/Field.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 // created on 04.08.2003 at 18:06
 
 using SharpDevelop.Internal.Parser;
-using MonoDevelop.SharpRefactory.Parser;
+using ICSharpCode.SharpRefactory.Parser;
 
 namespace CSharpBinding.Parser.SharpDevelopTree
 {

Modified: trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/SharpDevelopTree/Indexer.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/SharpDevelopTree/Indexer.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/SharpDevelopTree/Indexer.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 // created on 06.08.2003 at 12:34
 
 using SharpDevelop.Internal.Parser;
-using MonoDevelop.SharpRefactory.Parser;
+using ICSharpCode.SharpRefactory.Parser;
 
 namespace CSharpBinding.Parser.SharpDevelopTree
 {

Modified: trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/SharpDevelopTree/Method.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/SharpDevelopTree/Method.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/SharpDevelopTree/Method.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 // created on 06.08.2003 at 12:35
 using System;
 using SharpDevelop.Internal.Parser;
-using MonoDevelop.SharpRefactory.Parser;
+using ICSharpCode.SharpRefactory.Parser;
 
 namespace CSharpBinding.Parser.SharpDevelopTree
 {

Modified: trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/SharpDevelopTree/Property.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/SharpDevelopTree/Property.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/SharpDevelopTree/Property.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 // created on 06.08.2003 at 12:36
 
 using SharpDevelop.Internal.Parser;
-using MonoDevelop.SharpRefactory.Parser;
+using ICSharpCode.SharpRefactory.Parser;
 
 namespace CSharpBinding.Parser.SharpDevelopTree
 {

Modified: trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/SharpDevelopTree/ReturnType.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/SharpDevelopTree/ReturnType.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/SharpDevelopTree/ReturnType.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -36,7 +36,7 @@
 			this.pointerNestingLevel = pointerNestingLevel;
 		}
 		
-		public ReturnType(MonoDevelop.SharpRefactory.Parser.AST.TypeReference type)
+		public ReturnType(ICSharpCode.SharpRefactory.Parser.AST.TypeReference type)
 		{
 			base.fullyQualifiedName  = type.SystemType;
 			base.arrayDimensions     = type.RankSpecifier == null ? new int[] { } : type.RankSpecifier;

Modified: trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/TypeVisitor.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/TypeVisitor.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/TypeVisitor.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -3,8 +3,8 @@
 using System;
 using System.Collections;
 
-using MonoDevelop.SharpRefactory.Parser;
-using MonoDevelop.SharpRefactory.Parser.AST;
+using ICSharpCode.SharpRefactory.Parser;
+using ICSharpCode.SharpRefactory.Parser.AST;
 using CSharpBinding.Parser.SharpDevelopTree;
 
 using SharpDevelop.Internal.Parser;

Added: trunk/MonoDevelop/src/Libraries/SharpRefactory/ChangeLog
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/ChangeLog	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/ChangeLog	2004-03-21 06:22:28 UTC (rev 1213)
@@ -0,0 +1,3 @@
+2004-04-21  Todd Berman  <tberman at sevenl.net>
+
+	* src/*: Merged in sync with #D parser. Renamespace to ICSharpCode

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/Makefile.am
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/Makefile.am	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/Makefile.am	2004-03-21 06:22:28 UTC (rev 1213)
@@ -96,6 +96,8 @@
 ./src/Parser/generated/Modifiers.cs \
 ./src/Parser/generated/Parser.cs \
 ./src/Parser/generated/Error.cs \
+./src/Parser/generated/keywordlist/Tokens.cs \
+./src/Parser/generated/keywordlist/Keywords.cs \
 ./src/PrettyPrinter/OutputFormatter.cs \
 ./src/PrettyPrinter/PrettyPrintVisitor.cs \
 ./src/PrettyPrinter/PrettyPrintUtil.cs \

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/CodeDOM/CodeDOMVisitor.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/CodeDOM/CodeDOMVisitor.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/CodeDOM/CodeDOMVisitor.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -21,16 +21,19 @@
 using System.Text;
 using System.Collections;
 
-using MonoDevelop.SharpRefactory.Parser.AST;
+using ICSharpCode.SharpRefactory.Parser.AST;
 
-namespace MonoDevelop.SharpRefactory.Parser
+namespace ICSharpCode.SharpRefactory.Parser
 {
-	public class CodeDOMVisitor : IASTVisitor
+	public class CodeDOMVisitor : AbstractASTVisitor
 	{
 		Stack namespaceDeclarations = new Stack();
 		Stack typeDeclarations     = new Stack();
-		CodeMemberMethod currentMethod = null;
+		Stack codeStack  = new Stack();
 		TypeDeclaration currentTypeDeclaration;
+
+		// dummy collection used to swallow statements
+		System.CodeDom.CodeStatementCollection NullStmtCollection = new CodeStatementCollection();
 		
 		public CodeCompileUnit codeCompileUnit = new CodeCompileUnit();
 		public ArrayList namespaces = new ArrayList();
@@ -63,6 +66,7 @@
 				typeConversionTable[typeConversionList[i, 1]] = typeConversionList[i, 0];
 			}
 		}
+
 		string ConvType(string type) 
 		{
 			if (typeConversionTable[type] != null) {
@@ -71,14 +75,94 @@
 			return type;
 		}
 
-#region MonoDevelop.SharpRefactory.Parser.IASTVisitor interface implementation
-		public object Visit(INode node, object data)
+		void AddStmt(System.CodeDom.CodeStatement stmt)
 		{
-			return null;
+			System.CodeDom.CodeStatementCollection stmtCollection = codeStack.Peek() as System.CodeDom.CodeStatementCollection;
+			if (stmtCollection != null) {
+				stmtCollection.Add(stmt);
+			}
 		}
-		
-		public object Visit(CompilationUnit compilationUnit, object data)
+
+		void AddStmt(System.CodeDom.CodeExpression expr)
 		{
+			System.CodeDom.CodeStatementCollection stmtCollection = codeStack.Peek() as System.CodeDom.CodeStatementCollection;
+			if (stmtCollection != null) {
+				stmtCollection.Add(expr);
+			}
+		}
+
+		// FIXME: map all modifiers correctly
+		MemberAttributes ConvMemberAttributes(Modifier modifier) 
+		{
+			MemberAttributes attr = (MemberAttributes)0;
+
+			if ((modifier & Modifier.Abstract) != 0)
+				attr |=  MemberAttributes.Abstract;
+//			if ((modifier & Modifier.None) != 0)
+//				attr |=  MemberAttributes.AccessMask;
+//			if ((modifier & Modifier.None) != 0)
+//				attr |=  MemberAttributes.Assembly;
+			if ((modifier & Modifier.Const) != 0)
+				attr |=  MemberAttributes.Const;
+//			if ((modifier & Modifier.None) != 0)
+//				attr |=  MemberAttributes.Family;
+//			if ((modifier & Modifier.None) != 0)
+//				attr |=  MemberAttributes.FamilyAndAssembly;
+//			if ((modifier & Modifier.None) != 0)
+//				attr |=  MemberAttributes.FamilyOrAssembly;
+			if ((modifier & Modifier.Sealed) != 0)
+				attr |=  MemberAttributes.Final;
+			if ((modifier & Modifier.New) != 0)
+				attr |=  MemberAttributes.New;
+			if ((modifier & Modifier.Virtual) != 0)
+				attr |=  MemberAttributes.Overloaded;
+			if ((modifier & Modifier.Override) != 0)
+				attr |=  MemberAttributes.Override;
+			if ((modifier & Modifier.Private) != 0)
+				attr |=  MemberAttributes.Private;
+			if ((modifier & Modifier.Public) != 0)
+				attr |=  MemberAttributes.Public;
+//			if ((modifier & Modifier.None) != 0)
+//				attr |=  MemberAttributes.ScopeMask;
+			if ((modifier & Modifier.Static) != 0)
+				attr |=  MemberAttributes.Static;
+//			if ((modifier & Modifier.None) != 0)
+//				attr |=  MemberAttributes.VTableMask;
+
+			return attr;
+		}
+
+		void ProcessSpecials(Hashtable specials)
+		{
+			if (specials == null) {
+				return;
+			}
+			
+			foreach (object special in specials) {
+				if (special is BlankLine) {
+					AddStmt(new CodeSnippetStatement());
+				} else if (special is PreProcessingDirective) {
+					// TODO
+				} else if (special is Comment) {
+					Comment comment = (Comment)special;
+					switch (comment.CommentType) {
+						case CommentType.SingleLine:
+							AddStmt(new CodeCommentStatement(comment.CommentText, false));
+							break;
+						case CommentType.Documentation:
+							AddStmt(new CodeCommentStatement(comment.CommentText, true));
+							break;
+						case CommentType.Block:
+							AddStmt(new CodeCommentStatement(comment.CommentText, false));
+							break;
+					}
+				}
+			}
+		}
+
+#region ICSharpCode.SharpRefactory.Parser.IASTVisitor interface implementation
+		public override object Visit(CompilationUnit compilationUnit, object data)
+		{
 			CodeNamespace globalNamespace = new CodeNamespace("Global");
 			namespaces.Add(globalNamespace);
 			namespaceDeclarations.Push(globalNamespace);
@@ -87,8 +171,10 @@
 			return globalNamespace;
 		}
 		
-		public object Visit(NamespaceDeclaration namespaceDeclaration, object data)
+		public override object Visit(NamespaceDeclaration namespaceDeclaration, object data)
 		{
+			ProcessSpecials(namespaceDeclaration.Specials);
+
 			CodeNamespace currentNamespace = new CodeNamespace(namespaceDeclaration.NameSpace);
 			namespaces.Add(currentNamespace);
 			// add imports from mother namespace
@@ -104,24 +190,28 @@
 			return null;
 		}
 		
-		public object Visit(UsingDeclaration usingDeclaration, object data)
+		public override object Visit(UsingDeclaration usingDeclaration, object data)
 		{
+			ProcessSpecials(usingDeclaration.Specials);
+
 			((CodeNamespace)namespaceDeclarations.Peek()).Imports.Add(new CodeNamespaceImport(usingDeclaration.Namespace));
 			return null;
 		}
 		
-		public object Visit(UsingAliasDeclaration usingAliasDeclaration, object data)
+		public override object Visit(UsingAliasDeclaration usingAliasDeclaration, object data)
 		{
 			return null;
 		}
 		
-		public object Visit(AttributeSection attributeSection, object data)
+		public override object Visit(AttributeSection attributeSection, object data)
 		{
 			return null;
 		}
 		
-		public object Visit(TypeDeclaration typeDeclaration, object data)
+		public override object Visit(TypeDeclaration typeDeclaration, object data)
 		{
+			ProcessSpecials(typeDeclaration.Specials);
+
 			this.currentTypeDeclaration = typeDeclaration;
 			CodeTypeDeclaration codeTypeDeclaration = new CodeTypeDeclaration(typeDeclaration.Name);
 			codeTypeDeclaration.IsClass     = typeDeclaration.Type == Types.Class;
@@ -146,7 +236,7 @@
 			return null;
 		}
 		
-		public object Visit(DelegateDeclaration delegateDeclaration, object data)
+		public override object Visit(DelegateDeclaration delegateDeclaration, object data)
 		{
 //			CodeTypeDelegate codeTypeDelegate = new CodeTypeDelegate(delegateDeclaration.Name);
 //			codeTypeDelegate.Parameters
@@ -155,17 +245,21 @@
 			return null;
 		}
 		
-		public object Visit(VariableDeclaration variableDeclaration, object data)
+		public override object Visit(VariableDeclaration variableDeclaration, object data)
 		{
 			return null;
 		}
 		
-		public object Visit(FieldDeclaration fieldDeclaration, object data)
+		public override object Visit(FieldDeclaration fieldDeclaration, object data)
 		{
-			for (int i = 0; i < fieldDeclaration.Fields.Count; ++i) {
+			ProcessSpecials(fieldDeclaration.Specials);
+
+			for (int i = 0; i < fieldDeclaration.Fields.Count; ++i) 
+			{
 				VariableDeclaration field = (VariableDeclaration)fieldDeclaration.Fields[i];
 				
 				CodeMemberField memberField = new CodeMemberField(new CodeTypeReference(ConvType(fieldDeclaration.TypeReference.Type)), field.Name);
+				memberField.Attributes = ConvMemberAttributes(fieldDeclaration.Modifier);
 				if (field.Initializer != null) {
 					memberField.InitExpression =  (CodeExpression)((INode)field.Initializer).AcceptVisitor(this, data);
 				}
@@ -176,92 +270,105 @@
 			return null;
 		}
 		
-		public object Visit(MethodDeclaration methodDeclaration, object data)
+		public override object Visit(MethodDeclaration methodDeclaration, object data)
 		{
+			ProcessSpecials(methodDeclaration.Specials);
+
 			CodeMemberMethod memberMethod = new CodeMemberMethod();
 			memberMethod.Name = methodDeclaration.Name;
-			currentMethod = memberMethod;
+			memberMethod.Attributes = ConvMemberAttributes(methodDeclaration.Modifier);
+			
+			codeStack.Push(memberMethod.Statements);
+
 			((CodeTypeDeclaration)typeDeclarations.Peek()).Members.Add(memberMethod);
-//			if (memberMethod.Name == "InitializeComponent") {
-				methodDeclaration.Body.AcceptChildren(this, data);
-//			}
-			currentMethod = null;
+
+			// Add Method Parameters
+			foreach (ParameterDeclarationExpression parameter in methodDeclaration.Parameters)
+			{
+				memberMethod.Parameters.Add((CodeParameterDeclarationExpression)Visit(parameter, data));
+			}
+
+			methodDeclaration.Body.AcceptChildren(this, data);
+
+			codeStack.Pop();
+
 			return null;
 		}
 		
-		public object Visit(PropertyDeclaration propertyDeclaration, object data)
+		public override object Visit(PropertyDeclaration propertyDeclaration, object data)
 		{
 			return null;
 		}
 		
-		public object Visit(PropertyGetRegion propertyGetRegion, object data)
+		public override object Visit(PropertyGetRegion propertyGetRegion, object data)
 		{
 			return null;
 		}
 		
-		public object Visit(PropertySetRegion PropertySetRegion, object data)
+		public override object Visit(PropertySetRegion PropertySetRegion, object data)
 		{
 			return null;
 		}
 		
-		public object Visit(EventDeclaration eventDeclaration, object data)
+		public override object Visit(EventDeclaration eventDeclaration, object data)
 		{
 			return null;
 		}
 		
-		public object Visit(EventAddRegion eventAddRegion, object data)
+		public override object Visit(EventAddRegion eventAddRegion, object data)
 		{
 			return null;
 		}
 		
-		public object Visit(EventRemoveRegion eventRemoveRegion, object data)
+		public override object Visit(EventRemoveRegion eventRemoveRegion, object data)
 		{
 			return null;
 		}
 		
-		public object Visit(ConstructorDeclaration constructorDeclaration, object data)
+		public override object Visit(ConstructorDeclaration constructorDeclaration, object data)
 		{
+			ProcessSpecials(constructorDeclaration.Specials);
+
 			CodeMemberMethod memberMethod = new CodeConstructor();
-			currentMethod = memberMethod;
+
+			codeStack.Push(memberMethod.Statements);
 			((CodeTypeDeclaration)typeDeclarations.Peek()).Members.Add(memberMethod);
 //			constructorDeclaration.AcceptChildren(this, data);
-			currentMethod = null;
+			codeStack.Pop();
+
 			return null;
 		}
 		
-		public object Visit(DestructorDeclaration destructorDeclaration, object data)
+		public override object Visit(DestructorDeclaration destructorDeclaration, object data)
 		{
 			return null;
 		}
-		
-		public object Visit(OperatorDeclaration operatorDeclaration, object data)
+
+		public override object Visit(OperatorDeclaration operatorDeclaration, object data)
 		{
 			return null;
 		}
 		
-		public object Visit(IndexerDeclaration indexerDeclaration, object data)
+		public override object Visit(IndexerDeclaration indexerDeclaration, object data)
 		{
 			return null;
 		}
 		
-		public object Visit(BlockStatement blockStatement, object data)
+		public override object Visit(BlockStatement blockStatement, object data)
 		{
+			ProcessSpecials(blockStatement.Specials);
+
 			blockStatement.AcceptChildren(this, data);
 			return null;
 		}
 		
-		public object Visit(StatementExpression statementExpression, object data)
+		public override object Visit(StatementExpression statementExpression, object data)
 		{
-			CodeExpression expr = (CodeExpression)statementExpression.Expression.AcceptVisitor(this, data);
-			if (expr == null) {
-				if (!(statementExpression.Expression is AssignmentExpression)) {
-					Console.WriteLine("NULL EXPRESSION : " + statementExpression.Expression);
-				}
-			} else {
-				currentMethod.Statements.Add(new CodeExpressionStatement(expr));
+			object exp = statementExpression.Expression.AcceptVisitor(this, data);
+			if (exp is CodeExpression) {
+				AddStmt(new CodeExpressionStatement((CodeExpression)exp));
 			}
-			
-			return null;
+			return exp;
 		}
 		
 		public string Convert(TypeReference typeRef)
@@ -285,131 +392,276 @@
 			return builder.ToString();
 		}
 		
-		public object Visit(LocalVariableDeclaration localVariableDeclaration, object data)
+		public override object Visit(LocalVariableDeclaration localVariableDeclaration, object data)
 		{
+			CodeVariableDeclarationStatement declStmt = null;
+
 			CodeTypeReference type = new CodeTypeReference(Convert(localVariableDeclaration.Type));
 			
 			foreach (VariableDeclaration var in localVariableDeclaration.Variables) {
 				if (var.Initializer != null) {
-					currentMethod.Statements.Add(new CodeVariableDeclarationStatement(type,
-					                                                                  var.Name,
-					                                                                  (CodeExpression)((INode)var.Initializer).AcceptVisitor(this, data)));
+					declStmt = new CodeVariableDeclarationStatement(type,
+					                                             var.Name,
+					                                             (CodeExpression)((INode)var.Initializer).AcceptVisitor(this, data));
 				} else {
-					currentMethod.Statements.Add(new CodeVariableDeclarationStatement(type,
-					                                                                  var.Name));
+					declStmt = new CodeVariableDeclarationStatement(type,
+					                                             var.Name);
 				}
 			}
-			return null;
+
+			AddStmt(declStmt);
+
+			return declStmt;
 		}
 		
-		public object Visit(EmptyStatement emptyStatement, object data)
+		public override object Visit(EmptyStatement emptyStatement, object data)
 		{
-			return null;
+			CodeSnippetStatement emptyStmt = new CodeSnippetStatement();
+
+			AddStmt(emptyStmt);
+
+			return emptyStmt;
 		}
 		
-		public object Visit(ReturnStatement returnStatement, object data)
+		public override object Visit(ReturnStatement returnStatement, object data)
 		{
-			return null;
+			ProcessSpecials(returnStatement.Specials);
+
+			CodeMethodReturnStatement returnStmt = new CodeMethodReturnStatement((CodeExpression)returnStatement.ReturnExpression.AcceptVisitor(this,data));
+
+			AddStmt(returnStmt);
+
+			return returnStmt;
 		}
 		
-		public object Visit(IfStatement ifStatement, object data)
+		public override object Visit(IfStatement ifStatement, object data)
 		{
-			return null;
+			ProcessSpecials(ifStatement.Specials);
+
+			CodeConditionStatement ifStmt = new CodeConditionStatement();
+			
+			ifStmt.Condition = (CodeExpression)ifStatement.Condition.AcceptVisitor(this, data);
+
+			codeStack.Push(ifStmt.TrueStatements);
+			ifStatement.EmbeddedStatement.AcceptChildren(this, data);
+			codeStack.Pop();
+
+			AddStmt(ifStmt);
+
+			return ifStmt;
 		}
 		
-		public object Visit(IfElseStatement ifElseStatement, object data)
+		public override object Visit(IfElseStatement ifElseStatement, object data)
 		{
-			return null;
+			ProcessSpecials(ifElseStatement.Specials);
+
+			CodeConditionStatement ifStmt = new CodeConditionStatement();
+
+			ifStmt.Condition = (CodeExpression)ifElseStatement.Condition.AcceptVisitor(this, data);
+
+			codeStack.Push(ifStmt.TrueStatements);
+			ifElseStatement.EmbeddedStatement.AcceptChildren(this, data);
+			codeStack.Pop();
+
+			codeStack.Push(ifStmt.FalseStatements);
+			ifElseStatement.EmbeddedElseStatement.AcceptChildren(this, data);
+			codeStack.Pop();
+
+			AddStmt(ifStmt);
+
+			return ifStmt;
 		}
 		
-		public object Visit(WhileStatement whileStatement, object data)
+		public override object Visit(WhileStatement whileStatement, object data)
 		{
 			return null;
 		}
 		
-		public object Visit(DoWhileStatement doWhileStatement, object data)
+		public override object Visit(DoWhileStatement doWhileStatement, object data)
 		{
 			return null;
 		}
 		
-		public object Visit(ForStatement forStatement, object data)
+		public override object Visit(ForStatement forStatement, object data)
 		{
-			return null;
+			CodeIterationStatement forLoop = new CodeIterationStatement();
+
+			if (forStatement.Initializers != null) 
+			{
+				if (forStatement.Initializers.Count > 1)
+				{
+					throw new NotSupportedException("CodeDom does not support Multiple For-Loop Initializer Statements");
+				}
+
+				foreach (object o in forStatement.Initializers)
+				{
+					if (o is Expression) 
+					{
+						forLoop.InitStatement = new CodeExpressionStatement((CodeExpression)((Expression)o).AcceptVisitor(this,data));
+					}
+					if (o is Statement) 
+					{
+						codeStack.Push(NullStmtCollection);
+						forLoop.InitStatement = (CodeStatement)((Statement)o).AcceptVisitor(this, data);
+						codeStack.Pop();
+					}
+				}
+			}
+
+			if (forStatement.Condition == null) 
+			{
+				forLoop.TestExpression = new CodePrimitiveExpression(true);
+			} 
+			else 
+			{
+				forLoop.TestExpression = (CodeExpression)forStatement.Condition.AcceptVisitor(this, data);
+			}
+
+			codeStack.Push(forLoop.Statements);
+			forStatement.EmbeddedStatement.AcceptVisitor(this, data);
+			codeStack.Pop();
+
+			if (forStatement.Iterator != null) 
+			{
+				if (forStatement.Initializers.Count > 1)
+				{
+					throw new NotSupportedException("CodeDom does not support Multiple For-Loop Iterator Statements");
+				}
+
+				foreach (Statement stmt in forStatement.Iterator) 
+				{
+					forLoop.IncrementStatement = (CodeStatement)stmt.AcceptVisitor(this, data);
+				}
+			}
+
+			AddStmt(forLoop);
+
+			return forLoop;
 		}
 		
-		public object Visit(LabelStatement labelStatement, object data)
+		public override object Visit(LabelStatement labelStatement, object data)
 		{
-			return null;
+			ProcessSpecials(labelStatement.Specials);
+
+			System.CodeDom.CodeLabeledStatement labelStmt = new CodeLabeledStatement(labelStatement.Label,(CodeStatement)labelStatement.AcceptVisitor(this, data));
+
+			// Add Statement to Current Statement Collection
+			AddStmt(labelStmt);
+
+			return labelStmt;
 		}
 		
-		public object Visit(GotoStatement gotoStatement, object data)
+		public override object Visit(GotoStatement gotoStatement, object data)
 		{
-			return null;
+			ProcessSpecials(gotoStatement.Specials);
+
+			System.CodeDom.CodeGotoStatement gotoStmt = new CodeGotoStatement(gotoStatement.Label);
+
+			// Add Statement to Current Statement Collection
+			AddStmt(gotoStmt);
+
+			return gotoStmt;
 		}
 		
-		public object Visit(SwitchStatement switchStatement, object data)
+		public override object Visit(SwitchStatement switchStatement, object data)
 		{
-			return null;
+			throw new NotSupportedException("CodeDom does not support Switch Statement");
 		}
 		
-		public object Visit(BreakStatement breakStatement, object data)
+		public override object Visit(BreakStatement breakStatement, object data)
 		{
 			return null;
 		}
 		
-		public object Visit(ContinueStatement continueStatement, object data)
+		public override object Visit(ContinueStatement continueStatement, object data)
 		{
 			return null;
 		}
 		
-		public object Visit(GotoCaseStatement gotoCaseStatement, object data)
+		public override object Visit(GotoCaseStatement gotoCaseStatement, object data)
 		{
 			return null;
 		}
 		
-		public object Visit(ForeachStatement foreachStatement, object data)
+		public override object Visit(ForeachStatement foreachStatement, object data)
 		{
 			return null;
 		}
 		
-		public object Visit(LockStatement lockStatement, object data)
+		public override object Visit(LockStatement lockStatement, object data)
 		{
 			return null;
 		}
 		
-		public object Visit(UsingStatement usingStatement, object data)
+		public override object Visit(UsingStatement usingStatement, object data)
 		{
 			return null;
 		}
 		
-		public object Visit(TryCatchStatement tryCatchStatement, object data)
+		public override object Visit(TryCatchStatement tryCatchStatement, object data)
 		{
-			return null;
+			ProcessSpecials(tryCatchStatement.Specials);
+
+			// add a try-catch-finally
+			CodeTryCatchFinallyStatement tryStmt = new CodeTryCatchFinallyStatement();
+
+			codeStack.Push(tryStmt.TryStatements);
+			ProcessSpecials(tryCatchStatement.StatementBlock.Specials);
+			tryCatchStatement.StatementBlock.AcceptChildren(this, data);
+			codeStack.Pop();
+
+			if (tryCatchStatement.FinallyBlock != null)
+			{
+				codeStack.Push(tryStmt.FinallyStatements);
+				ProcessSpecials(tryCatchStatement.FinallyBlock.Specials);
+				tryCatchStatement.FinallyBlock.AcceptChildren(this,data);
+				codeStack.Pop();
+			}
+
+			if (tryCatchStatement.CatchClauses != null) 
+			{
+				foreach (CatchClause clause in tryCatchStatement.CatchClauses) 
+				{
+					CodeCatchClause catchClause = new CodeCatchClause(clause.VariableName);
+					catchClause.CatchExceptionType = new CodeTypeReference(clause.Type);
+					tryStmt.CatchClauses.Add(catchClause);
+
+					codeStack.Push(catchClause.Statements);
+					ProcessSpecials(clause.StatementBlock.Specials);
+					clause.StatementBlock.AcceptChildren(this, data);
+					codeStack.Pop();
+				}
+			}
+
+			// Add Statement to Current Statement Collection
+			AddStmt(tryStmt);
+
+			return tryStmt;
 		}
 		
-		public object Visit(ThrowStatement throwStatement, object data)
+		public override object Visit(ThrowStatement throwStatement, object data)
 		{
-			return new CodeThrowExceptionStatement((CodeExpression)throwStatement.ThrowExpression.AcceptVisitor(this, data));
+			ProcessSpecials(throwStatement.Specials);
+
+			CodeThrowExceptionStatement throwStmt = new CodeThrowExceptionStatement((CodeExpression)throwStatement.ThrowExpression.AcceptVisitor(this, data));
+
+			// Add Statement to Current Statement Collection
+			AddStmt(throwStmt);
+
+			return throwStmt;
 		}
 		
-		public object Visit(FixedStatement fixedStatement, object data)
+		public override object Visit(FixedStatement fixedStatement, object data)
 		{
-			return null;
+			throw new NotSupportedException("CodeDom does not support Fixed Statement");
 		}
 		
-		public object Visit(PrimitiveExpression expression, object data)
+		public override object Visit(PrimitiveExpression expression, object data)
 		{
-//			if (expression.Value is string) {
-//				return new CodePrimitiveExpression(expression.Value);
-//			} else if (expression.Value is char) {
-//				return new CodePrimitiveExpression((char)expression.Value);
-//			} else if (expression.Value == null) {
-//				return new CodePrimitiveExpression(null);
-//			}
 			return new CodePrimitiveExpression(expression.Value);
 		}
 		
-		public object Visit(BinaryOperatorExpression expression, object data)
+		public override object Visit(BinaryOperatorExpression expression, object data)
 		{
 			CodeBinaryOperatorType op = CodeBinaryOperatorType.Add;
 			switch (expression.Op) {
@@ -485,12 +737,12 @@
 			                                        (CodeExpression)expression.Right.AcceptVisitor(this, data));
 		}
 		
-		public object Visit(ParenthesizedExpression expression, object data)
+		public override object Visit(ParenthesizedExpression expression, object data)
 		{
 			return expression.Expression.AcceptVisitor(this, data);
 		}
 		
-		public object Visit(InvocationExpression invocationExpression, object data)
+		public override object Visit(InvocationExpression invocationExpression, object data)
 		{
 			Expression     target     = invocationExpression.TargetObject;
 			CodeExpression targetExpr;
@@ -500,6 +752,17 @@
 			} else if (target is FieldReferenceExpression) {
 				FieldReferenceExpression fRef = (FieldReferenceExpression)target;
 				targetExpr = (CodeExpression)fRef.TargetObject.AcceptVisitor(this, data);
+				if (fRef.TargetObject is FieldReferenceExpression) {
+					FieldReferenceExpression fRef2 = (FieldReferenceExpression)fRef.TargetObject;
+					if (fRef2.FieldName != null && Char.IsUpper(fRef2.FieldName[0])) {
+						// an exception is thrown if it doesn't end in an indentifier exception
+						// for example for : this.MyObject.MyMethod() leads to an exception, which 
+						// is correct in this case ... I know this is really HACKY :)
+						try {
+							targetExpr = ConvertToIdentifier(fRef2);
+						} catch (Exception) {}
+					}
+				}
 				methodName = fRef.FieldName;
 			} else {
 				targetExpr = (CodeExpression)target.AcceptVisitor(this, data);
@@ -507,7 +770,7 @@
 			return new CodeMethodInvokeExpression(targetExpr, methodName, GetExpressionList(invocationExpression.Parameters));
 		}
 		
-		public object Visit(IdentifierExpression expression, object data)
+		public override object Visit(IdentifierExpression expression, object data)
 		{
 			if (IsField(expression.Identifier)) {
 				return new CodeFieldReferenceExpression(new CodeThisReferenceExpression(),
@@ -516,13 +779,15 @@
 			return new CodeVariableReferenceExpression(expression.Identifier);
 		}
 		
-		public object Visit(TypeReferenceExpression typeReferenceExpression, object data)
+		public override object Visit(TypeReferenceExpression typeReferenceExpression, object data)
 		{
 			return null;
 		}
-		
-		public object Visit(UnaryOperatorExpression unaryOperatorExpression, object data)
+
+		public override object Visit(UnaryOperatorExpression unaryOperatorExpression, object data)
 		{
+			CodeExpression var;
+
 			switch (unaryOperatorExpression.Op) {
 				case UnaryOperatorType.Minus:
 					if (unaryOperatorExpression.Expression is PrimitiveExpression) {
@@ -546,11 +811,48 @@
 			                                        (CodeExpression)unaryOperatorExpression.Expression.AcceptVisitor(this, data));
 				case UnaryOperatorType.Plus:
 					return unaryOperatorExpression.Expression.AcceptVisitor(this, data);
+
+				case UnaryOperatorType.PostIncrement:
+					// emulate i++, with i = i + 1
+					var = (CodeExpression)unaryOperatorExpression.Expression.AcceptVisitor(this, data);
+
+					return new CodeAssignStatement(var,
+									new CodeBinaryOperatorExpression(var,
+																	 CodeBinaryOperatorType.Add,
+																	 new CodePrimitiveExpression(1)));
+
+				case UnaryOperatorType.PostDecrement:
+					// emulate i--, with i = i - 1
+					var = (CodeExpression)unaryOperatorExpression.Expression.AcceptVisitor(this, data);
+
+					return new CodeAssignStatement(var,
+						new CodeBinaryOperatorExpression(var,
+						CodeBinaryOperatorType.Subtract,
+						new CodePrimitiveExpression(1)));
+
+				case UnaryOperatorType.Decrement:
+					// emulate --i, with i = i - 1
+					var = (CodeExpression)unaryOperatorExpression.Expression.AcceptVisitor(this, data);
+
+					return new CodeAssignStatement(var,
+						new CodeBinaryOperatorExpression(var,
+						CodeBinaryOperatorType.Subtract,
+						new CodePrimitiveExpression(1)));
+
+				case UnaryOperatorType.Increment:
+					// emulate ++i, with i = i + 1
+					var = (CodeExpression)unaryOperatorExpression.Expression.AcceptVisitor(this, data);
+
+					return new CodeAssignStatement(var,
+						new CodeBinaryOperatorExpression(var,
+						CodeBinaryOperatorType.Add,
+						new CodePrimitiveExpression(1)));
+
 			}
 			return null;
 		}
 		bool methodReference = false;
-		public object Visit(AssignmentExpression assignmentExpression, object data)
+		public override object Visit(AssignmentExpression assignmentExpression, object data)
 		{
 			if (assignmentExpression.Op == AssignmentOperatorType.Add) {
 				
@@ -558,89 +860,89 @@
 				CodeExpression methodInvoker = (CodeExpression)assignmentExpression.Right.AcceptVisitor(this, null);
 				methodReference = false;
 					
-				if (assignmentExpression.Left is IdentifierExpression) {
-					currentMethod.Statements.Add(new CodeAttachEventStatement(new CodeEventReferenceExpression(new CodeThisReferenceExpression(), ((IdentifierExpression)assignmentExpression.Left).Identifier),
+				if (assignmentExpression.Left is IdentifierExpression) 
+				{
+					AddStmt(new CodeAttachEventStatement(new CodeEventReferenceExpression(new CodeThisReferenceExpression(), ((IdentifierExpression)assignmentExpression.Left).Identifier),
 					                                                          methodInvoker));
 				} else {
 					FieldReferenceExpression fr = (FieldReferenceExpression)assignmentExpression.Left;
 					
-					currentMethod.Statements.Add(new CodeAttachEventStatement(new CodeEventReferenceExpression((CodeExpression)fr.TargetObject.AcceptVisitor(this, data), fr.FieldName),
+					AddStmt(new CodeAttachEventStatement(new CodeEventReferenceExpression((CodeExpression)fr.TargetObject.AcceptVisitor(this, data), fr.FieldName),
 					                                                          methodInvoker));
 				}
 			} else {
 				if (assignmentExpression.Left is IdentifierExpression) {
-					currentMethod.Statements.Add(new CodeAssignStatement((CodeExpression)assignmentExpression.Left.AcceptVisitor(this, null), (CodeExpression)assignmentExpression.Right.AcceptVisitor(this, null)));
+					AddStmt(new CodeAssignStatement((CodeExpression)assignmentExpression.Left.AcceptVisitor(this, null), (CodeExpression)assignmentExpression.Right.AcceptVisitor(this, null)));
 				} else {
-					currentMethod.Statements.Add(new CodeAssignStatement((CodeExpression)assignmentExpression.Left.AcceptVisitor(this, null), (CodeExpression)assignmentExpression.Right.AcceptVisitor(this, null)));
-					
+					AddStmt(new CodeAssignStatement((CodeExpression)assignmentExpression.Left.AcceptVisitor(this, null), (CodeExpression)assignmentExpression.Right.AcceptVisitor(this, null)));
 				}
 			}
 			return null;
 		}
-		public virtual object Visit(CheckedStatement checkedStatement, object data)
+		
+		public override object Visit(CheckedStatement checkedStatement, object data)
 		{
 			return null;
 		}
-		public virtual object Visit(UncheckedStatement uncheckedStatement, object data)
+		
+		public override object Visit(UncheckedStatement uncheckedStatement, object data)
 		{
 			return null;
 		}
 		
-		public object Visit(SizeOfExpression sizeOfExpression, object data)
+		public override object Visit(SizeOfExpression sizeOfExpression, object data)
 		{
 			return null;
 		}
 		
-		public object Visit(TypeOfExpression typeOfExpression, object data)
+		public override object Visit(TypeOfExpression typeOfExpression, object data)
 		{
 			return new CodeTypeOfExpression(ConvType(typeOfExpression.TypeReference.Type));
 		}
 		
-		public object Visit(CheckedExpression checkedExpression, object data)
+		public override object Visit(CheckedExpression checkedExpression, object data)
 		{
 			return null;
 		}
 		
-		public object Visit(UncheckedExpression uncheckedExpression, object data)
+		public override object Visit(UncheckedExpression uncheckedExpression, object data)
 		{
 			return null;
 		}
 		
-		public object Visit(PointerReferenceExpression pointerReferenceExpression, object data)
+		public override object Visit(PointerReferenceExpression pointerReferenceExpression, object data)
 		{
 			return null;
 		}
 		
-		public object Visit(CastExpression castExpression, object data)
+		public override object Visit(CastExpression castExpression, object data)
 		{
 			string typeRef = castExpression.CastTo.Type;
-			
-			
-			return new CodeCastExpression(ConvType(typeRef), (CodeExpression)castExpression.Expression.AcceptVisitor(this, data));
+			return new CodeCastExpression(typeRef, (CodeExpression)castExpression.Expression.AcceptVisitor(this, data));
 		}
 		
-		public object Visit(StackAllocExpression stackAllocExpression, object data)
+		public override object Visit(StackAllocExpression stackAllocExpression, object data)
 		{
 			// TODO
 			return null;
 		}
 		
-		public object Visit(IndexerExpression indexerExpression, object data)
+		public override object Visit(IndexerExpression indexerExpression, object data)
 		{
 			return new CodeIndexerExpression((CodeExpression)indexerExpression.TargetObject.AcceptVisitor(this, data), GetExpressionList(indexerExpression.Indices));
 		}
 		
-		public object Visit(ThisReferenceExpression thisReferenceExpression, object data)
+		public override object Visit(ThisReferenceExpression thisReferenceExpression, object data)
 		{
 			return new CodeThisReferenceExpression();
 		}
 		
-		public object Visit(BaseReferenceExpression baseReferenceExpression, object data)
+		public override object Visit(BaseReferenceExpression baseReferenceExpression, object data)
 		{
 			return new CodeBaseReferenceExpression();
 		}
 		
-		public object Visit(ArrayCreateExpression arrayCreateExpression, object data)
+		public override object Visit(ArrayCreateExpression arrayCreateExpression, object data)
 		{
 			if (arrayCreateExpression.ArrayInitializer == null) {
 				if (arrayCreateExpression.Rank != null && arrayCreateExpression.Rank.Length > 0) {
@@ -654,13 +956,13 @@
 			                                     GetExpressionList(arrayCreateExpression.ArrayInitializer.CreateExpressions));
 		}
 		
-		public object Visit(ObjectCreateExpression objectCreateExpression, object data)
+		public override object Visit(ObjectCreateExpression objectCreateExpression, object data)
 		{
 			return new CodeObjectCreateExpression(ConvType(objectCreateExpression.CreateType.Type),
 			                                      objectCreateExpression.Parameters == null ? null : GetExpressionList(objectCreateExpression.Parameters));
 		}
 		
-		public object Visit(ParameterDeclarationExpression parameterDeclarationExpression, object data)
+		public override object Visit(ParameterDeclarationExpression parameterDeclarationExpression, object data)
 		{
 			return new CodeParameterDeclarationExpression(new CodeTypeReference(ConvType(parameterDeclarationExpression.TypeReference.Type)), parameterDeclarationExpression.ParameterName);
 		}
@@ -677,10 +979,10 @@
 				t = asm.GetType(type);
 			}
 			
-			if (t == null) {
-				//asm = typeof(System.Windows.Forms.Control).Assembly;
-				//t = asm.GetType(type);
-			}
+			//if (t == null) {
+			//	asm = typeof(System.Windows.Forms.Control).Assembly;
+			//	t = asm.GetType(type);
+			//}
 			
 			if (t == null) {
 				asm = typeof(System.String).Assembly;
@@ -707,7 +1009,7 @@
 			return false; //Char.IsLower(fieldReferenceExpression.FieldName[0]);
 		}
 		
-		public object Visit(FieldReferenceExpression fieldReferenceExpression, object data)
+		public override object Visit(FieldReferenceExpression fieldReferenceExpression, object data)
 		{
 			if (methodReference) {
 				return new CodeMethodReferenceExpression((CodeExpression)fieldReferenceExpression.TargetObject.AcceptVisitor(this, data), fieldReferenceExpression.FieldName);
@@ -734,15 +1036,16 @@
 				                                           fieldReferenceExpression.FieldName);
 			}
 		}
-		public object Visit(DirectionExpression directionExpression, object data)
+		
+		public override object Visit(DirectionExpression directionExpression, object data)
 		{
 			return null;
 		}
-		public object Visit(ArrayInitializerExpression arrayInitializerExpression, object data)
+		public override object Visit(ArrayInitializerExpression arrayInitializerExpression, object data)
 		{
 			return null;
 		}
-		public object Visit(ConditionalExpression conditionalExpression, object data)
+		public override object Visit(ConditionalExpression conditionalExpression, object data)
 		{
 			return null;
 		}
@@ -813,7 +1116,7 @@
 			}
 			return list;
 		}
-
+		
 		Type GetType(string typeName)
 		{
 			foreach (Assembly asm in AppDomain.CurrentDomain.GetAssemblies()) 
@@ -826,6 +1129,5 @@
 			}
 			return Type.GetType(typeName);
 		}
-
 	}
 }

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Lexer.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Lexer.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Lexer.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -11,18 +11,21 @@
 using System.Diagnostics;
 using System.Globalization;
 using System.Text;
-using MonoDevelop.SharpRefactory.Parser;
+using ICSharpCode.SharpRefactory.Parser;
 
-namespace MonoDevelop.SharpRefactory.Parser {
-	public struct Token {
-		public readonly int kind;
+namespace ICSharpCode.SharpRefactory.Parser
+{
+	public class Token
+	{
+		public int kind;
 		
-		public readonly int col;
-		public readonly int line;
+		public int col;
+		public int line;
 		
-		public readonly object literalValue;
-		public readonly string val;
-
+		public object literalValue = null;
+		public string val;
+		public Token  next;
+		
 		public Point EndLocation {
 			get {
 				return new Point(col + val.Length, line);
@@ -34,22 +37,28 @@
 			}
 		}
 		
+		public Token()
+		{
+		}
+		
 		public Token(int kind)
 		{
 			this.kind = kind;
-			this.col  = 0;
-			this.line = 0;
-			this.val  = null;
-			this.literalValue = null;
 		}
 		
+//		public Token(Tokens kind, int col, int line)
+//		{
+//			this.kind = kind;
+//			this.col  = col;
+//			this.line = line;
+//		}
+		
 		public Token(int kind, int col, int line, string val)
 		{
 			this.kind = kind;
 			this.col  = col;
 			this.line = line;
 			this.val  = val;
-			this.literalValue = null;
 		}
 		
 		public Token(int kind, int col, int line, string val, object literalValue)
@@ -62,31 +71,25 @@
 		}
 	}
 	
-
-	
 	public class Lexer
 	{
 		IReader reader;
-		static  Hashtable keywords = new Hashtable();
 		
 		int col  = 1;
 		int line = 1;
 		
-		Errors errors   = new Errors();
-		class TokenLink {
-			public Token t;
-			public TokenLink next;
-			
-			public TokenLink (Token t) { this.t = t; }
+		Errors         errors   = new Errors();
+		SpecialTracker specialTracker = new SpecialTracker();
+		Token          lastToken = null;
+		Token          curToken  = null;
+		Token          peekToken = null;
+		
+		public SpecialTracker SpecialTracker {
+			get {
+				return specialTracker;
+			}
 		}
 		
-//		SpecialTracker specialTracker = new SpecialTracker();
-		
-		TokenLink lastToken = null;
-		TokenLink curToken  = null;
-		TokenLink peekToken = null;
-		TokenLink reuse;
-		
 		public Errors Errors {
 			get {
 				return errors;
@@ -95,13 +98,13 @@
 		
 		public Token Token {
 			get {
-				return lastToken.t;
+				return lastToken;
 			}
 		}
 		
 		public Token LookAhead {
 			get {
-				return curToken.t;
+				return curToken;
 			}
 		}
 		
@@ -113,134 +116,32 @@
 		public Token Peek()
 		{
 			if (peekToken.next == null) {
-				if (reuse != null) {
-					reuse.t = Next ();
-					peekToken.next = reuse;
-					reuse = null;
-				} else
-					peekToken.next = new TokenLink (Next());
+				peekToken.next = Next();
+				specialTracker.InformToken(peekToken.next.kind);
 			}
-				
 			peekToken = peekToken.next;
-			return peekToken.t;
+			return peekToken;
 		}
 		
 		public Token NextToken()
 		{
 			if (curToken == null) {
-				curToken = new TokenLink (Next());
-				return curToken.t;
+				curToken = Next();
+				specialTracker.InformToken(curToken.kind);
+				return curToken;
 			}
 			
-			reuse = lastToken;
-			// make sure we dont keep a chain around
-			if (reuse != null)
-				reuse.next = null;
-			
 			lastToken = curToken;
 			
 			if (curToken.next == null) {
-				
-				if (reuse != null) {
-					reuse.t = Next ();
-					curToken.next = reuse;
-					reuse = null;
-				} else
-					curToken.next = new TokenLink (Next());
+				curToken.next = Next();
+				specialTracker.InformToken(curToken.next.kind);
 			}
 			
 			curToken  = curToken.next;
-			return curToken.t;
+			return curToken;
 		}
-
 		
-		static string[] keywordStrings = {
-			"abstract",
-			"as",
-			"base",
-			"bool",
-			"break",
-			"byte",
-			"case",
-			"catch",
-			"char",
-			"checked",
-			"class",
-			"const",
-			"continue",
-			"decimal",
-			"default",
-			"delegate",
-			"do",
-			"double",
-			"else",
-			"enum",
-			"event",
-			"explicit",
-			"extern",
-			"false",
-			"finally",
-			"fixed",
-			"float",
-			"for",
-			"foreach",
-			"goto",
-			"if",
-			"implicit",
-			"in",
-			"int",
-			"interface",
-			"internal",
-			"is",
-			"lock",
-			"long",
-			"namespace",
-			"new",
-			"null",
-			"object",
-			"operator",
-			"out",
-			"override",
-			"params",
-			"private",
-			"protected",
-			"public",
-			"readonly",
-			"ref",
-			"return",
-			"sbyte",
-			"sealed",
-			"short",
-			"sizeof",
-			"stackalloc",
-			"static",
-			"string",
-			"struct",
-			"switch",
-			"this",
-			"throw",
-			"true",
-			"try",
-			"typeof",
-			"uint",
-			"ulong",
-			"unchecked",
-			"unsafe",
-			"ushort",
-			"using",
-			"virtual",
-			"void",
-			"volatile",
-			"while",
-		};
-		
-		static Lexer()
-		{
-			for (int i = 0 ; i < keywordStrings.Length; ++i) {
-				keywords.Add(keywordStrings[i], i + Tokens.Abstract);
-			}
-		}
-		
 		public Lexer(IReader reader)
 		{
 			this.reader = reader;
@@ -255,7 +156,7 @@
 					++col;
 					
 					if (ch == '\n') {
-//						specialTracker.AddEndOfLine();
+						specialTracker.AddEndOfLine();
 						++line;
 						col = 1;
 					}
@@ -266,8 +167,8 @@
 					int x = col;
 					int y = line;
 					string s = ReadIdent(ch);
-					if (keywords[s] != null) {
-						return new Token((int)keywords[s], x, y, s);
+					if (Keywords.IsKeyword(s)) {
+						return new Token(Keywords.GetToken(s), x, y, s);
 					}
 					return new Token(Tokens.Identifier, x, y, s);
 				}
@@ -283,10 +184,11 @@
 						continue;
 					}
 				} else if (ch == '#') {
+					Point start = new Point(col, line);
 					++col;
 					string directive = ReadIdent('#');
 					string argument  = ReadToEOL();
-//					this.specialTracker.AddPreProcessingDirective(directive, argument);
+					this.specialTracker.AddPreProcessingDirective(directive, argument, start, new Point(start.X + directive.Length + argument.Length, start.Y));
 					continue;
 				}
 				
@@ -317,7 +219,7 @@
 				Token token = ReadOperator(ch);
 				
 				// try error recovery :)
-				if (token.kind == -1) {
+				if (token == null) {
 					return Next();
 				}
 				return token;
@@ -326,27 +228,18 @@
 			return new Token(Tokens.EOF, col, line, String.Empty);
 		}
 		
-		const int max_id_size = 512;
-		char [] id_builder = new char [max_id_size];
-		
 		string ReadIdent(char ch)
 		{
-			int pos = 0;
-			
-			id_builder [pos ++] = ch;
+			StringBuilder s = new StringBuilder(ch.ToString());
 			++col;
 			while (!reader.Eos() && (Char.IsLetterOrDigit(ch = reader.GetNext()) || ch == '_')) {
-				if (pos == max_id_size) {
-					errors.Error(col, line, "identifier too long");
-				}
-				
-				id_builder [pos ++] = ch;
+				s.Append(ch.ToString());
 				++col;
 			}
 			if (!reader.Eos()) {
 				reader.UnGet();
 			}
-			return new String (id_builder, 0, pos);
+			return s.ToString();
 		}
 		
 		Token ReadDigit(char ch, int x)
@@ -354,6 +247,8 @@
 			int y = line;
 			++col;
 			StringBuilder sb = new StringBuilder(ch.ToString());
+			StringBuilder prefix = new StringBuilder();
+			StringBuilder suffix = new StringBuilder();
 			
 			bool ishex      = false;
 			bool isunsigned = false;
@@ -371,6 +266,7 @@
 					++col;
 				}
 				ishex = true;
+				prefix.Append("0x");
 			} else {
 				while (Char.IsDigit(reader.Peek())) {
 					sb.Append(reader.GetNext());
@@ -408,29 +304,35 @@
 			}
 			
 			if (Char.ToUpper(reader.Peek()) == 'F') { // float value
+				suffix.Append(reader.Peek());
 				reader.GetNext();
 				++col;
 				isfloat = true;
 			} else if (Char.ToUpper(reader.Peek()) == 'M') { // double type suffix (obsolete, double is default)
+				suffix.Append(reader.Peek());
 				reader.GetNext();
 				++col;
 				isdouble = true;
 			} else if (Char.ToUpper(reader.Peek()) == 'D') { // decimal value
+				suffix.Append(reader.Peek());
 				reader.GetNext();
 				++col;
 				isdecimal = true;
 			} else if (!isdouble) {
 				if (Char.ToUpper(reader.Peek()) == 'U') {
+					suffix.Append(reader.Peek());
 					reader.GetNext();
 					++col;
 					isunsigned = true;
 				}
 				
 				if (Char.ToUpper(reader.Peek()) == 'L') {
+					suffix.Append(reader.Peek());
 					reader.GetNext();
 					++col;
 					islong = true;
 					if (!isunsigned && Char.ToUpper(reader.Peek()) == 'U') {
+						suffix.Append(reader.Peek());
 						reader.GetNext();
 						++col;
 						isunsigned = true;
@@ -439,74 +341,67 @@
 			}
 			
 			string digit = sb.ToString();
+			string stringValue = String.Concat(prefix.ToString(), digit, suffix.ToString());
 			if (isfloat) {
 				try {
 					NumberFormatInfo numberFormatInfo = new NumberFormatInfo();
 					numberFormatInfo.CurrencyDecimalSeparator = ".";
-					return new Token(Tokens.Literal, x, y, digit, Single.Parse(digit, numberFormatInfo));
+					return new Token(Tokens.Literal, x, y, stringValue, Single.Parse(digit, numberFormatInfo));
 				} catch (Exception) {
 					errors.Error(y, x, String.Format("Can't parse float {0}", digit));
-					return new Token(Tokens.Literal, x, y, digit, 0f);
+					return new Token(Tokens.Literal, x, y, stringValue, 0f);
 				}
 			}
 			if (isdecimal) {
 				try {
 					NumberFormatInfo numberFormatInfo = new NumberFormatInfo();
 					numberFormatInfo.CurrencyDecimalSeparator = ".";
-					return new Token(Tokens.Literal, x, y, digit, Decimal.Parse(digit, numberFormatInfo));
+					return new Token(Tokens.Literal, x, y, stringValue, Decimal.Parse(digit, numberFormatInfo));
 				} catch (Exception) {
 					errors.Error(y, x, String.Format("Can't parse decimal {0}", digit));
-					return new Token(Tokens.Literal, x, y, digit, 0m);
+					return new Token(Tokens.Literal, x, y, stringValue, 0m);
 				}
 			}
 			if (isdouble) {
 				try {
 					NumberFormatInfo numberFormatInfo = new NumberFormatInfo();
 					numberFormatInfo.CurrencyDecimalSeparator = ".";
-					return new Token(Tokens.Literal, x, y, digit, Double.Parse(digit, numberFormatInfo));
+					return new Token(Tokens.Literal, x, y, stringValue, Double.Parse(digit, numberFormatInfo));
 				} catch (Exception) {
 					errors.Error(y, x, String.Format("Can't parse double {0}", digit));
-					return new Token(Tokens.Literal, x, y, digit, 0d);
+					return new Token(Tokens.Literal, x, y, stringValue, 0d);
 				}
 			}
 			if (islong) {
 				if (isunsigned) {
 					try {
-						return new Token(Tokens.Literal, x, y, digit, UInt64.Parse(digit, ishex ? NumberStyles.HexNumber : NumberStyles.Number));
+						return new Token(Tokens.Literal, x, y, stringValue, UInt64.Parse(digit, ishex ? NumberStyles.HexNumber : NumberStyles.Number));
 					} catch (Exception) {
 						errors.Error(y, x, String.Format("Can't parse unsigned long {0}", digit));
-						return new Token(Tokens.Literal, x, y, digit, 0UL);
+						return new Token(Tokens.Literal, x, y, stringValue, 0UL);
 					}
 				} else {
 					try {
-						return new Token(Tokens.Literal, x, y, digit, Int64.Parse(digit, ishex ? NumberStyles.HexNumber : NumberStyles.Number));
+						return new Token(Tokens.Literal, x, y, stringValue, Int64.Parse(digit, ishex ? NumberStyles.HexNumber : NumberStyles.Number));
 					} catch (Exception) {
 						errors.Error(y, x, String.Format("Can't parse long {0}", digit));
-						return new Token(Tokens.Literal, x, y, digit, 0L);
+						return new Token(Tokens.Literal, x, y, stringValue, 0L);
 					}
 				}
 			} else {
 				if (isunsigned) {
 					try {
-						return new Token(Tokens.Literal, x, y, digit, UInt32.Parse(digit, ishex ? NumberStyles.HexNumber : NumberStyles.Number));
+						return new Token(Tokens.Literal, x, y, stringValue, UInt32.Parse(digit, ishex ? NumberStyles.HexNumber : NumberStyles.Number));
 					} catch (Exception) {
 						errors.Error(y, x, String.Format("Can't parse unsigned int {0}", digit));
-						return new Token(Tokens.Literal, x, y, digit, 0U);
+						return new Token(Tokens.Literal, x, y, stringValue, 0U);
 					}
 				} else {
 					try {
-						return new Token(Tokens.Literal, x, y, digit, Int32.Parse(digit, ishex ? NumberStyles.HexNumber : NumberStyles.Number));
+						return new Token(Tokens.Literal, x, y, stringValue, Int32.Parse(digit, ishex ? NumberStyles.HexNumber : NumberStyles.Number));
 					} catch (Exception) {
-						try {
-							return new Token(Tokens.Literal, x, y, digit, Int64.Parse(digit, ishex ? NumberStyles.HexNumber : NumberStyles.Number));
-						} catch {}
-							
-						try {
-							return new Token(Tokens.Literal, x, y, digit, UInt64.Parse(digit, ishex ? NumberStyles.HexNumber : NumberStyles.Number));
-						} catch {}
-						
 						errors.Error(y, x, String.Format("Can't parse int {0}", digit));
-						return new Token(Tokens.Literal, x, y, digit, 0);
+						return new Token(Tokens.Literal, x, y, stringValue, 0);
 					}
 				}
 			}
@@ -548,7 +443,14 @@
 			int y = line;
 			char ch = '\0';
 			StringBuilder s = new StringBuilder();
-			while (!reader.Eos() && (ch = reader.GetNext()) != '"') {
+			while (!reader.Eos()) {
+				ch = reader.GetNext();
+				if (ch == '"') {
+					if (reader.Peek() != '"') {
+						break;
+					}
+					reader.GetNext();
+				}
 				++col;
 				if (ch == '\n') {
 					++line;
@@ -886,7 +788,7 @@
 					return new Token(Tokens.OpenCurlyBrace, x, y, "{");
 				default:
 					--col;
-					return new Token (-1);
+					return null;
 			}
 		}
 		
@@ -934,33 +836,21 @@
 		
 		void ReadSingleLineComment(CommentType commentType)
 		{
-			if (!reader.Eos()) {
-				char ch = reader.GetNext();
-				while (!reader.Eos()) {
-					if (ch == '\n') {
-						++line;
-						col = 1;
-						return;
-					}
-					ch = reader.GetNext();
-					++col;
-				}
-			}
-//			specialTracker.StartComment(commentType, new Point(line, col));
-//			specialTracker.AddString(ReadToEOL());
-//			specialTracker.FinishComment();
+			specialTracker.StartComment(commentType, new Point(line, col));
+			specialTracker.AddString(ReadToEOL());
+			specialTracker.FinishComment();
 		}
 		
 		void ReadMultiLineComment()
 		{
-//			specialTracker.StartComment(CommentType.Block, new Point(line, col));
+			specialTracker.StartComment(CommentType.Block, new Point(line, col));
 			int x = col;
 			int y = line;
 			while (!reader.Eos()) {
 				char ch;
 				switch (ch = reader.GetNext()) {
 					case '\n':
-//						specialTracker.AddChar('\n');
+						specialTracker.AddChar('\n');
 						++line;
 						col = 1;
 						break;
@@ -970,19 +860,19 @@
 							case '/':
 								reader.GetNext();
 								++col;
-//								specialTracker.FinishComment();
+								specialTracker.FinishComment();
 								return;
 							default:
-//								specialTracker.AddChar('*');
+								specialTracker.AddChar('*');
 								continue;
 						}
 					default:
-//						specialTracker.AddChar(ch);
+						specialTracker.AddChar(ch);
 						++col;
 						break;
 				}
 			}
-//			specialTracker.FinishComment();
+			specialTracker.FinishComment();
 		}
 	}
 }

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Reader/FileReader.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Reader/FileReader.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Reader/FileReader.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -8,7 +8,7 @@
 using System;
 using System.IO;
 
-namespace MonoDevelop.SharpRefactory.Parser
+namespace ICSharpCode.SharpRefactory.Parser
 {
 	public class FileReader : IReader
 	{
@@ -17,7 +17,6 @@
 		
 		public FileReader(string filename)
 		{
-			Console.WriteLine("open file name " + filename);
 			StreamReader sreader = File.OpenText(filename);
 			file = sreader.ReadToEnd();
 			sreader.Close();

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Reader/IReader.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Reader/IReader.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Reader/IReader.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -5,7 +5,7 @@
 //     <version value="$version"/>
 // </file>
 
-namespace MonoDevelop.SharpRefactory.Parser
+namespace ICSharpCode.SharpRefactory.Parser
 {
 	public interface IReader
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Reader/StringReader.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Reader/StringReader.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Reader/StringReader.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -8,7 +8,7 @@
 using System;
 using System.IO;
 
-namespace MonoDevelop.SharpRefactory.Parser
+namespace ICSharpCode.SharpRefactory.Parser
 {
 	public class StringReader : IReader
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Specials/BlankLine.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Specials/BlankLine.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Specials/BlankLine.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -3,7 +3,7 @@
 using System.CodeDom;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser
+namespace ICSharpCode.SharpRefactory.Parser
 {
 	public class BlankLine
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Specials/Comment.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Specials/Comment.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Specials/Comment.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -4,7 +4,7 @@
 using System.Collections;
 using System.Drawing;
 
-namespace MonoDevelop.SharpRefactory.Parser
+namespace ICSharpCode.SharpRefactory.Parser
 {
 	public class Comment
 	{
@@ -45,5 +45,12 @@
 			this.comment       = comment;
 			this.startPosition = startPosition;
 		}
+		
+		public override string ToString()
+		{
+			return String.Format("[Comment: CommentType = {0}]",
+			                     CommentType);
+		}
+		
 	}
 }

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Specials/CommentType.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Specials/CommentType.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Specials/CommentType.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -3,7 +3,7 @@
 using System.CodeDom;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser
+namespace ICSharpCode.SharpRefactory.Parser
 {
 	public enum CommentType
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Specials/PreProcessingDirective.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Specials/PreProcessingDirective.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Specials/PreProcessingDirective.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,15 +1,36 @@
 using System;
+using System.Drawing;
 using System.Text;
 using System.CodeDom;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser
+namespace ICSharpCode.SharpRefactory.Parser
 {
 	public class PreProcessingDirective
 	{
 		string cmd;
 		string arg;
+		Point  start;
+		Point  end;
 		
+		public Point Start {
+			get {
+				return start;
+			}
+			set {
+				start = value;
+			}
+		}
+		
+		public Point End {
+			get {
+				return end;
+			}
+			set {
+				end = value;
+			}
+		}
+		
 		public string Cmd {
 			get {
 				return cmd;
@@ -27,11 +48,19 @@
 				arg = value;
 			}
 		}
+		public override string ToString()
+		{
+			return String.Format("[PreProcessingDirective: Cmd = {0}, Arg = {1}]",
+			                     Cmd,
+			                     Arg);
+		}
 		
-		public PreProcessingDirective(string cmd, string arg)
+		public PreProcessingDirective(string cmd, string arg, Point start, Point end)
 		{
 			this.cmd = cmd;
 			this.arg = arg;
+			this.start = start;
+			this.end = end;
 		}
 	}
 }

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Specials/SpecialTracker.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Specials/SpecialTracker.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Specials/SpecialTracker.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -4,7 +4,7 @@
 using System.Collections;
 using System.Drawing;
 
-namespace MonoDevelop.SharpRefactory.Parser
+namespace ICSharpCode.SharpRefactory.Parser
 {
 	public class SpecialTracker
 	{
@@ -20,6 +20,11 @@
 			}
 		}
 		
+		public void InformToken(int kind)
+		{
+			currentSpecials.Add(kind);
+		}
+		
 		public ArrayList RetrieveSpecials()
 		{
 			ArrayList tmp = currentSpecials;
@@ -32,9 +37,9 @@
 			currentSpecials.Add(new BlankLine());
 		}
 		
-		public void AddPreProcessingDirective(string cmd, string arg)
+		public void AddPreProcessingDirective(string cmd, string arg, Point start, Point end)
 		{
-			currentSpecials.Add(new PreProcessingDirective(cmd, arg));
+			currentSpecials.Add(new PreProcessingDirective(cmd, arg, start, end));
 		}
 		
 		// used for comment tracking

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Specials/SpecialType.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Specials/SpecialType.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Specials/SpecialType.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -3,7 +3,7 @@
 using System.CodeDom;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser
+namespace ICSharpCode.SharpRefactory.Parser
 {
 	public enum SpecialType {
 		SingleLine,

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Main.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Main.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Main.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,85 +1,100 @@
 // project created on 09.08.2003 at 10:16
 using System;
+using System.Collections.Specialized;
 using System.IO;
 using System.CodeDom;
 using System.CodeDom.Compiler;
 using Microsoft.CSharp;
 
-using MonoDevelop.SharpRefactory.PrettyPrinter;
-using MonoDevelop.SharpRefactory.Parser;
+using ICSharpCode.SharpRefactory.PrettyPrinter;
+using ICSharpCode.SharpRefactory.Parser;
 
 
 class MainClass
 {
-//	static void A()
-//	{
-//		Lexer lexer = new Lexer(new MonoDevelop.SharpRefactory.Lexer.StringReader("(int)i"));
-//		for (int i = 0; i < 10; ++i) {
-//			Console.WriteLine(i + " ----> " + lexer.Peek(i).kind);
-//		}
-//		lexer.NextToken();
-//		Console.WriteLine("1." + lexer.LookAhead.kind + " -- " + Tokens.OpenParenthesis);
-//		lexer.NextToken();
-//		Console.WriteLine("2." + lexer.LookAhead.kind + " -- " + Tokens.Int);
-//		lexer.NextToken();
-//		Console.WriteLine("3." + lexer.LookAhead.kind + " -- " + Tokens.CloseParenthesis);
-//		lexer.NextToken();
-//		Console.WriteLine("4." + lexer.LookAhead.kind + " -- " + Tokens.Identifier);
-//		lexer.NextToken();
-//		Console.WriteLine("5." + lexer.LookAhead.kind + " -- " + Tokens.EOF);
-//	}
+	public static StringCollection SearchDirectory(string directory, string filemask)
+	{
+		return SearchDirectory(directory, filemask, true);
+	}
 	
+	public static StringCollection SearchDirectory(string directory, string filemask, bool searchSubdirectories)
+	{
+		StringCollection collection = new StringCollection();
+		SearchDirectory(directory, filemask, collection, searchSubdirectories);
+		return collection;
+	}
+	
+	/// <summary>
+	/// Finds all files which are valid to the mask <code>filemask</code> in the path
+	/// <code>directory</code> and all subdirectories (if searchSubdirectories
+	/// is true. The found files are added to the StringCollection 
+	/// <code>collection</code>.
+	/// </summary>
+	static void SearchDirectory(string directory, string filemask, StringCollection collection, bool searchSubdirectories)
+	{
+		try {
+			string[] file = Directory.GetFiles(directory, filemask);
+			foreach (string f in file) {
+				collection.Add(f);
+			}
+			
+			if (searchSubdirectories) {
+				string[] dir = Directory.GetDirectories(directory);
+				foreach (string d in dir) {
+					SearchDirectory(d, filemask, collection, searchSubdirectories);
+				}
+			}
+		} catch (Exception) {
+		}
+	}
+	
+	static void PrettyPrintDirectories()
+	{
+		StringCollection files = SearchDirectory("C:\\b", "*.cs");
+		foreach (string fileName in files) {
+			Parser p = new Parser();
+			Console.Write("Converting : " + fileName);
+			p.Parse(new Lexer(new FileReader(fileName)));
+			if (p.Errors.count == 0) {
+				StreamReader sr = File.OpenText(fileName);
+				string content = sr.ReadToEnd();
+				sr.Close();
+				PrettyPrintVisitor ppv = new PrettyPrintVisitor(content);
+				ppv.Visit(p.compilationUnit, null);
+				
+				StreamWriter sw = new StreamWriter(fileName);
+				sw.Write(ppv.Text);
+				sw.Close();
+				
+				Console.WriteLine(" done.");
+			} else {
+				Console.Write(" Source code errors:");
+				Console.WriteLine(p.Errors.ErrorOutput);
+			}
+		}
+		Console.ReadLine();
+	}
+
 	public static void Main (string[] args)
 	{
-//		Lexer lexer = new Lexer(new FileReader("C:\\test.cs"));
-//		Token t = lexer.NextToken();
-//		while (t != null && t.kind != Tokens.EOF) {
-//			Console.WriteLine("Token : {0}, value={1}, literalValue={2}", t.kind, t.val, t.literalValue);
-//			t = lexer.NextToken();
-//		}
-//		if (t != null) {
-//			Console.WriteLine("Token : {0}, value={1}, literalValue={2}", t.kind, t.val, t.literalValue);
-//		} else {
-//			Console.WriteLine("NULL");
-//		}
-		
+//		PrettyPrintDirectories();
 		Parser p = new Parser();
-		p.Parse(new Lexer(new FileReader(args [0])));
+		string fileName = "C:\\a.cs";
+		Console.Write("Converting : " + fileName);
+		p.Parse(new Lexer(new FileReader(fileName)));
 		if (p.Errors.count == 0) {
-			LookupTableVisitor lookupTableVisitor = new LookupTableVisitor();
-			lookupTableVisitor.Visit(p.compilationUnit, null);
+			StreamReader sr = File.OpenText(fileName);
+			string content = sr.ReadToEnd();
+			sr.Close();
+			PrettyPrintVisitor ppv = new PrettyPrintVisitor(content);
+			ppv.Visit(p.compilationUnit, null);
 			
-			new DebugASTVisitor().Visit(p.compilationUnit, null);
-			PrettyPrintVisitor ppv = new PrettyPrintVisitor();
-			ppv.Visit(p.compilationUnit, null);
-			Console.WriteLine(ppv.Text.ToString());
+			Console.WriteLine(ppv.Text);
+			
+			Console.WriteLine(" done.");
 		} else {
-			Console.WriteLine("Source code errors:");
+			Console.Write(" Source code errors:");
 			Console.WriteLine(p.Errors.ErrorOutput);
 		}
-			
-//		
-//		Scanner.Init(fileName);
-//		Console.WriteLine("Parsing source file {0}", fileName);
-//		Parser.Parse();
-//		
-		
-//			
-//			CodeDOMVisitor cdom = new CodeDOMVisitor();
-//			
-//			cdom.Visit(Parser.compilationUnit, null);
-//			
-//			Microsoft.CSharp.CSharpCodeProvider provider = new CSharpCodeProvider();
-//			// Call the CodeDomProvider.CreateGenerator() method to obtain an ICodeGenerator from the provider.
-//			System.CodeDom.Compiler.ICodeGenerator generator = provider.CreateGenerator();
-//			generator.GenerateCodeFromCompileUnit(cdom.codeCompileUnit, Console.Out, null);
-//			
-//			VBNetVisitor vbv = new VBNetVisitor();
-//			
-//			vbv.Visit(Parser.compilationUnit, null);
-//			StreamWriter sw = new StreamWriter(@"C:\testform.vb");
-//			sw.Write(vbv.SourceText.ToString());
-//			sw.Close();
-//			Console.WriteLine("converted.");
 	}
 }

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/AbstractASTVisitor.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/AbstractASTVisitor.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/AbstractASTVisitor.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,8 +1,8 @@
 using System;
 using System.Collections;
-using MonoDevelop.SharpRefactory.Parser.AST;
+using ICSharpCode.SharpRefactory.Parser.AST;
 
-namespace MonoDevelop.SharpRefactory.Parser
+namespace ICSharpCode.SharpRefactory.Parser
 {
 	public abstract class AbstractASTVisitor : IASTVisitor
 	{
@@ -17,10 +17,12 @@
 			}
 		}
 		
-#region MonoDevelop.SharpRefactory.Parser.IASTVisitor interface implementation
+#region ICSharpCode.SharpRefactory.Parser.IASTVisitor interface implementation
 		public virtual object Visit(INode node, object data)
 		{
 			Console.WriteLine("Warning: INode visited");
+			Console.WriteLine("Visitor was: " + this.GetType());
+			Console.WriteLine("Node was : " + node.GetType());
 			return node.AcceptChildren(this, data);
 		}
 		
@@ -72,8 +74,8 @@
 			return data;
 		}
 #endregion
-		
-#region Global Scope
+
+#region Type level
 		public virtual object Visit(VariableDeclaration variableDeclaration, object data)
 		{
 			if (variableDeclaration.Initializer != null) {
@@ -340,22 +342,19 @@
 		public virtual object Visit(ForStatement forStatement, object data)
 		{
 			object ret = data;
-			if (forStatement.Initializers != null) { 
+			if (forStatement.Initializers != null) {
 				foreach(INode n in forStatement.Initializers) {
-					if (n != null) n.AcceptVisitor(this, data);
+					n.AcceptVisitor(this, data);
 				}
 			}
-			
 			if (forStatement.Condition != null) {
 				ret = forStatement.Condition.AcceptVisitor(this, data);
 			}
-			
 			if (forStatement.Iterator != null) {
 				foreach(INode n in forStatement.Iterator) {
-					if (n != null) n.AcceptVisitor(this, data);
+					n.AcceptVisitor(this, data);
 				}
 			}
-			
 			if (forStatement.EmbeddedStatement == null) {
 				return ret;
 			}
@@ -449,11 +448,18 @@
 		}
 		public virtual object Visit(TryCatchStatement tryCatchStatement, object data)
 		{
+			if (tryCatchStatement == null) {
+				return data;
+			}
 			if (tryCatchStatement.StatementBlock != null) {
 				tryCatchStatement.StatementBlock.AcceptVisitor(this, data);
 			}
-			foreach (CatchClause catchClause in tryCatchStatement.CatchClauses) {
-				catchClause.StatementBlock.AcceptVisitor(this, data);
+			if (tryCatchStatement.CatchClauses != null) {
+				foreach (CatchClause catchClause in tryCatchStatement.CatchClauses) {
+					if (catchClause != null) {
+						catchClause.StatementBlock.AcceptVisitor(this, data);
+					}
+				}
 			}
 			if (tryCatchStatement.FinallyBlock != null) {
 				return tryCatchStatement.FinallyBlock.AcceptVisitor(this, data);
@@ -587,11 +593,22 @@
 			}
 			return data;
 		}
+		
+		public virtual object Visit(ArrayCreationParameter arrayCreationParameter, object data)
+		{
+			if (arrayCreationParameter.Expressions != null) {
+				foreach (Expression e in arrayCreationParameter.Expressions) {
+					e.AcceptVisitor(this, data);
+				}
+			}
+			return data;
+		}
+		
 		public virtual object Visit(ArrayCreateExpression arrayCreateExpression, object data)
 		{
 			if (arrayCreateExpression.Parameters != null) {
-				foreach (Expression p in arrayCreateExpression.Parameters) {
-					p.AcceptVisitor(this, data);
+				foreach (INode node in arrayCreateExpression.Parameters) {
+					node.AcceptVisitor(this, data);
 				}
 			}
 			if (arrayCreateExpression.ArrayInitializer != null) {

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/AbstractNode.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/AbstractNode.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/AbstractNode.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -21,12 +21,12 @@
 
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST
+namespace ICSharpCode.SharpRefactory.Parser.AST
 {
 	public abstract class AbstractNode : INode
 	{
 		INode     parent;
-		ArrayList children;
+		ArrayList children = new ArrayList();
 		Hashtable specials;
 		Point     startLocation;
 		Point     endLocation;
@@ -69,17 +69,12 @@
 		
 		public ArrayList Children {
 			get {
-				if (children == null)
-					return children = new ArrayList (1);
 				return children;
 			}
 		}
 		
 		public virtual void AddChild(INode childNode)
 		{
-			if (children == null)
-				children = new ArrayList ();
-			
 			children.Add(childNode);
 		}
 		
@@ -90,9 +85,6 @@
 		
 		public object AcceptChildren(IASTVisitor visitor, object data)
 		{
-			if (children == null)
-				return data;
-			
 			foreach (INode child in children) {
 				if (child != null) {
 					child.AcceptVisitor(visitor, data);

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/AttributeTargets.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/AttributeTargets.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/AttributeTargets.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -2,7 +2,7 @@
 using System.Collections;
 using System.Text;
 
-namespace MonoDevelop.SharpRefactory.Parser
+namespace ICSharpCode.SharpRefactory.Parser
 {
 	[Flags]
 	public enum AttributeTarget

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/CompilationUnit.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/CompilationUnit.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/CompilationUnit.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -19,7 +19,7 @@
 using System.Threading;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST
+namespace ICSharpCode.SharpRefactory.Parser.AST
 {
 	public class CompilationUnit : AbstractNode
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/DebugASTVisitor.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/DebugASTVisitor.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/DebugASTVisitor.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,65 +1,60 @@
 using System;
-using MonoDevelop.SharpRefactory.Parser.AST;
+using ICSharpCode.SharpRefactory.Parser.AST;
 
-namespace MonoDevelop.SharpRefactory.Parser
+namespace ICSharpCode.SharpRefactory.Parser
 {
-	public class DebugASTVisitor : IASTVisitor
+	public class DebugASTVisitor : AbstractASTVisitor
 	{
-#region MonoDevelop.SharpRefactory.Parser.IASTVisitor interface implementation
-		public virtual object Visit(CompilationUnit compilationUnit, object data)
+#region ICSharpCode.SharpRefactory.Parser.IASTVisitor interface implementation
+		public override object Visit(CompilationUnit compilationUnit, object data)
 		{
 			Console.WriteLine(compilationUnit.ToString());
 			return compilationUnit.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(FieldDeclaration fieldDeclaration, object data)
+		public override object Visit(FieldDeclaration fieldDeclaration, object data)
 		{
 			Console.WriteLine(fieldDeclaration.ToString());
 			return fieldDeclaration.AcceptChildren(this, data);
 		}
-		public virtual object Visit(INode node, object data)
-		{
-			Console.WriteLine("!!! PURE NODE --- SHOULD NEVER HAPPEN!!!");
-			return node.AcceptChildren(this, data);
-		}
 		
-		public virtual object Visit(NamespaceDeclaration namespaceDeclaration, object data)
+		public override object Visit(NamespaceDeclaration namespaceDeclaration, object data)
 		{
 			Console.WriteLine(namespaceDeclaration.ToString());
 			return namespaceDeclaration.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(UsingDeclaration usingDeclaration, object data)
+		public override object Visit(UsingDeclaration usingDeclaration, object data)
 		{
 			Console.WriteLine(usingDeclaration.ToString());
 			return usingDeclaration.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(UsingAliasDeclaration usingAliasDeclaration, object data)
+		public override object Visit(UsingAliasDeclaration usingAliasDeclaration, object data)
 		{
 			Console.WriteLine(usingAliasDeclaration.ToString());
 			return usingAliasDeclaration.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(TypeDeclaration typeDeclaration, object data)
+		public override object Visit(TypeDeclaration typeDeclaration, object data)
 		{
 			Console.WriteLine(typeDeclaration.ToString());
 			return typeDeclaration.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(DelegateDeclaration delegateDeclaration, object data)
+		public override object Visit(DelegateDeclaration delegateDeclaration, object data)
 		{
 			Console.WriteLine(delegateDeclaration.ToString());
 			return delegateDeclaration.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(VariableDeclaration variableDeclaration, object data)
+		public override object Visit(VariableDeclaration variableDeclaration, object data)
 		{
 			Console.WriteLine(variableDeclaration.ToString());
 			return variableDeclaration.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(MethodDeclaration methodDeclaration, object data)
+		public override object Visit(MethodDeclaration methodDeclaration, object data)
 		{
 			Console.WriteLine(methodDeclaration.ToString());
 			if (methodDeclaration.Body != null) {
@@ -68,360 +63,360 @@
 			return methodDeclaration.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(AttributeSection attributeSection, object data)
+		public override object Visit(AttributeSection attributeSection, object data)
 		{
 			Console.WriteLine(attributeSection.ToString());
 			return attributeSection.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(FieldReferenceExpression fieldReferenceExpression, object data)
+		public override object Visit(FieldReferenceExpression fieldReferenceExpression, object data)
 		{
 			Console.WriteLine(fieldReferenceExpression.ToString());
 			return fieldReferenceExpression.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(ConstructorDeclaration constructorDeclaration, object data)
+		public override object Visit(ConstructorDeclaration constructorDeclaration, object data)
 		{
 			Console.WriteLine(constructorDeclaration.ToString());
 			return constructorDeclaration.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(DestructorDeclaration destructorDeclaration, object data)
+		public override object Visit(DestructorDeclaration destructorDeclaration, object data)
 		{
 			Console.WriteLine(destructorDeclaration.ToString());
 			return destructorDeclaration.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(OperatorDeclaration operatorDeclaration, object data)
+		public override object Visit(OperatorDeclaration operatorDeclaration, object data)
 		{
 			Console.WriteLine(operatorDeclaration.ToString());
 			return operatorDeclaration.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(IndexerDeclaration indexerDeclaration, object data)
+		public override object Visit(IndexerDeclaration indexerDeclaration, object data)
 		{
 			Console.WriteLine(indexerDeclaration.ToString());
 			return indexerDeclaration.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(ParameterDeclarationExpression parameterDeclarationExpression, object data)
+		public override object Visit(ParameterDeclarationExpression parameterDeclarationExpression, object data)
 		{
 			Console.WriteLine(parameterDeclarationExpression.ToString());
 			return parameterDeclarationExpression.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(FixedStatement fixedStatement, object data)
+		public override object Visit(FixedStatement fixedStatement, object data)
 		{
 			Console.WriteLine(fixedStatement.ToString());
 			return fixedStatement.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(PropertyDeclaration propertyDeclaration, object data)
+		public override object Visit(PropertyDeclaration propertyDeclaration, object data)
 		{
 			Console.WriteLine(propertyDeclaration.ToString());
 			return propertyDeclaration.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(PropertyGetRegion propertyGetRegion, object data)
+		public override object Visit(PropertyGetRegion propertyGetRegion, object data)
 		{
 			Console.WriteLine(propertyGetRegion.ToString());
 			return propertyGetRegion.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(PropertySetRegion PropertySetRegion, object data)
+		public override object Visit(PropertySetRegion PropertySetRegion, object data)
 		{
 			Console.WriteLine(PropertySetRegion.ToString());
 			return PropertySetRegion.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(EventDeclaration eventDeclaration, object data)
+		public override object Visit(EventDeclaration eventDeclaration, object data)
 		{
 			Console.WriteLine(eventDeclaration.ToString());
 			return eventDeclaration.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(EventAddRegion eventAddRegion, object data)
+		public override object Visit(EventAddRegion eventAddRegion, object data)
 		{
 			Console.WriteLine(eventAddRegion.ToString());
 			return eventAddRegion.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(EventRemoveRegion eventRemoveRegion, object data)
+		public override object Visit(EventRemoveRegion eventRemoveRegion, object data)
 		{
 			Console.WriteLine(eventRemoveRegion.ToString());
 			return eventRemoveRegion.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(BlockStatement blockStatement, object data)
+		public override object Visit(BlockStatement blockStatement, object data)
 		{
 			Console.WriteLine(blockStatement.ToString());
 			return blockStatement.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(StatementExpression statementExpression, object data)
+		public override object Visit(StatementExpression statementExpression, object data)
 		{
 			Console.WriteLine(statementExpression.ToString());
 			return statementExpression.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(LocalVariableDeclaration localVariableDeclaration, object data)
+		public override object Visit(LocalVariableDeclaration localVariableDeclaration, object data)
 		{
 			Console.WriteLine(localVariableDeclaration.ToString());
 			return localVariableDeclaration.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(EmptyStatement emptyStatement, object data)
+		public override object Visit(EmptyStatement emptyStatement, object data)
 		{
 			Console.WriteLine(emptyStatement.ToString());
 			return emptyStatement.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(ReturnStatement returnStatement, object data)
+		public override object Visit(ReturnStatement returnStatement, object data)
 		{
 			Console.WriteLine(returnStatement.ToString());
 			return returnStatement.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(IfStatement ifStatement, object data)
+		public override object Visit(IfStatement ifStatement, object data)
 		{
 			Console.WriteLine(ifStatement.ToString());
 			return ifStatement.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(IfElseStatement ifElseStatement, object data)
+		public override object Visit(IfElseStatement ifElseStatement, object data)
 		{
 			Console.WriteLine(ifElseStatement.ToString());
 			return ifElseStatement.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(WhileStatement whileStatement, object data)
+		public override object Visit(WhileStatement whileStatement, object data)
 		{
 			Console.WriteLine(whileStatement.ToString());
 			return whileStatement.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(DoWhileStatement doWhileStatement, object data)
+		public override object Visit(DoWhileStatement doWhileStatement, object data)
 		{
 			Console.WriteLine(doWhileStatement.ToString());
 			return doWhileStatement.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(ForStatement forStatement, object data)
+		public override object Visit(ForStatement forStatement, object data)
 		{
 			Console.WriteLine(forStatement.ToString());
 			return forStatement.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(LabelStatement labelStatement, object data)
+		public override object Visit(LabelStatement labelStatement, object data)
 		{
 			Console.WriteLine(labelStatement.ToString());
 			return labelStatement.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(GotoStatement gotoStatement, object data)
+		public override object Visit(GotoStatement gotoStatement, object data)
 		{
 			Console.WriteLine(gotoStatement.ToString());
 			return gotoStatement.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(SwitchStatement switchStatement, object data)
+		public override object Visit(SwitchStatement switchStatement, object data)
 		{
 			Console.WriteLine(switchStatement.ToString());
 			return switchStatement.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(BreakStatement breakStatement, object data)
+		public override object Visit(BreakStatement breakStatement, object data)
 		{
 			Console.WriteLine(breakStatement.ToString());
 			return breakStatement.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(ContinueStatement continueStatement, object data)
+		public override object Visit(ContinueStatement continueStatement, object data)
 		{
 			Console.WriteLine(continueStatement.ToString());
 			return continueStatement.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(GotoCaseStatement gotoCaseStatement, object data)
+		public override object Visit(GotoCaseStatement gotoCaseStatement, object data)
 		{
 			Console.WriteLine(gotoCaseStatement.ToString());
 			return gotoCaseStatement.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(ForeachStatement foreachStatement, object data)
+		public override object Visit(ForeachStatement foreachStatement, object data)
 		{
 			Console.WriteLine(foreachStatement.ToString());
 			return foreachStatement.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(LockStatement lockStatement, object data)
+		public override object Visit(LockStatement lockStatement, object data)
 		{
 			Console.WriteLine(lockStatement.ToString());
 			return lockStatement.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(UsingStatement usingStatement, object data)
+		public override object Visit(UsingStatement usingStatement, object data)
 		{
 			Console.WriteLine(usingStatement.ToString());
 			return usingStatement.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(TryCatchStatement tryCatchStatement, object data)
+		public override object Visit(TryCatchStatement tryCatchStatement, object data)
 		{
 			Console.WriteLine(tryCatchStatement.ToString());
 			return tryCatchStatement.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(ThrowStatement throwStatement, object data)
+		public override object Visit(ThrowStatement throwStatement, object data)
 		{
 			Console.WriteLine(throwStatement.ToString());
 			return throwStatement.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(CheckedStatement checkedStatement, object data)
+		public override object Visit(CheckedStatement checkedStatement, object data)
 		{
 			Console.WriteLine(checkedStatement.ToString());
 			return checkedStatement.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(UncheckedStatement uncheckedStatement, object data)
+		public override object Visit(UncheckedStatement uncheckedStatement, object data)
 		{
 			Console.WriteLine(uncheckedStatement.ToString());
 			return uncheckedStatement.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(PrimitiveExpression expression, object data)
+		public override object Visit(PrimitiveExpression expression, object data)
 		{
 			Console.WriteLine(expression.ToString());
 			return expression.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(BinaryOperatorExpression expression, object data)
+		public override object Visit(BinaryOperatorExpression expression, object data)
 		{
 			Console.WriteLine(expression.ToString());
 			return expression.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(ParenthesizedExpression expression, object data)
+		public override object Visit(ParenthesizedExpression expression, object data)
 		{
 			Console.WriteLine(expression.ToString());
 			return expression.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(InvocationExpression invocationExpression, object data)
+		public override object Visit(InvocationExpression invocationExpression, object data)
 		{
 			Console.WriteLine(invocationExpression.ToString());
 			return invocationExpression.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(IdentifierExpression expression, object data)
+		public override object Visit(IdentifierExpression expression, object data)
 		{
 			Console.WriteLine(expression.ToString());
 			return expression.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(TypeReferenceExpression typeReferenceExpression, object data)
+		public override object Visit(TypeReferenceExpression typeReferenceExpression, object data)
 		{
 			Console.WriteLine(typeReferenceExpression.ToString());
 			return typeReferenceExpression.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(UnaryOperatorExpression unaryOperatorExpression, object data)
+		public override object Visit(UnaryOperatorExpression unaryOperatorExpression, object data)
 		{
 			Console.WriteLine(unaryOperatorExpression.ToString());
 			return unaryOperatorExpression.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(AssignmentExpression assignmentExpression, object data)
+		public override object Visit(AssignmentExpression assignmentExpression, object data)
 		{
 			Console.WriteLine(assignmentExpression.ToString());
 			return assignmentExpression.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(SizeOfExpression sizeOfExpression, object data)
+		public override object Visit(SizeOfExpression sizeOfExpression, object data)
 		{
 			Console.WriteLine(sizeOfExpression.ToString());
 			return sizeOfExpression.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(TypeOfExpression typeOfExpression, object data)
+		public override object Visit(TypeOfExpression typeOfExpression, object data)
 		{
 			Console.WriteLine(typeOfExpression.ToString());
 			return typeOfExpression.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(CheckedExpression checkedExpression, object data)
+		public override object Visit(CheckedExpression checkedExpression, object data)
 		{
 			Console.WriteLine(checkedExpression.ToString());
 			return checkedExpression.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(UncheckedExpression uncheckedExpression, object data)
+		public override object Visit(UncheckedExpression uncheckedExpression, object data)
 		{
 			Console.WriteLine(uncheckedExpression.ToString());
 			return uncheckedExpression.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(PointerReferenceExpression pointerReferenceExpression, object data)
+		public override object Visit(PointerReferenceExpression pointerReferenceExpression, object data)
 		{
 			Console.WriteLine(pointerReferenceExpression.ToString());
 			return pointerReferenceExpression.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(CastExpression castExpression, object data)
+		public override object Visit(CastExpression castExpression, object data)
 		{
 			Console.WriteLine(castExpression.ToString());
 			return castExpression.AcceptChildren(this, data);
 		}
 		
 		
-		public virtual object Visit(StackAllocExpression stackAllocExpression, object data)
+		public override object Visit(StackAllocExpression stackAllocExpression, object data)
 		{
 			Console.WriteLine(stackAllocExpression.ToString());
 			return stackAllocExpression.AcceptChildren(this, data);
 		}
 		
 		
-		public virtual object Visit(IndexerExpression indexerExpression, object data)
+		public override object Visit(IndexerExpression indexerExpression, object data)
 		{
 			Console.WriteLine(indexerExpression.ToString());
 			return indexerExpression.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(ThisReferenceExpression thisReferenceExpression, object data)
+		public override object Visit(ThisReferenceExpression thisReferenceExpression, object data)
 		{
 			Console.WriteLine(thisReferenceExpression.ToString());
 			return thisReferenceExpression.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(BaseReferenceExpression baseReferenceExpression, object data)
+		public override object Visit(BaseReferenceExpression baseReferenceExpression, object data)
 		{
 			Console.WriteLine(baseReferenceExpression.ToString());
 			return baseReferenceExpression.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(ObjectCreateExpression objectCreateExpression, object data)
+		public override object Visit(ObjectCreateExpression objectCreateExpression, object data)
 		{
 			Console.WriteLine(objectCreateExpression.ToString());
 			return objectCreateExpression.AcceptChildren(this, data);
 		}
 		
-		public virtual object Visit(ArrayCreateExpression arrayCreateExpression, object data)
+		public override object Visit(ArrayCreateExpression arrayCreateExpression, object data)
 		{
 			Console.WriteLine(arrayCreateExpression.ToString());
 			return arrayCreateExpression.AcceptChildren(this, data);
 		}
-		public virtual object Visit(DirectionExpression directionExpression, object data)
+		public override object Visit(DirectionExpression directionExpression, object data)
 		{
 			Console.WriteLine(directionExpression.ToString());
 			return directionExpression.AcceptChildren(this, data);
 		}
-		public virtual object Visit(ArrayInitializerExpression arrayInitializerExpression, object data)
+		public override object Visit(ArrayInitializerExpression arrayInitializerExpression, object data)
 		{
 			Console.WriteLine(arrayInitializerExpression.ToString());
 			return arrayInitializerExpression.AcceptChildren(this, data);
 		}
-		public virtual object Visit(ConditionalExpression conditionalExpression, object data)
+		public override object Visit(ConditionalExpression conditionalExpression, object data)
 		{
 			Console.WriteLine(conditionalExpression.ToString());
 			return conditionalExpression.AcceptChildren(this, data);

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Enums.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Enums.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Enums.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,6 +1,6 @@
 using System;
 
-namespace MonoDevelop.SharpRefactory.Parser
+namespace ICSharpCode.SharpRefactory.Parser
 {
 	/// <summary>
 	/// Summary description for Class1.

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/ArrayCreateExpression.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/ArrayCreateExpression.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/ArrayCreateExpression.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,12 +1,64 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST
+namespace ICSharpCode.SharpRefactory.Parser.AST
 {
+	public class ArrayCreationParameter : AbstractNode 
+	{
+		ArrayList expressions = null;
+		int       dimensions  = -1;
+		
+		public bool IsExpressionList {
+			get {
+				return expressions != null;
+			}
+		}
+		
+		public ArrayList Expressions {
+			get {
+				return expressions;
+			}
+			set {
+				expressions = value;
+			}
+		}
+		
+		public int Dimensions {
+			get {
+				return dimensions;
+			}
+			set {
+				dimensions = value;
+			}
+		}
+		
+		public ArrayCreationParameter(ArrayList expressions)
+		{
+			this.expressions = expressions;
+		}
+		
+		public ArrayCreationParameter(int dimensions)
+		{
+			this.dimensions = dimensions;
+		}
+		
+		public override object AcceptVisitor(IASTVisitor visitor, object data)
+		{
+			return visitor.Visit(this, data);
+		}
+		
+		public override string ToString()
+		{
+			return String.Format("[ArrayCreationParameter: Dimensions={0}, Expressions={1}",
+			                     dimensions,
+			                     GetCollectionString(expressions));
+		}
+	}
+	
 	public class ArrayCreateExpression : Expression
 	{
 		TypeReference              createType       = null;
-		ArrayList                  parameters       = null; // Expressions
+		ArrayList                  parameters       = null; // ArrayCreationParameter
 		int[]                      rank             = null;
 		ArrayInitializerExpression arrayInitializer = null; // Array Initializer OR NULL
 		
@@ -46,17 +98,16 @@
 			}
 		}
 		
-		public ArrayCreateExpression(TypeReference createType, ArrayList parameters)
+		public ArrayCreateExpression(TypeReference createType)
 		{
 			this.createType = createType;
-			this.parameters = parameters;
 		}
 		
-		public ArrayCreateExpression(TypeReference createType, ArrayInitializerExpression arrayInitializer)
-		{
-			this.createType = createType;
-			this.arrayInitializer = arrayInitializer;
-		}
+//		public ArrayCreateExpression(TypeReference createType, ArrayInitializerExpression arrayInitializer)
+//		{
+//			this.createType = createType;
+//			this.arrayInitializer = arrayInitializer;
+//		}
 		
 		
 		public override object AcceptVisitor(IASTVisitor visitor, object data)

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/ArrayInitializerExpression.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/ArrayInitializerExpression.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/ArrayInitializerExpression.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST {
+namespace ICSharpCode.SharpRefactory.Parser.AST {
 	
 	public class ArrayInitializerExpression : Expression
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/AssignmentExpression.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/AssignmentExpression.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/AssignmentExpression.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class AssignmentExpression : Expression
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/BaseReferenceExpression.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/BaseReferenceExpression.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/BaseReferenceExpression.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class BaseReferenceExpression : Expression
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/BinaryOperatorExpression.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/BinaryOperatorExpression.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/BinaryOperatorExpression.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class BinaryOperatorExpression : Expression
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/CastExpression.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/CastExpression.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/CastExpression.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class CastExpression : Expression
 	{
@@ -27,6 +27,11 @@
 			}
 		}
 		
+		public CastExpression(TypeReference castTo)
+		{
+			this.castTo = castTo;
+		}
+		
 		public CastExpression(TypeReference castTo, Expression expression)
 		{
 			this.castTo = castTo;

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/CheckedExpression.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/CheckedExpression.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/CheckedExpression.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class CheckedExpression : Expression
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/ConditionalExpression.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/ConditionalExpression.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/ConditionalExpression.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST {
+namespace ICSharpCode.SharpRefactory.Parser.AST {
 	
 	public class ConditionalExpression : Expression
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/DirectionExpression.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/DirectionExpression.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/DirectionExpression.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST {
+namespace ICSharpCode.SharpRefactory.Parser.AST {
 	
 	public class DirectionExpression : Expression
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/Expression.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/Expression.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/Expression.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -18,7 +18,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class Expression : AbstractNode
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/FieldReferenceExpression.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/FieldReferenceExpression.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/FieldReferenceExpression.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST {
+namespace ICSharpCode.SharpRefactory.Parser.AST {
 	
 	public class FieldReferenceExpression : Expression
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/IdentifierExpression.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/IdentifierExpression.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/IdentifierExpression.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST
+namespace ICSharpCode.SharpRefactory.Parser.AST
 {
 	public class IdentifierExpression : Expression
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/IndexerExpression.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/IndexerExpression.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/IndexerExpression.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class IndexerExpression : Expression
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/InvocationExpression.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/InvocationExpression.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/InvocationExpression.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST {
+namespace ICSharpCode.SharpRefactory.Parser.AST {
 	
 	public class InvocationExpression : Expression
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/ObjectCreateExpression.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/ObjectCreateExpression.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/ObjectCreateExpression.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class ObjectCreateExpression : Expression
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/ParenthesizedExpression.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/ParenthesizedExpression.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/ParenthesizedExpression.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class ParenthesizedExpression : Expression
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/PointerReferenceExpression.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/PointerReferenceExpression.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/PointerReferenceExpression.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class PointerReferenceExpression : Expression
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/PrimitiveExpression.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/PrimitiveExpression.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/PrimitiveExpression.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -2,7 +2,7 @@
 using System.Collections;
 using System.Globalization;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST {
+namespace ICSharpCode.SharpRefactory.Parser.AST {
 	
 	public class PrimitiveExpression : Expression
 	{
@@ -33,7 +33,7 @@
 			this.stringValue = stringValue;
 		}
 		
-		static NumberFormatInfo nfi = CultureInfo.InvariantCulture.NumberFormat;
+		static NumberFormatInfo nfi = new CultureInfo( "en-US", false ).NumberFormat;
 
 		public override object AcceptVisitor(IASTVisitor visitor, object data)
 		{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/SizeOfExpression.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/SizeOfExpression.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/SizeOfExpression.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class SizeOfExpression : Expression
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/StackAllocExpression.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/StackAllocExpression.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/StackAllocExpression.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class StackAllocExpression : Expression
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/ThisReferenceExpression.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/ThisReferenceExpression.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/ThisReferenceExpression.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class ThisReferenceExpression : Expression
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/TypeOfExpression.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/TypeOfExpression.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/TypeOfExpression.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class TypeOfExpression : Expression
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/TypeReferenceExpression.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/TypeReferenceExpression.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/TypeReferenceExpression.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST {
+namespace ICSharpCode.SharpRefactory.Parser.AST {
 	
 	public class TypeReferenceExpression : Expression
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/UnaryOperatorExpression.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/UnaryOperatorExpression.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/UnaryOperatorExpression.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class UnaryOperatorExpression : Expression
 	{
@@ -25,6 +25,11 @@
 			}
 		}
 		
+		public UnaryOperatorExpression(UnaryOperatorType op)
+		{
+			this.op    = op;
+		}
+		
 		public UnaryOperatorExpression(Expression expression, UnaryOperatorType op)
 		{
 			this.expression  = expression;

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/UncheckedExpression.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/UncheckedExpression.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Expressions/UncheckedExpression.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class UncheckedExpression : Expression
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/GlobalScope/AttributeSection.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/GlobalScope/AttributeSection.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/GlobalScope/AttributeSection.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -18,7 +18,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST
+namespace ICSharpCode.SharpRefactory.Parser.AST
 {
 	public class NamedArgument : AbstractNode
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/GlobalScope/DelegateDeclaration.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/GlobalScope/DelegateDeclaration.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/GlobalScope/DelegateDeclaration.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -18,7 +18,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST
+namespace ICSharpCode.SharpRefactory.Parser.AST
 {
 	public class DelegateDeclaration : AbstractNode
 	{
@@ -73,15 +73,6 @@
 			}
 		}
 		
-//		public DelegateDeclaration(string name, Modifier modifier, TypeReference returnType, ArrayList parameters, ArrayList attributes)
-//		{
-//			this.name = name;
-//			this.modifier = modifier;
-//			this.returnType = returnType;
-//			this.parameters = parameters;
-//			this.attributes = attributes;
-//		}
-		
 		public override object AcceptVisitor(IASTVisitor visitor, object data)
 		{
 			return visitor.Visit(this, data);

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/GlobalScope/NamespaceDeclaration.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/GlobalScope/NamespaceDeclaration.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/GlobalScope/NamespaceDeclaration.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -18,7 +18,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST
+namespace ICSharpCode.SharpRefactory.Parser.AST
 {
 	public class NamespaceDeclaration : AbstractNode
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/GlobalScope/TypeDeclaration.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/GlobalScope/TypeDeclaration.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/GlobalScope/TypeDeclaration.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -19,7 +19,7 @@
 using System.Collections;
 using System.Collections.Specialized;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST
+namespace ICSharpCode.SharpRefactory.Parser.AST
 {
 	public class TypeDeclaration : AbstractNode
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/GlobalScope/UsingAliasDeclaration.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/GlobalScope/UsingAliasDeclaration.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/GlobalScope/UsingAliasDeclaration.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -18,7 +18,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST
+namespace ICSharpCode.SharpRefactory.Parser.AST
 {
 	public class UsingAliasDeclaration : AbstractNode
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/GlobalScope/UsingDeclaration.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/GlobalScope/UsingDeclaration.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/GlobalScope/UsingDeclaration.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -18,7 +18,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class UsingDeclaration : AbstractNode
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/IASTVisitor.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/IASTVisitor.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/IASTVisitor.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
-using MonoDevelop.SharpRefactory.Parser.AST;
+using ICSharpCode.SharpRefactory.Parser.AST;
 
-namespace MonoDevelop.SharpRefactory.Parser
+namespace ICSharpCode.SharpRefactory.Parser
 {
 	public interface IASTVisitor
 	{
@@ -80,6 +80,7 @@
 		object Visit(ThisReferenceExpression thisReferenceExpression, object data);
 		object Visit(BaseReferenceExpression baseReferenceExpression, object data);
 		object Visit(ObjectCreateExpression objectCreateExpression, object data);
+		object Visit(ArrayCreationParameter arrayCreationParameter, object data);
 		object Visit(ArrayCreateExpression arrayCreateExpression, object data);
 		object Visit(ParameterDeclarationExpression parameterDeclarationExpression, object data);
 		object Visit(FieldReferenceExpression fieldReferenceExpression, object data);

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/INode.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/INode.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/INode.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -19,7 +19,7 @@
 using System.Drawing;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST
+namespace ICSharpCode.SharpRefactory.Parser.AST
 {
 	public interface INode
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/LookupTableVisitor.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/LookupTableVisitor.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/LookupTableVisitor.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -2,9 +2,9 @@
 using System.Drawing;
 using System.Collections;
 
-using MonoDevelop.SharpRefactory.Parser.AST;
+using ICSharpCode.SharpRefactory.Parser.AST;
 
-namespace MonoDevelop.SharpRefactory.Parser
+namespace ICSharpCode.SharpRefactory.Parser
 {
 	public class LocalLookupVariable
 	{
@@ -71,7 +71,13 @@
 			            foreachStatement.VariableName,
 			            foreachStatement.StartLocation,
 			            foreachStatement.EndLocation);
-			return data;
+			if (foreachStatement.Expression != null) {
+				foreachStatement.Expression.AcceptVisitor(this, data);
+			}
+			if (foreachStatement.EmbeddedStatement == null) {
+				return data;
+			}
+			return foreachStatement.EmbeddedStatement.AcceptVisitor(this, data);
 		}
 	}
 }

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Modifier.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Modifier.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Modifier.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,6 +1,6 @@
 using System;
 
-namespace MonoDevelop.SharpRefactory.Parser
+namespace ICSharpCode.SharpRefactory.Parser
 {
 	[Flags]
 	public enum Modifier

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/BlockStatement.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/BlockStatement.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/BlockStatement.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST
+namespace ICSharpCode.SharpRefactory.Parser.AST
 {
 	public class BlockStatement : Statement
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/BreakStatement.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/BreakStatement.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/BreakStatement.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class BreakStatement : Statement
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/CheckedStatement.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/CheckedStatement.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/CheckedStatement.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class CheckedStatement : Statement
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/ContinueStatement.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/ContinueStatement.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/ContinueStatement.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class ContinueStatement : Statement
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/DoWhileStatement.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/DoWhileStatement.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/DoWhileStatement.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class DoWhileStatement : Statement
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/EmptyStatement.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/EmptyStatement.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/EmptyStatement.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class EmptyStatement : Statement
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/FixedStatement.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/FixedStatement.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/FixedStatement.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class FixedStatement : Statement
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/ForStatement.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/ForStatement.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/ForStatement.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class ForStatement : Statement
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/ForeachStatement.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/ForeachStatement.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/ForeachStatement.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class ForeachStatement : Statement
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/GotoCaseStatement.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/GotoCaseStatement.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/GotoCaseStatement.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class GotoCaseStatement : Statement
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/GotoStatement.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/GotoStatement.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/GotoStatement.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class GotoStatement : Statement
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/IfElseStatement.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/IfElseStatement.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/IfElseStatement.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class IfElseStatement : Statement
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/IfStatement.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/IfStatement.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/IfStatement.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class IfStatement : Statement
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/LabelStatement.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/LabelStatement.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/LabelStatement.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class LabelStatement : Statement
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/LocalVariableDeclaration.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/LocalVariableDeclaration.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/LocalVariableDeclaration.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class LocalVariableDeclaration : Statement
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/LockStatement.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/LockStatement.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/LockStatement.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class LockStatement : Statement
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/ReturnStatement.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/ReturnStatement.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/ReturnStatement.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class ReturnStatement : Statement
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/Statement.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/Statement.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/Statement.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -18,7 +18,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class Statement : AbstractNode
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/StatementExpression.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/StatementExpression.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/StatementExpression.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -18,7 +18,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class StatementExpression : Statement
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/SwitchStatement.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/SwitchStatement.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/SwitchStatement.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class SwitchStatement : BlockStatement
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/ThrowStatement.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/ThrowStatement.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/ThrowStatement.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class ThrowStatement : Statement
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/TryCatchStatement.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/TryCatchStatement.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/TryCatchStatement.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class TryCatchStatement : Statement
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/UncheckedStatement.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/UncheckedStatement.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/UncheckedStatement.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class UncheckedStatement : Statement
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/UnsafeStatement.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/UnsafeStatement.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/UnsafeStatement.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class UnsafeStatement : Statement
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/UsingStatement.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/UsingStatement.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/UsingStatement.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class UsingStatement : Statement
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/WhileStatement.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/WhileStatement.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/Statements/WhileStatement.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST 
+namespace ICSharpCode.SharpRefactory.Parser.AST 
 {
 	public class WhileStatement : Statement
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/ConstructorDeclaration.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/ConstructorDeclaration.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/ConstructorDeclaration.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -18,7 +18,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST
+namespace ICSharpCode.SharpRefactory.Parser.AST
 {
 	public class ConstructorDeclaration : AbstractNode
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/DestructorDeclaration.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/DestructorDeclaration.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/DestructorDeclaration.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -18,7 +18,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST
+namespace ICSharpCode.SharpRefactory.Parser.AST
 {
 	public class DestructorDeclaration : AbstractNode
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/EventAddRegion.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/EventAddRegion.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/EventAddRegion.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -18,7 +18,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST
+namespace ICSharpCode.SharpRefactory.Parser.AST
 {
 	public class EventAddRegion : AbstractNode
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/EventDeclaration.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/EventDeclaration.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/EventDeclaration.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -19,7 +19,7 @@
 using System.Drawing;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST
+namespace ICSharpCode.SharpRefactory.Parser.AST
 {
 	public class EventDeclaration : AbstractNode
 	{
@@ -122,8 +122,9 @@
 		public EventDeclaration()
 		{}
 		
-		public EventDeclaration(ArrayList attributes)
+		public EventDeclaration(Modifier modifier, ArrayList attributes)
 		{
+			this.modifier = modifier;
 			this.attributes = attributes;
 		}
 		

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/EventRemoveRegion.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/EventRemoveRegion.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/EventRemoveRegion.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -18,7 +18,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST
+namespace ICSharpCode.SharpRefactory.Parser.AST
 {
 	public class EventRemoveRegion : AbstractNode
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/FieldDeclaration.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/FieldDeclaration.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/FieldDeclaration.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -18,7 +18,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST
+namespace ICSharpCode.SharpRefactory.Parser.AST
 {
 	public class FieldDeclaration : AbstractNode
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/IndexerDeclaration.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/IndexerDeclaration.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/IndexerDeclaration.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -19,7 +19,7 @@
 using System.Drawing;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST
+namespace ICSharpCode.SharpRefactory.Parser.AST
 {
 	public class IndexerDeclaration : AbstractNode
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/MethodDeclaration.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/MethodDeclaration.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/MethodDeclaration.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -18,7 +18,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST
+namespace ICSharpCode.SharpRefactory.Parser.AST
 {
 	public class MethodDeclaration : AbstractNode
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/OperatorDeclaration.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/OperatorDeclaration.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/OperatorDeclaration.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -18,14 +18,14 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST
+namespace ICSharpCode.SharpRefactory.Parser.AST
 {
 	public class OperatorDeclaration : AbstractNode
 	{
 		OperatorDeclarator opratorDeclarator;
 		Modifier           modifier;
 		ArrayList          attributes = new ArrayList();
-		BlockStatement     body;
+		Statement     body;
 		
 		// TODO: delegate OperatorDeclarator Members
 		public OperatorDeclarator OpratorDeclarator {
@@ -55,7 +55,7 @@
 			}
 		}
 		
-		public BlockStatement Body {
+		public Statement Body {
 			get {
 				return body;
 			}set {
@@ -85,9 +85,9 @@
 	
 	public class OperatorDeclarator
 	{
-		OperatorType operatorType;
+		OperatorType  operatorType;
 		TypeReference typeReference;
-		string overloadOperator;
+		int           overloadOperatorToken;
 		
 		TypeReference firstParameterType;
 		string firstParameterName;
@@ -103,6 +103,11 @@
 				operatorType = value;
 			}
 		}
+		public bool IsConversion {
+			get {
+				return operatorType == OperatorType.Implicit || operatorType == OperatorType.Explicit;
+			}
+		}
 		
 		public TypeReference TypeReference {
 			get {
@@ -112,14 +117,16 @@
 				typeReference = value;
 			}
 		}
-		public string OverloadOperator {
+		
+		public int OverloadOperatorToken {
 			get {
-				return overloadOperator;
+				return overloadOperatorToken;
 			}
 			set {
-				overloadOperator = value;
+				overloadOperatorToken = value;
 			}
 		}
+		
 		public TypeReference FirstParameterType {
 			get {
 				return firstParameterType;
@@ -153,31 +160,21 @@
 			}
 		}
 		
-		public OperatorDeclarator(TypeReference typeReference, string overloadOperator, TypeReference firstParameterType, string firstParameterName)
+		public OperatorDeclarator(OperatorType operatorType, TypeReference typeReference, int overloadOperatorToken, TypeReference firstParameterType, string firstParameterName, TypeReference secondParameterType, string secondParameterName)
 		{
-			operatorType = OperatorType.Unary;
+			this.operatorType = operatorType;
 			this.typeReference = typeReference;
-			this.overloadOperator = overloadOperator;
+			this.overloadOperatorToken = overloadOperatorToken;
 			this.firstParameterType = firstParameterType;
 			this.firstParameterName = firstParameterName;
-		}
-		
-		public OperatorDeclarator(TypeReference typeReference, string overloadOperator, TypeReference firstParameterType, string firstParameterName, TypeReference secondParameterType, string secondParameterName)
-		{
-			operatorType = OperatorType.Binary;
-			this.typeReference = typeReference;
-			this.overloadOperator = overloadOperator;
-			this.firstParameterType = firstParameterType;
-			this.firstParameterName = firstParameterName;
 			this.secondParameterType = secondParameterType;
 			this.secondParameterName = secondParameterName;
 		}
 		
-		public OperatorDeclarator(OperatorType operatorType,TypeReference typeReference,  string overloadOperator, TypeReference firstParameterType, string firstParameterName)
+		public OperatorDeclarator(OperatorType operatorType,TypeReference typeReference,  TypeReference firstParameterType, string firstParameterName)
 		{
-			this.operatorType = operatorType;
-			this.typeReference = typeReference;
-			this.overloadOperator = overloadOperator;
+			this.operatorType       = operatorType;
+			this.typeReference      = typeReference;
 			this.firstParameterType = firstParameterType;
 			this.firstParameterName = firstParameterName;
 		}

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/ParameterDeclarationExpression.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/ParameterDeclarationExpression.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/ParameterDeclarationExpression.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST {
+namespace ICSharpCode.SharpRefactory.Parser.AST {
 	
 	public class ParameterDeclarationExpression : Expression
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/PropertyDeclaration.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/PropertyDeclaration.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/PropertyDeclaration.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -19,7 +19,7 @@
 using System.Drawing;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST
+namespace ICSharpCode.SharpRefactory.Parser.AST
 {
 	public class PropertyDeclaration : AbstractNode
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/PropertyGetRegion.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/PropertyGetRegion.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/PropertyGetRegion.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -18,7 +18,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST
+namespace ICSharpCode.SharpRefactory.Parser.AST
 {
 	public class PropertyGetRegion : AbstractNode
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/PropertySetRegion.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/PropertySetRegion.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/PropertySetRegion.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -18,7 +18,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST
+namespace ICSharpCode.SharpRefactory.Parser.AST
 {
 	public class PropertySetRegion : AbstractNode
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/TypeReference.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/TypeReference.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/TypeReference.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -19,7 +19,7 @@
 using System.Collections;
 using System.Text;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST
+namespace ICSharpCode.SharpRefactory.Parser.AST
 {
 	public class TypeReference
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/VariableDeclaration.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/VariableDeclaration.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/TypeLevel/VariableDeclaration.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -18,7 +18,7 @@
 using System;
 using System.Collections;
 
-namespace MonoDevelop.SharpRefactory.Parser.AST
+namespace ICSharpCode.SharpRefactory.Parser.AST
 {
 	public class VariableDeclaration : AbstractNode
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/Error.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/Error.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/Error.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,7 +1,7 @@
 using System;
 using System.Text;
 
-namespace MonoDevelop.SharpRefactory.Parser
+namespace ICSharpCode.SharpRefactory.Parser
 {
 	public delegate void ErrorCodeProc(int line, int col, int n);
 	public delegate void ErrorMsgProc(int line, int col, string msg);

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/Modifiers.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/Modifiers.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/Modifiers.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,4 +1,4 @@
-namespace MonoDevelop.SharpRefactory.Parser
+namespace ICSharpCode.SharpRefactory.Parser
 {
 	public class Modifiers
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/Parser.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/Parser.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/Parser.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -4,12 +4,12 @@
 using System.Collections;
 using System.Collections.Specialized;
 using System.Text;
-using MonoDevelop.SharpRefactory.Parser;
-using MonoDevelop.SharpRefactory.Parser.AST;
+using ICSharpCode.SharpRefactory.Parser;
+using ICSharpCode.SharpRefactory.Parser.AST;
 using System;
 using System.Reflection;
 
-namespace MonoDevelop.SharpRefactory.Parser {
+namespace ICSharpCode.SharpRefactory.Parser {
 
 
 
@@ -338,7 +338,7 @@
 /* True, if lookahead is a primitive type keyword, or *
  * if it is a type declaration followed by an ident   */
 bool IsLocalVarDecl () {
-	if (ParserUtil.IsTypeKW(la) || la.kind == Tokens.Void) return true;
+	if ((ParserUtil.IsTypeKW(la) && Peek(1).kind != Tokens.Dot) || la.kind == Tokens.Void) return true;
 	
 	StartPeek();
 	Token pt = la ;  // peek token
@@ -517,17 +517,17 @@
 	}
 
 	void GlobalAttributeSection() {
+		Expect(16);
 
-#line  551 "cs.ATG" 
+#line  552 "cs.ATG" 
 		Point startPos = t.Location; 
-		Expect(16);
 		Expect(1);
 
 #line  552 "cs.ATG" 
 		if (t.val != "assembly") Error("global attribute target specifier (\"assembly\") expected");
 		string attributeTarget = t.val;
 		ArrayList attributes = new ArrayList();
-		MonoDevelop.SharpRefactory.Parser.AST.Attribute attribute;
+		ICSharpCode.SharpRefactory.Parser.AST.Attribute attribute;
 		
 		Expect(9);
 		Attribute(
@@ -644,7 +644,7 @@
 
 	void Attribute(
 #line  567 "cs.ATG" 
-out MonoDevelop.SharpRefactory.Parser.AST.Attribute attribute) {
+out ICSharpCode.SharpRefactory.Parser.AST.Attribute attribute) {
 
 #line  568 "cs.ATG" 
 		string qualident; 
@@ -664,7 +664,7 @@
 		}
 
 #line  574 "cs.ATG" 
-		attribute  = new MonoDevelop.SharpRefactory.Parser.AST.Attribute(name, positional, named);
+		attribute  = new ICSharpCode.SharpRefactory.Parser.AST.Attribute(name, positional, named);
 	}
 
 	void AttributeArguments(
@@ -730,40 +730,43 @@
 	}
 
 	void Expr(
-#line  1684 "cs.ATG" 
+#line  1714 "cs.ATG" 
 out Expression expr) {
 
-#line  1685 "cs.ATG" 
-		expr = new Expression(); 
+#line  1715 "cs.ATG" 
+		expr = null; Expression expr1 = null, expr2 = null; 
 		UnaryExpr(
-#line  1687 "cs.ATG" 
+#line  1717 "cs.ATG" 
 out expr);
 		if (StartOf(5)) {
 			ConditionalOrExpr(
-#line  1690 "cs.ATG" 
+#line  1720 "cs.ATG" 
 ref expr);
 			if (la.kind == 11) {
 				lexer.NextToken();
 				Expr(
-#line  1690 "cs.ATG" 
-out expr);
+#line  1720 "cs.ATG" 
+out expr1);
 				Expect(9);
 				Expr(
-#line  1690 "cs.ATG" 
-out expr);
+#line  1720 "cs.ATG" 
+out expr2);
+
+#line  1720 "cs.ATG" 
+				expr = new ConditionalExpression(expr, expr1, expr2);  
 			}
 		} else if (StartOf(6)) {
 
-#line  1692 "cs.ATG" 
+#line  1722 "cs.ATG" 
 			AssignmentOperatorType op; Expression val; 
 			AssignmentOperator(
-#line  1692 "cs.ATG" 
+#line  1722 "cs.ATG" 
 out op);
 			Expr(
-#line  1692 "cs.ATG" 
+#line  1722 "cs.ATG" 
 out val);
 
-#line  1692 "cs.ATG" 
+#line  1722 "cs.ATG" 
 			expr = new AssignmentExpression(expr, op, val); 
 		} else SynErr(128);
 	}
@@ -775,7 +778,7 @@
 #line  611 "cs.ATG" 
 		string attributeTarget = "";
 		ArrayList attributes = new ArrayList();
-		MonoDevelop.SharpRefactory.Parser.AST.Attribute attribute;
+		ICSharpCode.SharpRefactory.Parser.AST.Attribute attribute;
 		
 		
 		Expect(16);
@@ -947,7 +950,7 @@
 			}
 
 #line  685 "cs.ATG" 
-			newType.EndLocation = t.EndLocation; 
+			newType.EndLocation = t.Location; 
 			compilationUnit.BlockEnd();
 			
 		} else if (StartOf(7)) {
@@ -986,7 +989,7 @@
 				}
 
 #line  699 "cs.ATG" 
-				newType.EndLocation = t.EndLocation; 
+				newType.EndLocation = t.Location; 
 				compilationUnit.BlockEnd();
 				
 			} else if (la.kind == 82) {
@@ -1020,7 +1023,7 @@
 				}
 
 #line  712 "cs.ATG" 
-				newType.EndLocation = t.EndLocation; 
+				newType.EndLocation = t.Location; 
 				compilationUnit.BlockEnd();
 				
 			} else if (la.kind == 67) {
@@ -1057,7 +1060,7 @@
 				}
 
 #line  728 "cs.ATG" 
-				newType.EndLocation = t.EndLocation; 
+				newType.EndLocation = t.Location; 
 				compilationUnit.BlockEnd();
 				
 			} else {
@@ -1101,7 +1104,7 @@
 				Expect(10);
 
 #line  743 "cs.ATG" 
-				delegateDeclr.EndLocation = t.EndLocation;
+				delegateDeclr.EndLocation = t.Location;
 				compilationUnit.AddChild(delegateDeclr);
 				
 			}
@@ -1618,23 +1621,23 @@
 	}
 
 	void ClassMemberDecl(
-#line  1153 "cs.ATG" 
+#line  1178 "cs.ATG" 
 Modifiers m, ArrayList attributes) {
 
-#line  1154 "cs.ATG" 
+#line  1179 "cs.ATG" 
 		Statement stmt = null; 
 		if (StartOf(16)) {
 			StructMemberDecl(
-#line  1156 "cs.ATG" 
+#line  1181 "cs.ATG" 
 m, attributes);
 		} else if (la.kind == 25) {
 
-#line  1157 "cs.ATG" 
+#line  1182 "cs.ATG" 
 			m.Check(Modifier.Destructors); Point startPos = t.Location; 
 			lexer.NextToken();
 			Expect(1);
 
-#line  1158 "cs.ATG" 
+#line  1183 "cs.ATG" 
 			DestructorDeclaration d = new DestructorDeclaration(t.val, attributes); 
 			d.Modifier = m.Modifier;
 			d.StartLocation = startPos;
@@ -1643,13 +1646,13 @@
 			Expect(19);
 			if (la.kind == 14) {
 				Block(
-#line  1162 "cs.ATG" 
+#line  1187 "cs.ATG" 
 out stmt);
 			} else if (la.kind == 10) {
 				lexer.NextToken();
 			} else SynErr(139);
 
-#line  1162 "cs.ATG" 
+#line  1187 "cs.ATG" 
 			d.EndLocation = t.EndLocation; 
 			d.Body = (BlockStatement)stmt;
 			compilationUnit.AddChild(d);
@@ -1662,7 +1665,7 @@
 Modifiers m, ArrayList attributes) {
 
 #line  972 "cs.ATG" 
-		string qualident;
+		string qualident = null;
 		TypeReference type;
 		Expression expr;
 		ArrayList p = new ArrayList();
@@ -1765,7 +1768,7 @@
 			lexer.NextToken();
 
 #line  1012 "cs.ATG" 
-			EventDeclaration eventDecl = new EventDeclaration(attributes);
+			EventDeclaration eventDecl = new EventDeclaration(m.Modifier, attributes);
 			eventDecl.StartLocation = t.Location;
 			compilationUnit.AddChild(eventDecl);
 			compilationUnit.BlockStart(eventDecl);
@@ -1872,70 +1875,102 @@
 #line  1050 "cs.ATG" 
 			m.Check(Modifier.Operators);
 			if (m.isNone) Error("at least one modifier must be set"); 
+			bool isImplicit = true;
 			
 			if (la.kind == 79) {
 				lexer.NextToken();
 			} else {
 				lexer.NextToken();
+
+#line  1054 "cs.ATG" 
+				isImplicit = false; 
 			}
 			Expect(91);
 			Type(
-#line  1053 "cs.ATG" 
+#line  1055 "cs.ATG" 
 out type);
+
+#line  1055 "cs.ATG" 
+			TypeReference operatorType = type; 
 			Expect(18);
 			Type(
-#line  1053 "cs.ATG" 
+#line  1056 "cs.ATG" 
 out type);
 			Expect(1);
+
+#line  1056 "cs.ATG" 
+			string varName = t.val; 
 			Expect(19);
 			if (la.kind == 14) {
 				Block(
-#line  1053 "cs.ATG" 
+#line  1056 "cs.ATG" 
 out stmt);
 			} else if (la.kind == 10) {
 				lexer.NextToken();
+
+#line  1056 "cs.ATG" 
+				stmt = null; 
 			} else SynErr(144);
+
+#line  1059 "cs.ATG" 
+			OperatorDeclarator operatorDeclarator = new OperatorDeclarator(isImplicit ? OperatorType.Implicit : OperatorType.Explicit,
+			                                                              operatorType,
+			                                                              type,
+			                                                              varName);
+			OperatorDeclaration operatorDeclaration = new OperatorDeclaration(operatorDeclarator, m.Modifier, attributes);
+			operatorDeclaration.Body = stmt;
+			compilationUnit.AddChild(operatorDeclaration);
+			
 		} else if (StartOf(17)) {
 			TypeDecl(
-#line  1056 "cs.ATG" 
+#line  1069 "cs.ATG" 
 m, attributes);
 		} else if (StartOf(8)) {
 			Type(
-#line  1057 "cs.ATG" 
+#line  1070 "cs.ATG" 
 out type);
 
-#line  1057 "cs.ATG" 
+#line  1070 "cs.ATG" 
 			Point startPos = t.Location; 
 			if (la.kind == 91) {
 
-#line  1059 "cs.ATG" 
+#line  1072 "cs.ATG" 
 				Token op;
 				m.Check(Modifier.Operators);
 				if (m.isNone) Error("at least one modifier must be set");
 				
 				lexer.NextToken();
 				OverloadableOperator(
-#line  1063 "cs.ATG" 
+#line  1076 "cs.ATG" 
 out op);
+
+#line  1076 "cs.ATG" 
+				TypeReference firstType, secondType = null; string secondName = null; 
 				Expect(18);
 				Type(
-#line  1064 "cs.ATG" 
-out type);
+#line  1077 "cs.ATG" 
+out firstType);
 				Expect(1);
+
+#line  1077 "cs.ATG" 
+				string firstName = t.val; 
 				if (la.kind == 12) {
 					lexer.NextToken();
 					Type(
-#line  1065 "cs.ATG" 
-out type);
+#line  1078 "cs.ATG" 
+out secondType);
 					Expect(1);
 
-#line  1065 "cs.ATG" 
-					if (ParserUtil.IsUnaryOperator(op))
+#line  1078 "cs.ATG" 
+					secondName = t.val; 
+
+#line  1078 "cs.ATG" 
+					if (ParserUtil.IsUnaryOperator(op) && !ParserUtil.IsBinaryOperator(op))
 					Error("too many operands for unary operator"); 
 					
 				} else if (la.kind == 19) {
 
-#line  1068 "cs.ATG" 
+#line  1081 "cs.ATG" 
 					if (ParserUtil.IsBinaryOperator(op))
 					Error("too few operands for binary operator");
 					
@@ -1943,49 +1978,62 @@
 				Expect(19);
 				if (la.kind == 14) {
 					Block(
-#line  1072 "cs.ATG" 
+#line  1085 "cs.ATG" 
 out stmt);
 				} else if (la.kind == 10) {
 					lexer.NextToken();
 				} else SynErr(146);
+
+#line  1087 "cs.ATG" 
+				OperatorDeclarator operatorDeclarator = new OperatorDeclarator(secondType != null ? OperatorType.Binary : OperatorType.Unary, 
+				                                                              type,
+				                                                              op.kind,
+				                                                              firstType,
+				                                                              firstName,
+				                                                              secondType,
+				                                                              secondName);
+				OperatorDeclaration operatorDeclaration = new OperatorDeclaration(operatorDeclarator, m.Modifier, attributes);
+				operatorDeclaration.Body = stmt;
+				compilationUnit.AddChild(operatorDeclaration);
+				
 			} else if (
-#line  1075 "cs.ATG" 
+#line  1100 "cs.ATG" 
 IsVarDecl()) {
 
-#line  1075 "cs.ATG" 
+#line  1100 "cs.ATG" 
 				m.Check(Modifier.Fields); 
 				FieldDeclaration fd = new FieldDeclaration(attributes, type, m.Modifier);
 				fd.StartLocation = startPos; 
 				
 				VariableDeclarator(
-#line  1079 "cs.ATG" 
+#line  1104 "cs.ATG" 
 variableDeclarators);
 				while (la.kind == 12) {
 					lexer.NextToken();
 					VariableDeclarator(
-#line  1080 "cs.ATG" 
+#line  1105 "cs.ATG" 
 variableDeclarators);
 				}
 				Expect(10);
 
-#line  1081 "cs.ATG" 
+#line  1106 "cs.ATG" 
 				fd.EndLocation = t.EndLocation; fd.Fields = variableDeclarators; compilationUnit.AddChild(fd); 
 			} else if (la.kind == 110) {
 
-#line  1084 "cs.ATG" 
+#line  1109 "cs.ATG" 
 				m.Check(Modifier.Indexers); 
 				lexer.NextToken();
 				Expect(16);
 				FormalParameterList(
-#line  1085 "cs.ATG" 
+#line  1110 "cs.ATG" 
 out p);
 				Expect(17);
 
-#line  1085 "cs.ATG" 
+#line  1110 "cs.ATG" 
 				Point endLocation = t.EndLocation; 
 				Expect(14);
 
-#line  1086 "cs.ATG" 
+#line  1111 "cs.ATG" 
 				IndexerDeclaration indexer = new IndexerDeclaration(type, p, m.Modifier, attributes);
 				indexer.StartLocation = startPos;
 				indexer.EndLocation   = endLocation;
@@ -1994,11 +2042,11 @@
 				PropertySetRegion setRegion;
 				
 				AccessorDecls(
-#line  1093 "cs.ATG" 
+#line  1118 "cs.ATG" 
 out getRegion, out setRegion);
 				Expect(15);
 
-#line  1094 "cs.ATG" 
+#line  1119 "cs.ATG" 
 				indexer.BodyEnd    = t.EndLocation;
 				indexer.GetRegion = getRegion;
 				indexer.SetRegion = setRegion;
@@ -2006,25 +2054,25 @@
 				
 			} else if (la.kind == 1) {
 				Qualident(
-#line  1099 "cs.ATG" 
+#line  1124 "cs.ATG" 
 out qualident);
 
-#line  1099 "cs.ATG" 
+#line  1124 "cs.ATG" 
 				Point qualIdentEndLocation = t.EndLocation; 
 				if (la.kind == 14 || la.kind == 18) {
 					if (la.kind == 18) {
 
-#line  1102 "cs.ATG" 
+#line  1127 "cs.ATG" 
 						m.Check(Modifier.PropertysEventsMethods); 
 						lexer.NextToken();
 						if (StartOf(9)) {
 							FormalParameterList(
-#line  1103 "cs.ATG" 
+#line  1128 "cs.ATG" 
 out p);
 						}
 						Expect(19);
 
-#line  1103 "cs.ATG" 
+#line  1128 "cs.ATG" 
 						MethodDeclaration methodDeclaration = new MethodDeclaration(qualident, 
 						                                                     m.Modifier, 
 						                                                     type, 
@@ -2036,18 +2084,18 @@
 						  
 						if (la.kind == 14) {
 							Block(
-#line  1112 "cs.ATG" 
+#line  1137 "cs.ATG" 
 out stmt);
 						} else if (la.kind == 10) {
 							lexer.NextToken();
 						} else SynErr(147);
 
-#line  1112 "cs.ATG" 
+#line  1137 "cs.ATG" 
 						methodDeclaration.Body  = (BlockStatement)stmt; 
 					} else {
 						lexer.NextToken();
 
-#line  1115 "cs.ATG" 
+#line  1140 "cs.ATG" 
 						PropertyDeclaration pDecl = new PropertyDeclaration(qualident, type, m.Modifier, attributes); 
 						pDecl.StartLocation = startPos;
 						pDecl.EndLocation   = qualIdentEndLocation;
@@ -2056,11 +2104,11 @@
 						PropertySetRegion setRegion;
 						
 						AccessorDecls(
-#line  1122 "cs.ATG" 
+#line  1147 "cs.ATG" 
 out getRegion, out setRegion);
 						Expect(15);
 
-#line  1124 "cs.ATG" 
+#line  1149 "cs.ATG" 
 						pDecl.GetRegion = getRegion;
 						pDecl.SetRegion = setRegion;
 						pDecl.BodyEnd = t.EndLocation;
@@ -2069,17 +2117,17 @@
 					}
 				} else if (la.kind == 13) {
 
-#line  1132 "cs.ATG" 
+#line  1157 "cs.ATG" 
 					m.Check(Modifier.Indexers); 
 					lexer.NextToken();
 					Expect(110);
 					Expect(16);
 					FormalParameterList(
-#line  1133 "cs.ATG" 
+#line  1158 "cs.ATG" 
 out p);
 					Expect(17);
 
-#line  1134 "cs.ATG" 
+#line  1159 "cs.ATG" 
 					IndexerDeclaration indexer = new IndexerDeclaration(type, p, m.Modifier, attributes);
 					indexer.StartLocation = startPos;
 					indexer.EndLocation   = t.EndLocation;
@@ -2089,14 +2137,14 @@
 					
 					Expect(14);
 
-#line  1141 "cs.ATG" 
+#line  1166 "cs.ATG" 
 					Point bodyStart = t.Location; 
 					AccessorDecls(
-#line  1142 "cs.ATG" 
+#line  1167 "cs.ATG" 
 out getRegion, out setRegion);
 					Expect(15);
 
-#line  1143 "cs.ATG" 
+#line  1168 "cs.ATG" 
 					indexer.BodyStart = bodyStart;
 					indexer.BodyEnd   = t.EndLocation;
 					indexer.GetRegion = getRegion;
@@ -2110,7 +2158,7 @@
 
 	void InterfaceMemberDecl() {
 
-#line  1170 "cs.ATG" 
+#line  1195 "cs.ATG" 
 		TypeReference type;
 		ArrayList p;
 		AttributeSection section;
@@ -2120,124 +2168,145 @@
 		string name;
 		PropertyGetRegion getBlock;
 		PropertySetRegion setBlock;
+		Point startLocation = new Point(-1, -1);
 		
 		while (la.kind == 16) {
 			AttributeSection(
-#line  1181 "cs.ATG" 
+#line  1207 "cs.ATG" 
 out section);
 
-#line  1181 "cs.ATG" 
+#line  1207 "cs.ATG" 
 			attributes.Add(section); 
 		}
 		if (la.kind == 88) {
 			lexer.NextToken();
 
-#line  1182 "cs.ATG" 
-			mod = Modifier.New; 
+#line  1208 "cs.ATG" 
+			mod = Modifier.New; startLocation = t.Location; 
 		}
 		if (
-#line  1185 "cs.ATG" 
+#line  1211 "cs.ATG" 
 NotVoidPointer()) {
 			Expect(122);
+
+#line  1211 "cs.ATG" 
+			if (startLocation.X == -1) startLocation = t.Location; 
 			Expect(1);
 
-#line  1185 "cs.ATG" 
+#line  1211 "cs.ATG" 
 			name = t.val; 
 			Expect(18);
 			if (StartOf(9)) {
 				FormalParameterList(
-#line  1186 "cs.ATG" 
-out p);
+#line  1212 "cs.ATG" 
+out parameters);
 			}
 			Expect(19);
 			Expect(10);
 
-#line  1186 "cs.ATG" 
+#line  1212 "cs.ATG" 
 			MethodDeclaration md = new MethodDeclaration(name, mod, new TypeReference("void"), parameters, attributes);
+			md.StartLocation = startLocation;
 			md.EndLocation = t.EndLocation;
 			compilationUnit.AddChild(md);
 			
 		} else if (StartOf(18)) {
 			if (StartOf(8)) {
 				Type(
-#line  1191 "cs.ATG" 
+#line  1218 "cs.ATG" 
 out type);
+
+#line  1218 "cs.ATG" 
+				if (startLocation.X == -1) startLocation = t.Location; 
 				if (la.kind == 1) {
 					lexer.NextToken();
 
-#line  1193 "cs.ATG" 
-					name = t.val; 
+#line  1220 "cs.ATG" 
+					name = t.val; Point qualIdentEndLocation = t.EndLocation; 
 					if (la.kind == 18) {
 						lexer.NextToken();
 						if (StartOf(9)) {
 							FormalParameterList(
-#line  1196 "cs.ATG" 
+#line  1223 "cs.ATG" 
 out parameters);
 						}
 						Expect(19);
 						Expect(10);
 
-#line  1196 "cs.ATG" 
+#line  1223 "cs.ATG" 
 						MethodDeclaration md = new MethodDeclaration(name, mod, type, parameters, attributes);
+						md.StartLocation = startLocation;
 						md.EndLocation = t.EndLocation;
 						compilationUnit.AddChild(md);
 						
 					} else if (la.kind == 14) {
 
-#line  1201 "cs.ATG" 
+#line  1229 "cs.ATG" 
 						PropertyDeclaration pd = new PropertyDeclaration(name, type, mod, attributes); compilationUnit.AddChild(pd); 
 						lexer.NextToken();
+
+#line  1230 "cs.ATG" 
+						Point bodyStart = t.Location;
 						InterfaceAccessors(
-#line  1202 "cs.ATG" 
+#line  1230 "cs.ATG" 
 out getBlock, out setBlock);
 						Expect(15);
 
-#line  1202 "cs.ATG" 
-						pd.GetRegion = getBlock; pd.SetRegion = setBlock; pd.EndLocation = t.EndLocation; 
+#line  1230 "cs.ATG" 
+						pd.GetRegion = getBlock; pd.SetRegion = setBlock; pd.StartLocation = startLocation; pd.EndLocation = qualIdentEndLocation; pd.BodyStart = bodyStart; pd.BodyEnd = t.EndLocation; 
 					} else SynErr(151);
 				} else if (la.kind == 110) {
 					lexer.NextToken();
 					Expect(16);
 					FormalParameterList(
-#line  1205 "cs.ATG" 
+#line  1233 "cs.ATG" 
 out p);
 					Expect(17);
 
-#line  1205 "cs.ATG" 
+#line  1233 "cs.ATG" 
+					Point bracketEndLocation = t.EndLocation; 
+
+#line  1233 "cs.ATG" 
 					IndexerDeclaration id = new IndexerDeclaration(type, p, mod, attributes); compilationUnit.AddChild(id); 
 					Expect(14);
+
+#line  1234 "cs.ATG" 
+					Point bodyStart = t.Location;
 					InterfaceAccessors(
-#line  1206 "cs.ATG" 
+#line  1234 "cs.ATG" 
 out getBlock, out setBlock);
 					Expect(15);
 
-#line  1206 "cs.ATG" 
-					id.GetRegion = getBlock; id.SetRegion = setBlock; id.EndLocation = t.EndLocation; 
+#line  1234 "cs.ATG" 
+					id.GetRegion = getBlock; id.SetRegion = setBlock; id.StartLocation = startLocation;  id.EndLocation = bracketEndLocation; id.BodyStart = bodyStart; id.BodyEnd = t.EndLocation;
 				} else SynErr(152);
 			} else {
 				lexer.NextToken();
+
+#line  1237 "cs.ATG" 
+				if (startLocation.X == -1) startLocation = t.Location; 
 				Type(
-#line  1209 "cs.ATG" 
+#line  1237 "cs.ATG" 
 out type);
 				Expect(1);
 
-#line  1209 "cs.ATG" 
+#line  1237 "cs.ATG" 
 				EventDeclaration ed = new EventDeclaration(type, t.val, mod, attributes);
 				compilationUnit.AddChild(ed);
 				
 				Expect(10);
 
-#line  1212 "cs.ATG" 
-				ed.EndLocation = t.EndLocation; 
+#line  1240 "cs.ATG" 
+				ed.StartLocation = startLocation; ed.EndLocation = t.EndLocation; 
 			}
 		} else SynErr(153);
 	}
 
 	void EnumMemberDecl(
-#line  1217 "cs.ATG" 
+#line  1245 "cs.ATG" 
 out FieldDeclaration f) {
 
-#line  1219 "cs.ATG" 
+#line  1247 "cs.ATG" 
 		Expression expr = null;
 		ArrayList attributes = new ArrayList();
 		AttributeSection section = null;
@@ -2245,15 +2314,15 @@
 		
 		while (la.kind == 16) {
 			AttributeSection(
-#line  1225 "cs.ATG" 
+#line  1253 "cs.ATG" 
 out section);
 
-#line  1225 "cs.ATG" 
+#line  1253 "cs.ATG" 
 			attributes.Add(section); 
 		}
 		Expect(1);
 
-#line  1226 "cs.ATG" 
+#line  1254 "cs.ATG" 
 		f = new FieldDeclaration(attributes);
 		varDecl         = new VariableDeclaration(t.val);
 		f.Fields.Add(varDecl);
@@ -2262,10 +2331,10 @@
 		if (la.kind == 3) {
 			lexer.NextToken();
 			Expr(
-#line  1231 "cs.ATG" 
+#line  1259 "cs.ATG" 
 out expr);
 
-#line  1231 "cs.ATG" 
+#line  1259 "cs.ATG" 
 			varDecl.Initializer = expr; 
 		}
 	}
@@ -2387,11 +2456,11 @@
 	}
 
 	void Block(
-#line  1335 "cs.ATG" 
+#line  1363 "cs.ATG" 
 out Statement stmt) {
 		Expect(14);
 
-#line  1337 "cs.ATG" 
+#line  1365 "cs.ATG" 
 		BlockStatement blockStmt = new BlockStatement();
 		blockStmt.StartLocation = t.Location;
 		compilationUnit.BlockStart(blockStmt);
@@ -2401,7 +2470,7 @@
 		}
 		Expect(15);
 
-#line  1342 "cs.ATG" 
+#line  1370 "cs.ATG" 
 		stmt = blockStmt;
 		blockStmt.EndLocation = t.EndLocation;
 		compilationUnit.BlockEnd();
@@ -2409,34 +2478,34 @@
 	}
 
 	void VariableDeclarator(
-#line  1328 "cs.ATG" 
+#line  1356 "cs.ATG" 
 ArrayList fieldDeclaration) {
 
-#line  1329 "cs.ATG" 
+#line  1357 "cs.ATG" 
 		Expression expr = null; 
 		Expect(1);
 
-#line  1331 "cs.ATG" 
+#line  1359 "cs.ATG" 
 		VariableDeclaration f = new VariableDeclaration(t.val); 
 		if (la.kind == 3) {
 			lexer.NextToken();
 			VariableInitializer(
-#line  1332 "cs.ATG" 
+#line  1360 "cs.ATG" 
 out expr);
 
-#line  1332 "cs.ATG" 
+#line  1360 "cs.ATG" 
 			f.Initializer = expr; 
 		}
 
-#line  1332 "cs.ATG" 
+#line  1360 "cs.ATG" 
 		fieldDeclaration.Add(f); 
 	}
 
 	void EventAccessorDecls(
-#line  1277 "cs.ATG" 
+#line  1305 "cs.ATG" 
 out EventAddRegion addBlock, out EventRemoveRegion removeBlock) {
 
-#line  1278 "cs.ATG" 
+#line  1306 "cs.ATG" 
 		AttributeSection section;
 		ArrayList attributes = new ArrayList();
 		Statement stmt;
@@ -2445,102 +2514,102 @@
 		
 		while (la.kind == 16) {
 			AttributeSection(
-#line  1285 "cs.ATG" 
+#line  1313 "cs.ATG" 
 out section);
 
-#line  1285 "cs.ATG" 
+#line  1313 "cs.ATG" 
 			attributes.Add(section); 
 		}
 		if (
-#line  1287 "cs.ATG" 
+#line  1315 "cs.ATG" 
 IdentIsAdd()) {
 
-#line  1287 "cs.ATG" 
+#line  1315 "cs.ATG" 
 			addBlock = new EventAddRegion(attributes); 
 			AddAccessorDecl(
-#line  1288 "cs.ATG" 
+#line  1316 "cs.ATG" 
 out stmt);
 
-#line  1288 "cs.ATG" 
+#line  1316 "cs.ATG" 
 			attributes = new ArrayList(); addBlock.Block = (BlockStatement)stmt; 
 			while (la.kind == 16) {
 				AttributeSection(
-#line  1289 "cs.ATG" 
+#line  1317 "cs.ATG" 
 out section);
 
-#line  1289 "cs.ATG" 
+#line  1317 "cs.ATG" 
 				attributes.Add(section); 
 			}
 			RemoveAccessorDecl(
-#line  1290 "cs.ATG" 
+#line  1318 "cs.ATG" 
 out stmt);
 
-#line  1290 "cs.ATG" 
+#line  1318 "cs.ATG" 
 			removeBlock = new EventRemoveRegion(attributes); removeBlock.Block = (BlockStatement)stmt; 
 		} else if (
-#line  1291 "cs.ATG" 
+#line  1319 "cs.ATG" 
 IdentIsRemove()) {
 			RemoveAccessorDecl(
-#line  1292 "cs.ATG" 
+#line  1320 "cs.ATG" 
 out stmt);
 
-#line  1292 "cs.ATG" 
+#line  1320 "cs.ATG" 
 			removeBlock = new EventRemoveRegion(attributes); removeBlock.Block = (BlockStatement)stmt; attributes = new ArrayList(); 
 			while (la.kind == 16) {
 				AttributeSection(
-#line  1293 "cs.ATG" 
+#line  1321 "cs.ATG" 
 out section);
 
-#line  1293 "cs.ATG" 
+#line  1321 "cs.ATG" 
 				attributes.Add(section); 
 			}
 			AddAccessorDecl(
-#line  1294 "cs.ATG" 
+#line  1322 "cs.ATG" 
 out stmt);
 
-#line  1294 "cs.ATG" 
+#line  1322 "cs.ATG" 
 			addBlock = new EventAddRegion(attributes); addBlock.Block = (BlockStatement)stmt; 
 		} else if (la.kind == 1) {
 			lexer.NextToken();
 
-#line  1295 "cs.ATG" 
+#line  1323 "cs.ATG" 
 			Error("add or remove accessor declaration expected"); 
 		} else SynErr(156);
 	}
 
 	void ConstructorInitializer(
-#line  1364 "cs.ATG" 
+#line  1392 "cs.ATG" 
 out ConstructorInitializer ci) {
 
-#line  1365 "cs.ATG" 
+#line  1393 "cs.ATG" 
 		Expression expr; ci = new ConstructorInitializer(); 
 		Expect(9);
 		if (la.kind == 50) {
 			lexer.NextToken();
 
-#line  1369 "cs.ATG" 
+#line  1397 "cs.ATG" 
 			ci.ConstructorInitializerType = ConstructorInitializerType.Base; 
 		} else if (la.kind == 110) {
 			lexer.NextToken();
 
-#line  1370 "cs.ATG" 
+#line  1398 "cs.ATG" 
 			ci.ConstructorInitializerType = ConstructorInitializerType.This; 
 		} else SynErr(157);
 		Expect(18);
 		if (StartOf(21)) {
 			Argument(
-#line  1373 "cs.ATG" 
+#line  1401 "cs.ATG" 
 out expr);
 
-#line  1373 "cs.ATG" 
+#line  1401 "cs.ATG" 
 			ci.Arguments.Add(expr); 
 			while (la.kind == 12) {
 				lexer.NextToken();
 				Argument(
-#line  1373 "cs.ATG" 
+#line  1401 "cs.ATG" 
 out expr);
 
-#line  1373 "cs.ATG" 
+#line  1401 "cs.ATG" 
 				ci.Arguments.Add(expr); 
 			}
 		}
@@ -2548,7 +2617,7 @@
 	}
 
 	void OverloadableOperator(
-#line  1385 "cs.ATG" 
+#line  1413 "cs.ATG" 
 out Token op) {
 		switch (la.kind) {
 		case 4: {
@@ -2642,15 +2711,15 @@
 		default: SynErr(158); break;
 		}
 
-#line  1394 "cs.ATG" 
+#line  1422 "cs.ATG" 
 		op = t; 
 	}
 
 	void AccessorDecls(
-#line  1235 "cs.ATG" 
+#line  1263 "cs.ATG" 
 out PropertyGetRegion getBlock, out PropertySetRegion setBlock) {
 
-#line  1237 "cs.ATG" 
+#line  1265 "cs.ATG" 
 		ArrayList attributes = new ArrayList(); 
 		AttributeSection section;
 		getBlock = null;
@@ -2658,136 +2727,136 @@
 		
 		while (la.kind == 16) {
 			AttributeSection(
-#line  1243 "cs.ATG" 
+#line  1271 "cs.ATG" 
 out section);
 
-#line  1243 "cs.ATG" 
+#line  1271 "cs.ATG" 
 			attributes.Add(section); 
 		}
 		if (
-#line  1245 "cs.ATG" 
+#line  1273 "cs.ATG" 
 IdentIsGet()) {
 			GetAccessorDecl(
-#line  1246 "cs.ATG" 
+#line  1274 "cs.ATG" 
 out getBlock, attributes);
 			if (la.kind == 1 || la.kind == 16) {
 
-#line  1247 "cs.ATG" 
+#line  1275 "cs.ATG" 
 				attributes = new ArrayList(); 
 				while (la.kind == 16) {
 					AttributeSection(
-#line  1248 "cs.ATG" 
+#line  1276 "cs.ATG" 
 out section);
 
-#line  1248 "cs.ATG" 
+#line  1276 "cs.ATG" 
 					attributes.Add(section); 
 				}
 				SetAccessorDecl(
-#line  1249 "cs.ATG" 
+#line  1277 "cs.ATG" 
 out setBlock, attributes);
 			}
 		} else if (
-#line  1251 "cs.ATG" 
+#line  1279 "cs.ATG" 
 IdentIsSet()) {
 			SetAccessorDecl(
-#line  1252 "cs.ATG" 
+#line  1280 "cs.ATG" 
 out setBlock, attributes);
 			if (la.kind == 1 || la.kind == 16) {
 
-#line  1253 "cs.ATG" 
+#line  1281 "cs.ATG" 
 				attributes = new ArrayList(); 
 				while (la.kind == 16) {
 					AttributeSection(
-#line  1254 "cs.ATG" 
+#line  1282 "cs.ATG" 
 out section);
 
-#line  1254 "cs.ATG" 
+#line  1282 "cs.ATG" 
 					attributes.Add(section); 
 				}
 				GetAccessorDecl(
-#line  1255 "cs.ATG" 
+#line  1283 "cs.ATG" 
 out getBlock, attributes);
 			}
 		} else if (la.kind == 1) {
 			lexer.NextToken();
 
-#line  1257 "cs.ATG" 
+#line  1285 "cs.ATG" 
 			Error("get or set accessor declaration expected"); 
 		} else SynErr(159);
 	}
 
 	void InterfaceAccessors(
-#line  1299 "cs.ATG" 
+#line  1327 "cs.ATG" 
 out PropertyGetRegion getBlock, out PropertySetRegion setBlock) {
 
-#line  1301 "cs.ATG" 
+#line  1329 "cs.ATG" 
 		AttributeSection section;
 		ArrayList attributes = new ArrayList();
 		getBlock = null; setBlock = null;
 		
 		while (la.kind == 16) {
 			AttributeSection(
-#line  1306 "cs.ATG" 
+#line  1334 "cs.ATG" 
 out section);
 
-#line  1306 "cs.ATG" 
+#line  1334 "cs.ATG" 
 			attributes.Add(section); 
 		}
 		if (
-#line  1308 "cs.ATG" 
+#line  1336 "cs.ATG" 
 IdentIsGet()) {
 			Expect(1);
 
-#line  1308 "cs.ATG" 
+#line  1336 "cs.ATG" 
 			getBlock = new PropertyGetRegion(null, attributes); 
 		} else if (
-#line  1309 "cs.ATG" 
+#line  1337 "cs.ATG" 
 IdentIsSet()) {
 			Expect(1);
 
-#line  1309 "cs.ATG" 
+#line  1337 "cs.ATG" 
 			setBlock = new PropertySetRegion(null, attributes); 
 		} else if (la.kind == 1) {
 			lexer.NextToken();
 
-#line  1310 "cs.ATG" 
+#line  1338 "cs.ATG" 
 			Error("set or get expected"); 
 		} else SynErr(160);
 		Expect(10);
 
-#line  1312 "cs.ATG" 
+#line  1340 "cs.ATG" 
 		attributes = new ArrayList(); 
 		if (la.kind == 1 || la.kind == 16) {
 			while (la.kind == 16) {
 				AttributeSection(
-#line  1314 "cs.ATG" 
+#line  1342 "cs.ATG" 
 out section);
 
-#line  1314 "cs.ATG" 
+#line  1342 "cs.ATG" 
 				attributes.Add(section); 
 			}
 			if (
-#line  1316 "cs.ATG" 
+#line  1344 "cs.ATG" 
 IdentIsGet()) {
 				Expect(1);
 
-#line  1316 "cs.ATG" 
+#line  1344 "cs.ATG" 
 				if (getBlock != null) Error("get already declared");
 				else getBlock = new PropertyGetRegion(null, attributes);
 				
 			} else if (
-#line  1319 "cs.ATG" 
+#line  1347 "cs.ATG" 
 IdentIsSet()) {
 				Expect(1);
 
-#line  1319 "cs.ATG" 
+#line  1347 "cs.ATG" 
 				if (setBlock != null) Error("set already declared");
 				else setBlock = new PropertySetRegion(null, attributes);
 				
 			} else if (la.kind == 1) {
 				lexer.NextToken();
 
-#line  1322 "cs.ATG" 
+#line  1350 "cs.ATG" 
 				Error("set or get expected"); 
 			} else SynErr(161);
 			Expect(10);
@@ -2795,187 +2864,187 @@
 	}
 
 	void GetAccessorDecl(
-#line  1261 "cs.ATG" 
+#line  1289 "cs.ATG" 
 out PropertyGetRegion getBlock, ArrayList attributes) {
 
-#line  1262 "cs.ATG" 
+#line  1290 "cs.ATG" 
 		Statement stmt = null; 
 		Expect(1);
 
-#line  1265 "cs.ATG" 
+#line  1293 "cs.ATG" 
 		if (t.val != "get") Error("get expected"); 
 		if (la.kind == 14) {
 			Block(
-#line  1266 "cs.ATG" 
+#line  1294 "cs.ATG" 
 out stmt);
 		} else if (la.kind == 10) {
 			lexer.NextToken();
 		} else SynErr(162);
 
-#line  1266 "cs.ATG" 
+#line  1294 "cs.ATG" 
 		getBlock = new PropertyGetRegion((BlockStatement)stmt, attributes); 
 	}
 
 	void SetAccessorDecl(
-#line  1269 "cs.ATG" 
+#line  1297 "cs.ATG" 
 out PropertySetRegion setBlock, ArrayList attributes) {
 
-#line  1270 "cs.ATG" 
+#line  1298 "cs.ATG" 
 		Statement stmt = null; 
 		Expect(1);
 
-#line  1273 "cs.ATG" 
+#line  1301 "cs.ATG" 
 		if (t.val != "set") Error("set expected"); 
 		if (la.kind == 14) {
 			Block(
-#line  1274 "cs.ATG" 
+#line  1302 "cs.ATG" 
 out stmt);
 		} else if (la.kind == 10) {
 			lexer.NextToken();
 		} else SynErr(163);
 
-#line  1274 "cs.ATG" 
+#line  1302 "cs.ATG" 
 		setBlock = new PropertySetRegion((BlockStatement)stmt, attributes); 
 	}
 
 	void AddAccessorDecl(
-#line  1348 "cs.ATG" 
+#line  1376 "cs.ATG" 
 out Statement stmt) {
 
-#line  1349 "cs.ATG" 
+#line  1377 "cs.ATG" 
 		stmt = null;
 		Expect(1);
 
-#line  1352 "cs.ATG" 
+#line  1380 "cs.ATG" 
 		if (t.val != "add") Error("add expected"); 
 		Block(
-#line  1353 "cs.ATG" 
+#line  1381 "cs.ATG" 
 out stmt);
 	}
 
 	void RemoveAccessorDecl(
-#line  1356 "cs.ATG" 
+#line  1384 "cs.ATG" 
 out Statement stmt) {
 
-#line  1357 "cs.ATG" 
+#line  1385 "cs.ATG" 
 		stmt = null;
 		Expect(1);
 
-#line  1360 "cs.ATG" 
+#line  1388 "cs.ATG" 
 		if (t.val != "remove") Error("remove expected"); 
 		Block(
-#line  1361 "cs.ATG" 
+#line  1389 "cs.ATG" 
 out stmt);
 	}
 
 	void VariableInitializer(
-#line  1377 "cs.ATG" 
+#line  1405 "cs.ATG" 
 out Expression initializerExpression) {
 
-#line  1378 "cs.ATG" 
+#line  1406 "cs.ATG" 
 		TypeReference type = null; Expression expr = null; initializerExpression = null; 
 		if (StartOf(4)) {
 			Expr(
-#line  1380 "cs.ATG" 
+#line  1408 "cs.ATG" 
 out initializerExpression);
 		} else if (la.kind == 14) {
 			ArrayInitializer(
-#line  1381 "cs.ATG" 
+#line  1409 "cs.ATG" 
 out initializerExpression);
 		} else if (la.kind == 105) {
 			lexer.NextToken();
 			Type(
-#line  1382 "cs.ATG" 
+#line  1410 "cs.ATG" 
 out type);
 			Expect(16);
 			Expr(
-#line  1382 "cs.ATG" 
+#line  1410 "cs.ATG" 
 out expr);
 			Expect(17);
 
-#line  1382 "cs.ATG" 
+#line  1410 "cs.ATG" 
 			initializerExpression = new StackAllocExpression(type, expr); 
 		} else SynErr(164);
 	}
 
 	void Statement() {
 
-#line  1465 "cs.ATG" 
+#line  1493 "cs.ATG" 
 		TypeReference type;
 		Expression expr;
 		Statement stmt;
 		
 		if (
-#line  1471 "cs.ATG" 
+#line  1499 "cs.ATG" 
 IsLabel()) {
 			Expect(1);
 
-#line  1471 "cs.ATG" 
+#line  1499 "cs.ATG" 
 			compilationUnit.AddChild(new LabelStatement(t.val)); 
 			Expect(9);
 			Statement();
 		} else if (la.kind == 59) {
 			lexer.NextToken();
 			Type(
-#line  1474 "cs.ATG" 
+#line  1502 "cs.ATG" 
 out type);
 
-#line  1474 "cs.ATG" 
+#line  1502 "cs.ATG" 
 			LocalVariableDeclaration var = new LocalVariableDeclaration(type, Modifier.Const); string ident = null; var.StartLocation = t.Location; 
 			Expect(1);
 
-#line  1475 "cs.ATG" 
+#line  1503 "cs.ATG" 
 			ident = t.val; 
 			Expect(3);
 			Expr(
-#line  1476 "cs.ATG" 
+#line  1504 "cs.ATG" 
 out expr);
 
-#line  1476 "cs.ATG" 
+#line  1504 "cs.ATG" 
 			var.Variables.Add(new VariableDeclaration(ident, expr)); 
 			while (la.kind == 12) {
 				lexer.NextToken();
 				Expect(1);
 
-#line  1477 "cs.ATG" 
+#line  1505 "cs.ATG" 
 				ident = t.val; 
 				Expect(3);
 				Expr(
-#line  1477 "cs.ATG" 
+#line  1505 "cs.ATG" 
 out expr);
 
-#line  1477 "cs.ATG" 
+#line  1505 "cs.ATG" 
 				var.Variables.Add(new VariableDeclaration(ident, expr)); 
 			}
 			Expect(10);
 
-#line  1478 "cs.ATG" 
+#line  1506 "cs.ATG" 
 			compilationUnit.AddChild(var); 
 		} else if (
-#line  1480 "cs.ATG" 
+#line  1508 "cs.ATG" 
 IsLocalVarDecl()) {
 			LocalVariableDecl(
-#line  1480 "cs.ATG" 
+#line  1508 "cs.ATG" 
 out stmt);
 			Expect(10);
 
-#line  1480 "cs.ATG" 
+#line  1508 "cs.ATG" 
 			compilationUnit.AddChild(stmt); 
 		} else if (StartOf(22)) {
 			EmbeddedStatement(
-#line  1481 "cs.ATG" 
+#line  1509 "cs.ATG" 
 out stmt);
 
-#line  1481 "cs.ATG" 
+#line  1509 "cs.ATG" 
 			compilationUnit.AddChild(stmt); 
 		} else SynErr(165);
 	}
 
 	void Argument(
-#line  1397 "cs.ATG" 
+#line  1425 "cs.ATG" 
 out Expression argumentexpr) {
 
-#line  1399 "cs.ATG" 
+#line  1427 "cs.ATG" 
 		Expression expr;
 		FieldDirection fd = FieldDirection.None;
 		
@@ -2983,48 +3052,48 @@
 			if (la.kind == 99) {
 				lexer.NextToken();
 
-#line  1404 "cs.ATG" 
+#line  1432 "cs.ATG" 
 				fd = FieldDirection.Ref; 
 			} else {
 				lexer.NextToken();
 
-#line  1405 "cs.ATG" 
+#line  1433 "cs.ATG" 
 				fd = FieldDirection.Out; 
 			}
 		}
 		Expr(
-#line  1407 "cs.ATG" 
+#line  1435 "cs.ATG" 
 out expr);
 
-#line  1407 "cs.ATG" 
+#line  1435 "cs.ATG" 
 		argumentexpr = fd != FieldDirection.None ? argumentexpr = new DirectionExpression(fd, expr) : expr; 
 	}
 
 	void ArrayInitializer(
-#line  1426 "cs.ATG" 
+#line  1454 "cs.ATG" 
 out Expression outExpr) {
 
-#line  1428 "cs.ATG" 
+#line  1456 "cs.ATG" 
 		Expression expr = null;
 		ArrayInitializerExpression initializer = new ArrayInitializerExpression();
 		
 		Expect(14);
 		if (StartOf(23)) {
 			VariableInitializer(
-#line  1433 "cs.ATG" 
+#line  1461 "cs.ATG" 
 out expr);
 
-#line  1433 "cs.ATG" 
+#line  1461 "cs.ATG" 
 			initializer.CreateExpressions.Add(expr); 
 			while (
-#line  1433 "cs.ATG" 
+#line  1461 "cs.ATG" 
 NotFinalComma()) {
 				Expect(12);
 				VariableInitializer(
-#line  1433 "cs.ATG" 
+#line  1461 "cs.ATG" 
 out expr);
 
-#line  1433 "cs.ATG" 
+#line  1461 "cs.ATG" 
 				initializer.CreateExpressions.Add(expr); 
 			}
 			if (la.kind == 12) {
@@ -3033,91 +3102,91 @@
 		}
 		Expect(15);
 
-#line  1434 "cs.ATG" 
+#line  1462 "cs.ATG" 
 		outExpr = initializer; 
 	}
 
 	void AssignmentOperator(
-#line  1410 "cs.ATG" 
+#line  1438 "cs.ATG" 
 out AssignmentOperatorType op) {
 
-#line  1411 "cs.ATG" 
+#line  1439 "cs.ATG" 
 		op = AssignmentOperatorType.None; 
 		switch (la.kind) {
 		case 3: {
 			lexer.NextToken();
 
-#line  1413 "cs.ATG" 
+#line  1441 "cs.ATG" 
 			op = AssignmentOperatorType.Assign; 
 			break;
 		}
 		case 37: {
 			lexer.NextToken();
 
-#line  1414 "cs.ATG" 
+#line  1442 "cs.ATG" 
 			op = AssignmentOperatorType.Add; 
 			break;
 		}
 		case 38: {
 			lexer.NextToken();
 
-#line  1415 "cs.ATG" 
+#line  1443 "cs.ATG" 
 			op = AssignmentOperatorType.Subtract; 
 			break;
 		}
 		case 39: {
 			lexer.NextToken();
 
-#line  1416 "cs.ATG" 
+#line  1444 "cs.ATG" 
 			op = AssignmentOperatorType.Multiply; 
 			break;
 		}
 		case 40: {
 			lexer.NextToken();
 
-#line  1417 "cs.ATG" 
+#line  1445 "cs.ATG" 
 			op = AssignmentOperatorType.Divide; 
 			break;
 		}
 		case 41: {
 			lexer.NextToken();
 
-#line  1418 "cs.ATG" 
+#line  1446 "cs.ATG" 
 			op = AssignmentOperatorType.Modulus; 
 			break;
 		}
 		case 42: {
 			lexer.NextToken();
 
-#line  1419 "cs.ATG" 
+#line  1447 "cs.ATG" 
 			op = AssignmentOperatorType.BitwiseAnd; 
 			break;
 		}
 		case 43: {
 			lexer.NextToken();
 
-#line  1420 "cs.ATG" 
+#line  1448 "cs.ATG" 
 			op = AssignmentOperatorType.BitwiseOr; 
 			break;
 		}
 		case 44: {
 			lexer.NextToken();
 
-#line  1421 "cs.ATG" 
+#line  1449 "cs.ATG" 
 			op = AssignmentOperatorType.ExclusiveOr; 
 			break;
 		}
 		case 45: {
 			lexer.NextToken();
 
-#line  1422 "cs.ATG" 
+#line  1450 "cs.ATG" 
 			op = AssignmentOperatorType.ShiftLeft; 
 			break;
 		}
 		case 46: {
 			lexer.NextToken();
 
-#line  1423 "cs.ATG" 
+#line  1451 "cs.ATG" 
 			op = AssignmentOperatorType.ShiftRight; 
 			break;
 		}
@@ -3126,83 +3195,83 @@
 	}
 
 	void LocalVariableDecl(
-#line  1437 "cs.ATG" 
+#line  1465 "cs.ATG" 
 out Statement stmt) {
 
-#line  1439 "cs.ATG" 
+#line  1467 "cs.ATG" 
 		TypeReference type;
 		VariableDeclaration      var = null;
 		LocalVariableDeclaration localVariableDeclaration; 
 		
 		Type(
-#line  1444 "cs.ATG" 
+#line  1472 "cs.ATG" 
 out type);
 
-#line  1444 "cs.ATG" 
+#line  1472 "cs.ATG" 
 		localVariableDeclaration = new LocalVariableDeclaration(type); localVariableDeclaration.StartLocation = t.Location; 
 		LocalVariableDeclarator(
-#line  1445 "cs.ATG" 
+#line  1473 "cs.ATG" 
 out var);
 
-#line  1445 "cs.ATG" 
+#line  1473 "cs.ATG" 
 		localVariableDeclaration.Variables.Add(var); 
 		while (la.kind == 12) {
 			lexer.NextToken();
 			LocalVariableDeclarator(
-#line  1446 "cs.ATG" 
+#line  1474 "cs.ATG" 
 out var);
 
-#line  1446 "cs.ATG" 
+#line  1474 "cs.ATG" 
 			localVariableDeclaration.Variables.Add(var); 
 		}
 
-#line  1447 "cs.ATG" 
+#line  1475 "cs.ATG" 
 		stmt = localVariableDeclaration; 
 	}
 
 	void LocalVariableDeclarator(
-#line  1450 "cs.ATG" 
+#line  1478 "cs.ATG" 
 out VariableDeclaration var) {
 
-#line  1451 "cs.ATG" 
+#line  1479 "cs.ATG" 
 		Expression expr = null; 
 		Expect(1);
 
-#line  1453 "cs.ATG" 
+#line  1481 "cs.ATG" 
 		var = new VariableDeclaration(t.val); 
 		if (la.kind == 3) {
 			lexer.NextToken();
 			LocalVariableInitializer(
-#line  1453 "cs.ATG" 
+#line  1481 "cs.ATG" 
 out expr);
 
-#line  1453 "cs.ATG" 
+#line  1481 "cs.ATG" 
 			var.Initializer = expr; 
 		}
 	}
 
 	void LocalVariableInitializer(
-#line  1456 "cs.ATG" 
+#line  1484 "cs.ATG" 
 out Expression expr) {
 
-#line  1457 "cs.ATG" 
+#line  1485 "cs.ATG" 
 		expr = null; 
 		if (StartOf(4)) {
 			Expr(
-#line  1459 "cs.ATG" 
+#line  1487 "cs.ATG" 
 out expr);
 		} else if (la.kind == 14) {
 			ArrayInitializer(
-#line  1460 "cs.ATG" 
+#line  1488 "cs.ATG" 
 out expr);
 		} else SynErr(167);
 	}
 
 	void EmbeddedStatement(
-#line  1487 "cs.ATG" 
+#line  1515 "cs.ATG" 
 out Statement statement) {
 
-#line  1489 "cs.ATG" 
+#line  1517 "cs.ATG" 
 		TypeReference type = null;
 		Expression expr = null;
 		Statement embeddedStatement = null;
@@ -3210,523 +3279,525 @@
 		
 		if (la.kind == 14) {
 			Block(
-#line  1495 "cs.ATG" 
+#line  1523 "cs.ATG" 
 out statement);
 		} else if (la.kind == 10) {
 			lexer.NextToken();
 
-#line  1497 "cs.ATG" 
+#line  1525 "cs.ATG" 
 			statement = new EmptyStatement(); 
 		} else if (
-#line  1499 "cs.ATG" 
+#line  1527 "cs.ATG" 
 UnCheckedAndLBrace()) {
 
-#line  1499 "cs.ATG" 
+#line  1527 "cs.ATG" 
 			Statement block; bool isChecked = true; 
 			if (la.kind == 57) {
 				lexer.NextToken();
 			} else if (la.kind == 117) {
 				lexer.NextToken();
 
-#line  1500 "cs.ATG" 
+#line  1528 "cs.ATG" 
 				isChecked = false;
 			} else SynErr(168);
 			Block(
-#line  1501 "cs.ATG" 
+#line  1529 "cs.ATG" 
 out block);
 
-#line  1501 "cs.ATG" 
+#line  1529 "cs.ATG" 
 			statement = isChecked ? (Statement)new CheckedStatement(block) : (Statement)new UncheckedStatement(block); 
 		} else if (StartOf(4)) {
 			StatementExpr(
-#line  1503 "cs.ATG" 
+#line  1531 "cs.ATG" 
 out statement);
 			Expect(10);
 		} else if (la.kind == 78) {
 			lexer.NextToken();
 
-#line  1505 "cs.ATG" 
+#line  1533 "cs.ATG" 
 			Statement elseStatement = null; 
 			Expect(18);
 			Expr(
-#line  1506 "cs.ATG" 
+#line  1534 "cs.ATG" 
 out expr);
 			Expect(19);
 			EmbeddedStatement(
-#line  1507 "cs.ATG" 
+#line  1535 "cs.ATG" 
 out embeddedStatement);
 			if (la.kind == 66) {
 				lexer.NextToken();
 				EmbeddedStatement(
-#line  1508 "cs.ATG" 
+#line  1536 "cs.ATG" 
 out elseStatement);
 			}
 
-#line  1509 "cs.ATG" 
+#line  1537 "cs.ATG" 
 			statement = elseStatement != null ? (Statement)new IfElseStatement(expr, embeddedStatement, elseStatement) :  (Statement)new IfStatement(expr, embeddedStatement); 
 		} else if (la.kind == 109) {
 			lexer.NextToken();
 
-#line  1510 "cs.ATG" 
+#line  1538 "cs.ATG" 
 			ArrayList switchSections = new ArrayList(); 
 			Expect(18);
 			Expr(
-#line  1511 "cs.ATG" 
+#line  1539 "cs.ATG" 
 out expr);
 			Expect(19);
 			Expect(14);
 			while (la.kind == 54 || la.kind == 62) {
 				SwitchSection(
-#line  1512 "cs.ATG" 
+#line  1540 "cs.ATG" 
 out statement);
 
-#line  1512 "cs.ATG" 
+#line  1540 "cs.ATG" 
 				switchSections.Add(statement); 
 			}
 			Expect(15);
 
-#line  1513 "cs.ATG" 
+#line  1541 "cs.ATG" 
 			statement = new SwitchStatement(expr, switchSections); 
 		} else if (la.kind == 124) {
 			lexer.NextToken();
 			Expect(18);
 			Expr(
-#line  1515 "cs.ATG" 
+#line  1543 "cs.ATG" 
 out expr);
 			Expect(19);
 			EmbeddedStatement(
-#line  1516 "cs.ATG" 
+#line  1544 "cs.ATG" 
 out embeddedStatement);
 
-#line  1516 "cs.ATG" 
+#line  1544 "cs.ATG" 
 			statement = new WhileStatement(expr, embeddedStatement); 
 		} else if (la.kind == 64) {
 			lexer.NextToken();
 			EmbeddedStatement(
-#line  1517 "cs.ATG" 
+#line  1545 "cs.ATG" 
 out embeddedStatement);
 			Expect(124);
 			Expect(18);
 			Expr(
-#line  1518 "cs.ATG" 
+#line  1546 "cs.ATG" 
 out expr);
 			Expect(19);
 			Expect(10);
 
-#line  1518 "cs.ATG" 
+#line  1546 "cs.ATG" 
 			statement = new DoWhileStatement(expr, embeddedStatement); 
 		} else if (la.kind == 75) {
 			lexer.NextToken();
 
-#line  1519 "cs.ATG" 
+#line  1547 "cs.ATG" 
 			ArrayList initializer = null, iterator = null; 
 			Expect(18);
 			if (StartOf(4)) {
 				ForInitializer(
-#line  1520 "cs.ATG" 
+#line  1548 "cs.ATG" 
 out initializer);
 			}
 			Expect(10);
 			if (StartOf(4)) {
 				Expr(
-#line  1521 "cs.ATG" 
+#line  1549 "cs.ATG" 
 out expr);
 			}
 			Expect(10);
 			if (StartOf(4)) {
 				ForIterator(
-#line  1522 "cs.ATG" 
+#line  1550 "cs.ATG" 
 out iterator);
 			}
 			Expect(19);
 			EmbeddedStatement(
-#line  1523 "cs.ATG" 
+#line  1551 "cs.ATG" 
 out embeddedStatement);
 
-#line  1523 "cs.ATG" 
+#line  1551 "cs.ATG" 
 			statement = new ForStatement(initializer, expr, iterator, embeddedStatement); 
 		} else if (la.kind == 76) {
 			lexer.NextToken();
 			Expect(18);
 			Type(
-#line  1524 "cs.ATG" 
+#line  1552 "cs.ATG" 
 out type);
 			Expect(1);
 
-#line  1524 "cs.ATG" 
-			string varName = t.val; 
+#line  1552 "cs.ATG" 
+			string varName = t.val; Point start = t.Location;
 			Expect(80);
 			Expr(
-#line  1525 "cs.ATG" 
+#line  1553 "cs.ATG" 
 out expr);
 			Expect(19);
 			EmbeddedStatement(
-#line  1526 "cs.ATG" 
+#line  1554 "cs.ATG" 
 out embeddedStatement);
 
-#line  1526 "cs.ATG" 
+#line  1554 "cs.ATG" 
 			statement = new ForeachStatement(type, varName , expr, embeddedStatement); 
+			statement.EndLocation = t.EndLocation;
+			
 		} else if (la.kind == 52) {
 			lexer.NextToken();
 			Expect(10);
 
-#line  1528 "cs.ATG" 
+#line  1558 "cs.ATG" 
 			statement = new BreakStatement(); 
 		} else if (la.kind == 60) {
 			lexer.NextToken();
 			Expect(10);
 
-#line  1529 "cs.ATG" 
+#line  1559 "cs.ATG" 
 			statement = new ContinueStatement(); 
 		} else if (la.kind == 77) {
 			GotoStatement(
-#line  1530 "cs.ATG" 
+#line  1560 "cs.ATG" 
 out statement);
 		} else if (la.kind == 100) {
 			lexer.NextToken();
 			if (StartOf(4)) {
 				Expr(
-#line  1531 "cs.ATG" 
+#line  1561 "cs.ATG" 
 out expr);
 			}
 			Expect(10);
 
-#line  1531 "cs.ATG" 
+#line  1561 "cs.ATG" 
 			statement = new ReturnStatement(expr); 
 		} else if (la.kind == 111) {
 			lexer.NextToken();
 			if (StartOf(4)) {
 				Expr(
-#line  1532 "cs.ATG" 
+#line  1562 "cs.ATG" 
 out expr);
 			}
 			Expect(10);
 
-#line  1532 "cs.ATG" 
+#line  1562 "cs.ATG" 
 			statement = new ThrowStatement(expr); 
 		} else if (la.kind == 113) {
 			TryStatement(
-#line  1534 "cs.ATG" 
+#line  1564 "cs.ATG" 
 out statement);
 		} else if (la.kind == 85) {
 			lexer.NextToken();
 			Expect(18);
 			Expr(
-#line  1536 "cs.ATG" 
+#line  1566 "cs.ATG" 
 out expr);
 			Expect(19);
 			EmbeddedStatement(
-#line  1537 "cs.ATG" 
+#line  1567 "cs.ATG" 
 out embeddedStatement);
 
-#line  1537 "cs.ATG" 
+#line  1567 "cs.ATG" 
 			statement = new LockStatement(expr, embeddedStatement); 
 		} else if (la.kind == 120) {
 
-#line  1539 "cs.ATG" 
+#line  1569 "cs.ATG" 
 			Statement resourceAcquisitionStmt = null; 
 			lexer.NextToken();
 			Expect(18);
 			ResourceAcquisition(
-#line  1541 "cs.ATG" 
+#line  1571 "cs.ATG" 
 out resourceAcquisitionStmt);
 			Expect(19);
 			EmbeddedStatement(
-#line  1542 "cs.ATG" 
+#line  1572 "cs.ATG" 
 out embeddedStatement);
 
-#line  1542 "cs.ATG" 
+#line  1572 "cs.ATG" 
 			statement = new UsingStatement(resourceAcquisitionStmt, embeddedStatement); 
 		} else if (la.kind == 118) {
 			lexer.NextToken();
 			Block(
-#line  1544 "cs.ATG" 
+#line  1574 "cs.ATG" 
 out embeddedStatement);
 
-#line  1544 "cs.ATG" 
+#line  1574 "cs.ATG" 
 			statement = new UnsafeStatement(embeddedStatement); 
 		} else if (la.kind == 73) {
 			lexer.NextToken();
 			Expect(18);
 			Type(
-#line  1547 "cs.ATG" 
+#line  1577 "cs.ATG" 
 out type);
 
-#line  1547 "cs.ATG" 
+#line  1577 "cs.ATG" 
 			if (type.PointerNestingLevel == 0) Error("can only fix pointer types");
 			FixedStatement fxStmt = new FixedStatement(type);
 			string identifier = null;
 			
 			Expect(1);
 
-#line  1551 "cs.ATG" 
+#line  1581 "cs.ATG" 
 			identifier = t.val; 
 			Expect(3);
 			Expr(
-#line  1552 "cs.ATG" 
+#line  1582 "cs.ATG" 
 out expr);
 
-#line  1552 "cs.ATG" 
+#line  1582 "cs.ATG" 
 			fxStmt.PointerDeclarators.Add(new VariableDeclaration(identifier, expr)); 
 			while (la.kind == 12) {
 				lexer.NextToken();
 				Expect(1);
 
-#line  1554 "cs.ATG" 
+#line  1584 "cs.ATG" 
 				identifier = t.val; 
 				Expect(3);
 				Expr(
-#line  1555 "cs.ATG" 
+#line  1585 "cs.ATG" 
 out expr);
 
-#line  1555 "cs.ATG" 
+#line  1585 "cs.ATG" 
 				fxStmt.PointerDeclarators.Add(new VariableDeclaration(identifier, expr)); 
 			}
 			Expect(19);
 			EmbeddedStatement(
-#line  1557 "cs.ATG" 
+#line  1587 "cs.ATG" 
 out embeddedStatement);
 
-#line  1557 "cs.ATG" 
+#line  1587 "cs.ATG" 
 			fxStmt.EmbeddedStatement = embeddedStatement; statement = fxStmt;
 		} else SynErr(169);
 	}
 
 	void StatementExpr(
-#line  1665 "cs.ATG" 
+#line  1695 "cs.ATG" 
 out Statement stmt) {
 
-#line  1670 "cs.ATG" 
+#line  1700 "cs.ATG" 
 		bool mustBeAssignment = la.kind == Tokens.Plus  || la.kind == Tokens.Minus ||
 		                       la.kind == Tokens.Not   || la.kind == Tokens.BitwiseComplement ||
 		                       la.kind == Tokens.Times || la.kind == Tokens.BitwiseAnd   || IsTypeCast();
 		Expression expr = null;
 		
 		UnaryExpr(
-#line  1676 "cs.ATG" 
+#line  1706 "cs.ATG" 
 out expr);
 		if (StartOf(6)) {
 
-#line  1679 "cs.ATG" 
+#line  1709 "cs.ATG" 
 			AssignmentOperatorType op; Expression val; 
 			AssignmentOperator(
-#line  1679 "cs.ATG" 
+#line  1709 "cs.ATG" 
 out op);
 			Expr(
-#line  1679 "cs.ATG" 
+#line  1709 "cs.ATG" 
 out val);
 
-#line  1679 "cs.ATG" 
+#line  1709 "cs.ATG" 
 			expr = new AssignmentExpression(expr, op, val); 
 		} else if (la.kind == 10 || la.kind == 12 || la.kind == 19) {
 
-#line  1680 "cs.ATG" 
+#line  1710 "cs.ATG" 
 			if (mustBeAssignment) Error("error in assignment."); 
 		} else SynErr(170);
 
-#line  1681 "cs.ATG" 
+#line  1711 "cs.ATG" 
 		stmt = new StatementExpression(expr); 
 	}
 
 	void SwitchSection(
-#line  1579 "cs.ATG" 
+#line  1609 "cs.ATG" 
 out Statement stmt) {
 
-#line  1581 "cs.ATG" 
+#line  1611 "cs.ATG" 
 		SwitchSection switchSection = new SwitchSection();
 		Expression expr;
 		
 		SwitchLabel(
-#line  1585 "cs.ATG" 
+#line  1615 "cs.ATG" 
 out expr);
 
-#line  1585 "cs.ATG" 
+#line  1615 "cs.ATG" 
 		switchSection.SwitchLabels.Add(expr); 
 		while (la.kind == 54 || la.kind == 62) {
 			SwitchLabel(
-#line  1585 "cs.ATG" 
+#line  1615 "cs.ATG" 
 out expr);
 
-#line  1585 "cs.ATG" 
+#line  1615 "cs.ATG" 
 			switchSection.SwitchLabels.Add(expr); 
 		}
 
-#line  1586 "cs.ATG" 
+#line  1616 "cs.ATG" 
 		compilationUnit.BlockStart(switchSection); 
 		Statement();
 		while (StartOf(20)) {
 			Statement();
 		}
 
-#line  1589 "cs.ATG" 
+#line  1619 "cs.ATG" 
 		compilationUnit.BlockEnd();
 		stmt = switchSection;
 		
 	}
 
 	void ForInitializer(
-#line  1560 "cs.ATG" 
+#line  1590 "cs.ATG" 
 out ArrayList initializer) {
 
-#line  1562 "cs.ATG" 
+#line  1592 "cs.ATG" 
 		Statement stmt; 
 		initializer = new ArrayList();
 		
 		if (
-#line  1566 "cs.ATG" 
+#line  1596 "cs.ATG" 
 IsLocalVarDecl()) {
 			LocalVariableDecl(
-#line  1566 "cs.ATG" 
+#line  1596 "cs.ATG" 
 out stmt);
 
-#line  1566 "cs.ATG" 
+#line  1596 "cs.ATG" 
 			initializer.Add(stmt);
 		} else if (StartOf(4)) {
 			StatementExpr(
-#line  1567 "cs.ATG" 
+#line  1597 "cs.ATG" 
 out stmt);
 
-#line  1567 "cs.ATG" 
+#line  1597 "cs.ATG" 
 			initializer.Add(stmt);
 			while (la.kind == 12) {
 				lexer.NextToken();
 				StatementExpr(
-#line  1567 "cs.ATG" 
+#line  1597 "cs.ATG" 
 out stmt);
 
-#line  1567 "cs.ATG" 
+#line  1597 "cs.ATG" 
 				initializer.Add(stmt);
 			}
 
-#line  1567 "cs.ATG" 
+#line  1597 "cs.ATG" 
 			initializer.Add(stmt);
 		} else SynErr(171);
 	}
 
 	void ForIterator(
-#line  1570 "cs.ATG" 
+#line  1600 "cs.ATG" 
 out ArrayList iterator) {
 
-#line  1572 "cs.ATG" 
+#line  1602 "cs.ATG" 
 		Statement stmt; 
 		iterator = new ArrayList();
 		
 		StatementExpr(
-#line  1576 "cs.ATG" 
+#line  1606 "cs.ATG" 
 out stmt);
 
-#line  1576 "cs.ATG" 
+#line  1606 "cs.ATG" 
 		iterator.Add(stmt);
 		while (la.kind == 12) {
 			lexer.NextToken();
 			StatementExpr(
-#line  1576 "cs.ATG" 
+#line  1606 "cs.ATG" 
 out stmt);
 
-#line  1576 "cs.ATG" 
+#line  1606 "cs.ATG" 
 			iterator.Add(stmt); 
 		}
 	}
 
 	void GotoStatement(
-#line  1638 "cs.ATG" 
+#line  1668 "cs.ATG" 
 out Statement stmt) {
 
-#line  1639 "cs.ATG" 
+#line  1669 "cs.ATG" 
 		Expression expr; stmt = null; 
 		Expect(77);
 		if (la.kind == 1) {
 			lexer.NextToken();
 
-#line  1643 "cs.ATG" 
+#line  1673 "cs.ATG" 
 			stmt = new GotoStatement(t.val); 
 			Expect(10);
 		} else if (la.kind == 54) {
 			lexer.NextToken();
 			Expr(
-#line  1644 "cs.ATG" 
+#line  1674 "cs.ATG" 
 out expr);
 			Expect(10);
 
-#line  1644 "cs.ATG" 
+#line  1674 "cs.ATG" 
 			stmt = new GotoCaseStatement(expr); 
 		} else if (la.kind == 62) {
 			lexer.NextToken();
 			Expect(10);
 
-#line  1645 "cs.ATG" 
+#line  1675 "cs.ATG" 
 			stmt = new GotoCaseStatement(null); 
 		} else SynErr(172);
 	}
 
 	void TryStatement(
-#line  1601 "cs.ATG" 
+#line  1631 "cs.ATG" 
 out Statement tryStatement) {
 
-#line  1603 "cs.ATG" 
+#line  1633 "cs.ATG" 
 		Statement blockStmt = null, finallyStmt = null;
 		ArrayList catchClauses = null;
 		
 		Expect(113);
 		Block(
-#line  1607 "cs.ATG" 
+#line  1637 "cs.ATG" 
 out blockStmt);
 		if (la.kind == 55) {
 			CatchClauses(
-#line  1609 "cs.ATG" 
+#line  1639 "cs.ATG" 
 out catchClauses);
 			if (la.kind == 72) {
 				lexer.NextToken();
 				Block(
-#line  1609 "cs.ATG" 
+#line  1639 "cs.ATG" 
 out finallyStmt);
 			}
 		} else if (la.kind == 72) {
 			lexer.NextToken();
 			Block(
-#line  1610 "cs.ATG" 
+#line  1640 "cs.ATG" 
 out finallyStmt);
 		} else SynErr(173);
 
-#line  1613 "cs.ATG" 
+#line  1643 "cs.ATG" 
 		tryStatement = new TryCatchStatement(blockStmt, catchClauses, finallyStmt);
 			
 	}
 
 	void ResourceAcquisition(
-#line  1649 "cs.ATG" 
+#line  1679 "cs.ATG" 
 out Statement stmt) {
 
-#line  1651 "cs.ATG" 
+#line  1681 "cs.ATG" 
 		stmt = null;
 		Expression expr;
 		
 		if (
-#line  1656 "cs.ATG" 
+#line  1686 "cs.ATG" 
 IsLocalVarDecl()) {
 			LocalVariableDecl(
-#line  1656 "cs.ATG" 
+#line  1686 "cs.ATG" 
 out stmt);
 		} else if (StartOf(4)) {
 			Expr(
-#line  1657 "cs.ATG" 
+#line  1687 "cs.ATG" 
 out expr);
 
-#line  1661 "cs.ATG" 
+#line  1691 "cs.ATG" 
 			stmt = new StatementExpression(expr); 
 		} else SynErr(174);
 	}
 
 	void SwitchLabel(
-#line  1594 "cs.ATG" 
+#line  1624 "cs.ATG" 
 out Expression expr) {
 
-#line  1595 "cs.ATG" 
+#line  1625 "cs.ATG" 
 		expr = null; 
 		if (la.kind == 54) {
 			lexer.NextToken();
 			Expr(
-#line  1597 "cs.ATG" 
+#line  1627 "cs.ATG" 
 out expr);
 			Expect(9);
 		} else if (la.kind == 62) {
@@ -3736,192 +3807,197 @@
 	}
 
 	void CatchClauses(
-#line  1618 "cs.ATG" 
+#line  1648 "cs.ATG" 
 out ArrayList catchClauses) {
 
-#line  1620 "cs.ATG" 
+#line  1650 "cs.ATG" 
 		catchClauses = new ArrayList();
 		
 		Expect(55);
 
-#line  1623 "cs.ATG" 
+#line  1653 "cs.ATG" 
 		string name;
 		string identifier;
 		Statement stmt; 
 		
 		if (la.kind == 14) {
 			Block(
-#line  1629 "cs.ATG" 
+#line  1659 "cs.ATG" 
 out stmt);
 
-#line  1629 "cs.ATG" 
+#line  1659 "cs.ATG" 
 			catchClauses.Add(new CatchClause(stmt)); 
 		} else if (la.kind == 18) {
 			lexer.NextToken();
 			ClassType(
-#line  1631 "cs.ATG" 
+#line  1661 "cs.ATG" 
 out name);
 
-#line  1631 "cs.ATG" 
+#line  1661 "cs.ATG" 
 			identifier = null; 
 			if (la.kind == 1) {
 				lexer.NextToken();
 
-#line  1631 "cs.ATG" 
+#line  1661 "cs.ATG" 
 				identifier = t.val; 
 			}
 			Expect(19);
 			Block(
-#line  1631 "cs.ATG" 
+#line  1661 "cs.ATG" 
 out stmt);
 
-#line  1631 "cs.ATG" 
+#line  1661 "cs.ATG" 
 			catchClauses.Add(new CatchClause(name, identifier, stmt)); 
 			while (
-#line  1632 "cs.ATG" 
+#line  1662 "cs.ATG" 
 IsTypedCatch()) {
 				Expect(55);
 				Expect(18);
 				ClassType(
-#line  1632 "cs.ATG" 
+#line  1662 "cs.ATG" 
 out name);
 
-#line  1632 "cs.ATG" 
+#line  1662 "cs.ATG" 
 				identifier = null; 
 				if (la.kind == 1) {
 					lexer.NextToken();
 
-#line  1632 "cs.ATG" 
+#line  1662 "cs.ATG" 
 					identifier = t.val; 
 				}
 				Expect(19);
 				Block(
-#line  1632 "cs.ATG" 
+#line  1662 "cs.ATG" 
 out stmt);
 
-#line  1632 "cs.ATG" 
+#line  1662 "cs.ATG" 
 				catchClauses.Add(new CatchClause(name, identifier, stmt)); 
 			}
 			if (la.kind == 55) {
 				lexer.NextToken();
 				Block(
-#line  1634 "cs.ATG" 
+#line  1664 "cs.ATG" 
 out stmt);
 
-#line  1634 "cs.ATG" 
+#line  1664 "cs.ATG" 
 				catchClauses.Add(new CatchClause(stmt)); 
 			}
 		} else SynErr(176);
 	}
 
 	void UnaryExpr(
-#line  1697 "cs.ATG" 
+#line  1727 "cs.ATG" 
 out Expression uExpr) {
 
-#line  1699 "cs.ATG" 
+#line  1729 "cs.ATG" 
 		TypeReference type = null;
 		Expression expr;
-		UnaryOperatorType uop = UnaryOperatorType.None;
-		bool isUOp = false;
-		bool isCast = false;
+		ArrayList  expressions = new ArrayList();
+		uExpr = null;
 		
 		while (StartOf(24) || 
-#line  1722 "cs.ATG" 
+#line  1751 "cs.ATG" 
 IsTypeCast()) {
 			if (la.kind == 4) {
 				lexer.NextToken();
 
-#line  1707 "cs.ATG" 
-				uop = UnaryOperatorType.Plus; isUOp = true; 
+#line  1736 "cs.ATG" 
+				expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Plus)); 
 			} else if (la.kind == 5) {
 				lexer.NextToken();
 
-#line  1708 "cs.ATG" 
-				uop = UnaryOperatorType.Minus; isUOp = true; 
+#line  1737 "cs.ATG" 
+				expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Minus)); 
 			} else if (la.kind == 22) {
 				lexer.NextToken();
 
-#line  1709 "cs.ATG" 
-				uop = UnaryOperatorType.Not;  isUOp = true;
+#line  1738 "cs.ATG" 
+				expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Not)); 
 			} else if (la.kind == 25) {
 				lexer.NextToken();
 
-#line  1710 "cs.ATG" 
-				uop = UnaryOperatorType.BitNot; isUOp = true; 
+#line  1739 "cs.ATG" 
+				expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.BitNot)); 
 			} else if (la.kind == 6) {
 				lexer.NextToken();
 
-#line  1711 "cs.ATG" 
-				uop = UnaryOperatorType.Star;  isUOp = true; 
+#line  1740 "cs.ATG" 
+				expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Star)); 
 			} else if (la.kind == 29) {
 				lexer.NextToken();
 
-#line  1712 "cs.ATG" 
-				uop = UnaryOperatorType.Increment; isUOp = true; 
+#line  1741 "cs.ATG" 
+				expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Increment)); 
 			} else if (la.kind == 30) {
 				lexer.NextToken();
 
-#line  1713 "cs.ATG" 
-				uop = UnaryOperatorType.Decrement; isUOp = true; 
+#line  1742 "cs.ATG" 
+				expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Decrement)); 
 			} else if (la.kind == 26) {
 				lexer.NextToken();
 
-#line  1714 "cs.ATG" 
-				uop = UnaryOperatorType.BitWiseAnd; isUOp = true; 
+#line  1743 "cs.ATG" 
+				expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.BitWiseAnd)); 
 			} else {
 				Expect(18);
 				Type(
-#line  1722 "cs.ATG" 
+#line  1751 "cs.ATG" 
 out type);
 				Expect(19);
 
-#line  1722 "cs.ATG" 
-				isCast = true; 
+#line  1751 "cs.ATG" 
+				expressions.Add(new CastExpression(type)); 
 			}
 		}
 		PrimaryExpr(
-#line  1724 "cs.ATG" 
+#line  1754 "cs.ATG" 
 out expr);
 
-#line  1724 "cs.ATG" 
-		if (isUOp) { 
-		   uExpr = new UnaryOperatorExpression(expr, uop);
-		} else if (isCast) {
-		    uExpr = new CastExpression(type, expr);
+#line  1754 "cs.ATG" 
+		for (int i = 0; i < expressions.Count; ++i) {
+		Expression nextExpression = i + 1 < expressions.Count ? (Expression)expressions[i + 1] : expr;
+		if (expressions[i] is CastExpression) {
+			((CastExpression)expressions[i]).Expression = nextExpression;
 		} else {
-		    uExpr = expr;
+			((UnaryOperatorExpression)expressions[i]).Expression = nextExpression;
 		}
+		}
+		if (expressions.Count > 0) {
+			uExpr = (Expression)expressions[0];
+		} else {
+			uExpr = expr;
+		}
 		
 	}
 
 	void ConditionalOrExpr(
-#line  1820 "cs.ATG" 
+#line  1856 "cs.ATG" 
 ref Expression outExpr) {
 
-#line  1821 "cs.ATG" 
-		Expression expr; 
+#line  1857 "cs.ATG" 
+		Expression expr;   
 		ConditionalAndExpr(
-#line  1823 "cs.ATG" 
+#line  1859 "cs.ATG" 
 ref outExpr);
 		while (la.kind == 24) {
 			lexer.NextToken();
 			UnaryExpr(
-#line  1823 "cs.ATG" 
+#line  1859 "cs.ATG" 
 out expr);
 			ConditionalAndExpr(
-#line  1823 "cs.ATG" 
+#line  1859 "cs.ATG" 
 ref expr);
 
-#line  1823 "cs.ATG" 
+#line  1859 "cs.ATG" 
 			outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.LogicalOr, expr);  
 		}
 	}
 
 	void PrimaryExpr(
-#line  1735 "cs.ATG" 
+#line  1771 "cs.ATG" 
 out Expression pexpr) {
 
-#line  1737 "cs.ATG" 
+#line  1773 "cs.ATG" 
 		TypeReference type = null;
 		bool isArrayCreation = false;
 		Expression expr;
@@ -3931,46 +4007,46 @@
 		case 112: {
 			lexer.NextToken();
 
-#line  1744 "cs.ATG" 
+#line  1780 "cs.ATG" 
 			pexpr = new PrimitiveExpression(true, "true");  
 			break;
 		}
 		case 71: {
 			lexer.NextToken();
 
-#line  1745 "cs.ATG" 
+#line  1781 "cs.ATG" 
 			pexpr = new PrimitiveExpression(false, "false"); 
 			break;
 		}
 		case 89: {
 			lexer.NextToken();
 
-#line  1746 "cs.ATG" 
+#line  1782 "cs.ATG" 
 			pexpr = new PrimitiveExpression(null, "null");  
 			break;
 		}
 		case 2: {
 			lexer.NextToken();
 
-#line  1747 "cs.ATG" 
+#line  1783 "cs.ATG" 
 			pexpr = new PrimitiveExpression(t.literalValue, t.val);  
 			break;
 		}
 		case 1: {
 			lexer.NextToken();
 
-#line  1749 "cs.ATG" 
+#line  1785 "cs.ATG" 
 			pexpr = new IdentifierExpression(t.val); 
 			break;
 		}
 		case 18: {
 			lexer.NextToken();
 			Expr(
-#line  1751 "cs.ATG" 
+#line  1787 "cs.ATG" 
 out expr);
 			Expect(19);
 
-#line  1751 "cs.ATG" 
+#line  1787 "cs.ATG" 
 			pexpr = new ParenthesizedExpression(expr); 
 			break;
 		}
@@ -4038,177 +4114,186 @@
 			}
 			}
 
-#line  1757 "cs.ATG" 
+#line  1793 "cs.ATG" 
 			string val = t.val; 
 			Expect(13);
 			Expect(1);
 
-#line  1757 "cs.ATG" 
+#line  1793 "cs.ATG" 
 			pexpr = new FieldReferenceExpression(new TypeReferenceExpression(val), t.val); 
 			break;
 		}
 		case 110: {
 			lexer.NextToken();
 
-#line  1759 "cs.ATG" 
+#line  1795 "cs.ATG" 
 			pexpr = new ThisReferenceExpression(); 
 			break;
 		}
 		case 50: {
 			lexer.NextToken();
 
-#line  1761 "cs.ATG" 
+#line  1797 "cs.ATG" 
 			Expression retExpr = new BaseReferenceExpression(); 
 			if (la.kind == 13) {
 				lexer.NextToken();
 				Expect(1);
 
-#line  1763 "cs.ATG" 
+#line  1799 "cs.ATG" 
 				retExpr = new FieldReferenceExpression(retExpr, t.val); 
 			} else if (la.kind == 16) {
 				lexer.NextToken();
 				Expr(
-#line  1764 "cs.ATG" 
+#line  1800 "cs.ATG" 
 out expr);
 
-#line  1764 "cs.ATG" 
+#line  1800 "cs.ATG" 
 				ArrayList indices = new ArrayList(); indices.Add(expr); 
 				while (la.kind == 12) {
 					lexer.NextToken();
 					Expr(
-#line  1765 "cs.ATG" 
+#line  1801 "cs.ATG" 
 out expr);
 
-#line  1765 "cs.ATG" 
+#line  1801 "cs.ATG" 
 					indices.Add(expr); 
 				}
 				Expect(17);
 
-#line  1766 "cs.ATG" 
+#line  1802 "cs.ATG" 
 				retExpr = new IndexerExpression(retExpr, indices); 
 			} else SynErr(177);
 
-#line  1767 "cs.ATG" 
+#line  1803 "cs.ATG" 
 			pexpr = retExpr; 
 			break;
 		}
 		case 88: {
 			lexer.NextToken();
 			NonArrayType(
-#line  1768 "cs.ATG" 
+#line  1804 "cs.ATG" 
 out type);
 
-#line  1768 "cs.ATG" 
+#line  1804 "cs.ATG" 
 			ArrayList parameters = new ArrayList(); 
 			if (la.kind == 18) {
 				lexer.NextToken();
 
-#line  1773 "cs.ATG" 
+#line  1809 "cs.ATG" 
 				ObjectCreateExpression oce = new ObjectCreateExpression(type, parameters); 
 				if (StartOf(21)) {
 					Argument(
-#line  1773 "cs.ATG" 
+#line  1809 "cs.ATG" 
 out expr);
 
-#line  1773 "cs.ATG" 
+#line  1809 "cs.ATG" 
 					parameters.Add(expr); 
 					while (la.kind == 12) {
 						lexer.NextToken();
 						Argument(
-#line  1774 "cs.ATG" 
+#line  1810 "cs.ATG" 
 out expr);
 
-#line  1774 "cs.ATG" 
+#line  1810 "cs.ATG" 
 						parameters.Add(expr); 
 					}
 				}
 				Expect(19);
 
-#line  1774 "cs.ATG" 
+#line  1810 "cs.ATG" 
 				pexpr = oce; 
 			} else if (la.kind == 16) {
 
-#line  1776 "cs.ATG" 
-				isArrayCreation = true; ArrayCreateExpression ace = new ArrayCreateExpression(type, parameters); pexpr = ace; 
+#line  1812 "cs.ATG" 
+				isArrayCreation = true; ArrayCreateExpression ace = new ArrayCreateExpression(type); pexpr = ace; 
 				lexer.NextToken();
 
-#line  1777 "cs.ATG" 
-				int dims = 0; ArrayList rank = new ArrayList(); 
+#line  1813 "cs.ATG" 
+				int dims = 0; ArrayList rank = new ArrayList(); ArrayList parameterExpression = new ArrayList(); 
 				if (StartOf(4)) {
 					Expr(
-#line  1779 "cs.ATG" 
+#line  1815 "cs.ATG" 
 out expr);
 
-#line  1779 "cs.ATG" 
-					parameters.Add(expr); 
+#line  1815 "cs.ATG" 
+					parameterExpression.Add(expr); 
 					while (la.kind == 12) {
 						lexer.NextToken();
 						Expr(
-#line  1779 "cs.ATG" 
+#line  1815 "cs.ATG" 
 out expr);
 
-#line  1779 "cs.ATG" 
-						parameters.Add(expr); 
+#line  1815 "cs.ATG" 
+						parameterExpression.Add(expr); 
 					}
 					Expect(17);
+
+#line  1815 "cs.ATG" 
+					parameters.Add(new ArrayCreationParameter(parameterExpression)); ace.Parameters = parameters; 
 					while (
-#line  1780 "cs.ATG" 
+#line  1816 "cs.ATG" 
 IsDims()) {
 						Expect(16);
 
-#line  1780 "cs.ATG" 
+#line  1816 "cs.ATG" 
 						dims =0;
 						while (la.kind == 12) {
 							lexer.NextToken();
 
-#line  1780 "cs.ATG" 
+#line  1816 "cs.ATG" 
 							dims++;
 						}
 
-#line  1780 "cs.ATG" 
-						rank.Add(dims); 
+#line  1816 "cs.ATG" 
+						rank.Add(dims); parameters.Add(new ArrayCreationParameter(dims)); 
 						Expect(17);
 					}
 
-#line  1781 "cs.ATG" 
+#line  1817 "cs.ATG" 
 					if (rank.Count > 0) { ace.Rank = (int[])rank.ToArray(typeof (int)); } 
 					if (la.kind == 14) {
 						ArrayInitializer(
-#line  1782 "cs.ATG" 
+#line  1818 "cs.ATG" 
 out expr);
 
-#line  1782 "cs.ATG" 
+#line  1818 "cs.ATG" 
 						ace.ArrayInitializer = (ArrayInitializerExpression)expr; 
 					}
 				} else if (la.kind == 12 || la.kind == 17) {
 					while (la.kind == 12) {
 						lexer.NextToken();
+
+#line  1820 "cs.ATG" 
+						dims++;
 					}
+
+#line  1820 "cs.ATG" 
+					parameters.Add(new ArrayCreationParameter(dims)); 
 					Expect(17);
 					while (
-#line  1784 "cs.ATG" 
+#line  1820 "cs.ATG" 
 IsDims()) {
 						Expect(16);
 
-#line  1784 "cs.ATG" 
+#line  1820 "cs.ATG" 
 						dims =0;
 						while (la.kind == 12) {
 							lexer.NextToken();
 
-#line  1784 "cs.ATG" 
+#line  1820 "cs.ATG" 
 							dims++;
 						}
 
-#line  1784 "cs.ATG" 
-						parameters.Add(dims); 
+#line  1820 "cs.ATG" 
+						parameters.Add(new ArrayCreationParameter(dims)); 
 						Expect(17);
 					}
 					ArrayInitializer(
-#line  1784 "cs.ATG" 
+#line  1820 "cs.ATG" 
 out expr);
 
-#line  1784 "cs.ATG" 
-					ace.ArrayInitializer = (ArrayInitializerExpression)expr; 
+#line  1820 "cs.ATG" 
+					ace.ArrayInitializer = (ArrayInitializerExpression)expr; ace.Parameters = parameters; 
 				} else SynErr(178);
 			} else SynErr(179);
 			break;
@@ -4217,20 +4302,20 @@
 			lexer.NextToken();
 			Expect(18);
 			if (
-#line  1790 "cs.ATG" 
+#line  1826 "cs.ATG" 
 NotVoidPointer()) {
 				Expect(122);
 
-#line  1790 "cs.ATG" 
+#line  1826 "cs.ATG" 
 				type = new TypeReference("void"); 
 			} else if (StartOf(8)) {
 				Type(
-#line  1791 "cs.ATG" 
+#line  1827 "cs.ATG" 
 out type);
 			} else SynErr(180);
 			Expect(19);
 
-#line  1792 "cs.ATG" 
+#line  1828 "cs.ATG" 
 			pexpr = new TypeOfExpression(type); 
 			break;
 		}
@@ -4238,11 +4323,11 @@
 			lexer.NextToken();
 			Expect(18);
 			Type(
-#line  1793 "cs.ATG" 
+#line  1829 "cs.ATG" 
 out type);
 			Expect(19);
 
-#line  1793 "cs.ATG" 
+#line  1829 "cs.ATG" 
 			pexpr = new SizeOfExpression(type); 
 			break;
 		}
@@ -4250,11 +4335,11 @@
 			lexer.NextToken();
 			Expect(18);
 			Expr(
-#line  1794 "cs.ATG" 
+#line  1830 "cs.ATG" 
 out expr);
 			Expect(19);
 
-#line  1794 "cs.ATG" 
+#line  1830 "cs.ATG" 
 			pexpr = new CheckedExpression(expr); 
 			break;
 		}
@@ -4262,11 +4347,11 @@
 			lexer.NextToken();
 			Expect(18);
 			Expr(
-#line  1795 "cs.ATG" 
+#line  1831 "cs.ATG" 
 out expr);
 			Expect(19);
 
-#line  1795 "cs.ATG" 
+#line  1831 "cs.ATG" 
 			pexpr = new CheckedExpression(expr); 
 			break;
 		}
@@ -4277,350 +4362,350 @@
 				if (la.kind == 29) {
 					lexer.NextToken();
 
-#line  1799 "cs.ATG" 
+#line  1835 "cs.ATG" 
 					pexpr = new UnaryOperatorExpression(pexpr, UnaryOperatorType.PostIncrement); 
 				} else if (la.kind == 30) {
 					lexer.NextToken();
 
-#line  1800 "cs.ATG" 
+#line  1836 "cs.ATG" 
 					pexpr = new UnaryOperatorExpression(pexpr, UnaryOperatorType.PostDecrement); 
 				} else SynErr(182);
 			} else if (la.kind == 47) {
 				lexer.NextToken();
 				Expect(1);
 
-#line  1803 "cs.ATG" 
+#line  1839 "cs.ATG" 
 				pexpr = new PointerReferenceExpression(pexpr, t.val); 
 			} else if (la.kind == 13) {
 				lexer.NextToken();
 				Expect(1);
 
-#line  1804 "cs.ATG" 
+#line  1840 "cs.ATG" 
 				pexpr = new FieldReferenceExpression(pexpr, t.val);
 			} else if (la.kind == 18) {
 				lexer.NextToken();
 
-#line  1806 "cs.ATG" 
+#line  1842 "cs.ATG" 
 				ArrayList parameters = new ArrayList(); 
 				if (StartOf(21)) {
 					Argument(
-#line  1807 "cs.ATG" 
+#line  1843 "cs.ATG" 
 out expr);
 
-#line  1807 "cs.ATG" 
+#line  1843 "cs.ATG" 
 					parameters.Add(expr); 
 					while (la.kind == 12) {
 						lexer.NextToken();
 						Argument(
-#line  1808 "cs.ATG" 
+#line  1844 "cs.ATG" 
 out expr);
 
-#line  1808 "cs.ATG" 
+#line  1844 "cs.ATG" 
 						parameters.Add(expr); 
 					}
 				}
 				Expect(19);
 
-#line  1809 "cs.ATG" 
+#line  1845 "cs.ATG" 
 				pexpr = new InvocationExpression(pexpr, parameters); 
 			} else {
 
-#line  1811 "cs.ATG" 
+#line  1847 "cs.ATG" 
 				if (isArrayCreation) Error("element access not allow on array creation");
 				ArrayList indices = new ArrayList();
 				
 				lexer.NextToken();
 				Expr(
-#line  1814 "cs.ATG" 
+#line  1850 "cs.ATG" 
 out expr);
 
-#line  1814 "cs.ATG" 
+#line  1850 "cs.ATG" 
 				indices.Add(expr); 
 				while (la.kind == 12) {
 					lexer.NextToken();
 					Expr(
-#line  1815 "cs.ATG" 
+#line  1851 "cs.ATG" 
 out expr);
 
-#line  1815 "cs.ATG" 
+#line  1851 "cs.ATG" 
 					indices.Add(expr); 
 				}
 				Expect(17);
 
-#line  1816 "cs.ATG" 
+#line  1852 "cs.ATG" 
 				pexpr = new IndexerExpression(pexpr, indices); 
 			}
 		}
 	}
 
 	void ConditionalAndExpr(
-#line  1826 "cs.ATG" 
+#line  1862 "cs.ATG" 
 ref Expression outExpr) {
 
-#line  1827 "cs.ATG" 
+#line  1863 "cs.ATG" 
 		Expression expr; 
 		InclusiveOrExpr(
-#line  1829 "cs.ATG" 
+#line  1865 "cs.ATG" 
 ref outExpr);
 		while (la.kind == 23) {
 			lexer.NextToken();
 			UnaryExpr(
-#line  1829 "cs.ATG" 
+#line  1865 "cs.ATG" 
 out expr);
 			InclusiveOrExpr(
-#line  1829 "cs.ATG" 
+#line  1865 "cs.ATG" 
 ref expr);
 
-#line  1829 "cs.ATG" 
+#line  1865 "cs.ATG" 
 			outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.LogicalAnd, expr);  
 		}
 	}
 
 	void InclusiveOrExpr(
-#line  1832 "cs.ATG" 
+#line  1868 "cs.ATG" 
 ref Expression outExpr) {
 
-#line  1833 "cs.ATG" 
+#line  1869 "cs.ATG" 
 		Expression expr; 
 		ExclusiveOrExpr(
-#line  1835 "cs.ATG" 
+#line  1871 "cs.ATG" 
 ref outExpr);
 		while (la.kind == 27) {
 			lexer.NextToken();
 			UnaryExpr(
-#line  1835 "cs.ATG" 
+#line  1871 "cs.ATG" 
 out expr);
 			ExclusiveOrExpr(
-#line  1835 "cs.ATG" 
+#line  1871 "cs.ATG" 
 ref expr);
 
-#line  1835 "cs.ATG" 
+#line  1871 "cs.ATG" 
 			outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.BitwiseOr, expr);  
 		}
 	}
 
 	void ExclusiveOrExpr(
-#line  1838 "cs.ATG" 
+#line  1874 "cs.ATG" 
 ref Expression outExpr) {
 
-#line  1839 "cs.ATG" 
+#line  1875 "cs.ATG" 
 		Expression expr; 
 		AndExpr(
-#line  1841 "cs.ATG" 
+#line  1877 "cs.ATG" 
 ref outExpr);
 		while (la.kind == 28) {
 			lexer.NextToken();
 			UnaryExpr(
-#line  1841 "cs.ATG" 
+#line  1877 "cs.ATG" 
 out expr);
 			AndExpr(
-#line  1841 "cs.ATG" 
+#line  1877 "cs.ATG" 
 ref expr);
 
-#line  1841 "cs.ATG" 
+#line  1877 "cs.ATG" 
 			outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.ExclusiveOr, expr);  
 		}
 	}
 
 	void AndExpr(
-#line  1844 "cs.ATG" 
+#line  1880 "cs.ATG" 
 ref Expression outExpr) {
 
-#line  1845 "cs.ATG" 
+#line  1881 "cs.ATG" 
 		Expression expr; 
 		EqualityExpr(
-#line  1847 "cs.ATG" 
+#line  1883 "cs.ATG" 
 ref outExpr);
 		while (la.kind == 26) {
 			lexer.NextToken();
 			UnaryExpr(
-#line  1847 "cs.ATG" 
+#line  1883 "cs.ATG" 
 out expr);
 			EqualityExpr(
-#line  1847 "cs.ATG" 
+#line  1883 "cs.ATG" 
 ref expr);
 
-#line  1847 "cs.ATG" 
+#line  1883 "cs.ATG" 
 			outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.BitwiseAnd, expr);  
 		}
 	}
 
 	void EqualityExpr(
-#line  1850 "cs.ATG" 
+#line  1886 "cs.ATG" 
 ref Expression outExpr) {
 
-#line  1852 "cs.ATG" 
+#line  1888 "cs.ATG" 
 		Expression expr;
 		BinaryOperatorType op = BinaryOperatorType.None;
 		
 		RelationalExpr(
-#line  1856 "cs.ATG" 
+#line  1892 "cs.ATG" 
 ref outExpr);
 		while (la.kind == 31 || la.kind == 32) {
 			if (la.kind == 32) {
 				lexer.NextToken();
 
-#line  1859 "cs.ATG" 
+#line  1895 "cs.ATG" 
 				op = BinaryOperatorType.InEquality; 
 			} else {
 				lexer.NextToken();
 
-#line  1860 "cs.ATG" 
+#line  1896 "cs.ATG" 
 				op = BinaryOperatorType.Equality; 
 			}
 			UnaryExpr(
-#line  1862 "cs.ATG" 
+#line  1898 "cs.ATG" 
 out expr);
 			RelationalExpr(
-#line  1862 "cs.ATG" 
+#line  1898 "cs.ATG" 
 ref expr);
 
-#line  1862 "cs.ATG" 
+#line  1898 "cs.ATG" 
 			outExpr = new BinaryOperatorExpression(outExpr, op, expr);  
 		}
 	}
 
 	void RelationalExpr(
-#line  1866 "cs.ATG" 
+#line  1902 "cs.ATG" 
 ref Expression outExpr) {
 
-#line  1868 "cs.ATG" 
+#line  1904 "cs.ATG" 
 		TypeReference type;
 		Expression expr;
 		BinaryOperatorType op = BinaryOperatorType.None;
 		
 		ShiftExpr(
-#line  1873 "cs.ATG" 
+#line  1909 "cs.ATG" 
 ref outExpr);
 		while (StartOf(26)) {
 			if (StartOf(27)) {
 				if (la.kind == 21) {
 					lexer.NextToken();
 
-#line  1876 "cs.ATG" 
+#line  1912 "cs.ATG" 
 					op = BinaryOperatorType.LessThan; 
 				} else if (la.kind == 20) {
 					lexer.NextToken();
 
-#line  1877 "cs.ATG" 
+#line  1913 "cs.ATG" 
 					op = BinaryOperatorType.GreaterThan; 
 				} else if (la.kind == 34) {
 					lexer.NextToken();
 
-#line  1878 "cs.ATG" 
+#line  1914 "cs.ATG" 
 					op = BinaryOperatorType.LessThanOrEqual; 
 				} else if (la.kind == 33) {
 					lexer.NextToken();
 
-#line  1879 "cs.ATG" 
+#line  1915 "cs.ATG" 
 					op = BinaryOperatorType.GreaterThanOrEqual; 
 				} else SynErr(183);
 				UnaryExpr(
-#line  1881 "cs.ATG" 
+#line  1917 "cs.ATG" 
 out expr);
 				ShiftExpr(
-#line  1881 "cs.ATG" 
+#line  1917 "cs.ATG" 
 ref expr);
 
-#line  1881 "cs.ATG" 
+#line  1917 "cs.ATG" 
 				outExpr = new BinaryOperatorExpression(outExpr, op, expr);  
 			} else {
 				if (la.kind == 84) {
 					lexer.NextToken();
 
-#line  1884 "cs.ATG" 
+#line  1920 "cs.ATG" 
 					op = BinaryOperatorType.IS; 
 				} else if (la.kind == 49) {
 					lexer.NextToken();
 
-#line  1885 "cs.ATG" 
+#line  1921 "cs.ATG" 
 					op = BinaryOperatorType.AS; 
 				} else SynErr(184);
 				Type(
-#line  1887 "cs.ATG" 
+#line  1923 "cs.ATG" 
 out type);
 
-#line  1887 "cs.ATG" 
+#line  1923 "cs.ATG" 
 				outExpr = new BinaryOperatorExpression(outExpr, op, new TypeReferenceExpression(type)); 
 			}
 		}
 	}
 
 	void ShiftExpr(
-#line  1891 "cs.ATG" 
+#line  1927 "cs.ATG" 
 ref Expression outExpr) {
 
-#line  1893 "cs.ATG" 
+#line  1929 "cs.ATG" 
 		Expression expr;
 		BinaryOperatorType op = BinaryOperatorType.None;
 		
 		AdditiveExpr(
-#line  1897 "cs.ATG" 
+#line  1933 "cs.ATG" 
 ref outExpr);
 		while (la.kind == 35 || la.kind == 36) {
 			if (la.kind == 35) {
 				lexer.NextToken();
 
-#line  1900 "cs.ATG" 
+#line  1936 "cs.ATG" 
 				op = BinaryOperatorType.ShiftLeft; 
 			} else {
 				lexer.NextToken();
 
-#line  1901 "cs.ATG" 
+#line  1937 "cs.ATG" 
 				op = BinaryOperatorType.ShiftRight; 
 			}
 			UnaryExpr(
-#line  1903 "cs.ATG" 
+#line  1939 "cs.ATG" 
 out expr);
 			AdditiveExpr(
-#line  1903 "cs.ATG" 
+#line  1939 "cs.ATG" 
 ref expr);
 
-#line  1903 "cs.ATG" 
+#line  1939 "cs.ATG" 
 			outExpr = new BinaryOperatorExpression(outExpr, op, expr);  
 		}
 	}
 
 	void AdditiveExpr(
-#line  1907 "cs.ATG" 
+#line  1943 "cs.ATG" 
 ref Expression outExpr) {
 
-#line  1909 "cs.ATG" 
+#line  1945 "cs.ATG" 
 		Expression expr;
 		BinaryOperatorType op = BinaryOperatorType.None;
 		
 		MultiplicativeExpr(
-#line  1913 "cs.ATG" 
+#line  1949 "cs.ATG" 
 ref outExpr);
 		while (la.kind == 4 || la.kind == 5) {
 			if (la.kind == 4) {
 				lexer.NextToken();
 
-#line  1916 "cs.ATG" 
+#line  1952 "cs.ATG" 
 				op = BinaryOperatorType.Add; 
 			} else {
 				lexer.NextToken();
 
-#line  1917 "cs.ATG" 
+#line  1953 "cs.ATG" 
 				op = BinaryOperatorType.Subtract; 
 			}
 			UnaryExpr(
-#line  1919 "cs.ATG" 
+#line  1955 "cs.ATG" 
 out expr);
 			MultiplicativeExpr(
-#line  1919 "cs.ATG" 
+#line  1955 "cs.ATG" 
 ref expr);
 
-#line  1919 "cs.ATG" 
+#line  1955 "cs.ATG" 
 			outExpr = new BinaryOperatorExpression(outExpr, op, expr);  
 		}
 	}
 
 	void MultiplicativeExpr(
-#line  1923 "cs.ATG" 
+#line  1959 "cs.ATG" 
 ref Expression outExpr) {
 
-#line  1925 "cs.ATG" 
+#line  1961 "cs.ATG" 
 		Expression expr;
 		BinaryOperatorType op = BinaryOperatorType.None;
 		
@@ -4628,24 +4713,24 @@
 			if (la.kind == 6) {
 				lexer.NextToken();
 
-#line  1931 "cs.ATG" 
+#line  1967 "cs.ATG" 
 				op = BinaryOperatorType.Multiply; 
 			} else if (la.kind == 7) {
 				lexer.NextToken();
 
-#line  1932 "cs.ATG" 
+#line  1968 "cs.ATG" 
 				op = BinaryOperatorType.Divide; 
 			} else {
 				lexer.NextToken();
 
-#line  1933 "cs.ATG" 
+#line  1969 "cs.ATG" 
 				op = BinaryOperatorType.Modulus; 
 			}
 			UnaryExpr(
-#line  1935 "cs.ATG" 
+#line  1971 "cs.ATG" 
 out expr);
 
-#line  1935 "cs.ATG" 
+#line  1971 "cs.ATG" 
 			outExpr = new BinaryOperatorExpression(outExpr, op, expr); 
 		}
 	}

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/ParserUtil.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/ParserUtil.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/ParserUtil.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,4 +1,4 @@
-namespace MonoDevelop.SharpRefactory.Parser
+namespace ICSharpCode.SharpRefactory.Parser
 {
 	public sealed class ParserUtil
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/cs.ATG
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/cs.ATG	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/cs.ATG	2004-03-21 06:22:28 UTC (rev 1213)
@@ -312,7 +312,7 @@
 /* True, if lookahead is a primitive type keyword, or *
  * if it is a type declaration followed by an ident   */
 bool IsLocalVarDecl () {
-	if (ParserUtil.IsTypeKW(la) || la.kind == Tokens.Void) return true;
+	if ((ParserUtil.IsTypeKW(la) && Peek(1).kind != Tokens.Dot) || la.kind == Tokens.Void) return true;
 	
 	StartPeek();
 	Token pt = la ;  // peek token
@@ -548,8 +548,8 @@
 
 GlobalAttributeSection
 =
-	(. Point startPos = t.Location; .)
-	"[" ident                   (. if (t.val != "assembly") Error("global attribute target specifier (\"assembly\") expected");
+	
+	"[" (. Point startPos = t.Location; .) ident                   (. if (t.val != "assembly") Error("global attribute target specifier (\"assembly\") expected");
 	                               string attributeTarget = t.val;
 	                               ArrayList attributes = new ArrayList();
 	                               ICSharpCode.SharpRefactory.Parser.AST.Attribute attribute;
@@ -682,7 +682,7 @@
 	ident                           (. newType.Name = t.val; .)
 	[ ClassBase<out names>          (. newType.BaseTypes = names; .) ] (. newType.StartLocation = t.EndLocation; .)
 	ClassBody
-	[ ";" ]                         (. newType.EndLocation = t.EndLocation; 
+	[ ";" ]                         (. newType.EndLocation = t.Location; 
 	                                   compilationUnit.BlockEnd();
 	                                .)
 	| /*--- struct declaration: */  (. m.Check(Modifier.StructsInterfacesEnumsDelegates); .)
@@ -696,7 +696,7 @@
 	ident                            (. newType.Name = t.val; .)
 	[ StructInterfaces<out names>    (. newType.BaseTypes = names; .) ] (. newType.StartLocation = t.EndLocation; .)
 	StructBody
-	[ ";" ]                          (. newType.EndLocation = t.EndLocation; 
+	[ ";" ]                          (. newType.EndLocation = t.Location; 
 	                                    compilationUnit.BlockEnd();
 	                                 .)
 	| /*--- interface declaration: */ 
@@ -709,7 +709,7 @@
 	ident                            (. newType.Name = t.val; .)
 	[ InterfaceBase<out names>       (. newType.BaseTypes = names; .) ] (. newType.StartLocation = t.EndLocation; .)
 	InterfaceBody
-	[ ";" ]                          (. newType.EndLocation = t.EndLocation; 
+	[ ";" ]                          (. newType.EndLocation = t.Location; 
 	                                    compilationUnit.BlockEnd();
 	                                 .)
 	| /*--- enumeration declaration: */
@@ -725,7 +725,7 @@
 	                                 .)
 	]                                (. newType.StartLocation = t.EndLocation; .)
 	EnumBody 
-	[ ";" ]                          (. newType.EndLocation = t.EndLocation; 
+	[ ";" ]                          (. newType.EndLocation = t.Location; 
 	                                    compilationUnit.BlockEnd();
 	                                 .)
 	| /*--- delegate declaration: */
@@ -740,7 +740,7 @@
 	ident                            (. delegateDeclr.Name = t.val; .)
 	"(" [ FormalParameterList<out p> (. delegateDeclr.Parameters = p; .)
 	] ")"
-	";"                              (. delegateDeclr.EndLocation = t.EndLocation;
+	";"                              (. delegateDeclr.EndLocation = t.Location;
 	                                    compilationUnit.AddChild(delegateDeclr);
 	                                 .)
 	)
@@ -969,7 +969,7 @@
 
 StructMemberDecl<Modifiers m, ArrayList attributes>
 (.
-	string qualident;
+	string qualident = null;
 	TypeReference type;
 	Expression expr;
 	ArrayList p = new ArrayList();
@@ -1009,7 +1009,7 @@
 	                                       .)
 	
 	| /*--- event declaration: */          (. m.Check(Modifier.PropertysEventsMethods); .)
-	"event"                                (. EventDeclaration eventDecl = new EventDeclaration(attributes);
+	"event"                                (. EventDeclaration eventDecl = new EventDeclaration(m.Modifier, attributes);
 	                                          eventDecl.StartLocation = t.Location;
 	                                          compilationUnit.AddChild(eventDecl);
 	                                          compilationUnit.BlockStart(eventDecl);
@@ -1049,8 +1049,21 @@
 	/*--- conversion operator declaration: */
 	|                                      (. m.Check(Modifier.Operators);
 	                                          if (m.isNone) Error("at least one modifier must be set"); 
+	                                          bool isImplicit = true;
 	                                       .)
-	( "implicit" | "explicit" ) "operator" Type<out type> "(" Type<out type> ident ")" ( Block<out stmt> | ";" )
+	( "implicit" | "explicit" (. isImplicit = false; .) ) 
+	"operator" Type<out type> (. TypeReference operatorType = type; .) 
+	"(" Type<out type> ident (. string varName = t.val; .) ")" ( Block<out stmt> | ";" (. stmt = null; .) )
+	(.
+		
+		OperatorDeclarator operatorDeclarator = new OperatorDeclarator(isImplicit ? OperatorType.Implicit : OperatorType.Explicit,
+		                                                               operatorType,
+		                                                               type,
+		                                                               varName);
+		OperatorDeclaration operatorDeclaration = new OperatorDeclaration(operatorDeclarator, m.Modifier, attributes);
+		operatorDeclaration.Body = stmt;
+		compilationUnit.AddChild(operatorDeclaration);
+	.)
 	
 	/*--- inner type declaration: */
 	| TypeDecl<m, attributes>
@@ -1060,9 +1073,9 @@
 		                                      m.Check(Modifier.Operators);
 		                                      if (m.isNone) Error("at least one modifier must be set");
 		                                   .)
-		"operator" OverloadableOperator<out op> 
-		"(" Type<out type> ident 
-		( "," Type<out type> ident         (. if (ParserUtil.IsUnaryOperator(op))
+		"operator" OverloadableOperator<out op> (. TypeReference firstType, secondType = null; string secondName = null; .)
+		"(" Type<out firstType> ident (. string firstName = t.val; .)
+		( "," Type<out secondType> ident (. secondName = t.val; .)        (. if (ParserUtil.IsUnaryOperator(op) && !ParserUtil.IsBinaryOperator(op))
 		                                      Error("too many operands for unary operator"); 
 		                                   .)
 		| /* empty */                      (. if (ParserUtil.IsBinaryOperator(op))
@@ -1070,6 +1083,18 @@
 		                                   .)
 		)
 		")" ( Block<out stmt> | ";" )
+		(.
+			OperatorDeclarator operatorDeclarator = new OperatorDeclarator(secondType != null ? OperatorType.Binary : OperatorType.Unary, 
+			                                                               type,
+			                                                               op.kind,
+			                                                               firstType,
+			                                                               firstName,
+			                                                               secondType,
+			                                                               secondName);
+			OperatorDeclaration operatorDeclaration = new OperatorDeclaration(operatorDeclarator, m.Modifier, attributes);
+			operatorDeclaration.Body = stmt;
+			compilationUnit.AddChild(operatorDeclaration);
+		.)
 		
 		/*--- field declaration: */
 		| IF (IsVarDecl())                 (. m.Check(Modifier.Fields); 
@@ -1176,40 +1201,43 @@
 	string name;
 	PropertyGetRegion getBlock;
 	PropertySetRegion setBlock;
+	Point startLocation = new Point(-1, -1);
 .)
 =
 	{ AttributeSection<out section>     (. attributes.Add(section); .)}
-	[ "new" (. mod = Modifier.New; .) ]
+	[ "new" (. mod = Modifier.New; startLocation = t.Location; .) ]
 	(
 		/*--- interface void method (procedure) declaration: */
-		IF (NotVoidPointer()) "void" ident (. name = t.val; .)
-		"(" [ FormalParameterList<out p> ] ")" ";" (. MethodDeclaration md = new MethodDeclaration(name, mod, new TypeReference("void"), parameters, attributes);
+		IF (NotVoidPointer()) "void" (. if (startLocation.X == -1) startLocation = t.Location; .) ident (. name = t.val; .)
+		"(" [ FormalParameterList<out parameters> ] ")" ";" (. MethodDeclaration md = new MethodDeclaration(name, mod, new TypeReference("void"), parameters, attributes);
+		                                              md.StartLocation = startLocation;
 		                                              md.EndLocation = t.EndLocation;
 		                                              compilationUnit.AddChild(md);
 		                                           .)
 		| (
-			Type<out type>
+			Type<out type> (. if (startLocation.X == -1) startLocation = t.Location; .)
 			(
-				ident                  (. name = t.val; .)
+				ident                  (. name = t.val; Point qualIdentEndLocation = t.EndLocation; .)
 				(
 					/*--- interface "not void" method (function) declaration: */
 					"(" [ FormalParameterList<out parameters> ] ")" ";" (. MethodDeclaration md = new MethodDeclaration(name, mod, type, parameters, attributes);
+					                                              md.StartLocation = startLocation;
 					                                              md.EndLocation = t.EndLocation;
 					                                              compilationUnit.AddChild(md);
 					                                           .)
 					/*--- interface property declaration: */
 					|                   (. PropertyDeclaration pd = new PropertyDeclaration(name, type, mod, attributes); compilationUnit.AddChild(pd); .)
-					"{" InterfaceAccessors<out getBlock, out setBlock> "}" (. pd.GetRegion = getBlock; pd.SetRegion = setBlock; pd.EndLocation = t.EndLocation; .)
+					"{" (. Point bodyStart = t.Location;.) InterfaceAccessors<out getBlock, out setBlock> "}" (. pd.GetRegion = getBlock; pd.SetRegion = setBlock; pd.StartLocation = startLocation; pd.EndLocation = qualIdentEndLocation; pd.BodyStart = bodyStart; pd.BodyEnd = t.EndLocation; .)
 				)
 				/*--- interface indexer declaration: */
-				| "this" "[" FormalParameterList<out p> "]" (. IndexerDeclaration id = new IndexerDeclaration(type, p, mod, attributes); compilationUnit.AddChild(id); .)
-				"{" InterfaceAccessors<out getBlock, out setBlock> "}" (. id.GetRegion = getBlock; id.SetRegion = setBlock; id.EndLocation = t.EndLocation; .)
+				| "this" "[" FormalParameterList<out p> "]" (.Point bracketEndLocation = t.EndLocation; .)  (. IndexerDeclaration id = new IndexerDeclaration(type, p, mod, attributes); compilationUnit.AddChild(id); .)
+				"{" (. Point bodyStart = t.Location;.) InterfaceAccessors<out getBlock, out setBlock> "}" (. id.GetRegion = getBlock; id.SetRegion = setBlock; id.StartLocation = startLocation;  id.EndLocation = bracketEndLocation; id.BodyStart = bodyStart; id.BodyEnd = t.EndLocation;.)
 			)
 			/*--- interface event declaration: */
-			| "event" Type<out type> ident (. EventDeclaration ed = new EventDeclaration(type, t.val, mod, attributes);
+			| "event" (. if (startLocation.X == -1) startLocation = t.Location; .) Type<out type> ident (. EventDeclaration ed = new EventDeclaration(type, t.val, mod, attributes);
 			                                  compilationUnit.AddChild(ed);
 			                               .)
-			";"                            (. ed.EndLocation = t.EndLocation; .)
+			";"                            (. ed.StartLocation = startLocation; ed.EndLocation = t.EndLocation; .)
 		)
 	)
 .
@@ -1521,9 +1549,11 @@
 	  [ Expr<out expr> ] ";"
 	  [ ForIterator<out iterator> ] ")"
 	  EmbeddedStatement<out embeddedStatement> (. statement = new ForStatement(initializer, expr, iterator, embeddedStatement); .)
-	| "foreach" "(" Type<out type> ident     (. string varName = t.val; .)
+	| "foreach" "(" Type<out type> ident     (. string varName = t.val; Point start = t.Location;.)
 	"in" Expr<out expr> ")"
-	EmbeddedStatement<out embeddedStatement> (.  statement = new ForeachStatement(type, varName , expr, embeddedStatement); .)
+	EmbeddedStatement<out embeddedStatement> (.  statement = new ForeachStatement(type, varName , expr, embeddedStatement); 
+	                                             statement.EndLocation = t.EndLocation;
+	                                         .)
 	/*--- jump statements (break, contine, goto, return, throw): */
 	| "break" ";"               (. statement = new BreakStatement(); .)
 	| "continue" ";"            (. statement = new ContinueStatement(); .)
@@ -1682,12 +1712,12 @@
 .
 
 Expr<out Expression expr>
-(. expr = new Expression(); .)
+(. expr = null; Expression expr1 = null, expr2 = null; .)
 =
 	UnaryExpr<out expr>
 	/*--- conditional expression: */
 	(
-		ConditionalOrExpr<ref expr> [ "?" Expr<out expr> ":" Expr<out expr> ]
+		ConditionalOrExpr<ref expr> [ "?" Expr<out expr1> ":" Expr<out expr2> (. expr = new ConditionalExpression(expr, expr1, expr2);  .) ] 
 		/*--- assignment: */
 		| (. AssignmentOperatorType op; Expression val; .) AssignmentOperator<out op> Expr<out val> (. expr = new AssignmentExpression(expr, op, val); .)
 	)
@@ -1698,20 +1728,19 @@
 (.
 	TypeReference type = null;
 	Expression expr;
-	UnaryOperatorType uop = UnaryOperatorType.None;
-	bool isUOp = false;
-	bool isCast = false;
+	ArrayList  expressions = new ArrayList();
+	uExpr = null;
 .)
 =
 	{
-		  "+"  (. uop = UnaryOperatorType.Plus; isUOp = true; .)
-		| "-"  (. uop = UnaryOperatorType.Minus; isUOp = true; .)
-		| "!"  (. uop = UnaryOperatorType.Not;  isUOp = true;.)
-		| "~"  (. uop = UnaryOperatorType.BitNot; isUOp = true; .)
-		| "*"  (. uop = UnaryOperatorType.Star;  isUOp = true; .)
-		| "++" (. uop = UnaryOperatorType.Increment; isUOp = true; .)
-		| "--" (. uop = UnaryOperatorType.Decrement; isUOp = true; .)
-		| "&"  (. uop = UnaryOperatorType.BitWiseAnd; isUOp = true; .)
+		  "+"  (. expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Plus)); .)
+		| "-"  (. expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Minus)); .)
+		| "!"  (. expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Not)); .)
+		| "~"  (. expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.BitNot)); .)
+		| "*"  (. expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Star)); .)
+		| "++" (. expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Increment)); .)
+		| "--" (. expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Decrement)); .)
+		| "&"  (. expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.BitWiseAnd)); .)
 		
 		/*--- cast expression: */
 		/* Problem:  "(" Type ")" from here and                     *
@@ -1719,14 +1748,21 @@
 		 *           are not distinguishable                        *
 		 * Solution: (in IsTypeCast())                              *
 		 * use external information from compiled assembly or guess */
-		| IF (IsTypeCast()) "(" Type<out type> ")"  (. isCast = true; .)
+		| IF (IsTypeCast()) "(" Type<out type> ")"  (.  expressions.Add(new CastExpression(type)); .)
 	}
-	PrimaryExpr<out expr> (. if (isUOp) { 
-	                             uExpr = new UnaryOperatorExpression(expr, uop);
-	                         } else if (isCast) {
-	                             uExpr = new CastExpression(type, expr);
+	
+	PrimaryExpr<out expr> (. for (int i = 0; i < expressions.Count; ++i) {
+	                         	Expression nextExpression = i + 1 < expressions.Count ? (Expression)expressions[i + 1] : expr;
+	                         	if (expressions[i] is CastExpression) {
+	                         		((CastExpression)expressions[i]).Expression = nextExpression;
+	                         	} else {
+	                         		((UnaryOperatorExpression)expressions[i]).Expression = nextExpression;
+	                         	}
+	                         }
+	                         if (expressions.Count > 0) {
+	                         	uExpr = (Expression)expressions[0];
 	                         } else {
-	                             uExpr = expr;
+	                         	uExpr = expr;
 	                         }
 	                      .)
 .
@@ -1773,15 +1809,15 @@
 			"(" (. ObjectCreateExpression oce = new ObjectCreateExpression(type, parameters); .) [ Argument<out expr>          (. parameters.Add(expr); .)
 			{ "," Argument<out expr>          (. parameters.Add(expr); .) } ] ")" (. pexpr = oce; .)
 			/*--- array creation expression: */
-			| (. isArrayCreation = true; ArrayCreateExpression ace = new ArrayCreateExpression(type, parameters); pexpr = ace; .)
-			"[" (. int dims = 0; ArrayList rank = new ArrayList(); .)
+			| (. isArrayCreation = true; ArrayCreateExpression ace = new ArrayCreateExpression(type); pexpr = ace; .)
+			"[" (. int dims = 0; ArrayList rank = new ArrayList(); ArrayList parameterExpression = new ArrayList(); .)
 			(
-				Expr<out expr> (. parameters.Add(expr); .) { "," Expr<out expr> (. parameters.Add(expr); .) } "]"
-				{ IF (IsDims()) "[" (.dims =0;.) { "," (.dims++;.) } (.rank.Add(dims); .) "]" } 
+				Expr<out expr> (. parameterExpression.Add(expr); .) { "," Expr<out expr> (. parameterExpression.Add(expr); .) } "]" (. parameters.Add(new ArrayCreationParameter(parameterExpression)); ace.Parameters = parameters; .)
+				{ IF (IsDims()) "[" (.dims =0;.) { "," (.dims++;.) } (.rank.Add(dims); parameters.Add(new ArrayCreationParameter(dims)); .) "]" } 
 				(. if (rank.Count > 0) { ace.Rank = (int[])rank.ToArray(typeof (int)); } .)
 				[ ArrayInitializer<out expr> (. ace.ArrayInitializer = (ArrayInitializerExpression)expr; .) ]
 				
-				| { "," } "]" { IF (IsDims()) "[" (.dims =0;.) { "," (.dims++;.) } (.parameters.Add(dims); .) "]" } ArrayInitializer<out expr> (. ace.ArrayInitializer = (ArrayInitializerExpression)expr; .)
+				| { "," (.dims++;.) } (.parameters.Add(new ArrayCreationParameter(dims)); .)  "]" { IF (IsDims()) "[" (.dims =0;.) { "," (.dims++;.) } (.parameters.Add(new ArrayCreationParameter(dims)); .) "]" } ArrayInitializer<out expr> (. ace.ArrayInitializer = (ArrayInitializerExpression)expr; ace.Parameters = parameters; .)
 			)
 /*			| ArrayInitializer<out expr> (. if (!type.IsArrayType) { Error("() or [] expected"); }  pexpr =  new ArrayCreateExpression(type, (ArrayInitializerExpression)expr); .)*/
 		)
@@ -1818,7 +1854,7 @@
 .
 
 ConditionalOrExpr<ref Expression outExpr>
-(. Expression expr; .)
+(. Expression expr;   .)
 =
 	ConditionalAndExpr<ref outExpr>  { "||" UnaryExpr<out expr> ConditionalAndExpr<ref expr> (.  outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.LogicalOr, expr);  .) }
 .

Added: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/keywordlist/ATGTokensSection.gen
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/keywordlist/ATGTokensSection.gen	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/keywordlist/ATGTokensSection.gen	2004-03-21 06:22:28 UTC (rev 1213)
@@ -0,0 +1,133 @@
+/* START AUTOGENERATED TOKENS SECTION */
+TOKENS
+	/* ----- terminal classes ----- */
+	/* EOF is 0 */
+	ident
+	Literal
+
+	/* ----- special character ----- */
+	"="
+	"+"
+	"-"
+	"*"
+	"/"
+	"%"
+	":"
+	";"
+	"?"
+	","
+	"."
+	"{"
+	"}"
+	"["
+	"]"
+	"("
+	")"
+	">"
+	"<"
+	"!"
+	"&&"
+	"||"
+	"~"
+	"&"
+	"|"
+	"^"
+	"++"
+	"--"
+	"=="
+	"!="
+	">="
+	"<="
+	"<<"
+	">>"
+	"+="
+	"-="
+	"*="
+	"/="
+	"%="
+	"&="
+	"|="
+	"^="
+	"<<="
+	">>="
+	"->"
+
+	/* ----- keywords ----- */
+	"abstract"
+	"as"
+	"base"
+	"bool"
+	"break"
+	"byte"
+	"case"
+	"catch"
+	"char"
+	"checked"
+	"class"
+	"const"
+	"continue"
+	"decimal"
+	"default"
+	"delegate"
+	"do"
+	"double"
+	"else"
+	"enum"
+	"event"
+	"explicit"
+	"extern"
+	"false"
+	"finally"
+	"fixed"
+	"float"
+	"for"
+	"foreach"
+	"goto"
+	"if"
+	"implicit"
+	"in"
+	"int"
+	"interface"
+	"internal"
+	"is"
+	"lock"
+	"long"
+	"namespace"
+	"new"
+	"null"
+	"object"
+	"operator"
+	"out"
+	"override"
+	"params"
+	"private"
+	"protected"
+	"public"
+	"readonly"
+	"ref"
+	"return"
+	"sbyte"
+	"sealed"
+	"short"
+	"sizeof"
+	"stackalloc"
+	"static"
+	"string"
+	"struct"
+	"switch"
+	"this"
+	"throw"
+	"true"
+	"try"
+	"typeof"
+	"uint"
+	"ulong"
+	"unchecked"
+	"unsafe"
+	"ushort"
+	"using"
+	"virtual"
+	"void"
+	"volatile"
+	"while"
+/* END AUTOGENERATED TOKENS SECTION */

Added: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/keywordlist/BuildKeywords.pl
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/keywordlist/BuildKeywords.pl	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/keywordlist/BuildKeywords.pl	2004-03-21 06:22:28 UTC (rev 1213)
@@ -0,0 +1,227 @@
+#!/bin/perl
+
+# File names
+$keyword_file     = "CSharpKeywordList.txt";
+$keywords_outfile = "Keywords.cs";
+$tokens_outfile   = "Tokens.cs";
+$ATGTokensSection = "ATGTokensSection.gen";
+
+#read infile
+print "\n";
+print "Reading keyword definition from '$keyword_file'.\n";
+open(DAT, $keyword_file) || die("Could not open file!");
+ at raw_data=<DAT>;
+close(DAT);
+print "done.\n";
+
+#analyse infile
+print "starting analysation ... this could take a few minutes.\n";
+
+foreach (@raw_data) {
+	if ($_=~/\A\s*\$(\w+)\s*=\s*(\S+)/) {
+		#properties form: $PROPERTY = "VALUE"
+		$properties{$1} = $2;
+	} elsif  ($_=~/\A\s*(\w+)\s*=\s*\"(\S+)\"/) {
+		#special characters form: name = "VALUE"
+		$special_chars[$#special_chars + 1] = $1;
+		$special_values[$#special_values + 1] = $2;
+	} elsif  ($_=~/\A\s*\"(\S+)\s*\"/) {
+		#special keywords form: "VALUE"
+		$keywords[$#keywords + 1] = $1
+	} elsif  ($_=~/\A\s*(\w+)\s*/) {
+		#special terminal classes form: name
+		$terminals[$#terminals + 1] = $1
+	}
+}
+
+for ($i=0; $i <= $#keywords; $i++) {
+	$upperKeywords[$i] = uc $keywords[$i];
+}
+sort (ascend @upperKeywords);
+
+
+sort (ascend @keywords);
+print "done.\n";
+
+#write output
+print "writing output files.\nIf your computer doesn’t respond, then press \"Ctrl-Alt-Delete\"\n";
+print "\n";
+&write_keywordfile;
+print "\n";
+&write_tokensfile;
+print "\n";
+&write_atgtokensfile;
+print "\n";
+print "finished.\n";
+
+sub write_keywordfile {
+	print "  ->Generating Keywords class to file '$keywords_outfile'\n";
+	open(DAT,">$keywords_outfile") || die("Cannot Open File");
+	print DAT "// this file was autogenerated by a tool.\n";
+	print DAT "using System;\n";
+	print DAT "using System.Collections;\n";
+	print DAT "using System.Text;\n";
+	print DAT "\n";
+	print DAT "namespace " . $properties{'Namespace'} . "\n";
+	print DAT "{\n";
+	print DAT "	public class Keywords\n";
+	print DAT "	{\n";
+	print DAT "		static readonly string[] keywordList = {\n";
+	if ($properties{'UpperCaseKeywords'} eq "True") {
+		for ($i=0; $i <= $#upperKeywords; $i++) {
+			print DAT "			\"$upperKeywords[$i]\"";
+			if ($i + 1 <= $#upperKeywords) {
+				print DAT ",";
+			}
+			print DAT "\n";
+		}
+	} else {
+		for ($i=0; $i <= $#keywords; $i++) {
+			print DAT "			\"$keywords[$i]\"";
+			if ($i + 1 <= $#keywords) {
+				print DAT ",";
+			}
+			print DAT "\n";
+		}
+	}
+	
+	print DAT "		};\n";
+	print DAT "		\n";
+	print DAT "		static Hashtable keywords = new Hashtable();\n";
+	print DAT "		\n";
+	print DAT "		static Keywords()\n";
+	print DAT "		{\n";
+	print DAT "			for (int i = 0; i < keywordList.Length; ++i) {\n";
+	$up = ucfirst($keywords[0]);
+	print DAT "				keywords.Add(keywordList[i], i + Tokens.$up);\n";
+	print DAT "			}\n";
+	print DAT "		}\n";
+	print DAT "		\n";
+	print DAT "		public static bool IsKeyword(string identifier)\n";
+	print DAT "		{\n";
+	if ($properties{'UpperCaseKeywords'} eq "True") {
+		print DAT "			return keywords[identifier.ToUpper()] != null;\n";
+	} else {
+		print DAT "			return keywords[identifier] != null;\n";
+	}
+	print DAT "		}\n";
+	print DAT "		\n";
+	print DAT "		public static int GetToken(string keyword)\n";
+	print DAT "		{\n";
+	if ($properties{'UpperCaseKeywords'} eq "True") {
+		print DAT "			return (int)keywords[keyword.ToUpper()];\n";
+	} else {
+		print DAT "			return (int)keywords[keyword];\n";
+	}
+	print DAT "		}\n";
+	print DAT "	}\n";
+	print DAT "}\n";
+	
+	close(DAT);
+	print "  ->done.\n";
+}
+
+sub write_token {
+	$formattedString = sprintf("%-20s", ucfirst($tokenName));
+	if ($tokenName eq "GetType") {
+		print DAT "		new public const int $formattedString = $tokenValue;";
+	} else {
+		print DAT "		public const int $formattedString = $tokenValue;";
+	}
+	$tokenValue++;
+	
+}
+
+sub write_tokensfile {
+	print "  ->Generating Tokens class to file '$tokens_outfile'\n";
+	open(DAT,">$tokens_outfile") || die("Cannot Open File");
+	print DAT "// this file was autogenerated by a tool.\n";
+	print DAT "using System;\n";
+	print DAT "\n";
+	print DAT "namespace " . $properties{'Namespace'} . "\n";
+	print DAT "{\n";
+	print DAT "	public sealed class Tokens\n";
+	print DAT "	{\n";
+	$tokenValue = 0;
+	
+	print DAT "		// ----- terminal classes -----\n";
+	foreach (@terminals) {
+		$tokenName = $_;
+		write_token();
+		print DAT "\n";
+	}
+	print DAT "\n";
+	print DAT "		// ----- special character -----\n";
+	for ($i=0; $i <= $#special_chars; $i++) {
+		$tokenName = $special_chars[$i];
+		write_token();
+		print DAT " // $special_values[$i] \n";
+	}
+	print DAT "\n";
+	print DAT "		// ----- keywords -----\n";
+	foreach (@keywords) {
+		$tokenName = $_;
+		write_token();
+		print DAT "\n";
+	}
+	print DAT "\n";
+	
+	print DAT "		public static string GetTokenString(int token)\n";
+	print DAT "		{\n";
+	print DAT "			switch (token) {\n";
+	for ($i = 0; $i <= $#special_chars; $i++) {
+		print DAT "				case $special_chars[$i]:\n";
+		print DAT "					return \"$special_values[$i]\";\n";
+	}
+	foreach (@keywords) {
+		$up = ucfirst($_);
+		print DAT "				case $up:\n";
+		print DAT "					return \"$_\";\n";
+	}
+	
+	print DAT "			}\n";
+	print DAT "			throw new System.NotSupportedException(\"Unknown token:\" + token);\n";
+	print DAT "		}\n";
+	print DAT "	}\n";
+	
+	
+	
+	print DAT "}\n";
+	close(DAT);
+	print "  ->done.\n";
+}
+
+sub write_atgtokensfile {
+	print "  ->Generating ATG TOKENS section and writing it to file '$ATGTokensSection'\n";
+	open(DAT,">$ATGTokensSection") || die("Cannot Open File");
+	print DAT "/* START AUTOGENERATED TOKENS SECTION */\n";
+	print DAT "TOKENS\n";
+
+	print DAT "	/* ----- terminal classes ----- */\n";
+	print DAT "	/* EOF is 0 */\n";
+	foreach $term (@terminals) {
+		if ($term eq "EOF") {
+		} elsif ($term eq "Identifier") {
+			print DAT "\tident\n";
+		} else {
+			print DAT "\t$term\n";
+		}
+			
+	}
+	
+	print DAT "\n";
+	print DAT "	/* ----- special character ----- */\n";
+	foreach (@special_values) {
+		print DAT "\t\"$_\"\n";
+	}
+	print DAT "\n";
+	print DAT "	/* ----- keywords ----- */\n";
+	foreach (@keywords) {
+		print DAT "\t\"$_\"\n";
+	}
+
+	print DAT "/* END AUTOGENERATED TOKENS SECTION */\n";
+	close(DAT);
+	print "  ->done.\n";
+}
+

Added: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/keywordlist/CSharpKeywordList.txt
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/keywordlist/CSharpKeywordList.txt	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/keywordlist/CSharpKeywordList.txt	2004-03-21 06:22:28 UTC (rev 1213)
@@ -0,0 +1,151 @@
+# this list is used for autogeneration of:
+# - Keywords.cs
+# - Tokens.cs
+# - ATGTokensSection.txt - the TOKENS section of the ATG file
+
+# use BuildKeywords to generate the different lists.
+
+$Namespace=ICSharpCode.SharpRefactory.Parser
+$UpperCaseKeywords=False
+
+
+# TERMINAL_CLASSES
+EOF
+Identifier
+Literal
+
+# SPECIAL_CHARACTERS
+Assign = "="
+Plus = "+"
+Minus = "-"
+Times = "*"
+Div = "/"
+Mod = "%"
+		
+Colon = ":"
+Semicolon = ";"
+Question = "?"
+Comma = ","
+Dot = "."
+	
+OpenCurlyBrace = "{"
+CloseCurlyBrace = "}"
+
+OpenSquareBracket = "["
+CloseSquareBracket = "]"
+
+OpenParenthesis = "("
+CloseParenthesis = ")"
+
+GreaterThan = ">"
+LessThan = "<"
+		
+Not = "!"
+LogicalAnd = "&&"
+LogicalOr = "||"
+		
+BitwiseComplement = "~"
+BitwiseAnd = "&"
+BitwiseOr = "|"
+Xor = "^"
+
+Increment = "++"
+Decrement = "--"
+Equal = "=="
+NotEqual = "!="
+GreaterEqual = ">="
+LessEqual = "<="
+		
+ShiftLeft = "<<"
+ShiftRight = ">>"
+		
+PlusAssign = "+="
+MinusAssign = "-="
+TimesAssign = "*="
+DivAssign = "/="
+ModAssign = "%="
+BitwiseAndAssign = "&="
+BitwiseOrAssign = "|="
+XorAssign = "^="
+ShiftLeftAssign = "<<="
+ShiftRightAssign = ">>="
+Pointer = "->"
+
+# Keywordlist
+"abstract"
+"as"
+"base"
+"bool"
+"break"
+"byte"
+"case"
+"catch"
+"char"
+"checked"
+"class"
+"const"
+"continue"
+"decimal"
+"default"
+"delegate"
+"do"
+"double"
+"else"
+"enum"
+"event"
+"explicit"
+"extern"
+"false"
+"finally"
+"fixed"
+"float"
+"for"
+"foreach"
+"goto"
+"if"
+"implicit"
+"in"
+"int"
+"interface"
+"internal"
+"is"
+"lock"
+"long"
+"namespace"
+"new"
+"null"
+"object"
+"operator"
+"out"
+"override"
+"params"
+"private"
+"protected"
+"public"
+"readonly"
+"ref"
+"return"
+"sbyte"
+"sealed"
+"short"
+"sizeof"
+"stackalloc"
+"static"
+"string"
+"struct"
+"switch"
+"this"
+"throw"
+"true"
+"try"
+"typeof"
+"uint"
+"ulong"
+"unchecked"
+"unsafe"
+"ushort"
+"using"
+"virtual"
+"void"
+"volatile"
+"while"

Added: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/keywordlist/Keywords.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/keywordlist/Keywords.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/keywordlist/Keywords.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -0,0 +1,109 @@
+// this file was autogenerated by a tool.
+using System;
+using System.Collections;
+using System.Text;
+
+namespace ICSharpCode.SharpRefactory.Parser
+{
+	public class Keywords
+	{
+		static readonly string[] keywordList = {
+			"abstract",
+			"as",
+			"base",
+			"bool",
+			"break",
+			"byte",
+			"case",
+			"catch",
+			"char",
+			"checked",
+			"class",
+			"const",
+			"continue",
+			"decimal",
+			"default",
+			"delegate",
+			"do",
+			"double",
+			"else",
+			"enum",
+			"event",
+			"explicit",
+			"extern",
+			"false",
+			"finally",
+			"fixed",
+			"float",
+			"for",
+			"foreach",
+			"goto",
+			"if",
+			"implicit",
+			"in",
+			"int",
+			"interface",
+			"internal",
+			"is",
+			"lock",
+			"long",
+			"namespace",
+			"new",
+			"null",
+			"object",
+			"operator",
+			"out",
+			"override",
+			"params",
+			"private",
+			"protected",
+			"public",
+			"readonly",
+			"ref",
+			"return",
+			"sbyte",
+			"sealed",
+			"short",
+			"sizeof",
+			"stackalloc",
+			"static",
+			"string",
+			"struct",
+			"switch",
+			"this",
+			"throw",
+			"true",
+			"try",
+			"typeof",
+			"uint",
+			"ulong",
+			"unchecked",
+			"unsafe",
+			"ushort",
+			"using",
+			"virtual",
+			"void",
+			"volatile",
+			"while"
+		};
+		
+		static Hashtable keywords = new Hashtable();
+		
+		static Keywords()
+		{
+			for (int i = 0; i < keywordList.Length; ++i) {
+				keywords.Add(keywordList[i], i + Tokens.Abstract);
+			}
+		}
+		
+		public static bool IsKeyword(string identifier)
+		{
+			return keywords[identifier] != null;
+		}
+		
+		public static int GetToken(string keyword)
+		{
+			return (int)keywords[keyword];
+		}
+	}
+}

Added: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/keywordlist/Tokens.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/keywordlist/Tokens.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/generated/keywordlist/Tokens.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -0,0 +1,390 @@
+// this file was autogenerated by a tool.
+using System;
+
+namespace ICSharpCode.SharpRefactory.Parser
+{
+	public sealed class Tokens
+	{
+		// ----- terminal classes -----
+		public const int EOF                  = 0;
+		public const int Identifier           = 1;
+		public const int Literal              = 2;
+
+		// ----- special character -----
+		public const int Assign               = 3; // = 
+		public const int Plus                 = 4; // + 
+		public const int Minus                = 5; // - 
+		public const int Times                = 6; // * 
+		public const int Div                  = 7; // / 
+		public const int Mod                  = 8; // % 
+		public const int Colon                = 9; // : 
+		public const int Semicolon            = 10; // ; 
+		public const int Question             = 11; // ? 
+		public const int Comma                = 12; // , 
+		public const int Dot                  = 13; // . 
+		public const int OpenCurlyBrace       = 14; // { 
+		public const int CloseCurlyBrace      = 15; // } 
+		public const int OpenSquareBracket    = 16; // [ 
+		public const int CloseSquareBracket   = 17; // ] 
+		public const int OpenParenthesis      = 18; // ( 
+		public const int CloseParenthesis     = 19; // ) 
+		public const int GreaterThan          = 20; // > 
+		public const int LessThan             = 21; // < 
+		public const int Not                  = 22; // ! 
+		public const int LogicalAnd           = 23; // && 
+		public const int LogicalOr            = 24; // || 
+		public const int BitwiseComplement    = 25; // ~ 
+		public const int BitwiseAnd           = 26; // & 
+		public const int BitwiseOr            = 27; // | 
+		public const int Xor                  = 28; // ^ 
+		public const int Increment            = 29; // ++ 
+		public const int Decrement            = 30; // -- 
+		public const int Equal                = 31; // == 
+		public const int NotEqual             = 32; // != 
+		public const int GreaterEqual         = 33; // >= 
+		public const int LessEqual            = 34; // <= 
+		public const int ShiftLeft            = 35; // << 
+		public const int ShiftRight           = 36; // >> 
+		public const int PlusAssign           = 37; // += 
+		public const int MinusAssign          = 38; // -= 
+		public const int TimesAssign          = 39; // *= 
+		public const int DivAssign            = 40; // /= 
+		public const int ModAssign            = 41; // %= 
+		public const int BitwiseAndAssign     = 42; // &= 
+		public const int BitwiseOrAssign      = 43; // |= 
+		public const int XorAssign            = 44; // ^= 
+		public const int ShiftLeftAssign      = 45; // <<= 
+		public const int ShiftRightAssign     = 46; // >>= 
+		public const int Pointer              = 47; // -> 
+
+		// ----- keywords -----
+		public const int Abstract             = 48;
+		public const int As                   = 49;
+		public const int Base                 = 50;
+		public const int Bool                 = 51;
+		public const int Break                = 52;
+		public const int Byte                 = 53;
+		public const int Case                 = 54;
+		public const int Catch                = 55;
+		public const int Char                 = 56;
+		public const int Checked              = 57;
+		public const int Class                = 58;
+		public const int Const                = 59;
+		public const int Continue             = 60;
+		public const int Decimal              = 61;
+		public const int Default              = 62;
+		public const int Delegate             = 63;
+		public const int Do                   = 64;
+		public const int Double               = 65;
+		public const int Else                 = 66;
+		public const int Enum                 = 67;
+		public const int Event                = 68;
+		public const int Explicit             = 69;
+		public const int Extern               = 70;
+		public const int False                = 71;
+		public const int Finally              = 72;
+		public const int Fixed                = 73;
+		public const int Float                = 74;
+		public const int For                  = 75;
+		public const int Foreach              = 76;
+		public const int Goto                 = 77;
+		public const int If                   = 78;
+		public const int Implicit             = 79;
+		public const int In                   = 80;
+		public const int Int                  = 81;
+		public const int Interface            = 82;
+		public const int Internal             = 83;
+		public const int Is                   = 84;
+		public const int Lock                 = 85;
+		public const int Long                 = 86;
+		public const int Namespace            = 87;
+		public const int New                  = 88;
+		public const int Null                 = 89;
+		public const int Object               = 90;
+		public const int Operator             = 91;
+		public const int Out                  = 92;
+		public const int Override             = 93;
+		public const int Params               = 94;
+		public const int Private              = 95;
+		public const int Protected            = 96;
+		public const int Public               = 97;
+		public const int Readonly             = 98;
+		public const int Ref                  = 99;
+		public const int Return               = 100;
+		public const int Sbyte                = 101;
+		public const int Sealed               = 102;
+		public const int Short                = 103;
+		public const int Sizeof               = 104;
+		public const int Stackalloc           = 105;
+		public const int Static               = 106;
+		public const int String               = 107;
+		public const int Struct               = 108;
+		public const int Switch               = 109;
+		public const int This                 = 110;
+		public const int Throw                = 111;
+		public const int True                 = 112;
+		public const int Try                  = 113;
+		public const int Typeof               = 114;
+		public const int Uint                 = 115;
+		public const int Ulong                = 116;
+		public const int Unchecked            = 117;
+		public const int Unsafe               = 118;
+		public const int Ushort               = 119;
+		public const int Using                = 120;
+		public const int Virtual              = 121;
+		public const int Void                 = 122;
+		public const int Volatile             = 123;
+		public const int While                = 124;
+
+		public static string GetTokenString(int token)
+		{
+			switch (token) {
+				case Assign:
+					return "=";
+				case Plus:
+					return "+";
+				case Minus:
+					return "-";
+				case Times:
+					return "*";
+				case Div:
+					return "/";
+				case Mod:
+					return "%";
+				case Colon:
+					return ":";
+				case Semicolon:
+					return ";";
+				case Question:
+					return "?";
+				case Comma:
+					return ",";
+				case Dot:
+					return ".";
+				case OpenCurlyBrace:
+					return "{";
+				case CloseCurlyBrace:
+					return "}";
+				case OpenSquareBracket:
+					return "[";
+				case CloseSquareBracket:
+					return "]";
+				case OpenParenthesis:
+					return "(";
+				case CloseParenthesis:
+					return ")";
+				case GreaterThan:
+					return ">";
+				case LessThan:
+					return "<";
+				case Not:
+					return "!";
+				case LogicalAnd:
+					return "&&";
+				case LogicalOr:
+					return "||";
+				case BitwiseComplement:
+					return "~";
+				case BitwiseAnd:
+					return "&";
+				case BitwiseOr:
+					return "|";
+				case Xor:
+					return "^";
+				case Increment:
+					return "++";
+				case Decrement:
+					return "--";
+				case Equal:
+					return "==";
+				case NotEqual:
+					return "!=";
+				case GreaterEqual:
+					return ">=";
+				case LessEqual:
+					return "<=";
+				case ShiftLeft:
+					return "<<";
+				case ShiftRight:
+					return ">>";
+				case PlusAssign:
+					return "+=";
+				case MinusAssign:
+					return "-=";
+				case TimesAssign:
+					return "*=";
+				case DivAssign:
+					return "/=";
+				case ModAssign:
+					return "%=";
+				case BitwiseAndAssign:
+					return "&=";
+				case BitwiseOrAssign:
+					return "|=";
+				case XorAssign:
+					return "^=";
+				case ShiftLeftAssign:
+					return "<<=";
+				case ShiftRightAssign:
+					return ">>=";
+				case Pointer:
+					return "->";
+				case Abstract:
+					return "abstract";
+				case As:
+					return "as";
+				case Base:
+					return "base";
+				case Bool:
+					return "bool";
+				case Break:
+					return "break";
+				case Byte:
+					return "byte";
+				case Case:
+					return "case";
+				case Catch:
+					return "catch";
+				case Char:
+					return "char";
+				case Checked:
+					return "checked";
+				case Class:
+					return "class";
+				case Const:
+					return "const";
+				case Continue:
+					return "continue";
+				case Decimal:
+					return "decimal";
+				case Default:
+					return "default";
+				case Delegate:
+					return "delegate";
+				case Do:
+					return "do";
+				case Double:
+					return "double";
+				case Else:
+					return "else";
+				case Enum:
+					return "enum";
+				case Event:
+					return "event";
+				case Explicit:
+					return "explicit";
+				case Extern:
+					return "extern";
+				case False:
+					return "false";
+				case Finally:
+					return "finally";
+				case Fixed:
+					return "fixed";
+				case Float:
+					return "float";
+				case For:
+					return "for";
+				case Foreach:
+					return "foreach";
+				case Goto:
+					return "goto";
+				case If:
+					return "if";
+				case Implicit:
+					return "implicit";
+				case In:
+					return "in";
+				case Int:
+					return "int";
+				case Interface:
+					return "interface";
+				case Internal:
+					return "internal";
+				case Is:
+					return "is";
+				case Lock:
+					return "lock";
+				case Long:
+					return "long";
+				case Namespace:
+					return "namespace";
+				case New:
+					return "new";
+				case Null:
+					return "null";
+				case Object:
+					return "object";
+				case Operator:
+					return "operator";
+				case Out:
+					return "out";
+				case Override:
+					return "override";
+				case Params:
+					return "params";
+				case Private:
+					return "private";
+				case Protected:
+					return "protected";
+				case Public:
+					return "public";
+				case Readonly:
+					return "readonly";
+				case Ref:
+					return "ref";
+				case Return:
+					return "return";
+				case Sbyte:
+					return "sbyte";
+				case Sealed:
+					return "sealed";
+				case Short:
+					return "short";
+				case Sizeof:
+					return "sizeof";
+				case Stackalloc:
+					return "stackalloc";
+				case Static:
+					return "static";
+				case String:
+					return "string";
+				case Struct:
+					return "struct";
+				case Switch:
+					return "switch";
+				case This:
+					return "this";
+				case Throw:
+					return "throw";
+				case True:
+					return "true";
+				case Try:
+					return "try";
+				case Typeof:
+					return "typeof";
+				case Uint:
+					return "uint";
+				case Ulong:
+					return "ulong";
+				case Unchecked:
+					return "unchecked";
+				case Unsafe:
+					return "unsafe";
+				case Ushort:
+					return "ushort";
+				case Using:
+					return "using";
+				case Virtual:
+					return "virtual";
+				case Void:
+					return "void";
+				case Volatile:
+					return "volatile";
+				case While:
+					return "while";
+			}
+			return "<unknown>";
+		}
+	}
+}

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/PrettyPrinter/OutputFormatter.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/PrettyPrinter/OutputFormatter.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/PrettyPrinter/OutputFormatter.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -20,22 +20,50 @@
 using System.Collections;
 using System.Diagnostics;
 
-using MonoDevelop.SharpRefactory.Parser;
-using MonoDevelop.SharpRefactory.Parser.AST;
+using ICSharpCode.SharpRefactory.Parser;
+using ICSharpCode.SharpRefactory.Parser.AST;
 
-namespace MonoDevelop.SharpRefactory.PrettyPrinter
+namespace ICSharpCode.SharpRefactory.PrettyPrinter
 {
 	public class OutputFormatter
 	{
-		int indentationLevel     = 0;
-		StringBuilder text       = new StringBuilder();
-		
+		int           indentationLevel = 0;
+		StringBuilder text             = new StringBuilder();
+		Lexer         lexer; 
+		bool          indent       = true;
+		bool          doNewLine      = true;
+		bool          emitSemicolon = true;
 		public string Text {
 			get {
 				return text.ToString();
 			}
 		}
 		
+		public bool DoIndent {
+			get {
+				return indent;
+			}
+			set {
+				indent = value;
+			}
+		}
+		public bool DoNewLine {
+			get {
+				return doNewLine;
+			}
+			set {
+				doNewLine = value;
+			}
+		}
+		public bool EmitSemicolon {
+			get {
+				return emitSemicolon;
+			}
+			set {
+				emitSemicolon = value;
+			}
+		}
+		
 		public int IndentationLevel {
 			get {
 				return indentationLevel;
@@ -44,11 +72,20 @@
 				indentationLevel = value;
 			}
 		}
+		Token token;
+		public OutputFormatter(string originalSourceFile)
+		{
+			lexer = new Lexer(new StringReader(originalSourceFile));
+//			token = lexer.NextToken();
+//			PrintSpecials(token.kind);
+		}
 		
 		public void Indent()
 		{
-			for (int i = 0; i < indentationLevel; ++i) {
-				text.Append('\t');
+			if (DoIndent) {
+				for (int i = 0; i < indentationLevel; ++i) {
+					text.Append('\t');
+				}
 			}
 		}
 		
@@ -56,24 +93,127 @@
 		{
 			text.Append(' ');
 		}
+		bool gotBlankLine  = false;
+		int currentSpecial = 0;
 		
+		void PrintSpecials(int tokenKind)
+		{
+			if (currentSpecial >= lexer.SpecialTracker.CurrentSpecials.Count) {
+				return;
+			}
+			object o = lexer.SpecialTracker.CurrentSpecials[currentSpecial++];
+			if (o is Comment) {
+//				Console.WriteLine("COMMENT " + o);	
+				Comment comment = (Comment)o;
+				switch (comment.CommentType) {
+					case CommentType.SingleLine:
+						text.Append("//");	
+						text.Append(comment.CommentText);	
+						text.Append("\n");
+						Indent();
+						break;
+					case CommentType.Documentation:
+						text.Append("///");	
+						text.Append(comment.CommentText);	
+						text.Append("\n");	
+						Indent();
+						break;
+					case CommentType.Block:
+						text.Append("/*");	
+						text.Append(comment.CommentText);	
+						text.Append("*/\n");	
+						Indent();
+						break;
+				}
+				PrintSpecials(tokenKind);
+			} else if (o is BlankLine) {
+				if (!gotBlankLine) {
+//						text.Append("\n");
+//						Indent();
+				} 
+				gotBlankLine = false;
+				PrintSpecials(tokenKind);
+			} else if (o is PreProcessingDirective) { 
+//				Console.WriteLine("PPD:" + o);	
+				text.Append("\n");
+				PreProcessingDirective ppd = (PreProcessingDirective)o;
+				text.Append(ppd.Cmd);
+				if (ppd.Arg != null && ppd.Arg.Length > 0) {
+					text.Append(" ");
+					text.Append(ppd.Arg);
+				}
+				text.Append("\n");
+				Indent();
+				PrintSpecials(tokenKind);
+			} else {
+				int kind = (int)o;
+//				Console.WriteLine(kind + " -- " + Tokens.GetTokenString(kind));
+				if (kind != tokenKind) {
+					PrintSpecials(tokenKind);
+				}
+			}
+		}
+		
 		public void NewLine()
 		{
-			text.Append("\n");
+			if (DoNewLine) {
+				text.Append("\n");
+				gotBlankLine = true;
+			}
 		}
 		
+		public void EndFile()
+		{
+			while (this.token == null || this.token.kind > 0) {
+				this.token = lexer.NextToken();
+				PrintSpecials(token.kind);
+			}
+			PrintSpecials(-1);
+//			foreach (object o in lexer.SpecialTracker.CurrentSpecials) {
+//				Console.WriteLine(o);
+//			}
+		}
+		
+		public void PrintTokenList(ArrayList tokenList)
+		{
+			ArrayList trackList = (ArrayList)tokenList.Clone();
+			while (this.token == null || trackList.Count > 0) {
+				this.token = lexer.NextToken();
+				PrintSpecials(this.token.kind);
+				for (int i = 0; i < trackList.Count; ++i) {
+					trackList.RemoveAt(i);
+					break;
+				}
+			}
+			foreach (int token in tokenList) {
+				text.Append(Tokens.GetTokenString(token));
+				Space();
+			}
+		}
+		
 		public void PrintToken(int token)
 		{
+//			Console.WriteLine("PRINT TOKEN:" + token);
+			if (token == Tokens.Semicolon && !EmitSemicolon) {
+				return;
+			}
+			while (this.token == null || this.token.kind > 0) {
+				this.token = lexer.NextToken();
+				PrintSpecials(this.token.kind);
+				if (this.token.kind == token) {
+					break;
+				}
+			}
+			text.Append(Tokens.GetTokenString(token));
+			gotBlankLine = false;
 		}
 		
+		
 		public void PrintIdentifier(string identifier)
 		{
+			this.token = lexer.NextToken();
+			PrintSpecials(token.kind);
 			text.Append(identifier);
 		}
-		
-		public void PrintTrailingComment()
-		{
-			
-		}
 	}
 }

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/PrettyPrinter/PrettyPrintData.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/PrettyPrinter/PrettyPrintData.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/PrettyPrinter/PrettyPrintData.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -17,10 +17,10 @@
 
 using System;
 using System.Text;
-using MonoDevelop.SharpRefactory.Parser;
-using MonoDevelop.SharpRefactory.Parser.AST;
+using ICSharpCode.SharpRefactory.Parser;
+using ICSharpCode.SharpRefactory.Parser.AST;
 
-namespace MonoDevelop.SharpRefactory.PrettyPrinter
+namespace ICSharpCode.SharpRefactory.PrettyPrinter
 {
 	/*
 	public class PrettyPrintData

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/PrettyPrinter/PrettyPrintUtil.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/PrettyPrinter/PrettyPrintUtil.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/PrettyPrinter/PrettyPrintUtil.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -19,10 +19,10 @@
 using System.Collections;
 using System.Diagnostics;
 
-using MonoDevelop.SharpRefactory.Parser;
-using MonoDevelop.SharpRefactory.Parser.AST;
+using ICSharpCode.SharpRefactory.Parser;
+using ICSharpCode.SharpRefactory.Parser.AST;
 
-namespace MonoDevelop.SharpRefactory.PrettyPrinter
+namespace ICSharpCode.SharpRefactory.PrettyPrinter
 {
 	/*
 	public sealed class PrettyPrintUtil

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/PrettyPrinter/PrettyPrintVisitor.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/PrettyPrinter/PrettyPrintVisitor.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/PrettyPrinter/PrettyPrintVisitor.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -20,15 +20,15 @@
 using System.Collections;
 using System.Diagnostics;
 
-using MonoDevelop.SharpRefactory.Parser;
-using MonoDevelop.SharpRefactory.Parser.AST;
+using ICSharpCode.SharpRefactory.Parser;
+using ICSharpCode.SharpRefactory.Parser.AST;
 
-namespace MonoDevelop.SharpRefactory.PrettyPrinter
+namespace ICSharpCode.SharpRefactory.PrettyPrinter
 {
-	public class PrettyPrintVisitor : IASTVisitor
+	public class PrettyPrintVisitor : AbstractASTVisitor
 	{
 		Errors  errors = new Errors();
-		OutputFormatter outputFormatter = new OutputFormatter();
+		OutputFormatter outputFormatter;
 		
 		public string Text {
 			get {
@@ -41,13 +41,20 @@
 			}
 		}
 		
-		public object Visit(INode node, object data)
+		public PrettyPrintVisitor(string originalSourceFile)
 		{
-			errors.Error(-1, -1, String.Format("Visited INode (should NEVER HAPPEN) Node was : {0} ", node));
+			outputFormatter = new OutputFormatter(originalSourceFile);
+		}
+		
+		public override object Visit(INode node, object data)
+		{
+			errors.Error(-1, -1, String.Format("Visited INode (should NEVER HAPPEN)"));
+			Console.WriteLine("Visitor was: " + this.GetType());
+			Console.WriteLine("Node was : " + node.GetType());
 			return node.AcceptChildren(this, data);
 		}
 		
-		public object Visit(AttributeSection section, object data)
+		public override object Visit(AttributeSection section, object data)
 		{
 			outputFormatter.Indent();
 			outputFormatter.PrintToken(Tokens.OpenSquareBracket);
@@ -57,7 +64,8 @@
 				outputFormatter.Space();
 			}
 			Debug.Assert(section.Attributes != null);
-			foreach (MonoDevelop.SharpRefactory.Parser.AST.Attribute a in section.Attributes) {
+			for (int j = 0; j < section.Attributes.Count; ++j) {
+				ICSharpCode.SharpRefactory.Parser.AST.Attribute a = (ICSharpCode.SharpRefactory.Parser.AST.Attribute)section.Attributes[j];
 				outputFormatter.PrintIdentifier(a.Name);
 				outputFormatter.PrintToken(Tokens.OpenParenthesis);
 				this.AppendCommaSeparatedList(a.PositionalArguments);
@@ -81,32 +89,35 @@
 					}
 				}
 				outputFormatter.PrintToken(Tokens.CloseParenthesis);
+				if (j + 1 < section.Attributes.Count) {
+					outputFormatter.PrintToken(Tokens.Comma);
+					outputFormatter.Space();
+				}
 			}
 			outputFormatter.PrintToken(Tokens.CloseSquareBracket);
-			outputFormatter.PrintTrailingComment();
 			outputFormatter.NewLine();
 			return null;
 		}
 		
-		public object Visit(CompilationUnit compilationUnit, object data)
+		public override object Visit(CompilationUnit compilationUnit, object data)
 		{
 			compilationUnit.AcceptChildren(this, data);
+			outputFormatter.EndFile();
 			return null;
 		}
 		
-		public object Visit(UsingDeclaration usingDeclaration, object data)
+		public override object Visit(UsingDeclaration usingDeclaration, object data)
 		{
 			outputFormatter.Indent();
 			outputFormatter.PrintToken(Tokens.Using);
 			outputFormatter.Space();
 			outputFormatter.PrintIdentifier(usingDeclaration.Namespace);
 			outputFormatter.PrintToken(Tokens.Semicolon);
-			outputFormatter.PrintTrailingComment();
 			outputFormatter.NewLine();
 			return null;
 		}
 		
-		public object Visit(UsingAliasDeclaration usingAliasDeclaration, object data)
+		public override object Visit(UsingAliasDeclaration usingAliasDeclaration, object data)
 		{
 			outputFormatter.Indent();
 			outputFormatter.PrintToken(Tokens.Using);
@@ -117,12 +128,11 @@
 			outputFormatter.Space();
 			outputFormatter.PrintIdentifier(usingAliasDeclaration.Namespace);
 			outputFormatter.PrintToken(Tokens.Semicolon);
-			outputFormatter.PrintTrailingComment();
 			outputFormatter.NewLine();
 			return null;
 		}
 		
-		public object Visit(NamespaceDeclaration namespaceDeclaration, object data)
+		public override object Visit(NamespaceDeclaration namespaceDeclaration, object data)
 		{
 			outputFormatter.Indent();
 			outputFormatter.PrintToken(Tokens.Namespace);
@@ -143,49 +153,53 @@
 		
 		object VisitModifier(Modifier modifier)
 		{
+			ArrayList tokenList = new ArrayList();
 			if ((modifier & Modifier.Unsafe) != 0) {
-				outputFormatter.PrintToken(Tokens.Unsafe);
+				tokenList.Add(Tokens.Unsafe);
 			}
 			if ((modifier & Modifier.Public) != 0) {
-				outputFormatter.PrintToken(Tokens.Public);
+				tokenList.Add(Tokens.Public);
 			}
 			if ((modifier & Modifier.Private) != 0) {
-				outputFormatter.PrintToken(Tokens.Private);
+				tokenList.Add(Tokens.Private);
 			}
 			if ((modifier & Modifier.Protected) != 0) {
-				outputFormatter.PrintToken(Tokens.Protected);
+				tokenList.Add(Tokens.Protected);
 			}
 			if ((modifier & Modifier.Static) != 0) {
-				outputFormatter.PrintToken(Tokens.Static);
+				tokenList.Add(Tokens.Static);
 			}
 			if ((modifier & Modifier.Internal) != 0) {
-				outputFormatter.PrintToken(Tokens.Internal);
+				tokenList.Add(Tokens.Internal);
 			}
 			if ((modifier & Modifier.Override) != 0) {
-				outputFormatter.PrintToken(Tokens.Override);
+				tokenList.Add(Tokens.Override);
 			}
 			if ((modifier & Modifier.Abstract) != 0) {
-				outputFormatter.PrintToken(Tokens.Abstract);
+				tokenList.Add(Tokens.Abstract);
 			}
+			if ((modifier & Modifier.Virtual) != 0) {
+				tokenList.Add(Tokens.Virtual);
+			}
 			if ((modifier & Modifier.New) != 0) {
-				outputFormatter.PrintToken(Tokens.New);
+				tokenList.Add(Tokens.New);
 			}
 			if ((modifier & Modifier.Sealed) != 0) {
-				outputFormatter.PrintToken(Tokens.Sealed);
+				tokenList.Add(Tokens.Sealed);
 			}
 			if ((modifier & Modifier.Extern) != 0) {
-				outputFormatter.PrintToken(Tokens.Extern);
+				tokenList.Add(Tokens.Extern);
 			}
 			if ((modifier & Modifier.Const) != 0) {
-				outputFormatter.PrintToken(Tokens.Const);
+				tokenList.Add(Tokens.Const);
 			}
 			if ((modifier & Modifier.Readonly) != 0) {
-				outputFormatter.PrintToken(Tokens.Readonly);
+				tokenList.Add(Tokens.Readonly);
 			}
 			if ((modifier & Modifier.Volatile) != 0) {
-				outputFormatter.PrintToken(Tokens.Volatile);
+				tokenList.Add(Tokens.Volatile);
 			}
-			outputFormatter.Space();
+			outputFormatter.PrintTokenList(tokenList);
 			return null;
 		}
 				
@@ -254,9 +268,10 @@
 			return null;
 		}
 		
-		public object Visit(TypeDeclaration typeDeclaration, object data)
+		public override object Visit(TypeDeclaration typeDeclaration, object data)
 		{
 			VisitAttributes(typeDeclaration.Attributes, data);
+			outputFormatter.Indent();
 			VisitModifier(typeDeclaration.Modifier);
 			switch (typeDeclaration.Type) {
 				case Types.Class:
@@ -275,10 +290,15 @@
 			outputFormatter.Space();
 			outputFormatter.PrintIdentifier(typeDeclaration.Name);
 			if (typeDeclaration.BaseTypes != null && typeDeclaration.BaseTypes.Count > 0) {
+				outputFormatter.Space();
 				outputFormatter.PrintToken(Tokens.Colon);
 				for (int i = 0; i < typeDeclaration.BaseTypes.Count; ++i) {
 					outputFormatter.Space();
 					outputFormatter.PrintIdentifier(typeDeclaration.BaseTypes[i]);
+					if (i + 1 < typeDeclaration.BaseTypes.Count) {
+						outputFormatter.PrintToken(Tokens.Comma);
+						outputFormatter.Space();
+					}
 				}
 			}
 			outputFormatter.NewLine();
@@ -299,7 +319,7 @@
 			return null;
 		}
 		
-		public object Visit(ParameterDeclarationExpression parameterDeclarationExpression, object data)
+		public override object Visit(ParameterDeclarationExpression parameterDeclarationExpression, object data)
 		{
 			VisitAttributes(parameterDeclarationExpression.Attributes, data);
 			VisitParamModifiers(parameterDeclarationExpression.ParamModifiers);
@@ -309,7 +329,7 @@
 			return null;
 		}
 		
-		public object Visit(DelegateDeclaration delegateDeclaration, object data)
+		public override object Visit(DelegateDeclaration delegateDeclaration, object data)
 		{
 			VisitAttributes(delegateDeclaration.Attributes, data);
 			VisitModifier(delegateDeclaration.Modifier);
@@ -326,7 +346,7 @@
 			return null;
 		}
 		
-		public object Visit(VariableDeclaration variableDeclaration, object data)
+		public override object Visit(VariableDeclaration variableDeclaration, object data)
 		{
 			outputFormatter.PrintIdentifier(variableDeclaration.Name);
 			if (variableDeclaration.Initializer != null) {
@@ -347,976 +367,1202 @@
 						outputFormatter.PrintToken(Tokens.Comma);
 						outputFormatter.Space();
 					}
+					if ((i + 1) % 10 == 0) {
+						outputFormatter.NewLine();
+						outputFormatter.Indent();
+					}
 				}
 			}
 		}
 		
-		public object Visit(EventDeclaration eventDeclaration, object data)
+		public override object Visit(EventDeclaration eventDeclaration, object data)
 		{
-//			VisitAttributes(eventDeclaration.Attributes, data);
-//			VisitModifier(eventDeclaration.Modifier);
-//			text.Append("event ");
-//			Visit(eventDeclaration.TypeReference, data);
-//			text.Append(' ');
-//			if (eventDeclaration.VariableDeclarators != null && eventDeclaration.VariableDeclarators.Count > 0) {
-//				AppendCommaSeparatedList(eventDeclaration.VariableDeclarators);
-//				text.Append(";\n");
-//			} else {
-//				text.Append(eventDeclaration.Name);
-//				text.Append(" {\n");
-//				++indentationLevel;
-//				if (eventDeclaration.AddRegion != null) {
-//					eventDeclaration.AddRegion.AcceptVisitor(this, data);
-//				}
-//				if (eventDeclaration.RemoveRegion != null) {
-//					eventDeclaration.RemoveRegion.AcceptVisitor(this, data);
-//				}
-//				--indentationLevel;
-//				Indent();
-//				text.Append("}\n");
-//			}
+			VisitAttributes(eventDeclaration.Attributes, data);
+			outputFormatter.Indent();
+			VisitModifier(eventDeclaration.Modifier);
+			outputFormatter.PrintToken(Tokens.Event);
+			outputFormatter.Space();
+			Visit(eventDeclaration.TypeReference, data);
+			outputFormatter.Space();
+			
+			if (eventDeclaration.VariableDeclarators != null && eventDeclaration.VariableDeclarators.Count > 0) {
+				AppendCommaSeparatedList(eventDeclaration.VariableDeclarators);
+				outputFormatter.PrintToken(Tokens.Semicolon);
+				outputFormatter.NewLine();
+			} else {
+				outputFormatter.PrintIdentifier(eventDeclaration.Name);
+				if (eventDeclaration.AddRegion == null && eventDeclaration.RemoveRegion == null) {
+					outputFormatter.PrintToken(Tokens.Semicolon);
+				} else {
+					outputFormatter.Space();
+					outputFormatter.PrintToken(Tokens.OpenCurlyBrace);
+					outputFormatter.NewLine();
+					++outputFormatter.IndentationLevel;
+					if (eventDeclaration.AddRegion != null) {
+						eventDeclaration.AddRegion.AcceptVisitor(this, data);
+					}
+					if (eventDeclaration.RemoveRegion != null) {
+						eventDeclaration.RemoveRegion.AcceptVisitor(this, data);
+					}
+					--outputFormatter.IndentationLevel;
+					outputFormatter.Indent();
+					outputFormatter.PrintToken(Tokens.CloseCurlyBrace);
+				}
+				outputFormatter.NewLine();
+			}
 			return null;
 		}
 		
-		public object Visit(EventAddRegion addRegion, object data)
+		public override object Visit(EventAddRegion addRegion, object data)
 		{
-//			this.VisitAttributes(addRegion.Attributes, data);
-//			Indent();
-//			VisitAttributes(addRegion.Attributes, data);
-//			text.Append("add {\n");
-//			++indentationLevel;
-//			addRegion.Block.AcceptVisitor(this, false);
-//			--indentationLevel;
-//			Indent();
-//			text.Append("}\n");
+			VisitAttributes(addRegion.Attributes, data);
+			outputFormatter.Indent();
+			outputFormatter.PrintIdentifier("add");
+			if (addRegion.Block == null) {
+				outputFormatter.PrintToken(Tokens.Semicolon);
+			} else {
+				outputFormatter.Space();
+				outputFormatter.PrintToken(Tokens.OpenCurlyBrace);
+				outputFormatter.NewLine();
+				++outputFormatter.IndentationLevel;
+				addRegion.Block.AcceptChildren(this, false);
+				--outputFormatter.IndentationLevel;
+				outputFormatter.Indent();
+				outputFormatter.PrintToken(Tokens.CloseCurlyBrace);
+			}
+			outputFormatter.NewLine();
 			return null;
 		}
 		
-		public object Visit(EventRemoveRegion removeRegion, object data)
+		public override object Visit(EventRemoveRegion removeRegion, object data)
 		{
-//			this.VisitAttributes(removeRegion.Attributes, data);
-//			Indent();
-//			VisitAttributes(removeRegion.Attributes, data);
-//			text.Append("remove {\n");
-//			++indentationLevel;
-//			removeRegion.Block.AcceptVisitor(this, false);
-//			--indentationLevel;
-//			Indent();
-//			text.Append("}\n");
+			VisitAttributes(removeRegion.Attributes, data);
+			outputFormatter.Indent();
+			outputFormatter.PrintIdentifier("remove");
+			if (removeRegion.Block == null) {
+				outputFormatter.PrintToken(Tokens.Semicolon);
+			} else {
+				outputFormatter.Space();
+				outputFormatter.PrintToken(Tokens.OpenCurlyBrace);
+				outputFormatter.NewLine();
+				++outputFormatter.IndentationLevel;
+				removeRegion.Block.AcceptChildren(this, false);
+				--outputFormatter.IndentationLevel;
+				outputFormatter.Indent();
+				outputFormatter.PrintToken(Tokens.CloseCurlyBrace);
+			}
+			outputFormatter.NewLine();
 			return null;
 		}
 		
-		public object Visit(FieldDeclaration fieldDeclaration, object data)
+		public override object Visit(FieldDeclaration fieldDeclaration, object data)
 		{
-//			VisitAttributes(fieldDeclaration.Attributes, data);
-//			VisitModifier(fieldDeclaration.Modifier);
-//			Visit(fieldDeclaration.TypeReference, data);
-//			text.Append(' ');
-//			AppendCommaSeparatedList(fieldDeclaration.Fields);
-//			text.Append(";\n");
+			VisitAttributes(fieldDeclaration.Attributes, data);
+			outputFormatter.Indent();
+			VisitModifier(fieldDeclaration.Modifier);
+			Visit(fieldDeclaration.TypeReference, data);
+			outputFormatter.Space();
+			AppendCommaSeparatedList(fieldDeclaration.Fields);
+			outputFormatter.PrintToken(Tokens.Semicolon);
+			outputFormatter.NewLine();
 			return null;
 		}
 		
-		public object Visit(ConstructorDeclaration constructorDeclaration, object data)
+		public override object Visit(ConstructorDeclaration constructorDeclaration, object data)
 		{
-//			VisitAttributes(constructorDeclaration.Attributes, data);
-//			VisitModifier(constructorDeclaration.Modifier);
-//			text.Append(constructorDeclaration.Name);
-//			text.Append('(');
-//			AppendCommaSeparatedList(constructorDeclaration.Parameters);
-//			text.Append(")\n");
-//			Indent();
-//			text.Append("{\n");
-//			++indentationLevel;
-//			constructorDeclaration.Body.AcceptChildren(this, data);
-//			--indentationLevel;
-//			Indent();
-//			text.Append("}\n");
+			VisitAttributes(constructorDeclaration.Attributes, data);
+			outputFormatter.Indent();
+			VisitModifier(constructorDeclaration.Modifier);
+			outputFormatter.PrintIdentifier(constructorDeclaration.Name);
+			outputFormatter.PrintToken(Tokens.OpenParenthesis);
+			AppendCommaSeparatedList(constructorDeclaration.Parameters);
+			outputFormatter.PrintToken(Tokens.CloseParenthesis);
+			
+			if (constructorDeclaration.ConstructorInitializer != null) {
+				outputFormatter.Space();
+				outputFormatter.PrintToken(Tokens.Colon);
+				outputFormatter.Space();
+				if (constructorDeclaration.ConstructorInitializer.ConstructorInitializerType == ConstructorInitializerType.Base) {
+					outputFormatter.PrintToken(Tokens.Base);
+				} else {
+					outputFormatter.PrintToken(Tokens.This);
+				}
+				outputFormatter.PrintToken(Tokens.OpenParenthesis);
+				AppendCommaSeparatedList(constructorDeclaration.ConstructorInitializer.Arguments);
+				outputFormatter.PrintToken(Tokens.CloseParenthesis);
+			}
+			
+			outputFormatter.NewLine();
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.OpenCurlyBrace);
+			outputFormatter.NewLine();
+			++outputFormatter.IndentationLevel;
+			constructorDeclaration.Body.AcceptChildren(this, data);
+			--outputFormatter.IndentationLevel;
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.CloseCurlyBrace);
+			outputFormatter.NewLine();
 			return null;
 		}
 		
-		public object Visit(DestructorDeclaration destructorDeclaration, object data)
+		public override object Visit(DestructorDeclaration destructorDeclaration, object data)
 		{
-//			VisitAttributes(destructorDeclaration.Attributes, data);
-//			VisitModifier(destructorDeclaration.Modifier);
-//			text.Append('~');
-//			text.Append(destructorDeclaration.Name);
-//			text.Append('(');
-//			text.Append(")\n");
-//			Indent();
-//			text.Append("{\n");
-//			++indentationLevel;
-//			destructorDeclaration.Body.AcceptChildren(this, data);
-//			--indentationLevel;
-//			Indent();
-//			text.Append("}\n");
+			VisitAttributes(destructorDeclaration.Attributes, data);
+			outputFormatter.Indent();
+			VisitModifier(destructorDeclaration.Modifier);
+			outputFormatter.PrintToken(Tokens.BitwiseComplement);
+			outputFormatter.PrintIdentifier(destructorDeclaration.Name);
+			outputFormatter.PrintToken(Tokens.OpenParenthesis);
+			outputFormatter.PrintToken(Tokens.CloseParenthesis);
+			outputFormatter.NewLine();
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.OpenCurlyBrace);
+			outputFormatter.NewLine();
+			++outputFormatter.IndentationLevel;
+			destructorDeclaration.Body.AcceptChildren(this, data);
+			--outputFormatter.IndentationLevel;
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.CloseCurlyBrace);
+			outputFormatter.NewLine();
 			return null;
 		}
 		
-		public object Visit(MethodDeclaration methodDeclaration, object data)
+		public override object Visit(MethodDeclaration methodDeclaration, object data)
 		{
-//			VisitAttributes(methodDeclaration.Attributes, data);
-//			VisitModifier(methodDeclaration.Modifier);
-//			Visit(methodDeclaration.TypeReference, data);
-//			text.Append(' ');
-//			text.Append(methodDeclaration.Name);
-//			text.Append('(');
-//			AppendCommaSeparatedList(methodDeclaration.Parameters);
-//			text.Append(")\n");
-//			Indent();
-//			text.Append("{\n");
-//			++indentationLevel;
-//			methodDeclaration.Body.AcceptChildren(this, data);
-//			--indentationLevel;
-//			Indent();
-//			text.Append("}\n");
+			VisitAttributes(methodDeclaration.Attributes, data);
+			outputFormatter.Indent();
+			VisitModifier(methodDeclaration.Modifier);
+			Visit(methodDeclaration.TypeReference, data);
+			outputFormatter.Space();
+			outputFormatter.PrintIdentifier(methodDeclaration.Name);
+			outputFormatter.PrintToken(Tokens.OpenParenthesis);
+			AppendCommaSeparatedList(methodDeclaration.Parameters);
+			outputFormatter.PrintToken(Tokens.CloseParenthesis);
+			if (methodDeclaration.Body == null) {
+				outputFormatter.PrintToken(Tokens.Semicolon);
+			} else {
+				outputFormatter.NewLine();
+				outputFormatter.Indent();
+				outputFormatter.PrintToken(Tokens.OpenCurlyBrace);
+				outputFormatter.NewLine();
+				++outputFormatter.IndentationLevel;
+				methodDeclaration.Body.AcceptChildren(this, data);
+				--outputFormatter.IndentationLevel;
+				outputFormatter.Indent();
+				outputFormatter.PrintToken(Tokens.CloseCurlyBrace);
+			}
+			outputFormatter.NewLine();
 			return null;
 		}
 		
-		public object Visit(IndexerDeclaration indexerDeclaration, object data)
+		public override object Visit(IndexerDeclaration indexerDeclaration, object data)
 		{
-//			VisitAttributes(indexerDeclaration.Attributes, data);
-//			VisitModifier(indexerDeclaration.Modifier);
-//			Visit(indexerDeclaration.TypeReference, data);
-//			text.Append(' ');
-//			if (indexerDeclaration.NamespaceName != null && indexerDeclaration.NamespaceName.Length > 0) {
-//				text.Append(indexerDeclaration.NamespaceName);
-//				text.Append('.');
-//			}
-//			text.Append("this[");
-//			AppendCommaSeparatedList(indexerDeclaration.Parameters);
-//			text.Append("]\n");
-//			Indent();
-//			text.Append("{\n");
-//			++indentationLevel;
-//			if (indexerDeclaration.GetRegion != null) {
-//				indexerDeclaration.GetRegion.AcceptVisitor(this, data);
-//			}
-//			if (indexerDeclaration.SetRegion != null) {
-//				indexerDeclaration.SetRegion.AcceptVisitor(this, data);
-//			}
-//			--indentationLevel;
-//			Indent();
-//			text.Append("}\n");
+			VisitAttributes(indexerDeclaration.Attributes, data);
+			outputFormatter.Indent();
+			VisitModifier(indexerDeclaration.Modifier);
+			Visit(indexerDeclaration.TypeReference, data);
+			outputFormatter.Space();
+			if (indexerDeclaration.NamespaceName != null && indexerDeclaration.NamespaceName.Length > 0) {
+				outputFormatter.PrintIdentifier(indexerDeclaration.NamespaceName);
+				outputFormatter.PrintToken(Tokens.Dot);
+			}
+			outputFormatter.PrintToken(Tokens.This);
+			outputFormatter.PrintToken(Tokens.OpenSquareBracket);
+			AppendCommaSeparatedList(indexerDeclaration.Parameters);
+			outputFormatter.PrintToken(Tokens.CloseSquareBracket);
+			outputFormatter.NewLine();
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.OpenCurlyBrace);
+			outputFormatter.NewLine();
+			++outputFormatter.IndentationLevel;
+			if (indexerDeclaration.GetRegion != null) {
+				indexerDeclaration.GetRegion.AcceptVisitor(this, data);
+			}
+			if (indexerDeclaration.SetRegion != null) {
+				indexerDeclaration.SetRegion.AcceptVisitor(this, data);
+			}
+			--outputFormatter.IndentationLevel;
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.CloseCurlyBrace);
+			outputFormatter.NewLine();
 			return null;
 		}
 		
-		public object Visit(PropertyDeclaration propertyDeclaration, object data)
+		public override object Visit(PropertyDeclaration propertyDeclaration, object data)
 		{
-//			VisitAttributes(propertyDeclaration.Attributes, data);
-//			VisitModifier(propertyDeclaration.Modifier);
-//			Visit(propertyDeclaration.TypeReference, data);
-//			text.Append(' ');
-//			text.Append(propertyDeclaration.Name);
-//			text.Append(" {\n");
-//			++indentationLevel;
-//			if (propertyDeclaration.GetRegion != null) {
-//				propertyDeclaration.GetRegion.AcceptVisitor(this, data);
-//			}
-//			if (propertyDeclaration.SetRegion != null) {
-//				propertyDeclaration.SetRegion.AcceptVisitor(this, data);
-//			}
-//			--indentationLevel;
-//			Indent();
-//			text.Append("}\n");
+			VisitAttributes(propertyDeclaration.Attributes, data);
+			outputFormatter.Indent();
+			VisitModifier(propertyDeclaration.Modifier);
+			Visit(propertyDeclaration.TypeReference, data);
+			outputFormatter.Space();
+			outputFormatter.PrintIdentifier(propertyDeclaration.Name);
+			outputFormatter.Space();
+			outputFormatter.PrintToken(Tokens.OpenCurlyBrace);
+			outputFormatter.NewLine();
+			++outputFormatter.IndentationLevel;
+			if (propertyDeclaration.GetRegion != null) {
+				propertyDeclaration.GetRegion.AcceptVisitor(this, data);
+			}
+			if (propertyDeclaration.SetRegion != null) {
+				propertyDeclaration.SetRegion.AcceptVisitor(this, data);
+			}
+			--outputFormatter.IndentationLevel;
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.CloseCurlyBrace);
+			outputFormatter.NewLine();
 			return null;
 		}
 		
-		public object Visit(PropertyGetRegion getRegion, object data)
+		public override object Visit(PropertyGetRegion getRegion, object data)
 		{
-//			this.VisitAttributes(getRegion.Attributes, data);
-//			Indent();
-//			text.Append("get {\n");
-//			++indentationLevel;
-//			getRegion.Block.AcceptVisitor(this, false);
-//			--indentationLevel;
-//			Indent();
-//			text.Append("}\n");
+			this.VisitAttributes(getRegion.Attributes, data);
+			outputFormatter.Indent();
+			outputFormatter.PrintIdentifier("get");
+			if (getRegion.Block == null) {
+				outputFormatter.PrintToken(Tokens.Semicolon);
+			} else {
+				outputFormatter.Space();
+				outputFormatter.PrintToken(Tokens.OpenCurlyBrace);
+				outputFormatter.NewLine();
+				++outputFormatter.IndentationLevel;
+				getRegion.Block.AcceptChildren(this, false);
+				--outputFormatter.IndentationLevel;
+				outputFormatter.Indent();
+				outputFormatter.PrintToken(Tokens.CloseCurlyBrace);
+			}
+			outputFormatter.NewLine();
 			return null;
 		}
 		
-		public object Visit(PropertySetRegion setRegion, object data)
+		public override object Visit(PropertySetRegion setRegion, object data)
 		{
-//			this.VisitAttributes(setRegion.Attributes, data);
-//			Indent();
-//			text.Append("set {\n");
-//			++indentationLevel;
-//			setRegion.Block.AcceptVisitor(this, false);
-//			--indentationLevel;
-//			Indent();
-//			text.Append("}\n");
+			this.VisitAttributes(setRegion.Attributes, data);
+			outputFormatter.Indent();
+			outputFormatter.PrintIdentifier("set");
+			if (setRegion.Block == null) {
+				outputFormatter.PrintToken(Tokens.Semicolon);
+			} else {
+				outputFormatter.Space();
+				outputFormatter.PrintToken(Tokens.OpenCurlyBrace);
+				outputFormatter.NewLine();
+				++outputFormatter.IndentationLevel;
+				setRegion.Block.AcceptChildren(this, false);
+				--outputFormatter.IndentationLevel;
+				outputFormatter.Indent();
+				outputFormatter.PrintToken(Tokens.CloseCurlyBrace);
+			}
+			outputFormatter.NewLine();
 			return null;
 		}
 		
-		// TODO : Add operator declaration to the parser ... 
-		public object Visit(OperatorDeclaration operatorDeclaration, object data)
+		public override object Visit(OperatorDeclaration operatorDeclaration, object data)
 		{
-//			VisitAttributes(operatorDeclaration.Attributes, data);
-//			VisitModifier(operatorDeclaration.Modifier);
-////			Visit(operatorDeclaration.TypeReference, data);
-//			text.Append(' ');
-////			if (operatorDeclaration.OperatorType == OperatorType.Explicit) {
-////				text.Append("explicit");
-////			} else if (operatorDeclaration.OperatorType == OperatorType.Implicit) {
-////				text.Append("implicit");
-////			} else {
-////				text.Append(operatorDeclaration.overloadOperator)
-////			}
-//			text.Append('(');
-////			text.Append(operatorDeclaration.FirstParameterType);
-//			text.Append(' ');
-////			text.Append(operatorDeclaration.FirstParameterName);
-////			if (operatorDeclaration.OperatorType == OperatorType.Binary) {
-//				text.Append(", ");
-////				text.Append(operatorDeclaration.SecondParameterType);
-//				text.Append(' ');
-////				text.Append(operatorDeclaration.SecondParameterName);
-////			}
-//			text.Append(")\n");
-//			Indent();
-//			text.Append("{\n");
-//			++indentationLevel;
-//			operatorDeclaration.AcceptChildren(this, data);
-//			--indentationLevel;
-//			Indent();
-//			text.Append("}\n");
+			VisitAttributes(operatorDeclaration.Attributes, data);
+			outputFormatter.Indent();
+			VisitModifier(operatorDeclaration.Modifier);
+			switch (operatorDeclaration.OpratorDeclarator.OperatorType) {
+				case OperatorType.Explicit:
+					outputFormatter.PrintToken(Tokens.Explicit);
+					break;
+				case OperatorType.Implicit:
+					outputFormatter.PrintToken(Tokens.Implicit);
+					break;
+				default:
+					Visit(operatorDeclaration.OpratorDeclarator.TypeReference, data);
+					break;
+			}
+			outputFormatter.Space();
+			outputFormatter.PrintToken(Tokens.Operator);
+			outputFormatter.Space();
+			if (!operatorDeclaration.OpratorDeclarator.IsConversion) {
+				outputFormatter.PrintIdentifier(Tokens.GetTokenString(operatorDeclaration.OpratorDeclarator.OverloadOperatorToken));
+			} else {
+				Visit(operatorDeclaration.OpratorDeclarator.TypeReference, data);
+			}
+			
+			outputFormatter.PrintToken(Tokens.OpenParenthesis);
+			Visit(operatorDeclaration.OpratorDeclarator.FirstParameterType, data);
+			outputFormatter.Space();
+			outputFormatter.PrintIdentifier(operatorDeclaration.OpratorDeclarator.FirstParameterName);
+			if (operatorDeclaration.OpratorDeclarator.OperatorType == OperatorType.Binary) {
+				outputFormatter.PrintToken(Tokens.Comma);
+				outputFormatter.Space();
+				Visit(operatorDeclaration.OpratorDeclarator.SecondParameterType, data);
+				outputFormatter.Space();
+				outputFormatter.PrintIdentifier(operatorDeclaration.OpratorDeclarator.SecondParameterName);
+			}
+			outputFormatter.PrintToken(Tokens.CloseParenthesis);
+			
+			if (operatorDeclaration.Body == null) {
+				outputFormatter.PrintToken(Tokens.Semicolon);
+				outputFormatter.NewLine();
+			} else {
+				outputFormatter.NewLine();
+				outputFormatter.Indent();
+				outputFormatter.PrintToken(Tokens.OpenCurlyBrace);
+				outputFormatter.NewLine();
+				++outputFormatter.IndentationLevel;
+				operatorDeclaration.Body.AcceptChildren(this, data);
+				--outputFormatter.IndentationLevel;
+				outputFormatter.Indent();
+				outputFormatter.PrintToken(Tokens.CloseCurlyBrace);
+				outputFormatter.NewLine();
+			}
 			return null;
 		}
 		
-		public object Visit(EmptyStatement emptyStatement, object data)
+		public override object Visit(EmptyStatement emptyStatement, object data)
 		{
-//			Indent();
-//			text.Append(";\n");
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.Semicolon);
+			outputFormatter.NewLine();
 			return null;
 		}
-		
-		public object Visit(BlockStatement blockStatement, object data)
+		public override object Visit(BlockStatement blockStatement, object data)
 		{
-//			bool appendBrace = true;
-//			if (data is bool) {
-//				appendBrace = (bool)data;
-//			}
-//			if (appendBrace) {
-//				Indent();
-//				text.Append("{\n");
-//				++indentationLevel;
-//			}
-//			blockStatement.AcceptChildren(this, true);
-//			if (appendBrace) {
-//				--indentationLevel;
-//				Indent();
-//				text.Append("}\n");
-//			}
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.OpenCurlyBrace);
+			outputFormatter.NewLine();
+			++outputFormatter.IndentationLevel;
+			blockStatement.AcceptChildren(this, true);
+			--outputFormatter.IndentationLevel;
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.CloseCurlyBrace);
+			outputFormatter.NewLine();
 			return null;
 		}
 		
-		public object Visit(ForStatement forStatement, object data)
+		public override object Visit(ForStatement forStatement, object data)
 		{
-//			Indent();
-//			text.Append("for (");
-//			if (forStatement.Initializers != null && forStatement.Initializers.Count > 0) {
-//				foreach (INode node in forStatement.Initializers) {
-//					node.AcceptVisitor(this, false);
-//					text.Append(',');
-//				}
-//			}
-//			text.Append(';');
-//			if (forStatement.Condition != null) {
-//				forStatement.Condition.AcceptVisitor(this, data);
-//			}
-//			text.Append(';');
-//			if (forStatement.Iterator != null && forStatement.Iterator.Count > 0) {
-//				foreach (INode node in forStatement.Iterator) {
-//					node.AcceptVisitor(this, false);
-//					text.Append(',');
-//				}
-//			}
-//			text.Append(") {\n");
-//			++indentationLevel;
-//			if (forStatement.EmbeddedStatement is BlockStatement) {
-//				Visit((BlockStatement)forStatement.EmbeddedStatement, false);
-//			} else {
-//				forStatement.EmbeddedStatement.AcceptVisitor(this, data);
-//			}
-//			--indentationLevel;
-//			Indent();
-//			text.Append("}\n");
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.For);
+			outputFormatter.Space();
+			outputFormatter.PrintToken(Tokens.OpenParenthesis);
+			outputFormatter.DoIndent = false;
+			outputFormatter.DoNewLine = false;
+			outputFormatter.EmitSemicolon = false;
+			if (forStatement.Initializers != null && forStatement.Initializers.Count > 0) {
+				for (int i = 0; i < forStatement.Initializers.Count; ++i) {
+					INode node = (INode)forStatement.Initializers[i];
+					node.AcceptVisitor(this, false);
+					if (i + 1 < forStatement.Initializers.Count) {
+						outputFormatter.PrintToken(Tokens.Comma);
+					}
+				}
+			} 
+			outputFormatter.EmitSemicolon = true;
+			outputFormatter.PrintToken(Tokens.Semicolon);
+			outputFormatter.EmitSemicolon = false;
+			if (forStatement.Condition != null) {
+				outputFormatter.Space();
+				forStatement.Condition.AcceptVisitor(this, data);
+			}
+			outputFormatter.EmitSemicolon = true;
+			outputFormatter.PrintToken(Tokens.Semicolon);
+			outputFormatter.EmitSemicolon = false;
+			if (forStatement.Iterator != null && forStatement.Iterator.Count > 0) {
+				outputFormatter.Space();
+				for (int i = 0; i < forStatement.Iterator.Count; ++i) {
+					INode node = (INode)forStatement.Iterator[i];
+					node.AcceptVisitor(this, false);
+					if (i + 1 < forStatement.Iterator.Count) {
+						outputFormatter.PrintToken(Tokens.Comma);
+					}
+				}
+			}
+			outputFormatter.PrintToken(Tokens.CloseParenthesis);
+			outputFormatter.EmitSemicolon = true;
+			outputFormatter.DoNewLine     = true;
+			outputFormatter.DoIndent      = true;
+			outputFormatter.NewLine();
+			++outputFormatter.IndentationLevel;
+			if (forStatement.EmbeddedStatement is BlockStatement) {
+				Visit((BlockStatement)forStatement.EmbeddedStatement, false);
+			} else {
+				forStatement.EmbeddedStatement.AcceptVisitor(this, data);
+			}
+			--outputFormatter.IndentationLevel;
 			return null;
 		}
 		
-		public object Visit(ForeachStatement foreachStatement, object data)
+		public override object Visit(ForeachStatement foreachStatement, object data)
 		{
-//			Indent();
-//			text.Append("foreach (");
-//			Visit(foreachStatement.TypeReference, data);
-//			text.Append(' ');
-//			text.Append(foreachStatement.VariableName);
-//			text.Append(" in ");
-//			foreachStatement.Expression.AcceptVisitor(this, data);
-//			text.Append(") {\n");
-//			++indentationLevel;
-//			if (foreachStatement.EmbeddedStatement is BlockStatement) {
-//				Visit((BlockStatement)foreachStatement.EmbeddedStatement, false);
-//			} else {
-//				foreachStatement.EmbeddedStatement.AcceptVisitor(this, data);
-//			}
-//			--indentationLevel;
-//			Indent();
-//			text.Append("}\n");
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.Foreach);
+			outputFormatter.Space();
+			outputFormatter.PrintToken(Tokens.OpenParenthesis);
+			Visit(foreachStatement.TypeReference, data);
+			outputFormatter.Space();
+			outputFormatter.PrintIdentifier(foreachStatement.VariableName);
+			outputFormatter.Space();
+			outputFormatter.PrintToken(Tokens.In);
+			outputFormatter.Space();
+			foreachStatement.Expression.AcceptVisitor(this, data);
+			outputFormatter.PrintToken(Tokens.CloseParenthesis);
+			outputFormatter.NewLine();
+			++outputFormatter.IndentationLevel;
+			if (foreachStatement.EmbeddedStatement is BlockStatement) {
+				Visit((BlockStatement)foreachStatement.EmbeddedStatement, false);
+			} else {
+				foreachStatement.EmbeddedStatement.AcceptVisitor(this, data);
+			}
+			--outputFormatter.IndentationLevel;
 			return null;
 		}
 		
-		public object Visit(WhileStatement whileStatement, object data)
+		public override object Visit(WhileStatement whileStatement, object data)
 		{
-//			Indent();
-//			text.Append("while (");
-//			whileStatement.Condition.AcceptVisitor(this, data);
-//			text.Append(") {\n");
-//			++indentationLevel;
-//			if (whileStatement.EmbeddedStatement is BlockStatement) {
-//				Visit((BlockStatement)whileStatement.EmbeddedStatement, false);
-//			} else {
-//				whileStatement.EmbeddedStatement.AcceptVisitor(this, data);
-//			}
-//			--indentationLevel;
-//			Indent();
-//			text.Append("}\n");
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.While);
+			outputFormatter.Space();
+			outputFormatter.PrintToken(Tokens.OpenParenthesis);
+			whileStatement.Condition.AcceptVisitor(this, data);
+			outputFormatter.PrintToken(Tokens.CloseParenthesis);
+			outputFormatter.NewLine();
+			++outputFormatter.IndentationLevel;
+			if (whileStatement.EmbeddedStatement is BlockStatement) {
+				Visit((BlockStatement)whileStatement.EmbeddedStatement, false);
+			} else {
+				whileStatement.EmbeddedStatement.AcceptVisitor(this, data);
+			}
+			--outputFormatter.IndentationLevel;
 			return null;
 		}
 		
-		public object Visit(DoWhileStatement doWhileStatement, object data)
+		public override object Visit(DoWhileStatement doWhileStatement, object data)
 		{
-//			Indent();
-//			text.Append("do {\n");
-//			++indentationLevel;
-//			if (doWhileStatement.EmbeddedStatement is BlockStatement) {
-//				Visit((BlockStatement)doWhileStatement.EmbeddedStatement, false);
-//			} else {
-//				doWhileStatement.EmbeddedStatement.AcceptVisitor(this, data);
-//			}
-//			--indentationLevel;
-//			Indent();
-//			text.Append("} while (");
-//			doWhileStatement.Condition.AcceptVisitor(this, data);
-//			text.Append(");\n");
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.Do);
+			outputFormatter.NewLine();
+			++outputFormatter.IndentationLevel;
+			if (doWhileStatement.EmbeddedStatement is BlockStatement) {
+				Visit((BlockStatement)doWhileStatement.EmbeddedStatement, false);
+			} else {
+				doWhileStatement.EmbeddedStatement.AcceptVisitor(this, data);
+			}
+			--outputFormatter.IndentationLevel;
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.While);
+			outputFormatter.Space();
+			outputFormatter.PrintToken(Tokens.OpenParenthesis);
+			doWhileStatement.Condition.AcceptVisitor(this, data);
+			outputFormatter.PrintToken(Tokens.CloseParenthesis);
+			outputFormatter.PrintToken(Tokens.Semicolon);
+			outputFormatter.NewLine();
 			return null;
 		}
 		
-		public object Visit(BreakStatement breakStatement, object data)
+		public override object Visit(BreakStatement breakStatement, object data)
 		{
-//			Indent();
-//			text.Append("break;\n");
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.Break);
+			outputFormatter.PrintToken(Tokens.Semicolon);
+			outputFormatter.NewLine();
 			return null;
 		}
 		
-		public object Visit(ContinueStatement continueStatement, object data)
+		public override object Visit(ContinueStatement continueStatement, object data)
 		{
-//			Indent();
-//			text.Append("continue;\n");
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.Continue);
+			outputFormatter.PrintToken(Tokens.Semicolon);
+			outputFormatter.NewLine();
 			return null;
 		}
 		
-		public object Visit(CheckedStatement checkedStatement, object data)
+		public override object Visit(CheckedStatement checkedStatement, object data)
 		{
-//			Indent();
-//			text.Append("checked {\n");
-//			++indentationLevel;
-//			checkedStatement.Block.AcceptVisitor(this, false);
-//			--indentationLevel;
-//			Indent();
-//			text.Append("}\n");
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.Checked);
+			outputFormatter.Space();
+			outputFormatter.PrintToken(Tokens.OpenCurlyBrace);
+			outputFormatter.NewLine();
+			++outputFormatter.IndentationLevel;
+			checkedStatement.Block.AcceptChildren(this, false);
+			--outputFormatter.IndentationLevel;
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.CloseCurlyBrace);
+			outputFormatter.NewLine();
 			return null;
 		}
 		
-		public object Visit(UncheckedStatement uncheckedStatement, object data)
+		public override object Visit(UncheckedStatement uncheckedStatement, object data)
 		{
-//			Indent();
-//			text.Append("unchecked {\n");
-//			++indentationLevel;
-//			uncheckedStatement.Block.AcceptVisitor(this, false);
-//			--indentationLevel;
-//			Indent();
-//			text.Append("}\n");
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.Unchecked);
+			outputFormatter.Space();
+			outputFormatter.PrintToken(Tokens.OpenCurlyBrace);
+			outputFormatter.NewLine();
+			++outputFormatter.IndentationLevel;
+			uncheckedStatement.Block.AcceptVisitor(this, false);
+			--outputFormatter.IndentationLevel;
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.CloseCurlyBrace);
+			outputFormatter.NewLine();
 			return null;
 		}
 		
-		public object Visit(FixedStatement fixedStatement, object data)
+		public override object Visit(FixedStatement fixedStatement, object data)
 		{
-//			Indent();
-//			text.Append("fixed (");
-//			Visit(fixedStatement.TypeReference, data);
-//			text.Append(' ');
-//			AppendCommaSeparatedList(fixedStatement.PointerDeclarators);
-//			text.Append(") {\n");
-//			++indentationLevel;
-//			if (fixedStatement.EmbeddedStatement is BlockStatement) {
-//				Visit((BlockStatement)fixedStatement.EmbeddedStatement, false);
-//			} else {
-//				fixedStatement.EmbeddedStatement.AcceptVisitor(this, data);
-//			}
-//			--indentationLevel;
-//			Indent();
-//			text.Append("}\n");
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.Fixed);
+			outputFormatter.Space();
+			outputFormatter.PrintToken(Tokens.OpenParenthesis);
+			Visit(fixedStatement.TypeReference, data);
+			outputFormatter.Space();
+			AppendCommaSeparatedList(fixedStatement.PointerDeclarators);
+			outputFormatter.PrintToken(Tokens.CloseParenthesis);
+			outputFormatter.Space();
+			outputFormatter.PrintToken(Tokens.OpenCurlyBrace);
+			outputFormatter.NewLine();
+			++outputFormatter.IndentationLevel;
+			if (fixedStatement.EmbeddedStatement is BlockStatement) {
+				Visit((BlockStatement)fixedStatement.EmbeddedStatement, false);
+			} else {
+				fixedStatement.EmbeddedStatement.AcceptVisitor(this, data);
+			}
+			--outputFormatter.IndentationLevel;
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.CloseCurlyBrace);
+			outputFormatter.NewLine();
 			return null;
 		}
 		
-		public object Visit(GotoCaseStatement gotoCaseStatement, object data)
+		public override object Visit(GotoCaseStatement gotoCaseStatement, object data)
 		{
-//			Indent();
-//			text.Append("goto ");
-//			if (gotoCaseStatement.IsDefaultCase) {
-//				text.Append("default");
-//			} else {
-//				text.Append("case ");
-//				gotoCaseStatement.CaseExpression.AcceptVisitor(this, data);
-//			}
-//			text.Append(";\n");
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.Goto);
+			outputFormatter.Space();
+			if (gotoCaseStatement.IsDefaultCase) {
+				outputFormatter.PrintToken(Tokens.Default);
+			} else {
+				outputFormatter.PrintToken(Tokens.Case);
+				outputFormatter.Space();
+				gotoCaseStatement.CaseExpression.AcceptVisitor(this, data);
+			}
+			outputFormatter.PrintToken(Tokens.Semicolon);
+			outputFormatter.NewLine();
 			return null;
 		}
 		
-		public object Visit(GotoStatement gotoStatement, object data)
+		public override object Visit(GotoStatement gotoStatement, object data)
 		{
-//			Indent();
-//			text.Append("goto ");
-//			text.Append(gotoStatement.Label);
-//			text.Append(";\n");
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.Goto);
+			outputFormatter.Space();
+			outputFormatter.PrintIdentifier(gotoStatement.Label);
+			outputFormatter.PrintToken(Tokens.Semicolon);
+			outputFormatter.NewLine();
 			return null;
 		}
 		
-		public object Visit(IfElseStatement ifElseStatement, object data)
+		public override object Visit(IfElseStatement ifElseStatement, object data)
 		{
-//			Indent();
-//			text.Append("if (");
-//			ifElseStatement.Condition.AcceptVisitor(this,data);
-//			text.Append(") {\n");
-//			++indentationLevel;
-//			ifElseStatement.EmbeddedStatement.AcceptVisitor(this,data);
-//			--indentationLevel;
-//			Indent();
-//			text.Append("} else {\n");
-//			++indentationLevel;
-//			ifElseStatement.EmbeddedElseStatement.AcceptVisitor(this,data);
-//			--indentationLevel;
-//			Indent();
-//			text.Append("}\n");
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.If);
+			outputFormatter.Space();
+			outputFormatter.PrintToken(Tokens.OpenParenthesis);
+			ifElseStatement.Condition.AcceptVisitor(this,data);
+			outputFormatter.PrintToken(Tokens.CloseParenthesis);
+			outputFormatter.NewLine();
+			++outputFormatter.IndentationLevel;
+			ifElseStatement.EmbeddedStatement.AcceptVisitor(this,data);
+			--outputFormatter.IndentationLevel;
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.Else);
+			outputFormatter.NewLine();
+			++outputFormatter.IndentationLevel;
+			ifElseStatement.EmbeddedElseStatement.AcceptVisitor(this,data);
+			--outputFormatter.IndentationLevel;
 			return null;
 		}
 		
-		public object Visit(IfStatement ifStatement, object data)
+		public override object Visit(IfStatement ifStatement, object data)
 		{
-//			Indent();
-//			text.Append("if (");
-//			ifStatement.Condition.AcceptVisitor(this,data);
-//			text.Append(") {\n");
-//			++indentationLevel;
-//			ifStatement.EmbeddedStatement.AcceptVisitor(this,data);
-//			--indentationLevel;
-//			Indent();
-//			text.Append("}\n");
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.If);
+			outputFormatter.Space();
+			outputFormatter.PrintToken(Tokens.OpenParenthesis);
+			ifStatement.Condition.AcceptVisitor(this,data);
+			outputFormatter.PrintToken(Tokens.CloseParenthesis);
+			outputFormatter.Space();
+			++outputFormatter.IndentationLevel;
+			ifStatement.EmbeddedStatement.AcceptVisitor(this,data);
+			--outputFormatter.IndentationLevel;
 			return null;
 		}
 		
-		public object Visit(LabelStatement labelStatement, object data)
+		public override object Visit(LabelStatement labelStatement, object data)
 		{
-//			Indent();
-//			text.Append(labelStatement.Label);
-//			text.Append(":\n");
+			outputFormatter.Indent();
+			outputFormatter.PrintIdentifier(labelStatement.Label);
+			outputFormatter.PrintToken(Tokens.Colon);
+			outputFormatter.NewLine();
 			return null;
 		}
 		
-		public object Visit(LockStatement lockStatement, object data)
+		public override object Visit(LockStatement lockStatement, object data)
 		{
-//			Indent();
-//			text.Append("lock (");
-//			lockStatement.LockExpression.AcceptVisitor(this, data);
-//			text.Append(") {\n");
-//			++indentationLevel;
-//			lockStatement.EmbeddedStatement.AcceptVisitor(this, data);
-//			--indentationLevel;
-//			Indent();
-//			text.Append("}\n");
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.Lock);
+			outputFormatter.Space();
+			outputFormatter.PrintToken(Tokens.OpenParenthesis);
+			lockStatement.LockExpression.AcceptVisitor(this, data);
+			outputFormatter.PrintToken(Tokens.CloseParenthesis);
+			outputFormatter.Space();
+			outputFormatter.PrintToken(Tokens.OpenCurlyBrace);
+			outputFormatter.NewLine();
+			
+			++outputFormatter.IndentationLevel;
+			lockStatement.EmbeddedStatement.AcceptVisitor(this, data);
+			--outputFormatter.IndentationLevel;
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.CloseCurlyBrace);
+			outputFormatter.NewLine();
 			return null;
 		}
 		
-		public object Visit(ReturnStatement returnStatement, object data)
+		public override object Visit(ReturnStatement returnStatement, object data)
 		{
-//			Indent();
-//			text.Append("return");
-//			if (returnStatement.ReturnExpression != null) {
-//				text.Append(" ");
-//				returnStatement.ReturnExpression.AcceptVisitor(this, data);
-//			}
-//			text.Append(";\n");
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.Return);
+			if (returnStatement.ReturnExpression != null) {
+				outputFormatter.Space();
+				returnStatement.ReturnExpression.AcceptVisitor(this, data);
+			}
+			outputFormatter.PrintToken(Tokens.Semicolon);
+			outputFormatter.NewLine();
 			return null;
 		}
 		
-		public object Visit(SwitchStatement switchStatement, object data)
+		public override object Visit(SwitchStatement switchStatement, object data)
 		{
-//			Indent();
-//			text.Append("switch (");
-//			switchStatement.SwitchExpression.AcceptVisitor(this, data);
-//			text.Append(") {\n");
-//			++indentationLevel;
-//			foreach (SwitchSection section in switchStatement.SwitchSections) {
-//				Indent();
-//				text.Append("case ");
-//				
-//				for (int i = 0; i < section.SwitchLabels.Count; ++i) {
-//					Expression label = (Expression)section.SwitchLabels[i];
-//					if (label == null) {
-//						text.Append("default:");
-//						continue;
-//					}
-//					label.AcceptVisitor(this, data);
-//					text.Append(":\n");
-//				}
-//				
-//				++indentationLevel;
-//				section.AcceptVisitor(this, data);
-//				--indentationLevel;
-//			}
-//			--indentationLevel;
-//			Indent();
-//			text.Append("}\n");
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.Switch);
+			outputFormatter.Space();
+			outputFormatter.PrintToken(Tokens.OpenParenthesis);
+			switchStatement.SwitchExpression.AcceptVisitor(this, data);
+			outputFormatter.PrintToken(Tokens.CloseParenthesis);
+			outputFormatter.Space();
+			outputFormatter.PrintToken(Tokens.OpenCurlyBrace);
+			outputFormatter.NewLine();
+			++outputFormatter.IndentationLevel;
+			foreach (SwitchSection section in switchStatement.SwitchSections) {
+				for (int i = 0; i < section.SwitchLabels.Count; ++i) {
+					Expression label = (Expression)section.SwitchLabels[i];
+					if (label == null) {
+						outputFormatter.Indent();
+						outputFormatter.PrintToken(Tokens.Default);
+						outputFormatter.PrintToken(Tokens.Colon);
+						outputFormatter.NewLine();
+						continue;
+					}
+					
+					outputFormatter.Indent();
+					outputFormatter.PrintToken(Tokens.Case);
+					outputFormatter.Space();
+					label.AcceptVisitor(this, data);
+					outputFormatter.PrintToken(Tokens.Colon);
+					outputFormatter.NewLine();
+				}
+				
+				++outputFormatter.IndentationLevel;
+				section.AcceptChildren(this, data);
+				--outputFormatter.IndentationLevel;
+			}
+			--outputFormatter.IndentationLevel;
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.CloseCurlyBrace);
+			outputFormatter.NewLine();
 			return null;
 		}
 		
-		public object Visit(ThrowStatement throwStatement, object data)
+		public override object Visit(ThrowStatement throwStatement, object data)
 		{
-//			Indent();
-//			text.Append("throw ");
-//			throwStatement.ThrowExpression.AcceptVisitor(this, data);
-//			text.Append(";\n");
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.Throw);
+			if (throwStatement.ThrowExpression != null) {
+				outputFormatter.Space();
+				throwStatement.ThrowExpression.AcceptVisitor(this, data);
+			}
+			outputFormatter.PrintToken(Tokens.Semicolon);
+			outputFormatter.NewLine();
 			return null;
 		}
 		
-		public object Visit(TryCatchStatement tryCatchStatement, object data)
+		public override object Visit(TryCatchStatement tryCatchStatement, object data)
 		{
-//			Indent();
-//			text.Append("try {\n");
-//			
-//			++indentationLevel;
-//			tryCatchStatement.StatementBlock.AcceptVisitor(this, data);
-//			--indentationLevel;
-//			
-//			if (tryCatchStatement.CatchClauses != null) {
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.Try);
+			outputFormatter.Space();
+			outputFormatter.PrintToken(Tokens.OpenCurlyBrace);
+			outputFormatter.NewLine();
+			
+			++outputFormatter.IndentationLevel;
+			tryCatchStatement.StatementBlock.AcceptChildren(this, data);
+			--outputFormatter.IndentationLevel;
+			
+			if (tryCatchStatement.CatchClauses != null) {
 //				int generated = 0;
-//				foreach (CatchClause catchClause in tryCatchStatement.CatchClauses) {
-//					Indent();
-//					text.Append("} catch (");
-//					text.Append(catchClause.Type);
-//					text.Append(' ');
-//					if (catchClause.VariableName == null) {
-//						text.Append("generatedExceptionVariable" + generated.ToString());
-//						++generated;
-//					} else {
-//						text.Append(catchClause.VariableName);
-//					}
-//					text.Append(") {\n");
-//					++indentationLevel;
-//					catchClause.StatementBlock.AcceptVisitor(this, data);
-//					--indentationLevel;
-//				}
-//			}
-//			
-//			if (tryCatchStatement.FinallyBlock != null) {
-//				Indent();
-//				text.Append("} finally {\n");
-//				++indentationLevel;
-//				tryCatchStatement.FinallyBlock.AcceptVisitor(this, data);
-//				--indentationLevel;
-//			}
-//			Indent();
-//			text.Append("}\n");
+				foreach (CatchClause catchClause in tryCatchStatement.CatchClauses) {
+					outputFormatter.Indent();
+					outputFormatter.PrintToken(Tokens.CloseCurlyBrace);
+					outputFormatter.Space();
+					outputFormatter.PrintToken(Tokens.Catch);
+					outputFormatter.Space();
+					if (catchClause.Type == null) {
+					} else {
+						outputFormatter.PrintToken(Tokens.OpenParenthesis);
+						outputFormatter.PrintIdentifier(catchClause.Type);
+						if (catchClause.VariableName != null) {
+							outputFormatter.Space();
+							outputFormatter.PrintIdentifier(catchClause.VariableName);
+						}
+						outputFormatter.PrintToken(Tokens.CloseParenthesis);
+					}
+					outputFormatter.Space();
+					outputFormatter.PrintToken(Tokens.OpenCurlyBrace);
+					outputFormatter.NewLine();
+					++outputFormatter.IndentationLevel;
+					catchClause.StatementBlock.AcceptChildren(this, data);
+					--outputFormatter.IndentationLevel;
+				}
+			}
+			
+			if (tryCatchStatement.FinallyBlock != null) {
+				outputFormatter.Indent();
+				outputFormatter.PrintToken(Tokens.CloseCurlyBrace);
+				outputFormatter.Space();
+				outputFormatter.PrintToken(Tokens.Finally);
+				outputFormatter.Space();
+				outputFormatter.PrintToken(Tokens.OpenCurlyBrace);
+				outputFormatter.NewLine();
+				++outputFormatter.IndentationLevel;
+				tryCatchStatement.FinallyBlock.AcceptChildren(this, data);
+				--outputFormatter.IndentationLevel;
+			}
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.CloseCurlyBrace);
+			outputFormatter.NewLine();
 			return null;
 		}
 		
-		public object Visit(UsingStatement usingStatement, object data)
+		public override object Visit(UsingStatement usingStatement, object data)
 		{
-//			Indent();
-//			text.Append("using (");
-//			usingStatement.UsingStmnt.AcceptVisitor(this,data);
-//			text.Append(") {\n");
-//			++indentationLevel;
-//			usingStatement.EmbeddedStatement.AcceptVisitor(this,data);
-//			--indentationLevel;
-//			Indent();
-//			text.Append("}\n");
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.Using);
+			outputFormatter.Space();
+			outputFormatter.PrintToken(Tokens.OpenParenthesis);
+			outputFormatter.DoIndent = false;
+			outputFormatter.DoNewLine = false;
+			outputFormatter.EmitSemicolon = false;
+			
+			usingStatement.UsingStmnt.AcceptVisitor(this,data);
+			outputFormatter.DoIndent = true;
+			outputFormatter.DoNewLine = true;
+			outputFormatter.EmitSemicolon = true;
+			
+			outputFormatter.PrintToken(Tokens.CloseParenthesis);
+			outputFormatter.Space();
+			outputFormatter.PrintToken(Tokens.OpenCurlyBrace);
+			outputFormatter.NewLine();
+			
+			++outputFormatter.IndentationLevel;
+			usingStatement.EmbeddedStatement.AcceptVisitor(this,data);
+			--outputFormatter.IndentationLevel;
+			outputFormatter.Indent();
+			outputFormatter.PrintToken(Tokens.CloseCurlyBrace);
+			outputFormatter.NewLine();
 			return null;
 		}
 		
-		public object Visit(LocalVariableDeclaration localVariableDeclaration, object data)
+		public override object Visit(LocalVariableDeclaration localVariableDeclaration, object data)
 		{
-//			Indent();
-//			VisitModifier(localVariableDeclaration.Modifier);
-//			text.Append(" ");
-//			Visit(localVariableDeclaration.Type, data);
-//			this.AppendCommaSeparatedList(localVariableDeclaration.Variables);
-//			text.Append(";\n");
+//			Console.WriteLine(localVariableDeclaration);
+			outputFormatter.Indent();
+			VisitModifier(localVariableDeclaration.Modifier);
+			Visit(localVariableDeclaration.Type, data);
+			outputFormatter.Space();
+			this.AppendCommaSeparatedList(localVariableDeclaration.Variables);
+			outputFormatter.PrintToken(Tokens.Semicolon);
+			outputFormatter.NewLine();
 			return null;
 		}
 		
-		public object Visit(StatementExpression statementExpression, object data)
+		public override object Visit(StatementExpression statementExpression, object data)
 		{
-//			Indent();
-//			statementExpression.Expression.AcceptVisitor(this, data);
-//			text.Append(";\n");
+			outputFormatter.Indent();
+			statementExpression.Expression.AcceptVisitor(this, data);
+			outputFormatter.PrintToken(Tokens.Semicolon);
+			outputFormatter.NewLine();
 			return null;
 		}
 		
 #region Expressions
-		public object Visit(ArrayCreateExpression arrayCreateExpression, object data)
+		public override object Visit(ArrayCreateExpression arrayCreateExpression, object data)
 		{
-//			text.Append("new ");
-//			Visit(arrayCreateExpression.CreateType, null);
-//			foreach (object o in arrayCreateExpression.Parameters) {
-//				text.Append("[");
-//				if (o is int) {
-//					int num = (int)o;
-//					for (int i = 0; i < num; ++i) {
-//						text.Append(",");
-//					}
-//				} else {
-//					((Expression)o).AcceptVisitor(this, null);
-//				}
-//				text.Append("]");
-//			}
-//			
-//			if (arrayCreateExpression.Parameters.Count == 0) {
-//				text.Append("[]");
-//			}
-//			
-//			if (arrayCreateExpression.ArrayInitializer != null) {
-//				text.Append(" ");
-//				arrayCreateExpression.ArrayInitializer.AcceptVisitor(this, null);
-//			}
+			outputFormatter.PrintToken(Tokens.New);
+			outputFormatter.Space();
+			Visit(arrayCreateExpression.CreateType, null);
+			for (int i = 0; i < arrayCreateExpression.Parameters.Count; ++i) {
+				outputFormatter.PrintToken(Tokens.OpenSquareBracket);
+				ArrayCreationParameter creationParameter = (ArrayCreationParameter)arrayCreateExpression.Parameters[i];
+				if (creationParameter.IsExpressionList) {
+					AppendCommaSeparatedList(creationParameter.Expressions);
+				} else {
+					for (int j = 0; j < creationParameter.Dimensions; ++j) {
+						outputFormatter.PrintToken(Tokens.Comma);
+					}
+				}
+				outputFormatter.PrintToken(Tokens.CloseSquareBracket);
+			}
+			
+			
+			if (arrayCreateExpression.ArrayInitializer != null) {
+				outputFormatter.Space();
+				arrayCreateExpression.ArrayInitializer.AcceptVisitor(this, null);
+			}
 			return null;
 		}
 		
-		public object Visit(ArrayInitializerExpression arrayCreateExpression, object data)
+		public override object Visit(ArrayInitializerExpression arrayCreateExpression, object data)
 		{
-//			text.Append("{");
-//			this.AppendCommaSeparatedList(arrayCreateExpression.CreateExpressions);
-//			text.Append("}");
+			outputFormatter.PrintToken(Tokens.OpenCurlyBrace);
+			this.AppendCommaSeparatedList(arrayCreateExpression.CreateExpressions);
+			outputFormatter.PrintToken(Tokens.CloseCurlyBrace);
 			return null;
 		}
 		
-		public object Visit(AssignmentExpression assignmentExpression, object data)
+		public override object Visit(AssignmentExpression assignmentExpression, object data)
 		{
-//			assignmentExpression.Left.AcceptVisitor(this, data);
-//			switch (assignmentExpression.Op) {
-//				case AssignmentOperatorType.Assign:
-//					text.Append(" = ");
-//					break;
-//				case AssignmentOperatorType.Add:
-//					text.Append(" += ");
-//					break;
-//				case AssignmentOperatorType.Subtract:
-//					text.Append(" -= ");
-//					break;
-//				case AssignmentOperatorType.Multiply:
-//					text.Append(" *= ");
-//					break;
-//				case AssignmentOperatorType.Divide:
-//					text.Append(" /= ");
-//					break;
-//				case AssignmentOperatorType.ShiftLeft:
-//					text.Append(" <<= ");
-//					break;
-//				case AssignmentOperatorType.ShiftRight:
-//					text.Append(" >>= ");
-//					break;
-//				case AssignmentOperatorType.ExclusiveOr:
-//					text.Append(" ^= ");
-//					break;
-//				case AssignmentOperatorType.Modulus:
-//					text.Append(" %= ");
-//					break;
-//				case AssignmentOperatorType.BitwiseAnd:
-//					text.Append(" &= ");
-//					break;
-//				case AssignmentOperatorType.BitwiseOr:
-//					text.Append(" |= ");
-//					break;
-//			}
-//			assignmentExpression.Right.AcceptVisitor(this, data);
-//			
+			assignmentExpression.Left.AcceptVisitor(this, data);
+			outputFormatter.Space();
+			switch (assignmentExpression.Op) {
+				case AssignmentOperatorType.Assign:
+					outputFormatter.PrintToken(Tokens.Assign);
+					break;
+				case AssignmentOperatorType.Add:
+					outputFormatter.PrintToken(Tokens.PlusAssign);
+					break;
+				case AssignmentOperatorType.Subtract:
+					outputFormatter.PrintToken(Tokens.MinusAssign);
+					break;
+				case AssignmentOperatorType.Multiply:
+					outputFormatter.PrintToken(Tokens.TimesAssign);
+					break;
+				case AssignmentOperatorType.Divide:
+					outputFormatter.PrintToken(Tokens.DivAssign);
+					break;
+				case AssignmentOperatorType.ShiftLeft:
+					outputFormatter.PrintToken(Tokens.ShiftLeftAssign);
+					break;
+				case AssignmentOperatorType.ShiftRight:
+					outputFormatter.PrintToken(Tokens.ShiftRightAssign);
+					break;
+				case AssignmentOperatorType.ExclusiveOr:
+					outputFormatter.PrintToken(Tokens.XorAssign);
+					break;
+				case AssignmentOperatorType.Modulus:
+					outputFormatter.PrintToken(Tokens.ModAssign);
+					break;
+				case AssignmentOperatorType.BitwiseAnd:
+					outputFormatter.PrintToken(Tokens.BitwiseAndAssign);
+					break;
+				case AssignmentOperatorType.BitwiseOr:
+					outputFormatter.PrintToken(Tokens.BitwiseOrAssign);
+					break;
+			}
+			outputFormatter.Space();
+			assignmentExpression.Right.AcceptVisitor(this, data);
 			return null;
 		}
 		
-		public object Visit(BaseReferenceExpression baseReferenceExpression, object data)
+		public override object Visit(BaseReferenceExpression baseReferenceExpression, object data)
 		{
-//			text.Append("base");
+			outputFormatter.PrintToken(Tokens.Base);
 			return null;
 		}
 		
-		public object Visit(BinaryOperatorExpression binaryOperatorExpression, object data)
+		public override object Visit(BinaryOperatorExpression binaryOperatorExpression, object data)
 		{
-//			binaryOperatorExpression.Left.AcceptVisitor(this, data);
-//			switch (binaryOperatorExpression.Op) {
-//				case BinaryOperatorType.Add:
-//					text.Append(" + ");
-//					break;
-//				
-//				case BinaryOperatorType.Subtract:
-//					text.Append(" - ");
-//					break;
-//				
-//				case BinaryOperatorType.Multiply:
-//					text.Append(" * ");
-//					break;
-//				
-//				case BinaryOperatorType.Divide:
-//					text.Append(" / ");
-//					break;
-//				
-//				case BinaryOperatorType.Modulus:
-//					text.Append(" % ");
-//					break;
-//				
-//				case BinaryOperatorType.ShiftLeft:
-//					text.Append(" << ");
-//					break;
-//				
-//				case BinaryOperatorType.ShiftRight:
-//					text.Append(" >> ");
-//					break;
-//				
-//				case BinaryOperatorType.BitwiseAnd:
-//					text.Append(" & ");
-//					break;
-//				case BinaryOperatorType.BitwiseOr:
-//					text.Append(" | ");
-//					break;
-//				case BinaryOperatorType.ExclusiveOr:
-//					text.Append(" ^ ");
-//					break;
-//				
-//				case BinaryOperatorType.LogicalAnd:
-//					text.Append(" && ");
-//					break;
-//				case BinaryOperatorType.LogicalOr:
-//					text.Append(" || ");
-//					break;
-//				
-//				case BinaryOperatorType.AS:
-//					text.Append(" as ");
-//					break;
-//				case BinaryOperatorType.IS:
-//					text.Append(" is ");
-//					break;
-//				case BinaryOperatorType.Equality:
-//					text.Append(" == ");
-//					break;
-//				case BinaryOperatorType.GreaterThan:
-//					text.Append(" > ");
-//					break;
-//				case BinaryOperatorType.GreaterThanOrEqual:
-//					text.Append(" >= ");
-//					break;
-//				case BinaryOperatorType.InEquality:
-//					text.Append(" != ");
-//					break;
-//				case BinaryOperatorType.LessThan:
-//					text.Append(" < ");
-//					break;
-//				case BinaryOperatorType.LessThanOrEqual:
-//					text.Append(" <= ");
-//					break;
-//			}
-//			
-//			binaryOperatorExpression.Right.AcceptVisitor(this, data);
+			binaryOperatorExpression.Left.AcceptVisitor(this, data);
+			outputFormatter.Space();
+			switch (binaryOperatorExpression.Op) {
+				case BinaryOperatorType.Add:
+					outputFormatter.PrintToken(Tokens.Plus);
+					break;
+				
+				case BinaryOperatorType.Subtract:
+					outputFormatter.PrintToken(Tokens.Minus);
+					break;
+				
+				case BinaryOperatorType.Multiply:
+					outputFormatter.PrintToken(Tokens.Times);
+					break;
+				
+				case BinaryOperatorType.Divide:
+					outputFormatter.PrintToken(Tokens.Div);
+					break;
+				
+				case BinaryOperatorType.Modulus:
+					outputFormatter.PrintToken(Tokens.Mod);
+					break;
+				
+				case BinaryOperatorType.ShiftLeft:
+					outputFormatter.PrintToken(Tokens.ShiftLeft);
+					break;
+				
+				case BinaryOperatorType.ShiftRight:
+					outputFormatter.PrintToken(Tokens.ShiftRight);
+					break;
+				
+				case BinaryOperatorType.BitwiseAnd:
+					outputFormatter.PrintToken(Tokens.BitwiseAnd);
+					break;
+				case BinaryOperatorType.BitwiseOr:
+					outputFormatter.PrintToken(Tokens.BitwiseOr);
+					break;
+				case BinaryOperatorType.ExclusiveOr:
+					outputFormatter.PrintToken(Tokens.Xor);
+					break;
+				
+				case BinaryOperatorType.LogicalAnd:
+					outputFormatter.PrintToken(Tokens.LogicalAnd);
+					break;
+				case BinaryOperatorType.LogicalOr:
+					outputFormatter.PrintToken(Tokens.LogicalOr);
+					break;
+				
+				case BinaryOperatorType.AS:
+					outputFormatter.PrintToken(Tokens.As);
+					break;
+				
+				case BinaryOperatorType.IS:
+					outputFormatter.PrintToken(Tokens.Is);
+					break;
+				case BinaryOperatorType.Equality:
+					outputFormatter.PrintToken(Tokens.Equal);
+					break;
+				case BinaryOperatorType.GreaterThan:
+					outputFormatter.PrintToken(Tokens.GreaterThan);
+					break;
+				case BinaryOperatorType.GreaterThanOrEqual:
+					outputFormatter.PrintToken(Tokens.GreaterEqual);
+					break;
+				case BinaryOperatorType.InEquality:
+					outputFormatter.PrintToken(Tokens.NotEqual);
+					break;
+				case BinaryOperatorType.LessThan:
+					outputFormatter.PrintToken(Tokens.LessThan);
+					break;
+				case BinaryOperatorType.LessThanOrEqual:
+					outputFormatter.PrintToken(Tokens.LessEqual);
+					break;
+			}
+			outputFormatter.Space();
+			binaryOperatorExpression.Right.AcceptVisitor(this, data);
 			return null;
 		}
 		
-		public object Visit(CastExpression castExpression, object data)
+		public override object Visit(CastExpression castExpression, object data)
 		{
-//			text.Append("(");
-//			Visit(castExpression.CastTo, data);
-//			text.Append(")");
-//			castExpression.Expression.AcceptVisitor(this, data);
+			outputFormatter.PrintToken(Tokens.OpenParenthesis);
+			Visit(castExpression.CastTo, data);
+			outputFormatter.PrintToken(Tokens.CloseParenthesis);
+			castExpression.Expression.AcceptVisitor(this, data);
 			return null;
 		}
 		
-		public object Visit(CheckedExpression checkedExpression, object data)
+		public override object Visit(CheckedExpression checkedExpression, object data)
 		{
-//			text.Append("checked(");
-//			checkedExpression.Expression.AcceptVisitor(this, data);
-//			text.Append(")");
+			outputFormatter.PrintToken(Tokens.Checked);
+			outputFormatter.PrintToken(Tokens.OpenParenthesis);
+			checkedExpression.Expression.AcceptVisitor(this, data);
+			outputFormatter.PrintToken(Tokens.CloseParenthesis);
 			return null;
 		}
 		
-		public object Visit(ConditionalExpression conditionalExpression, object data)
+		public override object Visit(ConditionalExpression conditionalExpression, object data)
 		{
-//			conditionalExpression.TestCondition.AcceptVisitor(this, data);
-//			text.Append(" ? ");
-//			conditionalExpression.TrueExpression.AcceptVisitor(this, data);
-//			text.Append(" : ");
-//			conditionalExpression.FalseExpression.AcceptVisitor(this, data);
+			conditionalExpression.TestCondition.AcceptVisitor(this, data);
+			outputFormatter.Space();
+			outputFormatter.PrintToken(Tokens.Question);
+			outputFormatter.Space();
+			conditionalExpression.TrueExpression.AcceptVisitor(this, data);
+			outputFormatter.Space();
+			outputFormatter.PrintToken(Tokens.Colon);
+			outputFormatter.Space();
+			conditionalExpression.FalseExpression.AcceptVisitor(this, data);
 			return null;
 		}
 		
-		public object Visit(DirectionExpression directionExpression, object data)
+		public override object Visit(DirectionExpression directionExpression, object data)
 		{
-//			switch (directionExpression.FieldDirection) {
-//				case FieldDirection.Out:
-//					text.Append("out ");
-//					break;
-//				case FieldDirection.Ref:
-//					text.Append("ref ");
-//					break;
-//			}
-//			directionExpression.Expression.AcceptVisitor(this, data);
+			switch (directionExpression.FieldDirection) {
+				case FieldDirection.Out:
+					outputFormatter.PrintToken(Tokens.Out);
+					outputFormatter.Space();
+					break;
+				case FieldDirection.Ref:
+					outputFormatter.PrintToken(Tokens.Ref);
+					outputFormatter.Space();
+					break;
+			}
+			directionExpression.Expression.AcceptVisitor(this, data);
 			return null;
 		}
 		
-		public object Visit(FieldReferenceExpression fieldReferenceExpression, object data)
+		public override object Visit(FieldReferenceExpression fieldReferenceExpression, object data)
 		{
-//			fieldReferenceExpression.TargetObject.AcceptVisitor(this, data);
-//			text.Append(".");
-//			text.Append(fieldReferenceExpression.FieldName);
+			fieldReferenceExpression.TargetObject.AcceptVisitor(this, data);
+			outputFormatter.PrintToken(Tokens.Dot);
+			outputFormatter.PrintIdentifier(fieldReferenceExpression.FieldName);
 			return null;
 		}
 		
-		public object Visit(IdentifierExpression identifierExpression, object data)
+		public override object Visit(IdentifierExpression identifierExpression, object data)
 		{
-//			text.Append(identifierExpression.Identifier);
+			outputFormatter.PrintIdentifier(identifierExpression.Identifier);
 			return null;
 		}
 		
-		public object Visit(IndexerExpression indexerExpression, object data)
+		public override object Visit(IndexerExpression indexerExpression, object data)
 		{
-//			indexerExpression.TargetObject.AcceptVisitor(this, data);
-//			text.Append("[");
-//			AppendCommaSeparatedList(indexerExpression.Indices);
-//			text.Append("]");
+			indexerExpression.TargetObject.AcceptVisitor(this, data);
+			outputFormatter.PrintToken(Tokens.OpenSquareBracket);
+			AppendCommaSeparatedList(indexerExpression.Indices);
+			outputFormatter.PrintToken(Tokens.CloseSquareBracket);
 			return null;
 		}
 		
-		public object Visit(InvocationExpression invocationExpression, object data)
+		public override object Visit(InvocationExpression invocationExpression, object data)
 		{
-//			invocationExpression.TargetObject.AcceptVisitor(this, data);
-//			text.Append("(");
-//			AppendCommaSeparatedList(invocationExpression.Parameters);
-//			text.Append(")");
+			invocationExpression.TargetObject.AcceptVisitor(this, data);
+			outputFormatter.PrintToken(Tokens.OpenParenthesis);
+			AppendCommaSeparatedList(invocationExpression.Parameters);
+			outputFormatter.PrintToken(Tokens.CloseParenthesis);
 			return null;
 		}
 		
-		public object Visit(ObjectCreateExpression objectCreateExpression, object data)
+		public override object Visit(ObjectCreateExpression objectCreateExpression, object data)
 		{
-//			text.Append("new ");
-//			this.Visit(objectCreateExpression.CreateType, data);
-//			text.Append("(");
-//			AppendCommaSeparatedList(objectCreateExpression.Parameters);
-//			text.Append(")");
+			outputFormatter.PrintToken(Tokens.New);
+			outputFormatter.Space();
+			this.Visit(objectCreateExpression.CreateType, data);
+			outputFormatter.PrintToken(Tokens.OpenParenthesis);
+			AppendCommaSeparatedList(objectCreateExpression.Parameters);
+			outputFormatter.PrintToken(Tokens.CloseParenthesis);
 			return null;
 		}
 		
-		public object Visit(ParenthesizedExpression parenthesizedExpression, object data)
+		public override object Visit(ParenthesizedExpression parenthesizedExpression, object data)
 		{
-//			text.Append("(");
-//			parenthesizedExpression.Expression.AcceptVisitor(this, data);
-//			text.Append(")");
+			outputFormatter.PrintToken(Tokens.OpenParenthesis);
+			parenthesizedExpression.Expression.AcceptVisitor(this, data);
+			outputFormatter.PrintToken(Tokens.CloseParenthesis);
 			return null;
 		}
 		
-		public object Visit(PointerReferenceExpression pointerReferenceExpression, object data)
+		public override object Visit(PointerReferenceExpression pointerReferenceExpression, object data)
 		{
-//			pointerReferenceExpression.Expression.AcceptVisitor(this, data);
-//			text.Append("->");
-//			text.Append(pointerReferenceExpression.Identifier);
+			pointerReferenceExpression.Expression.AcceptVisitor(this, data);
+			outputFormatter.PrintToken(Tokens.Pointer);
+			outputFormatter.PrintIdentifier(pointerReferenceExpression.Identifier);
 			return null;
 		}
 		
-		public object Visit(PrimitiveExpression primitiveExpression, object data)
+		public override object Visit(PrimitiveExpression primitiveExpression, object data)
 		{
-//			text.Append(primitiveExpression.StringValue);
+			outputFormatter.PrintIdentifier(primitiveExpression.StringValue);
 			return null;
 		}
 		
-		public object Visit(SizeOfExpression sizeOfExpression, object data)
+		public override object Visit(SizeOfExpression sizeOfExpression, object data)
 		{
-//			text.Append("sizeof(");
-//			Visit(sizeOfExpression.TypeReference, data);
-//			text.Append(")");
+			outputFormatter.PrintToken(Tokens.Sizeof);
+			outputFormatter.PrintToken(Tokens.OpenParenthesis);
+			Visit(sizeOfExpression.TypeReference, data);
+			outputFormatter.PrintToken(Tokens.CloseParenthesis);
 			return null;
 		}
 		
-		public object Visit(StackAllocExpression stackAllocExpression, object data)
+		public override object Visit(StackAllocExpression stackAllocExpression, object data)
 		{
-//			text.Append("stackalloc ");
-//			Visit(stackAllocExpression.Type, data);
-//			text.Append("[");
-//			stackAllocExpression.Expression.AcceptVisitor(this, data);
-//			text.Append("]");
+			outputFormatter.PrintToken(Tokens.Stackalloc);
+			Visit(stackAllocExpression.Type, data);
+			outputFormatter.PrintToken(Tokens.OpenSquareBracket);
+			stackAllocExpression.Expression.AcceptVisitor(this, data);
+			outputFormatter.PrintToken(Tokens.CloseSquareBracket);
 			return null;
 		}
 		
-		public object Visit(ThisReferenceExpression thisReferenceExpression, object data)
+		public override object Visit(ThisReferenceExpression thisReferenceExpression, object data)
 		{
-//			text.Append("this");
+			outputFormatter.PrintToken(Tokens.This);
 			return null;
 		}
 		
-		public object Visit(TypeOfExpression typeOfExpression, object data)
+		public override object Visit(TypeOfExpression typeOfExpression, object data)
 		{
-//			text.Append("typeof(");
-//			Visit(typeOfExpression.TypeReference, data);
-//			text.Append(")");
+			outputFormatter.PrintToken(Tokens.Typeof);
+			outputFormatter.PrintToken(Tokens.OpenParenthesis);
+			Visit(typeOfExpression.TypeReference, data);
+			outputFormatter.PrintToken(Tokens.CloseParenthesis);
 			return null;
 		}
 		
-		public object Visit(TypeReferenceExpression typeReferenceExpression, object data)
+		public override object Visit(TypeReferenceExpression typeReferenceExpression, object data)
 		{
-//			Visit(typeReferenceExpression.TypeReference, data);
+			Visit(typeReferenceExpression.TypeReference, data);
 			return null;
 		}
 		
-		public object Visit(UnaryOperatorExpression unaryOperatorExpression, object data)
+		public override object Visit(UnaryOperatorExpression unaryOperatorExpression, object data)
 		{
-//			switch (unaryOperatorExpression.Op) {
-//				case UnaryOperatorType.BitNot:
-//					text.Append("~");
-//					break;
-//				case UnaryOperatorType.Decrement:
-//					text.Append("--");
-//					break;
-//				case UnaryOperatorType.Increment:
-//					text.Append("++");
-//					break;
-//				case UnaryOperatorType.Minus:
-//					text.Append("-");
-//					break;
-//				case UnaryOperatorType.Not:
-//					text.Append("!");
-//					break;
-//				case UnaryOperatorType.Plus:
-//					text.Append("+");
-//					break;
-//				case UnaryOperatorType.PostDecrement:
-//					unaryOperatorExpression.Expression.AcceptVisitor(this, data);
-//					text.Append("--");
-//					return null;
-//				case UnaryOperatorType.PostIncrement:
-//					unaryOperatorExpression.Expression.AcceptVisitor(this, data);
-//					text.Append("++");
-//					return null;
-//				case UnaryOperatorType.Star:
-//					text.Append("*");
-//					break;
-//				case UnaryOperatorType.BitWiseAnd:
-//					text.Append("&");
-//					break;
-//			}
-//			unaryOperatorExpression.Expression.AcceptVisitor(this, data);
+			switch (unaryOperatorExpression.Op) {
+				case UnaryOperatorType.BitNot:
+					outputFormatter.PrintToken(Tokens.BitwiseComplement);
+					break;
+				case UnaryOperatorType.Decrement:
+					outputFormatter.PrintToken(Tokens.Decrement);
+					break;
+				case UnaryOperatorType.Increment:
+					outputFormatter.PrintToken(Tokens.Increment);
+					break;
+				case UnaryOperatorType.Minus:
+					outputFormatter.PrintToken(Tokens.Minus);
+					break;
+				case UnaryOperatorType.Not:
+					outputFormatter.PrintToken(Tokens.Not);
+					break;
+				case UnaryOperatorType.Plus:
+					outputFormatter.PrintToken(Tokens.Plus);
+					break;
+				case UnaryOperatorType.PostDecrement:
+					unaryOperatorExpression.Expression.AcceptVisitor(this, data);
+					outputFormatter.PrintToken(Tokens.Decrement);
+					return null;
+				case UnaryOperatorType.PostIncrement:
+					unaryOperatorExpression.Expression.AcceptVisitor(this, data);
+					outputFormatter.PrintToken(Tokens.Increment);
+					return null;
+				case UnaryOperatorType.Star:
+					outputFormatter.PrintToken(Tokens.Times);
+					break;
+				case UnaryOperatorType.BitWiseAnd:
+					outputFormatter.PrintToken(Tokens.BitwiseAnd);
+					break;
+			}
+			unaryOperatorExpression.Expression.AcceptVisitor(this, data);
 			return null;
 		}
 		
-		public object Visit(UncheckedExpression uncheckedExpression, object data)
+		public override object Visit(UncheckedExpression uncheckedExpression, object data)
 		{
-//			text.Append("unchecked(");
-//			uncheckedExpression.Expression.AcceptVisitor(this, data);
-//			text.Append(")");
+			outputFormatter.PrintToken(Tokens.Unchecked);
+			outputFormatter.PrintToken(Tokens.OpenParenthesis);
+			uncheckedExpression.Expression.AcceptVisitor(this, data);
+			outputFormatter.PrintToken(Tokens.CloseParenthesis);
 			return null;
 		}
 #endregion

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/PrettyPrinter/SpecialVisitor.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/PrettyPrinter/SpecialVisitor.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/PrettyPrinter/SpecialVisitor.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -19,10 +19,10 @@
 using System.Collections;
 using System.Diagnostics;
 
-using MonoDevelop.SharpRefactory.Parser;
-using MonoDevelop.SharpRefactory.Parser.AST;
+using ICSharpCode.SharpRefactory.Parser;
+using ICSharpCode.SharpRefactory.Parser.AST;
 
-namespace MonoDevelop.SharpRefactory.PrettyPrinter
+namespace ICSharpCode.SharpRefactory.PrettyPrinter
 {
 //	
 //	public class SpecialVisitor

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/SharpRefactory.prjx
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/SharpRefactory.prjx	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/SharpRefactory.prjx	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,157 +1,160 @@
-<Project name="SharpRefactory" description="rfewewrwerewrwe" newfilesearch="None" enableviewstate="True" version="1.1" projecttype="C#">
-  <Contents>
-    <File name=".\Main.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\AssemblyInfo.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\AbstractASTVisitor.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\AttributeTargets.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\IASTVisitor.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\AbstractNode.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\GlobalScope\AttributeSection.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\CompilationUnit.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\TypeLevel\ConstructorDeclaration.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\GlobalScope\DelegateDeclaration.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\TypeLevel\DestructorDeclaration.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\TypeLevel\EventAddRegion.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\TypeLevel\EventDeclaration.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\TypeLevel\EventRemoveRegion.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\TypeLevel\VariableDeclaration.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\TypeLevel\FieldDeclaration.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\TypeLevel\IndexerDeclaration.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\INode.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\TypeLevel\MethodDeclaration.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\GlobalScope\NamespaceDeclaration.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\TypeLevel\OperatorDeclaration.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\TypeLevel\PropertyDeclaration.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\TypeLevel\PropertyGetRegion.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\TypeLevel\PropertySetRegion.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\GlobalScope\TypeDeclaration.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\TypeLevel\TypeReference.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\GlobalScope\UsingAliasDeclaration.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\GlobalScope\UsingDeclaration.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Expressions\AssignmentExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Expressions\BaseReferenceExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Expressions\BinaryOperatorExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Expressions\CastExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Expressions\CheckedExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Expressions\ConditionalExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Expressions\DirectionExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Expressions\Expression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Expressions\FieldReferenceExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Expressions\IdentifierExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Expressions\IndexerExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Expressions\InvocationExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Expressions\ObjectCreateExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\TypeLevel\ParameterDeclarationExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Expressions\ParenthesizedExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Expressions\PointerReferenceExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Expressions\PrimitiveExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Expressions\SizeOfExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Expressions\StackAllocExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Expressions\ThisReferenceExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Expressions\TypeOfExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Expressions\TypeReferenceExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Expressions\UnaryOperatorExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Expressions\UncheckedExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Statements\BlockStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Statements\BreakStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Statements\CheckedStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Statements\ContinueStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Statements\DoWhileStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Statements\EmptyStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Statements\FixedStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Statements\ForeachStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Statements\ForStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Statements\GotoCaseStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Statements\GotoStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Statements\IfElseStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Statements\IfStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Statements\LabelStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Statements\LockStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Statements\ReturnStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Statements\Statement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Statements\StatementExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Statements\SwitchStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Statements\ThrowStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Statements\TryCatchStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Statements\UncheckedStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Statements\UnsafeStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Statements\UsingStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Statements\LocalVariableDeclaration.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Statements\WhileStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\TypeLevel" subtype="Directory" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\GlobalScope" subtype="Directory" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Enums.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\generated\cs.ATG" subtype="Code" buildaction="Nothing" dependson="" data="" />
-    <File name=".\Parser\generated\gen.bat" subtype="Code" buildaction="Exclude" dependson="" data="" />
-    <File name=".\Parser\generated\Parser.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\generated\Parser.frame" subtype="Code" buildaction="Exclude" dependson="" data="" />
-    <File name=".\Parser\generated\Scanner.frame" subtype="Code" buildaction="Exclude" dependson="" data="" />
-    <File name=".\Parser\generated\trace.txt" subtype="Code" buildaction="Exclude" dependson="" data="" />
-    <File name=".\Parser\AST\Modifier.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\PrettyPrinter" subtype="Directory" buildaction="Compile" dependson="" data="" />
-    <File name=".\PrettyPrinter\PrettyPrintVisitor.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\PrettyPrinter\PrettyPrintData.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\PrettyPrinter\PrettyPrintUtil.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\PrettyPrinter\SpecialVisitor.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\CodeDOM" subtype="Directory" buildaction="Compile" dependson="" data="" />
-    <File name=".\CodeDOM\CodeDOMVisitor.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\DebugASTVisitor.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Expressions\ArrayInitializerExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\Expressions\ArrayCreateExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\generated\Scanner.cs.gen" subtype="Code" buildaction="Exclude" dependson="" data="" />
-    <File name=".\Parser\generated\Scanner.frame~" subtype="Code" buildaction="Exclude" dependson="" data="" />
-    <File name=".\VBConverter" subtype="Directory" buildaction="Compile" dependson="" data="" />
-    <File name=".\VBConverter\VBNetVisitor.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\VBConverter\VBNetRefactory.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\generated\cs.ATG~" subtype="Code" buildaction="Exclude" dependson="" data="" />
-    <File name=".\Parser\generated\Parser.frame~" subtype="Code" buildaction="Exclude" dependson="" data="" />
-    <File name=".\Lexer" subtype="Directory" buildaction="Compile" dependson="" data="" />
-    <File name=".\Lexer\Reader\IReader.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Lexer\Reader\FileReader.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Lexer\Reader\StringReader.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Lexer\Reader" subtype="Directory" buildaction="Compile" dependson="" data="" />
-    <File name=".\Lexer\Lexer.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\generated\Error.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\generated\Modifiers.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\generated\ParserUtil.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Lexer\Specials\SpecialTracker.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Lexer\Specials" subtype="Directory" buildaction="Compile" dependson="" data="" />
-    <File name=".\Lexer\Specials\SpecialType.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Lexer\Specials\PreProcessingDirective.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Lexer\Specials\Comment.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Lexer\Specials\BlankLine.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Lexer\Specials\CommentType.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Parser\AST\LookupTableVisitor.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\PrettyPrinter\OutputFormatter.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-    <File name=".\Lexer\Tokens.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
-  </Contents>
-  <References />
-  <DeploymentInformation target="" script="" strategy="File" />
-  <Configuration runwithwarnings="False" name="Release">
-    <CodeGeneration runtime="MsNet" compiler="Csc" warninglevel="4" includedebuginformation="True" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" target="Library" definesymbols="" generatexmldocumentation="False" win32Icon="" />
-    <Execution commandlineparameters="" consolepause="True" />
-    <Output directory="..\..\..\..\bin" assembly="ICSharpCode.SharpRefactory" executeScript="..\..\..\..\bin\SharpDevelop.exe" executeBeforeBuild="" executeAfterBuild="" />
-  </Configuration>
-  <Configurations active="Release">
-    <Configuration runwithwarnings="False" name="Debug">
-      <CodeGeneration runtime="MsNet" compiler="Csc" warninglevel="4" includedebuginformation="True" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" target="Module" definesymbols="" generatexmldocumentation="False" win32Icon="" />
-      <Execution commandlineparameters="" consolepause="True" />
-      <Output directory="..\..\..\..\bin" assembly="ICSharpCode.SharpRefactory" executeScript="" executeBeforeBuild=".\Parser\generated\gen.bat" executeAfterBuild="" />
-    </Configuration>
-    <Configuration runwithwarnings="False" name="Release">
-      <CodeGeneration runtime="MsNet" compiler="Csc" warninglevel="4" includedebuginformation="True" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" target="Library" definesymbols="" generatexmldocumentation="False" win32Icon="" />
-      <Execution commandlineparameters="" consolepause="True" />
-      <Output directory="..\..\..\..\bin" assembly="ICSharpCode.SharpRefactory" executeScript="..\..\..\..\bin\SharpDevelop.exe" executeBeforeBuild="" executeAfterBuild="" />
-    </Configuration>
-    <Configuration runwithwarnings="False" name="Debug2">
-      <CodeGeneration runtime="MsNet" compiler="Csc" warninglevel="4" includedebuginformation="True" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" target="Exe" definesymbols="" generatexmldocumentation="False" win32Icon="" />
-      <Execution commandlineparameters="" consolepause="True" />
-      <Output directory="..\..\..\..\bin" assembly="SharpRefactory" executeScript="" executeBeforeBuild="" executeAfterBuild="" />
-    </Configuration>
-    <Configuration runwithwarnings="False" name="New Configuration">
-      <CodeGeneration runtime="MsNet" compiler="Csc" warninglevel="4" includedebuginformation="True" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" target="Exe" definesymbols="" generatexmldocumentation="False" win32Icon="" />
-      <Execution commandlineparameters="" consolepause="True" />
-      <Output directory="..\..\..\..\bin" assembly="SharpRefactory" executeScript="" executeBeforeBuild="" executeAfterBuild="" />
-    </Configuration>
-  </Configurations>
+<Project name="SharpRefactory" standardNamespace="NewProject" description="rfewewrwerewrwe" newfilesearch="None" enableviewstate="True" version="1.1" projecttype="C#">
+  <Contents>
+    <File name=".\Main.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\AssemblyInfo.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\AbstractASTVisitor.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\AttributeTargets.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\IASTVisitor.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\AbstractNode.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\GlobalScope\AttributeSection.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\CompilationUnit.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\TypeLevel\ConstructorDeclaration.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\GlobalScope\DelegateDeclaration.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\TypeLevel\DestructorDeclaration.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\TypeLevel\EventAddRegion.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\TypeLevel\EventDeclaration.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\TypeLevel\EventRemoveRegion.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\TypeLevel\VariableDeclaration.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\TypeLevel\FieldDeclaration.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\TypeLevel\IndexerDeclaration.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\INode.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\TypeLevel\MethodDeclaration.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\GlobalScope\NamespaceDeclaration.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\TypeLevel\OperatorDeclaration.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\TypeLevel\PropertyDeclaration.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\TypeLevel\PropertyGetRegion.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\TypeLevel\PropertySetRegion.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\GlobalScope\TypeDeclaration.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\TypeLevel\TypeReference.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\GlobalScope\UsingAliasDeclaration.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\GlobalScope\UsingDeclaration.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Expressions\AssignmentExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Expressions\BaseReferenceExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Expressions\BinaryOperatorExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Expressions\CastExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Expressions\CheckedExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Expressions\ConditionalExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Expressions\DirectionExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Expressions\Expression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Expressions\FieldReferenceExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Expressions\IdentifierExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Expressions\IndexerExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Expressions\InvocationExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Expressions\ObjectCreateExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\TypeLevel\ParameterDeclarationExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Expressions\ParenthesizedExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Expressions\PointerReferenceExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Expressions\PrimitiveExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Expressions\SizeOfExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Expressions\StackAllocExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Expressions\ThisReferenceExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Expressions\TypeOfExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Expressions\TypeReferenceExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Expressions\UnaryOperatorExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Expressions\UncheckedExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Statements\BlockStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Statements\BreakStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Statements\CheckedStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Statements\ContinueStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Statements\DoWhileStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Statements\EmptyStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Statements\FixedStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Statements\ForeachStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Statements\ForStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Statements\GotoCaseStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Statements\GotoStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Statements\IfElseStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Statements\IfStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Statements\LabelStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Statements\LockStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Statements\ReturnStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Statements\Statement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Statements\StatementExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Statements\SwitchStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Statements\ThrowStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Statements\TryCatchStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Statements\UncheckedStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Statements\UnsafeStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Statements\UsingStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Statements\LocalVariableDeclaration.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Statements\WhileStatement.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\TypeLevel" subtype="Directory" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\GlobalScope" subtype="Directory" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Enums.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\generated\cs.ATG" subtype="Code" buildaction="Nothing" dependson="" data="" />
+    <File name=".\Parser\generated\gen.bat" subtype="Code" buildaction="Exclude" dependson="" data="" />
+    <File name=".\Parser\generated\Parser.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\generated\Parser.frame" subtype="Code" buildaction="Exclude" dependson="" data="" />
+    <File name=".\Parser\generated\Scanner.frame" subtype="Code" buildaction="Exclude" dependson="" data="" />
+    <File name=".\Parser\generated\trace.txt" subtype="Code" buildaction="Exclude" dependson="" data="" />
+    <File name=".\Parser\AST\Modifier.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\PrettyPrinter" subtype="Directory" buildaction="Compile" dependson="" data="" />
+    <File name=".\PrettyPrinter\PrettyPrintVisitor.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\PrettyPrinter\PrettyPrintData.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\PrettyPrinter\PrettyPrintUtil.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\PrettyPrinter\SpecialVisitor.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\CodeDOM" subtype="Directory" buildaction="Compile" dependson="" data="" />
+    <File name=".\CodeDOM\CodeDOMVisitor.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\DebugASTVisitor.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Expressions\ArrayInitializerExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\Expressions\ArrayCreateExpression.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\generated\Scanner.cs.gen" subtype="Code" buildaction="Exclude" dependson="" data="" />
+    <File name=".\Parser\generated\Scanner.frame~" subtype="Code" buildaction="Exclude" dependson="" data="" />
+    <File name=".\VBConverter" subtype="Directory" buildaction="Compile" dependson="" data="" />
+    <File name=".\VBConverter\VBNetVisitor.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\VBConverter\VBNetRefactory.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\generated\cs.ATG~" subtype="Code" buildaction="Exclude" dependson="" data="" />
+    <File name=".\Parser\generated\Parser.frame~" subtype="Code" buildaction="Exclude" dependson="" data="" />
+    <File name=".\Lexer" subtype="Directory" buildaction="Compile" dependson="" data="" />
+    <File name=".\Lexer\Reader\IReader.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Lexer\Reader\FileReader.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Lexer\Reader\StringReader.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Lexer\Reader" subtype="Directory" buildaction="Compile" dependson="" data="" />
+    <File name=".\Lexer\Lexer.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\generated\Error.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\generated\Modifiers.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\generated\ParserUtil.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Lexer\Specials\SpecialTracker.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Lexer\Specials" subtype="Directory" buildaction="Compile" dependson="" data="" />
+    <File name=".\Lexer\Specials\SpecialType.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Lexer\Specials\PreProcessingDirective.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Lexer\Specials\Comment.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Lexer\Specials\BlankLine.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Lexer\Specials\CommentType.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\AST\LookupTableVisitor.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\PrettyPrinter\OutputFormatter.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\generated\keywordlist\Tokens.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\generated\keywordlist" subtype="Directory" buildaction="Compile" dependson="" data="" />
+    <File name=".\Parser\generated\keywordlist\CSharpKeywordList.txt" subtype="Code" buildaction="Nothing" dependson="" data="" />
+    <File name=".\Parser\generated\keywordlist\Keywords.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
+  </Contents>
+  <References />
+  <DeploymentInformation target="" script="" strategy="File" />
+  <Configuration runwithwarnings="False" name="Debug">
+    <CodeGeneration runtime="MsNet" compiler="Csc" warninglevel="4" nowarn="" includedebuginformation="True" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" target="Library" definesymbols="" generatexmldocumentation="False" win32Icon="" />
+    <Execution commandlineparameters="" consolepause="True" />
+    <Output directory="..\..\..\..\bin" assembly="ICSharpCode.SharpRefactory" executeScript="..\..\..\..\bin\SharpDevelop.exe" executeBeforeBuild=".\Parser\generated\gen.bat" executeAfterBuild="" />
+  </Configuration>
+  <Configurations active="Debug">
+    <Configuration runwithwarnings="False" name="Debug">
+      <CodeGeneration runtime="MsNet" compiler="Csc" warninglevel="4" nowarn="" includedebuginformation="True" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" target="Library" definesymbols="" generatexmldocumentation="False" win32Icon="" />
+      <Execution commandlineparameters="" consolepause="True" />
+      <Output directory="..\..\..\..\bin" assembly="ICSharpCode.SharpRefactory" executeScript="..\..\..\..\bin\SharpDevelop.exe" executeBeforeBuild=".\Parser\generated\gen.bat" executeAfterBuild="" />
+    </Configuration>
+    <Configuration runwithwarnings="False" name="Release">
+      <CodeGeneration runtime="MsNet" compiler="Csc" warninglevel="0" nowarn="" includedebuginformation="True" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" target="Library" definesymbols="" generatexmldocumentation="False" win32Icon="" />
+      <Execution commandlineparameters="" consolepause="True" />
+      <Output directory="..\..\..\..\bin" assembly="ICSharpCode.SharpRefactory" executeScript="..\..\..\..\bin\SharpDevelop.exe" executeBeforeBuild=".\Parser\generated\gen.bat" executeAfterBuild="" />
+    </Configuration>
+    <Configuration runwithwarnings="False" name="Executable">
+      <CodeGeneration runtime="MsNet" compiler="Csc" warninglevel="4" nowarn="" includedebuginformation="True" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" target="Exe" definesymbols="" generatexmldocumentation="False" win32Icon="" />
+      <Execution commandlineparameters="" consolepause="True" />
+      <Output directory="..\..\..\..\bin" assembly="ICSharpCode.SharpRefactory" executeScript="" executeBeforeBuild="" executeAfterBuild="" />
+    </Configuration>
+    <Configuration runwithwarnings="False" name="Executable/withoutATGGen">
+      <CodeGeneration runtime="MsNet" compiler="Csc" warninglevel="4" nowarn="" includedebuginformation="True" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" target="Exe" definesymbols="" generatexmldocumentation="False" win32Icon="" />
+      <Execution commandlineparameters="" consolepause="True" />
+      <Output directory="..\..\..\..\bin" assembly="ICSharpCode.SharpRefactory" executeScript="" executeBeforeBuild="" executeAfterBuild="" />
+    </Configuration>
+  </Configurations>
 </Project>
\ No newline at end of file

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/VBConverter/VBNetRefactory.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/VBConverter/VBNetRefactory.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/VBConverter/VBNetRefactory.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -22,10 +22,10 @@
 using System.Collections;
 
 
-using MonoDevelop.SharpRefactory.Parser;
-using MonoDevelop.SharpRefactory.Parser.AST;
+using ICSharpCode.SharpRefactory.Parser;
+using ICSharpCode.SharpRefactory.Parser.AST;
 
-namespace MonoDevelop.SharpRefactory.PrettyPrinter
+namespace ICSharpCode.SharpRefactory.PrettyPrinter
 {
 	public class VBNetRefactory
 	{

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/VBConverter/VBNetVisitor.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/VBConverter/VBNetVisitor.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/VBConverter/VBNetVisitor.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -22,12 +22,12 @@
 using System.Collections;
 
 
-using MonoDevelop.SharpRefactory.Parser;
-using MonoDevelop.SharpRefactory.Parser.AST;
+using ICSharpCode.SharpRefactory.Parser;
+using ICSharpCode.SharpRefactory.Parser.AST;
 
-namespace MonoDevelop.SharpRefactory.PrettyPrinter
+namespace ICSharpCode.SharpRefactory.PrettyPrinter
 {
-	public class VBNetVisitor : IASTVisitor
+	public class VBNetVisitor : AbstractASTVisitor
 	{
 		StringBuilder   sourceText  = new StringBuilder();
 		int             indentLevel = 0;
@@ -40,11 +40,13 @@
 			}
 		}
 		
-#region MonoDevelop.SharpRefactory.Parser.IASTVisitor interface implementation
-		public object Visit(INode node, object data)
+#region ICSharpCode.SharpRefactory.Parser.IASTVisitor interface implementation
+		public override object Visit(INode node, object data)
 		{
-			errors.Error(-1, -1, String.Format("visited unknown node '{0}' ", node));
-			return String.Empty;
+			errors.Error(-1, -1, String.Format("Visited INode (should NEVER HAPPEN)"));
+			Console.WriteLine("Visitor was: " + this.GetType());
+			Console.WriteLine("Node was : " + node.GetType());
+			return node.AcceptChildren(this, data);
 		}
 		
 		public void AppendIndentation()
@@ -64,7 +66,7 @@
 //			Console.WriteLine(o.ToString());
 		}
 		
-		public object Visit(CompilationUnit compilationUnit, object data)
+		public override object Visit(CompilationUnit compilationUnit, object data)
 		{
 			DebugOutput(compilationUnit);
 			new VBNetRefactory().Refactor(compilationUnit);
@@ -72,7 +74,7 @@
 			return null;
 		}
 		
-		public object Visit(NamespaceDeclaration namespaceDeclaration, object data)
+		public override object Visit(NamespaceDeclaration namespaceDeclaration, object data)
 		{
 			DebugOutput(namespaceDeclaration);
 			AppendIndentation();sourceText.Append("Namespace ");
@@ -86,7 +88,7 @@
 			return null;
 		}
 		
-		public object Visit(UsingDeclaration usingDeclaration, object data)
+		public override object Visit(UsingDeclaration usingDeclaration, object data)
 		{
 			DebugOutput(usingDeclaration);
 			AppendIndentation();sourceText.Append("Imports ");
@@ -95,7 +97,7 @@
 			return null;
 		}
 		
-		public object Visit(UsingAliasDeclaration usingAliasDeclaration, object data)
+		public override object Visit(UsingAliasDeclaration usingAliasDeclaration, object data)
 		{
 			DebugOutput(usingAliasDeclaration);
 			AppendIndentation();sourceText.Append("Imports ");
@@ -106,7 +108,7 @@
 			return null;
 		}
 		
-		public object Visit(AttributeSection attributeSection, object data)
+		public override object Visit(AttributeSection attributeSection, object data)
 		{
 			DebugOutput(attributeSection);
 			AppendIndentation();sourceText.Append("<");
@@ -115,7 +117,7 @@
 				sourceText.Append(": ");
 			}
 			for (int j = 0; j < attributeSection.Attributes.Count; ++j) {
-				MonoDevelop.SharpRefactory.Parser.AST.Attribute attr = (MonoDevelop.SharpRefactory.Parser.AST.Attribute)attributeSection.Attributes[j];
+				ICSharpCode.SharpRefactory.Parser.AST.Attribute attr = (ICSharpCode.SharpRefactory.Parser.AST.Attribute)attributeSection.Attributes[j];
 				
 				sourceText.Append(attr.Name);
 				sourceText.Append("(");
@@ -126,7 +128,7 @@
 						sourceText.Append(", ");
 					}
 				}
-
+				
 				for (int i = 0; i < attr.NamedArguments.Count; ++i) {
 					NamedArgument named = (NamedArgument)attr.NamedArguments[i];
 					sourceText.Append(named.Name);
@@ -149,7 +151,7 @@
 			return null;
 		}
 		
-		public object Visit(TypeDeclaration typeDeclaration, object data)
+		public override object Visit(TypeDeclaration typeDeclaration, object data)
 		{
 			DebugOutput(typeDeclaration);
 			AppendNewLine();
@@ -210,7 +212,7 @@
 			return null;
 		}
 		
-		public object Visit(DelegateDeclaration delegateDeclaration, object data)
+		public override object Visit(DelegateDeclaration delegateDeclaration, object data)
 		{
 			DebugOutput(delegateDeclaration);
 			AppendNewLine();
@@ -236,7 +238,7 @@
 			return null;
 		}
 		
-		public object Visit(VariableDeclaration variableDeclaration, object data)
+		public override object Visit(VariableDeclaration variableDeclaration, object data)
 		{
 			// called inside ENUMS
 //			AppendAttributes(field.Attributes);
@@ -249,7 +251,7 @@
 			return null;
 		}
 		
-		public object Visit(FieldDeclaration fieldDeclaration, object data)
+		public override object Visit(FieldDeclaration fieldDeclaration, object data)
 		{
 			DebugOutput(fieldDeclaration);
 			foreach (VariableDeclaration field in fieldDeclaration.Fields) {
@@ -273,7 +275,7 @@
 			return null;
 		}
 		
-		public object Visit(MethodDeclaration methodDeclaration, object data)
+		public override object Visit(MethodDeclaration methodDeclaration, object data)
 		{
 			DebugOutput(methodDeclaration);
 			AppendNewLine();
@@ -307,7 +309,7 @@
 			return null;
 		}
 		
-		public object Visit(PropertyDeclaration propertyDeclaration, object data)
+		public override object Visit(PropertyDeclaration propertyDeclaration, object data)
 		{
 			DebugOutput(propertyDeclaration);
 			AppendNewLine();
@@ -343,7 +345,7 @@
 			return null;
 		}
 		
-		public object Visit(PropertyGetRegion propertyGetRegion, object data)
+		public override object Visit(PropertyGetRegion propertyGetRegion, object data)
 		{
 			DebugOutput(propertyGetRegion);
 			AppendAttributes(propertyGetRegion.Attributes);
@@ -360,7 +362,7 @@
 			return null;
 		}
 		
-		public object Visit(PropertySetRegion propertySetRegion, object data)
+		public override object Visit(PropertySetRegion propertySetRegion, object data)
 		{
 			DebugOutput(propertySetRegion);
 			AppendAttributes(propertySetRegion.Attributes);
@@ -378,7 +380,7 @@
 			return null;
 		}
 		
-		public object Visit(EventDeclaration eventDeclaration, object data)
+		public override object Visit(EventDeclaration eventDeclaration, object data)
 		{
 			DebugOutput(eventDeclaration);
 			AppendNewLine();
@@ -412,19 +414,19 @@
 			return data;
 		}
 		
-		public object Visit(EventAddRegion eventAddRegion, object data)
+		public override object Visit(EventAddRegion eventAddRegion, object data)
 		{
 			// should never be called:
 			throw new System.NotSupportedException();
 		}
 		
-		public object Visit(EventRemoveRegion eventRemoveRegion, object data)
+		public override object Visit(EventRemoveRegion eventRemoveRegion, object data)
 		{
 			// should never be called:
 			throw new System.NotSupportedException();
 		}
 		
-		public object Visit(ConstructorDeclaration constructorDeclaration, object data)
+		public override object Visit(ConstructorDeclaration constructorDeclaration, object data)
 		{
 			DebugOutput(constructorDeclaration);
 			AppendNewLine();
@@ -444,7 +446,7 @@
 			return null;
 		}
 		
-		public object Visit(DestructorDeclaration destructorDeclaration, object data)
+		public override object Visit(DestructorDeclaration destructorDeclaration, object data)
 		{
 			DebugOutput(destructorDeclaration);
 			AppendNewLine();
@@ -460,13 +462,13 @@
 			return null;
 		}
 		
-		public object Visit(OperatorDeclaration operatorDeclaration, object data)
+		public override object Visit(OperatorDeclaration operatorDeclaration, object data)
 		{
 			errors.Error(-1, -1, String.Format("Operator overloading cannot be performed"));
 			return null;
 		}
 		
-		public object Visit(IndexerDeclaration indexerDeclaration, object data)
+		public override object Visit(IndexerDeclaration indexerDeclaration, object data)
 		{
 			DebugOutput(indexerDeclaration);
 			
@@ -498,14 +500,14 @@
 			return null;
 		}
 		
-		public object Visit(BlockStatement blockStatement, object data)
+		public override object Visit(BlockStatement blockStatement, object data)
 		{
 			DebugOutput(blockStatement);
 			blockStatement.AcceptChildren(this, data);
 			return null;
 		}
 		
-		public object Visit(StatementExpression statementExpression, object data)
+		public override object Visit(StatementExpression statementExpression, object data)
 		{
 			DebugOutput(statementExpression);
 			AppendIndentation();sourceText.Append(statementExpression.Expression.AcceptVisitor(this, statementExpression).ToString());
@@ -513,7 +515,7 @@
 			return null;
 		}
 		
-		public object Visit(LocalVariableDeclaration localVariableDeclaration, object data)
+		public override object Visit(LocalVariableDeclaration localVariableDeclaration, object data)
 		{
 			DebugOutput(localVariableDeclaration);
 			foreach (VariableDeclaration localVar in localVariableDeclaration.Variables) {
@@ -546,14 +548,14 @@
 			return null;
 		}
 		
-		public object Visit(EmptyStatement emptyStatement, object data)
+		public override object Visit(EmptyStatement emptyStatement, object data)
 		{
 			DebugOutput(emptyStatement);
 			AppendNewLine();
 			return null;
 		}
 		
-		public object Visit(ReturnStatement returnStatement, object data)
+		public override object Visit(ReturnStatement returnStatement, object data)
 		{
 			DebugOutput(returnStatement);
 			AppendIndentation();sourceText.Append("Return");
@@ -565,7 +567,7 @@
 			return null;
 		}
 		
-		public object Visit(IfStatement ifStatement, object data)
+		public override object Visit(IfStatement ifStatement, object data)
 		{
 			DebugOutput(ifStatement);
 			AppendIndentation();
@@ -591,7 +593,7 @@
 			return null;
 		}
 		
-		public object Visit(IfElseStatement ifElseStatement, object data)
+		public override object Visit(IfElseStatement ifElseStatement, object data)
 		{
 			DebugOutput(ifElseStatement);
 			AppendIndentation();sourceText.Append("If ");
@@ -615,7 +617,7 @@
 			return null;
 		}
 		
-		public object Visit(WhileStatement whileStatement, object data)
+		public override object Visit(WhileStatement whileStatement, object data)
 		{
 			DebugOutput(whileStatement);
 			AppendIndentation();sourceText.Append("While ");
@@ -631,7 +633,7 @@
 			return null;
 		}
 		
-		public object Visit(DoWhileStatement doWhileStatement, object data)
+		public override object Visit(DoWhileStatement doWhileStatement, object data)
 		{
 			DebugOutput(doWhileStatement);
 			AppendIndentation();sourceText.Append("Do While");
@@ -647,7 +649,7 @@
 			return null;
 		}
 		
-		public object Visit(ForStatement forStatement, object data)
+		public override object Visit(ForStatement forStatement, object data)
 		{
 			DebugOutput(forStatement);
 			if (forStatement.Initializers != null) {
@@ -685,7 +687,7 @@
 			return null;
 		}
 		
-		public object Visit(LabelStatement labelStatement, object data)
+		public override object Visit(LabelStatement labelStatement, object data)
 		{
 			DebugOutput(labelStatement);
 			AppendIndentation();sourceText.Append(labelStatement.Label);
@@ -694,7 +696,7 @@
 			return null;
 		}
 		
-		public object Visit(GotoStatement gotoStatement, object data)
+		public override object Visit(GotoStatement gotoStatement, object data)
 		{
 			DebugOutput(gotoStatement);
 			AppendIndentation();sourceText.Append("Goto ");
@@ -703,7 +705,7 @@
 			return null;
 		}
 		
-		public object Visit(SwitchStatement switchStatement, object data)
+		public override object Visit(SwitchStatement switchStatement, object data)
 		{
 			DebugOutput(switchStatement);
 			AppendIndentation();sourceText.Append("Select ");
@@ -734,7 +736,7 @@
 			return null;
 		}
 		
-		public object Visit(BreakStatement breakStatement, object data)
+		public override object Visit(BreakStatement breakStatement, object data)
 		{
 			DebugOutput(breakStatement);
 			AppendIndentation();sourceText.Append("' break");
@@ -742,7 +744,7 @@
 			return null;
 		}
 		
-		public object Visit(ContinueStatement continueStatement, object data)
+		public override object Visit(ContinueStatement continueStatement, object data)
 		{
 			DebugOutput(continueStatement);
 			AppendIndentation();sourceText.Append("' continue");
@@ -750,7 +752,7 @@
 			return null;
 		}
 		
-		public object Visit(GotoCaseStatement gotoCaseStatement, object data)
+		public override object Visit(GotoCaseStatement gotoCaseStatement, object data)
 		{
 			DebugOutput(gotoCaseStatement);
 			AppendIndentation();sourceText.Append("' goto case ");
@@ -763,7 +765,7 @@
 			return null;
 		}
 		
-		public object Visit(ForeachStatement foreachStatement, object data)
+		public override object Visit(ForeachStatement foreachStatement, object data)
 		{
 			DebugOutput(foreachStatement);
 			AppendIndentation();sourceText.Append("For Each ");
@@ -783,7 +785,7 @@
 			return null;
 		}
 		
-		public object Visit(LockStatement lockStatement, object data)
+		public override object Visit(LockStatement lockStatement, object data)
 		{
 			DebugOutput(lockStatement);
 			AppendIndentation();sourceText.Append("SyncLock ");
@@ -799,7 +801,7 @@
 			return null;
 		}
 		
-		public object Visit(UsingStatement usingStatement, object data)
+		public override object Visit(UsingStatement usingStatement, object data)
 		{
 			DebugOutput(usingStatement);
 			// TODO : anything like this ?
@@ -811,7 +813,7 @@
 			return null;
 		}
 		
-		public object Visit(TryCatchStatement tryCatchStatement, object data)
+		public override object Visit(TryCatchStatement tryCatchStatement, object data)
 		{
 			DebugOutput(tryCatchStatement);
 			AppendIndentation();sourceText.Append("Try");
@@ -853,7 +855,7 @@
 			return null;
 		}
 		
-		public object Visit(ThrowStatement throwStatement, object data)
+		public override object Visit(ThrowStatement throwStatement, object data)
 		{
 			DebugOutput(throwStatement);
 			AppendIndentation();sourceText.Append("Throw ");
@@ -862,28 +864,28 @@
 			return null;
 		}
 		
-		public object Visit(FixedStatement fixedStatement, object data)
+		public override object Visit(FixedStatement fixedStatement, object data)
 		{
 			DebugOutput(fixedStatement);
 			errors.Error(-1, -1, String.Format("fixed statement not suported by VB.NET"));
 			return null;
 		}
 		
-		public virtual object Visit(CheckedStatement checkedStatement, object data)
+		public override object Visit(CheckedStatement checkedStatement, object data)
 		{
 			DebugOutput(checkedStatement);
 			errors.Error(-1, -1, String.Format("checked statement not suported by VB.NET"));
 			return null;
 		}
 		
-		public virtual object Visit(UncheckedStatement uncheckedStatement, object data)
+		public override object Visit(UncheckedStatement uncheckedStatement, object data)
 		{
 			DebugOutput(uncheckedStatement);
 			errors.Error(-1, -1, String.Format("unchecked statement not suported by VB.NET"));
 			return null;
 		}
 		
-		public object Visit(PrimitiveExpression primitiveExpression, object data)
+		public override object Visit(PrimitiveExpression primitiveExpression, object data)
 		{
 			DebugOutput(primitiveExpression);
 			if (primitiveExpression.Value == null) {
@@ -911,7 +913,7 @@
 			return primitiveExpression.Value;
 		}
 		
-		public object Visit(BinaryOperatorExpression binaryOperatorExpression, object data)
+		public override object Visit(BinaryOperatorExpression binaryOperatorExpression, object data)
 		{
 			DebugOutput(binaryOperatorExpression);
 			string op = null;
@@ -969,7 +971,7 @@
 					                     left,
 					                     ", GetType(",
 					                     right,
-					                     "), ",
+					                     ")), ",
 					                     right,
 					                     ")");
 				case BinaryOperatorType.IS:
@@ -1017,7 +1019,7 @@
 			                     right);
 		}
 		
-		public object Visit(ParenthesizedExpression parenthesizedExpression, object data)
+		public override object Visit(ParenthesizedExpression parenthesizedExpression, object data)
 		{
 			DebugOutput(parenthesizedExpression);
 			string innerExpr = parenthesizedExpression.Expression.AcceptVisitor(this, data).ToString();
@@ -1031,7 +1033,7 @@
 			return String.Concat("(", innerExpr, ")");
 		}
 		
-		public object Visit(InvocationExpression invocationExpression, object data)
+		public override object Visit(InvocationExpression invocationExpression, object data)
 		{
 			DebugOutput(invocationExpression);
 			string backString;
@@ -1057,19 +1059,19 @@
 			return backString;
 		}
 		
-		public object Visit(IdentifierExpression identifierExpression, object data)
+		public override object Visit(IdentifierExpression identifierExpression, object data)
 		{
 			DebugOutput(identifierExpression);
 			return identifierExpression.Identifier;
 		}
 		
-		public object Visit(TypeReferenceExpression typeReferenceExpression, object data)
+		public override object Visit(TypeReferenceExpression typeReferenceExpression, object data)
 		{
 			DebugOutput(typeReferenceExpression);
 			return GetTypeString(typeReferenceExpression.TypeReference);
 		}
 		
-		public object Visit(UnaryOperatorExpression unaryOperatorExpression, object data)
+		public override object Visit(UnaryOperatorExpression unaryOperatorExpression, object data)
 		{
 			DebugOutput(unaryOperatorExpression);
 			switch (unaryOperatorExpression.Op) {
@@ -1096,7 +1098,7 @@
 			throw new System.NotSupportedException();
 		}
 		
-		public object Visit(AssignmentExpression assignmentExpression, object data)
+		public override object Visit(AssignmentExpression assignmentExpression, object data)
 		{
 			DebugOutput(assignmentExpression);
 			string op   = null;
@@ -1149,14 +1151,14 @@
 			                     right);
 		}
 		
-		public object Visit(SizeOfExpression sizeOfExpression, object data)
+		public override object Visit(SizeOfExpression sizeOfExpression, object data)
 		{
 			DebugOutput(sizeOfExpression);
 			errors.Error(-1, -1, String.Format("sizeof expression not suported by VB.NET"));
 			return null;
 		}
 		
-		public object Visit(TypeOfExpression typeOfExpression, object data)
+		public override object Visit(TypeOfExpression typeOfExpression, object data)
 		{
 			DebugOutput(typeOfExpression);
 			return String.Concat("GetType(",
@@ -1164,25 +1166,25 @@
 			                     ")");
 		}
 		
-		public object Visit(CheckedExpression checkedExpression, object data)
+		public override object Visit(CheckedExpression checkedExpression, object data)
 		{
 			return String.Concat("'Checked expression (can't convert):",
 			                     checkedExpression.Expression.AcceptVisitor(this, data));
 		}
 		
-		public object Visit(UncheckedExpression uncheckedExpression, object data)
+		public override object Visit(UncheckedExpression uncheckedExpression, object data)
 		{
 			return String.Concat("'Unhecked expression (can't convert):",
 			                     uncheckedExpression.Expression.AcceptVisitor(this, data));
 		}
 		
-		public object Visit(PointerReferenceExpression pointerReferenceExpression, object data)
+		public override object Visit(PointerReferenceExpression pointerReferenceExpression, object data)
 		{
 			errors.Error(-1, -1, String.Format("pointer reference (->) not suported by VB.NET"));
 			return String.Empty;
 		}
 		
-		public object Visit(CastExpression castExpression, object data)
+		public override object Visit(CastExpression castExpression, object data)
 		{
 			DebugOutput(castExpression);
 			return String.Format("CType({0}, {1})",
@@ -1190,32 +1192,32 @@
 			                     GetTypeString(castExpression.CastTo));
 		}
 		
-		public object Visit(StackAllocExpression stackAllocExpression, object data)
+		public override object Visit(StackAllocExpression stackAllocExpression, object data)
 		{
 			errors.Error(-1, -1, String.Format("stack alloc expression not suported by VB.NET"));
 			return String.Empty;
 		}
 		
-		public object Visit(IndexerExpression indexerExpression, object data)
+		public override object Visit(IndexerExpression indexerExpression, object data)
 		{
 			DebugOutput(indexerExpression);
 			return String.Concat(indexerExpression.TargetObject.AcceptVisitor(this, data),
 			                     GetParameters(indexerExpression.Indices));
 		}
 		
-		public object Visit(ThisReferenceExpression thisReferenceExpression, object data)
+		public override object Visit(ThisReferenceExpression thisReferenceExpression, object data)
 		{
 			DebugOutput(thisReferenceExpression);
 			return "Me";
 		}
 		
-		public object Visit(BaseReferenceExpression baseReferenceExpression, object data)
+		public override object Visit(BaseReferenceExpression baseReferenceExpression, object data)
 		{
 			DebugOutput(baseReferenceExpression);
 			return "MyBase";
 		}
 		
-		public object Visit(ObjectCreateExpression objectCreateExpression, object data)
+		public override object Visit(ObjectCreateExpression objectCreateExpression, object data)
 		{
 			DebugOutput(objectCreateExpression);
 			if (IsEventHandlerCreation(objectCreateExpression)) {
@@ -1234,7 +1236,7 @@
 			                     );
 		}
 		
-		public object Visit(ArrayCreateExpression arrayCreateExpression, object data)
+		public override object Visit(ArrayCreateExpression arrayCreateExpression, object data)
 		{
 			DebugOutput(arrayCreateExpression);
 			string arrayInitializer = String.Empty;
@@ -1247,10 +1249,13 @@
 			}
 			
 			if (arrayCreateExpression.Parameters != null && arrayCreateExpression.Parameters.Count > 0) {
-				foreach (Expression expr in arrayCreateExpression.Parameters) {
-					arrayParameters += "(";
-					arrayParameters += expr.AcceptVisitor(this, data);
-					arrayParameters += ")";
+				foreach (ArrayCreationParameter param in arrayCreateExpression.Parameters) {
+					// TODO: multidimensional arrays ?
+					foreach (Expression expr in param.Expressions) {
+						arrayParameters += "(";
+						arrayParameters += expr.AcceptVisitor(this, data);
+						arrayParameters += ")";
+					}
 				}
 			} else {
 				arrayParameters = "()";
@@ -1263,13 +1268,13 @@
 			                     );
 		}
 		
-		public object Visit(ParameterDeclarationExpression parameterDeclarationExpression, object data)
+		public override object Visit(ParameterDeclarationExpression parameterDeclarationExpression, object data)
 		{
 			// should never be called:
 			throw new System.NotImplementedException();
 		}
 		
-		public object Visit(FieldReferenceExpression fieldReferenceExpression, object data)
+		public override object Visit(FieldReferenceExpression fieldReferenceExpression, object data)
 		{
 			DebugOutput(fieldReferenceExpression);
 			if (fieldReferenceExpression.TargetObject is ObjectCreateExpression) {
@@ -1283,7 +1288,7 @@
 			                     fieldReferenceExpression.FieldName);
 		}
 		
-		public object Visit(DirectionExpression directionExpression, object data)
+		public override object Visit(DirectionExpression directionExpression, object data)
 		{
 			DebugOutput(directionExpression);
 			string fieldDirection = String.Empty;
@@ -1297,14 +1302,14 @@
 			return String.Concat(fieldDirection, directionExpression.Expression.AcceptVisitor(this, data));
 		}
 		
-		public object Visit(ArrayInitializerExpression arrayInitializerExpression, object data)
+		public override object Visit(ArrayInitializerExpression arrayInitializerExpression, object data)
 		{
 			return String.Concat(" {",
 			                     GetExpressionList(arrayInitializerExpression.CreateExpressions),
 			                     "}");
 		}
 		
-		public object Visit(ConditionalExpression conditionalExpression, object data)
+		public override object Visit(ConditionalExpression conditionalExpression, object data)
 		{
 			errors.Error(-1, -1, String.Format("TODO: Conditionals :)"));
 			return String.Empty;
@@ -1411,10 +1416,6 @@
 				builder.Append("NotInheritable ");
 			}
 			
-			if ((modifier & Modifier.Sealed) == Modifier.Sealed) {
-				builder.Append("NotInheritable ");
-			}
-			
 			if ((modifier & Modifier.Const) == Modifier.Const) {
 				builder.Append("Const ");
 			}
@@ -1422,10 +1423,6 @@
 				builder.Append("ReadOnly ");
 			}
 			
-			if ((modifier & Modifier.Const) == Modifier.Const) {
-				builder.Append("Const ");
-			}
-			
 			// TODO : Extern 
 			if ((modifier & Modifier.Extern) == Modifier.Extern) {
 				errors.Error(-1, -1, String.Format("'Extern' modifier not convertable"));
@@ -1506,7 +1503,6 @@
 			if (op != null && op.Op == BinaryOperatorType.InEquality) {
 				if (op.Left is IdentifierExpression && op.Right is PrimitiveExpression && ((PrimitiveExpression)op.Right).Value == null) {
 					string identifier = ((IdentifierExpression)op.Left).Identifier;
-					Console.WriteLine(ifStatement.EmbeddedStatement);
 					StatementExpression se = null;
 					if (ifStatement.EmbeddedStatement is StatementExpression) {
 						se = (StatementExpression)ifStatement.EmbeddedStatement;
@@ -1527,7 +1523,6 @@
 								}
 							}
 							if (methodName != null && methodName == identifier) {
-								Console.WriteLine(methodName);
 								foreach (object o in this.currentType.Children) {
 									EventDeclaration ed = o as EventDeclaration;
 									if (ed != null) {

Added: trunk/MonoDevelop/src/Main/Base/ChangeLog
===================================================================
--- trunk/MonoDevelop/src/Main/Base/ChangeLog	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Main/Base/ChangeLog	2004-03-21 06:22:28 UTC (rev 1213)
@@ -0,0 +1,4 @@
+2004-04-21  Todd Berman  <tberman at sevenl.net>
+
+	* Commands/VBConverter/ConvertProject.cs:
+	* Commands/VBConverter/ConvertBuffer.cs: Changed to use new parser

Modified: trunk/MonoDevelop/src/Main/Base/Commands/VBConverter/ConvertBuffer.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Commands/VBConverter/ConvertBuffer.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Main/Base/Commands/VBConverter/ConvertBuffer.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -26,8 +26,8 @@
 using MonoDevelop.Gui.Dialogs;
 using MonoDevelop.Services;
 
-using MonoDevelop.SharpRefactory.PrettyPrinter;
-using MonoDevelop.SharpRefactory.Parser;
+using ICSharpCode.SharpRefactory.PrettyPrinter;
+using ICSharpCode.SharpRefactory.Parser;
 
 namespace MonoDevelop.Commands
 {
@@ -40,7 +40,7 @@
 			if (window != null && window.ViewContent is IEditable) {
 				
 				Parser p = new Parser();
-				p.Parse(new Lexer(new MonoDevelop.SharpRefactory.Parser.StringReader(((IEditable)window.ViewContent).Text)));
+				p.Parse(new Lexer(new ICSharpCode.SharpRefactory.Parser.StringReader(((IEditable)window.ViewContent).Text)));
 				
 				if (p.Errors.count > 0) {
 					IMessageService messageService =(IMessageService)ServiceManager.Services.GetService(typeof(IMessageService));

Modified: trunk/MonoDevelop/src/Main/Base/Commands/VBConverter/ConvertProject.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Commands/VBConverter/ConvertProject.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Main/Base/Commands/VBConverter/ConvertProject.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -26,8 +26,8 @@
 using MonoDevelop.Gui.Dialogs;
 using MonoDevelop.Services;
 
-using MonoDevelop.SharpRefactory.PrettyPrinter;
-using MonoDevelop.SharpRefactory.Parser;
+using ICSharpCode.SharpRefactory.PrettyPrinter;
+using ICSharpCode.SharpRefactory.Parser;
 
 namespace MonoDevelop.Commands
 {

Modified: trunk/MonoDevelop/src/Main/Base/Services/MonodocService.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Services/MonodocService.cs	2004-03-21 06:19:29 UTC (rev 1212)
+++ trunk/MonoDevelop/src/Main/Base/Services/MonodocService.cs	2004-03-21 06:22:28 UTC (rev 1213)
@@ -1,4 +1,5 @@
 using System;
+using System.Xml;
 
 using Monodoc;
 
@@ -21,6 +22,8 @@
 			get { return helpTree; }
 		}
 
+		//public XmlDocument GetHelpXml (string type) {
+		//	return helpTree.GetHelpXml ("T:" + type);
+		//}
 	}
-
 }




More information about the Monodevelop-patches-list mailing list