From e11c6451bb6b9046ede78e93d363eb12dbf246ca Mon Sep 17 00:00:00 2001 From: PTKu <61538034+PTKu@users.noreply.github.com> Date: Tue, 7 May 2024 08:03:36 +0200 Subject: [PATCH] clup --- GitVersion.yml | 2 +- .../src/AXSharp.Compiler/AXSharpProject.cs | 10 +- .../AXSharp.Compiler/Core/IxNodeVisitor.cs | 198 +++++------------- 3 files changed, 63 insertions(+), 147 deletions(-) diff --git a/GitVersion.yml b/GitVersion.yml index 68c7769f..ce5d2de1 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -1,5 +1,5 @@ mode: ContinuousDeployment -next-version: 0.19.2 +next-version: 0.19.0 branches: main: regex: ^master$|^main$ diff --git a/src/AXSharp.compiler/src/AXSharp.Compiler/AXSharpProject.cs b/src/AXSharp.compiler/src/AXSharp.Compiler/AXSharpProject.cs index 63769fa6..3a8de01d 100644 --- a/src/AXSharp.compiler/src/AXSharp.Compiler/AXSharpProject.cs +++ b/src/AXSharp.compiler/src/AXSharp.Compiler/AXSharpProject.cs @@ -93,8 +93,8 @@ public void Generate() var toCompile = refParseTrees.Concat(projectSources.Select(p => p.parseTree)); - var compilation = Compilation.Create(toCompile, new List(), Compilation.Settings.Default).Result; - + var compilationResult = Compilation.Create(toCompile, new List(), Compilation.Settings.Default).Result; + this.CleanOutput(this.OutputFolder); foreach (var origin in projectSources) @@ -103,7 +103,7 @@ public void Generate() foreach (var sourceBuilderType in BuilderTypes) { - var builder = Activator.CreateInstance(sourceBuilderType, this, compilation.Compilation); + var builder = Activator.CreateInstance(sourceBuilderType, this, compilationResult.Compilation); var treeWalker = builder as ICombinedThreeVisitor; var sourceBuilder = builder as ISourceBuilder; @@ -116,7 +116,7 @@ public void Generate() $"Could not create {sourceBuilderType.Name} as ISourceBuilder"); - origin.parseTree.GetRoot().Visit(new IxNodeVisitor(compilation.Compilation), treeWalker); + origin.parseTree.GetRoot().Visit(new IxNodeVisitor(compilationResult.Compilation), treeWalker); @@ -136,7 +136,7 @@ public void Generate() } TargetProject.ProvisionProjectStructure(); - GenerateMetadata(compilation.Compilation); + GenerateMetadata(compilationResult.Compilation); TargetProject.GenerateResources(); TargetProject.GenerateCompanionData(); Log.Logger.Information($"Compilation of project '{AxProject.SrcFolder}' done."); diff --git a/src/AXSharp.compiler/src/AXSharp.Compiler/Core/IxNodeVisitor.cs b/src/AXSharp.compiler/src/AXSharp.Compiler/Core/IxNodeVisitor.cs index 253bffad..84ad9683 100644 --- a/src/AXSharp.compiler/src/AXSharp.Compiler/Core/IxNodeVisitor.cs +++ b/src/AXSharp.compiler/src/AXSharp.Compiler/Core/IxNodeVisitor.cs @@ -39,12 +39,12 @@ public partial class IxNodeVisitor : ISemanticNodeVisitor void ISemanticNodeVisitor.Visit(IPartialSemanticTree partialSemanticTree, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(ISymbol symbol, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(IPragma pragma, ICombinedThreeVisitor data) @@ -61,35 +61,35 @@ void ISemanticNodeVisitor.Visit(IConfigurationDeclaration void ISemanticNodeVisitor.Visit(ITaskConfigurationDeclaration taskConfigurationDeclaration, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(ITaskDeclaration taskDeclaration, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit( IProgramConfigurationDeclaration programConfigurationDeclaration, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(INamespaceDeclaration namespaceDeclaration, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(IUsingDirective usingDirective, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(IProgramDeclaration programDeclaration, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(IClassDeclaration classDeclaration, @@ -107,25 +107,25 @@ void ISemanticNodeVisitor.Visit(IInterfaceDeclaration int void ISemanticNodeVisitor.Visit(IFunctionDeclaration functionDeclaration, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(IFunctionBlockDeclaration functionBlockDeclaration, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(IMethodDeclaration methodDeclaration, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(IMethodPrototypeDeclaration methodPrototypeDeclaration, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(IScalarTypeDeclaration scalarTypeDeclaration, @@ -172,7 +172,7 @@ void ISemanticNodeVisitor.Visit(IStringTypeDeclaration st void ISemanticNodeVisitor.Visit(IDimension dimension, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(IFieldDeclaration fieldDeclaration, @@ -190,37 +190,37 @@ void ISemanticNodeVisitor.Visit(IVariableDeclaration vari void ISemanticNodeVisitor.Visit(IEnumValueDeclaration enumValueDeclaration, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(INamedValueDeclaration namedValueDeclaration, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(ISemanticInitializerExpression initializerExpression, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(ISemanticArrayInitializer arrayInitializer, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(ISemanticStructureInitializer structureInitializer, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(ISemanticMemberInitializer memberInitializer, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(ISemanticTypeAccess semanticTypeAccess, @@ -237,162 +237,162 @@ public void Visit(IDocComment semanticTypeAccess, ICombinedThreeVisitor data) void ISemanticNodeVisitor.Visit(ISemanticInstructionList instrList, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(ISemanticAssignmentInstruction assignment, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(ISemanticUnsafeAssignmentInstruction assignment, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(ISemanticAssignmentAttemptInstruction assignmentAttempt, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(ISemanticExpressionInstruction expression, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(ISemanticIfConditionalStatement condStatement, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(IConditionalInstructionList condInstrList, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(ISemanticCaseStatement caseStatement, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(ISemanticSubrange subrange, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(ISemanticForStatement forStatement, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(ISemanticWhileStatement whileStatement, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(ISemanticRepeatStatement repeatStatement, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(ISemanticContinueInstruction continueInstruction, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(ISemanticExitInstruction exitInstruction, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(ISemanticReturnStatement returnStatement, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(ISemanticAsmStatement asmStatement, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(ISemanticConstantExpression constExpr, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(ISemanticIdentifierAccess identifierAccess, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(ISemanticBinaryExpression binExpr, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(ISemanticUnaryExpression unaryExpression, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(ISemanticQualifiedEnumAccess qualifiedEnumAccess, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(ISemanticMemberAccessExpression memberAccessExpression, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(ISemanticArrayAccessExpression arrayAccessExpression, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(ISemanticCallExpression call, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(ISemanticParameterList paramList, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(ISemanticParameterAssignment paramAssignment, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISemanticNodeVisitor.Visit(IPartialAccessExpression partialAccessExpression, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } } @@ -484,7 +484,7 @@ void ISyntaxNodeVisitor.Accept(IEnumTypeDeclarationSyntax public void Accept(IEnumValueListSyntax enumValueListSyntax, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISyntaxNodeVisitor.Accept( @@ -592,13 +592,6 @@ void ISyntaxNodeVisitor.Accept(IUserDeclaredTypeSyntax us throw new NotSupportedException("Uses semantics"); } - - //void ISyntaxNodeVisitor.Accept(IPragmaSyntax pragmaSyntax, ICombinedThreeVisitor data) - //{ - // throw new NotSupportedException("Uses semantics"); - //} - - void ISyntaxNodeVisitor.Accept(IExpressionInitializerSyntax expressionInitializerSyntax, ICombinedThreeVisitor data) { @@ -607,7 +600,7 @@ void ISyntaxNodeVisitor.Accept(IExpressionInitializerSynt public void Accept(IExpressionPrefixStatementSyntax expressionPrefixStatementSyntax, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISyntaxNodeVisitor.Accept(ILiteralSyntax literalSyntax, ICombinedThreeVisitor data) @@ -615,7 +608,6 @@ void ISyntaxNodeVisitor.Accept(ILiteralSyntax literalSynt throw new NotSupportedException(); } - void ISyntaxNodeVisitor.Accept(IExtendsListSyntax extendsListSyntax, ICombinedThreeVisitor data) { @@ -630,21 +622,9 @@ void ISyntaxNodeVisitor.Accept(ITaskDeclarationSyntax tas public void Accept(ITaskInitSpecSyntax taskInitSpecSyntax, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } - //void ISyntaxNodeVisitor.Accept(ITaskConfigSyntax taskConfigSyntax, - // ICombinedThreeVisitor data) - //{ - // throw new NotSupportedException(); - //} - - //void ISyntaxNodeVisitor.Accept( - // IAbstractMethodDeclarationSyntax abstractMethodDeclarationSyntax, ICombinedThreeVisitor data) - //{ - // throw new NotSupportedException(); - //} - void ISyntaxNodeVisitor.Accept(IAccessModifierSyntax accessModifierSyntax, ICombinedThreeVisitor data) { @@ -681,12 +661,6 @@ void ISyntaxNodeVisitor.Accept(IAnonymousReferenceTypeSyn throw new NotSupportedException(); } - //void ISyntaxNodeVisitor.Accept(IArgumentExpressionSyntax argumentExpressionSyntax, - // ICombinedThreeVisitor data) - //{ - // throw new NotSupportedException(); - //} - void ISyntaxNodeVisitor.Accept(IArrayAccessExpressionSyntax arrayAccessExpressionSyntax, ICombinedThreeVisitor data) { @@ -784,32 +758,9 @@ void ISyntaxNodeVisitor.Accept(ICallExpressionSyntax call public void Accept(ICaseListStatementSyntax caseListStatementSyntax, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } - //void ISyntaxNodeVisitor.Accept(ICallParamAssignmentLhsSyntax callParamAssignmentLhsSyntax, - // ICombinedThreeVisitor data) - //{ - // throw new NotSupportedException(); - //} - - //void ISyntaxNodeVisitor.Accept(ICaseListElemSyntax caseListElemSyntax, - // ICombinedThreeVisitor data) - //{ - // throw new NotSupportedException(); - //} - - //void ISyntaxNodeVisitor.Accept(ICaseListSyntax caseListSyntax, ICombinedThreeVisitor data) - //{ - // throw new NotSupportedException(); - //} - - //void ISyntaxNodeVisitor.Accept(ICaseSelectionSyntax caseSelectionSyntax, - // ICombinedThreeVisitor data) - //{ - // throw new NotSupportedException(); - //} - void ISyntaxNodeVisitor.Accept(ICaseStatementSyntax caseStatementSyntax, ICombinedThreeVisitor data) { @@ -827,12 +778,6 @@ void ISyntaxNodeVisitor.Accept(ICodeBodySyntax codeBodySy throw new NotSupportedException(); } - //void ISyntaxNodeVisitor.Accept(ICommaCaseListElemSyntax commaCaseListElemSyntax, - // ICombinedThreeVisitor data) - //{ - // throw new NotSupportedException(); - //} - public void Accept(IConditionalAndExpressionSyntax conditionalAndExpressionSyntax, ICombinedThreeVisitor data) { throw new NotSupportedException(); @@ -927,11 +872,6 @@ void ISyntaxNodeVisitor.Accept(IExpressionSyntax expressi throw new NotSupportedException(); } - //void ISyntaxNodeVisitor.Accept( - // IExternFunctionDeclarationSyntax externFunctionDeclarationSyntax, ICombinedThreeVisitor data) - //{ - // throw new NotSupportedException(); - //} void ISyntaxNodeVisitor.Accept(IForStatementSyntax forStatementSyntax, ICombinedThreeVisitor data) @@ -984,7 +924,7 @@ void ISyntaxNodeVisitor.Accept(IJumpStatementSyntax jumpS public void Accept(IKeywordStatementSyntax keywordStatementSyntax, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISyntaxNodeVisitor.Accept(IListElementSyntax listElementSyntax, @@ -1024,12 +964,6 @@ void ISyntaxNodeVisitor.Accept( throw new NotSupportedException(); } - //void ISyntaxNodeVisitor.Accept(INamedParamListSyntax namedParamListSyntax, - // ICombinedThreeVisitor data) - //{ - // throw new NotSupportedException(); - //} - void ISyntaxNodeVisitor.Accept(INamedTypeSyntax namedTypeSyntax, ICombinedThreeVisitor data) { throw new NotSupportedException(); @@ -1037,7 +971,7 @@ void ISyntaxNodeVisitor.Accept(INamedTypeSyntax namedType public void Accept(INamedValueListSyntax namedValueListSyntax, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISyntaxNodeVisitor.Accept(INamedValueSyntax namedValueSyntax, @@ -1060,7 +994,7 @@ void ISyntaxNodeVisitor.Accept(INamespaceElementSyntax na public void Accept(INonReferenceTypeSyntax nonReferenceTypeSyntax, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISyntaxNodeVisitor.Accept(INotExpressionSyntax notExpressionSyntax, @@ -1128,12 +1062,6 @@ void ISyntaxNodeVisitor.Accept(IProgramDeclarationSyntax // We ignore PROGRAM declarations. } - //void ISyntaxNodeVisitor.Accept(IQualifiedEnumAccessSyntax qualifiedEnumAccessSyntax, - // ICombinedThreeVisitor data) - //{ - // throw new NotSupportedException(); - //} - void ISyntaxNodeVisitor.Accept(IQualifiedIdentifierListSyntax qualifiedIdentifierListSyntax, ICombinedThreeVisitor data) { @@ -1201,12 +1129,6 @@ void ISyntaxNodeVisitor.Accept(IStatementListSyntax state throw new NotSupportedException(); } - //void ISyntaxNodeVisitor.Accept(IStatementPartSyntax statementPartSyntax, - // ICombinedThreeVisitor data) - //{ - // throw new NotSupportedException(); - //} - void ISyntaxNodeVisitor.Accept(IStatementSyntax statementSyntax, ICombinedThreeVisitor data) { throw new NotSupportedException(); @@ -1261,7 +1183,7 @@ void ISyntaxNodeVisitor.Accept(ITaskInitSyntax taskInitSy public void Accept(ITaskInstanceSyntax taskInstanceSyntax, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISyntaxNodeVisitor.Accept(IThisAccessSyntax thisAccessSyntax, @@ -1284,15 +1206,9 @@ void ISyntaxNodeVisitor.Accept(ITypeSyntax typeSyntax, IC public void Accept(IUnaryArithmeticExpressionSyntax unaryArithmeticExpressionSyntax, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } - //void ISyntaxNodeVisitor.Accept(IUnnamedParamListSyntax unnamedParamListSyntax, - // ICombinedThreeVisitor data) - //{ - // throw new NotSupportedException(); - //} - void ISyntaxNodeVisitor.Accept(IUnsafeAssignStatementSyntax unsafeAssignStatementSyntax, ICombinedThreeVisitor data) { @@ -1327,11 +1243,11 @@ void ISyntaxNodeVisitor.Accept(IXOrExpressionSyntax xOrEx public void Visit(ISemanticEmptyInstruction emptyInstruction, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } public void Visit(ISemanticCaseSelectionStatement caseSelectionStatement, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } } \ No newline at end of file