lestes::lang::cplus::syn::bison_pack_token Class Reference

#include <token.hh>

Inheritance diagram for lestes::lang::cplus::syn::bison_pack_token:

lestes::lang::cplus::syn::bison_madeup_token lestes::lang::cplus::syn::bison_token lestes::intercode::as_base lestes::intercode::intercode lestes::std::object lestes::std::mem::keystone List of all members.

Public Member Functions

ptr< token_list_typepack_get () const
ptr< source_location > end_location_get () const
virtual void print (::std::ostream &) const
virtual ptr< reflection_listreflection_get () const
 for purposes of dumping
virtual ptr< field_list_listfield_values_get () const
 for purposes of dumping

Static Public Member Functions

static ptr< bison_pack_tokencreate (const ptr< source_location > &a_location, int a_type, const ptr< source_location > a_end_location)

Protected Member Functions

 bison_pack_token (const ptr< source_location > &a_location, int a_type, ptr< token_list_type > a_pack, const ptr< source_location > &a_end_location)
void gc_mark ()
 Marking routine for class as_base.

Private Types

typedef list< srp< bison_token > > token_list_type

Private Attributes

const srp< token_list_typepack
const srp< source_location > end_location

Static Private Attributes

static ptr< reflection_listreflection = reflection

Detailed Description

Definition at line 197 of file token.hh.


Member Typedef Documentation

typedef list< srp<bison_token> > lestes::lang::cplus::syn::bison_pack_token::token_list_type [private]

Definition at line 199 of file token.hh.


Constructor & Destructor Documentation

lestes::lang::cplus::syn::bison_pack_token::bison_pack_token ( const ptr< source_location > &  a_location,
int  a_type,
ptr< token_list_type a_pack,
const ptr< source_location > &  a_end_location 
) [inline, protected]

Definition at line 207 of file token.hh.

00213                           :
00214                 bison_madeup_token( a_location, a_type ),
00215                 pack(a_pack), end_location(a_end_location)
00216 #if 0 || BISON_PACK_TOKEN_ERRORS_WANTED
00217                 ,errors(a_errors)
00218 #endif
00219         {}
        void gc_mark();


Member Function Documentation

void lestes::lang::cplus::syn::bison_pack_token::gc_mark ( void   )  [protected, virtual]

Marking routine for class as_base.

Marking routine is used for garbage collection.

Author:
lsg

Reimplemented from lestes::lang::cplus::syn::bison_token.

Definition at line 229 of file token.cc.

References end_location, lestes::lang::cplus::syn::bison_token::gc_mark(), and pack.

00230 {
00231         pack.gc_mark();
00232         end_location.gc_mark();
00233 #if 0 || BISON_PACK_TOKEN_ERRORS_WANTED
00234         errors.gc_mark();
00235 #endif
00236         bison_madeup_token::gc_mark();
00237 }

static ptr<bison_pack_token> lestes::lang::cplus::syn::bison_pack_token::create ( const ptr< source_location > &  a_location,
int  a_type,
const ptr< source_location >  a_end_location 
) [inline, static]

Definition at line 222 of file token.hh.

References _PACK_FIRST, _PACK_LAST, and lassert.

00224         {
00225                 lassert( a_type > bison_token::_PACK_FIRST && a_type < bison_token::_PACK_LAST );
00226                 return new bison_pack_token( a_location, a_type,
00227                                 token_list_type::create(), a_end_location
00228 #if 0 || BISON_PACK_TOKEN_ERRORS_WANTED
00229                                 ,token_list_type::create()
00230 #endif
00231                                 );
00232         }

ptr<token_list_type> lestes::lang::cplus::syn::bison_pack_token::pack_get (  )  const [inline]

Definition at line 233 of file token.hh.

00234         {
00235                 return pack;
00236         }

ptr<source_location> lestes::lang::cplus::syn::bison_pack_token::end_location_get (  )  const [inline]

