Browse Source

Fixed SD2-1481: C# parser does not support extern aliases

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@3718 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 17 years ago
parent
commit
a9a5a21b9a
  1. 6
      src/AddIns/BackendBindings/Boo/NRefactoryToBooConverter/Project/ConvertVisitorGlobal.cs
  2. 6
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/NRefactoryToPythonConverter.cs
  3. 1
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Debugger.AddIn.csproj
  4. 1
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Expressions/EvaluateAstVisitor.cs
  5. 621
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Expressions/NotImplementedAstVisitor.cs
  6. 5
      src/Libraries/NRefactory/NRefactoryASTGenerator/AST/GlobalLevel.cs
  7. 43
      src/Libraries/NRefactory/NRefactoryASTGenerator/Main.cs
  8. 1
      src/Libraries/NRefactory/Project/NRefactory.csproj
  9. 26
      src/Libraries/NRefactory/Project/Src/Ast/Generated.cs
  10. 2
      src/Libraries/NRefactory/Project/Src/IAstVisitor.cs
  11. 2
      src/Libraries/NRefactory/Project/Src/Lexer/CSharp/KeywordList.txt
  12. 2
      src/Libraries/NRefactory/Project/Src/Lexer/CSharp/Tokens.cs
  13. 2
      src/Libraries/NRefactory/Project/Src/Location.cs
  14. 2360
      src/Libraries/NRefactory/Project/Src/Parser/CSharp/Parser.cs
  15. 14
      src/Libraries/NRefactory/Project/Src/Parser/CSharp/cs.ATG
  16. 10
      src/Libraries/NRefactory/Project/Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs
  17. 6
      src/Libraries/NRefactory/Project/Src/PrettyPrinter/VBNet/VBNetOutputVisitor.cs
  18. 5
      src/Libraries/NRefactory/Project/Src/Visitors/AbstractASTVisitor.cs
  19. 5
      src/Libraries/NRefactory/Project/Src/Visitors/AbstractAstTransformer.cs
  20. 11
      src/Libraries/NRefactory/Project/Src/Visitors/NodeTrackingAstVisitor.cs
  21. 509
      src/Libraries/NRefactory/Project/Src/Visitors/NotImplementedAstVisitor.cs
  22. 6
      src/Libraries/NRefactory/Test/Output/CSharp/CSharpOutputTest.cs
  23. 7
      src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/EasyCodeDom.cs

6
src/AddIns/BackendBindings/Boo/NRefactoryToBooConverter/Project/ConvertVisitorGlobal.cs

@ -197,5 +197,11 @@ namespace NRefactoryToBooConverter @@ -197,5 +197,11 @@ namespace NRefactoryToBooConverter
AddError(optionDeclaration, "Option statement is not supported.");
return null;
}
public object VisitExternAliasDirective(ExternAliasDirective externAliasDirective, object data)
{
AddError(externAliasDirective, "'extern alias' directive is not supported.");
return null;
}
}
}

6
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/NRefactoryToPythonConverter.cs

