diff --git a/dotnet/DTDLParser.sln b/dotnet/DTDLParser.sln index 4ec22405..cadf37ba 100644 --- a/dotnet/DTDLParser.sln +++ b/dotnet/DTDLParser.sln @@ -29,8 +29,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{972CD45A-805 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DTDLParser", "src\DTDLParser\DTDLParser.csproj", "{DADA917F-E174-4FC9-BD69-F54A587E4FAA}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyParser", "src\MyParser\MyParser.csproj", "{EEB3CE38-6739-4902-BFB7-337708F1EDA9}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -77,10 +75,6 @@ Global {DADA917F-E174-4FC9-BD69-F54A587E4FAA}.Debug|Any CPU.Build.0 = Debug|Any CPU {DADA917F-E174-4FC9-BD69-F54A587E4FAA}.Release|Any CPU.ActiveCfg = Release|Any CPU {DADA917F-E174-4FC9-BD69-F54A587E4FAA}.Release|Any CPU.Build.0 = Release|Any CPU - {EEB3CE38-6739-4902-BFB7-337708F1EDA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EEB3CE38-6739-4902-BFB7-337708F1EDA9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EEB3CE38-6739-4902-BFB7-337708F1EDA9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EEB3CE38-6739-4902-BFB7-337708F1EDA9}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -96,7 +90,6 @@ Global {F7D316F3-BB4E-427D-91E2-697BE3190D88} = {972CD45A-805C-49F4-98F3-ED70C349D0F0} {6016372B-B354-4FD1-8CEC-EE1A30CE8FE5} = {E754E297-B718-4501-BA69-A58863D29DB6} {DADA917F-E174-4FC9-BD69-F54A587E4FAA} = {972CD45A-805C-49F4-98F3-ED70C349D0F0} - {EEB3CE38-6739-4902-BFB7-337708F1EDA9} = {972CD45A-805C-49F4-98F3-ED70C349D0F0} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {05FAFB89-338A-4C3E-8E2E-56C72915268C} diff --git a/dotnet/src/MyParser/MyParser.csproj b/dotnet/src/MyParser/MyParser.csproj deleted file mode 100644 index fff5e77c..00000000 --- a/dotnet/src/MyParser/MyParser.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - Exe - net8.0 - enable - enable - - - - - - - diff --git a/dotnet/src/MyParser/Program.cs b/dotnet/src/MyParser/Program.cs deleted file mode 100644 index 600b218d..00000000 --- a/dotnet/src/MyParser/Program.cs +++ /dev/null @@ -1,65 +0,0 @@ -namespace MyParser -{ - using System; - using System.Collections.Generic; - using System.IO; - using System.Xml; - using DTDLParser; - using DTDLParser.Models; - - internal class Program - { - static void Main(string[] args) - { - if (args.Length == 0) - { - Console.WriteLine("TestParse modelFile"); - return; - } - - string modelFile = args[0]; - - ParsingOptions options = new ParsingOptions(); - options.ExtensionLimitContexts.Add(new Dtmi("dtmi:dtdl:limits:onvif")); - - var modelParser = new ModelParser(options); - string modelText = File.OpenText(modelFile).ReadToEnd(); - - DtdlParseLocator parseLocator = (int parseIndex, int parseLine, out string sourceName, out int sourceLine) => - { - sourceName = modelFile; - sourceLine = parseLine; - return true; - }; - - IReadOnlyDictionary modelDict; - try - { - modelDict = modelParser.Parse(modelText, parseLocator); - } - catch (ParsingException pex) - { - foreach (ParsingError perr in pex.Errors) - { - Console.WriteLine($"{perr.ValidationID} -- {perr.Message}"); - } - - return; - } - - Console.WriteLine($"Model parsed successfully, {modelDict.Count} elements"); - - foreach (KeyValuePair kvp in modelDict) - { - if (kvp.Value is IRootable rootableElement) - { - string jsonText = rootableElement.GetJsonLdText(); - if (jsonText != string.Empty) - { - Console.WriteLine($"{kvp.Key}:\n{jsonText}\n"); - } - } - } - } - } -} diff --git a/dotnet/src/MyParser/TestModel.json b/dotnet/src/MyParser/TestModel.json deleted file mode 100644 index a71530a0..00000000 --- a/dotnet/src/MyParser/TestModel.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "@context": "dtmi:dtdl:context;4", - "@id": "dtmi:test:anInterface;1", - "@type": "Interface", - "schemas": [ - { - "@id": "dtmi:test:deepObject1;1", - "@type": "Object", - "fields": { - "name": "Field1", - "schema": { - "@id": "dtmi:test:deepObject2;1", - "@type": "Object", - "fields": { - "name": "Field2", - "schema": { - "@id": "dtmi:test:deepObject3;1", - "@type": "Object", - "fields": { - "name": "Field3", - "schema": { - "@id": "dtmi:test:deepObject4;1", - "@type": "Object", - "fields": { - "name": "Field4", - "schema": "dtmi:test:deepObject2;1" - } - } - } - } - } - } - } - } - ] -} diff --git a/dotnet/src/MyParser/TestModel2.json b/dotnet/src/MyParser/TestModel2.json deleted file mode 100644 index 82ce5ee9..00000000 --- a/dotnet/src/MyParser/TestModel2.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "@context": [ - "dtmi:dtdl:context;4", - "dtmi:dtdl:extension:mqtt;2" - ], - "@id": "dtmi:jsonTest:TelemetryAndCommand;1", - "@type": [ "Interface", "Mqtt" ], - "payloadFormat": "Json/ecma/404", - "telemetryTopic": "sample/{modelId}/{senderId}/telemetry", - "commandTopic": "sample/{modelId}/command/{commandName}", - "contents": [ - { - "@type": "Telemetry", - "name": "distance", - "schema": "double" - }, - { - "@type": "Telemetry", - "name": "color", - "schema": "string" - }, - { - "@type": "Command", - "name": "doit", - "request": { - "@type": [ "CommandRequest", "Transparent" ], - "name": "poke", - "schema": "string" - }, - "response": { - "name": "peek", - "schema": "integer" - } - } - ] -}