Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

SchReference Class Reference

#include <scheme.hpp>

Inheritance diagram for SchReference:

Inheritance graph
[legend]
Collaboration diagram for SchReference:

Collaboration graph
[legend]
List of all members.

Detailed Description

Reference to a Scheme S-expression.

This class only differs from SReference in that is has evaluation-related functions, the operator~(), the IsTrue(), IsEql() and IsEqual() functions.

If you don't need to evaluate an S-expression, it is better to use SReference as it is accepted by more function than SchReference. They can be cast to each other though.

Definition at line 38 of file scheme.hpp.

Public Member Functions

 SchReference ()
 Default constructor creates an unbound reference.
 SchReference (const SchReference &ref)
 Copy constructor.
 SchReference (const SReference &ref)
 Cast constructor.
 SchReference (SExpression *p)
 Cast from a plain pointer.
template<class X>
 SchReference (X &x)
template<class X>
 SchReference (const X &x)
 ~SchReference ()
 The destructor.
SchReference Evaluate () const
 Evaluate the expression.
SchReference Evaluate (class SchemeContinuation &cont) const
 Evaluate the expression within an existing machine.
bool IsTrue () const
 Is the object 'true' in the sence of Scheme.
SchReferenceoperator, (const SReference &ref)
 Add another element to list.
SchReferenceoperator|| (const SReference &ref)
 Set the cdr of the last pair of list.
SchReference operator~ () const
 Make the list (QUOTE *this).
bool IsEql (const SReference &other) const
 Is the object EQL (in the sence of CL) to the other.
bool IsEqual (const SReference &other) const
 Is the object EQUAL (in the sence of CL) to the other.
SString TextRepresentation () const
SExpressionGetPtr () const
 Get a plain pointer.
SReferenceAddAnotherItemToList (const SReference &right)
 Add item to list.
SReferenceChangeListEnd (const SReference &new_last)
 Make/change dotted list.
SReference MakeCons (const SReference &right) const
 Make a cons.
SReference operator^ (const SReference &t) const
 CONS operation.
bool operator== (const SReference &other) const
 Equality is just pointer comparision.
bool operator== (const SExpression *other) const
 Equality is just pointer comparision.
bool operator!= (const SReference &other) const
 Non-equality is just pointer comparision.
bool operator!= (const SExpression *other) const
 Non-equality is just pointer comparision.
SReferenceCar () const
SReferenceCdr () const
SReferenceCCar () const
SReferenceCCdr () const
intelib_float_t GetFloat () const
intelib_integer_t GetInt () const
const char * GetString () const
char GetSingleChar () const
template<class Tp>
Tp * DynamicCastGetPtr () const
template<class Tp>
Tp * SimpleCastGetPtr () const
SReference Clone () const
SReference CopyList () const
SReference CopyTree () const
bool IsEmptyList () const
SExpressionoperator-> () const
 Field/method selection.
SExpressionoperator * () const
 Dereference.


Constructor & Destructor Documentation

SchReference::SchReference  ) 
 

Default constructor creates an unbound reference.

Definition at line 41 of file scheme.hpp.

Referenced by IsEqual(), operator~(), and TextRepresentation().

SchReference::SchReference const SchReference ref  ) 
 

Copy constructor.

Definition at line 43 of file scheme.hpp.

SchReference::SchReference const SReference ref  ) 
 

Cast constructor.

Definition at line 45 of file scheme.hpp.

SchReference::SchReference SExpression p  ) 
 

Cast from a plain pointer.

Definition at line 47 of file scheme.hpp.

template<class X>
SchReference::SchReference X &  x  ) 
 

Definition at line 51 of file scheme.hpp.

template<class X>
SchReference::SchReference const X &  x  ) 
 

Definition at line 52 of file scheme.hpp.

SchReference::~SchReference  ) 
 

The destructor.

Definition at line 55 of file scheme.hpp.


Member Function Documentation

SchReference SchReference::Evaluate  )  const
 

Evaluate the expression.

This method creates a local object of SchemeContinuation and uses it to evaluate the expression. Consider it as a top-level form evaluation.

Definition at line 20 of file scheme.cpp.

