Class

io.chymyst.jc

ReactionMacros

Related Doc: package jc

Permalink

class ReactionMacros extends CommonMacros

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

Instance Constructors

  1. new ReactionMacros(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
  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.

  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
  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
  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) + ...

  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.

  7. object GuardVars extends scala.reflect.macros.Universe.Traverser

    Permalink
  8. object OtherOutputPatternF extends OutputPatternFlag with Product with Serializable

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

    Permalink
  10. object ReplaceVars extends scala.reflect.macros.Universe.Transformer

    Permalink
  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. val c: Context

    Permalink
    Definition Classes
    ReactionMacrosCommonMacros
  15. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  16. 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.

  17. final def eq(arg0: AnyRef): Boolean

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

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

    Permalink
  20. def finalize(): Unit

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

    Permalink
    Definition Classes
    AnyRef → Any
  22. 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.

  23. 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.

  24. 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
  25. def getNameImpl: scala.reflect.macros.Universe.Tree

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

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

    Permalink
  28. def hashCode(): Int

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

    Permalink
  30. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  31. 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

  32. 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.

    Annotations
    @tailrec()
  33. def isStaticReaction(pattern: scala.reflect.macros.Universe.Tree, guard: scala.reflect.macros.Universe.Tree, body: scala.reflect.macros.Universe.Tree): Boolean

    Permalink
  34. implicit val liftableInputPatternFlag: scala.reflect.macros.Universe.Liftable[InputPatternFlag]

    Permalink
  35. implicit val liftableOutputEnvironment: scala.reflect.macros.Universe.Liftable[OutputEnvironment]

    Permalink
  36. implicit val liftableOutputPatternType: scala.reflect.macros.Universe.Liftable[OutputPatternType]

    Permalink
  37. 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
  38. 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.

  39. def mergeGuards(treeVarsSeq: List[(scala.reflect.macros.Universe.Tree, List[scala.reflect.macros.Universe.Ident])]): Option[scala.reflect.macros.Universe.Tree]

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

    Permalink
  41. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  44. def rawTreeImpl(x: scala.reflect.macros.blackbox.Context.Expr[Any]): scala.reflect.macros.Universe.Tree

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

    Permalink
  46. final def synchronized[T0](arg0: ⇒ T0): T0

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

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

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

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

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

Inherited from CommonMacros

Inherited from AnyRef

Inherited from Any

Ungrouped