scalaParser

ScalaSyntax

class ScalaSyntax extends Parser with Basic with Identifiers with Literals

Parser for Scala syntax.

The G parameter that gets passed in to each rule stands for "Greedy", and determines whether or not that rule is to consume newlines after the last terminal in that rule. We need to pass it everywhere so it can go all the way to the last terminal deep inside the parse tree, which can then decide whether or not to consume whitespace.

The vast majority of terminals will consume newlines; only rules which occur in {} blocks won't have their terminals consume newlines, and only the *last* terminal in the rule will be affected. That's why the parser does terminals-consume-newlines-by-default, and leaves it up to the dev to thread the G variable where-ever we want the opposite behavior.

Linear Supertypes
Literals, Identifiers, Basic, Parser, RuleDSL, RuleDSLActions, RuleDSLCombinators, RuleDSLBasics, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ScalaSyntax
  2. Literals
  3. Identifiers
  4. Basic
  5. Parser
  6. RuleDSL
  7. RuleDSLActions
  8. RuleDSLCombinators
  9. RuleDSLBasics
  10. AnyRef
  11. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ScalaSyntax(input: ParserInput)

Type Members

  1. sealed trait ActionOperator[I <: HList, O <: HList, Ops] extends AnyRef

    Definition Classes
    RuleDSLActions
  2. type B = Boolean

  3. sealed trait CharRangeSupport extends AnyRef

    Definition Classes
    RuleDSLBasics
  4. sealed trait NTimes extends AnyRef

    Definition Classes
    RuleDSLCombinators
  5. type R0 = Rule[HNil, HNil]

  6. trait Repeated extends AnyRef

    Definition Classes
    RuleDSLCombinators
  7. trait WithSeparatedBy[I <: HList, O <: HList] extends AnyRef

    Definition Classes
    RuleDSLCombinators
  8. class __SubParserInput extends ParserInput

    Attributes
    protected
    Definition Classes
    Parser

