org.kiama.util

CompilerBase

trait CompilerBase[T] extends AnyRef

Trait to provide basic functionality for a compiler-like program constructed from phases.

Source
Compiler.scala
Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. CompilerBase
  2. AnyRef
  3. Any
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def makeast(reader: Reader, filename: String, emitter: Emitter): Either[T, String]

    Make an AST from the file with the given name, returning it wrapped in Left.

    Make an AST from the file with the given name, returning it wrapped in Left. Returns Right with an error message if an AST cannot be made.

  2. abstract def process(ast: T, console: Console, emitter: Emitter): Boolean

    Function to process the input that was parsed.

    Function to process the input that was parsed. console should be used to read anything needed by the processing. emitter should be used for output. Return true if everything worked, false otherwise. If false is returned, messages about the problem should be logged by process using the messaging facility.

Concrete Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def checkargs(args: Array[String], emitter: Emitter): Array[String]

    Process the command-line arguments.

    Process the command-line arguments. Returns the arguments that have not been processed. Output should be emitted using the provided Emitter. Default: do no processing.

  8. def clone(): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  9. def compile(args: Array[String], console: Console): String

    Run the driver using the given args and return the resulting output, which may be error messages or the result of running the compiled program, for example.

    Run the driver using the given args and return the resulting output, which may be error messages or the result of running the compiled program, for example. Read standard input from the specified console. Reset the message buffer before calling the driver.

  10. def driver(args: Array[String], console: Console, emitter: Emitter): Unit

    Process the arguments, using the given console for input and the given emitter for output.

    Process the arguments, using the given console for input and the given emitter for output. The arguments are first processed by checkargs. Any remaining arguments are interpreted as names of UTF-8 encoded files which are processed in turn by using makeast to turn their contents into abstract syntax trees (ASTs) and then by process which conducts arbitrary processing on the ASTs.

  11. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  14. final def getClass(): java.lang.Class[_]

    Definition Classes
    AnyRef → Any
  15. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  16. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  17. def main(args: Array[String]): Unit

    Process the program in the file given as the first command-line argument, read input using JLine input editing, and emit output to the standard output.

  18. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  19. final def notify(): Unit

    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  21. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  22. def toString(): String

    Definition Classes
    AnyRef → Any
  23. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  24. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  25. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from AnyRef

Inherited from Any