scala.tools.nsc.ast.parser.Parsers

# UnitParser

###
Related Doc: package Parsers

#### class UnitParser extends SourceFileParser

Self Type
  UnitParser
Source
  Parsers.scala

Linear Supertypes
SourceFileParser, Parser, Parsers.ParserCommon, AnyRef, Any
Ordering

1. Alphabetic
2. By Inheritance

Inherited

1. UnitParser
2. SourceFileParser
3. Parser
4. ParserCommon
5. AnyRef
6. Any

Implicitly

1. by any2stringadd
2. by StringFormat
3. by Ensuring
4. by ArrowAssoc

1. Hide All
2. Show All

Visibility

1. Public
2. All

### Instance Constructors

1. #### new UnitParser(unit: Global.CompilationUnit)

2. #### new UnitParser(unit: Global.CompilationUnit, patches: List[BracePatch])

### Type Members

1. #### class ParserTreeBuilder extends TreeBuilder

   Definition Classes
     Parser

2. #### trait PatternContextSensitive extends AnyRef

   Methods which implicitly propagate the context in which they were called: either in a pattern context or not.

   Methods which implicitly propagate the context in which they were called: either in a pattern context or not. Formerly, this was threaded through numerous methods as boolean isPattern.

   Definition Classes
     Parser

3. #### trait SeqContextSensitive extends PatternContextSensitive

   Methods which implicitly propagate whether the initial call took place in a context where sequences are allowed.

   Methods which implicitly propagate whether the initial call took place in a context where sequences are allowed. Formerly, this was threaded through methods as boolean seqOK.

   Definition Classes
     Parser

### Value Members

1. #### final def !=(arg0: Any): Boolean

   Test two objects for inequality.

   Test two objects for inequality.

   returns

     `true` if !(this == that), false otherwise.

   Definition Classes
     AnyRef → Any

2. #### final def ##(): Int

   Equivalent to `x.hashCode` except for boxed numeric types and `null`.

   Equivalent to `x.hashCode` except for boxed numeric types and `null`. For numerics, it returns a hash value which is consistent with value equality: if two value type instances compare as true, then ## will produce the same hash value for each of them. For `null` returns a hashcode where `null.hashCode` throws a `NullPointerException`.

   returns

     a hash value consistent with ==

   Definition Classes
     AnyRef → Any

3. #### def +(other: String): String

   Implicit information
     This member is added by an implicit conversion from UnitParser to any2stringadd[UnitParser] performed by method any2stringadd in scala.Predef.
   Definition Classes
     any2stringadd

4. #### def ->[B](y: B): (UnitParser, B)

   Implicit information
     This member is added by an implicit conversion from UnitParser to ArrowAssoc[UnitParser] performed by method ArrowAssoc in scala.Predef.
   Definition Classes
     ArrowAssoc
   Annotations
     @inline()

5. #### final def ==(arg0: Any): Boolean

   The expression `x == that` is equivalent to `if (x eq null) that eq null else x.equals(that)`.

   The expression `x == that` is equivalent to `if (x eq null) that eq null else x.equals(that)`.

   returns

     `true` if the receiver object is equivalent to the argument; `false` otherwise.

   Definition Classes
     AnyRef → Any

6. #### object InfixMode extends Enumeration

   Modes for infix types.

   Modes for infix types.

   Definition Classes
     Parser

7. #### def accept(token: Parsers.Token): Parsers.Offset

   Consume one token of the specified type, or signal an error if it is not there.

   Consume one token of the specified type, or signal an error if it is not there.

   Definition Classes
     Parser → ParserCommon

8. #### def acceptStatSep(): Unit

       semi = nl {nl} | `;`
       nl  = `\n' // where allowed

   Definition Classes
     Parser

9. #### def acceptStatSepOpt(): Unit

   Definition Classes
     Parser

10. #### def accessModifierOpt(): Global.Modifiers

        AccessModifier ::= (private | protected) [AccessQualifier]

    Definition Classes
      Parser

11. #### def accessQualifierOpt(mods: Global.Modifiers): Global.Modifiers

        AccessQualifier ::= `[' (Id | this) `]'

    Definition Classes
      Parser

12. #### def annotTypeRest(t: Global.Tree): Global.Tree

    Definition Classes
      Parser

13. #### def annotationExpr(): Global.Tree

    Definition Classes
      Parser

14. #### def annotations(skipNewLines: Boolean): List[Global.Tree]

        Annotations      ::= {`@' SimpleType {ArgumentExprs}}
        ConsrAnnotations ::= {`@' SimpleType ArgumentExprs}

    Definition Classes
      Parser

15. #### def argumentExprs(): List[Global.Tree]

        ArgumentExprs ::= `(' [Exprs] `)'
                        | [nl] BlockExpr

    Definition Classes
      Parser

16. #### def argumentPatterns(): List[Global.Tree]

    Definition Classes
      Parser

17. #### final def asInstanceOf[T0]: T0

    Cast the receiver object to be of type `T0`.

    Cast the receiver object to be of type `T0`.

    Note that the success of a cast at runtime is modulo Scala's erasure semantics. Therefore the expression `1.asInstanceOf[String]` will throw a `ClassCastException` at runtime, while the expression `List(1).asInstanceOf[List[String]]` will not. In the latter example, because the type argument is erased as part of compilation it is not possible to check whether the contents of the list are of the requested type.

    returns

      the receiver object.

    Definition Classes
      Any
    Exceptions thrown

      `ClassCastException` if the receiver object is not an instance of the erasure of type `T0`.

18. #### val assumedClosingParens: Map[Int, Int]

    Definition Classes
      Parser

19. #### def atInPos[T <: Global.Tree](t: T): T

    Definition Classes
      Parser

20. #### def atPos[T <: Global.Tree](pos: Global.Position)(t: T): T

    Definition Classes
      Parser

21. #### def atPos[T <: Global.Tree](start: Parsers.Offset, point: Parsers.Offset, end: Parsers.Offset)(t: T): T

    Definition Classes
      Parser

22. #### def atPos[T <: Global.Tree](start: Parsers.Offset, point: Parsers.Offset)(t: T): T

    Definition Classes
      Parser

23. #### def atPos[T <: Global.Tree](offset: Parsers.Offset)(t: T): T

    Definition Classes
      Parser

24. #### def block(): Global.Tree

        Block ::= BlockStatSeq

    Definition Classes
      Parser
    Note

      Return tree does not carry position.

25. #### def blockExpr(): Global.Tree

        BlockExpr ::= `{' (CaseClauses | Block) `}'

    Definition Classes
      Parser

