WorklistAlgorithm

dotty.tools.backend.WorklistAlgorithm

Simple implementation of a worklist algorithm. A processing function is applied repeatedly to the first element in the worklist, as long as the stack is not empty.

The client class should mix-in this class and initialize the worklist field and define the processElement method. Then call the run method providing a function that initializes the worklist.

Attributes

Authors:

Martin Odersky

See also

scala.tools.nsc.backend.icode.Linearizers

Version

1.0

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Type members

Classlikes

class WList

Attributes

Supertypes
class Object
trait Matchable
class Any

Types

type Elem

Value members

Abstract methods

def dequeue: Elem

Remove and return the first element to be processed from the worklist.

Remove and return the first element to be processed from the worklist.

Attributes

Process the current element from the worklist.

Process the current element from the worklist.

Attributes

Concrete methods

def run(initWorklist: => Unit): Unit

Run the iterative algorithm until the worklist remains empty. The initializer is run once before the loop starts and should initialize the worklist.

Run the iterative algorithm until the worklist remains empty. The initializer is run once before the loop starts and should initialize the worklist.

Attributes

Abstract fields