Class SuperExpr

  • All Implemented Interfaces:
    NodeWithRange<Node>, NodeWithTokenRange<Node>, Observable, Visitable, HasParentNode<Node>, Cloneable

    public final class SuperExpr
    extends Expression
    An occurrence of the "super" keyword.
    World.super.greet() is a MethodCallExpr of method name greet, and scope "World.super" which is a SuperExpr with classExpr "World".
    super.name is a FieldAccessExpr of field greet, and a SuperExpr as its scope. This SuperExpr has no classExpr.
    If classExpr is a single identifier (a.this) then it is of type NameExpr. If classExpr has multiple identifiers (a.b.c.this) then it is of type FieldAccessExpr.
    Author:
    Julio Vilmar Gesser
    See Also:
    ExplicitConstructorInvocationStmt, ThisExpr
    • Constructor Detail

      • SuperExpr

        public SuperExpr()
      • SuperExpr

        public SuperExpr​(Expression classExpr)
      • SuperExpr

        public SuperExpr​(TokenRange tokenRange,
                         Expression classExpr)
        This constructor is used by the parser and is considered private.
    • Method Detail

      • accept

        public <R,​A> R accept​(GenericVisitor<R,​A> v,
                                    A arg)
        Description copied from interface: Visitable
        Accept method for visitor support.
        Type Parameters:
        R - the type of the return value of the visitor
        A - the type the user argument passed to the visitor
        Parameters:
        v - the visitor implementation
        arg - the argument passed to the visitor (of type A)
        Returns:
        the result of the visit (of type R)
      • accept

        public <A> void accept​(VoidVisitor<A> v,
                               A arg)
        Description copied from interface: Visitable
        Accept method for visitor support.
        Type Parameters:
        A - the type the argument passed for the visitor
        Parameters:
        v - the visitor implementation
        arg - any value relevant for the visitor (of type A)
      • setClassExpr

        public SuperExpr setClassExpr​(Expression classExpr)
        Sets the classExpr
        Parameters:
        classExpr - the classExpr, can be null
        Returns:
        this, the SuperExpr
      • removeClassExpr

        public SuperExpr removeClassExpr()