Class Core.Exp

Direct Known Subclasses:
Core.Apply, Core.Case, Core.Fn, Core.From, Core.Id, Core.Let, Core.Literal, Core.Local, Core.RecordSelector, Core.Tuple
Enclosing class:
Core

public abstract static class Core.Exp extends Core.BaseNode
Base class of core expressions.
  • Field Details

    • type

      public final Type type
  • Constructor Details

  • Method Details

    • forEachArg

      public void forEachArg(ObjIntConsumer<Core.Exp> action)
    • arg

      public Core.Exp arg(int i)
      Returns the ith argument.
    • type

      public Type type()
      Returns the type.
    • accept

      public abstract Core.Exp accept(Shuttle shuttle)
      Description copied from class: AstNode
      Accepts a shuttle, calling the Shuttle.visit(net.hydromatic.morel.ast.Ast.Literal) method appropriate to the type of this node, and returning the result.
      Overrides:
      accept in class Core.BaseNode
    • isConstant

      public boolean isConstant()
      Returns whether this expression is a constant.

      Examples include literals 1, true, constructors applied to constants, records and tuples whose arguments are constant.

    • isCallTo

      public boolean isCallTo(BuiltIn builtIn)
      Returns whether this expression is a call to the given built-in.