KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Attributes | Friends | List of all members
semantics::Semantic_elaboration Class Referenceabstract

Base class for semantic elaborations. More...

#include <Semantic_elaboration.h>

Inheritance diagram for semantics::Semantic_elaboration:
semantics::Nonterminal_elaboration< T, Traits > semantics::Terminal_elaboration< T, Traits >

Public Types

typedef
Semantic_data_base::Key_type 
Key_type
 
typedef
Semantic_data_base::Val_type 
Val_type
 
typedef
Semantic_data_base::Hash_pair 
Hash_pair
 
typedef boost::shared_ptr
< Semantic_elaboration
Self_ptr
 
typedef boost::shared_ptr
< const Semantic_elaboration
Self_ptr_const
 
typedef std::deque
< Self_ptr_const
Self_ptrs_read
 
typedef
Semantic_data_base::Base_ptr 
Data_base_ptr
 
typedef boost::tuple
< Self_ptr_const,
Semantic_data_base::Hash_pair
Step_result
 
typedef int Referent_code
 
typedef std::vector
< Referent_code
Referent_list
 

Public Member Functions

virtual ~Semantic_elaboration ()
 
virtual const Val_typehead () const =0
 return underlying hash code for head value More...
 
virtual const Key_typehead_s () const =0
 return underlying hash code for head value More...
 
virtual const Val_typearg (const size_t &pos) const =0
 return underlying hash code for head value More...
 
virtual const Key_typearg_s (const size_t &pos) const =0
 return underlying hash code for head value More...
 
virtual const size_t & head_code () const =0
 return underlying hash code for head value More...
 
virtual const size_t & args_code () const =0
 return underlying hash code for args More...
 
virtual size_t type_code () const =0
 return the code corresponding to the type of elaboration More...
 
virtual const Data_base_ptr data () const =0
 return pointer to underlying data node More...
 
virtual const Step_code::Weightsstep_filter () const =0
 return a binary filter indicating what steps are allowed More...
 
virtual Self_ptr child (const size_t &) const =0
 return pointer to child in a particular position More...
 
virtual Self_ptrs_read children () const =0
 return pointer to child in a particular position More...
 
virtual const Referent_codehead_referent () const
 get the integral code for the referent (if it exists) More...
 
virtual const Referent_codearg_referent (const size_t &) const
 get the integral code for the arg in position pos (if it exists) More...
 
virtual Step_result take_a_step (const Step_code_t &step_code) const =0
 step down the tree according to step_code More...
 
virtual void add_child (const size_t &, const Self_ptr)=0
 put a child in a particular position More...
 
virtual void insert_child (const size_t &, const Self_ptr, const size_t &)=0
 add child and have existing child adopt the old one More...
 
virtual bool is_terminal () const =0
 is this a terminal node? More...
 
virtual void print (std::ostream &os) const =0
 print contents at this node More...
 
virtual void print_subtree (std::ostream &, int indent_level=0) const =0
 recursively print elaboration tree contents More...
 

Static Public Attributes

static const Referent_code NULL_REFERENT = -1
 

Friends

std::ostream & operator<< (std::ostream &os, Self_ptr)
 

Detailed Description

Base class for semantic elaborations.

Currently two derived classes: Terminal_elaboration, which covers attributes (color, size), and non-terminal elaborations, which are unary and binary predicates.

Member Typedef Documentation

Constructor & Destructor Documentation

virtual semantics::Semantic_elaboration::~Semantic_elaboration ( )
inlinevirtual

Member Function Documentation

virtual void semantics::Semantic_elaboration::add_child ( const size_t &  ,
const Self_ptr   
)
pure virtual

put a child in a particular position

Implemented in semantics::Nonterminal_elaboration< T, Traits >, and semantics::Terminal_elaboration< T, Traits >.

virtual const Val_type& semantics::Semantic_elaboration::arg ( const size_t &  pos) const
pure virtual

return underlying hash code for head value

Implemented in semantics::Nonterminal_elaboration< T, Traits >, and semantics::Terminal_elaboration< T, Traits >.

virtual const Referent_code& semantics::Semantic_elaboration::arg_referent ( const size_t &  ) const
inlinevirtual

