expression_list Class Reference

#include <list.h>

List of all members.

Public Member Functions

virtual ~expression_list ()
 expression_list ()
 expression_list (const expression::pointer &arg)
 expression_list (const expression_list &)
expression_listoperator= (const expression_list &)
void push_front (const expression::pointer &esp)
void push_back (const expression::pointer &esp)
void push_back (const expression_list &arg)
size_t size () const
bool empty () const
expression::pointer get (size_t n) const
expression::pointer operator[] (size_t n) const
expression_listclone () const
expression::pointer front () const
expression::pointer back () const
expression::side_effect_t has_side_effect () const
expression::pointer pop_front ()
expression::pointer pop_back ()
void clear ()
location get_location () const

Private Attributes

size_t length
size_t maximum
expression::pointeritem


Detailed Description

The expression_list class is used to represent an ordered collection of expressions.

Definition at line 33 of file list.h.


Constructor & Destructor Documentation

virtual expression_list::~expression_list (  )  [virtual]

The destructor.

expression_list::expression_list (  ) 

The default constructor.

expression_list::expression_list ( const expression::pointer arg  ) 

The constructor.

expression_list::expression_list ( const expression_list  ) 

The copy constructor.


Member Function Documentation

expression_list& expression_list::operator= ( const expression_list  ) 

The assignment operator.

void expression_list::push_front ( const expression::pointer esp  ) 

The push_front method is used to add another expression to the beginning of the list.

This is an O(n) operation.

void expression_list::push_back ( const expression::pointer esp  ) 

The push_back method is used to add another expression to the end of the list.

This is an O(1) operation.

void expression_list::push_back ( const expression_list arg  ) 

The push_back method is used to push a whole list on the back of this list.

Parameters:
arg This is to be appended.

size_t expression_list::size (  )  const [inline]

The size method is used to obtain the number of elements in the list.

Definition at line 90 of file list.h.

References length.

Referenced by expression_function_call::get_child_count().

bool expression_list::empty (  )  const [inline]

The empty method is used to determine whether or not the list is empty.

Definition at line 96 of file list.h.

References length.

Referenced by statement_writeln::has_args().

expression::pointer expression_list::get ( size_t  n  )  const [inline]

The get method is used to obtain a specific member of the list.

Definition at line 101 of file list.h.

References item.

Referenced by expression_function_call::get_child(), and operator[]().

expression::pointer expression_list::operator[] ( size_t  n  )  const [inline]

The subscript operator is used to obtain a specific member of the list.

Definition at line 107 of file list.h.

References get().

expression_list* expression_list::clone (  )  const

The clone method is used to make a deep copy of this expression list. It calls the member expressions' clone methods.

expression::pointer expression_list::front (  )  const [inline]

The front method is used to obtain the first item in the list.

Definition at line 119 of file list.h.

References item, and length.

expression::pointer expression_list::back (  )  const [inline]

The back method is used to obtain the last item in the list.

Definition at line 129 of file list.h.

References item, and length.

expression::side_effect_t expression_list::has_side_effect (  )  const

The has_side_effect method is used to determine if an expression has any effect. It is used by the parse to produce "statement with no effect" warnings.

expression::pointer expression_list::pop_front (  ) 

The pop_front method is used to remove the first element from the list, and return it. If the list is empty, the NULL pointer is returned.

expression::pointer expression_list::pop_back (  ) 

The pop_back method is used to remove the last element from the list, and return it. If the list is empty, the NULL pointer is returned.

void expression_list::clear (  ) 

The clear method is used to discard all list contents.

location expression_list::get_location (  )  const

The get_location method is used to obtain the location of the expression list.


Member Data Documentation

size_t expression_list::length [private]

The length instance variable is used to remember how many elements of the item array have been used to date.

Definition at line 172 of file list.h.

Referenced by back(), empty(), front(), and size().

size_t expression_list::maximum [private]

The maximum instance variable is used to remember the allocation size of the item array.

Definition at line 178 of file list.h.

expression::pointer* expression_list::item [private]

The item instance variable is used to remember the address of the dynamically allocated array of expression pointers.

Definition at line 184 of file list.h.

Referenced by back(), front(), and get().


The documentation for this class was generated from the following file:
Generated on Sun Feb 25 01:27:12 2007 for UCSDp-SystemCrossCompiler by  doxygen 1.5.1