org.kiama.util

WhitespacePositionedParserUtilities

trait WhitespacePositionedParserUtilities extends WhitespaceParser with PositionedParserUtilities

Combination of positioned parsing utilities and whitespace handling with a parser.

Source
Positioned.scala
Linear Supertypes
PositionedParserUtilities, WhitespaceParser, ParserUtilities, PackratParsers, RegexParsers, Parsers, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. WhitespacePositionedParserUtilities
  2. PositionedParserUtilities
  3. WhitespaceParser
  4. ParserUtilities
  5. PackratParsers
  6. RegexParsers
  7. Parsers
  8. AnyRef
  9. Any
Visibility
  1. Public
  2. All

Type Members

  1. type Elem = Char

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

    Definition Classes
    Parsers
  3. abstract type _$4

    Definition Classes
    PackratParsers
  4. abstract type _$4

    Definition Classes
    PackratParsers
  5. abstract type _$4

    Definition Classes
    PackratParsers
  6. abstract type _$5

    Definition Classes
    PackratParsers
  7. abstract type _$5

    Definition Classes
    PackratParsers
  8. abstract type _$5

    Definition Classes
    PackratParsers
  9. abstract type _$6

    Definition Classes
    PackratParsers
  10. abstract type _$6

    Definition Classes
    PackratParsers
  11. abstract type _$6

    Definition Classes
    PackratParsers
  12. abstract type _$7

    Definition Classes
    PackratParsers
  13. abstract type _$7

    Definition Classes
    PackratParsers
  14. abstract type _$7

    Definition Classes
    PackratParsers
  15. abstract type _$8

    Definition Classes
    PackratParsers
  16. abstract type _$8

    Definition Classes
    PackratParsers
  17. abstract type _$8

    Definition Classes
    PackratParsers
  18. abstract type _$9

    Definition Classes
    PackratParsers
  19. abstract type _$9

    Definition Classes
    PackratParsers
  20. abstract type _$9

    Definition Classes
    PackratParsers

Abstract Value Members

  1. abstract val whitespaceParser: PackratParser[Any]

    A parser that recognises whitespace.

    A parser that recognises whitespace. Normal whitespace handling is turned off while this parser is applied, since we need to avoid an infinite recursion if the form of whitespace is defined using literal or regex.

    Attributes
    protected
    Definition Classes
    WhitespaceParser

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]

    As for Parser but for the non-backtracking version OnceParser.

    As for Parser but for the non-backtracking version OnceParser.

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

    Make a new parser that processes input according to f.

    Make a new parser that processes input according to f. If the result produced by f is Positioned, set its start and finish positions. If the parser is ignoring whitespace then the start position will be the first non-white character that was accepted.

    Definition Classes
    PositionedParserUtilities → 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. def any: PackratParser[Char]

    A parser that matches any element, failing if the end of input is reached.

    A parser that matches any element, failing if the end of input is reached.

    Definition Classes
    ParserUtilities
  15. final def asInstanceOf[T0]: T0

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

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

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

    Definition Classes
    Parsers
  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. implicit def constToTupleFunction2[A, B, R](r: (A, B) ⇒ R): (~[A, B]) ⇒ R

    Convenience conversion to allow arity two functions to be used directly in tree construction actions.

    Convenience conversion to allow arity two functions to be used directly in tree construction actions.

    Definition Classes
    ParserUtilities
  22. implicit def constToTupleFunction3[A, B, C, R](r: (A, B, C) ⇒ R): (~[~[A, B], C]) ⇒ R

    Convenience conversion to allow arity three functions to be used directly in tree construction actions.

    Convenience conversion to allow arity three functions to be used directly in tree construction actions.

    Definition Classes
    ParserUtilities
  23. implicit def constToTupleFunction4[A, B, C, D, R](r: (A, B, C, D) ⇒ R): (~[~[~[A, B], C], D]) ⇒ R

    Convenience conversion to allow arity four functions to be used directly in tree construction actions.

    Convenience conversion to allow arity four functions to be used directly in tree construction actions.

    Definition Classes
    ParserUtilities
  24. implicit def constToTupleFunction5[A, B, C, D, E, R](r: (A, B, C, D, E) ⇒ R): (~[~[~[~[A, B], C], D], E]) ⇒ R

    Convenience conversion to allow arity five functions to be used directly in tree construction actions.

    Convenience conversion to allow arity five functions to be used directly in tree construction actions.

    Definition Classes
    ParserUtilities
  25. implicit def constToTupleFunction6[A, B, C, D, E, F, R](r: (A, B, C, D, E, F) ⇒ R): (~[~[~[~[~[A, B], C], D], E], F]) ⇒ R

    Convenience conversion to allow arity six functions to be used directly in tree construction actions.

    Convenience conversion to allow arity six functions to be used directly in tree construction actions.

    Definition Classes
    ParserUtilities
  26. lazy val constrainedInt: PackratParser[Int]

    Parse digit strings that are constrained to fit into an Int value.

    Parse digit strings that are constrained to fit into an Int value. If the digit string is too big, a parse error results.

    Definition Classes
    ParserUtilities
  27. def elem(e: Elem): Parser[Elem]

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

    Definition Classes
    Parsers
  29. final def eq(arg0: AnyRef): Boolean

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

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

    Return an error after skipping white space.

    Return an error after skipping white space.

    Definition Classes
    ParserUtilities → Parsers
  32. def failure(msg: String): Parser[Nothing]

    Return a failure after skipping white space.

    Return a failure after skipping white space.

    Definition Classes
    ParserUtilities → Parsers
  33. def finalize(): Unit

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

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

    Definition Classes
    Parsers
  36. def handleWhiteSpace(in: Input): Int

    Version of handleWhiteSpace that accepts an Input value and skips over whitespace defined by the parser.

    Version of handleWhiteSpace that accepts an Input value and skips over whitespace defined by the parser. Used with PositionedParserUtilities so that correct positions are used.

    Definition Classes
    WhitespacePositionedParserUtilitiesParserUtilities
  37. def handleWhiteSpace(source: CharSequence, offset: Int): Int

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

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

    Definition Classes
    Any
  40. var lastNoSuccess: NoSuccess

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

    A parser that matches a literal string after skipping any whitespace that is parsed by whitespaceParser.

    A parser that matches a literal string after skipping any whitespace that is parsed by whitespaceParser.

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

    Definition Classes
    Parsers
  43. def memo[T](p: Parser[T]): PackratParser[T]

    Definition Classes
    PackratParsers
  44. def mkList[T]: (~[T, List[T]]) ⇒ List[T]

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

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

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

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

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

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

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

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

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

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

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

    Definition Classes
    RegexParsers
  56. def parseAndPosition[T](f: (Input) ⇒ ParseResult[T], in: Input): ParseResult[T]

    Run a parse function on some input and if the result is Positioned set its positions.

    Run a parse function on some input and if the result is Positioned set its positions.

    Definition Classes
    PositionedParserUtilities
  57. implicit def parseResultToTuple2[A, B](p: Parser[~[A, B]]): PackratParser[(A, B)]

    Convenience conversion to lift parsers that return 2-tilde-tuples to parsers that return regular 2-tuples.

    Convenience conversion to lift parsers that return 2-tilde-tuples to parsers that return regular 2-tuples.

    Definition Classes
    ParserUtilities
  58. implicit def parseResultToTuple3[A, B, C](p: Parser[~[~[A, B], C]]): PackratParser[(A, B, C)]

    Convenience conversion to lift parsers that return 3-tilde-tuples to parsers that return regular 3-tuples.

    Convenience conversion to lift parsers that return 3-tilde-tuples to parsers that return regular 3-tuples.

    Definition Classes
    ParserUtilities
  59. implicit def parseResultToTuple4[A, B, C, D](p: Parser[~[~[~[A, B], C], D]]): PackratParser[(A, B, C, D)]

    Convenience conversion to lift parsers that return 4-tilde-tuples to parsers that return regular 4-tuples.

    Convenience conversion to lift parsers that return 4-tilde-tuples to parsers that return regular 4-tuples.

    Definition Classes
    ParserUtilities
  60. implicit def parseResultToTuple5[A, B, C, D, E](p: Parser[~[~[~[~[A, B], C], D], E]]): PackratParser[(A, B, C, D, E)]

    Convenience conversion to lift parsers that return 5-tilde-tuples to parsers that return regular 5-tuples.

    Convenience conversion to lift parsers that return 5-tilde-tuples to parsers that return regular 5-tuples.

    Definition Classes
    ParserUtilities
  61. implicit def parseResultToTuple6[A, B, C, D, E, F](p: Parser[~[~[~[~[~[A, B], C], D], E], F]]): PackratParser[(A, B, C, D, E, F)]

    Convenience conversion to lift parsers that return 6-tilde-tuples to parsers that return regular 6-tuples.

    Convenience conversion to lift parsers that return 6-tilde-tuples to parsers that return regular 6-tuples.

    Definition Classes
    ParserUtilities
  62. def parseString[T](parser: Parser[T], str: String): Either[T, String]

    Use parser to parse the string str.

    Use parser to parse the string str. If the parse is sucessful and produces the value t, return Left (t). Otherwise, return Right (msg) where msg is the mesage produced by the parser.

    Definition Classes
    ParserUtilities
  63. def parseWhitespace(in: Input): ParseResult[Any]

    If we are parsing whitespace already, fail if we are the end of the input, otherwise succeed with no progress.

    If we are parsing whitespace already, fail if we are the end of the input, otherwise succeed with no progress. If we are not already parsing whitespace, then apply the whitespace parser, swallowing any errors from it unless they occur at the end of the input. In other words, an error not at the end is treated as the absence of whitespace.

    Attributes
    protected
    Definition Classes
    WhitespaceParser
  64. implicit def parser2packrat[T](p: ⇒ Parser[T]): PackratParser[T]

    Definition Classes
    PackratParsers
  65. var parsingWhitespace: Boolean

    Are we currently parsing whitespace?

    Are we currently parsing whitespace?

    Attributes
    protected
    Definition Classes
    WhitespaceParser
  66. def phrase[T](p: Parser[T]): PackratParser[T]

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

    As for positioned in RegexParsers, but uses parseWhitespace to skip whitespace.

    As for positioned in RegexParsers, but uses parseWhitespace to skip whitespace.

    Definition Classes
    WhitespaceParser → RegexParsers → Parsers
  68. implicit def regex(r: Regex): Parser[String]

    A parser that matches a regex string after skipping any whitespace that is parsed by whitespaceParser.

    A parser that matches a regex string after skipping any whitespace that is parsed by whitespaceParser.

    Definition Classes
    WhitespaceParser → RegexParsers
  69. def regexnows(r: Regex): Parser[String]

    Create a parser that matches a regex string, but doesn't skip whitespace first.

    Create a parser that matches a regex string, but doesn't skip whitespace first. This operation is useful if you want to recognise parts of a lexical symbol with different regular expressions so you can use the parts separately. Otherwise you have to parse with one regex and then split the resulting string to get at its parts. Based on RegexParser.regex in the Scala library.

    Definition Classes
    ParserUtilities
  70. def rep[T](p: ⇒ Parser[T]): Parser[List[T]]

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

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

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

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

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

    Definition Classes
    Parsers
  76. def result[T](v: ⇒ T): Parser[T]

    Construct a parser that always succeeds and returns value v.

    Construct a parser that always succeeds and returns value v. See also the success combinator in the Scala library that does something similar but always returns the same value each time since the parameter is not passed by name.

    Definition Classes
    ParserUtilities
  77. def skipWhitespace: Boolean

    Definition Classes
    WhitespaceParser → RegexParsers
  78. def stringToInt(s: String): Either[Int, String]

    Convert the digit string s to an Int if it's in range, but return an error message if it's too big.

    Convert the digit string s to an Int if it's in range, but return an error message if it's too big.

    Definition Classes
    ParserUtilities
  79. def success[T](v: T): Parser[T]

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

    Definition Classes
    AnyRef
  81. def toString(): String

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

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

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

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

    Attributes
    protected
    Definition Classes
    RegexParsers
  86. def wrap[T, U](p: ⇒ Parser[T], f: (T) ⇒ Either[U, String]): Parser[U]

    Wrap a parser p that produces a value of type T to produce a parser returning values of type U.

    Wrap a parser p that produces a value of type T to produce a parser returning values of type U. Whitespace is skipped (if we are skipping white space) before p is applied, so that we have access to the first non-whitespace position.

    The function f is responsible for converting the T value into either a U value or a string that indicates what went wrong. In the latter case, the resulting parser will error at the original position with the message, ignoring any other errors at that position. Failures or errors of p will be lifted to the returned type.

    Definition Classes
    ParserUtilities

Inherited from PositionedParserUtilities

Inherited from WhitespaceParser

Inherited from ParserUtilities

Inherited from PackratParsers

Inherited from RegexParsers

Inherited from Parsers

Inherited from AnyRef

Inherited from Any