From 5d4ea4bd69c3e6642a7e28dac197e95e5097d284 Mon Sep 17 00:00:00 2001 From: sebastian Date: Sat, 18 Mar 2017 11:07:34 +0100 Subject: [PATCH] Ausgangsbasis erstellt --- .../dhbwstuttgart/strucTypes/Algo_Type.java | 4 +-- .../dhbwstuttgart/strucTypes/TV_Method.java | 4 +-- test/strucTypes/GeneralParserTest.java | 4 +-- test/strucTypes/StructuralTypesSimple2.jav | 28 ++----------------- 4 files changed, 9 insertions(+), 31 deletions(-) diff --git a/src/de/dhbwstuttgart/strucTypes/Algo_Type.java b/src/de/dhbwstuttgart/strucTypes/Algo_Type.java index eb345999..75ac00f0 100644 --- a/src/de/dhbwstuttgart/strucTypes/Algo_Type.java +++ b/src/de/dhbwstuttgart/strucTypes/Algo_Type.java @@ -40,8 +40,8 @@ public class Algo_Type { // für alle Methoden der Klasse List ass_arguments = new ArrayList(); for (Method m : cl.getMethods()) { - for (int i = 0; i < m.parameterlist.formalparameter.size() ; i++ ) { - AS_Argument as_argument = new AS_Argument(m.parameterlist.formalparameter.get(i), i , m , cl ); + for (int i = 0; i < m.getParameterList().getFormalparalist().size() ; i++ ) { + AS_Argument as_argument = new AS_Argument(m.getParameterList().getFormalparalist().get(i), i , m , cl ); ass_arguments.add(as_argument); } } diff --git a/src/de/dhbwstuttgart/strucTypes/TV_Method.java b/src/de/dhbwstuttgart/strucTypes/TV_Method.java index d7a9a792..3b725798 100644 --- a/src/de/dhbwstuttgart/strucTypes/TV_Method.java +++ b/src/de/dhbwstuttgart/strucTypes/TV_Method.java @@ -24,8 +24,8 @@ public class TV_Method extends TV_Abstract { this.alpha_strich = new ArrayList(); - for (int i = 0; i < method.parameterlist.formalparameter.size(); i++ ) { - FormalParameter fp = method.parameterlist.formalparameter.get(i); + for (int i = 0; i < method.getParameterList().getFormalparalist().size(); i++ ) { + FormalParameter fp = method.getParameterList().getFormalparalist().get(i); TV_Alpha tv_alpha = new TV_Alpha(method, i , cl, fp); this.alpha_strich.add(tv_alpha); } diff --git a/test/strucTypes/GeneralParserTest.java b/test/strucTypes/GeneralParserTest.java index 2af0fdab..1a2e6fc1 100644 --- a/test/strucTypes/GeneralParserTest.java +++ b/test/strucTypes/GeneralParserTest.java @@ -41,7 +41,7 @@ public class GeneralParserTest{ //filenames.add("FieldVarTest.jav"); //filenames.add("StructuralTypesField.jav"); - filenames.add("StructuralTypesSimple2.jav"); + filenames.add("StructuralTypesSimple.jav"); JavaTXParser parser = new JavaTXParser(); try{ @@ -54,7 +54,7 @@ public class GeneralParserTest{ SourceFile sfdebug = sf; List ass = new ArrayList(); - Algo_Type type = new Algo_Type( ass , sf.KlassenVektor.get(0)); + Algo_Type type = new Algo_Type( ass , sf.getClasses().get(0)); // Erstellen der TypeExpression diff --git a/test/strucTypes/StructuralTypesSimple2.jav b/test/strucTypes/StructuralTypesSimple2.jav index 8a774667..6d641fd1 100644 --- a/test/strucTypes/StructuralTypesSimple2.jav +++ b/test/strucTypes/StructuralTypesSimple2.jav @@ -5,35 +5,13 @@ class A { A f2; - - - mt6(haus2) { - nummer = haus.hausnummer; - val = nummer.value; - return val; - } - - - mt1(x) { return x; } + mt1(x) { return x; } - mt2(x) { return x.field ; } + mt2(x) { return x.feld ; } mt3(a,b,c) { return a.add(b).sub(c); } - mt4(a,b,c) { - r1 = a.add(b); - r2 = r1.sub(c); - return r2; - } - - - mt5(haus) { return haus.hausnummer.value; } - - - - - - + }