@@ -124,19 +124,42 @@ trait Core {
124124 /** Workaround missing `|` types in Scala 2 to represent `Term | TypeTree` */
125125 type TermOrTypeTree /* Term | TypeTree */
126126
127- /** Tree representing executable code written in the source */
127+ /** Tree representing code written in the source */
128128 type Tree
129+
130+ /** Tree representing a pacakage clause in the source code */
129131 type PackageClause <: Tree
132+
133+ /** Tree representing a statement in the source code */
130134 type Statement <: Tree
135+
136+ /** Tree representing an import in the source code */
131137 type Import <: Statement
138+
139+ /** Tree representing a definition in the source code. It can be `PackageDef`, `ClassDef`, `TypeDef`, `DefDef` or `ValDef`*/
132140 type Definition <: Statement
141+
142+ /** Tree representing a package definition. This includes definitions in all source files. */
133143 type PackageDef <: Definition
144+
145+ /** Tree representing a class definition. This includes annonymus class definitions and the class of a module object. */
134146 type ClassDef <: Definition
147+
148+ /** Tree representing a type (paramter or member) definition in the source code. */
135149 type TypeDef <: Definition
150+
151+ /** Tree representing a method definition in the source code. */
136152 type DefDef <: Definition
153+
154+ /** Tree representing a value definition in the source code. This inclues `val`, `lazy val`, `var`, `object` and parameter defintions. */
137155 type ValDef <: Definition
156+
157+ /** Tree representing an expression in the source code. */
138158 type Term <: Statement
139159
160+ // TODO Add subtype types of Term for documentation? Or support refined bindings and add the types.
161+
162+
140163 /** Branch of a pattern match or catch clause */
141164 type CaseDef
142165
@@ -145,30 +168,69 @@ trait Core {
145168
146169 /** Pattern tree of the pattern part of a CaseDef */
147170 type Pattern
171+
172+ /** Pattern representing a value. This includes `1`, ```x``` and `_` */
148173 type Value <: Pattern
174+
175+ /** Pattern representing a `_ @ _` binding. */
149176 type Bind <: Pattern
177+
178+ /** Pattern representing a `Xyz(...)` unapply. */
150179 type Unapply <: Pattern
180+
181+ /** Pattern representing `X | Y | ...` alternatives. */
151182 type Alternative <: Pattern
183+
184+ /** Pattern representing a `x: Y` type test. */
152185 type TypeTest <: Pattern
153186
154- /** Tree representing a type written in the source */
187+ /** Type tree representing a type or a bounds written in the source */
155188 type TypeOrBoundsTree
189+
190+ /** Type tree representing a type written in the source */
156191 type TypeTree <: TypeOrBoundsTree
192+
193+ // TODO Add subtype types of TypeTree for documentation? Or support refined bindings and add the types.
194+
195+
196+ /** Type tree representing a type bound written in the source */
157197 type TypeBoundsTree <: TypeOrBoundsTree
158198
199+ /** Type or bounds */
159200 type TypeOrBounds
201+
202+ /** NoPrefix for a type selection */
160203 type NoPrefix <: TypeOrBounds
204+
205+ /** Type bounds */
161206 type TypeBounds <: TypeOrBounds
207+
208+ /** A type */
162209 type Type <: TypeOrBounds
210+
211+ /** A type that is recursively defined */
163212 type RecursiveType <: Type
213+
164214 // TODO can we add the bound back without an cake?
165215 // TODO is LambdaType really needed? ParamRefExtractor could be split into more precise extractors
216+ /** Common abstraction for lambda types (MethodType, PolyType and TypeLambda). */
166217 type LambdaType [ParamInfo /* <: TypeOrBounds*/ ] <: Type
218+
219+ /** Type of the definition of a method taking a single list of parameters. It's return type may be a MethodType. */
167220 type MethodType <: LambdaType [Type ]
221+
222+ /** Type of the definition of a method taking a list of type parameters. It's return type may be a MethodType. */
168223 type PolyType <: LambdaType [TypeBounds ]
224+
225+ /** Type of the definition of a type lambda taking a list of type parameters. It's return type may be a TypeLambda. */
169226 type TypeLambda <: LambdaType [TypeBounds ]
170227
171228
229+ /** Import selectors:
230+ * * SimpleSelector: `.bar` in `import foo.bar`
231+ * * RenameSelector: `.{bar => baz}` in `import foo.{bar => baz}`
232+ * * OmitSelector: `.{bar => _}` in `import foo.{bar => _}`
233+ */
172234 type ImportSelector
173235
174236 /** Untyped identifier */
@@ -187,12 +249,26 @@ trait Core {
187249 * Then can be compared with == to know if the definition is the same.
188250 */
189251 type Symbol
252+
253+ /** Symbol of a package defnition */
190254 type PackageSymbol <: Symbol
255+
256+ /** Symbol of a class defnition. This includes annonymus class definitions and the class of a module object. */
191257 type ClassSymbol <: Symbol
258+
259+ /** Symbol of a type (paramter or member) definition. */
192260 type TypeSymbol <: Symbol
261+
262+ /** Symbol representing a method definition. */
193263 type DefSymbol <: Symbol
264+
265+ /** Symbol representing a value definition. This inclues `val`, `lazy val`, `var`, `object` and parameter defintions. */
194266 type ValSymbol <: Symbol
267+
268+ /** Symbol representing a bind definition. */
195269 type BindSymbol <: Symbol
270+
271+ /** No symbol availabe. */
196272 type NoSymbol <: Symbol
197273
198274}
0 commit comments