do statement implemented

This commit is contained in:
FelixKrespach 2017-08-17 15:30:57 +02:00
parent 856f9b059d
commit a9c49676a9
3 changed files with 25 additions and 3 deletions

View File

@ -344,8 +344,9 @@ public class StatementGenerator {
}
private Statement convert(Java8Parser.DoStatementContext stmt){
//TODO
throw new NotImplementedException();
Statement block = convert(stmt.statement());
Expression expr = convert(stmt.expression());
return new DoStmt(expr,block,stmt.getStart());
}
private Statement convert(Java8Parser.ForStatementContext stmt){

View File

@ -0,0 +1,16 @@
package de.dhbwstuttgart.syntaxtree.statement;
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
import org.antlr.v4.runtime.Token;
/**
* Created by Felix_K on 17.08.2017.
*/
public class DoStmt extends WhileStmt
{
public DoStmt(Expression expr, Statement loopBlock, Token offset)
{
super(expr, loopBlock, offset);
}
}

View File

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