@ -818,6 +818,12 @@ namespace ICSharpCode.PythonBinding @@ -818,6 +818,12 @@ namespace ICSharpCode.PythonBinding
return null;
}
public object VisitExternAliasDirective(ExternAliasDirective externAliasDirective, object data)
{
Console.WriteLine("ExternAliasDirective");
return null;
}
public object VisitParameterDeclarationExpression(ParameterDeclarationExpression parameterDeclarationExpression, object data)
{
Console.WriteLine("VisitParameterDeclarationExpression");

1
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Debugger.AddIn.csproj

@ -66,7 +66,6 @@ @@ -66,7 +66,6 @@
<Compile Include="Src\IsBreakpointCondition.cs" />
<Compile Include="Src\Expressions\AstEvaluator.cs" />
<Compile Include="Src\Expressions\EvaluateAstVisitor.cs" />
<Compile Include="Src\Expressions\NotImplementedAstVisitor.cs" />
<Compile Include="Src\Options\DebuggingOptions.cs" />
<Compile Include="Src\Options\DebuggingOptionsPanel.cs">
<SubType>UserControl</SubType>

1
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Expressions/EvaluateAstVisitor.cs

@ -4,6 +4,7 @@ @@ -4,6 +4,7 @@
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
// <version>$Revision$</version>
// </file>
using ICSharpCode.NRefactory.Visitors;
using System;
using System.Collections.Generic;
using Debugger.MetaData;

621
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Expressions/NotImplementedAstVisitor.cs

@ -1,621 +0,0 @@ @@ -1,621 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
// <version>$Revision$</version>
// </file>
using System;
using ICSharpCode.NRefactory;
using ICSharpCode.NRefactory.Ast;
using Attribute=ICSharpCode.NRefactory.Ast.Attribute;
namespace Debugger.AddIn
{
public class NotImplementedAstVisitor: IAstVisitor
{
public virtual object VisitAddHandlerStatement(AddHandlerStatement addHandlerStatement, object data)
{
throw new NotImplementedException("AddHandlerStatement");
}
public virtual object VisitAddressOfExpression(AddressOfExpression addressOfExpression, object data)
{
throw new NotImplementedException("AddressOfExpression");
}
public virtual object VisitAnonymousMethodExpression(AnonymousMethodExpression anonymousMethodExpression, object data)
{
throw new NotImplementedException("AnonymousMethodExpression");
}
public virtual object VisitArrayCreateExpression(ArrayCreateExpression arrayCreateExpression, object data)
{
throw new NotImplementedException("ArrayCreateExpression");
}
public virtual object VisitAssignmentExpression(AssignmentExpression assignmentExpression, object data)
{
throw new NotImplementedException("AssignmentExpression");
}
public virtual object VisitAttribute(Attribute attribute, object data)
{
throw new NotImplementedException("Attribute");
}
public virtual object VisitAttributeSection(AttributeSection attributeSection, object data)
{
throw new NotImplementedException("AttributeSection");
}
public virtual object VisitBaseReferenceExpression(BaseReferenceExpression baseReferenceExpression, object data)
{
throw new NotImplementedException("BaseReferenceExpression");
}
public virtual object VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression, object data)
{
throw new NotImplementedException("BinaryOperatorExpression");
}
public virtual object VisitBlockStatement(BlockStatement blockStatement, object data)
{
throw new NotImplementedException("BlockStatement");
}
public virtual object VisitBreakStatement(BreakStatement breakStatement, object data)
{
throw new NotImplementedException("BreakStatement");
}
public virtual object VisitCaseLabel(CaseLabel caseLabel, object data)
{
throw new NotImplementedException("CaseLabel");
}
public virtual object VisitCastExpression(CastExpression castExpression, object data)
{
throw new NotImplementedException("CastExpression");
}
public virtual object VisitCatchClause(CatchClause catchClause, object data)
{
throw new NotImplementedException("CatchClause");
}
public virtual object VisitCheckedExpression(CheckedExpression checkedExpression, object data)
{
throw new NotImplementedException("CheckedExpression");
}
public virtual object VisitCheckedStatement(CheckedStatement checkedStatement, object data)
{
throw new NotImplementedException("CheckedStatement");
}
public virtual object VisitClassReferenceExpression(ClassReferenceExpression classReferenceExpression, object data)
{
throw new NotImplementedException("ClassReferenceExpression");
}
public virtual object VisitCollectionInitializerExpression(CollectionInitializerExpression collectionInitializerExpression, object data)
{
throw new NotImplementedException("CollectionInitializerExpression");
}
public virtual object VisitCompilationUnit(CompilationUnit compilationUnit, object data)
{
throw new NotImplementedException("CompilationUnit");
}
public virtual object VisitConditionalExpression(ConditionalExpression conditionalExpression, object data)
{
throw new NotImplementedException("ConditionalExpression");
}
public virtual object VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration, object data)
{
throw new NotImplementedException("ConstructorDeclaration");
}
public virtual object VisitConstructorInitializer(ConstructorInitializer constructorInitializer, object data)
{
throw new NotImplementedException("ConstructorInitializer");
}
public virtual object VisitContinueStatement(ContinueStatement continueStatement, object data)
{
throw new NotImplementedException("ContinueStatement");
}
public virtual object VisitDeclareDeclaration(DeclareDeclaration declareDeclaration, object data)
{
throw new NotImplementedException("DeclareDeclaration");
}
public virtual object VisitDefaultValueExpression(DefaultValueExpression defaultValueExpression, object data)
{
throw new NotImplementedException("DefaultValueExpression");
}
public virtual object VisitDelegateDeclaration(DelegateDeclaration delegateDeclaration, object data)
{
throw new NotImplementedException("DelegateDeclaration");
}
public virtual object VisitDestructorDeclaration(DestructorDeclaration destructorDeclaration, object data)
{
throw new NotImplementedException("DestructorDeclaration");
}
public virtual object VisitDirectionExpression(DirectionExpression directionExpression, object data)
{
throw new NotImplementedException("DirectionExpression");
}
public virtual object VisitDoLoopStatement(DoLoopStatement doLoopStatement, object data)
{
throw new NotImplementedException("DoLoopStatement");
}
public virtual object VisitElseIfSection(ElseIfSection elseIfSection, object data)
{
throw new NotImplementedException("ElseIfSection");
}
public virtual object VisitEmptyStatement(EmptyStatement emptyStatement, object data)
{
throw new NotImplementedException("EmptyStatement");
}
public virtual object VisitEndStatement(EndStatement endStatement, object data)
{
throw new NotImplementedException("EndStatement");
}
public virtual object VisitEraseStatement(EraseStatement eraseStatement, object data)
{
throw new NotImplementedException("EraseStatement");
}
public virtual object VisitErrorStatement(ErrorStatement errorStatement, object data)
{
throw new NotImplementedException("ErrorStatement");
}
public virtual object VisitEventAddRegion(EventAddRegion eventAddRegion, object data)
{
throw new NotImplementedException("EventAddRegion");
}
public virtual object VisitEventDeclaration(EventDeclaration eventDeclaration, object data)
{
throw new NotImplementedException("EventDeclaration");
}
public virtual object VisitEventRaiseRegion(EventRaiseRegion eventRaiseRegion, object data)
{
throw new NotImplementedException("EventRaiseRegion");
}
public virtual object VisitEventRemoveRegion(EventRemoveRegion eventRemoveRegion, object data)
{
throw new NotImplementedException("EventRemoveRegion");
}
public virtual object VisitExitStatement(ExitStatement exitStatement, object data)
{
throw new NotImplementedException("ExitStatement");
}
public virtual object VisitExpressionStatement(ExpressionStatement expressionStatement, object data)
{
throw new NotImplementedException("ExpressionStatement");
}
public virtual object VisitFieldDeclaration(FieldDeclaration fieldDeclaration, object data)
{
throw new NotImplementedException("FieldDeclaration");
}
public virtual object VisitFixedStatement(FixedStatement fixedStatement, object data)
{
throw new NotImplementedException("FixedStatement");
}
public virtual object VisitForeachStatement(ForeachStatement foreachStatement, object data)
{
throw new NotImplementedException("ForeachStatement");
}
public virtual object VisitForNextStatement(ForNextStatement forNextStatement, object data)
{
throw new NotImplementedException("ForNextStatement");
}
public virtual object VisitForStatement(ForStatement forStatement, object data)
{
throw new NotImplementedException("ForStatement");
}
public virtual object VisitGotoCaseStatement(GotoCaseStatement gotoCaseStatement, object data)
{
throw new NotImplementedException("GotoCaseStatement");
}
public virtual object VisitGotoStatement(GotoStatement gotoStatement, object data)
{
throw new NotImplementedException("GotoStatement");
}
public virtual object VisitIdentifierExpression(IdentifierExpression identifierExpression, object data)
{
throw new NotImplementedException("IdentifierExpression");
}
public virtual object VisitIfElseStatement(IfElseStatement ifElseStatement, object data)
{
throw new NotImplementedException("IfElseStatement");
}
public virtual object VisitIndexerDeclaration(IndexerDeclaration indexerDeclaration, object data)
{
throw new NotImplementedException("IndexerDeclaration");
}
public virtual object VisitIndexerExpression(IndexerExpression indexerExpression, object data)
{
throw new NotImplementedException("IndexerExpression");
}
public virtual object VisitInnerClassTypeReference(InnerClassTypeReference innerClassTypeReference, object data)
{
throw new NotImplementedException("InnerClassTypeReference");
}
public virtual object VisitInterfaceImplementation(InterfaceImplementation interfaceImplementation, object data)
{
throw new NotImplementedException("InterfaceImplementation");
}
public virtual object VisitInvocationExpression(InvocationExpression invocationExpression, object data)
{
throw new NotImplementedException("InvocationExpression");
}
public virtual object VisitLabelStatement(LabelStatement labelStatement, object data)
{
throw new NotImplementedException("LabelStatement");
}
public virtual object VisitLambdaExpression(LambdaExpression lambdaExpression, object data)
{
throw new NotImplementedException("LambdaExpression");
}
public virtual object VisitLocalVariableDeclaration(LocalVariableDeclaration localVariableDeclaration, object data)
{
throw new NotImplementedException("LocalVariableDeclaration");
}
public virtual object VisitLockStatement(LockStatement lockStatement, object data)
{
throw new NotImplementedException("LockStatement");
}
public virtual object VisitMemberReferenceExpression(MemberReferenceExpression memberReferenceExpression, object data)
{
throw new NotImplementedException("MemberReferenceExpression");
}
public virtual object VisitMethodDeclaration(MethodDeclaration methodDeclaration, object data)
{
throw new NotImplementedException("MethodDeclaration");
}
public virtual object VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression, object data)
{
throw new NotImplementedException("NamedArgumentExpression");
}
public virtual object VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration, object data)
{
throw new NotImplementedException("NamespaceDeclaration");
}
public virtual object VisitObjectCreateExpression(ObjectCreateExpression objectCreateExpression, object data)
{
throw new NotImplementedException("ObjectCreateExpression");
}
public virtual object VisitOnErrorStatement(OnErrorStatement onErrorStatement, object data)
{
throw new NotImplementedException("OnErrorStatement");
}
public virtual object VisitOperatorDeclaration(OperatorDeclaration operatorDeclaration, object data)
{
throw new NotImplementedException("OperatorDeclaration");
}
public virtual object VisitOptionDeclaration(OptionDeclaration optionDeclaration, object data)
{
throw new NotImplementedException("OptionDeclaration");
}
public virtual object VisitParameterDeclarationExpression(ParameterDeclarationExpression parameterDeclarationExpression, object data)
{
throw new NotImplementedException("ParameterDeclarationExpression");
}
public virtual object VisitParenthesizedExpression(ParenthesizedExpression parenthesizedExpression, object data)
{
throw new NotImplementedException("ParenthesizedExpression");
}
public virtual object VisitPointerReferenceExpression(PointerReferenceExpression pointerReferenceExpression, object data)
{
throw new NotImplementedException("PointerReferenceExpression");
}
public virtual object VisitPrimitiveExpression(PrimitiveExpression primitiveExpression, object data)
{
throw new NotImplementedException("PrimitiveExpression");
}
public virtual object VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration, object data)
{
throw new NotImplementedException("PropertyDeclaration");
}
public virtual object VisitPropertyGetRegion(PropertyGetRegion propertyGetRegion, object data)
{
throw new NotImplementedException("PropertyGetRegion");
}
public virtual object VisitPropertySetRegion(PropertySetRegion propertySetRegion, object data)
{
throw new NotImplementedException("PropertySetRegion");
}
public virtual object VisitQueryExpression(QueryExpression queryExpression, object data)
{
throw new NotImplementedException("QueryExpression");
}
public virtual object VisitQueryExpressionFromClause(QueryExpressionFromClause queryExpressionFromClause, object data)
{
throw new NotImplementedException("QueryExpressionFromClause");
}
public virtual object VisitQueryExpressionGroupClause(QueryExpressionGroupClause queryExpressionGroupClause, object data)
{
throw new NotImplementedException("QueryExpressionGroupClause");
}
public virtual object VisitQueryExpressionJoinClause(QueryExpressionJoinClause queryExpressionJoinClause, object data)
{
throw new NotImplementedException("QueryExpressionJoinClause");
}
public virtual object VisitQueryExpressionLetClause(QueryExpressionLetClause queryExpressionLetClause, object data)
{
throw new NotImplementedException("QueryExpressionLetClause");
}
public virtual object VisitQueryExpressionOrderClause(QueryExpressionOrderClause queryExpressionOrderClause, object data)
{
throw new NotImplementedException("QueryExpressionOrderClause");
}
public virtual object VisitQueryExpressionOrdering(QueryExpressionOrdering queryExpressionOrdering, object data)
{
throw new NotImplementedException("QueryExpressionOrdering");
}
public virtual object VisitQueryExpressionSelectClause(QueryExpressionSelectClause queryExpressionSelectClause, object data)
{
throw new NotImplementedException("QueryExpressionSelectClause");
}
public virtual object VisitQueryExpressionWhereClause(QueryExpressionWhereClause queryExpressionWhereClause, object data)
{
throw new NotImplementedException("QueryExpressionWhereClause");
}
public virtual object VisitRaiseEventStatement(RaiseEventStatement raiseEventStatement, object data)
{
throw new NotImplementedException("RaiseEventStatement");
}
public virtual object VisitReDimStatement(ReDimStatement reDimStatement, object data)
{
throw new NotImplementedException("ReDimStatement");
}
public virtual object VisitRemoveHandlerStatement(RemoveHandlerStatement removeHandlerStatement, object data)
{
throw new NotImplementedException("RemoveHandlerStatement");
}
public virtual object VisitResumeStatement(ResumeStatement resumeStatement, object data)
{
throw new NotImplementedException("ResumeStatement");
}
public virtual object VisitReturnStatement(ReturnStatement returnStatement, object data)
{
throw new NotImplementedException("ReturnStatement");
}
public virtual object VisitSizeOfExpression(SizeOfExpression sizeOfExpression, object data)
{
throw new NotImplementedException("SizeOfExpression");
}
public virtual object VisitStackAllocExpression(StackAllocExpression stackAllocExpression, object data)
{
throw new NotImplementedException("StackAllocExpression");
}
public virtual object VisitStopStatement(StopStatement stopStatement, object data)
{
throw new NotImplementedException("StopStatement");
}
public virtual object VisitSwitchSection(SwitchSection switchSection, object data)
{
throw new NotImplementedException("SwitchSection");
}
public virtual object VisitSwitchStatement(SwitchStatement switchStatement, object data)
{
throw new NotImplementedException("SwitchStatement");
}
public virtual object VisitTemplateDefinition(TemplateDefinition templateDefinition, object data)
{
throw new NotImplementedException("TemplateDefinition");
}
public virtual object VisitThisReferenceExpression(ThisReferenceExpression thisReferenceExpression, object data)
{
throw new NotImplementedException("ThisReferenceExpression");
}
public virtual object VisitThrowStatement(ThrowStatement throwStatement, object data)
{
throw new NotImplementedException("ThrowStatement");
}
public virtual object VisitTryCatchStatement(TryCatchStatement tryCatchStatement, object data)
{
throw new NotImplementedException("TryCatchStatement");
}
public virtual object VisitTypeDeclaration(TypeDeclaration typeDeclaration, object data)
{
throw new NotImplementedException("TypeDeclaration");
}
public virtual object VisitTypeOfExpression(TypeOfExpression typeOfExpression, object data)
{
throw new NotImplementedException("TypeOfExpression");
}
public virtual object VisitTypeOfIsExpression(TypeOfIsExpression typeOfIsExpression, object data)
{
throw new NotImplementedException("TypeOfIsExpression");
}
public virtual object VisitTypeReference(TypeReference typeReference, object data)
{
throw new NotImplementedException("TypeReference");
}
public virtual object VisitTypeReferenceExpression(TypeReferenceExpression typeReferenceExpression, object data)
{
throw new NotImplementedException("TypeReferenceExpression");
}
public virtual object VisitUnaryOperatorExpression(UnaryOperatorExpression unaryOperatorExpression, object data)
{
throw new NotImplementedException("UnaryOperatorExpression");
}
public virtual object VisitUncheckedExpression(UncheckedExpression uncheckedExpression, object data)
{
throw new NotImplementedException("UncheckedExpression");
}
public virtual object VisitUncheckedStatement(UncheckedStatement uncheckedStatement, object data)
{
throw new NotImplementedException("UncheckedStatement");
}
public virtual object VisitUnsafeStatement(UnsafeStatement unsafeStatement, object data)
{
throw new NotImplementedException("UnsafeStatement");
}
public virtual object VisitUsing(Using @using, object data)
{
throw new NotImplementedException("Using");
}
public virtual object VisitUsingDeclaration(UsingDeclaration usingDeclaration, object data)
{
throw new NotImplementedException("UsingDeclaration");
}
public virtual object VisitUsingStatement(UsingStatement usingStatement, object data)
{
throw new NotImplementedException("UsingStatement");
}
public virtual object VisitVariableDeclaration(VariableDeclaration variableDeclaration, object data)
{
throw new NotImplementedException("VariableDeclaration");
}
public virtual object VisitWithStatement(WithStatement withStatement, object data)
{
throw new NotImplementedException("WithStatement");
}
public virtual object VisitYieldStatement(YieldStatement yieldStatement, object data)
{
throw new NotImplementedException("YieldStatement");
}
public virtual object VisitExpressionRangeVariable(ExpressionRangeVariable expressionRangeVariable, object data)
{
throw new NotImplementedException("ExpressionRangeVariable");
}
public virtual object VisitQueryExpressionAggregateClause(QueryExpressionAggregateClause queryExpressionAggregateClause, object data)
{
throw new NotImplementedException("QueryExpressionAggregateClause");
}
public virtual object VisitQueryExpressionDistinctClause(QueryExpressionDistinctClause queryExpressionDistinctClause, object data)
{
throw new NotImplementedException("QueryExpressionDistinctClause");
}
public virtual object VisitQueryExpressionGroupJoinVBClause(QueryExpressionGroupJoinVBClause queryExpressionGroupJoinVBClause, object data)
{
throw new NotImplementedException("QueryExpressionGroupJoinVBClause");
}
public virtual object VisitQueryExpressionGroupVBClause(QueryExpressionGroupVBClause queryExpressionGroupVBClause, object data)
{
throw new NotImplementedException("QueryExpressionGroupVBClause");
}
public virtual object VisitQueryExpressionJoinConditionVB(QueryExpressionJoinConditionVB queryExpressionJoinConditionVB, object data)
{
throw new NotImplementedException("QueryExpressionJoinConditionVB");
}
public virtual object VisitQueryExpressionJoinVBClause(QueryExpressionJoinVBClause queryExpressionJoinVBClause, object data)
{
throw new NotImplementedException("QueryExpressionJoinVBClause");
}
public virtual object VisitQueryExpressionLetVBClause(QueryExpressionLetVBClause queryExpressionLetVBClause, object data)
{
throw new NotImplementedException("QueryExpressionLetVBClause");
}
public virtual object VisitQueryExpressionPartitionVBClause(QueryExpressionPartitionVBClause queryExpressionPartitionVBClause, object data)
{
throw new NotImplementedException("QueryExpressionPartitionVBClause");
}
public virtual object VisitQueryExpressionSelectVBClause(QueryExpressionSelectVBClause queryExpressionSelectVBClause, object data)
{
throw new NotImplementedException("QueryExpressionSelectVBClause");
}
}
}

