Class

io.chymyst.jc

BlackboxMacros

Related Doc: package jc

Permalink

final class BlackboxMacros extends ReactionMacros

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. BlackboxMacros
  2. ReactionMacros
  3. CommonMacros
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new BlackboxMacros(c: Context)

    Permalink

Type Members

  1. final case class ConstOutputPatternF(v: scala.reflect.macros.Universe.Tree) extends OutputPatternFlag with Product with Serializable

    Permalink
    Definition Classes
    CommonMacros
  2. final case class ConstantPatternF(v: scala.reflect.macros.Universe.Tree) extends InputPatternFlag with Product with Serializable

    Permalink

    The pattern represents a constant, which can be a literal constant such as "abc" or a compound type such as (2, 3) or (Some(2), 3, 4).

    The pattern represents a constant, which can be a literal constant such as "abc" or a compound type such as (2, 3) or (Some(2), 3, 4). The value v represents a value of the [T] type of M[T] or B[T,R].

    Definition Classes
    CommonMacros
  3. sealed trait InputPatternFlag extends AnyRef

    Permalink

    Describes the pattern matcher for input molecules.

    Describes the pattern matcher for input molecules. Possible values: WildcardF for case a(_) ⇒ SimpleVarF for case a(x) ⇒ ConstantPatternF for case a(1) ⇒ WrongReplyVarF: the reply matcher for blocking molecules is not a simple variable, e.g. case f(_, _) instead of case f(_, r) OtherInputPatternF: none of the above (could be a case class or a general unapply expression)

    Definition Classes
    CommonMacros
  4. type MacroSymbol = scala.reflect.macros.Universe.Symbol

    Permalink
    Definition Classes
    ReactionMacros
  5. class MoleculeInfo extends scala.reflect.macros.Universe.Traverser

    Permalink

    This is the main traverser that gathers information about molecule inputs and outputs in a reaction.

    This is the main traverser that gathers information about molecule inputs and outputs in a reaction.

    Definition Classes
    ReactionMacros
  6. final case class OtherInputPatternF(matcher: scala.reflect.macros.Universe.Tree, guard: Option[scala.reflect.macros.Universe.Tree], vars: List[scala.reflect.macros.Universe.Ident]) extends InputPatternFlag with Product with Serializable

    Permalink

    Nontrivial pattern matching expression that could contain unapply, destructuring, and pattern @ variables.

    Nontrivial pattern matching expression that could contain unapply, destructuring, and pattern @ variables. For instance, if c is a molecule with values of type (Int, Option[Int]) then and example of nontrivial pattern match could be c( z@(x, Some(y)) ). In this example, we will have vars = List("z", "x", "y") and matcher = { case z@(x, Some(y)) => (z, x, y) }.

    matcher

    Tree of a partial function of type Any => Any.

    guard

    None if the pattern is irrefutable; Some(guard expression tree) if the pattern is not irrefutable and potentially requires a guard condition.

    vars

    List of pattern variables in the order of their appearance in the syntax tree.

    Definition Classes
    CommonMacros
  7. sealed trait OutputPatternFlag extends AnyRef

    Permalink

    Describes the pattern matcher for output molecules.

    Describes the pattern matcher for output molecules. This flag is used only within the macro code and is not exported to compiled code. The corresponding value of type OutputPatternType is exported to compiled code of the Reaction instance.

    Possible values: ConstOutputPatternF(x): a(123) or a(Some(4)), etc. OtherOutputPatternF: a(x), a(x+y), or any other kind of expression. EmptyOutputPatternF: no argument given, i.e. bare molecule emitter value or reply emitter value

    Definition Classes
    CommonMacros
  8. class ReplaceStaticEmits extends scala.reflect.macros.Universe.Transformer

    Permalink
    Definition Classes
    ReactionMacros
  9. final case class ReplyVarF(replyVar: scala.reflect.macros.Universe.Ident) extends InputPatternFlag with Product with Serializable

    Permalink

    Represents a reply pattern consisting of a simple variable.

    Represents a reply pattern consisting of a simple variable.

    replyVar

    The Ident of a reply pattern variable.

    Definition Classes
    CommonMacros
  10. type ScalaSymbol = Symbol

    Permalink
    Definition Classes
    ReactionMacros
  11. final case class SimpleVarF(v: scala.reflect.macros.Universe.Ident, binder: scala.reflect.macros.Universe.Tree, cond: Option[scala.reflect.macros.Universe.Tree]) extends InputPatternFlag with Product with Serializable

    Permalink

    Represents a pattern match with a simple pattern variable, such as a(x)

    Represents a pattern match with a simple pattern variable, such as a(x)

    v

    The Ident of the pattern variable.

    Definition Classes
    CommonMacros

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. object DetectInvalidInputGrouping extends scala.reflect.macros.Universe.Traverser

    Permalink

    Input molecules in a reaction must be given using a chemical notation such as a(x) + b(y) + c(z) => ....

    Input molecules in a reaction must be given using a chemical notation such as a(x) + b(y) + c(z) => .... It is an error to group input molecules such as a(x) + (b(y) + c(z)) => ..., or to use pattern grouping such as q @ a(x) + ...

    Definition Classes
    ReactionMacros
  5. object EmptyOutputPatternF extends OutputPatternFlag with Product with Serializable

    Permalink
    Definition Classes
    CommonMacros
  6. object GetReactionCases extends scala.reflect.macros.Universe.Traverser

    Permalink

    Obtain the list of case expressions in a reaction.

    Obtain the list of case expressions in a reaction. There should be only one case expression.

    Definition Classes
    ReactionMacros
  7. object GuardVars extends scala.reflect.macros.Universe.Traverser

    Permalink
    Definition Classes
    ReactionMacros
  8. object OtherOutputPatternF extends OutputPatternFlag with Product with Serializable

    Permalink
    Definition Classes
    CommonMacros
  9. object PatternVars extends scala.reflect.macros.Universe.Traverser

    Permalink
    Definition Classes
    ReactionMacros
  10. object ReplaceVars extends scala.reflect.macros.Universe.Transformer

    Permalink
    Definition Classes
    ReactionMacros
  11. object WildcardF extends InputPatternFlag with Product with Serializable

    Permalink
    Definition Classes
    CommonMacros
  12. object WrongReplyVarF extends InputPatternFlag with Product with Serializable

    Permalink

    Represents an error situation.

    Represents an error situation. The reply pseudo-molecule must be bound to a simple variable, but we found another pattern instead.

    Definition Classes
    CommonMacros
  13. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  14. def buildReactionImpl(reactionBody: scala.reflect.macros.blackbox.Context.Expr[ReactionBody]): scala.reflect.macros.blackbox.Context.Expr[Reaction]

    Permalink
  15. def buildReactionValueImpl(reactionBody: scala.reflect.macros.blackbox.Context.Expr[ReactionBody], pattern: scala.reflect.macros.Universe.Tree, guard: scala.reflect.macros.Universe.Tree, body: scala.reflect.macros.Universe.Tree): scala.reflect.macros.blackbox.Context.Expr[Reaction]

    Permalink
  16. val c: Context

    Permalink
    Definition Classes
    BlackboxMacrosReactionMacrosCommonMacros
  17. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  18. def convertToCNF(term: scala.reflect.macros.Universe.Tree): List[List[scala.reflect.macros.Universe.Tree]]

    Permalink

    Convert a term to conjunctive normal form (CNF).

    Convert a term to conjunctive normal form (CNF). CNF is represented as a list of lists of Boolean term trees. For example, List( List(q"x>0", q"y<x"), List(q"x>z", q"z<1") ) represents ( x > 0 || y < x ) && ( x > z || z < 1).

    term

    Initial expression tree.

    returns

    Equivalent expression in CNF. Terms will be duplicated when necessary. No simplification is performed on terms.

    Definition Classes
    ReactionMacros
  19. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  20. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  21. def equalsInMacro(a: Any, b: Any): Boolean

    Permalink
    Definition Classes
    ReactionMacros
  22. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  23. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  24. def getConstantTree(exprTree: Tree): Option[Tree]

    Permalink

    Detect whether an expression tree represents a constant expression.

    Detect whether an expression tree represents a constant expression. A constant expression is either a literal constant (Int, String, Symbol, etc.), (), None, Nil, or Some(...), Left(...), Right(...), List(...), and tuples of constant expressions.

    exprTree

    Binder pattern tree or expression tree.

    returns

    Some(tree) if the expression represents a constant of the recognized form. Here tree will be a quoted expression tree (not a binder tree). None otherwise.

    Definition Classes
    ReactionMacros
  25. def getCurrentSymbolOwner: MacroSymbol

    Permalink

    Obtain the owner of the current macro call site.

    Obtain the owner of the current macro call site.

    returns

    The owner symbol of the current macro call site.

    Definition Classes
    ReactionMacros
  26. def getEnclosingName: String

    Permalink

    Detect the enclosing name of an expression.

    Detect the enclosing name of an expression. For example: val x = "name is " + getName will set x to the string "name is x".

    returns

    String that represents the name of the enclosing value.

    Definition Classes
    CommonMacros
  27. def getNameImpl: scala.reflect.macros.Universe.Tree

    Permalink
    Definition Classes
    CommonMacros
  28. def getSimpleVar(binderTerm: scala.reflect.macros.Universe.Tree): scala.reflect.macros.Universe.Ident

    Permalink
    Definition Classes
    ReactionMacros
  29. def guardVarsConstrainOnlyThisMolecule(guardVarList: List[scala.reflect.macros.Universe.Ident], moleculeFlag: InputPatternFlag): Boolean

    Permalink
    Definition Classes
    ReactionMacros
  30. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  31. def identToScalaSymbol(ident: scala.reflect.macros.Universe.Ident): ScalaSymbol

    Permalink
    Definition Classes
    ReactionMacros
  32. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  33. def isIrrefutablePattern(binderTerm: scala.reflect.macros.Universe.Tree): Boolean

    Permalink

    Detect whether a pattern-matcher expression tree represents an irrefutable pattern.

    Detect whether a pattern-matcher expression tree represents an irrefutable pattern. For example, Some(_) is refutable because it does not match None. The pattern (_, x, y, (z, _)) is irrefutable. Patterns with single-case-classes are irrefutable.

    binderTerm

    Binder pattern tree.

    returns

    true or false

    Definition Classes
    ReactionMacros
  34. final def isOwnedBy(s: MacroSymbol, owner: MacroSymbol): Boolean

    Permalink

    Detect whether the symbol s is defined inside the scope of the symbol owner.

    Detect whether the symbol s is defined inside the scope of the symbol owner. Will return true for code like val owner = .... { val s = ... }

    s

    Symbol to be examined.

    owner

    Owner symbol of the scope to be examined.

    returns

    True if s is defined inside the scope of owner.

    Definition Classes
    ReactionMacros
    Annotations
    @tailrec()
  35. def isStaticReaction(pattern: scala.reflect.macros.Universe.Tree, guard: scala.reflect.macros.Universe.Tree, body: scala.reflect.macros.Universe.Tree): Boolean

    Permalink
    Definition Classes
    ReactionMacros
  36. implicit val liftableInputPatternFlag: scala.reflect.macros.Universe.Liftable[InputPatternFlag]

    Permalink
    Definition Classes
    ReactionMacros
  37. implicit val liftableOutputEnvironment: scala.reflect.macros.Universe.Liftable[OutputEnvironment]

    Permalink
    Definition Classes
    ReactionMacros
  38. implicit val liftableOutputPatternType: scala.reflect.macros.Universe.Liftable[OutputPatternType]

    Permalink
    Definition Classes
    ReactionMacros
  39. def matcherFunction(binderTerm: scala.reflect.macros.Universe.Tree, guardTree: scala.reflect.macros.Universe.Tree, vars: List[scala.reflect.macros.Universe.Ident]): scala.reflect.macros.Universe.Tree

    Permalink
    Definition Classes
    ReactionMacros
  40. def maybeError[T](what: String, patternWhat: String, molecules: Seq[T], connector: String = "not contain a pattern that", method: (scala.reflect.macros.blackbox.Context.Position, String) ⇒ Unit = c.error): Unit

    Permalink

    Build an error message about incorrect usage of chemical notation.

    Build an error message about incorrect usage of chemical notation. The phrase looks like this: (Beginning of phrase) must (Phrase connector) (What was incorrect) (molecule list)

    T

    Type of molecule or other object.

    what

    Beginning of phrase.

    patternWhat

    What was incorrect about the molecule usage.

    molecules

    List of molecules (or other objects) that were incorrectly used.

    connector

    Phrase connector. By default: "not contain a pattern that".

    method

    How to report the error; by default, will use c.error.

    Definition Classes
    ReactionMacros
  41. def mergeGuards(treeVarsSeq: List[(scala.reflect.macros.Universe.Tree, List[scala.reflect.macros.Universe.Ident])]): Option[scala.reflect.macros.Universe.Tree]

    Permalink
    Definition Classes
    ReactionMacros
  42. def moleculeIndicesConstrainedByGuard(guardVarList: List[scala.reflect.macros.Universe.Ident], inputMoleculeFlags: List[InputPatternFlag]): List[Int]

    Permalink
    Definition Classes
    ReactionMacros
  43. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  44. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  45. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  46. def printRawPatternType(p: OutputPatternType): String

    Permalink
  47. def rawTreeImpl(x: scala.reflect.macros.blackbox.Context.Expr[Any]): scala.reflect.macros.Universe.Tree

    Permalink
    Definition Classes
    CommonMacros
  48. def reportError(message: String): Unit

    Permalink
    Definition Classes
    ReactionMacros
  49. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  50. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  51. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  52. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  53. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from ReactionMacros

Inherited from CommonMacros

Inherited from AnyRef

Inherited from Any

Ungrouped