Value Members

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

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. def &(r: Rule[_, _]): Rule0

    Definition Classes
    RuleDSLCombinators
    Annotations
    @compileTimeOnly( ... )
  4. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  5. def ANY: Rule0

    Definition Classes
    RuleDSLBasics
    Annotations
    @compileTimeOnly( ... )
  6. def AccessModifier: R0

  7. def AccessQualifier: R0

  8. def AnnotType: Rule[HNil, HNil]

  9. def Annotation: R0

  10. def ArgumentExprs: R0

  11. def Ascription: Rule[HNil, HNil]

  12. object Basic

    Definition Classes
    Basic
  13. def BasicType: R0

  14. def Binding: R0

  15. def Bindings: R0

  16. def Block: R0

  17. def BlockEnd: R0

  18. def BlockExpr: R0

  19. def BlockStat: R0

  20. def BlockStats: R0

  21. def CaseClause: R0

  22. def CaseClauses: R0

  23. def ClassDef: R0

  24. def ClassParam: R0

  25. def ClassParamClause: R0

  26. def ClassParamClauses: R0

  27. def ClassParams: R0

  28. def ClassParents: R0

  29. def ClassQualifier: Rule[HNil, HNil]

  30. def ClassTemplate: R0

  31. def ClassTemplateOpt: R0

  32. def CompilationUnit: Rule1[String]

  33. def CompoundType: Rule[HNil, HNil]

  34. def Constr: R0

  35. def ConstrAnnotation: R0

  36. def ConstrBlock: R0

  37. def ConstrExpr: R0

  38. def Dcl: R0

  39. def Def: R0

  40. def DoWhileCFlow: Rule[HNil, HNil]

  41. def EOI: Char

    Definition Classes
    RuleDSLBasics
  42. def EarlyDef: R0

  43. def EarlyDefs: R0

  44. def Enumerator: R0

  45. def Enumerators: R0

  46. def ExistentialClause: Rule[HNil, HNil]

  47. def ExistentialDcl: Rule[HNil, HNil]

  48. def Expr: R0

  49. def Expr1: R0

  50. def Exprs: R0

  51. def ForCFlow: Rule[HNil, HNil]

  52. def FunDcl: R0

  53. def FunDef: R0

  54. def FunSig: R0

  55. def FunTypeParamClause: R0

  56. def FunctionArgTypes: Rule[HNil, HNil]

  57. def Generator: R0

  58. def Guard: R0

  59. def Id: Rule[HNil, HNil]

  60. object Identifiers

    Definition Classes
    Identifiers
  61. def Ids: Rule[HNil, HNil]

  62. def IfCFlow: Rule[HNil, HNil]

  63. def Import: R0

  64. def ImportExpr: R0

  65. def ImportSelector: R0

  66. def ImportSelectors: R0

  67. def InfixExpr: R0

  68. def InfixType: Rule[HNil, HNil]

  69. object K

    Most keywords don't just require the correct characters to match, they have to ensure that subsequent characters *don't* match in order for it to be a keyword.

    Most keywords don't just require the correct characters to match, they have to ensure that subsequent characters *don't* match in order for it to be a keyword. This enforces that rule for key-words (W) and key-operators (O) which have different non-match criteria.

  70. object Key

    Most keywords don't just require the correct characters to match, they have to ensure that subsequent characters *don't* match in order for it to be a keyword.

    Most keywords don't just require the correct characters to match, they have to ensure that subsequent characters *don't* match in order for it to be a keyword. This enforces that rule for key-words (W) and key-operators (O) which have different non-match criteria.

    Definition Classes
    Basic
  71. def Literal: Rule[HNil, HNil]

  72. object Literals

    Definition Classes
    Literals
  73. def LocalModifier: R0

  74. def MATCH: Rule0

    Definition Classes
    RuleDSLBasics
  75. def MISMATCH[I <: HList, O <: HList]: Rule[I, O]

    Definition Classes
    RuleDSLBasics
  76. def MISMATCH0: Rule0

    Definition Classes
    RuleDSLBasics
  77. def Modifier: R0

  78. def Newline: Rule[HNil, HNil]

  79. def NotNewline: R0

  80. def ObjectDef: R0

  81. def PackageObject: R0

  82. def Packaging: R0

  83. def Param: R0

  84. def ParamClause: R0

  85. def ParamClauses: R0

  86. def ParamType: Rule[HNil, HNil]

  87. def Params: R0

  88. def PatDef: R0

  89. def PatVarDef: R0

  90. def Path: R0

  91. def Pattern: R0

  92. def Pattern1: R0

  93. def Pattern2: R0

  94. def Pattern3: R0

  95. def Patterns: R0

  96. def PostfixExpr: R0

  97. def PrefixExpr: Rule[HNil, HNil]

  98. def QualId: Rule[HNil, HNil]

  99. def RefineStat: Rule[HNil, HNil]

  100. def Refinement: Rule[HNil, HNil]

  101. def ResultExpr: R0

  102. def SelfInvocation: R0

  103. def SelfType: R0

  104. def Semi: Rule[HNil, HNil]

  105. def Semis: Rule[HNil, HNil]

  106. def SimpleExpr: R0

  107. def SimpleExpr1: Rule[HNil, HNil]

  108. def SimplePattern: R0

  109. def SimpleType: R0

  110. def StableId: R0

  111. def TemplateBody: R0

  112. def TemplateStat: R0

  113. def TmplDef: R0

  114. def TopPackageSeq: R0

  115. def TopStat: R0

  116. def TopStatSeq: R0

  117. def TraitDef: R0

  118. def TraitParents: R0

  119. def TraitTemplate: R0

  120. def TraitTemplateOpt: R0

  121. def TryCFlow: Rule[HNil, HNil]

  122. def Type: R0

  123. def TypeArgs: Rule[HNil, HNil]

  124. def TypeDcl: R0

  125. def TypeDef: R0

  126. def TypeParam: R0

  127. def TypeParamClause: R0

  128. def TypePat: Rule[HNil, HNil]

  129. def Types: Rule[HNil, HNil]

  130. def ValDcl: R0

  131. def VarDcl: R0

  132. def VarDef: R0

  133. def VarId: Rule[HNil, HNil]

  134. def VariantTypeParam: R0

  135. def WL: Rule[HNil, HNil]

    Parses whitespace, including newlines.

    Parses whitespace, including newlines. This is the default for most things

  136. def WS: Rule[HNil, HNil]

    Parses all whitespace, excluding newlines.

    Parses all whitespace, excluding newlines. This is only really useful in e.g. {} blocks, where we want to avoid capturing newlines so semicolon-inference would work

  137. def WhileCFlow: Rule[HNil, HNil]

  138. def __advance(): Boolean

    Definition Classes
    Parser
  139. def __collectingErrors: Boolean

    Definition Classes
    Parser
  140. def __enterNotPredicate: Int

    Definition Classes
    Parser
  141. def __exitNotPredicate(saved: Int): Unit

    Definition Classes
    Parser
  142. final def __matchAnyOf(string: String, ix: Int): Boolean

    Definition Classes
    Parser
    Annotations
    @tailrec()
  143. final def __matchIgnoreCaseString(string: String, ix: Int): Boolean

    Definition Classes
    Parser
    Annotations
    @tailrec()
  144. final def __matchIgnoreCaseStringWrapped(string: String, ruleName: String, ix: Int): Boolean

    Definition Classes
    Parser
    Annotations
    @tailrec()
  145. def __matchMap(m: Map[String, Any]): Boolean

    Definition Classes
    Parser
  146. def __matchMapWrapped(m: Map[String, Any], ruleName: String): Boolean

    Definition Classes
    Parser
  147. final def __matchNoneOf(string: String, ix: Int): Boolean

    Definition Classes
    Parser
    Annotations
    @tailrec()
  148. final def __matchString(string: String, ix: Int): Boolean

    Definition Classes
    Parser
    Annotations
    @tailrec()
  149. final def __matchStringWrapped(string: String, ruleName: String, ix: Int): Boolean

    Definition Classes
    Parser
    Annotations
    @tailrec()
  150. def __push(value: Any): Boolean

    Definition Classes
    Parser
  151. def __registerMismatch(): Boolean

    Definition Classes
    Parser
  152. def __restoreState(mark: Mark): Unit

    Definition Classes
    Parser
  153. def __run[L <: HList](rule: ⇒ RuleN[L])(implicit scheme: DeliveryScheme[L]): Result

    Definition Classes
    Parser
  154. def __saveState: Mark

    Definition Classes
    Parser
  155. def __updateMaxCursor(): Boolean

    Definition Classes
    Parser
  156. def anyOf(chars: String): Rule0

    Definition Classes
    RuleDSLBasics
    Annotations
    @compileTimeOnly( ... )
  157. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  158. def capture[I <: HList, O <: HList](r: Rule[I, O])(implicit p: Prepend[O, ::[String, HNil]]): Rule[I, Out]

    Definition Classes
    RuleDSLActions
    Annotations
    @compileTimeOnly( ... )
  159. implicit def ch(c: Char): Rule0

    Definition Classes
    RuleDSLBasics
    Annotations
    @compileTimeOnly( ... )
  160. def charAt(offset: Int): Char

    Definition Classes
    Parser
  161. def charAtRC(offset: Int): Char

    Definition Classes
    Parser
  162. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  163. def copyStateFrom(other: Parser, offset: Int): Unit

    Definition Classes
    Parser
  164. def cursor: Int

    Definition Classes
    Parser
  165. def cursorChar: Char

    Definition Classes
    Parser
  166. def drop[T](implicit h: HListable[T]): PopRule[Out]

    Definition Classes
    RuleDSLActions
    Annotations
    @compileTimeOnly( ... )
  167. final def eq(arg0: AnyRef): Boolean

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  170. def formatError(error: ParseError, showExpected: Boolean, showPosition: Boolean, showLine: Boolean, showTraces: Boolean): String

    Definition Classes
    Parser
  171. def formatErrorLine(error: ParseError): String

    Definition Classes
    Parser
  172. def formatErrorProblem(error: ParseError): String

    Definition Classes
    Parser
  173. final def getClass(): Class[_]

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

    Definition Classes
    AnyRef → Any
  175. def ignoreCase(s: String): Rule0

    Definition Classes
    RuleDSLBasics
    Annotations
    @compileTimeOnly( ... )
  176. def ignoreCase(c: Char): Rule0

    Definition Classes
    RuleDSLBasics
    Annotations
    @compileTimeOnly( ... )
  177. val input: ParserInput

    Definition Classes
    ScalaSyntax → Parser
  178. implicit def int2NTimes(i: Int): NTimes

    Definition Classes
    RuleDSLCombinators
    Annotations
    @compileTimeOnly( ... )
  179. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  180. def lastChar: Char

    Definition Classes
    Parser
  181. macro def namedRule[I <: HList, O <: HList](name: String)(r: Rule[I, O]): Rule[I, O]

    Definition Classes
    Parser
  182. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  183. def noneOf(chars: String): Rule0

    Definition Classes
    RuleDSLBasics
    Annotations
    @compileTimeOnly( ... )
  184. final def notify(): Unit

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

    Definition Classes
    AnyRef
  186. def oneOrMore[I <: HList, O <: HList](r: Rule[I, O])(implicit s: Lifter[Seq, I, O]): Rule[In, Out] with Repeated

    Definition Classes
    RuleDSLCombinators
    Annotations
    @compileTimeOnly( ... )
  187. def optional[I <: HList, O <: HList](r: Rule[I, O])(implicit o: Lifter[Option, I, O]): Rule[In, Out]

    Definition Classes
    RuleDSLCombinators
    Annotations
    @compileTimeOnly( ... )
  188. def pos: (Int, Char)

  189. def pr(s: String): Rule[HNil, HNil]

    helper printing function

  190. implicit def predicate(p: CharPredicate): Rule0

    Definition Classes
    RuleDSLBasics
    Annotations
    @compileTimeOnly( ... )
  191. def push[T](value: T)(implicit h: HListable[T]): RuleN[Out]

    Definition Classes
    RuleDSLActions
    Annotations
    @compileTimeOnly( ... )
  192. implicit def range2NTimes(range: Range): NTimes

    Definition Classes
    RuleDSLCombinators
    Annotations
    @compileTimeOnly( ... )
  193. macro def rule[I <: HList, O <: HList](r: Rule[I, O]): Rule[I, O]

    Definition Classes
    Parser
  194. implicit def rule2ActionOperator[I <: HList, O <: HList](r: Rule[I, O])(implicit ops: ActionOps[I, O]): ActionOperator[I, O, Out]

    Definition Classes
    RuleDSLActions
    Annotations
    @compileTimeOnly( ... )
  195. implicit def rule2WithSeparatedBy[I <: HList, O <: HList](r: Rule[I, O] with Repeated): WithSeparatedBy[I, O]

    Definition Classes
    RuleDSLCombinators
    Annotations
    @compileTimeOnly( ... )
  196. def run[T](arg: T)(implicit rr: RunResult[T]): Out

    Definition Classes
    RuleDSLActions
    Annotations
    @compileTimeOnly( ... )
  197. def runSubParser[I <: HList, O <: HList](f: (ParserInput) ⇒ Rule[I, O]): Rule[I, O]

    Definition Classes
    RuleDSLCombinators
    Annotations
    @compileTimeOnly( ... )
  198. implicit def str(s: String): Rule0

    Definition Classes
    RuleDSLBasics
    Annotations
    @compileTimeOnly( ... )
  199. implicit def str2CharRangeSupport(s: String): CharRangeSupport

    Definition Classes
    RuleDSLBasics
    Annotations
    @compileTimeOnly( ... )
  200. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  201. val t: Boolean

  202. def test(condition: Boolean): Rule0

    Definition Classes
    RuleDSLActions
    Annotations
    @compileTimeOnly( ... )
  203. def toString(): String

    Definition Classes
    AnyRef → Any
  204. implicit def valueMap[T](m: Map[String, T])(implicit h: HListable[T]): RuleN[Out]

    Definition Classes
    RuleDSLBasics
    Annotations
    @compileTimeOnly( ... )
  205. def valueStack: ValueStack

    Definition Classes
    Parser
  206. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  209. def zeroOrMore[I <: HList, O <: HList](r: Rule[I, O])(implicit s: Lifter[Seq, I, O]): Rule[In, Out] with Repeated

    Definition Classes
    RuleDSLCombinators
    Annotations
    @compileTimeOnly( ... )

Inherited from Literals

Inherited from Identifiers

Inherited from Basic

Inherited from Parser

Inherited from RuleDSL

Inherited from RuleDSLActions

Inherited from RuleDSLCombinators

Inherited from RuleDSLBasics

Inherited from AnyRef

Inherited from Any

Ungrouped