Module dev.civl.abc

Interface EntityFactory


public interface EntityFactory
A factory for producing instances of Entity, and some related utility methods.
  • Method Details

    • newScope

      Scope newScope(Scope.ScopeKind kind, Scope parent, ASTNode root)
      Creates a new scope.
      Parameters:
      kind - the kind of scope to create
      parent - the scope immediately containing the new scope; can be null for the root scope
      root - an AST node to associate to the new scope; it is used only for printing to make it easy for the reader to identify where the scope comes from
      Returns:
      the new Scope
    • newVariable

      Variable newVariable(String name, ProgramEntity.LinkageKind linkage, Type type)
      Creates a new Variable.
      Parameters:
      name - the name of the variable
      linkage - the kind of linkage the variable has
      type - the type of the variable
      Returns:
      the new variable
    • newFunction

      Function newFunction(String name, ProgramEntity.LinkageKind linkage, Type type)
      Creates a new Function.
      Parameters:
      name - the name of the function
      linkage - the kind of linkage the function has
      type - the type of the function
      Returns:
      the new function
    • newTypedef

      Typedef newTypedef(String name, Type type)
      Creates a new Typedef entity.
      Parameters:
      name - the name of the typedef
      type - the type to which the name is bound in the typedef
      Returns:
      the new Typedef entity
    • newLabel

      Label newLabel(OrdinaryLabelNode declaration)
      Creates a new label entity. This corresponds to an ordinary label "declaration" in the code. (The name of the label is followed by a colon and then a statement.)
      Parameters:
      declaration - the ordinary label declaration
      Returns:
      the new label entity
    • join

      Scope join(Scope s1, Scope s2)
      Computes the join of the two scopes in the scope tree and returns it.
      Parameters:
      s1 - non-null scope
      s2 - non-null scope
      Returns:
      the youngest common ancestor of s1 and s2
    • newBehavior

      BehaviorEntity newBehavior(String name, BehaviorNode behavior)
      Creates a new behavior entity.
      Parameters:
      name -
      behavior -
      Returns: