NominalTreeModule

amyc.ast.NominalTreeModule$
object NominalTreeModule extends TreeModule

A module containing trees where the names have not been resolved. Instantiates Name to String and QualifiedName to a pair of Strings representing (module, name) (where module is optional)

Attributes

Graph
Supertypes
trait TreeModule
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

case class QualifiedName(module: Option[String], name: String)

Represents a name within an module

Represents a name within an module

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Inherited classlikes

case class AbstractClassDef(name: Name) extends ClassOrFunDef

Attributes

Inherited from:
TreeModule
Supertypes
trait Serializable
trait Product
trait Equals
trait Definition
trait Tree
trait Positioned
class Object
trait Matchable
class Any
Show all
case class BooleanLiteral(value: Boolean) extends Literal[Boolean]

Attributes

Inherited from:
TreeModule
Supertypes
trait Serializable
trait Product
trait Equals
trait Literal[Boolean]
trait Expr
trait Tree
trait Positioned
class Object
trait Matchable
class Any
Show all
case class Call(qname: QualifiedName, args: List[Expr]) extends Expr

Function/constructor call

Function/constructor call

Attributes

Inherited from:
TreeModule
Supertypes
trait Serializable
trait Product
trait Equals
trait Expr
trait Tree
trait Positioned
class Object
trait Matchable
class Any
Show all
case class CaseClassDef(name: Name, fields: List[ParamDef], parent: Name) extends ClassOrFunDef

Attributes

Inherited from:
TreeModule
Supertypes
trait Serializable
trait Product
trait Equals
trait Definition
trait Tree
trait Positioned
class Object
trait Matchable
class Any
Show all
case class CaseClassPattern(constr: QualifiedName, args: List[Pattern]) extends Pattern

Attributes

Inherited from:
TreeModule
Supertypes
trait Serializable
trait Product
trait Equals
class Pattern
trait Tree
trait Positioned
class Object
trait Matchable
class Any
Show all
trait ClassOrFunDef extends Definition

Attributes

Inherited from:
TreeModule
Supertypes
trait Definition
trait Tree
trait Positioned
class Object
trait Matchable
class Any
Show all
Known subtypes
case class ClassTypeTree(qname: QualifiedName) extends TypeTree

Represent a ClassType such as O.Option or String

Represent a ClassType such as O.Option or String

Attributes

Inherited from:
TreeModule
Supertypes
trait Serializable
trait Product
trait Equals
trait TypeTree
trait Tree
trait Positioned
class Object
trait Matchable
class Any
Show all
sealed trait Definition extends Tree

TODO

TODO

Attributes

Inherited from:
TreeModule
Supertypes
trait Tree
trait Positioned
class Object
trait Matchable
class Any
Known subtypes
class CaseClassDef
class FunDef
class ModuleDef
class ParamDef
Show all
case class EmptyExpr() extends Expr

Empty expression

Empty expression

Attributes

Inherited from:
TreeModule
Supertypes
trait Serializable
trait Product
trait Equals
trait Expr
trait Tree
trait Positioned
class Object
trait Matchable
class Any
Show all
case class Error(msg: Expr) extends Expr

Represents a computational error; prints its message, then exits

Represents a computational error; prints its message, then exits

Attributes

Inherited from:
TreeModule
Supertypes
trait Serializable
trait Product
trait Equals
trait Expr
trait Tree
trait Positioned
class Object
trait Matchable
class Any
Show all
sealed trait Expr extends Tree

Base type for all the expressions in Amy

Base type for all the expressions in Amy

Attributes

Inherited from:
TreeModule
Supertypes
trait Tree
trait Positioned
class Object
trait Matchable
class Any
Known subtypes
class Call
class EmptyExpr
class Error
class FunRef
class InfixCall
class Ite
class Let
trait Literal[T]
class IntLiteral
class UnitLiteral
class Match
class Neg
class Not
class Sequence
class Variable
Show all
case class FunDef(name: Name, params: List[ParamDef], retType: TypeTree, body: Expr) extends ClassOrFunDef

Attributes

