Class ändern zu ClassOrInterface

This commit is contained in:
JanUlrich 2016-12-21 15:46:28 +01:00
parent aed261c807
commit 5f61d478fa
17 changed files with 41 additions and 134 deletions

View File

@ -69,9 +69,9 @@
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#fields.inherited.from.class.de.dhbwstuttgart.syntaxtree.Class">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#fields.inherited.from.class.de.dhbwstuttgart.syntaxtree.ClassOrInterface">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.Class">Method</a></li>
<li><a href="#methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.ClassOrInterface">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
@ -100,7 +100,7 @@
<li><a href="../../../de/dhbwstuttgart/syntaxtree/GTVDeclarationContext.html" title="class in de.dhbwstuttgart.syntaxtree">de.dhbwstuttgart.syntaxtree.GTVDeclarationContext</a></li>
<li>
<ul class="inheritance">
<li><a href="../../../de/dhbwstuttgart/syntaxtree/Class.html" title="class in de.dhbwstuttgart.syntaxtree">de.dhbwstuttgart.syntaxtree.Class</a></li>
<li><a href="../../../de/dhbwstuttgart/syntaxtree/Class.html" title="class in de.dhbwstuttgart.syntaxtree">de.dhbwstuttgart.syntaxtree.ClassOrInterface</a></li>
<li>
<ul class="inheritance">
<li>de.dhbwstuttgart.syntaxtree.BasicAssumptionClass</li>
@ -137,7 +137,7 @@ extends <a href="../../../de/dhbwstuttgart/syntaxtree/Class.html" title="class i
</a>
<h3>Field Summary</h3>
<ul class="blockList">
<li class="blockList"><a name="fields.inherited.from.class.de.dhbwstuttgart.syntaxtree.Class">
<li class="blockList"><a name="fields.inherited.from.class.de.dhbwstuttgart.syntaxtree.ClassOrInterface">
<!-- -->
</a>
<h3>Fields inherited from class&nbsp;de.dhbwstuttgart.syntaxtree.<a href="../../../de/dhbwstuttgart/syntaxtree/Class.html" title="class in de.dhbwstuttgart.syntaxtree">Class</a></h3>
@ -173,7 +173,7 @@ extends <a href="../../../de/dhbwstuttgart/syntaxtree/Class.html" title="class i
</a>
<h3>Method Summary</h3>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.Class">
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.ClassOrInterface">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;de.dhbwstuttgart.syntaxtree.<a href="../../../de/dhbwstuttgart/syntaxtree/Class.html" title="class in de.dhbwstuttgart.syntaxtree">Class</a></h3>
@ -287,9 +287,9 @@ extends <a href="../../../de/dhbwstuttgart/syntaxtree/Class.html" title="class i
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#fields.inherited.from.class.de.dhbwstuttgart.syntaxtree.Class">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#fields.inherited.from.class.de.dhbwstuttgart.syntaxtree.ClassOrInterface">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.Class">Method</a></li>
<li><a href="#methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.ClassOrInterface">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>

View File

@ -106,7 +106,7 @@ var activeTableTab = "activeTableTab";
<li><a href="../../../de/dhbwstuttgart/syntaxtree/GTVDeclarationContext.html" title="class in de.dhbwstuttgart.syntaxtree">de.dhbwstuttgart.syntaxtree.GTVDeclarationContext</a></li>
<li>
<ul class="inheritance">
<li>de.dhbwstuttgart.syntaxtree.Class</li>
<li>de.dhbwstuttgart.syntaxtree.ClassOrInterface</li>
</ul>
</li>
</ul>

View File

