package de.dhbwstuttgart.syntaxtree;

import java.util.ArrayList;
import java.util.List;

import org.antlr.v4.runtime.Token;

import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;

public class RecordPattern extends FormalParameter {

  private final List<Pattern> subPattern;

  public RecordPattern(String name, RefTypeOrTPHOrWildcardOrGeneric type, Token offset) {
    super(name, type, offset);
    subPattern = new ArrayList<>();
  }

  public RecordPattern(List<Pattern> subPattern, String name, RefTypeOrTPHOrWildcardOrGeneric type, Token offset) {
    super(name, type, offset);
    this.subPattern = subPattern;
  }

  public List<Pattern> getSubPattern() {
    return this.subPattern;
  }

  @Override
  public void accept(ASTVisitor visitor) {
    visitor.visit(this);
  }

}