Literal löschen

This commit is contained in:
JanUlrich 2018-01-31 15:39:19 +01:00
parent cdcebdd4ac
commit e556a470e7
34 changed files with 123 additions and 301 deletions

View File

@ -112,7 +112,7 @@ var activeTableTab = "activeTableTab";
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Expr.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Expr</a></li> <li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Expr.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Expr</a></li>
<li> <li>
<ul class="inheritance"> <ul class="inheritance">
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.literal.Literal</a></li> <li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Literal</a></li>
<li> <li>
<ul class="inheritance"> <ul class="inheritance">
<li>de.dhbwstuttgart.syntaxtree.statement.literal.BoolLiteral</li> <li>de.dhbwstuttgart.syntaxtree.statement.literal.BoolLiteral</li>
@ -253,7 +253,7 @@ extends <a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html"
</tr> </tr>
</table> </table>
<ul class="blockList"> <ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.literal.Literal"> <li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.Literal">
<!-- --> <!-- -->
</a> </a>
<h3>Methods inherited from class&nbsp;de.dhbwstuttgart.syntaxtree.statement.<a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">Literal</a></h3> <h3>Methods inherited from class&nbsp;de.dhbwstuttgart.syntaxtree.statement.<a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">Literal</a></h3>

View File

@ -112,7 +112,7 @@ var activeTableTab = "activeTableTab";
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Expr.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Expr</a></li> <li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Expr.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Expr</a></li>
<li> <li>
<ul class="inheritance"> <ul class="inheritance">
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.literal.Literal</a></li> <li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Literal</a></li>
<li> <li>
<ul class="inheritance"> <ul class="inheritance">
<li>de.dhbwstuttgart.syntaxtree.statement.literal.CharLiteral</li> <li>de.dhbwstuttgart.syntaxtree.statement.literal.CharLiteral</li>
@ -253,7 +253,7 @@ extends <a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html"
</tr> </tr>
</table> </table>
<ul class="blockList"> <ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.literal.Literal"> <li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.Literal">
<!-- --> <!-- -->
</a> </a>
<h3>Methods inherited from class&nbsp;de.dhbwstuttgart.syntaxtree.statement.<a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">Literal</a></h3> <h3>Methods inherited from class&nbsp;de.dhbwstuttgart.syntaxtree.statement.<a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">Literal</a></h3>

View File

@ -112,7 +112,7 @@ var activeTableTab = "activeTableTab";
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Expr.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Expr</a></li> <li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Expr.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Expr</a></li>
<li> <li>
<ul class="inheritance"> <ul class="inheritance">
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.literal.Literal</a></li> <li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Literal</a></li>
<li> <li>
<ul class="inheritance"> <ul class="inheritance">
<li>de.dhbwstuttgart.syntaxtree.statement.literal.DoubleLiteral</li> <li>de.dhbwstuttgart.syntaxtree.statement.literal.DoubleLiteral</li>
@ -263,7 +263,7 @@ extends <a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html"
</tr> </tr>
</table> </table>
<ul class="blockList"> <ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.literal.Literal"> <li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.Literal">
<!-- --> <!-- -->
</a> </a>
<h3>Methods inherited from class&nbsp;de.dhbwstuttgart.syntaxtree.statement.<a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">Literal</a></h3> <h3>Methods inherited from class&nbsp;de.dhbwstuttgart.syntaxtree.statement.<a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">Literal</a></h3>

View File

@ -112,7 +112,7 @@ var activeTableTab = "activeTableTab";
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Expr.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Expr</a></li> <li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Expr.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Expr</a></li>
<li> <li>
<ul class="inheritance"> <ul class="inheritance">
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.literal.Literal</a></li> <li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Literal</a></li>
<li> <li>
<ul class="inheritance"> <ul class="inheritance">
<li>de.dhbwstuttgart.syntaxtree.statement.literal.FloatLiteral</li> <li>de.dhbwstuttgart.syntaxtree.statement.literal.FloatLiteral</li>
@ -263,7 +263,7 @@ extends <a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html"
</tr> </tr>
</table> </table>
<ul class="blockList"> <ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.literal.Literal"> <li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.Literal">
<!-- --> <!-- -->
</a> </a>
<h3>Methods inherited from class&nbsp;de.dhbwstuttgart.syntaxtree.statement.<a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">Literal</a></h3> <h3>Methods inherited from class&nbsp;de.dhbwstuttgart.syntaxtree.statement.<a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">Literal</a></h3>

View File

@ -112,7 +112,7 @@ var activeTableTab = "activeTableTab";
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Expr.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Expr</a></li> <li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Expr.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Expr</a></li>
<li> <li>
<ul class="inheritance"> <ul class="inheritance">
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.literal.Literal</a></li> <li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Literal</a></li>
<li> <li>
<ul class="inheritance"> <ul class="inheritance">
<li>de.dhbwstuttgart.syntaxtree.statement.literal.NumberLiteral</li> <li>de.dhbwstuttgart.syntaxtree.statement.literal.NumberLiteral</li>
@ -263,7 +263,7 @@ extends <a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html"
</tr> </tr>
</table> </table>
<ul class="blockList"> <ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.literal.Literal"> <li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.Literal">
<!-- --> <!-- -->
</a> </a>
<h3>Methods inherited from class&nbsp;de.dhbwstuttgart.syntaxtree.statement.<a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">Literal</a></h3> <h3>Methods inherited from class&nbsp;de.dhbwstuttgart.syntaxtree.statement.<a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">Literal</a></h3>

