class Environment {

    public List<Declaration> lookupFunctionDeclaration(String name) {
        List<Declaration> declarations = lookupLocalFunctionDeclaration(name);
        if (declarations == null) {
            declarations = new ArrayList<>();
        }
        Environment environment = this.parent;
        while (environment != null) {
            List<Declaration> parentDeclarations = environment.lookupLocalFunctionDeclaration(name);
            if (parentDeclarations != null) {
                declarations.addAll(parentDeclarations);
            }
            environment = environment.parent;
        }
        return declarations;
    }

      Environment();
      Environment(Environment parent);
      Environment(Environment parent, Expression inputExpression);

}