SchReference SchReference::Evaluate class SchemeContinuation cont  )  const
 

Evaluate the expression within an existing machine.

The given SchemeContinuation's state is marked; then, the object is used to evaluate the expression (that is, *this is scheduled to be evaluated within that SchemeContinuation object, and the evaluation is launched to run until the marked state is reached again).

Warning:
In most cases this leaves the continuation exactly in the same state as it was in before the call; this is not guaranteed though.

Definition at line 26 of file scheme.cpp.

bool SchReference::IsTrue  )  const
 

Is the object 'true' in the sence of Scheme.

Returns false in case the object stores the same pointer as PTheSchemeBooleanFalse variable does; otherwise, returns true.

Definition at line 140 of file scheme.hpp.

References SReference::GetPtr(), and PTheSchemeBooleanFalse.

SchReference& SchReference::operator, const SReference ref  ) 
 

Add another element to list.

Reimplemented from SReference.

Definition at line 83 of file scheme.hpp.

References SReference::operator,().

SchReference& SchReference::operator|| const SReference ref  ) 
 

Set the cdr of the last pair of list.

Reimplemented from SReference.

Definition at line 87 of file scheme.hpp.

References SReference::operator||().

SchReference SchReference::operator~  )  const
 

Make the list (QUOTE *this).

Definition at line 143 of file scheme.hpp.

References PTheEmptyList, PTheSchemeSymbolQuote, SchReference(), and SReference::SReference().

bool SchReference::IsEql const SReference other  )  const
 

Is the object EQL (in the sence of CL) to the other.

Reimplemented from SReference.

Definition at line 35 of file scheme.cpp.

References SReference::GetPtr(), SExpression::SpecificEql(), and SExpression::TermType().

Referenced by IsEqual().

bool SchReference::IsEqual const SReference other  )  const
 

Is the object EQUAL (in the sence of CL) to the other.

Reimplemented from SReference.

Definition at line 45 of file scheme.cpp.

References SExpressionCons::Car(), SExpressionCons::Cdr(), IsEql(), and SchReference().

SString SchReference::TextRepresentation  )  const
 

This version differs from SExpression::TextRepresentation() in that it handles the QUOTE form

Definition at line 67 of file scheme.cpp.

References SExpressionCons::Car(), SExpressionCons::Cdr(), SExpressionCons::CoreTextRepresentation(), SReference::GetPtr(), SReference::IsEmptyList(), PTheSchemeSymbolQuote, SchReference(), SExpression::TermType(), and SExpression::TextRepresentation().

SExpression* SReference::GetPtr  )  const [inherited]
 

Get a plain pointer.

Reimplemented from GenericReference< SExpression >.

Reimplemented in GenericSReference< Tp, X_wrongtype >, SBacklinkRef, SQueue, GenericSReference< SExpressionStream, IntelibX_not_a_stream >, GenericSReference< SchExpressionContext, IntelibX_scheme_not_a_context >, GenericSReference< SExpressionWrapper< Data >, IntelibX_wrong_expression_type >, GenericSReference< LExpressionSymbol, IntelibX_lisp_not_a_symbol >, GenericSReference< SExpressionDoubleList, IntelibX_not_a_doublelist >, GenericSReference< SExpressionString, IntelibX_not_a_string >, GenericSReference< SExpressionHashPackage, IntelibX_not_a_package >, GenericSReference< SExpressionVector, IntelibX_not_a_vector >, GenericSReference< SExpressionHashTable, IntelibX_not_a_hash_table >, GenericSReference< SchExpressionSymbol, IntelibX_scheme_not_a_symbol >, and GenericSReference< LExpressionContext, IntelibX_lisp_not_a_context >.

Definition at line 513 of file sexpress.hpp.

References GenericReference< Tp >::GetPtr().

