Break Class + Test

This commit is contained in:
FelixKrespach 2017-09-22 14:49:43 +02:00
parent b88b9e2534
commit 881830235a
6 changed files with 62 additions and 9 deletions

View File

@ -324,6 +324,7 @@ public class StatementGenerator {
private Statement convert(Java8Parser.AssertStatementContext stmt) private Statement convert(Java8Parser.AssertStatementContext stmt)
{ {
/*
if (stmt.expression().size()<2) if (stmt.expression().size()<2)
{ {
Expression expr = convert(stmt.expression(0)); Expression expr = convert(stmt.expression(0));
@ -334,7 +335,9 @@ public class StatementGenerator {
Expression expr2 = convert(stmt.expression(1)); Expression expr2 = convert(stmt.expression(1));
return new AssertStmt(expr1,expr2,stmt.getStart()); return new AssertStmt(expr1,expr2,stmt.getStart());
} }
*/
//TODO: Check Felix_K //TODO: Check Felix_K
throw new NotImplementedException();
} }
private Statement convert(Java8Parser.SwitchStatementContext stmt){ private Statement convert(Java8Parser.SwitchStatementContext stmt){

View File

@ -0,0 +1,24 @@
package de.dhbwstuttgart.syntaxtree.statement;
import com.sun.scenario.effect.Offset;
import de.dhbwstuttgart.syntaxtree.StatementVisitor;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
import org.antlr.v4.runtime.Token;
import org.antlr.v4.runtime.tree.TerminalNode;
/**
* Created by Felix_K on 20.09.2017.
*/
public class BreakStmt extends Statement
{
public final TerminalNode indentifier;
public BreakStmt(RefTypeOrTPHOrWildcardOrGeneric type, TerminalNode Indentifier, Token offset)
{
super(type, offset);
this.indentifier=Indentifier;
}
@Override
public void accept(StatementVisitor visitor) {
}
}

View File

@ -237,6 +237,8 @@ public class OutputGenerator implements ASTVisitor {
ifStmt.then_block.accept(this); ifStmt.then_block.accept(this);
out.append("\nelse"); out.append("\nelse");
ifStmt.else_block.accept(this); ifStmt.else_block.accept(this);
//TODO Felix_K
} }
@Override @Override

View File

@ -0,0 +1,9 @@
class BreakTest
{
void methode()
{
break;
}
}

View File

@ -0,0 +1,14 @@
class TryCatchTest
{
public void TryTest()
{
try
{
}
catch()
{
}
}
}

View File

@ -1,6 +1,7 @@
class WhileTest class WhileTest
{ {
void methode(){ void methode()
{
Boolean test; Boolean test;
do do
{ {
@ -8,9 +9,9 @@ class WhileTest
}while(test); }while(test);
while(test){ while(test)
{
test = test; test = test;
} }
return;
} }
} }