5
src/Libraries/NRefactory/NRefactoryASTGenerator/AST/GlobalLevel.cs

@ -92,4 +92,9 @@ namespace NRefactoryASTGenerator.Ast @@ -92,4 +92,9 @@ namespace NRefactoryASTGenerator.Ast
public OptionDeclaration(OptionType optionType, bool optionValue) {}
}
class ExternAliasDirective : AbstractNode
{
string name;
}
}

43
src/Libraries/NRefactory/NRefactoryASTGenerator/Main.cs

@ -144,6 +144,19 @@ namespace NRefactoryASTGenerator @@ -144,6 +144,19 @@ namespace NRefactoryASTGenerator
File.WriteAllText(visitorsDir + "NodeTrackingAstVisitor.cs",
writer.ToString().Replace("public override object", "public sealed override object"));
}
//NotImplementedAstVisitor
ccu = new EasyCompileUnit();
cns = ccu.AddNamespace("ICSharpCode.NRefactory.Visitors");
cns.AddImport("System");
cns.AddImport("ICSharpCode.NRefactory.Ast");
cns.Types.Add(CreateNotImplementedAstVisitorClass(nodeTypes));
using (StringWriter writer = new StringWriter()) {
new Microsoft.CSharp.CSharpCodeProvider().GenerateCodeFromCompileUnit(ccu, writer, settings);
File.WriteAllText(visitorsDir + "NotImplementedAstVisitor.cs", writer.ToString());
}
Debug.WriteLine("AST Generator done!");
}
static CodeTypeDeclaration CreateAstVisitorInterface(List<Type> nodeTypes)
@ -516,10 +529,6 @@ namespace NRefactoryASTGenerator @@ -516,10 +529,6 @@ namespace NRefactoryASTGenerator
CodeExpression var = Easy.Var(GetFieldName(type.Name));
// m.Statements.Add(new CodeMethodInvokeExpression(new CodeMethodReferenceExpression(new CodeThisReferenceExpression(), "BeginVisit"), new CodeExpression[] { var }));
// m.Statements.Add(new CodeVariableDeclarationStatement(new CodeTypeReference(typeof(object)), "result", new CodeMethodInvokeExpression(new CodeMethodReferenceExpression(new CodeThisReferenceExpression(), "TrackedVisit"), new CodeExpression[] { var, new CodeVariableReferenceExpression("data") })));
// m.Statements.Add(new CodeMethodInvokeExpression(new CodeMethodReferenceExpression(new CodeThisReferenceExpression(), "EndVisit"), new CodeExpression[] { var }));
// m.Statements.Add(new CodeMethodReturnStatement(new CodeVariableReferenceExpression("result")));
m.Body.InvokeMethod(Easy.This, "BeginVisit", var);
m.Body.DeclareVariable(typeof(object), "result").InitExpression
= Easy.This.InvokeMethod("TrackedVisit" + type.Name, var, Easy.Var("data"));
@ -542,5 +551,31 @@ namespace NRefactoryASTGenerator @@ -542,5 +551,31 @@ namespace NRefactoryASTGenerator
return td;
}
static CodeTypeDeclaration CreateNotImplementedAstVisitorClass(List<Type> nodeTypes)
{
EasyTypeDeclaration td = new EasyTypeDeclaration("NotImplementedAstVisitor");
td.TypeAttributes = TypeAttributes.Public | TypeAttributes.Class;
td.BaseTypes.Add(new CodeTypeReference("IAstVisitor"));
string comment = "<summary>\n " +
"IAstVisitor implementation that always throws NotImplementedExceptions.\n " +
"</summary>";
td.Comments.Add(new CodeCommentStatement(comment, true));
foreach (Type type in nodeTypes) {
if (!type.IsAbstract) {
EasyMethod m = td.AddMethod(typeof(object), VisitPrefix + type.Name);
m.Attributes = MemberAttributes.Public;
m.AddParameter(ConvertType(type), GetFieldName(type.Name));
m.AddParameter(new CodeTypeReference(typeof(object)), "data");
m.Body.Throw(Easy.New(typeof(NotImplementedException), Easy.Prim(type.Name)));
}
}
return td;
}
}
}

