From 307e5cf70eccf22852878a75fbc70888f2162794 Mon Sep 17 00:00:00 2001 From: Edward Sabinus <edward.sabinus@informatik.uni-halle.de> Date: Fri, 17 Nov 2023 11:05:52 +0100 Subject: [PATCH] adopted readme to .NET 6.0; minor fixes in I/O --- .../Eingabeverwaltung/Eingabeverwalter.cs | 34 +++++++++++++++---- .../Metamodell/Beweis/Transformation.cs | 2 +- README.md | 4 +-- 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/BewerterStrukturellerInduktion/Eingabeverwaltung/Eingabeverwalter.cs b/BewerterStrukturellerInduktion/Eingabeverwaltung/Eingabeverwalter.cs index d0da5be..8e9fdc0 100644 --- a/BewerterStrukturellerInduktion/Eingabeverwaltung/Eingabeverwalter.cs +++ b/BewerterStrukturellerInduktion/Eingabeverwaltung/Eingabeverwalter.cs @@ -58,8 +58,8 @@ namespace Eingabeverwaltung { ImmutableDictionary<string, Action> eingabe = new Dictionary<string, Action> { - ["ADT"] = ADT_Eingabe, - ["Task"] = Task_Eingabe, + ["ADT"] = New_ADT_Eingabe, + ["Task"] = New_Task_Eingabe, ["Proof"] = Proof_Eingabe, ["exit"] = Exit_Eingabe, ["printContainer"] = printContainer, @@ -85,18 +85,40 @@ namespace Eingabeverwaltung Console.WriteLine(e.Message); verwalteEingabe(); } + void New_ADT_Eingabe() => renewEingabe(""); + void New_Task_Eingabe() => renewEingabe("Task"); } + /// <summary> /// This Method manages the initial-input. /// </summary> - private void initialEingabe() + /// + private void initialEingabe() => renewEingabe(""); + + /// <summary> + /// This Method renews the input. startAt can be "" to renew all input, "Task" to renew Task and Proof or "Proof" to renew only Proof. + /// </summary> + /// <param name="startAt"></param> + private void renewEingabe(string startAt) { try { - ADT_Eingabe(); - Task_Eingabe(); - Proof_Eingabe(); + switch (startAt) + { + case "Task": + Task_Eingabe(); + Proof_Eingabe(); + break; + case "Proof": + Proof_Eingabe(); + break; + default: + ADT_Eingabe(); + Task_Eingabe(); + Proof_Eingabe(); + break; + } } catch (FileNotFoundException f) { diff --git a/BewerterStrukturellerInduktion/Eingabeverwaltung/Metamodell/Beweis/Transformation.cs b/BewerterStrukturellerInduktion/Eingabeverwaltung/Metamodell/Beweis/Transformation.cs index 5fe663f..0a00368 100644 --- a/BewerterStrukturellerInduktion/Eingabeverwaltung/Metamodell/Beweis/Transformation.cs +++ b/BewerterStrukturellerInduktion/Eingabeverwaltung/Metamodell/Beweis/Transformation.cs @@ -20,7 +20,7 @@ namespace Eingabeverwaltung.Metamodell public override string ToString() { string res = "Transformation:\r\n"; - res += "proof " + startTree.ToString() + "\n"; + res += "proof\r\n" + startTree.ToString() + "\r\n"; foreach (TransformationStep ts in transformationSteps) res += ts.ToString(); return res; } diff --git a/README.md b/README.md index 894acb7..6360e88 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Automatische Bewertung von struktureller Induktion auf abstrakten Datentypen Das Programm kann mit .NET oder mit Mono kompiliert werden. ### Komplilieren mit .NET .NET kann auf jedem Betriebssystem installiert werden. Die kompilierte ausführbare Datei funktioniert Plattformunabhängig, solange die entsprechende .NET-Version installiert ist. -1. Installieren Sie [.NET](https://dotnet.microsoft.com/en-us/download/dotnet) Version 3.1 oder höher. +1. Installieren Sie [.NET](https://dotnet.microsoft.com/en-us/download/dotnet) Version 6.0 oder höher. 2. Navigieren Sie mit der Konsole in den Ordner der [.csproj](BaumtransformationBewerter/BaumtransformationBewerter.csproj)-Datei 3. Rufen Sie `dotnet build` auf. Der Kompiler findet automatisch die .csproj-Datei und kompiliert das Projekt entsprechend dieser Konfiguration. ### Kompilieren mit Mono @@ -53,4 +53,4 @@ Automatische_Bewertung.txt, die in den selben Ordner generiert wird. ## Beispiele - Die Beispiele in [ANTRL-Grammatiken](ANTRL-Grammatiken) sind teilweise für ältere Versionen der Grammatik konzepiert und können inkompatibel zur aktuellen Version der Grammatik sein. -- Alle Beispiele in den [Tests](BaumtransformationBewerter/bin/Debug/netcoreapp3.1/Tests) funktionieren immer mit dem neuesten Stand der Grammatik und funktionieren auch mit der Yapex-Version. \ No newline at end of file +- Alle Beispiele in den [Tests](BaumtransformationBewerter/bin/Debug/netcoreapp6.0/Tests) funktionieren immer mit dem neuesten Stand der Grammatik und funktionieren auch mit der Yapex-Version. \ No newline at end of file -- GitLab