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)
{
/*
if (stmt.expression().size()<2)
{
Expression expr = convert(stmt.expression(0));
@ -334,7 +335,9 @@ public class StatementGenerator {
Expression expr2 = convert(stmt.expression(1));
return new AssertStmt(expr1,expr2,stmt.getStart());
}
*/
//TODO: Check Felix_K
throw new NotImplementedException();
}
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);
out.append("\nelse");
ifStmt.else_block.accept(this);
//TODO Felix_K
}
@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,16 +1,17 @@
class WhileTest
{
void methode(){
Boolean test;
do
void methode()
{
test=test;
}while(test);
Boolean test;
do
{
test=test;
}while(test);
while(test){
test = test;
}
return;
while(test)
{
test = test;
}
}
}