All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.fulib.scenarios.ast.scope.Scope Maven / Gradle / Ivy

package org.fulib.scenarios.ast.scope;

import org.fulib.scenarios.ast.decl.Decl;
import org.fulib.scenarios.diagnostic.Marker;

import java.util.function.BiConsumer;
import java.util.function.Function;

public interface Scope
{
   Decl resolve(String name);

   void list(BiConsumer consumer);

   default  T resolve(String name, Class type, Function create)
   {
      final Decl own = this.resolve(name);
      if (type.isInstance(own))
      {
         return (T) own;
      }

      throw new UnsupportedOperationException("create");
   }

   void report(Marker marker);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy