forked from JavaTX/JavaCompilerCore
Break Class + Test
This commit is contained in:
parent
b88b9e2534
commit
881830235a
@ -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){
|
||||
|
24
src/de/dhbwstuttgart/syntaxtree/statement/BreakStmt.java
Normal file
24
src/de/dhbwstuttgart/syntaxtree/statement/BreakStmt.java
Normal 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) {
|
||||
}
|
||||
}
|
@ -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
|
||||
|
9
test/parser/BreakTest.jav
Normal file
9
test/parser/BreakTest.jav
Normal file
@ -0,0 +1,9 @@
|
||||
class BreakTest
|
||||
{
|
||||
void methode()
|
||||
{
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
14
test/parser/TryCatchTest.jav
Normal file
14
test/parser/TryCatchTest.jav
Normal file
@ -0,0 +1,14 @@
|
||||
class TryCatchTest
|
||||
{
|
||||
public void TryTest()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
}
|
||||
catch()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user