org.bitbucket.inkytonik.kiama.util

CompilerBase

trait CompilerBase[T, C <: Config] extends PositionStore with Messaging with Profiler

Trait to provide basic functionality for a compiler-like program constructed from phases, including profiling and timing support. T is the type of the syntax tree communicated from the parser to the main processing of the compiler. C is the type of the configuration.

Source
Compiler.scala
Linear Supertypes
Profiler, dsprofile.Profiler, Values, Messaging, PositionStore, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. CompilerBase
  2. Profiler
  3. Profiler
  4. Values
  5. Messaging
  6. PositionStore
  7. AnyRef
  8. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. case class Child(i: Int) extends Step with Product with Serializable

    A step to child i of the current node, counting from zero.

  2. case class Dep(step: Step, tipe: Value, attribute: Value) extends Product with Serializable

    Dependence record saying that the source attribute depends on attribute of a node with type type that is the given step away.

  3. case class Record extends Product with Serializable

    Definition Classes
    Values
  4. abstract class Step extends AnyRef

    A single step in the evaluation of an attribute.

Abstract Value Members

  1. abstract def createConfig(args: Seq[String]): C

    Create the configuration for a particular run of the compiler.

    Create the configuration for a particular run of the compiler. Override this if you have a custom configuration for your compiler.

  2. abstract def format(ast: T): Document

    Format an abstract syntax tree for printing.

    Format an abstract syntax tree for printing. Default: return an empty document.

  3. abstract def makeast(source: Source, config: C): Either[T, Messages]

    Make the contents of the given source, returning the AST wrapped in Left.

    Make the contents of the given source, returning the AST wrapped in Left. Return Right with messages if an AST cannot be made. config provides access to all aspects of the configuration.

  4. abstract def process(source: Source, ast: T, config: C): Unit

    Function to process the input that was parsed.

    Function to process the input that was parsed. source is the input text processed by the compiler. ast is the abstract syntax tree produced by the parser from that text. config provides access to all aspects of the configuration.

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. object Next extends Step with Product with Serializable

    A step to the previous node in a sequence.

  7. object Other extends Step with Product with Serializable

    A step to a node that doesn't fit into any of the other categories.

  8. object Parent extends Step with Product with Serializable

    A step to the parent of the current node.

  9. object Prev extends Step with Product with Serializable

    A step to the previous node in a sequence.

  10. object Self extends Step with Product with Serializable

    A step nowhere.

  11. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  12. def checkFor(record: Record, dim: Dimension, eventtype: String, needed: Dimension)(f: (Value) ⇒ Value): Value

    Definition Classes
    Values
  13. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  14. def column(message: Message): Option[Int]

    Return the optional column number of a message.

    Return the optional column number of a message.

    Definition Classes
    Messaging
  15. def createAndInitConfig(args: Seq[String]): C

    Create and initialise the configuration for a particular run of the compiler.

    Create and initialise the configuration for a particular run of the compiler. Default: call createConfig and then initialise the resulting configuration.

  16. def dimValue(record: Record, dim: Dimension): Value

    Support Kiama-specific profiling dimensions.

    Support Kiama-specific profiling dimensions.

    Definition Classes
    Profiler → Profiler → Values
  17. def driver(args: Seq[String]): Unit

    Driver for this compiler.

    Driver for this compiler. First, use the argument list to create a configuration for this execution. Then, use the configuration to run the file processing in the appropriate way.

  18. def encoding: String

    The character encoding of input files read by this compiler.

    The character encoding of input files read by this compiler. Defaults to UTF-8.

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

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  22. def finishReport(): Unit

    Definition Classes
    Values
  23. def formatMessage(message: Message): String

    Format the message for reporting as a line containing the position and label, the input text line and line(s) containing the context of the position.

    Format the message for reporting as a line containing the position and label, the input text line and line(s) containing the context of the position. If no position is associated with this message just format as a line containing the label.

    Definition Classes
    Messaging
  24. def formatMessages(messages: Messages): String

    Return a string containing all the given messages sorted and formatted.

    Return a string containing all the given messages sorted and formatted.

    Definition Classes
    Messaging
  25. final def getClass(): Class[_]

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

    Definition Classes
    AnyRef → Any
  27. def includeTimings: Boolean

    Definition Classes
    Profiler
  28. def isEventType(record: Record, eventtype: String): Boolean

    Definition Classes
    Values
  29. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  30. def line(message: Message): Option[Int]

    Return the optional line number of a message.

    Return the optional line number of a message.

    Definition Classes
    Messaging
  31. def main(args: Array[String]): Unit

    The entry point for this compiler.

  32. implicit object messageOrdering extends Ordering[Message]

    An ordering on messages that prioritises line over column.

  33. def nanoToMs(nano: Long): Long

    Definition Classes
    Profiler
  34. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  37. def output(str: String): Unit

    Definition Classes
    Values
  38. def outputln(str: String): Unit

    Definition Classes
    Values
  39. def parseProfileOption(value: String): Seq[Dimension]

    Definition Classes
    Profiler
  40. def percent(v: Long, total: Long): String

    Definition Classes
    Profiler
  41. def positionOf(message: Message): Option[Position]

    A message's starting position as determined from the starting position of the message's value.

    A message's starting position as determined from the starting position of the message's value. Will be None if the value has no position.

    Definition Classes
    Messaging
  42. val positions: Positions

    Definition Classes
    PositionStore
  43. def printDependencyGraph(record: Record, dim: Dimension): Unit

    Print the dependency graph for the attribute evaluation represented by record.

    Print the dependency graph for the attribute evaluation represented by record. The output is in dot form.

    Definition Classes
    Profiler
  44. def printReports(totalTime: Long, dimensionNames: Seq[Dimension], records: List[Record]): Unit

    Definition Classes
    Profiler
  45. var printTables: Boolean

    Definition Classes
    Values
  46. def processfile(filename: String, config: C): Unit

    Process a file argument by using makeast to turn their contents into abstract syntax trees (ASTs) and then by process which conducts arbitrary processing on the ASTs.

    Process a file argument by using makeast to turn their contents into abstract syntax trees (ASTs) and then by process which conducts arbitrary processing on the ASTs. The character encoding of the files is given by the encoding method.

  47. def processfiles(config: C): Unit

    Process the files one by one.

  48. def profile[T](computation: ⇒ T, dimensionNames: Seq[Dimension], logging: Boolean): T

    Definition Classes
    Profiler
  49. def profileStart(logging: Boolean): Unit

    Definition Classes
    Profiler
  50. def profileStop(): (Seq[Dimension]) ⇒ Unit

    Definition Classes
    Profiler
  51. def profileStop(dimensionNames: Seq[Dimension]): Unit

    Definition Classes
    Profiler
  52. def profileStopInteractive(): Unit

    Definition Classes
    Profiler
  53. def report(messages: Messages, emitter: Emitter = new OutputEmitter): Unit

    Output the messages in order of position using the given emitter, which defaults to terminal output.

    Output the messages in order of position using the given emitter, which defaults to terminal output.

    Definition Classes
    Messaging
  54. def startReport(dimensionNames: Seq[Dimension]): Unit

    Take any actions that need to be done at the start of reporting.

    Take any actions that need to be done at the start of reporting.

    Definition Classes
    Profiler → Values
  55. var startTime: Long

    Definition Classes
    Profiler
  56. def summariseAlongDims(dimensionNames: Seq[Dimension], records: List[Record], nrecords: Int, profiledTime: Long): Unit

    Definition Classes
    Profiler
  57. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  58. def time[T](computation: ⇒ T, warmup: Int, n: Int, discard: Int): Unit

    Definition Classes
    Profiler
  59. def toString(): String

    Definition Classes
    AnyRef → Any
  60. def trace(predicate: (Event) ⇒ Boolean): Unit

    Definition Classes
    Profiler
  61. def valueToString(a: Value): String

    Definition Classes
    Values
  62. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Profiler

Inherited from dsprofile.Profiler

Inherited from Values

Inherited from Messaging

Inherited from PositionStore

Inherited from AnyRef

Inherited from Any

Ungrouped