View File

@ -112,7 +112,7 @@ var activeTableTab = "activeTableTab";
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Expr.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Expr</a></li> <li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Expr.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Expr</a></li>
<li> <li>
<ul class="inheritance"> <ul class="inheritance">
<li>de.dhbwstuttgart.syntaxtree.statement.literal.Literal</li> <li>de.dhbwstuttgart.syntaxtree.statement.Literal</li>
</ul> </ul>
</li> </li>
</ul> </ul>

View File

@ -112,7 +112,7 @@ var activeTableTab = "activeTableTab";
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Expr.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Expr</a></li> <li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Expr.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Expr</a></li>
<li> <li>
<ul class="inheritance"> <ul class="inheritance">
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.literal.Literal</a></li> <li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Literal</a></li>
<li> <li>
<ul class="inheritance"> <ul class="inheritance">
<li>de.dhbwstuttgart.syntaxtree.statement.LongLiteral</li> <li>de.dhbwstuttgart.syntaxtree.statement.LongLiteral</li>
@ -263,7 +263,7 @@ extends <a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html"
</tr> </tr>
</table> </table>
<ul class="blockList"> <ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.literal.Literal"> <li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.Literal">
<!-- --> <!-- -->
</a> </a>
<h3>Methods inherited from class&nbsp;de.dhbwstuttgart.syntaxtree.statement.<a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">Literal</a></h3> <h3>Methods inherited from class&nbsp;de.dhbwstuttgart.syntaxtree.statement.<a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">Literal</a></h3>

View File

@ -112,7 +112,7 @@ var activeTableTab = "activeTableTab";
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Expr.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Expr</a></li> <li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Expr.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Expr</a></li>
<li> <li>
<ul class="inheritance"> <ul class="inheritance">
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.literal.Literal</a></li> <li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Literal</a></li>
<li> <li>
<ul class="inheritance"> <ul class="inheritance">
<li>de.dhbwstuttgart.syntaxtree.statement.literal.Null</li> <li>de.dhbwstuttgart.syntaxtree.statement.literal.Null</li>
@ -245,7 +245,7 @@ extends <a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html"
</tr> </tr>
</table> </table>
<ul class="blockList"> <ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.literal.Literal"> <li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.Literal">
<!-- --> <!-- -->
</a> </a>
<h3>Methods inherited from class&nbsp;de.dhbwstuttgart.syntaxtree.statement.<a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">Literal</a></h3> <h3>Methods inherited from class&nbsp;de.dhbwstuttgart.syntaxtree.statement.<a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">Literal</a></h3>

View File

@ -112,7 +112,7 @@ var activeTableTab = "activeTableTab";
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Expr.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Expr</a></li> <li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Expr.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Expr</a></li>
<li> <li>
<ul class="inheritance"> <ul class="inheritance">
<li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.literal.Literal</a></li> <li><a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">de.dhbwstuttgart.syntaxtree.statement.Literal</a></li>
<li> <li>
<ul class="inheritance"> <ul class="inheritance">
<li>de.dhbwstuttgart.syntaxtree.statement.literal.StringLiteral</li> <li>de.dhbwstuttgart.syntaxtree.statement.literal.StringLiteral</li>
@ -253,7 +253,7 @@ extends <a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html"
</tr> </tr>
</table> </table>
<ul class="blockList"> <ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.literal.Literal"> <li class="blockList"><a name="methods.inherited.from.class.de.dhbwstuttgart.syntaxtree.statement.Literal">
<!-- --> <!-- -->
</a> </a>
<h3>Methods inherited from class&nbsp;de.dhbwstuttgart.syntaxtree.statement.<a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">Literal</a></h3> <h3>Methods inherited from class&nbsp;de.dhbwstuttgart.syntaxtree.statement.<a href="../../../../de/dhbwstuttgart/syntaxtree/statement/Literal.html" title="class in de.dhbwstuttgart.syntaxtree.statement">Literal</a></h3>

View File

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

View File

