package io.lp0onfire.smtnes.smt2;

import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;

public class ExpressionList extends SExpression {

  private final List<SExpression> exprs;
  public List<SExpression> getExprs() {
    return this.exprs;
  }
  
  public ExpressionList(SExpression... values) {
    exprs = new LinkedList<SExpression>(Arrays.asList(values));
  }
  
  public ExpressionList(List<SExpression> values) {
    exprs = new LinkedList<SExpression>(values);
  }
  
  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("(");
    for (SExpression expr : exprs) {
      sb.append(" ");
      sb.append(expr.toString());
    }
    sb.append(" )");
    return sb.toString();
  }
  
}

@@ -325,126 +325,666 @@
     
-exprs = new LinkedList%3CSExpression%3E(Arrays.asList(values));%0A  %7D%0A  %0A  public ExpressionList(List%3CSExpression%3E values) %7B
+if (values == null) %7B%0A      throw new NullPointerException(%22null subexpression in ExpressionList%22);%0A    %7D%0A    for (SExpression value : values) %7B%0A      if (value == null) %7B%0A        throw new NullPointerException(%22null subexpression in ExpressionList%22);%0A      %7D%0A    %7D%0A    exprs = new LinkedList%3CSExpression%3E(Arrays.asList(values));%0A  %7D%0A  %0A  public ExpressionList(List%3CSExpression%3E values) %7B%0A    if (values == null) %7B%0A      throw new NullPointerException(%22null subexpression in ExpressionList%22);%0A    %7D%0A    for (SExpression value : values) %7B%0A      if (value == null) %7B%0A        throw new NullPointerException(%22null subexpression in ExpressionList%22);%0A      %7D%0A    %7D
 %0A   

check that arguments to ExpressionList are not null