1
src/Libraries/NRefactory/Project/NRefactory.csproj

@ -107,6 +107,7 @@ @@ -107,6 +107,7 @@
<Compile Include="Src\Visitors\ConvertVisitorBase.cs" />
<Compile Include="Src\Visitors\CSharpConstructsConvertVisitor.cs" />
<Compile Include="Src\Visitors\LookupTableVisitor.cs" />
<Compile Include="Src\Visitors\NotImplementedAstVisitor.cs" />
<Compile Include="Src\Visitors\PrefixFieldsVisitor.cs" />
<Compile Include="Src\Visitors\RenameIdentifierVisitor.cs" />
<Compile Include="Src\Visitors\SetParentVisitor.cs" />

26
src/Libraries/NRefactory/Project/Src/Ast/Generated.cs

@ -1835,6 +1835,32 @@ namespace ICSharpCode.NRefactory.Ast { @@ -1835,6 +1835,32 @@ namespace ICSharpCode.NRefactory.Ast {
}
}
public class ExternAliasDirective : AbstractNode {
string name;
public string Name {
get {
return name;
}
set {
name = value ?? "";
}
}
public ExternAliasDirective() {
name = "";
}
public override object AcceptVisitor(IAstVisitor visitor, object data) {
return visitor.VisitExternAliasDirective(this, data);
}
public override string ToString() {
return string.Format("[ExternAliasDirective Name={0}]", Name);
}
}
public class FieldDeclaration : AttributedNode {
TypeReference typeReference;

2
src/Libraries/NRefactory/Project/Src/IAstVisitor.cs

@ -97,6 +97,8 @@ namespace ICSharpCode.NRefactory { @@ -97,6 +97,8 @@ namespace ICSharpCode.NRefactory {
object VisitExpressionStatement(ExpressionStatement expressionStatement, object data);
object VisitExternAliasDirective(ExternAliasDirective externAliasDirective, object data);
object VisitFieldDeclaration(FieldDeclaration fieldDeclaration, object data);
object VisitFixedStatement(FixedStatement fixedStatement, object data);

2
src/Libraries/NRefactory/Project/Src/Lexer/CSharp/KeywordList.txt

@ -200,7 +200,7 @@ KCCClassModifiers("abstract", "sealed", "static", "unsafe", "partial") @@ -200,7 +200,7 @@ KCCClassModifiers("abstract", "sealed", "static", "unsafe", "partial")
KCCTypeDeclarationStart("public", "internal", @TypeDeclarationKW, @KCCClassModifiers)
KCCMemberVisibilityModifiers("protected", "private", "public", "internal")
SimpleTypeName(@TypeKW, @IdentifierTokens, "void")
GlobalLevel("namespace", "using", @KCCTypeDeclarationStart)
GlobalLevel("namespace", "using", "extern", @KCCTypeDeclarationStart)
ExpressionStart("base", "delegate", "false", "new", "null", "sizeof", "this", "true", "typeof", "checked", "unchecked", "from", "default")
ExpressionContent("as", "is", "out", "ref", "in")
# interfaces cannot have inner classes etc., the only keyword (expect for type names) that may appear in them is "event"

2
src/Libraries/NRefactory/Project/Src/Lexer/CSharp/Tokens.cs

@ -182,7 +182,7 @@ namespace ICSharpCode.NRefactory.Parser.CSharp @@ -182,7 +182,7 @@ namespace ICSharpCode.NRefactory.Parser.CSharp
public static BitArray KCCTypeDeclarationStart = NewSet(Public, Internal, Class, Interface, Struct, Enum, Delegate, Abstract, Sealed, Static, Unsafe, Partial);
public static BitArray KCCMemberVisibilityModifiers = NewSet(Protected, Private, Public, Internal);
public static BitArray SimpleTypeName = NewSet(Char, Bool, Object, String, Sbyte, Byte, Short, Ushort, Int, Uint, Long, Ulong, Float, Double, Decimal, Identifier, Partial, Where, Get, Set, Add, Remove, Yield, Select, Group, By, Into, From, Ascending, Descending, Orderby, Let, Join, On, Equals, Void);
public static BitArray GlobalLevel = NewSet(Namespace, Using, Public, Internal, Class, Interface, Struct, Enum, Delegate, Abstract, Sealed, Static, Unsafe, Partial);
public static BitArray GlobalLevel = NewSet(Namespace, Using, Extern, Public, Internal, Class, Interface, Struct, Enum, Delegate, Abstract, Sealed, Static, Unsafe, Partial);
public static BitArray ExpressionStart = NewSet(Base, Delegate, False, New, Null, Sizeof, This, True, Typeof, Checked, Unchecked, From, Default);
public static BitArray ExpressionContent = NewSet(As, Is, Out, Ref, In);
public static BitArray InterfaceLevel = NewSet(Event);

2
src/Libraries/NRefactory/Project/Src/Location.cs

@ -25,13 +25,11 @@ namespace ICSharpCode.NRefactory @@ -25,13 +25,11 @@ namespace ICSharpCode.NRefactory
int x, y;
[Obsolete("Use Column instead")]
public int X {
get { return x; }
set { x = value; }
}
[Obsolete("Use Line instead")]
public int Y {
get { return y; }
set { y = value; }

2360
src/Libraries/NRefactory/Project/Src/Parser/CSharp/Parser.cs

File diff suppressed because it is too large Load Diff

14
src/Libraries/NRefactory/Project/Src/Parser/CSharp/cs.ATG

@ -178,6 +178,7 @@ PRODUCTIONS @@ -178,6 +178,7 @@ PRODUCTIONS
CS
(. lexer.NextToken(); /* get the first token */ .)
=
{ ExternAliasDirective }
{ UsingDirective }
{ IF (IsGlobalAttrTarget()) GlobalAttributeSection }
{ NamespaceMemberDecl }
@ -332,6 +333,7 @@ NamespaceMemberDecl @@ -332,6 +333,7 @@ NamespaceMemberDecl
compilationUnit.BlockStart(node);
.)
"{"
{ ExternAliasDirective }
{ UsingDirective }
{ NamespaceMemberDecl }
"}"
@ -339,11 +341,21 @@ NamespaceMemberDecl @@ -339,11 +341,21 @@ NamespaceMemberDecl
compilationUnit.BlockEnd();
.)
/*--- type declaration: */
| { AttributeSection<out section> (. attributes.Add(section); .) }
| { AttributeSection<out section> (. attributes.Add(section); .) }
{ TypeModifier<m> }
TypeDecl<m, attributes>
.
ExternAliasDirective
(. ExternAliasDirective ead = new ExternAliasDirective { StartLocation = la.Location }; .)
=
"extern"
Identifier (. if (t.val != "alias") Error("Expected 'extern alias'."); .)
Identifier (. ead.Name = t.val; .)
";" (. ead.EndLocation = t.EndLocation; .)
(. compilationUnit.AddChild(ead); .)
.
TypeDecl<ModifierList m, List<AttributeSection> attributes>
(.
TypeReference type;

10
src/Libraries/NRefactory/Project/Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs

@ -298,6 +298,16 @@ namespace ICSharpCode.NRefactory.PrettyPrinter @@ -298,6 +298,16 @@ namespace ICSharpCode.NRefactory.PrettyPrinter
return null;
}
public override object TrackedVisitExternAliasDirective(ExternAliasDirective externAliasDirective, object data)
{
outputFormatter.Indent();
outputFormatter.PrintText("extern alias ");
outputFormatter.PrintIdentifier(externAliasDirective.Name);
outputFormatter.PrintToken(Tokens.Semicolon);
outputFormatter.NewLine();
return null;
}
public override object TrackedVisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration, object data)
{
outputFormatter.Indent();

6
src/Libraries/NRefactory/Project/Src/PrettyPrinter/VBNet/VBNetOutputVisitor.cs

@ -2994,5 +2994,11 @@ namespace ICSharpCode.NRefactory.PrettyPrinter @@ -2994,5 +2994,11 @@ namespace ICSharpCode.NRefactory.PrettyPrinter
outputFormatter.Space();
return whereClause.Condition.AcceptVisitor(this, data);
}
public override object TrackedVisitExternAliasDirective(ExternAliasDirective externAliasDirective, object data)
{
UnsupportedNode(externAliasDirective);
return null;
}
}
}

