Programming-Language-Design / src / ast / Program.java
Program.java
Raw
package ast;

import ast.definition.Definition;
import visitor.Visitor;

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

public class Program extends AbstractASTNode {
    private List<Definition> definitions;

    public Program(int line, int column, List<Definition> definition) {
        super(line, column);
        this.definitions = new ArrayList<>(definition);
    }

    @Override
    public <TP, TR> TR accept(Visitor<TP, TR> v, TP param) {
        return v.visit(this, param);
    }

    public List<Definition> getDefinitions() {
        return definitions;
    }
}