26. #### def blockStatSeq(): List[Global.Tree]

        BlockStatSeq ::= { BlockStat semi } [ResultExpr]
        BlockStat    ::= Import
                       | Annotations [implicit] [lazy] Def
                       | Annotations LocalModifiers TmplDef
                       | Expr1
                       |

    Definition Classes
      Parser

27. #### def bound(tok: Parsers.Token): Global.Tree

    Definition Classes
      Parser

28. #### def caseBlock(): Global.Tree

    Definition Classes
      Parser

29. #### def caseClause(): Global.CaseDef

    Definition Classes
      Parser

30. #### def caseClauses(): List[Global.CaseDef]

        CaseClauses ::= CaseClause {CaseClause}
        CaseClause  ::= case Pattern [Guard] `=>' Block

    Definition Classes
      Parser

31. #### final def caseSeparated[T](part: ⇒ T): List[T]

    Definition Classes
      Parser
    Annotations
      @inline()

32. #### def checkAssoc(offset: Parsers.Offset, op: Global.Name, leftAssoc: Boolean): Unit

    Definition Classes
      Parser

33. #### def checkHeadAssoc(leftAssoc: Boolean): Unit

    Definition Classes
      Parser

34. #### def checkNoEscapingPlaceholders[T](op: ⇒ T): T

    Definition Classes
      Parser

35. #### def checkNotByNameOrVarargs(tpt: Global.Tree): Unit

    Check that type parameter is not by name or repeated.

    Check that type parameter is not by name or repeated.

    Definition Classes
      Parser

36. #### def classDef(start: Parsers.Offset, mods: Global.Modifiers): Global.ClassDef

        ClassDef ::= Id [TypeParamClause] {Annotation}
                     [AccessModifier] ClassParamClauses RequiresTypeOpt ClassTemplateOpt
        TraitDef ::= Id [TypeParamClause] RequiresTypeOpt TraitTemplateOpt

    Definition Classes
      Parser

37. #### def clone(): AnyRef

    Create a copy of the receiver object.

    Create a copy of the receiver object.

    The default implementation of the `clone` method is platform dependent.

    returns

      a copy of the receiver object.

    Attributes
      protected[java.lang]
    Definition Classes
      AnyRef
    Annotations
      @HotSpotIntrinsicCandidate() @throws( ... )
    Note

      not specified by SLS as a member of AnyRef

38. #### final def commaSeparated[T](part: ⇒ T): List[T]

    Definition Classes
      Parser
    Annotations
      @inline()

39. #### def compilationUnit(): Global.PackageDef

        CompilationUnit ::= {package QualId semi} TopStatSeq

    Definition Classes
      Parser

40. #### def condExpr(): Global.Tree

    Definition Classes
      Parser

41. #### def constrBlock(vparamss: List[List[Global.ValDef]]): Global.Tree

        ConstrBlock    ::=  `{' SelfInvocation {semi BlockStat} `}'

    Definition Classes
      Parser

42. #### def constrExpr(vparamss: List[List[Global.ValDef]]): Global.Tree

        ConstrExpr      ::=  SelfInvocation
                          |  ConstrBlock

    Definition Classes
      Parser

43. #### def constructorAnnotations(): List[Global.Tree]

    Definition Classes
      Parser

44. #### def convertToParam(tree: Global.Tree): Global.ValDef

    Convert tree to formal parameter.

    Convert tree to formal parameter.

    Definition Classes
      Parser

45. #### def convertToParams(tree: Global.Tree): List[Global.ValDef]

    Convert tree to formal parameter list.

    Convert tree to formal parameter list.

    Definition Classes
      Parser

46. #### def convertToTypeId(tree: Global.Tree): Global.Tree

    Convert (qual)ident to type identifier.

    Convert (qual)ident to type identifier.

    Definition Classes
      Parser

47. #### def defOrDcl(pos: Parsers.Offset, mods: Global.Modifiers): List[Global.Tree]

        Def    ::= val PatDef
                 | var PatDef
                 | def FunDef
                 | type [nl] TypeDef
                 | TmplDef
        Dcl    ::= val PatDcl
                 | var PatDcl
                 | def FunDcl
                 | type [nl] TypeDcl

    Definition Classes
      Parser

48. #### def deprecationWarning(offset: Parsers.Offset, msg: String): Unit

    Definition Classes
      UnitParser → SourceFileParser → ParserCommon

49. #### final def dropAnyBraces[T](body: ⇒ T): T

    Definition Classes
      ParserCommon
    Annotations
      @inline()

50. #### def ensureEarlyDef(tree: Global.Tree): Global.Tree

    Definition Classes
      Parser

51. #### def ensuring(cond: (UnitParser) ⇒ Boolean, msg: ⇒ Any): UnitParser

    Implicit information
      This member is added by an implicit conversion from UnitParser to Ensuring[UnitParser] performed by method Ensuring in scala.Predef.
    Definition Classes
      Ensuring

52. #### def ensuring(cond: (UnitParser) ⇒ Boolean): UnitParser

    Implicit information
      This member is added by an implicit conversion from UnitParser to Ensuring[UnitParser] performed by method Ensuring in scala.Predef.
    Definition Classes
      Ensuring

53. #### def ensuring(cond: Boolean, msg: ⇒ Any): UnitParser

    Implicit information
      This member is added by an implicit conversion from UnitParser to Ensuring[UnitParser] performed by method Ensuring in scala.Predef.
    Definition Classes
      Ensuring

54. #### def ensuring(cond: Boolean): UnitParser

    Implicit information
      This member is added by an implicit conversion from UnitParser to Ensuring[UnitParser] performed by method Ensuring in scala.Predef.
    Definition Classes
      Ensuring

55. #### def enumerator(isFirst: Boolean, allowNestedIf: Boolean = true): List[Global.Tree]

    Definition Classes
      Parser

56. #### def enumerators(): List[Global.Tree]

        Enumerators ::= Generator {semi Enumerator}
        Enumerator  ::=  Generator
                      |  Guard
                      |  val Pattern1 `=' Expr

    Definition Classes
      Parser

57. #### final def eq(arg0: AnyRef): Boolean

    Tests whether the argument (`that`) is a reference to the receiver object (`this`).

    Tests whether the argument (`that`) is a reference to the receiver object (`this`).

    The `eq` method implements an equivalence relation on non-null instances of `AnyRef`, and has three additional properties:

    - It is consistent: for any non-null instances `x` and `y` of type `AnyRef`, multiple invocations of `x.eq(y)` consistently returns `true` or consistently returns `false`.
    - For any non-null instance `x` of type `AnyRef`, `x.eq(null)` and `null.eq(x)` returns `false`.
    - `null.eq(null)` returns `true`.

    When overriding the `equals` or `hashCode` methods, it is important to ensure that their behavior is consistent with reference equality. Therefore, if two objects are references to each other (`o1 eq o2`), they should be equal to each other (`o1 == o2`) and they should hash to the same value (`o1.hashCode == o2.hashCode`).

    returns

      `true` if the argument is a reference to the receiver object; `false` otherwise.

    Definition Classes
      AnyRef

58. #### def equals(arg0: Any): Boolean

    The equality method for reference types.

    The equality method for reference types. Default implementation delegates to `eq`.

    See also `equals` in scala.Any.

    returns

      `true` if the receiver object is equivalent to the argument; `false` otherwise.

    Definition Classes
      AnyRef → Any

59. #### def errorPatternTree: Global.Ident

    Definition Classes
      Parser

60. #### def errorTermTree: Global.Literal

    Definition Classes
      Parser

61. #### def errorTypeTree: Global.TypeTree

    Definition Classes
      Parser

62. #### def expectedMsg(token: Parsers.Token): String

    Definition Classes
      Parser

63. #### def expectedMsgTemplate(exp: String, fnd: String): String

    Definition Classes
      Parser

64. #### def expr(location: Location): Global.Tree

    Definition Classes
      Parser

65. #### def expr(): Global.Tree

        Expr       ::= (Bindings | [`implicit'] Id | `_')  `=>' Expr
                     | Expr1
        ResultExpr ::= (Bindings | Id `:' CompoundType) `=>' Block
                     | Expr1
        Expr1      ::= if `(' Expr `)' {nl} Expr [[semi] else Expr]
                     | try (`{' Block `}' | Expr) [catch `{' CaseClauses `}'] [finally Expr]
                     | while `(' Expr `)' {nl} Expr
                     | do Expr [semi] while `(' Expr `)'
                     | for (`(' Enumerators `)' | `{' Enumerators `}') {nl} [yield] Expr
                     | throw Expr
                     | return [Expr]
                     | [SimpleExpr `.'] Id `=' Expr
                     | SimpleExpr1 ArgumentExprs `=' Expr
                     | PostfixExpr Ascription
                     | PostfixExpr match `{' CaseClauses `}'
        Bindings   ::= `(' [Binding {`,' Binding}] `)'
        Binding    ::= (Id | `_') [`:' Type]
        Ascription ::= `:' CompoundType
                     | `:' Annotation {Annotation}
                     | `:' `_' `*'

    Definition Classes
      Parser

66. #### def expr0(location: Location): Global.Tree

    Definition Classes
      Parser

67. #### def exprSimpleType(): Global.Tree

    Definition Classes
      Parser

68. #### def exprTypeArgs(): List[Global.Tree]

    Definition Classes
      Parser

69. #### def finishBinaryOp(isExpr: Boolean, opinfo: OpInfo, rhs: Global.Tree): Global.Tree

    Definition Classes
      Parser

70. #### def finishPostfixOp(start: Int, base: List[OpInfo], opinfo: OpInfo): Global.Tree

    Definition Classes
      Parser

71. #### def formatted(fmtstr: String): String

    Implicit information
      This member is added by an implicit conversion from UnitParser to StringFormat[UnitParser] performed by method StringFormat in scala.Predef.
    Definition Classes
      StringFormat
    Annotations
      @inline()

72. #### implicit def fresh: FreshNameCreator

    Definition Classes
      Parser

73. #### def funDefOrDcl(start: Int, mods: Global.Modifiers): Global.Tree

        FunDef ::= FunSig [`:' Type] `=' [`macro'] Expr
                |  FunSig [nl] `{' Block `}'
                |  `this' ParamClause ParamClauses
                       (`=' ConstrExpr | [nl] ConstrBlock)
        FunDcl ::= FunSig [`:' Type]
        FunSig ::= id [FunTypeParamClause] ParamClauses

    Definition Classes
      Parser

74. #### def funDefRest(start: Parsers.Offset, nameOffset: Parsers.Offset, mods: Global.Modifiers, name: Global.Name): Global.Tree

    Definition Classes
      Parser

75. #### def generator(eqOK: Boolean, allowNestedIf: Boolean = true): List[Global.Tree]

        Generator ::= Pattern1 (`<-' | `=') Expr [Guard]

    Definition Classes
      Parser

76. #### final def getClass(): Class[_]

    A representation that corresponds to the dynamic class of the receiver object.

    A representation that corresponds to the dynamic class of the receiver object.

    The nature of the representation is platform dependent.

    returns

      a representation that corresponds to the dynamic class of the receiver object.

    Definition Classes
      AnyRef → Any
    Annotations
      @HotSpotIntrinsicCandidate()
    Note

      not specified by SLS as a member of AnyRef

77. #### def guard(): Global.Tree

        Guard ::= if PostfixExpr

    Definition Classes
      Parser

78. #### def hashCode(): Int

    The hashCode method for reference types.

    The hashCode method for reference types. See hashCode in scala.Any.

    returns

      the hash code value for this object.

    Definition Classes
      AnyRef → Any
    Annotations
      @HotSpotIntrinsicCandidate()

79. #### def ident(): Global.Name

    Definition Classes
      Parser

80. #### def ident(skipIt: Boolean): Global.Name

    Assumed (provisionally) to be TermNames.

    Assumed (provisionally) to be TermNames.

    Definition Classes
      Parser

81. #### def identForType(skipIt: Boolean): Global.TypeName

    Definition Classes
      Parser

82. #### def identForType(): Global.TypeName

    For when it's known already to be a type name.

    For when it's known already to be a type name.

    Definition Classes
      Parser

83. #### def identOrMacro(): Global.Name

    Definition Classes
      Parser

84. #### def implicitClosure(start: Parsers.Offset, location: Location): Global.Tree

        Expr ::= implicit Id => Expr

    Definition Classes
      Parser

85. #### def importClause(): List[Global.Tree]

        Import  ::= import ImportExpr {`,' ImportExpr}

    Definition Classes
      Parser

86. #### def importExpr(): Global.Tree

        ImportExpr ::= StableId `.' (Id | `_' | ImportSelectors)

    Definition Classes
      Parser

87. #### def importSelector(): Global.ImportSelector

        ImportSelector ::= Id [`=>' Id | `=>' `_']

    Definition Classes
      Parser

88. #### def importSelectors(): List[Global.ImportSelector]

        ImportSelectors ::= `{' {ImportSelector `,'} (ImportSelector | `_') `}'

    Definition Classes
      Parser

89. #### val in: Parsers.Scanner

    Definition Classes
      SourceFileParser → Parser → ParserCommon

90. #### final def inBraces[T](body: ⇒ T): T

    Definition Classes
      ParserCommon
    Annotations
      @inline()

91. #### final def inBracesOrError[T](body: ⇒ T, alt: T): T

    Definition Classes
      ParserCommon
    Annotations
      @inline()

92. #### final def inBracesOrNil[T](body: ⇒ List[T]): List[T]

    Definition Classes
      ParserCommon
    Annotations
      @inline()

93. #### final def inBracesOrUnit[T](body: ⇒ Global.Tree): Global.Tree

    Definition Classes
      ParserCommon
    Annotations
      @inline()

94. #### final def inBrackets[T](body: ⇒ T): T

    Definition Classes
      ParserCommon
    Annotations
      @inline()

95. #### final def inParens[T](body: ⇒ T): T

    Methods inParensOrError and similar take a second argument which, should the next token not be the expected opener (e.g.

    Methods inParensOrError and similar take a second argument which, should the next token not be the expected opener (e.g. LPAREN) will be returned instead of the contents of the groupers. However in all cases accept(LPAREN) will be called, so a parse error will still result. If the grouping is optional, in.token should be tested before calling these methods.

    Definition Classes
      ParserCommon
    Annotations
      @inline()

96. #### final def inParensOrError[T](body: ⇒ T, alt: T): T

    Definition Classes
      ParserCommon
    Annotations
      @inline()

97. #### final def inParensOrNil[T](body: ⇒ List[T]): List[T]

    Definition Classes
      ParserCommon
    Annotations
      @inline()

98. #### final def inParensOrUnit[T](body: ⇒ Global.Tree): Global.Tree

    Definition Classes
      ParserCommon
    Annotations
      @inline()

99. #### def incompleteInputError(msg: String): Unit

    Definition Classes
      UnitParser → SourceFileParser → Parser

100. #### def isAnnotation: Boolean

     Definition Classes
       Parser

101. #### def isCaseDefEnd: Boolean

     Definition Classes
       Parser

102. #### def isDclIntro: Boolean

     Definition Classes
       Parser

103. #### def isDefIntro: Boolean

     Definition Classes
       Parser

104. #### def isExprIntro: Boolean

     Definition Classes
       Parser

105. #### def isExprIntroToken(token: Parsers.Token): Boolean

     Definition Classes
       Parser

106. #### def isIdent: Boolean

     Definition Classes
       Parser

107. #### def isIdentExcept(except: Global.Name): Boolean

     Definition Classes
       Parser

108. #### def isIdentOf(name: Global.Name): Boolean

     Definition Classes
       Parser

109. #### final def isInstanceOf[T0]: Boolean

     Test whether the dynamic type of the receiver object is `T0`.

     Test whether the dynamic type of the receiver object is `T0`.

     Note that the result of the test is modulo Scala's erasure semantics. Therefore the expression `1.isInstanceOf[String]` will return `false`, while the expression `List(1).isInstanceOf[List[String]]` will return `true`. In the latter example, because the type argument is erased as part of compilation it is not possible to check whether the contents of the list are of the specified type.

     returns

       `true` if the receiver object is an instance of erasure of type `T0`; `false` otherwise.

     Definition Classes
       Any

110. #### def isLiteral: Boolean

     Definition Classes
       Parser

111. #### def isLiteralToken(token: Parsers.Token): Boolean

     Definition Classes
       Parser

112. #### def isLocalModifier: Boolean

     Definition Classes
       Parser

113. #### def isMacro: Boolean

     Definition Classes
       Parser

114. #### def isModifier: Boolean

     Definition Classes
       Parser

115. #### def isNumericLit: Boolean

     Definition Classes
       Parser

116. #### def isRawBar: Boolean

     Definition Classes
       Parser

117. #### def isRawIdent: Boolean

     Definition Classes
       Parser

118. #### def isRawStar: Boolean

     Definition Classes
       Parser

119. #### def isStatSep: Boolean

     Definition Classes
       Parser

120. #### def isStatSep(token: Parsers.Token): Boolean

     Definition Classes
       Parser

121. #### def isStatSeqEnd: Boolean

     Definition Classes
       Parser

122. #### def isTemplateIntro: Boolean

     Definition Classes
       Parser

123. #### def isTypeIntroToken(token: Parsers.Token): Boolean

     Definition Classes
       Parser

124. #### def isTypedParam(t: Global.Tree): Boolean

     Definition Classes
       Parser

125. #### def isUnaryOp: Boolean

     Definition Classes
       Parser

126. #### def isWildcard(t: Global.Tree): Boolean

     Definition Classes
       Parser

127. #### def joinComment(trees: ⇒ List[Global.Tree]): List[Global.Tree]

     A hook for joining the comment associated with a definition.

     A hook for joining the comment associated with a definition. Overridden by scaladoc.

     Definition Classes
       Parser

128. #### def literal(isNegated: Boolean = false, inPattern: Boolean = false, start: Parsers.Offset = in.offset): Global.Tree

         SimpleExpr    ::= literal
                         | symbol
                         | null

     Definition Classes
       Parser

129. #### def localDef(implicitMod: Int): List[Global.Tree]

     overridable IDE hook for local definitions of blockStatSeq Here's an idea how to fill in start and end positions.

     overridable IDE hook for local definitions of blockStatSeq Here's an idea how to fill in start and end positions. def localDef : List[Tree] = { atEndPos { atStartPos(in.offset) { val annots = annotations(skipNewLines = true) val mods = localModifiers() withAnnotations annots if (!(mods hasFlag ~(Flags.IMPLICIT | Flags.LAZY))) defOrDcl(mods) else List(tmplDef(mods)) } } (in.offset) }

     Definition Classes
       Parser

130. #### def localModifiers(): Global.Modifiers

         LocalModifiers ::= {LocalModifier}
         LocalModifier  ::= abstract | final | sealed | implicit | lazy

     Definition Classes
       Parser

131. #### final def lookingAhead[T](body: ⇒ T): T

     Scoping operator used to temporarily look into the future.

     Scoping operator used to temporarily look into the future. Backs up scanner data before evaluating a block and restores it after.

     Definition Classes
       Parser
     Annotations
       @inline()

132. #### def makeBinop(isExpr: Boolean, left: Global.Tree, op: Global.TermName, right: Global.Tree, opPos: Global.Position, targs: List[Global.Tree] = Nil): Global.Tree

     Create tree representing (unencoded) binary operation expression or pattern.

     Create tree representing (unencoded) binary operation expression or pattern.

     Definition Classes
       Parser

133. #### def makeEmptyPackage(start: Parsers.Offset, stats: List[Global.Tree]): Global.PackageDef

     Definition Classes
       Parser

134. #### def makeFilter(start: Parsers.Offset, tree: Global.Tree): Global.Apply

     Definition Classes
       Parser

135. #### def makePackageObject(start: Parsers.Offset, objDef: Global.ModuleDef): Global.PackageDef

     Definition Classes
       Parser

136. #### def makePackaging(start: Parsers.Offset, pkg: Global.Tree, stats: List[Global.Tree]): Global.PackageDef

     Create a tree representing a packaging.

     Create a tree representing a packaging.

     Definition Classes
       Parser

137. #### final def makeParens(body: ⇒ List[Global.Tree]): Global.Parens

     Creates an actual Parens node (only used during parsing.)

     Creates an actual Parens node (only used during parsing.)

     Definition Classes
       ParserCommon
     Annotations
       @inline()

138. #### def makeSafeTupleTerm(elems: List[Global.Tree], offset: Parsers.Offset): Global.Tree

     Create a tuple term Tree.

     Create a tuple term Tree. If the arity is not supported, a syntax error is emitted.

     Definition Classes
       Parser

139. #### def makeSafeTupleType(elems: List[Global.Tree], offset: Parsers.Offset): Global.Tree

     Create a tuple type Tree.

     Create a tuple type Tree. If the arity is not supported, a syntax error is emitted.

     Definition Classes
       Parser

140. #### def mixinQualifierOpt(): Global.TypeName

         MixinQualifier ::= `[' Id `]'

     Definition Classes
       Parser

141. #### def modifiers(): Global.Modifiers

         Modifiers ::= {Modifier}
         Modifier  ::= LocalModifier
                     |  AccessModifier
                     |  override

     Definition Classes
       Parser

142. #### def multipleArgumentExprs(): List[List[Global.Tree]]

     A succession of argument lists.

     A succession of argument lists.

     Definition Classes
       Parser

143. #### final def ne(arg0: AnyRef): Boolean

     Equivalent to `!(this eq that)`.

     Equivalent to `!(this eq that)`.

     returns

       `true` if the argument is not a reference to the receiver object; `false` otherwise.

     Definition Classes
       AnyRef

144. #### def newLineOpt(): Unit

     Definition Classes
       Parser

145. #### def newLineOptWhenFollowedBy(token: Parsers.Offset): Unit

     Definition Classes
       Parser

146. #### def newLineOptWhenFollowing(p: (Parsers.Token) ⇒ Boolean): Unit

     Definition Classes
       Parser

147. #### def newLinesOpt(): Unit

     Definition Classes
       Parser

148. #### def newScanner(): Parsers.UnitScanner

     Definition Classes
       UnitParser → SourceFileParser

149. #### object noSeq extends SeqContextSensitive

     The implementation for parsing inside of patterns at points where sequences are disallowed.

     The implementation for parsing inside of patterns at points where sequences are disallowed.

     Definition Classes
       Parser

150. #### def nonLocalDefOrDcl: List[Global.Tree]

     Definition Classes
       Parser

151. #### final def notify(): Unit

     Wakes up a single thread that is waiting on the receiver object's monitor.

     Wakes up a single thread that is waiting on the receiver object's monitor.

     Definition Classes
       AnyRef
     Annotations
       @HotSpotIntrinsicCandidate()
     Note

       not specified by SLS as a member of AnyRef

152. #### final def notifyAll(): Unit

     Wakes up all threads that are waiting on the receiver object's monitor.

     Wakes up all threads that are waiting on the receiver object's monitor.

     Definition Classes
       AnyRef
     Annotations
       @HotSpotIntrinsicCandidate()
     Note

       not specified by SLS as a member of AnyRef

153. #### def o2p(offset: Parsers.Offset): Global.Position

     Definition Classes
       Parser

154. #### def objectDef(start: Parsers.Offset, mods: Global.Modifiers): Global.ModuleDef

         ObjectDef       ::= Id ClassTemplateOpt

     Definition Classes
       Parser

155. #### var opstack: List[OpInfo]

     Definition Classes
       Parser

156. #### object outPattern extends PatternContextSensitive

     The implementation of the context sensitive methods for parsing outside of patterns.

     The implementation of the context sensitive methods for parsing outside of patterns.

     Definition Classes
       Parser

157. #### def packageObjectDef(start: Parsers.Offset): Global.PackageDef

     Create a tree representing a package object, converting

     Create a tree representing a package object, converting

         package object foo { ... }

     to

         package foo {
           object `package` { ... }
         }

     Definition Classes
       Parser

158. #### def packageOrPackageObject(start: Parsers.Offset): Global.Tree

     Definition Classes
       Parser

159. #### def param(owner: Global.Name, implicitmod: Int, caseParam: Boolean): Global.ValDef

     Definition Classes
       Parser

160. #### def paramClauses(owner: Global.Name, contextBounds: List[Global.Tree], ofCaseClass: Boolean): List[List[Global.ValDef]]

         ParamClauses      ::= {ParamClause} [[nl] `(' implicit Params `)']
         ParamClause       ::= [nl] `(' [Params] `)'
         Params            ::= Param {`,' Param}
         Param             ::= {Annotation} Id [`:' ParamType] [`=' Expr]
         ClassParamClauses ::= {ClassParamClause} [[nl] `(' implicit ClassParams `)']
         ClassParamClause  ::= [nl] `(' [ClassParams] `)'
         ClassParams       ::= ClassParam {`,' ClassParam}
         ClassParam        ::= {Annotation}  [{Modifier} (`val' | `var')] Id [`:' ParamType] [`=' Expr]

     Definition Classes
       Parser

161. #### def paramType(useStartAsPosition: Boolean): Global.Tree

     Definition Classes
       Parser

162. #### def paramType(): Global.Tree

         ParamType ::= Type | `=>' Type | Type `*'

     Definition Classes
       Parser

163. #### def parse(): Global.Tree

     This is the general parse entry point.

     This is the general parse entry point.

     Definition Classes
       Parser

164. #### def parseRule[T](rule: (UnitParser.this.type) ⇒ T): T

     Definition Classes
       Parser

165. #### def parseStartRule: () ⇒ Global.Tree

     The parse starting point depends on whether the source file is self-contained: if not, the AST will be supplemented.

     The parse starting point depends on whether the source file is self-contained: if not, the AST will be supplemented.

     Definition Classes
       SourceFileParser → Parser

166. #### def parseStats(): List[Global.Tree]

     These are alternative entry points for repl, script runner, toolbox and parsing in macros.

     These are alternative entry points for repl, script runner, toolbox and parsing in macros.

     Definition Classes
       Parser

167. #### def parseStatsOrPackages(): List[Global.Tree]

     Definition Classes
       Parser

168. #### def patDefOrDcl(pos: Int, mods: Global.Modifiers): List[Global.Tree]

         PatDef ::= Pattern2 {`,' Pattern2} [`:' Type] `=' Expr
         ValDcl ::= Id {`,' Id} `:' Type
         VarDef ::= PatDef | Id {`,' Id} `:' Type `=' `_'

     Definition Classes
       Parser

169. #### def path(thisOK: Boolean, typeOK: Boolean): Global.Tree

         Path       ::= StableId
                     |  [Ident `.'] this
         AnnotType ::= Path [`.' type]

     Definition Classes
       Parser

170. #### def pattern(): Global.Tree

     Default entry points into some pattern contexts.

     Default entry points into some pattern contexts.

     Definition Classes
       Parser

171. #### def peekingAhead(tree: ⇒ Global.Tree): Global.Tree

     Perform an operation while peeking ahead.

     Perform an operation while peeking ahead. Pushback if the operation yields an empty tree or blows to pieces.

     Definition Classes
       Parser
     Annotations
       @inline()

172. #### var placeholderParams: List[Global.ValDef]

     The implicit parameters introduced by `_` in the current expression.

     The implicit parameters introduced by `_` in the current expression. Parameters appear in reverse order.

     Definition Classes
       Parser

173. #### def placeholderTypeBoundary(op: ⇒ Global.Tree): Global.Tree

     Definition Classes
       Parser

174. #### var placeholderTypes: List[Global.TypeDef]

     The placeholderTypes introduced by `_` in the current type.

     The placeholderTypes introduced by `_` in the current type. Parameters appear in reverse order.

     Definition Classes
       Parser

175. #### def postfixExpr(): Global.Tree

         PostfixExpr   ::= InfixExpr [Id [nl]]
         InfixExpr     ::= PrefixExpr
                         | InfixExpr Id [nl] InfixExpr

     Definition Classes
       Parser

176. #### def prefixExpr(): Global.Tree

         PrefixExpr   ::= [`-' | `+' | `~' | `!'] SimpleExpr

     Definition Classes
       Parser

177. #### def qualId(): Global.Tree

         QualId ::= Id {`.' Id}

     Definition Classes
       Parser

178. #### def r2p(offset: Parsers.Offset): Global.Position

     Definition Classes
       Parser

179. #### def r2p(start: Parsers.Offset, mid: Parsers.Offset): Global.Position

     Definition Classes
       Parser

180. #### def r2p(start: Parsers.Offset, mid: Parsers.Offset, end: Parsers.Offset): Global.Position

     Definition Classes
       Parser

181. #### def rawIdent(): Global.Name

     Definition Classes
       Parser

182. #### def readAnnots(part: ⇒ Global.Tree): List[Global.Tree]

     Definition Classes
       Parser

183. #### def reduceExprStack(base: List[OpInfo], top: Global.Tree): Global.Tree

     Definition Classes
       Parser

184. #### def reducePatternStack(base: List[OpInfo], top: Global.Tree): Global.Tree

     Definition Classes
       Parser

185. #### def reduceStack(isExpr: Boolean, base: List[OpInfo], top: Global.Tree, opPrecedence: Precedence, leftAssoc: Boolean): Global.Tree

     Definition Classes
       Parser

186. #### def reduceStack(isExpr: Boolean, base: List[OpInfo], top: Global.Tree): Global.Tree

     Definition Classes
       Parser

187. #### def refineStat(): List[Global.Tree]

     Definition Classes
       Parser

188. #### def refineStatSeq(): List[Global.Tree]

         RefineStatSeq    ::= RefineStat {semi RefineStat}
         RefineStat       ::= Dcl
                            | type TypeDef
                            |

     Definition Classes
       Parser

189. #### def refinement(): List[Global.Tree]

         Refinement ::= [nl] `{' RefineStat {semi RefineStat} `}'

     Definition Classes
       Parser

190. #### def resetPackage(): Unit

     Definition Classes
       Parser

191. #### def scriptBody(): Global.Tree

     This is the parse entry point for code which is not self-contained, e.g.

     This is the parse entry point for code which is not self-contained, e.g. a script which is a series of template statements. They will be swaddled in Trees until the AST is equivalent to the one returned by compilationUnit().

     Definition Classes
       Parser

192. #### def selector(t: Global.Tree): Global.Tree

     Definition Classes
       Parser

193. #### def selectors(t: Global.Tree, typeOK: Boolean, dotOffset: Parsers.Offset): Global.Tree

     Definition Classes
       Parser

194. #### def selfInvocation(vparamss: List[List[Global.ValDef]]): Global.Tree

         SelfInvocation  ::= this ArgumentExprs {ArgumentExprs}

     Definition Classes
       Parser

195. #### object seqOK extends SeqContextSensitive

     The implementation for parsing inside of patterns at points where sequences are allowed.

     The implementation for parsing inside of patterns at points where sequences are allowed.

     Definition Classes
       Parser

196. #### def seqPatterns(): List[Global.Tree]

     Definition Classes
       Parser

197. #### def setInPos[T <: Global.Tree](t: T): T

     Definition Classes
       Parser

198. #### def showSyntaxErrors(): Unit

199. #### def simpleExpr(): Global.Tree

         SimpleExpr    ::= new (ClassTemplate | TemplateBody)
                         |  BlockExpr
                         |  SimpleExpr1 [`_']
         SimpleExpr1   ::= literal
                         |  xLiteral
                         |  Path
                         |  `(' [Exprs] `)'
                         |  SimpleExpr `.' Id
                         |  SimpleExpr TypeArgs
                         |  SimpleExpr1 ArgumentExprs

     Definition Classes
       Parser

200. #### def simpleExprRest(t: Global.Tree, canApply: Boolean): Global.Tree

     Definition Classes
       Parser

201. #### def skip(targetToken: Parsers.Token): Unit

     Attributes
       protected
     Definition Classes
       Parser

202. #### def smartParse(): Global.Tree

     parse unit.

     parse unit. If there are inbalanced braces, try to correct them and reparse.

203. #### val source: SourceFile

     Definition Classes
       SourceFileParser → Parser

204. #### def stableId(): Global.Tree

         StableId ::= Id
                   |  Path `.' Id
                   |  [id `.'] super [`[' id `]']`.' id

     Definition Classes
       Parser

205. #### def startAnnotType(): Global.Tree

     Definition Classes
       Parser

206. #### def startInfixType(): Global.Tree

     Definition Classes
       Parser

207. #### def statSeq(stat: PartialFunction[Parsers.Token, List[Global.Tree]], errorMsg: String = "illegal start of definition"): List[Global.Tree]

     Definition Classes
       Parser

208. #### def statement(location: Location): Global.Tree

     Definition Classes
       Parser

209. #### def stripParens(t: Global.Tree): Global.Tree

     Strip the artifitial `Parens` node to create a tuple term Tree.

     Strip the artifitial `Parens` node to create a tuple term Tree.

     Definition Classes
       Parser

210. #### object symbXMLBuilder extends SymbolicXMLBuilder

     Definition Classes
       SourceFileParser

211. #### final def synchronized[T0](arg0: ⇒ T0): T0

     Definition Classes
       AnyRef

212. #### def syntaxError(offset: Parsers.Offset, msg: String): Unit

     Definition Classes
       UnitParser → SourceFileParser → Parser

213. #### def syntaxError(offset: Parsers.Offset, msg: String, skipIt: Boolean): Unit

     Definition Classes
       Parser

214. #### def syntaxError(msg: String, skipIt: Boolean): Unit

     Definition Classes
       Parser

215. #### def syntaxErrorOrIncomplete(msg: String, skipIt: Boolean): Unit

     Definition Classes
       Parser

216. #### def syntaxErrorOrIncompleteAnd[T](msg: String, skipIt: Boolean)(and: T): T

     Definition Classes
       Parser

217. #### val syntaxErrors: ListBuffer[(Int, String)]

218. #### def template(): (List[Global.Tree], Global.ValDef, List[Global.Tree])

         ClassTemplate ::= [EarlyDefs with] ClassParents [TemplateBody]
         TraitTemplate ::= [EarlyDefs with] TraitParents [TemplateBody]
         EarlyDefs     ::= `{' [EarlyDef {semi EarlyDef}] `}'
         EarlyDef      ::= Annotations Modifiers PatDef

     Definition Classes
       Parser

219. #### def templateBody(isPre: Boolean): (Global.ValDef, List[Global.Tree])

         TemplateBody ::= [nl] `{' TemplateStatSeq `}'

     isPre

       specifies whether in early initializer (true) or not (false)

     Definition Classes
       Parser

220. #### def templateBodyOpt(parenMeansSyntaxError: Boolean): (Global.ValDef, List[Global.Tree])

     Definition Classes
       Parser

221. #### def templateOpt(mods: Global.Modifiers, name: Global.Name, constrMods: Global.Modifiers, vparamss: List[List[Global.ValDef]], tstart: Parsers.Offset): Global.Template

         ClassTemplateOpt ::= `extends' ClassTemplate | [[`extends'] TemplateBody]
         TraitTemplateOpt ::= TraitExtends TraitTemplate | [[`extends'] TemplateBody] | `<:' TemplateBody
         TraitExtends     ::= `extends' | `<:'

     Definition Classes
       Parser

222. #### def templateOrTopStatSeq(): List[Global.Tree]

     Definition Classes
       Parser

223. #### def templateParents(): List[Global.Tree]

         ClassParents       ::= AnnotType {`(' [Exprs] `)'} {with AnnotType}
         TraitParents       ::= AnnotType {with AnnotType}

     Definition Classes
       Parser

224. #### def templateStat: PartialFunction[Parsers.Token, List[Global.Tree]]

     Definition Classes
       Parser

225. #### def templateStatSeq(isPre: Boolean): (Global.ValDef, List[Global.Tree])

         TemplateStatSeq  ::= [id [`:' Type] `=>'] TemplateStats

     isPre

       specifies whether in early initializer (true) or not (false)

     Definition Classes
       Parser

226. #### def templateStats(): List[Global.Tree]

         TemplateStats    ::= TemplateStat {semi TemplateStat}
         TemplateStat     ::= Import
                            | Annotations Modifiers Def
                            | Annotations Modifiers Dcl
                            | Expr1
                            | super ArgumentExprs {ArgumentExprs}
                            |

     Definition Classes
       Parser

227. #### def tmplDef(pos: Parsers.Offset, mods: Global.Modifiers): Global.Tree

         TmplDef ::= [case] class ClassDef
                   |  [case] object ObjectDef
                   |  [override] trait TraitDef

     Definition Classes
       Parser

228. #### def toString(): String

     Creates a String representation of this object.

     Creates a String representation of this object. The default representation is platform dependent. On the java platform it is the concatenation of the class name, "@", and the object's hashcode in hexadecimal.

     returns

       a String representation of the object.

     Definition Classes
       AnyRef → Any

229. #### final def tokenSeparated[T](separator: Parsers.Token, sepFirst: Boolean, part: ⇒ T): List[T]

     ,or if sepFirst is true,

         part { `sep` part }

     ,or if sepFirst is true,

         { `sep` part }

     . { `sep` part } }}} part { `sep` part } }}}

     Definition Classes
       Parser

230. #### def topLevelTmplDef: Global.Tree

     Hook for IDE, for top-level classes/objects.

     Hook for IDE, for top-level classes/objects.

     Definition Classes
       Parser

231. #### def topStat: PartialFunction[Parsers.Token, List[Global.Tree]]

     Definition Classes
       Parser

232. #### def topStatSeq(): List[Global.Tree]

         TopStatSeq ::= TopStat {semi TopStat}
         TopStat ::= Annotations Modifiers TmplDef
                   | Packaging
                   | package object objectDef
                   | Import
                   |

     Definition Classes
       Parser

233. #### val treeBuilder: ParserTreeBuilder

     Definition Classes
       Parser

234. #### def typ(): Global.Tree

     These are default entry points into the pattern context sensitive methods: they are all initiated from non-pattern context.

     These are default entry points into the pattern context sensitive methods: they are all initiated from non-pattern context.

     Definition Classes
       Parser

235. #### def typeBounds(): Global.TypeBoundsTree

         TypeBounds ::= [`>:' Type] [`<:' Type]

     Definition Classes
       Parser

236. #### def typeDefOrDcl(start: Parsers.Offset, mods: Global.Modifiers): Global.Tree

         TypeDef ::= type Id [TypeParamClause] `=' Type
                   | FunSig `=' Expr
         TypeDcl ::= type Id [TypeParamClause] TypeBounds

     Definition Classes
       Parser

237. #### def typeOrInfixType(location: Location): Global.Tree

     Definition Classes
       Parser

238. #### def typeParamClauseOpt(owner: Global.Name, contextBoundBuf: ListBuffer[Global.Tree]): List[Global.TypeDef]

         TypeParamClauseOpt    ::= [TypeParamClause]
         TypeParamClause       ::= `[' VariantTypeParam {`,' VariantTypeParam} `]']
         VariantTypeParam      ::= {Annotation} [`+' | `-'] TypeParam
         FunTypeParamClauseOpt ::= [FunTypeParamClause]
         FunTypeParamClause    ::= `[' TypeParam {`,' TypeParam} `]']
         TypeParam             ::= Id TypeParamClauseOpt TypeBounds {<% Type} {":" Type}

     Definition Classes
       Parser

239. #### def typedOpt(): Global.Tree

         TypedOpt ::= [`:' Type]

     Definition Classes
       Parser

240. #### val unit: Global.CompilationUnit

     Definition Classes
       UnitParser → SourceFileParser → Parser

241. #### final def wait(arg0: Long, arg1: Int): Unit

     Definition Classes
       AnyRef
     Annotations
       @throws( ... )

242. #### final def wait(arg0: Long): Unit

     Definition Classes
       AnyRef
     Annotations
       @throws( ... )

243. #### final def wait(): Unit

     Definition Classes
       AnyRef
     Annotations
       @throws( ... )

244. #### def warning(offset: Parsers.Offset, msg: String): Unit

     Definition Classes
       UnitParser → SourceFileParser → Parser

245. #### def warning(msg: String): Unit

     Definition Classes
       Parser

246. #### def wildcardOrIdent(): Global.Name

     Definition Classes
       Parser

247. #### def wildcardType(start: Parsers.Offset): Global.Ident

         WildcardType ::= `_' TypeBounds

     Definition Classes
       Parser

248. #### def withPatches(patches: List[BracePatch]): UnitParser

249. #### def xmlLiteral(): Global.Tree

     Definition Classes
       SourceFileParser → Parser

250. #### def xmlLiteralPattern(): Global.Tree

     Definition Classes
       SourceFileParser → Parser

251. #### object xmlSeqOK extends SeqContextSensitive

     For use from xml pattern, where sequence is allowed and encouraged.

     For use from xml pattern, where sequence is allowed and encouraged.

     Definition Classes
       Parser

252. #### def xmlSeqPatterns(): List[Global.Tree]

     Definition Classes
       Parser

253. #### def →[B](y: B): (UnitParser, B)

     Implicit information
       This member is added by an implicit conversion from UnitParser to ArrowAssoc[UnitParser] performed by method ArrowAssoc in scala.Predef.
     Definition Classes
       ArrowAssoc

### Deprecated Value Members

1. #### def finalize(): Unit

   Called by the garbage collector on the receiver object when there are no more references to the object.

   Called by the garbage collector on the receiver object when there are no more references to the object.

   The details of when and if the `finalize` method is invoked, as well as the interaction between `finalize` and non-local returns and exceptions, are all platform dependent.

   Attributes
     protected[java.lang]
   Definition Classes
     AnyRef
   Annotations
     @Deprecated @deprecated @throws( classOf[java.lang.Throwable] )
   Deprecated

     (Since version ) see corresponding Javadoc for more information.

   Note

     not specified by SLS as a member of AnyRef

2. #### def precedence(operator: Global.Name): Int

   Definition Classes
     Parser
   Annotations
     @deprecated
   Deprecated

     (Since version 2.11.0) Use `scala.reflect.internal.Precedence`

### Inherited from SourceFileParser

### Inherited from Parser

### Inherited from Parsers.ParserCommon

### Inherited from AnyRef

### Inherited from Any

### Inherited by implicit conversion any2stringadd from UnitParser to any2stringadd[UnitParser]

### Inherited by implicit conversion StringFormat from UnitParser to StringFormat[UnitParser]

### Inherited by implicit conversion Ensuring from UnitParser to Ensuring[UnitParser]

### Inherited by implicit conversion ArrowAssoc from UnitParser to ArrowAssoc[UnitParser]

### Ungrouped