5
src/Libraries/NRefactory/Project/Src/Visitors/AbstractASTVisitor.cs

@ -414,6 +414,11 @@ namespace ICSharpCode.NRefactory.Visitors { @@ -414,6 +414,11 @@ namespace ICSharpCode.NRefactory.Visitors {
return expressionStatement.Expression.AcceptVisitor(this, data);
}
public virtual object VisitExternAliasDirective(ExternAliasDirective externAliasDirective, object data) {
Debug.Assert((externAliasDirective != null));
return null;
}
public virtual object VisitFieldDeclaration(FieldDeclaration fieldDeclaration, object data) {
Debug.Assert((fieldDeclaration != null));
Debug.Assert((fieldDeclaration.Attributes != null));

5
src/Libraries/NRefactory/Project/Src/Visitors/AbstractAstTransformer.cs

@ -745,6 +745,11 @@ namespace ICSharpCode.NRefactory.Visitors { @@ -745,6 +745,11 @@ namespace ICSharpCode.NRefactory.Visitors {
return null;
}
public virtual object VisitExternAliasDirective(ExternAliasDirective externAliasDirective, object data) {
Debug.Assert((externAliasDirective != null));
return null;
}
public virtual object VisitFieldDeclaration(FieldDeclaration fieldDeclaration, object data) {
Debug.Assert((fieldDeclaration != null));
Debug.Assert((fieldDeclaration.Attributes != null));

11
src/Libraries/NRefactory/Project/Src/Visitors/NodeTrackingAstVisitor.cs

@ -318,6 +318,13 @@ namespace ICSharpCode.NRefactory.Visitors { @@ -318,6 +318,13 @@ namespace ICSharpCode.NRefactory.Visitors {
return result;
}
public sealed override object VisitExternAliasDirective(ExternAliasDirective externAliasDirective, object data) {
this.BeginVisit(externAliasDirective);
object result = this.TrackedVisitExternAliasDirective(externAliasDirective, data);
this.EndVisit(externAliasDirective);
return result;
}
public sealed override object VisitFieldDeclaration(FieldDeclaration fieldDeclaration, object data) {
this.BeginVisit(fieldDeclaration);
object result = this.TrackedVisitFieldDeclaration(fieldDeclaration, data);
@ -1042,6 +1049,10 @@ namespace ICSharpCode.NRefactory.Visitors { @@ -1042,6 +1049,10 @@ namespace ICSharpCode.NRefactory.Visitors {
return base.VisitExpressionStatement(expressionStatement, data);
}
public virtual object TrackedVisitExternAliasDirective(ExternAliasDirective externAliasDirective, object data) {
return base.VisitExternAliasDirective(externAliasDirective, data);
}
public virtual object TrackedVisitFieldDeclaration(FieldDeclaration fieldDeclaration, object data) {
return base.VisitFieldDeclaration(fieldDeclaration, data);
}

509
src/Libraries/NRefactory/Project/Src/Visitors/NotImplementedAstVisitor.cs

@ -0,0 +1,509 @@ @@ -0,0 +1,509 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.3053
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace ICSharpCode.NRefactory.Visitors {
using System;
using ICSharpCode.NRefactory.Ast;
/// <summary>
/// IAstVisitor implementation that always throws NotImplementedExceptions.
/// </summary>
public class NotImplementedAstVisitor : IAstVisitor {
public virtual object VisitAddHandlerStatement(AddHandlerStatement addHandlerStatement, object data) {
throw new global::System.NotImplementedException("AddHandlerStatement");
}
public virtual object VisitAddressOfExpression(AddressOfExpression addressOfExpression, object data) {
throw new global::System.NotImplementedException("AddressOfExpression");
}
public virtual object VisitAnonymousMethodExpression(AnonymousMethodExpression anonymousMethodExpression, object data) {
throw new global::System.NotImplementedException("AnonymousMethodExpression");
}
public virtual object VisitArrayCreateExpression(ArrayCreateExpression arrayCreateExpression, object data) {
throw new global::System.NotImplementedException("ArrayCreateExpression");
}
public virtual object VisitAssignmentExpression(AssignmentExpression assignmentExpression, object data) {
throw new global::System.NotImplementedException("AssignmentExpression");
}
public virtual object VisitAttribute(ICSharpCode.NRefactory.Ast.Attribute attribute, object data) {
throw new global::System.NotImplementedException("Attribute");
}
public virtual object VisitAttributeSection(AttributeSection attributeSection, object data) {
throw new global::System.NotImplementedException("AttributeSection");
}
public virtual object VisitBaseReferenceExpression(BaseReferenceExpression baseReferenceExpression, object data) {
throw new global::System.NotImplementedException("BaseReferenceExpression");
}
public virtual object VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression, object data) {
throw new global::System.NotImplementedException("BinaryOperatorExpression");
}
public virtual object VisitBlockStatement(BlockStatement blockStatement, object data) {
throw new global::System.NotImplementedException("BlockStatement");
}
public virtual object VisitBreakStatement(BreakStatement breakStatement, object data) {
throw new global::System.NotImplementedException("BreakStatement");
}
public virtual object VisitCaseLabel(CaseLabel caseLabel, object data) {
throw new global::System.NotImplementedException("CaseLabel");
}
public virtual object VisitCastExpression(CastExpression castExpression, object data) {
throw new global::System.NotImplementedException("CastExpression");
}
public virtual object VisitCatchClause(CatchClause catchClause, object data) {
throw new global::System.NotImplementedException("CatchClause");
}
public virtual object VisitCheckedExpression(CheckedExpression checkedExpression, object data) {
throw new global::System.NotImplementedException("CheckedExpression");
}
public virtual object VisitCheckedStatement(CheckedStatement checkedStatement, object data) {
throw new global::System.NotImplementedException("CheckedStatement");
}
public virtual object VisitClassReferenceExpression(ClassReferenceExpression classReferenceExpression, object data) {
throw new global::System.NotImplementedException("ClassReferenceExpression");
}
public virtual object VisitCollectionInitializerExpression(CollectionInitializerExpression collectionInitializerExpression, object data) {
throw new global::System.NotImplementedException("CollectionInitializerExpression");
}
public virtual object VisitCompilationUnit(CompilationUnit compilationUnit, object data) {
throw new global::System.NotImplementedException("CompilationUnit");
}
public virtual object VisitConditionalExpression(ConditionalExpression conditionalExpression, object data) {
throw new global::System.NotImplementedException("ConditionalExpression");
}
public virtual object VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration, object data) {
throw new global::System.NotImplementedException("ConstructorDeclaration");
}
public virtual object VisitConstructorInitializer(ConstructorInitializer constructorInitializer, object data) {
throw new global::System.NotImplementedException("ConstructorInitializer");
}
public virtual object VisitContinueStatement(ContinueStatement continueStatement, object data) {
throw new global::System.NotImplementedException("ContinueStatement");
}
public virtual object VisitDeclareDeclaration(DeclareDeclaration declareDeclaration, object data) {
throw new global::System.NotImplementedException("DeclareDeclaration");
}
public virtual object VisitDefaultValueExpression(DefaultValueExpression defaultValueExpression, object data) {
throw new global::System.NotImplementedException("DefaultValueExpression");
}
public virtual object VisitDelegateDeclaration(DelegateDeclaration delegateDeclaration, object data) {
throw new global::System.NotImplementedException("DelegateDeclaration");
}
public virtual object VisitDestructorDeclaration(DestructorDeclaration destructorDeclaration, object data) {
throw new global::System.NotImplementedException("DestructorDeclaration");
}
public virtual object VisitDirectionExpression(DirectionExpression directionExpression, object data) {
throw new global::System.NotImplementedException("DirectionExpression");
}
public virtual object VisitDoLoopStatement(DoLoopStatement doLoopStatement, object data) {
throw new global::System.NotImplementedException("DoLoopStatement");
}
public virtual object VisitElseIfSection(ElseIfSection elseIfSection, object data) {
throw new global::System.NotImplementedException("ElseIfSection");
}
public virtual object VisitEmptyStatement(EmptyStatement emptyStatement, object data) {
throw new global::System.NotImplementedException("EmptyStatement");
}
public virtual object VisitEndStatement(EndStatement endStatement, object data) {
throw new global::System.NotImplementedException("EndStatement");
}
public virtual object VisitEraseStatement(EraseStatement eraseStatement, object data) {
throw new global::System.NotImplementedException("EraseStatement");
}
public virtual object VisitErrorStatement(ErrorStatement errorStatement, object data) {
throw new global::System.NotImplementedException("ErrorStatement");
}
public virtual object VisitEventAddRegion(EventAddRegion eventAddRegion, object data) {
throw new global::System.NotImplementedException("EventAddRegion");
}
public virtual object VisitEventDeclaration(EventDeclaration eventDeclaration, object data) {
throw new global::System.NotImplementedException("EventDeclaration");
}
public virtual object VisitEventRaiseRegion(EventRaiseRegion eventRaiseRegion, object data) {
throw new global::System.NotImplementedException("EventRaiseRegion");
}
public virtual object VisitEventRemoveRegion(EventRemoveRegion eventRemoveRegion, object data) {
throw new global::System.NotImplementedException("EventRemoveRegion");
}
public virtual object VisitExitStatement(ExitStatement exitStatement, object data) {
throw new global::System.NotImplementedException("ExitStatement");
}
public virtual object VisitExpressionRangeVariable(ExpressionRangeVariable expressionRangeVariable, object data) {
throw new global::System.NotImplementedException("ExpressionRangeVariable");
}
public virtual object VisitExpressionStatement(ExpressionStatement expressionStatement, object data) {
throw new global::System.NotImplementedException("ExpressionStatement");
}
public virtual object VisitExternAliasDirective(ExternAliasDirective externAliasDirective, object data) {
throw new global::System.NotImplementedException("ExternAliasDirective");
}
public virtual object VisitFieldDeclaration(FieldDeclaration fieldDeclaration, object data) {
throw new global::System.NotImplementedException("FieldDeclaration");
}
public virtual object VisitFixedStatement(FixedStatement fixedStatement, object data) {
throw new global::System.NotImplementedException("FixedStatement");
}
public virtual object VisitForeachStatement(ForeachStatement foreachStatement, object data) {
throw new global::System.NotImplementedException("ForeachStatement");
}
public virtual object VisitForNextStatement(ForNextStatement forNextStatement, object data) {
throw new global::System.NotImplementedException("ForNextStatement");
}
public virtual object VisitForStatement(ForStatement forStatement, object data) {
throw new global::System.NotImplementedException("ForStatement");
}
public virtual object VisitGotoCaseStatement(GotoCaseStatement gotoCaseStatement, object data) {
throw new global::System.NotImplementedException("GotoCaseStatement");
}
public virtual object VisitGotoStatement(GotoStatement gotoStatement, object data) {
throw new global::System.NotImplementedException("GotoStatement");
}
public virtual object VisitIdentifierExpression(IdentifierExpression identifierExpression, object data) {
throw new global::System.NotImplementedException("IdentifierExpression");
}
public virtual object VisitIfElseStatement(IfElseStatement ifElseStatement, object data) {
throw new global::System.NotImplementedException("IfElseStatement");
}
public virtual object VisitIndexerDeclaration(IndexerDeclaration indexerDeclaration, object data) {
throw new global::System.NotImplementedException("IndexerDeclaration");
}
public virtual object VisitIndexerExpression(IndexerExpression indexerExpression, object data) {
throw new global::System.NotImplementedException("IndexerExpression");
}
public virtual object VisitInnerClassTypeReference(InnerClassTypeReference innerClassTypeReference, object data) {
throw new global::System.NotImplementedException("InnerClassTypeReference");
}
public virtual object VisitInterfaceImplementation(InterfaceImplementation interfaceImplementation, object data) {
throw new global::System.NotImplementedException("InterfaceImplementation");
}
public virtual object VisitInvocationExpression(InvocationExpression invocationExpression, object data) {
throw new global::System.NotImplementedException("InvocationExpression");
}
public virtual object VisitLabelStatement(LabelStatement labelStatement, object data) {
throw new global::System.NotImplementedException("LabelStatement");
}
public virtual object VisitLambdaExpression(LambdaExpression lambdaExpression, object data) {
throw new global::System.NotImplementedException("LambdaExpression");
}
public virtual object VisitLocalVariableDeclaration(LocalVariableDeclaration localVariableDeclaration, object data) {
throw new global::System.NotImplementedException("LocalVariableDeclaration");
}
public virtual object VisitLockStatement(LockStatement lockStatement, object data) {
throw new global::System.NotImplementedException("LockStatement");
}
public virtual object VisitMemberReferenceExpression(MemberReferenceExpression memberReferenceExpression, object data) {
throw new global::System.NotImplementedException("MemberReferenceExpression");
}
public virtual object VisitMethodDeclaration(MethodDeclaration methodDeclaration, object data) {
throw new global::System.NotImplementedException("MethodDeclaration");
}
public virtual object VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression, object data) {
throw new global::System.NotImplementedException("NamedArgumentExpression");
}
public virtual object VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration, object data) {
throw new global::System.NotImplementedException("NamespaceDeclaration");
}
public virtual object VisitObjectCreateExpression(ObjectCreateExpression objectCreateExpression, object data) {
throw new global::System.NotImplementedException("ObjectCreateExpression");
}
public virtual object VisitOnErrorStatement(OnErrorStatement onErrorStatement, object data) {
throw new global::System.NotImplementedException("OnErrorStatement");
}
public virtual object VisitOperatorDeclaration(OperatorDeclaration operatorDeclaration, object data) {
throw new global::System.NotImplementedException("OperatorDeclaration");
}
public virtual object VisitOptionDeclaration(OptionDeclaration optionDeclaration, object data) {
throw new global::System.NotImplementedException("OptionDeclaration");
}
public virtual object VisitParameterDeclarationExpression(ParameterDeclarationExpression parameterDeclarationExpression, object data) {
throw new global::System.NotImplementedException("ParameterDeclarationExpression");
}
public virtual object VisitParenthesizedExpression(ParenthesizedExpression parenthesizedExpression, object data) {
throw new global::System.NotImplementedException("ParenthesizedExpression");
}
public virtual object VisitPointerReferenceExpression(PointerReferenceExpression pointerReferenceExpression, object data) {
throw new global::System.NotImplementedException("PointerReferenceExpression");
}
public virtual object VisitPrimitiveExpression(PrimitiveExpression primitiveExpression, object data) {
throw new global::System.NotImplementedException("PrimitiveExpression");
}
public virtual object VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration, object data) {
throw new global::System.NotImplementedException("PropertyDeclaration");
}
public virtual object VisitPropertyGetRegion(PropertyGetRegion propertyGetRegion, object data) {
throw new global::System.NotImplementedException("PropertyGetRegion");
}
public virtual object VisitPropertySetRegion(PropertySetRegion propertySetRegion, object data) {
throw new global::System.NotImplementedException("PropertySetRegion");
}
public virtual object VisitQueryExpression(QueryExpression queryExpression, object data) {
throw new global::System.NotImplementedException("QueryExpression");
}
public virtual object VisitQueryExpressionAggregateClause(QueryExpressionAggregateClause queryExpressionAggregateClause, object data) {
throw new global::System.NotImplementedException("QueryExpressionAggregateClause");
}
public virtual object VisitQueryExpressionDistinctClause(QueryExpressionDistinctClause queryExpressionDistinctClause, object data) {
throw new global::System.NotImplementedException("QueryExpressionDistinctClause");
}
public virtual object VisitQueryExpressionFromClause(QueryExpressionFromClause queryExpressionFromClause, object data) {
throw new global::System.NotImplementedException("QueryExpressionFromClause");
}
public virtual object VisitQueryExpressionGroupClause(QueryExpressionGroupClause queryExpressionGroupClause, object data) {
throw new global::System.NotImplementedException("QueryExpressionGroupClause");
}
public virtual object VisitQueryExpressionGroupJoinVBClause(QueryExpressionGroupJoinVBClause queryExpressionGroupJoinVBClause, object data) {
throw new global::System.NotImplementedException("QueryExpressionGroupJoinVBClause");
}
public virtual object VisitQueryExpressionGroupVBClause(QueryExpressionGroupVBClause queryExpressionGroupVBClause, object data) {
throw new global::System.NotImplementedException("QueryExpressionGroupVBClause");
}
public virtual object VisitQueryExpressionJoinClause(QueryExpressionJoinClause queryExpressionJoinClause, object data) {
throw new global::System.NotImplementedException("QueryExpressionJoinClause");
}
public virtual object VisitQueryExpressionJoinConditionVB(QueryExpressionJoinConditionVB queryExpressionJoinConditionVB, object data) {
throw new global::System.NotImplementedException("QueryExpressionJoinConditionVB");
}
public virtual object VisitQueryExpressionJoinVBClause(QueryExpressionJoinVBClause queryExpressionJoinVBClause, object data) {
throw new global::System.NotImplementedException("QueryExpressionJoinVBClause");
}
public virtual object VisitQueryExpressionLetClause(QueryExpressionLetClause queryExpressionLetClause, object data) {
throw new global::System.NotImplementedException("QueryExpressionLetClause");
}
public virtual object VisitQueryExpressionLetVBClause(QueryExpressionLetVBClause queryExpressionLetVBClause, object data) {
throw new global::System.NotImplementedException("QueryExpressionLetVBClause");
}
public virtual object VisitQueryExpressionOrderClause(QueryExpressionOrderClause queryExpressionOrderClause, object data) {
throw new global::System.NotImplementedException("QueryExpressionOrderClause");
}
public virtual object VisitQueryExpressionOrdering(QueryExpressionOrdering queryExpressionOrdering, object data) {
throw new global::System.NotImplementedException("QueryExpressionOrdering");
}
public virtual object VisitQueryExpressionPartitionVBClause(QueryExpressionPartitionVBClause queryExpressionPartitionVBClause, object data) {
throw new global::System.NotImplementedException("QueryExpressionPartitionVBClause");
}
public virtual object VisitQueryExpressionSelectClause(QueryExpressionSelectClause queryExpressionSelectClause, object data) {
throw new global::System.NotImplementedException("QueryExpressionSelectClause");
}
public virtual object VisitQueryExpressionSelectVBClause(QueryExpressionSelectVBClause queryExpressionSelectVBClause, object data) {
throw new global::System.NotImplementedException("QueryExpressionSelectVBClause");
}
public virtual object VisitQueryExpressionWhereClause(QueryExpressionWhereClause queryExpressionWhereClause, object data) {
throw new global::System.NotImplementedException("QueryExpressionWhereClause");
}
public virtual object VisitRaiseEventStatement(RaiseEventStatement raiseEventStatement, object data) {
throw new global::System.NotImplementedException("RaiseEventStatement");
}
public virtual object VisitReDimStatement(ReDimStatement reDimStatement, object data) {
throw new global::System.NotImplementedException("ReDimStatement");
}
public virtual object VisitRemoveHandlerStatement(RemoveHandlerStatement removeHandlerStatement, object data) {
throw new global::System.NotImplementedException("RemoveHandlerStatement");
}
public virtual object VisitResumeStatement(ResumeStatement resumeStatement, object data) {
throw new global::System.NotImplementedException("ResumeStatement");
}
public virtual object VisitReturnStatement(ReturnStatement returnStatement, object data) {
throw new global::System.NotImplementedException("ReturnStatement");
}
public virtual object VisitSizeOfExpression(SizeOfExpression sizeOfExpression, object data) {
throw new global::System.NotImplementedException("SizeOfExpression");
}
public virtual object VisitStackAllocExpression(StackAllocExpression stackAllocExpression, object data) {
throw new global::System.NotImplementedException("StackAllocExpression");
}
public virtual object VisitStopStatement(StopStatement stopStatement, object data) {
throw new global::System.NotImplementedException("StopStatement");
}
public virtual object VisitSwitchSection(SwitchSection switchSection, object data) {
throw new global::System.NotImplementedException("SwitchSection");
}
public virtual object VisitSwitchStatement(SwitchStatement switchStatement, object data) {
throw new global::System.NotImplementedException("SwitchStatement");
}
public virtual object VisitTemplateDefinition(TemplateDefinition templateDefinition, object data) {
throw new global::System.NotImplementedException("TemplateDefinition");
}
public virtual object VisitThisReferenceExpression(ThisReferenceExpression thisReferenceExpression, object data) {
throw new global::System.NotImplementedException("ThisReferenceExpression");
}
public virtual object VisitThrowStatement(ThrowStatement throwStatement, object data) {
throw new global::System.NotImplementedException("ThrowStatement");
}
public virtual object VisitTryCatchStatement(TryCatchStatement tryCatchStatement, object data) {
throw new global::System.NotImplementedException("TryCatchStatement");
}
public virtual object VisitTypeDeclaration(TypeDeclaration typeDeclaration, object data) {
throw new global::System.NotImplementedException("TypeDeclaration");
}
public virtual object VisitTypeOfExpression(TypeOfExpression typeOfExpression, object data) {
throw new global::System.NotImplementedException("TypeOfExpression");
}
public virtual object VisitTypeOfIsExpression(TypeOfIsExpression typeOfIsExpression, object data) {
throw new global::System.NotImplementedException("TypeOfIsExpression");
}
public virtual object VisitTypeReference(TypeReference typeReference, object data) {
throw new global::System.NotImplementedException("TypeReference");
}
public virtual object VisitTypeReferenceExpression(TypeReferenceExpression typeReferenceExpression, object data) {
throw new global::System.NotImplementedException("TypeReferenceExpression");
}
public virtual object VisitUnaryOperatorExpression(UnaryOperatorExpression unaryOperatorExpression, object data) {
throw new global::System.NotImplementedException("UnaryOperatorExpression");
}
public virtual object VisitUncheckedExpression(UncheckedExpression uncheckedExpression, object data) {
throw new global::System.NotImplementedException("UncheckedExpression");
}
public virtual object VisitUncheckedStatement(UncheckedStatement uncheckedStatement, object data) {
throw new global::System.NotImplementedException("UncheckedStatement");
}
public virtual object VisitUnsafeStatement(UnsafeStatement unsafeStatement, object data) {
throw new global::System.NotImplementedException("UnsafeStatement");
}
public virtual object VisitUsing(Using @using, object data) {
throw new global::System.NotImplementedException("Using");
}
public virtual object VisitUsingDeclaration(UsingDeclaration usingDeclaration, object data) {
throw new global::System.NotImplementedException("UsingDeclaration");
}
public virtual object VisitUsingStatement(UsingStatement usingStatement, object data) {
throw new global::System.NotImplementedException("UsingStatement");
}
public virtual object VisitVariableDeclaration(VariableDeclaration variableDeclaration, object data) {
throw new global::System.NotImplementedException("VariableDeclaration");
}
public virtual object VisitWithStatement(WithStatement withStatement, object data) {
throw new global::System.NotImplementedException("WithStatement");
}
public virtual object VisitYieldStatement(YieldStatement yieldStatement, object data) {
throw new global::System.NotImplementedException("YieldStatement");
}
}
}

6
src/Libraries/NRefactory/Test/Output/CSharp/CSharpOutputTest.cs

@ -579,5 +579,11 @@ namespace ICSharpCode.NRefactory.Tests.PrettyPrinter @@ -579,5 +579,11 @@ namespace ICSharpCode.NRefactory.Tests.PrettyPrinter
" group n by n % 5 into g" +
" select new { Remainder = g.Key, Numbers = g }");
}
[Test]
public void ExternAlias()
{
TestProgram("extern alias Name;");
}
}
}

7
src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/EasyCodeDom.cs

@ -385,6 +385,13 @@ namespace ICSharpCode.EasyCodeDom @@ -385,6 +385,13 @@ namespace ICSharpCode.EasyCodeDom
return st;
}
public CodeThrowExceptionStatement Throw(CodeExpression expr)
{
CodeThrowExceptionStatement st = new CodeThrowExceptionStatement(expr);
csc.Add(st);
return st;
}
public CodeAssignStatement Assign(CodeExpression lhs, CodeExpression rhs)
{
CodeAssignStatement st = new CodeAssignStatement(lhs, rhs);

Loading…
Cancel
Save