StatementsCache

org.encalmo.utils.StatementsCache
See theStatementsCache companion object
class StatementsCache(val cacheId: String = ...)(implicit val quotes: Quotes)

A cache for statements and symbols. It can be nested to create a hierarchy of caches. Captures Quotes context.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def asExprOf[T : Type]: Expr[T]
def asExprOf[T : Type](returnExpr: Expr[T]): Expr[T]
def asTerm: quotes.reflect.Term

Convert the statements list to a term, otherwise abort with an error.

Convert the statements list to a term, otherwise abort with an error.

Attributes

def asTermOf(outer: StatementsCache): outer.quotes.reflect.Term

Convert the statements list to a term of the outer cache type, otherwise abort with an error.

Convert the statements list to a term of the outer cache type, otherwise abort with an error.

Attributes

def createMethodOf[T : Type](methodName: String, parameterNames: List[String], parameterTypes: List[quotes.reflect.TypeRepr], minMethodLinesCount: Int, buildMethodBody: StatementsCache ?=> List[quotes.reflect.Tree] => Unit, scope: Scope = ...): Either[Boolean, quotes.reflect.Ref]

Lookup or create a new method of type T and return the method call, if any

Lookup or create a new method of type T and return the method call, if any

Attributes

Create a nested statements cache that fallbacks to lookup in the outer cache if statement or symbol is not found in the nested cache. Lists of statements stay separated.

Create a nested statements cache that fallbacks to lookup in the outer cache if statement or symbol is not found in the nested cache. Lists of statements stay separated.

Attributes

def getSymbol(symbolName: String): quotes.reflect.Symbol

Lookup symbol by name and return the symbol, otherwise abort with an error.

Lookup symbol by name and return the symbol, otherwise abort with an error.

Attributes

def getSymbol(symbolName: String, symbolBody: => quotes.reflect.Symbol): quotes.reflect.Symbol

Lookup or create a new symbol and add it to the statements list, then return the symbol

Lookup or create a new symbol and add it to the statements list, then return the symbol

Attributes

def getValueRef(valueName: String): quotes.reflect.Ref

Lookup value reference by name and return the reference, otherwise abort with an error.

Lookup value reference by name and return the reference, otherwise abort with an error.

Attributes

def getValueRefOfExpr[T : Type](valueName: String, valueBody: => Expr[T], scope: Scope = ...): quotes.reflect.Ref

Lookup or create a new value reference of type T and add the value definition to the statements list, then return the value reference

Lookup or create a new value reference of type T and add the value definition to the statements list, then return the value reference

Attributes

def getValueRefOfTerm[T : Type](valueName: String, valueBody: => quotes.reflect.Term, scope: Scope = ...): quotes.reflect.Ref

Lookup or create a new value reference of type T and add the value definition to the statements list, then return the value reference

Lookup or create a new value reference of type T and add the value definition to the statements list, then return the value reference

Attributes

def inlineMethodBody(parameters: List[quotes.reflect.Term], buildMethodBody: StatementsCache ?=> List[quotes.reflect.Tree] => Unit): Unit
def lookupStatement(name: String): Option[quotes.reflect.Statement]

Lookup a method or value by name.

Lookup a method or value by name.

Attributes

def lookupSymbol(name: String): Option[quotes.reflect.Symbol]

Lookup a symbol by name.

Lookup a symbol by name.

Attributes

def put(statement: quotes.reflect.Statement): Unit
def putAll(statements: Iterable[quotes.reflect.Statement]): Unit
def putMethodCall(methodName: String, parameters: List[quotes.reflect.Term]): Unit

Lookup named method call of type Unit and add to the statements list, otherwise abort with an error.

Lookup named method call of type Unit and add to the statements list, otherwise abort with an error.

Attributes

def putMethodCallOf[T : Type](methodName: String, parameterNames: List[String], parameterTypes: List[quotes.reflect.TypeRepr], parameters: List[quotes.reflect.Term], minMethodLinesCount: Int, buildMethodBody: StatementsCache ?=> List[quotes.reflect.Tree] => Unit, scope: Scope): Unit

Lookup or create a new method of type T and add the method call to the statements list

Lookup or create a new method of type T and add the method call to the statements list

Attributes

def putMethodCallOf[T : Type](methodName: String, parameterNames: List[String], parameterTypes: List[quotes.reflect.TypeRepr], parameters: List[quotes.reflect.Term], buildMethodBody: StatementsCache ?=> List[quotes.reflect.Tree] => Unit, scope: Scope = ...): Unit

Lookup or create a new method of type T and add the method call to the statements list

Lookup or create a new method of type T and add the method call to the statements list

Attributes

def putParamlessMethodCallOf[T : Type](methodName: String, minMethodLinesCount: Int, buildMethodBody: StatementsCache ?=> Unit, scope: Scope): Unit

Lookup or create a new method of type T and add the method call to the statements list

Lookup or create a new method of type T and add the method call to the statements list

Attributes

def putParamlessMethodCallOf[T : Type](methodName: String, buildMethodBody: StatementsCache ?=> Unit, scope: Scope = ...): Unit

Lookup or create a new method of type T and add the method call to the statements list

Lookup or create a new method of type T and add the method call to the statements list

Attributes

def stringLiteral(value: String): quotes.reflect.Literal
def toList: List[quotes.reflect.Statement]
def typeRepr: quotes.reflect.TypeRepr
def unit: quotes.reflect.Literal

Concrete fields

Implicits

Implicits

implicit val quotes: Quotes