Class ASTList

    • Constructor Detail

      • ASTList

        public ASTList​(ASTree _head)
    • Method Detail

      • head

        public ASTree head()
        Returns the car part of the list.
      • setHead

        public void setHead​(ASTree _head)
      • tail

        public ASTList tail()
        Returns the cdr part of the list.
      • setTail

        public void setTail​(ASTList _tail)
      • accept

        public void accept​(Visitor v)
                    throws CompileError
        Description copied from class: ASTree
        Is a method for the visitor pattern. It calls atXXX() on the given visitor, where XXX is the class name of the node object.
        Specified by:
        accept in class ASTree
        Throws:
        CompileError
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class ASTree
      • length

        public int length()
        Returns the number of the elements in this list.
      • length

        public static int length​(ASTList list)
      • sublist

        public ASTList sublist​(int nth)
        Returns a sub list of the list. The sub list begins with the n-th element of the list.
        Parameters:
        nth - zero or more than zero.
      • subst

        public boolean subst​(ASTree newObj,
                             ASTree oldObj)
        Substitutes newObj for oldObj in the list.