Definition at line 237 of file token.hh.

00238         {
00239                 return end_location;
00240         }

void lestes::lang::cplus::syn::bison_pack_token::print ( ::std::ostream &   )  const [virtual]

Reimplemented from lestes::lang::cplus::syn::bison_madeup_token.

Definition at line 273 of file token.cc.

References lestes::lang::cplus::syn::bison_token::HINT_NONE, lassert2, pack, lestes::lang::cplus::syn::parser::token_type2name(), lestes::lang::cplus::syn::bison_token::type_get(), and lestes::lang::cplus::syn::bison_token::user_hint_get().

00274 {
00275         os << "bison_pack_token " << parser::token_type2name(type_get()) <<
00276                 ", size " << pack->size();
00277         lassert2( user_hint_get() == HINT_NONE, "Pack tokens must not have hints!" );
00278 }

ptr< object::reflection_list > lestes::lang::cplus::syn::bison_pack_token::reflection_get (  )  const [virtual]

for purposes of dumping

Reimplemented from lestes::lang::cplus::syn::bison_madeup_token.

Definition at line 241 of file token.cc.

References lestes::std::list< T >::create(), reflection, and lestes::lang::cplus::syn::bison_madeup_token::reflection_get().

00242 {
00243         if (!reflection) {
00244                 typedef class_reflection::field_metadata md;
00245                 typedef class_reflection::field_metadata_list mdlist;
00246                 ptr<mdlist> mdl = mdlist::create();
00247                 mdl->push_back( md::create( "pack", "list&lt; srp&lt; bison_token &gt; &gt;" ) );
00248                 mdl->push_back( md::create( "end_location", "source_location" ) );
00249 #if 0 || BISON_PACK_TOKEN_ERRORS_WANTED
00250                 mdl->push_back( md::create( "errors", "list&lt; srp&lt; bison_token &gt; &gt;" ) );
00251 #endif
00252                 // append our one to a copy of the base class's list
00253                 reflection = reflection_list::create( bison_madeup_token::reflection_get() );
00254                 reflection->push_back( class_reflection::create( "bison_pack_token", mdl ) );
00255         }
00256         return reflection;
00257 }

ptr< object::field_list_list > lestes::lang::cplus::syn::bison_pack_token::field_values_get (  )  const [virtual]

for purposes of dumping

Reimplemented from lestes::lang::cplus::syn::bison_madeup_token.

Definition at line 259 of file token.cc.

References lestes::std::list< T >::create(), end_location, lestes::lang::cplus::syn::bison_madeup_token::field_values_get(), and pack.

00260 {
00261         ptr<field_list_list> result = bison_madeup_token::field_values_get();
00262         result->push_back( value_list::create() );
00263         result->back()->push_back( pack );
00264         result->push_back( value_list::create() );
00265         result->back()->push_back( end_location );
00266 #if 0 || BISON_PACK_TOKEN_ERRORS_WANTED
00267         result->push_back( value_list::create() );
00268         result->back()->push_back( errors );
00269 #endif
00270         return result;
00271 }


Member Data Documentation

const srp<token_list_type> lestes::lang::cplus::syn::bison_pack_token::pack [private]

Definition at line 200 of file token.hh.

Referenced by field_values_get(), gc_mark(), and print().

const srp<source_location> lestes::lang::cplus::syn::bison_pack_token::end_location [private]

Definition at line 201 of file token.hh.

Referenced by field_values_get(), and gc_mark().

ptr< object::reflection_list > lestes::lang::cplus::syn::bison_pack_token::reflection = reflection [static, private]

Reimplemented from lestes::lang::cplus::syn::bison_madeup_token.

Definition at line 250 of file token.hh.

Referenced by reflection_get().


The documentation for this class was generated from the following files:
Generated on Mon Feb 12 18:25:39 2007 for lestes by doxygen 1.5.1-20070107