Referenced by IntelibGenericReader::AddSequenceOpener(), IntelibX::AddStack(), LispLambdaBody::DoAnalyseLambdaList(), SReference::DynamicCastGetPtr(), SExpressionHashTable::FindItem(), SExpressionHashPackage::FindSymbol(), SExpressionHashTable::GetItemPosition(), SExpressionHashTable::Iterator::GetNext(), SQueue::GetPtr(), SBacklinkRef::GetPtr(), GenericSReference< LExpressionContext, IntelibX_lisp_not_a_context >::GetPtr(), SExpressionHashPackage::Intern(), IsEql(), LReference::IsEql(), IsTrue(), LReference::IsTrue(), SReference::operator!=(), SBacklinkRef::operator,(), SReference::operator==(), SExpressionHashTable::RemoveItem(), RetrieveFunctionObject(), SExpressionHashTable::SafeAddItem(), SReference::SimpleCastGetPtr(), stack_representation(), IntelibContinuation::Step(), SExpressionHashTable::TextRepresentation(), TextRepresentation(), LReference::TextRepresentation(), and SExpressionBacklink::~SExpressionBacklink().

SReference& SReference::AddAnotherItemToList const SReference right  )  [inherited]
 

Add item to list.

For a list, adds another dotted pair to its end. For non-lists, the result is undefined.

Referenced by SReference::operator,().

SReference& SReference::ChangeListEnd const SReference new_last  )  [inherited]
 

Make/change dotted list.

  • For a proper (non-dotted) list, replaces its terminating () with the given argument, therefore producing a dotted list.
    • for a dotted list, changes it's terminating value (the value which is after the dot)
    • for other types, the result is undefined

Referenced by SReference::operator||().

SReference SReference::MakeCons const SReference right  )  const [inherited]
 

Make a cons.

Produces a cons (dotted pair) using *this as the CAR and the given argument as the CDR

Referenced by SReference::operator^().

SReference SReference::operator^ const SReference t  )  const [inherited]
 

CONS operation.

Operator "^" is used to produce conses

Definition at line 552 of file sexpress.hpp.

References SReference::MakeCons().

bool SReference::operator== const SReference other  )  const [inherited]
 

Equality is just pointer comparision.

Definition at line 556 of file sexpress.hpp.

References SReference::GetPtr().

bool SReference::operator== const SExpression other  )  const [inherited]
 

Equality is just pointer comparision.

Definition at line 562 of file sexpress.hpp.

References SReference::GetPtr().

bool SReference::operator!= const SReference other  )  const [inherited]
 

Non-equality is just pointer comparision.

Definition at line 559 of file sexpress.hpp.

References SReference::GetPtr().

bool SReference::operator!= const SExpression other  )  const [inherited]
 

Non-equality is just pointer comparision.

Definition at line 565 of file sexpress.hpp.

References SReference::GetPtr().

SReference& SReference::Car  )  const [inherited]
 

Referenced by LExpressionMacro::Call(), SDoubleListRange::Copy(), IntelibGenericReader::Get(), RetrieveFunctionObject(), and stack_representation().

SReference& SReference::Cdr  )  const [inherited]
 

Referenced by LExpressionMacro::Call(), SBacklinkRef::Remove(), SQueue::RemoveFirst(), RetrieveFunctionObject(), and stack_representation().

SReference& SReference::CCar  )  const [inherited]
 

SReference& SReference::CCdr  )  const [inherited]
 

intelib_float_t SReference::GetFloat  )  const [inherited]
 

Referenced by SExpressionIndirectTemplate< Tt >::Setf().

intelib_integer_t SReference::GetInt  )  const [inherited]
 

Referenced by SExpressionIndirectTemplate< Tt >::Setf().

const char* SReference::GetString  )  const [inherited]
 

Referenced by SExpressionIndirectTemplate< Tt >::Setf().

char SReference::GetSingleChar  )  const [inherited]
 

template<class Tp>
Tp * SReference::DynamicCastGetPtr  )  const [inherited]
 

Definition at line 687 of file sexpress.hpp.

References SReference::GetPtr(), IntelibTypeId::IsSubtypeOf(), and SExpression::TermType().

Referenced by LispLambdaBody::DoAnalyseLambdaList(), SExpressionBacklink::InsertAfter(), SBacklinkRef::operator,(), pretty_print(), IntelibGenericReader::Read(), SBacklinkRef::Remove(), SExpressionBacklink::RemoveNext(), RetrieveFunctionObject(), SQueue::SQueue(), and SExpressionBacklink::~SExpressionBacklink().