@ -75,7 +75,7 @@ var activeTableTab = "activeTableTab";
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#fields.inherited.from.class.de.dhbwstuttgart.syntaxtree.Class">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#fields.inherited.from.class.de.dhbwstuttgart.syntaxtree.ClassOrInterface">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
@ -106,7 +106,7 @@ var activeTableTab = "activeTableTab";
<li><a href="../../../de/dhbwstuttgart/syntaxtree/GTVDeclarationContext.html" title="class in de.dhbwstuttgart.syntaxtree">de.dhbwstuttgart.syntaxtree.GTVDeclarationContext</a></li>
<li>
<ul class="inheritance">
<li><a href="../../../de/dhbwstuttgart/syntaxtree/Class.html" title="class in de.dhbwstuttgart.syntaxtree">de.dhbwstuttgart.syntaxtree.Class</a></li>
<li><a href="../../../de/dhbwstuttgart/syntaxtree/Class.html" title="class in de.dhbwstuttgart.syntaxtree">de.dhbwstuttgart.syntaxtree.ClassOrInterface</a></li>
<li>
<ul class="inheritance">
<li>de.dhbwstuttgart.syntaxtree.Interface</li>
@ -148,7 +148,7 @@ extends <a href="../../../de/dhbwstuttgart/syntaxtree/Class.html" title="class i
</a>
<h3>Field Summary</h3>
<ul class="blockList">
<li class="blockList"><a name="fields.inherited.from.class.de.dhbwstuttgart.syntaxtree.Class">
<li class="blockList"><a name="fields.inherited.from.class.de.dhbwstuttgart.syntaxtree.ClassOrInterface">
<!-- -->
</a>
<h3>Fields inherited from class&nbsp;de.dhbwstuttgart.syntaxtree.<a href="../../../de/dhbwstuttgart/syntaxtree/Class.html" title="class in de.dhbwstuttgart.syntaxtree">Class</a></h3>
@ -205,7 +205,7 @@ extends <a href="../../../de/dhbwstuttgart/syntaxtree/Class.html" title="class i
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.Class">
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.ClassOrInterface">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;de.dhbwstuttgart.syntaxtree.<a href="../../../de/dhbwstuttgart/syntaxtree/Class.html" title="class in de.dhbwstuttgart.syntaxtree">Class</a></h3>
@ -356,7 +356,7 @@ extends <a href="../../../de/dhbwstuttgart/syntaxtree/Class.html" title="class i
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#fields.inherited.from.class.de.dhbwstuttgart.syntaxtree.Class">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#fields.inherited.from.class.de.dhbwstuttgart.syntaxtree.ClassOrInterface">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>

View File

@ -3,7 +3,7 @@
<html lang="de">
<head>
<!-- Generated by javadoc (1.8.0_05) on Tue May 12 19:56:24 CEST 2015 -->
<title>Uses of Class de.dhbwstuttgart.syntaxtree.Class</title>
<title>Uses of Class de.dhbwstuttgart.syntaxtree.ClassOrInterface</title>
<meta name="date" content="2015-05-12">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
@ -70,7 +70,7 @@
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class de.dhbwstuttgart.syntaxtree.Class" class="title">Uses of Class<br>de.dhbwstuttgart.syntaxtree.Class</h2>
<h2 title="Uses of Class de.dhbwstuttgart.syntaxtree.ClassOrInterface" class="title">Uses of Class<br>de.dhbwstuttgart.syntaxtree.Class</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">

View File

@ -75,7 +75,7 @@ var activeTableTab = "activeTableTab";
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#fields.inherited.from.class.de.dhbwstuttgart.syntaxtree.Class">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#fields.inherited.from.class.de.dhbwstuttgart.syntaxtree.ClassOrInterface">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
@ -106,7 +106,7 @@ var activeTableTab = "activeTableTab";
<li><a href="../../../de/dhbwstuttgart/syntaxtree/GTVDeclarationContext.html" title="class in de.dhbwstuttgart.syntaxtree">de.dhbwstuttgart.syntaxtree.GTVDeclarationContext</a></li>
<li>
<ul class="inheritance">
<li><a href="../../../de/dhbwstuttgart/syntaxtree/Class.html" title="class in de.dhbwstuttgart.syntaxtree">de.dhbwstuttgart.syntaxtree.Class</a></li>
<li><a href="../../../de/dhbwstuttgart/syntaxtree/Class.html" title="class in de.dhbwstuttgart.syntaxtree">de.dhbwstuttgart.syntaxtree.ClassOrInterface</a></li>
<li>
<ul class="inheritance">
<li>de.dhbwstuttgart.typeinference.FunNInterface</li>
@ -148,7 +148,7 @@ extends <a href="../../../de/dhbwstuttgart/syntaxtree/Class.html" title="class i
</a>
<h3>Field Summary</h3>
<ul class="blockList">
<li class="blockList"><a name="fields.inherited.from.class.de.dhbwstuttgart.syntaxtree.Class">
<li class="blockList"><a name="fields.inherited.from.class.de.dhbwstuttgart.syntaxtree.ClassOrInterface">
<!-- -->
</a>
<h3>Fields inherited from class&nbsp;de.dhbwstuttgart.syntaxtree.<a href="../../../de/dhbwstuttgart/syntaxtree/Class.html" title="class in de.dhbwstuttgart.syntaxtree">Class</a></h3>
@ -205,7 +205,7 @@ extends <a href="../../../de/dhbwstuttgart/syntaxtree/Class.html" title="class i
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.Class">
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.ClassOrInterface">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;de.dhbwstuttgart.syntaxtree.<a href="../../../de/dhbwstuttgart/syntaxtree/Class.html" title="class in de.dhbwstuttgart.syntaxtree">Class</a></h3>
@ -362,7 +362,7 @@ extends <a href="../../../de/dhbwstuttgart/syntaxtree/Class.html" title="class i
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#fields.inherited.from.class.de.dhbwstuttgart.syntaxtree.Class">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#fields.inherited.from.class.de.dhbwstuttgart.syntaxtree.ClassOrInterface">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>

View File

@ -1,7 +1,7 @@
package de.dhbwstuttgart.parser;
import de.dhbwstuttgart.syntaxtree.SourceFile;
import de.dhbwstuttgart.syntaxtree.Class;
import de.dhbwstuttgart.syntaxtree.ClassOrInterface;
import de.dhbwstuttgart.typecheck.JavaClassRegistry;
import java.util.ArrayList;
@ -14,15 +14,15 @@ public class SyntaxTreeGenerator {
}
public SourceFile convert(Java8Parser.CompilationUnitContext ctx){
List<Class> classes = new ArrayList<>();
List<ClassOrInterface> classes = new ArrayList<>();
for(Java8Parser.TypeDeclarationContext typeDecl : ctx.typeDeclaration()){
Class newClass = convert(typeDecl.classDeclaration());
ClassOrInterface newClass = convert(typeDecl.classDeclaration());
classes.add(newClass);
}
return new SourceFile(classes);
}
private Class convert(Java8Parser.ClassDeclarationContext ctx) {
private ClassOrInterface convert(Java8Parser.ClassDeclarationContext ctx) {
//TODO: Implement
return null;
}

View File

@ -13,7 +13,7 @@ import java.util.List;
/**
* Stellt jede Art von Klasse dar. Auch abstrakte Klassen und Interfaces
*/
public class Class extends GTVDeclarationContext implements IItemWithOffset, Generic
public class ClassOrInterface extends GTVDeclarationContext implements IItemWithOffset, Generic
{
protected Modifiers modifiers;

View File

@ -2,9 +2,6 @@ package de.dhbwstuttgart.syntaxtree;
import java.util.*;
import java.util.stream.Stream;
import de.dhbwstuttgart.core.MyCompiler;
import de.dhbwstuttgart.typecheck.JavaClassName;
@ -14,14 +11,14 @@ public class SourceFile extends SyntaxTreeNode
private String pkgName;
public List<Class> KlassenVektor = new ArrayList<>();
public List<ClassOrInterface> KlassenVektor = new ArrayList<>();
private List<JavaClassName> imports;
/**
* Die SourceFile repräsntiert eine zu einem Syntaxbaum eingelesene Java-Datei.
* SourceFile stellt dabei den Wurzelknoten des Syntaxbaumes dar.
*/
public SourceFile(List<Class> classDefinitions) {
public SourceFile(List<ClassOrInterface> classDefinitions) {
this.KlassenVektor = classDefinitions;
}

View File

@ -1,19 +1,9 @@
package de.dhbwstuttgart.syntaxtree.statement;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
import org.apache.bcel.generic.BranchInstruction;
import org.apache.bcel.generic.ClassGen;
import org.apache.bcel.generic.GOTO;
import org.apache.bcel.generic.IF_ICMPGE;
import org.apache.bcel.generic.InstructionHandle;
import org.apache.bcel.generic.InstructionList;
import org.apache.bcel.generic.NOP;
import de.dhbwstuttgart.syntaxtree.Class;
import de.dhbwstuttgart.syntaxtree.ClassOrInterface;
public class ForStmt extends Statement
{
@ -31,7 +21,7 @@ public class ForStmt extends Statement
super(null,variableLength);
}
void sc_check(List<Class> classname, Hashtable ch, Hashtable<String, String> bh, boolean ext, Hashtable parach, Hashtable<String, Hashtable> parabh)
void sc_check(List<ClassOrInterface> classname, Hashtable ch, Hashtable<String, String> bh, boolean ext, Hashtable parach, Hashtable<String, Hashtable> parabh)
{

View File

@ -2,17 +2,6 @@
package de.dhbwstuttgart.syntaxtree.statement;
// ino.end
// ino.module.LocalVarDecl.8638.import
import java.util.Enumeration;
import java.util.Hashtable;
import org.apache.bcel.generic.ClassGen;
import org.apache.bcel.generic.InstructionList;
import de.dhbwstuttgart.core.MyCompiler;
import de.dhbwstuttgart.syntaxtree.Class;
import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode;
import de.dhbwstuttgart.syntaxtree.type.RefType;
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
// ino.class.LocalVarDecl.25540.declaration

View File

@ -2,17 +2,6 @@
package de.dhbwstuttgart.syntaxtree.statement;
// ino.end
// ino.module.NotExpr.8643.import
import java.util.Hashtable;
import java.util.Iterator;
import org.apache.bcel.generic.ClassGen;
import org.apache.bcel.generic.InstructionList;
import de.dhbwstuttgart.syntaxtree.Class;
import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode;
import de.dhbwstuttgart.syntaxtree.type.RefType;
// ino.class.NotExpr.25873.declaration

View File

@ -2,15 +2,6 @@
package de.dhbwstuttgart.syntaxtree.statement;
// ino.end
// ino.module.PositivExpr.8645.import
import java.util.Hashtable;
import org.apache.bcel.generic.ClassGen;
import org.apache.bcel.generic.InstructionList;
import de.dhbwstuttgart.syntaxtree.Class;
import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode;
// ino.class.PositivExpr.25947.declaration

View File

@ -2,16 +2,6 @@
package de.dhbwstuttgart.syntaxtree.statement;
// ino.end
// ino.module.PreIncExpr.8649.import
import java.util.Hashtable;
import java.util.Iterator;
import org.apache.bcel.generic.ClassGen;
import org.apache.bcel.generic.InstructionList;
import de.dhbwstuttgart.syntaxtree.Class;
import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode;
// ino.class.PreIncExpr.26089.declaration

View File

@ -2,12 +2,6 @@
package de.dhbwstuttgart.syntaxtree.statement;
// ino.end
// ino.module.Receiver.8650.import
import java.util.Hashtable;
import de.dhbwstuttgart.syntaxtree.Class;
import de.dhbwstuttgart.syntaxtree.type.RefType;
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
// ino.class.Receiver.26123.declaration

View File

@ -2,17 +2,7 @@
package de.dhbwstuttgart.syntaxtree.statement;
// ino.end
// ino.module.This.8654.import
import java.util.Hashtable;
import org.apache.bcel.generic.ClassGen;
import org.apache.bcel.generic.InstructionFactory;
import org.apache.bcel.generic.InstructionHandle;
import org.apache.bcel.generic.InstructionList;
import org.apache.bcel.generic.MethodGen;
import org.apache.bcel.generic.ObjectType;
import de.dhbwstuttgart.syntaxtree.Class;
import de.dhbwstuttgart.syntaxtree.Constructor;
import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode;
// ino.class.This.26261.declaration

View File

@ -2,26 +2,6 @@
package de.dhbwstuttgart.syntaxtree.statement;
// ino.end
// ino.module.WhileStmt.8659.import
import java.sql.ResultSet;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
import org.apache.bcel.generic.BranchInstruction;
import org.apache.bcel.generic.ClassGen;
import org.apache.bcel.generic.DUP;
import org.apache.bcel.generic.GOTO;
import org.apache.bcel.generic.IFEQ;
import org.apache.bcel.generic.InstructionList;
import de.dhbwstuttgart.syntaxtree.Class;
import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode;
import de.dhbwstuttgart.syntaxtree.operator.LogOp;
import de.dhbwstuttgart.syntaxtree.operator.Operator;
import de.dhbwstuttgart.syntaxtree.operator.RelOp;
import de.dhbwstuttgart.syntaxtree.type.RefType;
// ino.class.WhileStmt.26326.declaration

View File

@ -1,11 +1,8 @@
package de.dhbwstuttgart.syntaxtree.type;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import de.dhbwstuttgart.typecheck.JavaClassName;
import de.dhbwstuttgart.syntaxtree.Class;
import de.dhbwstuttgart.syntaxtree.SourceFile;
import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode;