trait ParserMain extends AnyRef
- Alphabetic
- By Inheritance
- ParserMain
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
apply[T](p: Parser[T])(s: String): Parser[T]
Applies parser
p
to inputs
. -
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
charClass(f: (Char) ⇒ Boolean, label: String = "<unspecified>"): Parser[Char]
Defines a Parser that parses a single character only if the predicate
f
returns true for that character.Defines a Parser that parses a single character only if the predicate
f
returns true for that character. If this parser fails,label
is used as the failure message. -
def
chars(legal: String): Parser[Char]
Defines a Parser that parses a single character only if it is contained in
legal
. -
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
completions(p: Parser[_], s: String, level: Int): Completions
Applies parser
p
to inputs
and returns the completions at verbositylevel
.Applies parser
p
to inputs
and returns the completions at verbositylevel
. The interpretation oflevel
is up to parser definitions, but 0 is the default by convention, with increasing positive numbers corresponding to increasing verbosity. Typically no more than a few levels are defined. -
def
derive1[T](p: Parser[T], c: Char): Parser[T]
Applies parser
p
to a single character of input. -
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
examples[A](a: Parser[A], completions: ExampleSource, maxNumberOfExamples: Int, removeInvalidExamples: Boolean): Parser[A]
- A
the type of values that are returned by the parser.
- a
the parser to decorate with a source of examples. All validation and parsing is delegated to this parser, only Parser.completions is modified.
- completions
the source of examples when displaying completions to the user.
- maxNumberOfExamples
limits the number of examples that the source of examples should return. This can prevent lengthy pauses and avoids bad interactive user experience.
- removeInvalidExamples
indicates whether completion examples should be checked for validity (against the given parser). An exception is thrown if the example source contains no valid completion suggestions.
- def examples[A](a: Parser[A], completions: Set[String], check: Boolean = false): Parser[A]
-
def
failure(msg: ⇒ String, definitive: Boolean = false): Parser[Nothing]
Defines a parser that always fails on any input with message
msg
.Defines a parser that always fails on any input with message
msg
. Ifdefinitive
istrue
, any failures by later alternatives are discarded. -
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def homParser[A](a: Parser[A], b: Parser[A]): Parser[A]
-
def
invalid(msgs: ⇒ Seq[String], definitive: Boolean = false): Parser[Nothing]
Defines a parser that always fails on any input with messages
msgs
.Defines a parser that always fails on any input with messages
msgs
. Ifdefinitive
istrue
, any failures by later alternatives are discarded. -
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
implicit
def
literal(s: String): Parser[String]
Presents a literal String
s
as a Parser that only parses that exact text and provides it as the result. -
implicit
def
literal(ch: Char): Parser[Char]
Presents a single Char
ch
as a Parser that only parses that exact character. - implicit def literalRichCharParser(c: Char): RichParser[Char]
- implicit def literalRichStringParser(s: String): RichParser[String]
- def matched(t: Parser[_], seen: Vector[Char] = Vector.empty, partial: Boolean = false): Parser[String]
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def not(p: Parser[_], failMessage: String): Parser[Unit]
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def oneOf[T](p: Seq[Parser[T]]): Parser[T]
-
def
parse[T](str: String, parser: Parser[T]): Either[String, T]
Parses input
str
usingparser
.Parses input
str
usingparser
. If successful, the result is provided wrapped inRight
. If unsuccessful, an error message is provided inLeft
. -
def
range(r: NumericRange[Char], label: String): Parser[Char]
Presents a Char range as a Parser.
Presents a Char range as a Parser. A single Char is parsed only if it is in the given range.
-
implicit
def
range(r: NumericRange[Char]): Parser[Char]
Presents a Char range as a Parser.
Presents a Char range as a Parser. A single Char is parsed only if it is in the given range.
- def result[T](p: Parser[T], s: String): Either[() ⇒ (Seq[String], Int), T]
-
implicit
def
richParser[A](a: Parser[A]): RichParser[A]
Provides combinators for Parsers.
-
def
sample(str: String, parser: Parser[_], completions: Boolean = false): Unit
Convenience method to use when developing a parser.
Convenience method to use when developing a parser.
parser
is applied to the inputstr
. Ifcompletions
is true, the available completions for the input are displayed. Otherwise, the result of parsing is printed using the result'stoString
method. If parsing fails, the error message is displayed.See also sampleParse and sampleCompletions.
-
def
sampleCompletions(str: String, parser: Parser[_], level: Int = 1): Unit
Convenience method to use when developing a parser.
Convenience method to use when developing a parser.
parser
is applied to the inputstr
and the available completions are displayed on separate lines. If parsing fails, the error message is displayed. -
def
sampleParse(str: String, parser: Parser[_]): Unit
Convenience method to use when developing a parser.
Convenience method to use when developing a parser.
parser
is applied to the inputstr
and the result of parsing is printed using the result'stoString
method. If parsing fails, the error message is displayed. - def seq[T](p: Seq[Parser[T]]): Parser[Seq[T]]
- def seq0[T](p: Seq[Parser[T]], errors: ⇒ Seq[String]): Parser[Seq[T]]
- def stringLiteral(s: String, start: Int): Parser[String]
-
def
success[T](value: T): Parser[T]
Defines a parser that always succeeds on empty input with the result
value
. -
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
- def token[T](t: Parser[T], complete: TokenCompletions): Parser[T]
-
def
token[T](t: Parser[T], description: String): Parser[T]
Establishes delegate parser
t
as a single token of tab completion.Establishes delegate parser
t
as a single token of tab completion. When tab completion of part of this token is requested,description
is displayed for suggestions and no completions are ever performed. -
def
token[T](t: Parser[T], hide: (Int) ⇒ Boolean): Parser[T]
Establishes delegate parser
t
as a single token of tab completion.Establishes delegate parser
t
as a single token of tab completion. When tab completion of part of this token is requested, no completions are returned ifhide
returns true for the current tab completion level. Otherwise, the completions provided by the delegatet
or a later derivative are appended to the prefix String already seen by this parser. -
def
token[T](t: Parser[T]): Parser[T]
Establishes delegate parser
t
as a single token of tab completion.Establishes delegate parser
t
as a single token of tab completion. When tab completion of part of this token is requested, the completions provided by the delegatet
or a later derivative are appended to the prefix String already seen by this parser. -
def
tokenDisplay[T](t: Parser[T], display: String): Parser[T]
Establishes delegate parser
t
as a single token of tab completion.Establishes delegate parser
t
as a single token of tab completion. When tab completion of part of this token is requested,display
is used as the printed suggestion, but the completions from the delegate parsert
are used to complete if unambiguous. -
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
object
~
See unapply.