org.kiama.util

Compiler

trait Compiler[T <: Attributable] extends RegexCompiler[T]

A compiler that uses RegexParser to produce Attributable ASTs. The AST is initialised with initTree by process. Override it and call it before performing specific attribution.

Source
Compiler.scala
Linear Supertypes
RegexCompiler[T], RegexParsers, Parsers, CompilerBase[T], AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. Compiler
  2. RegexCompiler
  3. RegexParsers
  4. Parsers
  5. CompilerBase
  6. AnyRef
  7. Any
Visibility
  1. Public
  2. All

Type Members

  1. type Elem = Char

    Definition Classes
    RegexParsers → Parsers
  2. type Input = Reader[Elem]

    Definition Classes
    Parsers

Abstract Value Members

  1. abstract def parser: Parser[T]

    The actual parser used to produce the AST.

    The actual parser used to produce the AST.

    Definition Classes
    RegexCompiler

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. def OnceParser[T](f: (Input) ⇒ ParseResult[T]): Parser[T] with OnceParser[T]

    Definition Classes
    Parsers
  7. def Parser[T](f: (Input) ⇒ ParseResult[T]): Parser[T]

    Definition Classes
    Parsers
  8. def accept[U](expected: String, f: PartialFunction[Elem, U]): Parser[U]

    Definition Classes
    Parsers
  9. def accept[ES](es: ES)(implicit arg0: (ES) ⇒ List[Elem]): Parser[List[Elem]]

    Definition Classes
    Parsers
  10. implicit def accept(e: Elem): Parser[Elem]

    Definition Classes
    Parsers
  11. def acceptIf(p: (Elem) ⇒ Boolean)(err: (Elem) ⇒ String): Parser[Elem]

    Definition Classes
    Parsers
  12. def acceptMatch[U](expected: String, f: PartialFunction[Elem, U]): Parser[U]

    Definition Classes
    Parsers
  13. def acceptSeq[ES](es: ES)(implicit arg0: (ES) ⇒ Iterable[Elem]): Parser[List[Elem]]

    Definition Classes
    Parsers
  14. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  15. def chainl1[T, U](first: ⇒ Parser[T], p: ⇒ Parser[U], q: ⇒ Parser[(T, U) ⇒ T]): Parser[T]

    Definition Classes
    Parsers
  16. def chainl1[T](p: ⇒ Parser[T], q: ⇒ Parser[(T, T) ⇒ T]): Parser[T]

    Definition Classes
    Parsers
  17. def chainr1[T, U](p: ⇒ Parser[T], q: ⇒ Parser[(T, U) ⇒ U], combine: (T, U) ⇒ U, first: U): Parser[U]

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

    Entry point for standard compiler framework.

    Entry point for standard compiler framework. All command-line argumnents, a JLine console for input editing and a new emitter to standard output are passed to driver.

    Definition Classes
    CompilerBase
  19. def clone(): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  20. def commit[T](p: ⇒ Parser[T]): Parser[T]

    Definition Classes
    Parsers
  21. 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.

    Definition Classes
    CompilerBase
  22. 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 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. The character encoding of the files is given by the encoding method.

    Definition Classes
    CompilerBase
  23. def elem(e: Elem): Parser[Elem]

    Definition Classes
    Parsers
  24. def elem(kind: String, p: (Elem) ⇒ Boolean): Parser[Elem]

    Definition Classes
    Parsers
  25. 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.

    Definition Classes
    CompilerBase
  26. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  28. def err(msg: String): Parser[Nothing]

    Definition Classes
    Parsers
  29. def failure(msg: String): Parser[Nothing]

    Definition Classes
    Parsers
  30. def finalize(): Unit

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

    Definition Classes
    AnyRef → Any
  32. def guard[T](p: ⇒ Parser[T]): Parser[T]

    Definition Classes
    Parsers
  33. def handleWhiteSpace(source: CharSequence, offset: Int): Int

    Attributes
    protected
    Definition Classes
    RegexParsers
  34. def hashCode(): Int

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

    Definition Classes
    Any
  36. var lastNoSuccess: NoSuccess

    Definition Classes
    Parsers
  37. implicit def literal(s: String): Parser[String]

    Definition Classes
    RegexParsers
  38. def log[T](p: ⇒ Parser[T])(name: String): Parser[T]

    Definition Classes
    Parsers
  39. 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.

    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.

    Definition Classes
    CompilerBase
  40. 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.

    Definition Classes
    RegexCompilerCompilerBase
  41. def mkList[T]: (~[T, List[T]]) ⇒ List[T]

    Definition Classes
    Parsers
  42. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  43. def not[T](p: ⇒ Parser[T]): Parser[Unit]

    Definition Classes
    Parsers
  44. final def notify(): Unit

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

    Definition Classes
    AnyRef
  46. def opt[T](p: ⇒ Parser[T]): Parser[Option[T]]

    Definition Classes
    Parsers
  47. def parse[T](p: Parser[T], in: Reader): ParseResult[T]

    Definition Classes
    RegexParsers
  48. def parse[T](p: Parser[T], in: CharSequence): ParseResult[T]

    Definition Classes
    RegexParsers
  49. def parse[T](p: Parser[T], in: Reader[Char]): ParseResult[T]

    Definition Classes
    RegexParsers
  50. def parseAll[T](p: Parser[T], in: CharSequence): ParseResult[T]

    Definition Classes
    RegexParsers
  51. def parseAll[T](p: Parser[T], in: Reader): ParseResult[T]

    Definition Classes
    RegexParsers
  52. def parseAll[T](p: Parser[T], in: Reader[Char]): ParseResult[T]

    Definition Classes
    RegexParsers
  53. def phrase[T](p: Parser[T]): Parser[T]

    Definition Classes
    RegexParsers → Parsers
  54. def positioned[T <: Positional](p: ⇒ Parser[T]): Parser[T]

    Definition Classes
    RegexParsers → Parsers
  55. 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.

    Definition Classes
    CompilerCompilerBase
  56. implicit def regex(r: Regex): Parser[String]

    Definition Classes
    RegexParsers
  57. def rep[T](p: ⇒ Parser[T]): Parser[List[T]]

    Definition Classes
    Parsers
  58. def rep1[T](first: ⇒ Parser[T], p0: ⇒ Parser[T]): Parser[List[T]]

    Definition Classes
    Parsers
    Annotations
    @migration
    Migration

    (Changed in version 2.9.0) The p0 call-by-name arguments is evaluated at most once per constructed Parser object, instead of on every need that arises during parsing.

  59. def rep1[T](p: ⇒ Parser[T]): Parser[List[T]]

    Definition Classes
    Parsers
  60. def rep1sep[T](p: ⇒ Parser[T], q: ⇒ Parser[Any]): Parser[List[T]]

    Definition Classes
    Parsers
  61. def repN[T](num: Int, p: ⇒ Parser[T]): Parser[List[T]]

    Definition Classes
    Parsers
  62. def repsep[T](p: ⇒ Parser[T], q: ⇒ Parser[Any]): Parser[List[T]]

    Definition Classes
    Parsers
  63. def skipWhitespace: Boolean

    Definition Classes
    RegexParsers
  64. def success[T](v: T): Parser[T]

    Definition Classes
    Parsers
  65. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  66. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()
  70. val whiteSpace: Regex

    Attributes
    protected
    Definition Classes
    RegexParsers

Inherited from RegexCompiler[T]

Inherited from RegexParsers

Inherited from Parsers

Inherited from CompilerBase[T]

Inherited from AnyRef

Inherited from Any