Lab for Automated Reasoning and Analysis LARA

package toolc
package parser
 
object Trees {
  import analyzer.Symbols._
 
  sealed trait Tree extends Positional
 
  // You should 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, 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]
 
  // ...
}
 
cc10/lab06-trees.txt · Last modified: 2010/10/27 09:57 by philippe.suter
 
© EPFL 2018 - Legal notice