do statement implemented
This commit is contained in:
parent
856f9b059d
commit
a9c49676a9
@ -344,8 +344,9 @@ public class StatementGenerator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Statement convert(Java8Parser.DoStatementContext stmt){
|
private Statement convert(Java8Parser.DoStatementContext stmt){
|
||||||
//TODO
|
Statement block = convert(stmt.statement());
|
||||||
throw new NotImplementedException();
|
Expression expr = convert(stmt.expression());
|
||||||
|
return new DoStmt(expr,block,stmt.getStart());
|
||||||
}
|
}
|
||||||
|
|
||||||
private Statement convert(Java8Parser.ForStatementContext stmt){
|
private Statement convert(Java8Parser.ForStatementContext stmt){
|
||||||
|
16
src/de/dhbwstuttgart/syntaxtree/statement/DoStmt.java
Normal file
16
src/de/dhbwstuttgart/syntaxtree/statement/DoStmt.java
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
@ -1,7 +1,12 @@
|
|||||||
class WhileTest{
|
class WhileTest{
|
||||||
void methode(){
|
void methode(){
|
||||||
Boolean test;
|
Boolean test;
|
||||||
while(test){
|
do{
|
||||||
|
test=test;
|
||||||
|
}while(test);
|
||||||
|
|
||||||
|
|
||||||
|
while(test){
|
||||||
test = test;
|
test = test;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user