template<class Tp>
Tp * SReference::SimpleCastGetPtr  )  const [inherited]
 

Definition at line 695 of file sexpress.hpp.

References SReference::GetPtr(), and SExpression::TermType().

SReference SReference::Clone  )  const [inherited]
 

Referenced by SExpressionVector::Clone(), and SExpressionHashTable::Clone().

SReference SReference::CopyList  )  const [inherited]
 

SReference SReference::CopyTree  )  const [inherited]
 

bool SReference::IsEmptyList  )  const [inherited]
 

Referenced by SBacklinkRef::Begin(), LExpressionMacro::Call(), SExpressionBacklink::ConnectBack(), SDoubleListRange::Copy(), SBacklinkRef::End(), SExpressionDoubleList::Exclude(), SDoubleListRange::Exhausted(), SExpressionDoubleList::Iterator::Exhausted(), SDoubleListRange::GetLast(), SBacklinkRef::GetPtr(), SBacklinkRef::InsertAfter(), SExpressionDoubleList::InsertListAfter(), SExpressionDoubleList::Iterator::IsBegin(), SQueue::IsEmpty(), SExpressionDoubleList::Iterator::IsEnd(), SBacklinkRef::operator++(), SBacklinkRef::operator,(), SDoubleListRange::RightEndMover::operator--(), SDoubleListRange::LeftEndMover::operator--(), SBacklinkRef::operator--(), pretty_print(), SExpressionDoubleList::Iterator::Remove(), SBacklinkRef::Remove(), SExpressionBacklink::RemoveNext(), SQueue::SQueue(), stack_representation(), TextRepresentation(), LReference::TextRepresentation(), and SExpressionBacklink::~SExpressionBacklink().

SExpression * GenericReference< SExpression >::operator->  )  const [inherited]
 

Field/method selection.

Reimplemented in GenericSReference< Tp, X_wrongtype >, SBacklinkRef, GenericSReference< SExpressionStream, IntelibX_not_a_stream >, GenericSReference< SchExpressionContext, IntelibX_scheme_not_a_context >, GenericSReference< SExpressionWrapper< Data >, IntelibX_wrong_expression_type >, GenericSReference< LExpressionSymbol, IntelibX_lisp_not_a_symbol >, GenericSReference< SExpressionDoubleList, IntelibX_not_a_doublelist >, GenericSReference< SExpressionString, IntelibX_not_a_string >, GenericSReference< SExpressionHashPackage, IntelibX_not_a_package >, GenericSReference< SExpressionVector, IntelibX_not_a_vector >, GenericSReference< SExpressionHashTable, IntelibX_not_a_hash_table >, GenericSReference< SchExpressionSymbol, IntelibX_scheme_not_a_symbol >, and GenericSReference< LExpressionContext, IntelibX_lisp_not_a_context >.

Definition at line 175 of file refcount.hpp.

References GenericReference< Tp >::GetPtr().

SExpression & GenericReference< SExpression >::operator *  )  const [inherited]
 

Dereference.

Reimplemented in GenericSReference< Tp, X_wrongtype >, GenericSReference< SExpressionStream, IntelibX_not_a_stream >, GenericSReference< SchExpressionContext, IntelibX_scheme_not_a_context >, GenericSReference< SExpressionWrapper< Data >, IntelibX_wrong_expression_type >, GenericSReference< LExpressionSymbol, IntelibX_lisp_not_a_symbol >, GenericSReference< SExpressionDoubleList, IntelibX_not_a_doublelist >, GenericSReference< SExpressionString, IntelibX_not_a_string >, GenericSReference< SExpressionHashPackage, IntelibX_not_a_package >, GenericSReference< SExpressionVector, IntelibX_not_a_vector >, GenericSReference< SExpressionHashTable, IntelibX_not_a_hash_table >, GenericSReference< SchExpressionSymbol, IntelibX_scheme_not_a_symbol >, and GenericSReference< LExpressionContext, IntelibX_lisp_not_a_context >.

Definition at line 179 of file refcount.hpp.

References GenericReference< Tp >::GetPtr().


The documentation for this class was generated from the following files:
Generated on Tue Dec 18 00:40:55 2007 for InteLib by  doxygen 1.4.1