Class ExpressionTemplate

All Implemented Interfaces:
Unifiable<>, Serializable

public abstract class ExpressionTemplate extends Template<> implements Unifiable<>
Implementation of a template to match and replace an expression anywhere in an AST.
Author: (Louis Wasserman)
See Also:
  • Constructor Details

    • ExpressionTemplate

      public ExpressionTemplate()
  • Method Details

    • create

      public static ExpressionTemplate create(UExpression expression, UType returnType)
    • create

      public static ExpressionTemplate create(Map<String,? extends UType> expressionArgumentTypes, UExpression expression, UType returnType)
    • create

      public static ExpressionTemplate create(<Annotation> annotations, Iterable<UTypeVar> typeVariables, Map<String,? extends UType> expressionArgumentTypes, UExpression expression, UType returnType)
    • generateNegation

      public boolean generateNegation()
    • negation

      public ExpressionTemplate negation()
    • match

      public Iterable<> match( target, context)
      Returns the matches of this template against the specified target AST.
      Specified by:
      match in class Template<>
    • unify

      public Choice<Unifier> unify( target, Unifier unifier)
      Description copied from interface: Unifiable
      Returns all valid unification paths (if any) from this Unifier that unify this with target.
      Specified by:
      unify in interface Unifiable<>
    • replace

      public Fix replace( match)
      Generates a SuggestedFix replacing the specified match (usually of another template) with this template.
      Specified by:
      replace in class Template<>