Class SuperExpr

    • Constructor Detail

      • SuperExpr

        public SuperExpr​(SourceType type,
                         SourceLocation location)
        Creates a super reference of the given type.
        Parameters:
        type - the superclass type this expression denotes
        location - source position, null for unknown
        Throws:
        NullPointerException - if the type is null
      • SuperExpr

        public SuperExpr​(SourceType type)
        Creates a super reference with an unknown source position.
        Parameters:
        type - the superclass type this expression denotes
        Throws:
        NullPointerException - if the type is null
    • Method Detail

      • getType

        public SourceType getType()
        Description copied from interface: Expression
        Gets the inferred type of this expression.
        Specified by:
        getType in interface Expression
        Returns:
        the type
      • getLocation

        public SourceLocation getLocation()
        Description copied from interface: ASTNode
        Gets the source location of this node.
        Specified by:
        getLocation in interface ASTNode
        Returns:
        the location
      • getParent

        public ASTNode getParent()
        Description copied from interface: ASTNode
        Gets the parent node in the AST tree.
        Specified by:
        getParent in interface ASTNode
        Returns:
        the parent
      • setParent

        public void setParent​(ASTNode parent)
        Sets the enclosing node.
        Specified by:
        setParent in interface ASTNode
        Parameters:
        parent - the new parent, may be null
      • accept

        public <T> T accept​(SourceVisitor<T> visitor)
        Description copied from interface: ASTNode
        Accepts a visitor for this node.
        Specified by:
        accept in interface ASTNode
        Type Parameters:
        T - the return type of the visitor
        Parameters:
        visitor - the visitor to accept
        Returns:
        the result from the visitor