Inherited from:
TreeModule
Supertypes
trait Serializable
trait Product
trait Equals
trait Definition
trait Tree
trait Positioned
class Object
trait Matchable
class Any
Show all
case class FunRef(name: QualifiedName) extends Expr

Function references (Module::function_name)

Function references (Module::function_name)

Attributes

Inherited from:
TreeModule
Supertypes
trait Serializable
trait Product
trait Equals
trait Expr
trait Tree
trait Positioned
class Object
trait Matchable
class Any
Show all
case class FunctionTypeTree(args: List[TypeTree], rte: TypeTree) extends TypeTree

Represents a FunctionType such as (String) => String

Represents a FunctionType such as (String) => String

Attributes

Inherited from:
TreeModule
Supertypes
trait Serializable
trait Product
trait Equals
trait TypeTree
trait Tree
trait Positioned
class Object
trait Matchable
class Any
Show all
case class IdPattern(name: Name) extends Pattern

Attributes

Inherited from:
TreeModule
Supertypes
trait Serializable
trait Product
trait Equals
class Pattern
trait Tree
trait Positioned
class Object
trait Matchable
class Any
Show all
case class InfixCall(lhs: Expr, op: Name, rhs: Expr) extends Expr

Represents an Infix call to a function For now, we only use it for operators.

Represents an Infix call to a function For now, we only use it for operators.

It should be desugared to a Call(op, List(lhs, rhs))

Attributes

Inherited from:
TreeModule
Supertypes
trait Serializable
trait Product
trait Equals
trait Expr
trait Tree
trait Positioned
class Object
trait Matchable
class Any
Show all
case class IntLiteral(value: Int) extends Literal[Int]

Attributes

Inherited from:
TreeModule
Supertypes
trait Serializable
trait Product
trait Equals
trait Literal[Int]
trait Expr
trait Tree
trait Positioned
class Object
trait Matchable
class Any
Show all
case class Ite(cond: Expr, thenn: Expr, elze: Expr) extends Expr

If-then-else

If-then-else

Attributes

Inherited from:
TreeModule
Supertypes
trait Serializable
trait Product
trait Equals
trait Expr
trait Tree
trait Positioned
class Object
trait Matchable
class Any
Show all
case class Let(df: ParamDef, value: Expr, body: Expr) extends Expr

Local variable definition

Local variable definition

Attributes

Inherited from:
TreeModule
Supertypes
trait Serializable
trait Product
trait Equals
trait Expr
trait Tree
trait Positioned
class Object
trait Matchable
class Any
Show all
sealed trait Literal[+T](value: T) extends Expr

Represent a Literal (Int, Boolean, String or Unit)

Represent a Literal (Int, Boolean, String or Unit)

Attributes

Inherited from:
TreeModule
Supertypes
trait Expr
trait Tree
trait Positioned
class Object
trait Matchable
class Any
Show all
Known subtypes
case class LiteralPattern[+T](lit: Literal[T]) extends Pattern

Attributes

Inherited from:
TreeModule
Supertypes
trait Serializable
trait Product
trait Equals
class Pattern
trait Tree
trait Positioned
class Object
trait Matchable
class Any
Show all
case class Match(scrut: Expr, cases: List[MatchCase]) extends Expr

Pattern matching

Pattern matching

Attributes

Inherited from:
TreeModule
Supertypes
trait Serializable
trait Product
trait Equals
trait Expr
trait Tree
trait Positioned
class Object
trait Matchable
class Any
Show all
case class MatchCase(pat: Pattern, expr: Expr) extends Tree

Cases and patterns for Match expressions

Cases and patterns for Match expressions

Attributes

Inherited from:
TreeModule
Supertypes
trait Serializable
trait Product
trait Equals
trait Tree
trait Positioned
class Object
trait Matchable
class Any
Show all
case class ModuleDef(name: Name, defs: List[ClassOrFunDef], optExpr: Option[Expr]) extends Definition

Attributes

Inherited from:
TreeModule
Supertypes
trait Serializable
trait Product
trait Equals
trait Definition
trait Tree
trait Positioned
class Object
trait Matchable
class Any
Show all
case class Neg(e: Expr) extends Expr

Represents a -(expr)

