diff --git a/GitVersion.yml b/GitVersion.yml index ce5d2de1..79d4e845 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -1,5 +1,5 @@ mode: ContinuousDeployment -next-version: 0.19.0 +next-version: 0.18.0 branches: main: regex: ^master$|^main$ diff --git a/src/AXSharp.compiler/src/AXSharp.Compiler/AXSharp.Compiler.csproj b/src/AXSharp.compiler/src/AXSharp.Compiler/AXSharp.Compiler.csproj index 7ea22bf3..8897c2b4 100644 --- a/src/AXSharp.compiler/src/AXSharp.Compiler/AXSharp.Compiler.csproj +++ b/src/AXSharp.compiler/src/AXSharp.Compiler/AXSharp.Compiler.csproj @@ -61,15 +61,14 @@ - - - - - - - - - + + + + + + + + @@ -89,11 +88,6 @@ ..\..\..\apax\stc\bin\AX.Text.dll False - - - ..\..\..\apax\stc\bin\AX.ST.Compiler.PluginAbstractions.dll - False - \ No newline at end of file diff --git a/src/AXSharp.compiler/src/AXSharp.Compiler/AXSharpProject.cs b/src/AXSharp.compiler/src/AXSharp.Compiler/AXSharpProject.cs index 61698549..dfc86d35 100644 --- a/src/AXSharp.compiler/src/AXSharp.Compiler/AXSharpProject.cs +++ b/src/AXSharp.compiler/src/AXSharp.Compiler/AXSharpProject.cs @@ -8,7 +8,6 @@ using System.Text; using System.Xml.Linq; using AX.ST.Semantic; -using AX.ST.Semantic.Analyzer; using AX.ST.Semantic.Model.Declarations; using AX.ST.Semantic.Model.Declarations.Types; using AX.ST.Syntax.Parser; @@ -93,7 +92,7 @@ public void Generate() var toCompile = refParseTrees.Concat(projectSources.Select(p => p.parseTree)); - var compilation = Compilation.Create(toCompile, new List(), Compilation.Settings.Default).Result; + var compilation = Compilation.Create(toCompile, Compilation.Settings.Default).Result; this.CleanOutput(this.OutputFolder); @@ -103,7 +102,7 @@ public void Generate() foreach (var sourceBuilderType in BuilderTypes) { - var builder = Activator.CreateInstance(sourceBuilderType, this, compilation.Compilation); + var builder = Activator.CreateInstance(sourceBuilderType, this, compilation); var treeWalker = builder as ICombinedThreeVisitor; var sourceBuilder = builder as ISourceBuilder; @@ -116,7 +115,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(compilation), treeWalker); @@ -136,7 +135,7 @@ public void Generate() } TargetProject.ProvisionProjectStructure(); - GenerateMetadata(compilation.Compilation); + GenerateMetadata(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..57fdc2ce 100644 --- a/src/AXSharp.compiler/src/AXSharp.Compiler/Core/IxNodeVisitor.cs +++ b/src/AXSharp.compiler/src/AXSharp.Compiler/Core/IxNodeVisitor.cs @@ -282,8 +282,12 @@ void ISemanticNodeVisitor.Visit(ISemanticCaseStatement ca throw new NotImplementedException(); } - - + void ISemanticNodeVisitor.Visit(ISemanticCaseSelection caseSelection, + ICombinedThreeVisitor data) + { + throw new NotImplementedException(); + } + void ISemanticNodeVisitor.Visit(ISemanticSubrange subrange, ICombinedThreeVisitor data) { throw new NotImplementedException(); @@ -482,11 +486,6 @@ void ISyntaxNodeVisitor.Accept(IEnumTypeDeclarationSyntax data.CreateEnumTypeDeclaration(enumTypeDeclarationSyntax, semantics, this); } - public void Accept(IEnumValueListSyntax enumValueListSyntax, ICombinedThreeVisitor data) - { - throw new NotImplementedException(); - } - void ISyntaxNodeVisitor.Accept( INamedValueTypeDeclarationSyntax namedValueTypeDeclarationSyntax, ICombinedThreeVisitor data) @@ -521,11 +520,9 @@ void ISyntaxNodeVisitor.Accept(IStructTypeDeclarationSynt private string GetFullyQualifiedNameFromCurrentSyntaxTree(string typeName) { - var qualified = string.IsNullOrEmpty(_containingNamespace.Replace('|', '.')) + return string.IsNullOrEmpty(_containingNamespace.Replace('|', '.')) ? typeName : $"{_containingNamespace}.{typeName}"; - - return qualified.Replace("|", "."); } #region NotImplemented @@ -593,10 +590,10 @@ void ISyntaxNodeVisitor.Accept(IUserDeclaredTypeSyntax us } - //void ISyntaxNodeVisitor.Accept(IPragmaSyntax pragmaSyntax, ICombinedThreeVisitor data) - //{ - // throw new NotSupportedException("Uses semantics"); - //} + void ISyntaxNodeVisitor.Accept(IPragmaSyntax pragmaSyntax, ICombinedThreeVisitor data) + { + throw new NotSupportedException("Uses semantics"); + } void ISyntaxNodeVisitor.Accept(IExpressionInitializerSyntax expressionInitializerSyntax, @@ -605,11 +602,6 @@ void ISyntaxNodeVisitor.Accept(IExpressionInitializerSynt throw new NotSupportedException(); } - public void Accept(IExpressionPrefixStatementSyntax expressionPrefixStatementSyntax, ICombinedThreeVisitor data) - { - throw new NotImplementedException(); - } - void ISyntaxNodeVisitor.Accept(ILiteralSyntax literalSyntax, ICombinedThreeVisitor data) { throw new NotSupportedException(); @@ -628,22 +620,17 @@ void ISyntaxNodeVisitor.Accept(ITaskDeclarationSyntax tas throw new NotSupportedException(); } - public void Accept(ITaskInitSpecSyntax taskInitSpecSyntax, ICombinedThreeVisitor data) + void ISyntaxNodeVisitor.Accept(ITaskConfigSyntax taskConfigSyntax, + 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( + IAbstractMethodDeclarationSyntax abstractMethodDeclarationSyntax, ICombinedThreeVisitor data) + { + throw new NotSupportedException(); + } void ISyntaxNodeVisitor.Accept(IAccessModifierSyntax accessModifierSyntax, ICombinedThreeVisitor data) @@ -681,11 +668,11 @@ void ISyntaxNodeVisitor.Accept(IAnonymousReferenceTypeSyn throw new NotSupportedException(); } - //void ISyntaxNodeVisitor.Accept(IArgumentExpressionSyntax argumentExpressionSyntax, - // ICombinedThreeVisitor data) - //{ - // throw new NotSupportedException(); - //} + void ISyntaxNodeVisitor.Accept(IArgumentExpressionSyntax argumentExpressionSyntax, + ICombinedThreeVisitor data) + { + throw new NotSupportedException(); + } void ISyntaxNodeVisitor.Accept(IArrayAccessExpressionSyntax arrayAccessExpressionSyntax, ICombinedThreeVisitor data) @@ -741,11 +728,6 @@ void ISyntaxNodeVisitor.Accept(IArrayInitializerSyntax ar throw new NotSupportedException(); } - public void Accept(IArrayRepetitionInitializerSyntax arrayRepetitionInitializerSyntax, ICombinedThreeVisitor data) - { - throw new NotSupportedException(); - } - void ISyntaxNodeVisitor.Accept(IArrayTypeDeclarationSyntax arrayTypeDeclarationSyntax, ICombinedThreeVisitor data) { @@ -782,33 +764,28 @@ void ISyntaxNodeVisitor.Accept(ICallExpressionSyntax call throw new NotSupportedException(); } - public void Accept(ICaseListStatementSyntax caseListStatementSyntax, ICombinedThreeVisitor data) + void ISyntaxNodeVisitor.Accept(ICallParamAssignmentLhsSyntax callParamAssignmentLhsSyntax, + 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(ICaseListElemSyntax caseListElemSyntax, + ICombinedThreeVisitor data) + { + throw new NotSupportedException(); + } - //void ISyntaxNodeVisitor.Accept(ICaseListSyntax caseListSyntax, 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(ICaseSelectionSyntax caseSelectionSyntax, + ICombinedThreeVisitor data) + { + throw new NotSupportedException(); + } void ISyntaxNodeVisitor.Accept(ICaseStatementSyntax caseStatementSyntax, ICombinedThreeVisitor data) @@ -827,20 +804,20 @@ void ISyntaxNodeVisitor.Accept(ICodeBodySyntax codeBodySy throw new NotSupportedException(); } - //void ISyntaxNodeVisitor.Accept(ICommaCaseListElemSyntax commaCaseListElemSyntax, - // ICombinedThreeVisitor data) - //{ - // throw new NotSupportedException(); - //} + void ISyntaxNodeVisitor.Accept(ICommaCaseListElemSyntax commaCaseListElemSyntax, + ICombinedThreeVisitor data) + { + throw new NotSupportedException(); + } public void Accept(IConditionalAndExpressionSyntax conditionalAndExpressionSyntax, ICombinedThreeVisitor data) { - throw new NotSupportedException(); + throw new NotImplementedException(); } public void Accept(IConditionalOrExpressionSyntax conditionalOrExpressionSyntax, ICombinedThreeVisitor data) { - throw new NotSupportedException(); + throw new NotImplementedException(); } void ISyntaxNodeVisitor.Accept(IConditionalStatementSyntax conditionalStatementSyntax, @@ -927,11 +904,11 @@ void ISyntaxNodeVisitor.Accept(IExpressionSyntax expressi throw new NotSupportedException(); } - //void ISyntaxNodeVisitor.Accept( - // IExternFunctionDeclarationSyntax externFunctionDeclarationSyntax, ICombinedThreeVisitor data) - //{ - // throw new NotSupportedException(); - //} + void ISyntaxNodeVisitor.Accept( + IExternFunctionDeclarationSyntax externFunctionDeclarationSyntax, ICombinedThreeVisitor data) + { + throw new NotSupportedException(); + } void ISyntaxNodeVisitor.Accept(IForStatementSyntax forStatementSyntax, ICombinedThreeVisitor data) @@ -982,11 +959,6 @@ void ISyntaxNodeVisitor.Accept(IJumpStatementSyntax jumpS throw new NotSupportedException(); } - public void Accept(IKeywordStatementSyntax keywordStatementSyntax, ICombinedThreeVisitor data) - { - throw new NotImplementedException(); - } - void ISyntaxNodeVisitor.Accept(IListElementSyntax listElementSyntax, ICombinedThreeVisitor data) { @@ -1024,20 +996,15 @@ void ISyntaxNodeVisitor.Accept( throw new NotSupportedException(); } - //void ISyntaxNodeVisitor.Accept(INamedParamListSyntax namedParamListSyntax, - // ICombinedThreeVisitor data) - //{ - // throw new NotSupportedException(); - //} - - void ISyntaxNodeVisitor.Accept(INamedTypeSyntax namedTypeSyntax, ICombinedThreeVisitor data) + void ISyntaxNodeVisitor.Accept(INamedParamListSyntax namedParamListSyntax, + ICombinedThreeVisitor data) { throw new NotSupportedException(); } - public void Accept(INamedValueListSyntax namedValueListSyntax, ICombinedThreeVisitor data) + void ISyntaxNodeVisitor.Accept(INamedTypeSyntax namedTypeSyntax, ICombinedThreeVisitor data) { - throw new NotImplementedException(); + throw new NotSupportedException(); } void ISyntaxNodeVisitor.Accept(INamedValueSyntax namedValueSyntax, @@ -1058,11 +1025,6 @@ void ISyntaxNodeVisitor.Accept(INamespaceElementSyntax na throw new NotSupportedException(); } - public void Accept(INonReferenceTypeSyntax nonReferenceTypeSyntax, ICombinedThreeVisitor data) - { - throw new NotImplementedException(); - } - void ISyntaxNodeVisitor.Accept(INotExpressionSyntax notExpressionSyntax, ICombinedThreeVisitor data) { @@ -1128,11 +1090,11 @@ void ISyntaxNodeVisitor.Accept(IProgramDeclarationSyntax // We ignore PROGRAM declarations. } - //void ISyntaxNodeVisitor.Accept(IQualifiedEnumAccessSyntax qualifiedEnumAccessSyntax, - // ICombinedThreeVisitor data) - //{ - // throw new NotSupportedException(); - //} + void ISyntaxNodeVisitor.Accept(IQualifiedEnumAccessSyntax qualifiedEnumAccessSyntax, + ICombinedThreeVisitor data) + { + throw new NotSupportedException(); + } void ISyntaxNodeVisitor.Accept(IQualifiedIdentifierListSyntax qualifiedIdentifierListSyntax, ICombinedThreeVisitor data) @@ -1201,11 +1163,11 @@ void ISyntaxNodeVisitor.Accept(IStatementListSyntax state throw new NotSupportedException(); } - //void ISyntaxNodeVisitor.Accept(IStatementPartSyntax statementPartSyntax, - // ICombinedThreeVisitor data) - //{ - // throw new NotSupportedException(); - //} + void ISyntaxNodeVisitor.Accept(IStatementPartSyntax statementPartSyntax, + ICombinedThreeVisitor data) + { + throw new NotSupportedException(); + } void ISyntaxNodeVisitor.Accept(IStatementSyntax statementSyntax, ICombinedThreeVisitor data) { @@ -1226,16 +1188,6 @@ void ISyntaxNodeVisitor.Accept(IStructureInitializerSynta throw new NotSupportedException(); } - public void Accept(IStSyntax stSyntax, ICombinedThreeVisitor data) - { - throw new NotSupportedException(); - } - - public void Accept(ISubCaseListSyntax subCaseListSyntax, ICombinedThreeVisitor data) - { - throw new NotSupportedException(); - } - void ISyntaxNodeVisitor.Accept(ISuperExpressionSyntax superExpressionSyntax, ICombinedThreeVisitor data) { @@ -1259,11 +1211,6 @@ void ISyntaxNodeVisitor.Accept(ITaskInitSyntax taskInitSy throw new NotSupportedException(); } - public void Accept(ITaskInstanceSyntax taskInstanceSyntax, ICombinedThreeVisitor data) - { - throw new NotImplementedException(); - } - void ISyntaxNodeVisitor.Accept(IThisAccessSyntax thisAccessSyntax, ICombinedThreeVisitor data) { @@ -1282,17 +1229,12 @@ void ISyntaxNodeVisitor.Accept(ITypeSyntax typeSyntax, IC throw new NotSupportedException(); } - public void Accept(IUnaryArithmeticExpressionSyntax unaryArithmeticExpressionSyntax, ICombinedThreeVisitor data) + void ISyntaxNodeVisitor.Accept(IUnnamedParamListSyntax unnamedParamListSyntax, + 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) { @@ -1324,14 +1266,4 @@ void ISyntaxNodeVisitor.Accept(IXOrExpressionSyntax xOrEx } #endregion - - public void Visit(ISemanticEmptyInstruction emptyInstruction, ICombinedThreeVisitor data) - { - throw new NotImplementedException(); - } - - public void Visit(ISemanticCaseSelectionStatement caseSelectionStatement, ICombinedThreeVisitor data) - { - throw new NotImplementedException(); - } } \ No newline at end of file diff --git a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerSourceBuilder.cs b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerSourceBuilder.cs index 2e571f30..ef00a14c 100644 --- a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerSourceBuilder.cs +++ b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerSourceBuilder.cs @@ -103,18 +103,6 @@ public void CreateClassDeclaration(IClassDeclarationSyntax classDeclarationSynta IxNodeVisitor visitor) { TypeCommAccessibility = classDeclaration.GetCommAccessibility(this); - - // This is a workaround for abstract classes where semantic model does not contain pragmas even when declared in the source. - if (classDeclarationSyntax.ClassKeyword.FullText.Trim().ToLower().StartsWith("{S7.extern=ReadWrite}".ToLower())) - { - TypeCommAccessibility = eCommAccessibility.ReadWrite; - } - - if (classDeclarationSyntax.ClassKeyword.FullText.Trim().ToLower().StartsWith("{S7.extern=Read}".ToLower())) - { - TypeCommAccessibility = eCommAccessibility.ReadOnly; - } - classDeclarationSyntax.UsingDirectives.ToList().ForEach(p => p.Visit(visitor, this)); var generic = classDeclaration.GetGenericAttributes(); @@ -212,7 +200,7 @@ public void CreateEnumTypeDeclaration(IEnumTypeDeclarationSyntax enumTypeDeclara TypeCommAccessibility = eCommAccessibility.None; AddToSource($"public enum {enumTypeDeclarationSyntax.Name.Text} {{"); - AddToSource(string.Join("\n,", enumTypeDeclarationSyntax.EnumValueList.EnumValues.Select(p => p.Name.Text))); + AddToSource(string.Join("\n,", enumTypeDeclarationSyntax.EnumValues.Select(p => p.Name.Text))); AddToSource("}"); } @@ -223,7 +211,7 @@ public void CreateNamedValueTypeDeclaration(INamedValueTypeDeclarationSyntax nam TypeCommAccessibility = eCommAccessibility.None; AddToSource( - $"public enum {namedValueTypeDeclarationSyntax.Name.Text} : {namedValueTypeDeclarationSyntax.BaseType.TransformType()} {{"); + $"public enum {namedValueTypeDeclarationSyntax.Name.Text} : {namedValueTypeDeclarationSyntax.Type.TransformType()} {{"); // TODO: Value re-interpretation should be done according to the type. diff --git a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Plain/CsPlainSourceBuilder.cs b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Plain/CsPlainSourceBuilder.cs index fb532a3c..a44ced5d 100644 --- a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Plain/CsPlainSourceBuilder.cs +++ b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Plain/CsPlainSourceBuilder.cs @@ -54,18 +54,7 @@ public void CreateClassDeclaration(IClassDeclarationSyntax classDeclarationSynta IxNodeVisitor visitor) { TypeCommAccessibility = classDeclaration.GetCommAccessibility(this); - - // This is a workaround for abstract classes where semantic model does not contain pragmas even when declared in the source. - if (classDeclarationSyntax.ClassKeyword.FullText.Trim().ToLower().StartsWith("{S7.extern=ReadWrite}".ToLower())) - { - TypeCommAccessibility = eCommAccessibility.ReadWrite; - } - - if (classDeclarationSyntax.ClassKeyword.FullText.Trim().ToLower().StartsWith("{S7.extern=Read}".ToLower())) - { - TypeCommAccessibility = eCommAccessibility.ReadOnly; - } - + classDeclarationSyntax.UsingDirectives.ToList().ForEach(p => p.Visit(visitor, this)); AddToSource($"{classDeclaration.AccessModifier.Transform()}partial class {classDeclaration.Name}"); diff --git a/src/AXSharp.compiler/src/ixc/AXSharp.ixc.csproj b/src/AXSharp.compiler/src/ixc/AXSharp.ixc.csproj index 80f46ef6..66935014 100644 --- a/src/AXSharp.compiler/src/ixc/AXSharp.ixc.csproj +++ b/src/AXSharp.compiler/src/ixc/AXSharp.ixc.csproj @@ -76,8 +76,7 @@ - - + diff --git a/src/AXSharp.compiler/src/ixd/AXSharp.ixd.csproj b/src/AXSharp.compiler/src/ixd/AXSharp.ixd.csproj index 15cb4747..9e64ebab 100644 --- a/src/AXSharp.compiler/src/ixd/AXSharp.ixd.csproj +++ b/src/AXSharp.compiler/src/ixd/AXSharp.ixd.csproj @@ -47,11 +47,10 @@ - - - - - + + + + diff --git a/src/AXSharp.compiler/src/ixd/Program.cs b/src/AXSharp.compiler/src/ixd/Program.cs index fe6ebfc2..785fa144 100644 --- a/src/AXSharp.compiler/src/ixd/Program.cs +++ b/src/AXSharp.compiler/src/ixd/Program.cs @@ -77,9 +77,9 @@ void GenerateYamls(Options o) var toCompile = projectSources.Select(p => p.parseTree); - var compilation = Compilation.Create(toCompile, null, Compilation.Settings.Default).Result; + var compilation = Compilation.Create(toCompile, Compilation.Settings.Default).Result; - var semanticTree = compilation.Compilation.GetSemanticTree(); + var semanticTree = compilation.GetSemanticTree(); //visit var myNodeVisitor = new MyNodeVisitor(); diff --git a/src/AXSharp.compiler/src/ixd/Visitors/MyNodeVisitor.cs b/src/AXSharp.compiler/src/ixd/Visitors/MyNodeVisitor.cs index 4917a11e..0904cbc5 100644 --- a/src/AXSharp.compiler/src/ixd/Visitors/MyNodeVisitor.cs +++ b/src/AXSharp.compiler/src/ixd/Visitors/MyNodeVisitor.cs @@ -197,7 +197,7 @@ public void Visit(ISemanticTypeAccess semanticTypeAccess, IYamlBuiderVisitor dat public void Visit(IDocComment semanticTypeAccess, IYamlBuiderVisitor data) { - // throw new NotImplementedException(); + throw new NotImplementedException(); } public void Visit(ISemanticInstructionList instrList, IYamlBuiderVisitor data) @@ -205,11 +205,6 @@ public void Visit(ISemanticInstructionList instrList, IYamlBuiderVisitor data) } - public void Visit(ISemanticEmptyInstruction emptyInstruction, IYamlBuiderVisitor data) - { - // throw new NotImplementedException(); - } - public void Visit(ISemanticAssignmentInstruction assignment, IYamlBuiderVisitor data) { @@ -245,15 +240,10 @@ public void Visit(ISemanticCaseStatement caseStatement, IYamlBuiderVisitor data) } - public void Visit(ISemanticCaseSelectionStatement caseSelectionStatement, IYamlBuiderVisitor data) + public void Visit(ISemanticCaseSelection caseSelection, IYamlBuiderVisitor data) { - throw new NotImplementedException(); - } - - //public void Visit(ISemanticCaseSelection caseSelection, IYamlBuiderVisitor data) - //{ - //} + } public void Visit(ISemanticSubrange subrange, IYamlBuiderVisitor data) { diff --git a/src/AXSharp.compiler/src/ixr/AXSharp.ixr.csproj b/src/AXSharp.compiler/src/ixr/AXSharp.ixr.csproj index 938a1376..15547222 100644 --- a/src/AXSharp.compiler/src/ixr/AXSharp.ixr.csproj +++ b/src/AXSharp.compiler/src/ixr/AXSharp.ixr.csproj @@ -53,12 +53,11 @@ - - - - - - + + + + + diff --git a/src/AXSharp.compiler/src/ixr/Program.cs b/src/AXSharp.compiler/src/ixr/Program.cs index c9cc0794..6a185c80 100644 --- a/src/AXSharp.compiler/src/ixr/Program.cs +++ b/src/AXSharp.compiler/src/ixr/Program.cs @@ -101,18 +101,16 @@ void IterateSyntaxTreeForStringLiterals(ISyntaxNode root, LocalizedStringWrapper } } - - void IterateSyntaxTreeForPragmas(ISyntaxNode root, LocalizedStringWrapper lw, string fileName) { - //foreach (var pragmaSyntax in GetChildNodesRecursive(root).OfType()) - //{ - // var token = pragmaSyntax.PragmaToken; - // if(lw.IsAttributeNamePragmaToken(token.Text)) - // { - // AddToDictionaryIfLocalizedString(token,lw,fileName); - // } - //} + foreach (var pragmaSyntax in GetChildNodesRecursive(root).OfType()) + { + var token = pragmaSyntax.PragmaToken; + if(lw.IsAttributeNamePragmaToken(token.Text)) + { + AddToDictionaryIfLocalizedString(token,lw,fileName); + } + } } void AddToDictionaryIfLocalizedString(ISyntaxToken token, LocalizedStringWrapper lw, string fileName) @@ -149,10 +147,10 @@ void AddToDictionaryIfLocalizedString(ISyntaxToken token, LocalizedStringWrapper } bool IsPragmaToken(ISyntaxToken token) { - //if(token.SyntaxKind == SyntaxKind.PragmaToken) - //{ - // return true; - //} + if(token.SyntaxKind == SyntaxKind.PragmaToken) + { + return true; + } return false; } diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/AXSharp.Compiler.CsTests.csproj b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/AXSharp.Compiler.CsTests.csproj index 0b079d2c..51b9e24e 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/AXSharp.Compiler.CsTests.csproj +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/AXSharp.Compiler.CsTests.csproj @@ -27,7 +27,6 @@ - @@ -60,18 +59,6 @@ - - - PreserveNewest - - - - - - PreserveNewest - - - PreserveNewest @@ -110,9 +97,6 @@ PreserveNewest - - PreserveNewest - Always @@ -416,7 +400,7 @@ Always - + @@ -444,9 +428,6 @@ ..\..\..\apax\stc\bin\AX.Text.dll - - ..\..\..\apax\stc\bin\AX.ST.Syntax.dll - diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/Cs/CsSourceBuilderTests.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/Cs/CsSourceBuilderTests.cs index b1bf464d..342e3798 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/Cs/CsSourceBuilderTests.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/Cs/CsSourceBuilderTests.cs @@ -271,16 +271,9 @@ public void mixed_access() var memberName = GetMethodName(); CompareOutputs(memberName); } - - - [Fact] - public void abstract_members() - { - var memberName = GetMethodName(); - CompareOutputs(memberName); - } + private void CompareOutputs(string memberName) { var sourceFile = Path.Combine(testFolder, $@"samples\units\src\{memberName}.st"); diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/abstract_members.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/abstract_members.g.cs deleted file mode 100644 index dfbac880..00000000 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/abstract_members.g.cs +++ /dev/null @@ -1,232 +0,0 @@ -using System; -using AXSharp.Connector; -using AXSharp.Connector.ValueTypes; -using System.Collections.Generic; -using AXSharp.Connector.Localizations; - -public partial class AbstractMotor : AXSharp.Connector.ITwinObject -{ - public OnlinerBool Run { get; } - - public OnlinerBool ReverseDirection { get; } - - partial void PreConstruct(AXSharp.Connector.ITwinObject parent, string readableTail, string symbolTail); - partial void PostConstruct(AXSharp.Connector.ITwinObject parent, string readableTail, string symbolTail); - public AbstractMotor(AXSharp.Connector.ITwinObject parent, string readableTail, string symbolTail) - { - Symbol = AXSharp.Connector.Connector.CreateSymbol(parent.Symbol, symbolTail); - this.@SymbolTail = symbolTail; - this.@Connector = parent.GetConnector(); - this.@Parent = parent; - HumanReadable = AXSharp.Connector.Connector.CreateHumanReadable(parent.HumanReadable, readableTail); - PreConstruct(parent, readableTail, symbolTail); - Run = @Connector.ConnectorAdapter.AdapterFactory.CreateBOOL(this, "Run", "Run"); - ReverseDirection = @Connector.ConnectorAdapter.AdapterFactory.CreateBOOL(this, "ReverseDirection", "ReverseDirection"); - parent.AddChild(this); - parent.AddKid(this); - PostConstruct(parent, readableTail, symbolTail); - } - - public async virtual Task OnlineToPlain() - { - return await (dynamic)this.OnlineToPlainAsync(); - } - - public async Task OnlineToPlainAsync() - { - Pocos.AbstractMotor plain = new Pocos.AbstractMotor(); - await this.ReadAsync(); - plain.Run = Run.LastValue; - plain.ReverseDirection = ReverseDirection.LastValue; - return plain; - } - - [Obsolete("This method should not be used if you indent to access the controllers data. Use `OnlineToPlain` instead.")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public async Task _OnlineToPlainNoacAsync() - { - Pocos.AbstractMotor plain = new Pocos.AbstractMotor(); - plain.Run = Run.LastValue; - plain.ReverseDirection = ReverseDirection.LastValue; - return plain; - } - - [Obsolete("This method should not be used if you indent to access the controllers data. Use `OnlineToPlain` instead.")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - protected async Task _OnlineToPlainNoacAsync(Pocos.AbstractMotor plain) - { - plain.Run = Run.LastValue; - plain.ReverseDirection = ReverseDirection.LastValue; - return plain; - } - - public async virtual Task PlainToOnline(T plain) - { - await this.PlainToOnlineAsync((dynamic)plain); - } - - public async Task> PlainToOnlineAsync(Pocos.AbstractMotor plain) - { -#pragma warning disable CS0612 - Run.LethargicWrite(plain.Run); -#pragma warning restore CS0612 -#pragma warning disable CS0612 - ReverseDirection.LethargicWrite(plain.ReverseDirection); -#pragma warning restore CS0612 - return await this.WriteAsync(); - } - - [Obsolete("This method should not be used if you indent to access the controllers data. Use `PlainToOnline` instead.")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public async Task _PlainToOnlineNoacAsync(Pocos.AbstractMotor plain) - { -#pragma warning disable CS0612 - Run.LethargicWrite(plain.Run); -#pragma warning restore CS0612 -#pragma warning disable CS0612 - ReverseDirection.LethargicWrite(plain.ReverseDirection); -#pragma warning restore CS0612 - } - - public async virtual Task ShadowToPlain() - { - return await (dynamic)this.ShadowToPlainAsync(); - } - - public async Task ShadowToPlainAsync() - { - Pocos.AbstractMotor plain = new Pocos.AbstractMotor(); - plain.Run = Run.Shadow; - plain.ReverseDirection = ReverseDirection.Shadow; - return plain; - } - - protected async Task ShadowToPlainAsync(Pocos.AbstractMotor plain) - { - plain.Run = Run.Shadow; - plain.ReverseDirection = ReverseDirection.Shadow; - return plain; - } - - public async virtual Task PlainToShadow(T plain) - { - await this.PlainToShadowAsync((dynamic)plain); - } - - public async Task> PlainToShadowAsync(Pocos.AbstractMotor plain) - { - Run.Shadow = plain.Run; - ReverseDirection.Shadow = plain.ReverseDirection; - return this.RetrievePrimitives(); - } - - /// - public async virtual Task AnyChangeAsync(T plain) - { - return await this.DetectsAnyChangeAsync((dynamic)plain); - } - - /// - ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated. - ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed. - /// - public async Task DetectsAnyChangeAsync(Pocos.AbstractMotor plain, Pocos.AbstractMotor latest = null) - { - if (latest == null) - latest = await this._OnlineToPlainNoacAsync(); - var somethingChanged = false; - return await Task.Run(async () => - { - if (plain.Run != Run.LastValue) - somethingChanged = true; - if (plain.ReverseDirection != ReverseDirection.LastValue) - somethingChanged = true; - plain = latest; - return somethingChanged; - }); - } - - public void Poll() - { - this.RetrievePrimitives().ToList().ForEach(x => x.Poll()); - } - - public Pocos.AbstractMotor CreateEmptyPoco() - { - return new Pocos.AbstractMotor(); - } - - private IList Children { get; } = new List(); - public IEnumerable GetChildren() - { - return Children; - } - - private IList Kids { get; } = new List(); - public IEnumerable GetKids() - { - return Kids; - } - - private IList ValueTags { get; } = new List(); - public IEnumerable GetValueTags() - { - return ValueTags; - } - - public void AddValueTag(AXSharp.Connector.ITwinPrimitive valueTag) - { - ValueTags.Add(valueTag); - } - - public void AddKid(AXSharp.Connector.ITwinElement kid) - { - Kids.Add(kid); - } - - public void AddChild(AXSharp.Connector.ITwinObject twinObject) - { - Children.Add(twinObject); - } - - protected AXSharp.Connector.Connector @Connector { get; } - - public AXSharp.Connector.Connector GetConnector() - { - return this.@Connector; - } - - public string GetSymbolTail() - { - return this.SymbolTail; - } - - public AXSharp.Connector.ITwinObject GetParent() - { - return this.@Parent; - } - - public string Symbol { get; protected set; } - - private string _attributeName; - public System.String AttributeName { get => string.IsNullOrEmpty(_attributeName) ? SymbolTail : _attributeName.Interpolate(this).CleanUpLocalizationTokens(); set => _attributeName = value; } - - public System.String GetAttributeName(System.Globalization.CultureInfo culture) - { - return this.Translate(_attributeName, culture).Interpolate(this); - } - - private string _humanReadable; - public string HumanReadable { get => string.IsNullOrEmpty(_humanReadable) ? SymbolTail : _humanReadable.Interpolate(this).CleanUpLocalizationTokens(); set => _humanReadable = value; } - - public System.String GetHumanReadable(System.Globalization.CultureInfo culture) - { - return this.Translate(_humanReadable, culture); - } - - protected System.String @SymbolTail { get; set; } - - protected AXSharp.Connector.ITwinObject @Parent { get; set; } - - public AXSharp.Connector.Localizations.Translator Interpreter => global::units.PlcTranslator.Instance; -} \ No newline at end of file diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/file_with_usings.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/file_with_usings.g.cs index 1f3ba8e0..277eab90 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/file_with_usings.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/file_with_usings.g.cs @@ -3,790 +3,21 @@ using AXSharp.Connector.ValueTypes; using System.Collections.Generic; using AXSharp.Connector.Localizations; +using FileWithUsingsSimpleFirstLevelNamespace; +using FileWithUsingsSimpleQualifiedNamespace.Qualified; +using FileWithUsingsHelloLevelOne.FileWithUsingsHelloLevelTwo; namespace FileWithUsingsSimpleFirstLevelNamespace { - public partial class Hello : AXSharp.Connector.ITwinObject - { - partial void PreConstruct(AXSharp.Connector.ITwinObject parent, string readableTail, string symbolTail); - partial void PostConstruct(AXSharp.Connector.ITwinObject parent, string readableTail, string symbolTail); - public Hello(AXSharp.Connector.ITwinObject parent, string readableTail, string symbolTail) - { - Symbol = AXSharp.Connector.Connector.CreateSymbol(parent.Symbol, symbolTail); - this.@SymbolTail = symbolTail; - this.@Connector = parent.GetConnector(); - this.@Parent = parent; - HumanReadable = AXSharp.Connector.Connector.CreateHumanReadable(parent.HumanReadable, readableTail); - PreConstruct(parent, readableTail, symbolTail); - parent.AddChild(this); - parent.AddKid(this); - PostConstruct(parent, readableTail, symbolTail); - } - - public async virtual Task OnlineToPlain() - { - return await (dynamic)this.OnlineToPlainAsync(); - } - - public async Task OnlineToPlainAsync() - { - Pocos.FileWithUsingsSimpleFirstLevelNamespace.Hello plain = new Pocos.FileWithUsingsSimpleFirstLevelNamespace.Hello(); - await this.ReadAsync(); - return plain; - } - - [Obsolete("This method should not be used if you indent to access the controllers data. Use `OnlineToPlain` instead.")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public async Task _OnlineToPlainNoacAsync() - { - Pocos.FileWithUsingsSimpleFirstLevelNamespace.Hello plain = new Pocos.FileWithUsingsSimpleFirstLevelNamespace.Hello(); - return plain; - } - - [Obsolete("This method should not be used if you indent to access the controllers data. Use `OnlineToPlain` instead.")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - protected async Task _OnlineToPlainNoacAsync(Pocos.FileWithUsingsSimpleFirstLevelNamespace.Hello plain) - { - return plain; - } - - public async virtual Task PlainToOnline(T plain) - { - await this.PlainToOnlineAsync((dynamic)plain); - } - - public async Task> PlainToOnlineAsync(Pocos.FileWithUsingsSimpleFirstLevelNamespace.Hello plain) - { - return await this.WriteAsync(); - } - - [Obsolete("This method should not be used if you indent to access the controllers data. Use `PlainToOnline` instead.")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public async Task _PlainToOnlineNoacAsync(Pocos.FileWithUsingsSimpleFirstLevelNamespace.Hello plain) - { - } - - public async virtual Task ShadowToPlain() - { - return await (dynamic)this.ShadowToPlainAsync(); - } - - public async Task ShadowToPlainAsync() - { - Pocos.FileWithUsingsSimpleFirstLevelNamespace.Hello plain = new Pocos.FileWithUsingsSimpleFirstLevelNamespace.Hello(); - return plain; - } - - protected async Task ShadowToPlainAsync(Pocos.FileWithUsingsSimpleFirstLevelNamespace.Hello plain) - { - return plain; - } - - public async virtual Task PlainToShadow(T plain) - { - await this.PlainToShadowAsync((dynamic)plain); - } - - public async Task> PlainToShadowAsync(Pocos.FileWithUsingsSimpleFirstLevelNamespace.Hello plain) - { - return this.RetrievePrimitives(); - } - - /// - public async virtual Task AnyChangeAsync(T plain) - { - return await this.DetectsAnyChangeAsync((dynamic)plain); - } - - /// - ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated. - ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed. - /// - public async Task DetectsAnyChangeAsync(Pocos.FileWithUsingsSimpleFirstLevelNamespace.Hello plain, Pocos.FileWithUsingsSimpleFirstLevelNamespace.Hello latest = null) - { - if (latest == null) - latest = await this._OnlineToPlainNoacAsync(); - var somethingChanged = false; - return await Task.Run(async () => - { - plain = latest; - return somethingChanged; - }); - } - - public void Poll() - { - this.RetrievePrimitives().ToList().ForEach(x => x.Poll()); - } - - public Pocos.FileWithUsingsSimpleFirstLevelNamespace.Hello CreateEmptyPoco() - { - return new Pocos.FileWithUsingsSimpleFirstLevelNamespace.Hello(); - } - - private IList Children { get; } = new List(); - public IEnumerable GetChildren() - { - return Children; - } - - private IList Kids { get; } = new List(); - public IEnumerable GetKids() - { - return Kids; - } - - private IList ValueTags { get; } = new List(); - public IEnumerable GetValueTags() - { - return ValueTags; - } - - public void AddValueTag(AXSharp.Connector.ITwinPrimitive valueTag) - { - ValueTags.Add(valueTag); - } - - public void AddKid(AXSharp.Connector.ITwinElement kid) - { - Kids.Add(kid); - } - - public void AddChild(AXSharp.Connector.ITwinObject twinObject) - { - Children.Add(twinObject); - } - - protected AXSharp.Connector.Connector @Connector { get; } - - public AXSharp.Connector.Connector GetConnector() - { - return this.@Connector; - } - - public string GetSymbolTail() - { - return this.SymbolTail; - } - - public AXSharp.Connector.ITwinObject GetParent() - { - return this.@Parent; - } - - public string Symbol { get; protected set; } - - private string _attributeName; - public System.String AttributeName { get => string.IsNullOrEmpty(_attributeName) ? SymbolTail : _attributeName.Interpolate(this).CleanUpLocalizationTokens(); set => _attributeName = value; } - - public System.String GetAttributeName(System.Globalization.CultureInfo culture) - { - return this.Translate(_attributeName, culture).Interpolate(this); - } - - private string _humanReadable; - public string HumanReadable { get => string.IsNullOrEmpty(_humanReadable) ? SymbolTail : _humanReadable.Interpolate(this).CleanUpLocalizationTokens(); set => _humanReadable = value; } - - public System.String GetHumanReadable(System.Globalization.CultureInfo culture) - { - return this.Translate(_humanReadable, culture); - } - - protected System.String @SymbolTail { get; set; } - - protected AXSharp.Connector.ITwinObject @Parent { get; set; } - - public AXSharp.Connector.Localizations.Translator Interpreter => global::units.PlcTranslator.Instance; - } } namespace FileWithUsingsSimpleQualifiedNamespace.Qualified { - public partial class Hello : AXSharp.Connector.ITwinObject - { - partial void PreConstruct(AXSharp.Connector.ITwinObject parent, string readableTail, string symbolTail); - partial void PostConstruct(AXSharp.Connector.ITwinObject parent, string readableTail, string symbolTail); - public Hello(AXSharp.Connector.ITwinObject parent, string readableTail, string symbolTail) - { - Symbol = AXSharp.Connector.Connector.CreateSymbol(parent.Symbol, symbolTail); - this.@SymbolTail = symbolTail; - this.@Connector = parent.GetConnector(); - this.@Parent = parent; - HumanReadable = AXSharp.Connector.Connector.CreateHumanReadable(parent.HumanReadable, readableTail); - PreConstruct(parent, readableTail, symbolTail); - parent.AddChild(this); - parent.AddKid(this); - PostConstruct(parent, readableTail, symbolTail); - } - - public async virtual Task OnlineToPlain() - { - return await (dynamic)this.OnlineToPlainAsync(); - } - - public async Task OnlineToPlainAsync() - { - Pocos.FileWithUsingsSimpleQualifiedNamespace.Qualified.Hello plain = new Pocos.FileWithUsingsSimpleQualifiedNamespace.Qualified.Hello(); - await this.ReadAsync(); - return plain; - } - - [Obsolete("This method should not be used if you indent to access the controllers data. Use `OnlineToPlain` instead.")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public async Task _OnlineToPlainNoacAsync() - { - Pocos.FileWithUsingsSimpleQualifiedNamespace.Qualified.Hello plain = new Pocos.FileWithUsingsSimpleQualifiedNamespace.Qualified.Hello(); - return plain; - } - - [Obsolete("This method should not be used if you indent to access the controllers data. Use `OnlineToPlain` instead.")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - protected async Task _OnlineToPlainNoacAsync(Pocos.FileWithUsingsSimpleQualifiedNamespace.Qualified.Hello plain) - { - return plain; - } - - public async virtual Task PlainToOnline(T plain) - { - await this.PlainToOnlineAsync((dynamic)plain); - } - - public async Task> PlainToOnlineAsync(Pocos.FileWithUsingsSimpleQualifiedNamespace.Qualified.Hello plain) - { - return await this.WriteAsync(); - } - - [Obsolete("This method should not be used if you indent to access the controllers data. Use `PlainToOnline` instead.")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public async Task _PlainToOnlineNoacAsync(Pocos.FileWithUsingsSimpleQualifiedNamespace.Qualified.Hello plain) - { - } - - public async virtual Task ShadowToPlain() - { - return await (dynamic)this.ShadowToPlainAsync(); - } - - public async Task ShadowToPlainAsync() - { - Pocos.FileWithUsingsSimpleQualifiedNamespace.Qualified.Hello plain = new Pocos.FileWithUsingsSimpleQualifiedNamespace.Qualified.Hello(); - return plain; - } - - protected async Task ShadowToPlainAsync(Pocos.FileWithUsingsSimpleQualifiedNamespace.Qualified.Hello plain) - { - return plain; - } - - public async virtual Task PlainToShadow(T plain) - { - await this.PlainToShadowAsync((dynamic)plain); - } - - public async Task> PlainToShadowAsync(Pocos.FileWithUsingsSimpleQualifiedNamespace.Qualified.Hello plain) - { - return this.RetrievePrimitives(); - } - - /// - public async virtual Task AnyChangeAsync(T plain) - { - return await this.DetectsAnyChangeAsync((dynamic)plain); - } - - /// - ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated. - ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed. - /// - public async Task DetectsAnyChangeAsync(Pocos.FileWithUsingsSimpleQualifiedNamespace.Qualified.Hello plain, Pocos.FileWithUsingsSimpleQualifiedNamespace.Qualified.Hello latest = null) - { - if (latest == null) - latest = await this._OnlineToPlainNoacAsync(); - var somethingChanged = false; - return await Task.Run(async () => - { - plain = latest; - return somethingChanged; - }); - } - - public void Poll() - { - this.RetrievePrimitives().ToList().ForEach(x => x.Poll()); - } - - public Pocos.FileWithUsingsSimpleQualifiedNamespace.Qualified.Hello CreateEmptyPoco() - { - return new Pocos.FileWithUsingsSimpleQualifiedNamespace.Qualified.Hello(); - } - - private IList Children { get; } = new List(); - public IEnumerable GetChildren() - { - return Children; - } - - private IList Kids { get; } = new List(); - public IEnumerable GetKids() - { - return Kids; - } - - private IList ValueTags { get; } = new List(); - public IEnumerable GetValueTags() - { - return ValueTags; - } - - public void AddValueTag(AXSharp.Connector.ITwinPrimitive valueTag) - { - ValueTags.Add(valueTag); - } - - public void AddKid(AXSharp.Connector.ITwinElement kid) - { - Kids.Add(kid); - } - - public void AddChild(AXSharp.Connector.ITwinObject twinObject) - { - Children.Add(twinObject); - } - - protected AXSharp.Connector.Connector @Connector { get; } - - public AXSharp.Connector.Connector GetConnector() - { - return this.@Connector; - } - - public string GetSymbolTail() - { - return this.SymbolTail; - } - - public AXSharp.Connector.ITwinObject GetParent() - { - return this.@Parent; - } - - public string Symbol { get; protected set; } - - private string _attributeName; - public System.String AttributeName { get => string.IsNullOrEmpty(_attributeName) ? SymbolTail : _attributeName.Interpolate(this).CleanUpLocalizationTokens(); set => _attributeName = value; } - - public System.String GetAttributeName(System.Globalization.CultureInfo culture) - { - return this.Translate(_attributeName, culture).Interpolate(this); - } - - private string _humanReadable; - public string HumanReadable { get => string.IsNullOrEmpty(_humanReadable) ? SymbolTail : _humanReadable.Interpolate(this).CleanUpLocalizationTokens(); set => _humanReadable = value; } - - public System.String GetHumanReadable(System.Globalization.CultureInfo culture) - { - return this.Translate(_humanReadable, culture); - } - - protected System.String @SymbolTail { get; set; } - - protected AXSharp.Connector.ITwinObject @Parent { get; set; } - - public AXSharp.Connector.Localizations.Translator Interpreter => global::units.PlcTranslator.Instance; - } } namespace FileWithUsingsHelloLevelOne { namespace FileWithUsingsHelloLevelTwo { - public partial class Hello : AXSharp.Connector.ITwinObject - { - partial void PreConstruct(AXSharp.Connector.ITwinObject parent, string readableTail, string symbolTail); - partial void PostConstruct(AXSharp.Connector.ITwinObject parent, string readableTail, string symbolTail); - public Hello(AXSharp.Connector.ITwinObject parent, string readableTail, string symbolTail) - { - Symbol = AXSharp.Connector.Connector.CreateSymbol(parent.Symbol, symbolTail); - this.@SymbolTail = symbolTail; - this.@Connector = parent.GetConnector(); - this.@Parent = parent; - HumanReadable = AXSharp.Connector.Connector.CreateHumanReadable(parent.HumanReadable, readableTail); - PreConstruct(parent, readableTail, symbolTail); - parent.AddChild(this); - parent.AddKid(this); - PostConstruct(parent, readableTail, symbolTail); - } - - public async virtual Task OnlineToPlain() - { - return await (dynamic)this.OnlineToPlainAsync(); - } - - public async Task OnlineToPlainAsync() - { - Pocos.FileWithUsingsHelloLevelOne.FileWithUsingsHelloLevelTwo.Hello plain = new Pocos.FileWithUsingsHelloLevelOne.FileWithUsingsHelloLevelTwo.Hello(); - await this.ReadAsync(); - return plain; - } - - [Obsolete("This method should not be used if you indent to access the controllers data. Use `OnlineToPlain` instead.")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public async Task _OnlineToPlainNoacAsync() - { - Pocos.FileWithUsingsHelloLevelOne.FileWithUsingsHelloLevelTwo.Hello plain = new Pocos.FileWithUsingsHelloLevelOne.FileWithUsingsHelloLevelTwo.Hello(); - return plain; - } - - [Obsolete("This method should not be used if you indent to access the controllers data. Use `OnlineToPlain` instead.")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - protected async Task _OnlineToPlainNoacAsync(Pocos.FileWithUsingsHelloLevelOne.FileWithUsingsHelloLevelTwo.Hello plain) - { - return plain; - } - - public async virtual Task PlainToOnline(T plain) - { - await this.PlainToOnlineAsync((dynamic)plain); - } - - public async Task> PlainToOnlineAsync(Pocos.FileWithUsingsHelloLevelOne.FileWithUsingsHelloLevelTwo.Hello plain) - { - return await this.WriteAsync(); - } - - [Obsolete("This method should not be used if you indent to access the controllers data. Use `PlainToOnline` instead.")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public async Task _PlainToOnlineNoacAsync(Pocos.FileWithUsingsHelloLevelOne.FileWithUsingsHelloLevelTwo.Hello plain) - { - } - - public async virtual Task ShadowToPlain() - { - return await (dynamic)this.ShadowToPlainAsync(); - } - - public async Task ShadowToPlainAsync() - { - Pocos.FileWithUsingsHelloLevelOne.FileWithUsingsHelloLevelTwo.Hello plain = new Pocos.FileWithUsingsHelloLevelOne.FileWithUsingsHelloLevelTwo.Hello(); - return plain; - } - - protected async Task ShadowToPlainAsync(Pocos.FileWithUsingsHelloLevelOne.FileWithUsingsHelloLevelTwo.Hello plain) - { - return plain; - } - - public async virtual Task PlainToShadow(T plain) - { - await this.PlainToShadowAsync((dynamic)plain); - } - - public async Task> PlainToShadowAsync(Pocos.FileWithUsingsHelloLevelOne.FileWithUsingsHelloLevelTwo.Hello plain) - { - return this.RetrievePrimitives(); - } - - /// - public async virtual Task AnyChangeAsync(T plain) - { - return await this.DetectsAnyChangeAsync((dynamic)plain); - } - - /// - ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated. - ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed. - /// - public async Task DetectsAnyChangeAsync(Pocos.FileWithUsingsHelloLevelOne.FileWithUsingsHelloLevelTwo.Hello plain, Pocos.FileWithUsingsHelloLevelOne.FileWithUsingsHelloLevelTwo.Hello latest = null) - { - if (latest == null) - latest = await this._OnlineToPlainNoacAsync(); - var somethingChanged = false; - return await Task.Run(async () => - { - plain = latest; - return somethingChanged; - }); - } - - public void Poll() - { - this.RetrievePrimitives().ToList().ForEach(x => x.Poll()); - } - - public Pocos.FileWithUsingsHelloLevelOne.FileWithUsingsHelloLevelTwo.Hello CreateEmptyPoco() - { - return new Pocos.FileWithUsingsHelloLevelOne.FileWithUsingsHelloLevelTwo.Hello(); - } - - private IList Children { get; } = new List(); - public IEnumerable GetChildren() - { - return Children; - } - - private IList Kids { get; } = new List(); - public IEnumerable GetKids() - { - return Kids; - } - - private IList ValueTags { get; } = new List(); - public IEnumerable GetValueTags() - { - return ValueTags; - } - - public void AddValueTag(AXSharp.Connector.ITwinPrimitive valueTag) - { - ValueTags.Add(valueTag); - } - - public void AddKid(AXSharp.Connector.ITwinElement kid) - { - Kids.Add(kid); - } - - public void AddChild(AXSharp.Connector.ITwinObject twinObject) - { - Children.Add(twinObject); - } - - protected AXSharp.Connector.Connector @Connector { get; } - - public AXSharp.Connector.Connector GetConnector() - { - return this.@Connector; - } - - public string GetSymbolTail() - { - return this.SymbolTail; - } - - public AXSharp.Connector.ITwinObject GetParent() - { - return this.@Parent; - } - - public string Symbol { get; protected set; } - - private string _attributeName; - public System.String AttributeName { get => string.IsNullOrEmpty(_attributeName) ? SymbolTail : _attributeName.Interpolate(this).CleanUpLocalizationTokens(); set => _attributeName = value; } - - public System.String GetAttributeName(System.Globalization.CultureInfo culture) - { - return this.Translate(_attributeName, culture).Interpolate(this); - } - - private string _humanReadable; - public string HumanReadable { get => string.IsNullOrEmpty(_humanReadable) ? SymbolTail : _humanReadable.Interpolate(this).CleanUpLocalizationTokens(); set => _humanReadable = value; } - - public System.String GetHumanReadable(System.Globalization.CultureInfo culture) - { - return this.Translate(_humanReadable, culture); - } - - protected System.String @SymbolTail { get; set; } - - protected AXSharp.Connector.ITwinObject @Parent { get; set; } - - public AXSharp.Connector.Localizations.Translator Interpreter => global::units.PlcTranslator.Instance; - } - } -} - -namespace ExampleNamespace -{ - public partial class Hello : AXSharp.Connector.ITwinObject - { - partial void PreConstruct(AXSharp.Connector.ITwinObject parent, string readableTail, string symbolTail); - partial void PostConstruct(AXSharp.Connector.ITwinObject parent, string readableTail, string symbolTail); - public Hello(AXSharp.Connector.ITwinObject parent, string readableTail, string symbolTail) - { - Symbol = AXSharp.Connector.Connector.CreateSymbol(parent.Symbol, symbolTail); - this.@SymbolTail = symbolTail; - this.@Connector = parent.GetConnector(); - this.@Parent = parent; - HumanReadable = AXSharp.Connector.Connector.CreateHumanReadable(parent.HumanReadable, readableTail); - PreConstruct(parent, readableTail, symbolTail); - parent.AddChild(this); - parent.AddKid(this); - PostConstruct(parent, readableTail, symbolTail); - } - - public async virtual Task OnlineToPlain() - { - return await (dynamic)this.OnlineToPlainAsync(); - } - - public async Task OnlineToPlainAsync() - { - Pocos.ExampleNamespace.Hello plain = new Pocos.ExampleNamespace.Hello(); - await this.ReadAsync(); - return plain; - } - - [Obsolete("This method should not be used if you indent to access the controllers data. Use `OnlineToPlain` instead.")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public async Task _OnlineToPlainNoacAsync() - { - Pocos.ExampleNamespace.Hello plain = new Pocos.ExampleNamespace.Hello(); - return plain; - } - - [Obsolete("This method should not be used if you indent to access the controllers data. Use `OnlineToPlain` instead.")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - protected async Task _OnlineToPlainNoacAsync(Pocos.ExampleNamespace.Hello plain) - { - return plain; - } - - public async virtual Task PlainToOnline(T plain) - { - await this.PlainToOnlineAsync((dynamic)plain); - } - - public async Task> PlainToOnlineAsync(Pocos.ExampleNamespace.Hello plain) - { - return await this.WriteAsync(); - } - - [Obsolete("This method should not be used if you indent to access the controllers data. Use `PlainToOnline` instead.")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public async Task _PlainToOnlineNoacAsync(Pocos.ExampleNamespace.Hello plain) - { - } - - public async virtual Task ShadowToPlain() - { - return await (dynamic)this.ShadowToPlainAsync(); - } - - public async Task ShadowToPlainAsync() - { - Pocos.ExampleNamespace.Hello plain = new Pocos.ExampleNamespace.Hello(); - return plain; - } - - protected async Task ShadowToPlainAsync(Pocos.ExampleNamespace.Hello plain) - { - return plain; - } - - public async virtual Task PlainToShadow(T plain) - { - await this.PlainToShadowAsync((dynamic)plain); - } - - public async Task> PlainToShadowAsync(Pocos.ExampleNamespace.Hello plain) - { - return this.RetrievePrimitives(); - } - - /// - public async virtual Task AnyChangeAsync(T plain) - { - return await this.DetectsAnyChangeAsync((dynamic)plain); - } - - /// - ///Compares if the current plain object has changed from the previous object.This method is used by the framework to determine if the object has changed and needs to be updated. - ///[!NOTE] Any member in the hierarchy that is ignored by the compilers (e.g. when CompilerOmitAttribute is used) will not be compared, and therefore will not be detected as changed. - /// - public async Task DetectsAnyChangeAsync(Pocos.ExampleNamespace.Hello plain, Pocos.ExampleNamespace.Hello latest = null) - { - if (latest == null) - latest = await this._OnlineToPlainNoacAsync(); - var somethingChanged = false; - return await Task.Run(async () => - { - plain = latest; - return somethingChanged; - }); - } - - public void Poll() - { - this.RetrievePrimitives().ToList().ForEach(x => x.Poll()); - } - - public Pocos.ExampleNamespace.Hello CreateEmptyPoco() - { - return new Pocos.ExampleNamespace.Hello(); - } - - private IList Children { get; } = new List(); - public IEnumerable GetChildren() - { - return Children; - } - - private IList Kids { get; } = new List(); - public IEnumerable GetKids() - { - return Kids; - } - - private IList ValueTags { get; } = new List(); - public IEnumerable GetValueTags() - { - return ValueTags; - } - - public void AddValueTag(AXSharp.Connector.ITwinPrimitive valueTag) - { - ValueTags.Add(valueTag); - } - - public void AddKid(AXSharp.Connector.ITwinElement kid) - { - Kids.Add(kid); - } - - public void AddChild(AXSharp.Connector.ITwinObject twinObject) - { - Children.Add(twinObject); - } - - protected AXSharp.Connector.Connector @Connector { get; } - - public AXSharp.Connector.Connector GetConnector() - { - return this.@Connector; - } - - public string GetSymbolTail() - { - return this.SymbolTail; - } - - public AXSharp.Connector.ITwinObject GetParent() - { - return this.@Parent; - } - - public string Symbol { get; protected set; } - - private string _attributeName; - public System.String AttributeName { get => string.IsNullOrEmpty(_attributeName) ? SymbolTail : _attributeName.Interpolate(this).CleanUpLocalizationTokens(); set => _attributeName = value; } - - public System.String GetAttributeName(System.Globalization.CultureInfo culture) - { - return this.Translate(_attributeName, culture).Interpolate(this); - } - - private string _humanReadable; - public string HumanReadable { get => string.IsNullOrEmpty(_humanReadable) ? SymbolTail : _humanReadable.Interpolate(this).CleanUpLocalizationTokens(); set => _humanReadable = value; } - - public System.String GetHumanReadable(System.Globalization.CultureInfo culture) - { - return this.Translate(_humanReadable, culture); - } - - protected System.String @SymbolTail { get; set; } - - protected AXSharp.Connector.ITwinObject @Parent { get; set; } - - public AXSharp.Connector.Localizations.Translator Interpreter => global::units.PlcTranslator.Instance; } } \ No newline at end of file diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/abstract_members.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/abstract_members.g.cs deleted file mode 100644 index d11d4a1f..00000000 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/abstract_members.g.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; - -namespace Pocos -{ - public partial class AbstractMotor : AXSharp.Connector.IPlain - { - public Boolean Run { get; set; } - - public Boolean ReverseDirection { get; set; } - } -} \ No newline at end of file diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/file_with_usings.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/file_with_usings.g.cs index cd26fc5e..e9de1bf9 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/file_with_usings.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/file_with_usings.g.cs @@ -2,33 +2,21 @@ namespace Pocos { + using FileWithUsingsSimpleFirstLevelNamespace; + using FileWithUsingsSimpleQualifiedNamespace.Qualified; + using FileWithUsingsHelloLevelOne.FileWithUsingsHelloLevelTwo; + namespace FileWithUsingsSimpleFirstLevelNamespace { - public partial class Hello : AXSharp.Connector.IPlain - { - } } namespace FileWithUsingsSimpleQualifiedNamespace.Qualified { - public partial class Hello : AXSharp.Connector.IPlain - { - } } namespace FileWithUsingsHelloLevelOne { namespace FileWithUsingsHelloLevelTwo - { - public partial class Hello : AXSharp.Connector.IPlain - { - } - } - } - - namespace ExampleNamespace - { - public partial class Hello : AXSharp.Connector.IPlain { } } diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/abstract_members.st b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/abstract_members.st deleted file mode 100644 index d2a91b2d..00000000 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/abstract_members.st +++ /dev/null @@ -1,8 +0,0 @@ -{S7.extern=ReadWrite} -CLASS ABSTRACT AbstractMotor - VAR PUBLIC - Run : BOOL; - ReverseDirection : BOOL; - END_VAR - ... -END_CLASS \ No newline at end of file diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/file_with_usings.st b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/file_with_usings.st index 1d335b17..84ea3b93 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/file_with_usings.st +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/file_with_usings.st @@ -3,37 +3,14 @@ USING FileWithUsingsSimpleQualifiedNamespace.Qualified; USING FileWithUsingsHelloLevelOne.FileWithUsingsHelloLevelTwo; NAMESPACE FileWithUsingsSimpleFirstLevelNamespace - CLASS Hello - VAR - - END_VAR - END_CLASS + END_NAMESPACE NAMESPACE FileWithUsingsSimpleQualifiedNamespace.Qualified - CLASS Hello - VAR - - END_VAR - END_CLASS + END_NAMESPACE NAMESPACE FileWithUsingsHelloLevelOne NAMESPACE FileWithUsingsHelloLevelTwo - CLASS Hello - VAR - - END_VAR - END_CLASS END_NAMESPACE -END_NAMESPACE - -NAMESPACE ExampleNamespace - CLASS Hello - VAR - a : FileWithUsingsSimpleFirstLevelNamespace.Hello; - b : FileWithUsingsSimpleQualifiedNamespace.Qualified.Hello; - c : FileWithUsingsHelloLevelOne.FileWithUsingsHelloLevelTwo.Hello; - END_VAR - END_CLASS -END_NAMESPACE \ No newline at end of file +END_NAMESPACE \ No newline at end of file diff --git a/src/AXSharp.compiler/tests/AXSharp.CompilerTests/AXSharp.CompilerTests.csproj b/src/AXSharp.compiler/tests/AXSharp.CompilerTests/AXSharp.CompilerTests.csproj index d37b8cb0..3769ac00 100644 --- a/src/AXSharp.compiler/tests/AXSharp.CompilerTests/AXSharp.CompilerTests.csproj +++ b/src/AXSharp.compiler/tests/AXSharp.CompilerTests/AXSharp.CompilerTests.csproj @@ -84,8 +84,5 @@ ..\..\..\apax\stc\bin\AX.Text.dll - - ..\..\..\apax\stc\bin\AX.ST.Compiler.PluginAbstractions.dll - \ No newline at end of file diff --git a/src/AXSharp.compiler/tests/AXSharp.CompilerTests/Core/IxNodeVisitorTests.cs b/src/AXSharp.compiler/tests/AXSharp.CompilerTests/Core/IxNodeVisitorTests.cs index f7504498..3e7fcc44 100644 --- a/src/AXSharp.compiler/tests/AXSharp.CompilerTests/Core/IxNodeVisitorTests.cs +++ b/src/AXSharp.compiler/tests/AXSharp.CompilerTests/Core/IxNodeVisitorTests.cs @@ -685,19 +685,19 @@ public void CanCallVisitForISemanticNodeVisitor_ICombinedThreeVisitor_WithCaseSt - //[Fact] - //public void CanCallVisitForISemanticNodeVisitor_ICombinedThreeVisitor_WithCaseSelectionAndData() - //{ - // // Arrange - // var caseSelection = new Mock().Object; - // var data = new Mock().Object; + [Fact] + public void CanCallVisitForISemanticNodeVisitor_ICombinedThreeVisitor_WithCaseSelectionAndData() + { + // Arrange + var caseSelection = new Mock().Object; + var data = new Mock().Object; - // // Assert - // Assert.Throws(() => ((ISemanticNodeVisitor)_testClass).Visit(caseSelection, data)); + // Assert + Assert.Throws(() => ((ISemanticNodeVisitor)_testClass).Visit(caseSelection, data)); - //} + } diff --git a/src/AXSharp.compiler/tests/AXSharp.CompilerTests/Core/IxNodeVisitorTestsSemantics.cs b/src/AXSharp.compiler/tests/AXSharp.CompilerTests/Core/IxNodeVisitorTestsSemantics.cs index f08c0fc6..c3377cb6 100644 --- a/src/AXSharp.compiler/tests/AXSharp.CompilerTests/Core/IxNodeVisitorTestsSemantics.cs +++ b/src/AXSharp.compiler/tests/AXSharp.CompilerTests/Core/IxNodeVisitorTestsSemantics.cs @@ -6,7 +6,6 @@ // Third party licenses: https://github.com/ix-ax/axsharp/blob/master/notices.md using AX.ST.Semantic; -using AX.ST.Semantic.Analyzer; using AX.Text; using AXSharp.Compiler.Core; @@ -46,12 +45,7 @@ public IxNodeVisitorTestsSemantics() new StringText("TYPE\r\n TestStructureType : STRUCT\r\n isRunning : BOOL;\r\n END_STRUCT; END_TYPE") }; - //_compilation = Compilation.Create(sources.Select(s => STParser.ParseTextAsync(s).Result), Compilation.Settings.Default).Result; - var analizers = new List(); - _compilation = Compilation.Create(sources.Select(s => STParser.ParseTextAsync(s).Result), analizers).Result.Compilation; - - - + _compilation = Compilation.Create(sources.Select(s => STParser.ParseTextAsync(s).Result), Compilation.Settings.Default).Result; _testClass = new IxNodeVisitor(_compilation); } @@ -531,19 +525,19 @@ public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithUserDec - //[Fact] - //public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithPragmaSyntaxAndData() - //{ - // // Arrange - // var pragmaSyntax = new Mock().Object; - // var data = new Mock().Object; + [Fact] + public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithPragmaSyntaxAndData() + { + // Arrange + var pragmaSyntax = new Mock().Object; + var data = new Mock().Object; - // // Act - // Assert.Throws(() => ((ISyntaxNodeVisitor)_testClass).Accept(pragmaSyntax, data)); + // Act + Assert.Throws(() => ((ISyntaxNodeVisitor)_testClass).Accept(pragmaSyntax, data)); - // // Assert + // Assert - //} + } @@ -611,19 +605,19 @@ public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithTaskDec - //[Fact] - //public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithTaskConfigSyntaxAndData() - //{ - // // Arrange - // var taskConfigSyntax = new Mock().Object; - // var data = new Mock().Object; + [Fact] + public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithTaskConfigSyntaxAndData() + { + // Arrange + var taskConfigSyntax = new Mock().Object; + var data = new Mock().Object; - // // Act - // Assert.Throws(() => ((ISyntaxNodeVisitor)_testClass).Accept(taskConfigSyntax, data)); + // Act + Assert.Throws(() => ((ISyntaxNodeVisitor)_testClass).Accept(taskConfigSyntax, data)); - // // Assert + // Assert - //} + } @@ -643,19 +637,19 @@ public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithProgCon - //[Fact] - //public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithAbstractMethodDeclarationSyntaxAndData() - //{ - // // Arrange - // var abstractMethodDeclarationSyntax = new Mock().Object; - // var data = new Mock().Object; + [Fact] + public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithAbstractMethodDeclarationSyntaxAndData() + { + // Arrange + var abstractMethodDeclarationSyntax = new Mock().Object; + var data = new Mock().Object; - // // Act - // Assert.Throws(() => ((ISyntaxNodeVisitor)_testClass).Accept(abstractMethodDeclarationSyntax, data)); + // Act + Assert.Throws(() => ((ISyntaxNodeVisitor)_testClass).Accept(abstractMethodDeclarationSyntax, data)); - // // Assert - // // - //} + // Assert + // + } @@ -754,19 +748,19 @@ public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithAnonymo - //[Fact] - //public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithArgumentExpressionSyntaxAndData() - //{ - // // Arrange - // var argumentExpressionSyntax = new Mock().Object; - // var data = new Mock().Object; + [Fact] + public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithArgumentExpressionSyntaxAndData() + { + // Arrange + var argumentExpressionSyntax = new Mock().Object; + var data = new Mock().Object; - // // Act - // Assert.Throws(() => ((ISyntaxNodeVisitor)_testClass).Accept(argumentExpressionSyntax, data)); + // Act + Assert.Throws(() => ((ISyntaxNodeVisitor)_testClass).Accept(argumentExpressionSyntax, data)); - // // Assert + // Assert - //} + } @@ -1009,67 +1003,67 @@ public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithCallExp - //[Fact] - //public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithCallParamAssignmentLhsSyntaxAndData() - //{ - // // Arrange - // var callParamAssignmentLhsSyntax = new Mock().Object; - // var data = new Mock().Object; + [Fact] + public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithCallParamAssignmentLhsSyntaxAndData() + { + // Arrange + var callParamAssignmentLhsSyntax = new Mock().Object; + var data = new Mock().Object; - // // Act - // Assert.Throws(() => ((ISyntaxNodeVisitor)_testClass).Accept(callParamAssignmentLhsSyntax, data)); + // Act + Assert.Throws(() => ((ISyntaxNodeVisitor)_testClass).Accept(callParamAssignmentLhsSyntax, data)); - // // Assert + // Assert - //} + } - //[Fact] - //public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithCaseListElemSyntaxAndData() - //{ - // // Arrange - // var caseListElemSyntax = new Mock().Object; - // var data = new Mock().Object; + [Fact] + public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithCaseListElemSyntaxAndData() + { + // Arrange + var caseListElemSyntax = new Mock().Object; + var data = new Mock().Object; - // // Act - // Assert.Throws(() => ((ISyntaxNodeVisitor)_testClass).Accept(caseListElemSyntax, data)); + // Act + Assert.Throws(() => ((ISyntaxNodeVisitor)_testClass).Accept(caseListElemSyntax, data)); - // // Assert + // Assert - //} + } - //[Fact] - //public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithCaseListSyntaxAndData() - //{ - // // Arrange - // var caseListSyntax = new Mock().Object; - // var data = new Mock().Object; + [Fact] + public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithCaseListSyntaxAndData() + { + // Arrange + var caseListSyntax = new Mock().Object; + var data = new Mock().Object; - // // Act - // Assert.Throws(() => ((ISyntaxNodeVisitor)_testClass).Accept(caseListSyntax, data)); + // Act + Assert.Throws(() => ((ISyntaxNodeVisitor)_testClass).Accept(caseListSyntax, data)); - // // Assert + // Assert - //} + } - //[Fact] - //public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithCaseSelectionSyntaxAndData() - //{ - // // Arrange - // var caseSelectionSyntax = new Mock().Object; - // var data = new Mock().Object; + [Fact] + public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithCaseSelectionSyntaxAndData() + { + // Arrange + var caseSelectionSyntax = new Mock().Object; + var data = new Mock().Object; - // // Act - // Assert.Throws(() => ((ISyntaxNodeVisitor)_testClass).Accept(caseSelectionSyntax, data)); + // Act + Assert.Throws(() => ((ISyntaxNodeVisitor)_testClass).Accept(caseSelectionSyntax, data)); - // // Assert + // Assert - //} + } @@ -1122,19 +1116,19 @@ public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithCodeBod - //[Fact] - //public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithCommaCaseListElemSyntaxAndData() - //{ - // // Arrange - // var commaCaseListElemSyntax = new Mock().Object; - // var data = new Mock().Object; + [Fact] + public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithCommaCaseListElemSyntaxAndData() + { + // Arrange + var commaCaseListElemSyntax = new Mock().Object; + var data = new Mock().Object; - // // Act - // Assert.Throws(() => ((ISyntaxNodeVisitor)_testClass).Accept(commaCaseListElemSyntax, data)); + // Act + Assert.Throws(() => ((ISyntaxNodeVisitor)_testClass).Accept(commaCaseListElemSyntax, data)); - // // Assert + // Assert - //} + } @@ -1362,19 +1356,19 @@ public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithExpress - //[Fact] - //public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithExternFunctionDeclarationSyntaxAndData() - //{ - // // Arrange - // var externFunctionDeclarationSyntax = new Mock().Object; - // var data = new Mock().Object; + [Fact] + public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithExternFunctionDeclarationSyntaxAndData() + { + // Arrange + var externFunctionDeclarationSyntax = new Mock().Object; + var data = new Mock().Object; - // // Act - // Assert.Throws(() => ((ISyntaxNodeVisitor)_testClass).Accept(externFunctionDeclarationSyntax, data)); + // Act + Assert.Throws(() => ((ISyntaxNodeVisitor)_testClass).Accept(externFunctionDeclarationSyntax, data)); - // // Assert + // Assert - //} + } @@ -1601,19 +1595,19 @@ public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithMultipl - //[Fact] - //public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithNamedParamListSyntaxAndData() - //{ - // // Arrange - // var namedParamListSyntax = new Mock().Object; - // var data = new Mock().Object; + [Fact] + public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithNamedParamListSyntaxAndData() + { + // Arrange + var namedParamListSyntax = new Mock().Object; + var data = new Mock().Object; - // // Act - // Assert.Throws(() => ((ISyntaxNodeVisitor)_testClass).Accept(namedParamListSyntax, data)); + // Act + Assert.Throws(() => ((ISyntaxNodeVisitor)_testClass).Accept(namedParamListSyntax, data)); - // // Assert + // Assert - //} + } @@ -1843,19 +1837,19 @@ public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithProgram - //[Fact] - //public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithQualifiedEnumAccessSyntaxAndData() - //{ - // // Arrange - // var qualifiedEnumAccessSyntax = new Mock().Object; - // var data = new Mock().Object; + [Fact] + public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithQualifiedEnumAccessSyntaxAndData() + { + // Arrange + var qualifiedEnumAccessSyntax = new Mock().Object; + var data = new Mock().Object; - // // Act - // Assert.Throws(() => ((ISyntaxNodeVisitor)_testClass).Accept(qualifiedEnumAccessSyntax, data)); + // Act + Assert.Throws(() => ((ISyntaxNodeVisitor)_testClass).Accept(qualifiedEnumAccessSyntax, data)); - // // Assert + // Assert - //} + } @@ -2035,19 +2029,19 @@ public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithStateme - //[Fact] - //public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithStatementPartSyntaxAndData() - //{ - // // Arrange - // var statementPartSyntax = new Mock().Object; - // var data = new Mock().Object; + [Fact] + public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithStatementPartSyntaxAndData() + { + // Arrange + var statementPartSyntax = new Mock().Object; + var data = new Mock().Object; - // // Act - // Assert.Throws(() => ((ISyntaxNodeVisitor)_testClass).Accept(statementPartSyntax, data)); + // Act + Assert.Throws(() => ((ISyntaxNodeVisitor)_testClass).Accept(statementPartSyntax, data)); - // // Assert + // Assert - //} + } @@ -2211,19 +2205,19 @@ public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithTypeSyn - //[Fact] - //public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithUnnamedParamListSyntaxAndData() - //{ - // // Arrange - // var unnamedParamListSyntax = new Mock().Object; - // var data = new Mock().Object; + [Fact] + public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithUnnamedParamListSyntaxAndData() + { + // Arrange + var unnamedParamListSyntax = new Mock().Object; + var data = new Mock().Object; - // // Act - // Assert.Throws(() => ((ISyntaxNodeVisitor)_testClass).Accept(unnamedParamListSyntax, data)); + // Act + Assert.Throws(() => ((ISyntaxNodeVisitor)_testClass).Accept(unnamedParamListSyntax, data)); - // // Assert + // Assert - //} + } diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 8b5f8fa5..66e95282 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -9,17 +9,15 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + - diff --git a/src/apax/apax-lock.json b/src/apax/apax-lock.json index 2a89dda9..daddd372 100644 --- a/src/apax/apax-lock.json +++ b/src/apax/apax-lock.json @@ -7,25 +7,25 @@ "name": "s", "version": "0.0.0", "devDependencies": { - "@ax/stc": "6.1.59" + "@ax/stc": "5.3.28" } }, "packages": { "@ax/stc": { "name": "@ax/stc", - "version": "6.1.59", - "integrity": "sha512-9fSnPIR1Le1i5vA0g13ONfvwWXY6MOM/5+8cDeFvWRh0iIZwviYjCXJ5XM5kv7/wKdkJHZTelQWF6GMPnvWORw==", - "resolved": "https://registry.simatic-ax.siemens.io/@ax/stc/-/stc-6.1.59.tgz", + "version": "5.3.28", + "integrity": "sha512-1YYnkgUIjlPLVkBntVPeOCd+IQ4rj+TUa6DGjj9mqdKlQDqMsqX2sDvS+IOtu3TGskB38GE40PEsvS1B5lQS5w==", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/stc/-/stc-5.3.28.tgz", "dependencies": { - "@ax/stc-win-x64": "6.1.59", - "@ax/stc-linux-x64": "6.1.59" + "@ax/stc-win-x64": "5.3.28", + "@ax/stc-linux-x64": "5.3.28" } }, "@ax/stc-win-x64": { "name": "@ax/stc-win-x64", - "version": "6.1.59", - "integrity": "sha512-PMI1NqqJlANZyug6ZFsXBP0SFneGKo0nAeUtO7KiKC4LAdmLZ54gOvc6OzxUUhuSrjI1yD1zO9faQP7s/Hu15g==", - "resolved": "https://registry.simatic-ax.siemens.io/@ax/stc-win-x64/-/stc-win-x64-6.1.59.tgz", + "version": "5.3.28", + "integrity": "sha512-WzeBs2ELhfwo6E0S+tjL+wljfd5ndqAAeSf8xUQIscCLZyZV4aqFyBAHg34qlqiqu6+go3fFG2UGGKiMQQ8hqQ==", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/stc-win-x64/-/stc-win-x64-5.3.28.tgz", "os": [ "win32" ], @@ -33,14 +33,14 @@ "x64" ], "dependencies": { - "@ax/st-docs": "6.1.59" + "@ax/st-docs": "5.3.28" } }, "@ax/stc-linux-x64": { "name": "@ax/stc-linux-x64", - "version": "6.1.59", - "integrity": "sha512-cggJ3PcIu683s6kTLy0U2bFVOGPvVLjGmWQVp2XB1yC33bZY/HJK28pjJaNUvSOk9AVwgEpDWT15nF99kjN05g==", - "resolved": "https://registry.simatic-ax.siemens.io/@ax/stc-linux-x64/-/stc-linux-x64-6.1.59.tgz", + "version": "5.3.28", + "integrity": "sha512-IQncNWsUogtm7uIS+j5HGZNZAWZ9iChSvoHB/irOmbBDVW7ZWYmIn8gpAAWXQiaDQLB5EzXuGxnASkdQFGDg3g==", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/stc-linux-x64/-/stc-linux-x64-5.3.28.tgz", "os": [ "linux" ], @@ -48,14 +48,14 @@ "x64" ], "dependencies": { - "@ax/st-docs": "6.1.59" + "@ax/st-docs": "5.3.28" } }, "@ax/st-docs": { "name": "@ax/st-docs", - "version": "6.1.59", - "integrity": "sha512-yKvjrpe7o6MQYeAHNxkSGtHXWn7sMDSLt0HzqxFSNGiw3OFQwYADSRTEpgi7TETA1u4pBbNTOCie4TDtYyYhiw==", - "resolved": "https://registry.simatic-ax.siemens.io/@ax/st-docs/-/st-docs-6.1.59.tgz", + "version": "5.3.28", + "integrity": "sha512-HPaafcaiujBjUWDzWKVKAB/k0f2QOr2O38pCBdnFdTEzjUS/A6wfeji4Zb+LEaXfbxmYpB2G1+9eau9bFcCBlA==", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/st-docs/-/st-docs-5.3.28.tgz", "dependencies": {} } }, diff --git a/src/apax/apax.yml b/src/apax/apax.yml index c66baaa1..fa5557ce 100644 --- a/src/apax/apax.yml +++ b/src/apax/apax.yml @@ -5,6 +5,6 @@ targets: - "1500" - axunit-llvm devDependencies: - "@ax/stc": 6.1.59 + "@ax/stc": 5.3.28 installStrategy: strict -apaxVersion: 3.1.1 +apaxVersion: 3.1.0 diff --git a/src/sanbox/integration/ix-integration-plc/ix/.g/Onliners/configuration.g.cs b/src/sanbox/integration/ix-integration-plc/ix/.g/Onliners/configuration.g.cs index 2ff7d06d..afe0ad8f 100644 --- a/src/sanbox/integration/ix-integration-plc/ix/.g/Onliners/configuration.g.cs +++ b/src/sanbox/integration/ix-integration-plc/ix/.g/Onliners/configuration.g.cs @@ -3,6 +3,7 @@ using AXSharp.Connector.ValueTypes; using System.Collections.Generic; using AXSharp.Connector.Localizations; +using MonsterData; public partial class ix_integration_plcTwinController : ITwinController { diff --git a/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/configuration.g.cs b/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/configuration.g.cs index 200a8736..6065134e 100644 --- a/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/configuration.g.cs +++ b/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/configuration.g.cs @@ -2,6 +2,8 @@ namespace Pocos { + using MonsterData; + public partial class ix_integration_plcTwinController { public all_primitives all_primitives { get; set; } = new all_primitives(); diff --git a/src/tests.integrations/integrated/src/integrated.twin/.g/Onliners/configuration.g.cs b/src/tests.integrations/integrated/src/integrated.twin/.g/Onliners/configuration.g.cs index b261e984..08151d29 100644 --- a/src/tests.integrations/integrated/src/integrated.twin/.g/Onliners/configuration.g.cs +++ b/src/tests.integrations/integrated/src/integrated.twin/.g/Onliners/configuration.g.cs @@ -3,6 +3,7 @@ using AXSharp.Connector.ValueTypes; using System.Collections.Generic; using AXSharp.Connector.Localizations; +using RealMonsterData; public partial class integratedTwinController : ITwinController { diff --git a/src/tests.integrations/integrated/src/integrated.twin/.g/POCO/configuration.g.cs b/src/tests.integrations/integrated/src/integrated.twin/.g/POCO/configuration.g.cs index 423b45b7..3b41e0e6 100644 --- a/src/tests.integrations/integrated/src/integrated.twin/.g/POCO/configuration.g.cs +++ b/src/tests.integrations/integrated/src/integrated.twin/.g/POCO/configuration.g.cs @@ -2,6 +2,8 @@ namespace Pocos { + using RealMonsterData; + public partial class integratedTwinController { public MonsterData.Monster Monster { get; set; } = new MonsterData.Monster();