get the integral code for the arg in position pos (if it exists)

Reimplemented in semantics::Nonterminal_elaboration< T, Traits >.

virtual const Key_type& semantics::Semantic_elaboration::arg_s ( const size_t &  pos) const
pure virtual

return underlying hash code for head value

Implemented in semantics::Nonterminal_elaboration< T, Traits >, and semantics::Terminal_elaboration< T, Traits >.

virtual const size_t& semantics::Semantic_elaboration::args_code ( ) const
pure virtual

return underlying hash code for args

Implemented in semantics::Nonterminal_elaboration< T, Traits >, and semantics::Terminal_elaboration< T, Traits >.

virtual Self_ptr semantics::Semantic_elaboration::child ( const size_t &  ) const
pure virtual

return pointer to child in a particular position

Implemented in semantics::Nonterminal_elaboration< T, Traits >, and semantics::Terminal_elaboration< T, Traits >.

virtual Self_ptrs_read semantics::Semantic_elaboration::children ( ) const
pure virtual

return pointer to child in a particular position

Implemented in semantics::Nonterminal_elaboration< T, Traits >, and semantics::Terminal_elaboration< T, Traits >.

virtual const Data_base_ptr semantics::Semantic_elaboration::data ( ) const
pure virtual

return pointer to underlying data node

Implemented in semantics::Nonterminal_elaboration< T, Traits >, and semantics::Terminal_elaboration< T, Traits >.

virtual const Val_type& semantics::Semantic_elaboration::head ( ) const
pure virtual

return underlying hash code for head value

Implemented in semantics::Nonterminal_elaboration< T, Traits >, and semantics::Terminal_elaboration< T, Traits >.

virtual const size_t& semantics::Semantic_elaboration::head_code ( ) const
pure virtual

return underlying hash code for head value

Implemented in semantics::Nonterminal_elaboration< T, Traits >, and semantics::Terminal_elaboration< T, Traits >.

virtual const Referent_code& semantics::Semantic_elaboration::head_referent ( ) const
inlinevirtual

get the integral code for the referent (if it exists)

Reimplemented in semantics::Nonterminal_elaboration< T, Traits >.

virtual const Key_type& semantics::Semantic_elaboration::head_s ( ) const
pure virtual

return underlying hash code for head value

Implemented in semantics::Nonterminal_elaboration< T, Traits >, and semantics::Terminal_elaboration< T, Traits >.

virtual void semantics::Semantic_elaboration::insert_child ( const size_t &  ,
const Self_ptr  ,
const size_t &   
)
pure virtual

add child and have existing child adopt the old one

Implemented in semantics::Nonterminal_elaboration< T, Traits >, and semantics::Terminal_elaboration< T, Traits >.

virtual bool semantics::Semantic_elaboration::is_terminal ( ) const
pure virtual
virtual void semantics::Semantic_elaboration::print ( std::ostream &  os) const
pure virtual
virtual void semantics::Semantic_elaboration::print_subtree ( std::ostream &  ,
int  indent_level = 0 
) const
pure virtual

recursively print elaboration tree contents

Implemented in semantics::Nonterminal_elaboration< T, Traits >, and semantics::Terminal_elaboration< T, Traits >.

virtual const Step_code::Weights& semantics::Semantic_elaboration::step_filter ( ) const
pure virtual

return a binary filter indicating what steps are allowed

Implemented in semantics::Nonterminal_elaboration< T, Traits >, and semantics::Terminal_elaboration< T, Traits >.

virtual Step_result semantics::Semantic_elaboration::take_a_step ( const Step_code_t step_code) const
pure virtual

step down the tree according to step_code

Implemented in semantics::Nonterminal_elaboration< T, Traits >, and semantics::Terminal_elaboration< T, Traits >.

virtual size_t semantics::Semantic_elaboration::type_code ( ) const
pure virtual

return the code corresponding to the type of elaboration

Implemented in semantics::Nonterminal_elaboration< T, Traits >, and semantics::Terminal_elaboration< T, Traits >.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
Self_ptr   
)
friend

Member Data Documentation

const Semantic_elaboration::Referent_code semantics::Semantic_elaboration::NULL_REFERENT = -1
static

The documentation for this class was generated from the following files: