From 4cf19d6767dc91b7b6ef008ed1416050933e3981 Mon Sep 17 00:00:00 2001
From: Edward Sabinus <edward.sabinus@informatik.uni-halle.de>
Date: Sun, 31 Mar 2024 14:05:37 +0200
Subject: [PATCH] make same Listener helper for both proof listener.

---
 .../Eingabeverwaltung/Parser/Proof_Antlr.cs               | 8 +++++---
 .../Eingabeverwaltung/Parser/Proof_Listener.cs            | 4 ++--
 .../Parser/TransformationStep_Listener.cs                 | 4 ++--
 3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/BewerterStrukturellerInduktion/Eingabeverwaltung/Parser/Proof_Antlr.cs b/BewerterStrukturellerInduktion/Eingabeverwaltung/Parser/Proof_Antlr.cs
index fdb2e6a..663393f 100644
--- a/BewerterStrukturellerInduktion/Eingabeverwaltung/Parser/Proof_Antlr.cs
+++ b/BewerterStrukturellerInduktion/Eingabeverwaltung/Parser/Proof_Antlr.cs
@@ -24,12 +24,14 @@ namespace Eingabeverwaltung.Parser
 
 			ProofParser.ProofContext tree = parser.proof();
 
-			// create Proof without TransformationSteps
-			IProofListener PL = new Proof_Listener(container);
+            Listener_Helper LH = new Listener_Helper(container.ADT.sorts, container.ADT.operations, container.ADT.axioms);
+            // create Proof without TransformationSteps
+            IProofListener PL = new Proof_Listener(container,LH);
 			ParseTreeWalker.Default.Walk(PL, tree);
 			// walk again and create all TransformationSteps: Now cycles are no Problem anymore.
-			IProofListener TL = new TransformationStep_Listener(container);
+			IProofListener TL = new TransformationStep_Listener(container,LH);
 			ParseTreeWalker.Default.Walk(TL, tree);
+			LH.close();
 		}
 	}
 }
diff --git a/BewerterStrukturellerInduktion/Eingabeverwaltung/Parser/Proof_Listener.cs b/BewerterStrukturellerInduktion/Eingabeverwaltung/Parser/Proof_Listener.cs
index 11ec7bb..3108f13 100644
--- a/BewerterStrukturellerInduktion/Eingabeverwaltung/Parser/Proof_Listener.cs
+++ b/BewerterStrukturellerInduktion/Eingabeverwaltung/Parser/Proof_Listener.cs
@@ -34,10 +34,10 @@ namespace Eingabeverwaltung.Parser
         // Transformation parts
         private Tree startTree;
 
-        public Proof_Listener(Container container)
+        public Proof_Listener(Container container, Listener_Helper LH)
         {
             this.container = container;
-            LH = new Listener_Helper(container.ADT.sorts, container.ADT.operations, null, container.ADT.axioms, null, null);
+            this.LH = LH;
 
             mainProof = null;
             lemmata = null;
diff --git a/BewerterStrukturellerInduktion/Eingabeverwaltung/Parser/TransformationStep_Listener.cs b/BewerterStrukturellerInduktion/Eingabeverwaltung/Parser/TransformationStep_Listener.cs
index ebaeac9..d33b3af 100644
--- a/BewerterStrukturellerInduktion/Eingabeverwaltung/Parser/TransformationStep_Listener.cs
+++ b/BewerterStrukturellerInduktion/Eingabeverwaltung/Parser/TransformationStep_Listener.cs
@@ -38,7 +38,7 @@ namespace Eingabeverwaltung.Parser
         private Transformation_Step TS;
         private List<Transformation_Step> TSs;
 
-        public TransformationStep_Listener(Container container)
+        public TransformationStep_Listener(Container container, Listener_Helper LH)
         {
             this.container = container;
             currentTR = null;
@@ -46,7 +46,7 @@ namespace Eingabeverwaltung.Parser
             currentIndCase = null;
             currentIndCaseIndex = -1;
             currentLemma = null;
-            LH = new Listener_Helper(container.ADT.sorts, container.ADT.operations, container.ADT.axioms);
+            this.LH = LH;
 
             TS = null;
             TSs = null;
-- 
GitLab