package de.dhbwstuttgart.syntaxtree.statement;
import java.util.*;

import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
import de.dhbwstuttgart.typeinference.assumptions.TypeInferenceBlockInformation;
import de.dhbwstuttgart.typeinference.constraints.ConstraintSet;
import org.antlr.v4.runtime.Token;


public class Block extends Statement
{
    public Block(List<Statement> statements, Token offset) {
		super(TypePlaceholder.fresh(offset), offset);
		this.statements = statements;
	}


    
    public List<Statement> statements = new ArrayList<>();

    public List<Statement> getStatements()
    {
        return statements;
    }

    @Override
    public ConstraintSet getConstraints(TypeInferenceBlockInformation info) {
        ConstraintSet ret = new ConstraintSet();
        for(Statement stmt : getStatements()){
            ret.addAll(stmt.getConstraints(info));
        }
        return ret;
    }
}