@ -1,6 +1,5 @@
package de.dhbwstuttgart.bytecode; package de.dhbwstuttgart.bytecode;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
@ -10,14 +9,10 @@ import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.FieldVisitor; import org.objectweb.asm.FieldVisitor;
import org.objectweb.asm.MethodVisitor; import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes; import org.objectweb.asm.Opcodes;
import org.objectweb.asm.Type;
import org.objectweb.asm.signature.SignatureVisitor;
import org.objectweb.asm.signature.SignatureWriter;
import de.dhbwstuttgart.parser.SyntaxTreeGenerator.AssignToLocal; import de.dhbwstuttgart.parser.SyntaxTreeGenerator.AssignToLocal;
import de.dhbwstuttgart.syntaxtree.*; import de.dhbwstuttgart.syntaxtree.*;
import de.dhbwstuttgart.syntaxtree.statement.literal.Literal; import de.dhbwstuttgart.syntaxtree.statement.Literal;
import de.dhbwstuttgart.syntaxtree.statement.literal.Null;
import de.dhbwstuttgart.syntaxtree.type.ExtendsWildcardType; import de.dhbwstuttgart.syntaxtree.type.ExtendsWildcardType;
import de.dhbwstuttgart.syntaxtree.type.GenericRefType; import de.dhbwstuttgart.syntaxtree.type.GenericRefType;
import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.syntaxtree.type.RefType;
@ -282,8 +277,7 @@ public class BytecodeGen implements ASTVisitor {
} }
@Override @Override
public void visit(Binary binary) { public void visit(BinaryExpr binary) {
// TODO Auto-generated method stub
} }
@ -395,11 +389,6 @@ public class BytecodeGen implements ASTVisitor {
} }
@Override
public void visit(Null aNull) {
// TODO Auto-generated method stub
}
// ??? // ???
@Override @Override
public void visit(Literal literal) { public void visit(Literal literal) {

View File

@ -20,9 +20,7 @@ import de.dhbwstuttgart.parser.SyntaxTreeGenerator.AssignToLocal;
import de.dhbwstuttgart.syntaxtree.FormalParameter; import de.dhbwstuttgart.syntaxtree.FormalParameter;
import de.dhbwstuttgart.syntaxtree.Method; import de.dhbwstuttgart.syntaxtree.Method;
import de.dhbwstuttgart.syntaxtree.StatementVisitor; import de.dhbwstuttgart.syntaxtree.StatementVisitor;
import de.dhbwstuttgart.syntaxtree.statement.literal.Literal; import de.dhbwstuttgart.syntaxtree.statement.Literal;
import de.dhbwstuttgart.syntaxtree.statement.literal.Null;
import de.dhbwstuttgart.syntaxtree.type.FunN;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric; import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
import de.dhbwstuttgart.typeinference.result.ResultSet; import de.dhbwstuttgart.typeinference.result.ResultSet;
@ -161,7 +159,7 @@ public class BytecodeGenMethod implements StatementVisitor{
} }
@Override @Override
public void visit(Binary binary) { public void visit(BinaryExpr binary) {
System.out.println("\t++ In Binary: "); System.out.println("\t++ In Binary: ");
} }
@ -385,11 +383,6 @@ public class BytecodeGenMethod implements StatementVisitor{
} }
@Override
public void visit(Null aNull) {
mv.visitInsn(Opcodes.ACONST_NULL);
}
@Override @Override
public void visit(Literal literal) { public void visit(Literal literal) {
// value? // value?

View File

@ -8,8 +8,7 @@ import java.util.List;
import de.dhbwstuttgart.parser.SyntaxTreeGenerator.AssignToLocal; import de.dhbwstuttgart.parser.SyntaxTreeGenerator.AssignToLocal;
import de.dhbwstuttgart.syntaxtree.StatementVisitor; import de.dhbwstuttgart.syntaxtree.StatementVisitor;
import de.dhbwstuttgart.syntaxtree.statement.literal.Literal; import de.dhbwstuttgart.syntaxtree.statement.Literal;
import de.dhbwstuttgart.syntaxtree.statement.literal.Null;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric; import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
public class KindOfLambda implements StatementVisitor{ public class KindOfLambda implements StatementVisitor{
@ -46,7 +45,7 @@ public class KindOfLambda implements StatementVisitor{
} }
@Override @Override
public void visit(Binary binary) { public void visit(BinaryExpr binary) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
} }
@ -173,12 +172,6 @@ public class KindOfLambda implements StatementVisitor{
} }
@Override
public void visit(Null aNull) {
// TODO Auto-generated method stub
}
@Override @Override
public void visit(Literal literal) { public void visit(Literal literal) {
// TODO Auto-generated method stub // TODO Auto-generated method stub

View File

@ -42,6 +42,7 @@ public class CompilationEnvironment {
public CompilationEnvironment(List<File> sourceFiles) { public CompilationEnvironment(List<File> sourceFiles) {
String bootClassPath = System.getProperty("sun.boot.class.path"); String bootClassPath = System.getProperty("sun.boot.class.path");
librarys = new ArrayList<>(); librarys = new ArrayList<>();
if(bootClassPath != null){
for(String path : bootClassPath.split(File.pathSeparator)) { for(String path : bootClassPath.split(File.pathSeparator)) {
try { try {
librarys.add(new URL("file:"+path)); librarys.add(new URL("file:"+path));
@ -49,6 +50,7 @@ public class CompilationEnvironment {
new DebugException("Fehler im Classpath auf diesem System"); new DebugException("Fehler im Classpath auf diesem System");
} }
} }
}
this.sourceFiles = sourceFiles; this.sourceFiles = sourceFiles;
this.packageCrawler = new PackageCrawler(librarys); this.packageCrawler = new PackageCrawler(librarys);
} }

View File

@ -29,7 +29,7 @@ public class JavaTXParser {
*/ */
} }
/* Für das Typsystem ist es notwendig, dass sich der Source in einer Datei befindet: /* Für das Typsystem ist es notwendig, dass sich der Source in einer Datei befindet:
public SourceFile parse(String fileContent) throws IOException, java.lang.ClassNotFoundException { public SourceFile parse(String fileContent) throws IOException, java.lang.ClassNotFoundException {
return this.parse(new ByteArrayInputStream(fileContent.getBytes(StandardCharsets.UTF_8))); return this.parse(new ByteArrayInputStream(fileContent.getBytes(StandardCharsets.UTF_8)));
} }

View File

@ -7,7 +7,6 @@ import de.dhbwstuttgart.parser.scope.GenericsRegistry;
import de.dhbwstuttgart.parser.scope.JavaClassRegistry; import de.dhbwstuttgart.parser.scope.JavaClassRegistry;
import de.dhbwstuttgart.syntaxtree.*; import de.dhbwstuttgart.syntaxtree.*;
import de.dhbwstuttgart.syntaxtree.statement.*; import de.dhbwstuttgart.syntaxtree.statement.*;
import de.dhbwstuttgart.syntaxtree.statement.literal.*;
import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.syntaxtree.type.RefType;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric; import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
@ -16,7 +15,6 @@ import de.dhbwstuttgart.syntaxtree.type.Void;
import org.antlr.v4.runtime.Token; import org.antlr.v4.runtime.Token;
import org.antlr.v4.runtime.tree.TerminalNode; import org.antlr.v4.runtime.tree.TerminalNode;
import java.lang.reflect.Type;
import java.util.*; import java.util.*;
public class StatementGenerator { public class StatementGenerator {
@ -544,8 +542,7 @@ public class StatementGenerator {
if(expression.conditionalOrExpression() == null){ if(expression.conditionalOrExpression() == null){
return convert(expression.conditionalAndExpression()); return convert(expression.conditionalAndExpression());
}else{ }else{
return new Binary(convert(expression.conditionalOrExpression()), throw new NotImplementedException();
convert(expression.conditionalAndExpression()), Binary.Operator.OR);
} }
} }
@ -553,8 +550,7 @@ public class StatementGenerator {
if(expression.conditionalAndExpression() == null){ if(expression.conditionalAndExpression() == null){
return convert(expression.inclusiveOrExpression()); return convert(expression.inclusiveOrExpression());
}else{ }else{
return new Binary(convert(expression.conditionalAndExpression()), throw new NotImplementedException();
convert(expression.inclusiveOrExpression()), Binary.Operator.AND);
} }
} }
@ -594,8 +590,17 @@ public class StatementGenerator {
if(expression.relationalExpression() == null) { if(expression.relationalExpression() == null) {
return convert(expression.shiftExpression()); return convert(expression.shiftExpression());
}else { }else {
return convert(expression.relationalExpression()); String operator = expression.getChild(1).getText();
return new BinaryExpr(convertBinaryOperator(operator), TypePlaceholder.fresh(expression.getStart()),
convert(expression.relationalExpression()),
convert(expression.shiftExpression()), expression.getStart());
} }
//}else throw new NotImplementedException();
}
private BinaryExpr.Operator convertBinaryOperator(String operator) {
return null;
} }
private Expression convert(Java8Parser.ShiftExpressionContext expression) { private Expression convert(Java8Parser.ShiftExpressionContext expression) {
@ -778,25 +783,25 @@ public class StatementGenerator {
private Expression convert(Java8Parser.LiteralContext literal) { private Expression convert(Java8Parser.LiteralContext literal) {
if(literal.IntegerLiteral() != null || literal.FloatingPointLiteral()!= null){ if(literal.IntegerLiteral() != null || literal.FloatingPointLiteral()!= null){
Number value = Double.parseDouble(literal.IntegerLiteral().getText()); Number value = Double.parseDouble(literal.IntegerLiteral().getText());
return new NumberLiteral(TypePlaceholder.fresh(literal.getStart()), return new Literal(TypePlaceholder.fresh(literal.getStart()),
value, literal.getStart()); value, literal.getStart());
}else if(literal.BooleanLiteral() != null){ }else if(literal.BooleanLiteral() != null){
RefType type = new RefType(reg.getName("java.lang.Boolean"),literal.getStart()); RefType type = new RefType(reg.getName("java.lang.Boolean"),literal.getStart());
return new BoolLiteral(type, return new Literal(type,
Boolean.parseBoolean(literal.BooleanLiteral().getText()), Boolean.parseBoolean(literal.BooleanLiteral().getText()),
literal.getStart()); literal.getStart());
}else if(literal.CharacterLiteral() != null){ }else if(literal.CharacterLiteral() != null){
RefType type = new RefType(reg.getName("java.lang.Character"),literal.getStart()); RefType type = new RefType(reg.getName("java.lang.Character"),literal.getStart());
return new CharLiteral(type, return new Literal(type,
literal.CharacterLiteral().getText().charAt(0), literal.CharacterLiteral().getText().charAt(0),
literal.getStart()); literal.getStart());
}else if(literal.StringLiteral()!=null){ }else if(literal.StringLiteral()!=null){
RefType type = new RefType(reg.getName("java.lang.String"),literal.getStart()); RefType type = new RefType(reg.getName("java.lang.String"),literal.getStart());
return new StringLiteral(type, return new Literal(type,
literal.StringLiteral().getText(), literal.StringLiteral().getText(),
literal.getStart()); literal.getStart());
}else if(literal.NullLiteral() != null){ }else if(literal.NullLiteral() != null){
return new Null(TypePlaceholder.fresh(literal.getStart()), return new Literal(TypePlaceholder.fresh(literal.getStart()), null,
literal.getStart()); literal.getStart());
}else { }else {
throw new NotImplementedException(); throw new NotImplementedException();

View File

@ -1,12 +1,6 @@
package de.dhbwstuttgart.syntaxtree; package de.dhbwstuttgart.syntaxtree;
import de.dhbwstuttgart.syntaxtree.statement.*;
import de.dhbwstuttgart.syntaxtree.statement.literal.Literal;
import de.dhbwstuttgart.syntaxtree.statement.literal.Null;
import de.dhbwstuttgart.syntaxtree.type.*; import de.dhbwstuttgart.syntaxtree.type.*;
import de.dhbwstuttgart.typeinference.constraints.Constraint;
import java.lang.reflect.Type;
public interface ASTVisitor extends StatementVisitor{ public interface ASTVisitor extends StatementVisitor{

View File

@ -1,14 +1,10 @@
package de.dhbwstuttgart.syntaxtree; package de.dhbwstuttgart.syntaxtree;
import de.dhbwstuttgart.exceptions.NotImplementedException;
import de.dhbwstuttgart.parser.SyntaxTreeGenerator.AssignToLocal; import de.dhbwstuttgart.parser.SyntaxTreeGenerator.AssignToLocal;
import de.dhbwstuttgart.syntaxtree.statement.*; import de.dhbwstuttgart.syntaxtree.statement.*;
import de.dhbwstuttgart.syntaxtree.statement.literal.Literal; import de.dhbwstuttgart.syntaxtree.statement.Literal;
import de.dhbwstuttgart.syntaxtree.statement.literal.Null;
import de.dhbwstuttgart.syntaxtree.type.*; import de.dhbwstuttgart.syntaxtree.type.*;
import javax.management.Notification;
import java.lang.reflect.Modifier;
import java.util.Iterator; import java.util.Iterator;
public abstract class AbstractASTWalker implements ASTVisitor{ public abstract class AbstractASTWalker implements ASTVisitor{
@ -130,7 +126,7 @@ public abstract class AbstractASTWalker implements ASTVisitor{
} }
@Override @Override
public void visit(Binary binary) { public void visit(BinaryExpr binary) {
} }
@ -244,11 +240,6 @@ public abstract class AbstractASTWalker implements ASTVisitor{
whileStmt.loopBlock.accept(this); whileStmt.loopBlock.accept(this);
} }
@Override
public void visit(Null aNull) {
}
@Override @Override
public void visit(Literal literal) { public void visit(Literal literal) {

View File

@ -2,9 +2,6 @@ package de.dhbwstuttgart.syntaxtree;
import de.dhbwstuttgart.parser.SyntaxTreeGenerator.AssignToLocal; import de.dhbwstuttgart.parser.SyntaxTreeGenerator.AssignToLocal;
import de.dhbwstuttgart.syntaxtree.statement.*; import de.dhbwstuttgart.syntaxtree.statement.*;
import de.dhbwstuttgart.syntaxtree.statement.literal.Literal;
import de.dhbwstuttgart.syntaxtree.statement.literal.Null;
import de.dhbwstuttgart.syntaxtree.statement.literal.StringLiteral;
public interface StatementVisitor { public interface StatementVisitor {
@ -14,7 +11,7 @@ public interface StatementVisitor {
void visit(Assign assign); void visit(Assign assign);
void visit(Binary binary); void visit(BinaryExpr binary);
void visit(Block block); void visit(Block block);
@ -54,10 +51,6 @@ public interface StatementVisitor {
void visit(DoStmt whileStmt); void visit(DoStmt whileStmt);
void visit(Null aNull);
void visit(Literal literal);
void visit(AssignToField assignLeftSide); void visit(AssignToField assignLeftSide);
void visit(AssignToLocal assignLeftSide); void visit(AssignToLocal assignLeftSide);
@ -67,4 +60,6 @@ public interface StatementVisitor {
void visit(ExpressionReceiver expressionReceiver); void visit(ExpressionReceiver expressionReceiver);
void visit(UnaryExpr unaryExpr); void visit(UnaryExpr unaryExpr);
void visit(Literal literal);
} }

View File

@ -1,27 +0,0 @@
package de.dhbwstuttgart.syntaxtree.statement;
import de.dhbwstuttgart.exceptions.NotImplementedException;
import de.dhbwstuttgart.syntaxtree.StatementVisitor;
import de.dhbwstuttgart.typeinference.assumptions.TypeInferenceBlockInformation;
import de.dhbwstuttgart.typeinference.constraints.ConstraintSet;
import de.dhbwstuttgart.typeinference.assumptions.TypeInferenceInformation;
// neu von Felix
public class Binary extends Expression
{
public enum Operator{
ADD,
SUB,
MUL,
AND, OR, DIV
}
public Binary(Expression expr1, Expression expr2, Operator op){
super(null, null);
}
@Override
public void accept(StatementVisitor visitor) {
visitor.visit(this);
}
}

View File

@ -1,14 +1,41 @@
package de.dhbwstuttgart.syntaxtree.statement; package de.dhbwstuttgart.syntaxtree.statement;
import de.dhbwstuttgart.syntaxtree.StatementVisitor;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
import org.antlr.v4.runtime.Token; import org.antlr.v4.runtime.Token;
public abstract class BinaryExpr extends Expression public class BinaryExpr extends Expression
{ {
@Override
public void accept(StatementVisitor visitor) {
visitor.visit(this);
}
public BinaryExpr(Token offset) public enum Operator{
ADD,
SUB,
MUL,
AND,
OR,
DIV,
LESSTHAN,
BIGGERTHAN,
LESSEQUAL,
BIGGEREQUAL
}
public final Operator operation;
public final Expression lexpr;
public final Expression rexpr;
public BinaryExpr(Operator operation, RefTypeOrTPHOrWildcardOrGeneric type, Expression lexpr, Expression rexpr, Token offset)
{ {
super(null,null); super(type,offset);
this.operation = operation;
this.lexpr = lexpr;
this.rexpr = rexpr;
} }
} }

View File

@ -3,8 +3,6 @@ package de.dhbwstuttgart.syntaxtree.statement;
import de.dhbwstuttgart.exceptions.NotImplementedException; import de.dhbwstuttgart.exceptions.NotImplementedException;
import de.dhbwstuttgart.syntaxtree.StatementVisitor; import de.dhbwstuttgart.syntaxtree.StatementVisitor;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric; import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
import de.dhbwstuttgart.typeinference.assumptions.TypeInferenceBlockInformation;
import de.dhbwstuttgart.typeinference.constraints.ConstraintSet;
public class InstanceOf extends BinaryExpr public class InstanceOf extends BinaryExpr
@ -14,7 +12,8 @@ public class InstanceOf extends BinaryExpr
public InstanceOf(int offset,int variableLength) public InstanceOf(int offset,int variableLength)
{ {
super(null); super(null, null, null, null, null);
throw new NotImplementedException();
// #JB# 20.04.2005 // #JB# 20.04.2005
} }

View File

@ -1,19 +1,21 @@
package de.dhbwstuttgart.syntaxtree.statement.literal; package de.dhbwstuttgart.syntaxtree.statement;
import de.dhbwstuttgart.syntaxtree.StatementVisitor;
import de.dhbwstuttgart.syntaxtree.statement.Expression; import de.dhbwstuttgart.syntaxtree.statement.Expression;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric; import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
import de.dhbwstuttgart.typeinference.assumptions.TypeInferenceBlockInformation; import de.dhbwstuttgart.typeinference.assumptions.TypeInferenceBlockInformation;
import de.dhbwstuttgart.typeinference.constraints.ConstraintSet; import de.dhbwstuttgart.typeinference.constraints.ConstraintSet;
import org.antlr.v4.runtime.Token; import org.antlr.v4.runtime.Token;
public abstract class Literal extends Expression public class Literal extends Expression
{ {
public Literal(RefTypeOrTPHOrWildcardOrGeneric type, Token offset) { public Literal(RefTypeOrTPHOrWildcardOrGeneric type, Object value, Token offset) {
super(type, offset); super(type, offset);
} }
public ConstraintSet getConstraints(TypeInferenceBlockInformation info){ @Override
return new ConstraintSet(); public void accept(StatementVisitor visitor) {
visitor.visit(this);
} }
} }

View File

@ -2,7 +2,6 @@ package de.dhbwstuttgart.syntaxtree.statement;
import de.dhbwstuttgart.exceptions.TypeinferenceException; import de.dhbwstuttgart.exceptions.TypeinferenceException;
import de.dhbwstuttgart.syntaxtree.*; import de.dhbwstuttgart.syntaxtree.*;
import de.dhbwstuttgart.syntaxtree.statement.literal.Null;
import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.syntaxtree.type.RefType;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric; import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
import de.dhbwstuttgart.typeinference.assumptions.TypeInferenceBlockInformation; import de.dhbwstuttgart.typeinference.assumptions.TypeInferenceBlockInformation;

View File

@ -1,26 +0,0 @@
package de.dhbwstuttgart.syntaxtree.statement.literal;
import de.dhbwstuttgart.syntaxtree.StatementVisitor;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
import org.antlr.v4.runtime.Token;
public class BoolLiteral extends Literal
{
private boolean value;
public BoolLiteral(RefTypeOrTPHOrWildcardOrGeneric type, boolean value, Token offset)
{
super(type,offset);
this.value = value;
}
@Override
public void accept(StatementVisitor visitor) {
visitor.visit(this);
}
}

View File

@ -1,21 +0,0 @@
package de.dhbwstuttgart.syntaxtree.statement.literal;
import de.dhbwstuttgart.syntaxtree.StatementVisitor;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
import org.antlr.v4.runtime.Token;
public class CharLiteral extends Literal
{
private char value;
public CharLiteral(RefTypeOrTPHOrWildcardOrGeneric type, char value, Token offset)
{
super(type,offset);
this.value = value;
}
@Override
public void accept(StatementVisitor visitor) {
visitor.visit(this);
}
}

View File

@ -1,21 +0,0 @@
package de.dhbwstuttgart.syntaxtree.statement.literal;
import de.dhbwstuttgart.syntaxtree.StatementVisitor;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
import org.antlr.v4.runtime.Token;
public class Null extends Literal
{
public Null(RefTypeOrTPHOrWildcardOrGeneric type, Token offset)
{
super(type,offset);
}
@Override
public void accept(StatementVisitor visitor) {
visitor.visit(this);
}
}

View File

@ -1,22 +0,0 @@
package de.dhbwstuttgart.syntaxtree.statement.literal;
import de.dhbwstuttgart.syntaxtree.StatementVisitor;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
import org.antlr.v4.runtime.Token;
public class NumberLiteral extends Literal
{
private Number value;
public NumberLiteral(RefTypeOrTPHOrWildcardOrGeneric type, Number value, Token offset)
{
super(type,offset);
this.value = value;
}
@Override
public void accept(StatementVisitor visitor) {
visitor.visit(this);
}
}

View File

@ -1,23 +0,0 @@
package de.dhbwstuttgart.syntaxtree.statement.literal;
import de.dhbwstuttgart.syntaxtree.StatementVisitor;
import de.dhbwstuttgart.syntaxtree.type.RefType;
import org.antlr.v4.runtime.Token;
public class StringLiteral extends Literal
{
private String value;
public StringLiteral(RefType type, String value, Token offset)
{
super(type,offset);
this.value = value;
}
@Override
public void accept(StatementVisitor visitor) {
visitor.visit(this);
}
}

View File

@ -1,13 +1,6 @@
package de.dhbwstuttgart.syntaxtree.visual; package de.dhbwstuttgart.syntaxtree.visual;
import de.dhbwstuttgart.syntaxtree.*; import de.dhbwstuttgart.syntaxtree.*;
import de.dhbwstuttgart.syntaxtree.statement.*;
import de.dhbwstuttgart.syntaxtree.statement.literal.Literal;
import de.dhbwstuttgart.syntaxtree.statement.literal.Null;
import de.dhbwstuttgart.syntaxtree.type.*;
import java.lang.reflect.Modifier;
import java.util.Iterator;
public class ASTTypePrinter extends ASTPrinter{ public class ASTTypePrinter extends ASTPrinter{

View File

@ -4,8 +4,6 @@ import de.dhbwstuttgart.exceptions.NotImplementedException;
import de.dhbwstuttgart.parser.SyntaxTreeGenerator.AssignToLocal; import de.dhbwstuttgart.parser.SyntaxTreeGenerator.AssignToLocal;
import de.dhbwstuttgart.syntaxtree.*; import de.dhbwstuttgart.syntaxtree.*;
import de.dhbwstuttgart.syntaxtree.statement.*; import de.dhbwstuttgart.syntaxtree.statement.*;
import de.dhbwstuttgart.syntaxtree.statement.literal.Literal;
import de.dhbwstuttgart.syntaxtree.statement.literal.Null;
import de.dhbwstuttgart.syntaxtree.type.*; import de.dhbwstuttgart.syntaxtree.type.*;
import java.lang.reflect.Modifier; import java.lang.reflect.Modifier;
@ -191,8 +189,10 @@ public class OutputGenerator implements ASTVisitor{
} }
@Override @Override
public void visit(Binary binary) { public void visit(BinaryExpr binary) {
binary.lexpr.accept(this);
out.append(" op ");
binary.rexpr.accept(this);
} }
@Override @Override
@ -313,16 +313,6 @@ public class OutputGenerator implements ASTVisitor{
out.append(");"); out.append(");");
} }
@Override
public void visit(Null aNull) {
}
@Override
public void visit(Literal literal) {
}
@Override @Override
public void visit(AssignToField assignLeftSide) { public void visit(AssignToField assignLeftSide) {
assignLeftSide.field.accept(this); assignLeftSide.field.accept(this);
@ -367,4 +357,9 @@ public class OutputGenerator implements ASTVisitor{
out.append("++"); out.append("++");
} }
} }
@Override
public void visit(de.dhbwstuttgart.syntaxtree.statement.Literal literal) {
throw new NotImplementedException();
}
} }

View File

@ -2,13 +2,9 @@ package de.dhbwstuttgart.syntaxtree.visual;
import de.dhbwstuttgart.syntaxtree.*; import de.dhbwstuttgart.syntaxtree.*;
import de.dhbwstuttgart.syntaxtree.statement.*; import de.dhbwstuttgart.syntaxtree.statement.*;
import de.dhbwstuttgart.syntaxtree.statement.literal.Literal; import de.dhbwstuttgart.syntaxtree.statement.Literal;
import de.dhbwstuttgart.syntaxtree.statement.literal.Null;
import de.dhbwstuttgart.syntaxtree.type.*; import de.dhbwstuttgart.syntaxtree.type.*;
import java.lang.reflect.Modifier;
import java.util.Iterator;
public class TypeOutputGenerator extends OutputGenerator { public class TypeOutputGenerator extends OutputGenerator {
TypeOutputGenerator(StringBuilder out){ TypeOutputGenerator(StringBuilder out){
@ -100,8 +96,10 @@ public class TypeOutputGenerator extends OutputGenerator {
} }
@Override @Override
public void visit(Binary binary) { public void visit(BinaryExpr binary) {
super.visit(binary); binary.lexpr.accept(this);
out.append(" | ");
binary.rexpr.accept(this);
} }
@Override @Override
@ -219,11 +217,6 @@ public class TypeOutputGenerator extends OutputGenerator {
super.visit(whileStmt); super.visit(whileStmt);
} }
@Override
public void visit(Null aNull) {
super.visit(aNull);
}
@Override @Override
public void visit(Literal literal) { public void visit(Literal literal) {
super.visit(literal); super.visit(literal);

View File

@ -1,6 +1,5 @@
package de.dhbwstuttgart.typeinference.assumptions; package de.dhbwstuttgart.typeinference.assumptions;
import com.sun.org.apache.regexp.internal.RE;
import de.dhbwstuttgart.parser.NullToken; import de.dhbwstuttgart.parser.NullToken;
import de.dhbwstuttgart.parser.SyntaxTreeGenerator.GenericContext; import de.dhbwstuttgart.parser.SyntaxTreeGenerator.GenericContext;
import de.dhbwstuttgart.parser.scope.GenericTypeName; import de.dhbwstuttgart.parser.scope.GenericTypeName;

View File

@ -1,8 +1,5 @@
package de.dhbwstuttgart.typeinference.typeAlgo; package de.dhbwstuttgart.typeinference.typeAlgo;
//import com.sun.org.apache.xpath.internal.Arg;
import com.sun.org.apache.xpath.internal.operations.Bool;
import de.dhbwstuttgart.exceptions.NotImplementedException; import de.dhbwstuttgart.exceptions.NotImplementedException;
import de.dhbwstuttgart.exceptions.TypeinferenceException; import de.dhbwstuttgart.exceptions.TypeinferenceException;
import de.dhbwstuttgart.parser.NullToken; import de.dhbwstuttgart.parser.NullToken;
@ -11,8 +8,6 @@ import de.dhbwstuttgart.parser.antlr.Java8Parser;
import de.dhbwstuttgart.syntaxtree.*; import de.dhbwstuttgart.syntaxtree.*;
import de.dhbwstuttgart.syntaxtree.factory.ASTFactory; import de.dhbwstuttgart.syntaxtree.factory.ASTFactory;
import de.dhbwstuttgart.syntaxtree.statement.*; import de.dhbwstuttgart.syntaxtree.statement.*;
import de.dhbwstuttgart.syntaxtree.statement.literal.Literal;
import de.dhbwstuttgart.syntaxtree.statement.literal.Null;
import de.dhbwstuttgart.syntaxtree.type.*; import de.dhbwstuttgart.syntaxtree.type.*;
import de.dhbwstuttgart.typeinference.assumptions.FieldAssumption; import de.dhbwstuttgart.typeinference.assumptions.FieldAssumption;
import de.dhbwstuttgart.typeinference.assumptions.FunNClass; import de.dhbwstuttgart.typeinference.assumptions.FunNClass;
@ -87,7 +82,7 @@ public class TYPEStmt implements StatementVisitor{
} }
@Override @Override
public void visit(Binary binary) { public void visit(BinaryExpr binary) {
throw new NotImplementedException(); throw new NotImplementedException();
} }
@ -212,6 +207,11 @@ public class TYPEStmt implements StatementVisitor{
} }
} }
@Override
public void visit(Literal literal) {
throw new NotImplementedException();
}
@Override @Override
public void visit(Return returnExpr) { public void visit(Return returnExpr) {
returnExpr.retexpr.accept(this); returnExpr.retexpr.accept(this);
@ -263,7 +263,11 @@ public class TYPEStmt implements StatementVisitor{
@Override @Override
public void visit(WhileStmt whileStmt) { public void visit(WhileStmt whileStmt) {
RefType booleanType = new RefType(ASTFactory.createClass(java.lang.Boolean.class).getClassName(), new NullToken()); RefType booleanType = new RefType(ASTFactory.createClass(java.lang.Boolean.class).getClassName(), new NullToken());
//Expression inferieren:
whileStmt.expr.accept(this);
//Expression muss boolean sein:
constraintsSet.addUndConstraint(new Pair(whileStmt.expr.getType(), booleanType, PairOperator.EQUALSDOT)); constraintsSet.addUndConstraint(new Pair(whileStmt.expr.getType(), booleanType, PairOperator.EQUALSDOT));
//LoopBlock inferieren:
whileStmt.loopBlock.accept(this); whileStmt.loopBlock.accept(this);
} }
@ -272,17 +276,6 @@ public class TYPEStmt implements StatementVisitor{
throw new NotImplementedException(); throw new NotImplementedException();
} }
@Override
public void visit(Null aNull) {
throw new NotImplementedException();
}
@Override
public void visit(Literal literal) {
//Hier gibt es nichts zu tun
//throw new NotImplementedException();
}
@Override @Override
public void visit(AssignToField assignLeftSide) { public void visit(AssignToField assignLeftSide) {
//Hier ist kein Code nötig. Es werden keine extra Constraints generiert //Hier ist kein Code nötig. Es werden keine extra Constraints generiert