LARA

package minijava.parser
 
object Trees {
  import analyzer.Symbols._
 
  sealed trait Tree extends Positional
 
  // You should of course not copy this file into your project.
  // Rather, observe how the symbols of the proper symbol types are
  // attached to the trees, and reproduce this by adapting it to your own AST nodes. 
 
  // ...
 
  case class MainClass(id: Identifier, mainarg: Identifier, stat: StatTree) extends Tree with Symbolic[ClassSymbol]
  case class ClassDecl(id: Identifier, parent: Option[Identifier], vars: List[VarDecl], methods: List[MethodDecl]) extends Tree with Symbolic[ClassSymbol]
  case class VarDecl(tpe: TypeTree, id: Identifier) extends Tree with Symbolic[VariableSymbol]
  case class MethodDecl(retType: TypeTree, id: Identifier, args: List[Formal], vars: List[VarDecl], stats: 
 
  // ...
 
  case class Identifier(value: String) extends TypeTree with ExprTree with Symbolic[Symbol]
  case class This extends ExprTree with Symbolic[ClassSymbol]
 
  // ...
}