Package hydra.ast

Class SeqExpr

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<SeqExpr>

    public class SeqExpr
    extends java.lang.Object
    implements java.io.Serializable, java.lang.Comparable<SeqExpr>
    A sequence of expressions joined by a separator operator. Unlike OpExpr, parenthesize ignores SeqExpr boundaries.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.util.List<Expr> elements
      The expressions to join
      static Name ELEMENTS
      Name of the hydra.ast.SeqExpr.elements field.
      Op op
      The separator operator
      static Name OP
      Name of the hydra.ast.SeqExpr.op field.
      static Name TYPE_
      Name of the hydra.ast.SeqExpr type.
    • Constructor Summary

      Constructors 
      Constructor Description
      SeqExpr​(Op op, java.util.List<Expr> elements)
      Constructs an immutable SeqExpr.
    • Field Detail

      • TYPE_

        public static final Name TYPE_
        Name of the hydra.ast.SeqExpr type.
      • OP

        public static final Name OP
        Name of the hydra.ast.SeqExpr.op field.
      • ELEMENTS

        public static final Name ELEMENTS
        Name of the hydra.ast.SeqExpr.elements field.
      • op

        public final Op op
        The separator operator
      • elements

        public final java.util.List<Expr> elements
        The expressions to join
    • Constructor Detail

      • SeqExpr

        public SeqExpr​(Op op,
                       java.util.List<Expr> elements)
        Constructs an immutable SeqExpr.
        Parameters:
        op - The separator operator
        elements - The expressions to join
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • compareTo

        public int compareTo​(SeqExpr other)
        Specified by:
        compareTo in interface java.lang.Comparable<SeqExpr>
      • withOp

        public SeqExpr withOp​(Op op)
        Returns a copy of this SeqExpr with op replaced.
      • withElements

        public SeqExpr withElements​(java.util.List<Expr> elements)
        Returns a copy of this SeqExpr with elements replaced.