Represents a -(expr)

Attributes

Inherited from:
TreeModule
Supertypes
trait Serializable
trait Product
trait Equals
trait Expr
trait Tree
trait Positioned
class Object
trait Matchable
class Any
Show all
case class Not(e: Expr) extends Expr

Represents a !(expr)

Represents a !(expr)

Attributes

Inherited from:
TreeModule
Supertypes
trait Serializable
trait Product
trait Equals
trait Expr
trait Tree
trait Positioned
class Object
trait Matchable
class Any
Show all
case class ParamDef(name: Name, tt: TypeTree) extends Definition

Attributes

Inherited from:
TreeModule
Supertypes
trait Serializable
trait Product
trait Equals
trait Definition
trait Tree
trait Positioned
class Object
trait Matchable
class Any
Show all
sealed abstract class Pattern extends Tree

Base Type to represent a pattern

Base Type to represent a pattern

Attributes

Inherited from:
TreeModule
Supertypes
trait Tree
trait Positioned
class Object
trait Matchable
class Any
Known subtypes
case class Program(modules: List[ModuleDef]) extends Tree

Root of the AST, we only have one Program with multiple modules

Root of the AST, we only have one Program with multiple modules

Attributes

Inherited from:
TreeModule
Supertypes
trait Serializable
trait Product
trait Equals
trait Tree
trait Positioned
class Object
trait Matchable
class Any
Show all
case class Sequence(e1: Expr, e2: Expr) extends Expr

The ; operator

The ; operator

Attributes

Inherited from:
TreeModule
Supertypes
trait Serializable
trait Product
trait Equals
trait Expr
trait Tree
trait Positioned
class Object
trait Matchable
class Any
Show all
case class StringLiteral(value: String) extends Literal[String]

Attributes

Inherited from:
TreeModule
Supertypes
trait Serializable
trait Product
trait Equals
trait Literal[String]
trait Expr
trait Tree
trait Positioned
class Object
trait Matchable
class Any
Show all
case class TTypeTree(tpe: Type) extends TypeTree

Attributes

Inherited from:
TreeModule
Supertypes
trait Serializable
trait Product
trait Equals
trait TypeTree
trait Tree
trait Positioned
class Object
trait Matchable
class Any
Show all
sealed trait Tree extends Positioned

Base type for all the AST nodes

Base type for all the AST nodes

Attributes

Inherited from:
TreeModule
Supertypes
trait Positioned
class Object
trait Matchable
class Any
Known subtypes
trait Definition
class CaseClassDef
class FunDef
class ModuleDef
class ParamDef
trait Expr
class Call
class EmptyExpr
class Error
class FunRef
class InfixCall
class Ite
class Let
trait Literal[T]
class IntLiteral
class UnitLiteral
class Match
class Neg
class Not
class Sequence
class Variable
class MatchCase
class Pattern
class IdPattern
class LiteralPattern[T]
class Program
trait TypeTree
class TTypeTree
Show all
trait TypeTree extends Tree

Base Type to represent type node

Base Type to represent type node

Attributes

Inherited from:
TreeModule
Supertypes
trait Tree
trait Positioned
class Object
trait Matchable
class Any
Known subtypes
case class UnitLiteral() extends Literal[Unit]

Attributes

Inherited from:
TreeModule
Supertypes
trait Serializable
trait Product
trait Equals
trait Literal[Unit]
trait Expr
trait Tree
trait Positioned
class Object
trait Matchable
class Any
Show all
case class Variable(name: Name) extends Expr

Represents an access to a variable

Represents an access to a variable

Attributes

Inherited from:
TreeModule
Supertypes
trait Serializable
trait Product
trait Equals
trait Expr
trait Tree
trait Positioned
class Object
trait Matchable
class Any
Show all
case class WildcardPattern() extends Pattern

Attributes

Inherited from:
TreeModule
Supertypes
trait Serializable
trait Product
trait Equals
class Pattern
trait Tree
trait Positioned
class Object
trait Matchable
class Any
Show all

Types

type Name = String

Represents the type for the name for this tree module.

Represents the type for the name for this tree module.

Attributes