Classes | Public Types | Public Member Functions

opennwa::NestedWord Class Reference

This class represents a single nested word. More...

List of all members.

Classes

struct  Position
 Each position in the nested word has a symbol and a type. More...

Public Types

typedef std::vector< Position >
::const_iterator 
const_iterator
 An iterator to allow traversal through the word.

Public Member Functions

void append (Position p)
 Appends the position 'p' (symbol & type) to the end of this nested word.
void appendCall (Symbol sym)
 Appends the given symbol to the end of this nested word in a call position.
void appendInternal (Symbol sym)
 Appends the given symbol to the end of this nested word in an internal position.
void appendReturn (Symbol sym)
 Appends the given symbol to the end of this nested word in a return position.
const_iterator begin () const
 Returns an iterator to the first position in this nested word.
const_iterator end () const
 Returns an iterator to one position past the end of this nested word.
size_t size () const
 Returns the number of positions in this nested word.
bool operator== (NestedWord const &other) const
 Returns whether the two nested words are equal.
bool operator!= (NestedWord const &other) const
 Returns whether two nested words are unequal.

Detailed Description

This class represents a single nested word.

The word can be unbalanced left or unbalanced right, even though our NWAs do not have support for unbalanced-right words.

The representation used by this class is closer to that of a word in a visibly-pushdown language. It holds the linear contents of a word, but does not store the nesting relation explicitly. Instead, each position in the word is annotated with whether it is an internal, call, or return position. The nesting relation is induced by the matchings between calls and returns.


Member Typedef Documentation

An iterator to allow traversal through the word.

(Don't depend on this concrete type specifically, but I guarantee it will be a random access iterator.)


Member Function Documentation

void opennwa::NestedWord::append ( Position  p  ) 

Appends the position 'p' (symbol & type) to the end of this nested word.

Referenced by appendCall(), appendInternal(), and appendReturn().

void opennwa::NestedWord::appendCall ( Symbol  sym  ) 

Appends the given symbol to the end of this nested word in a call position.

References append(), and opennwa::NestedWord::Position::CallType.

Referenced by main().

void opennwa::NestedWord::appendInternal ( Symbol  sym  ) 

Appends the given symbol to the end of this nested word in an internal position.

References append(), and opennwa::NestedWord::Position::InternalType.

Referenced by main().

void opennwa::NestedWord::appendReturn ( Symbol  sym  ) 

Appends the given symbol to the end of this nested word in a return position.

References append(), and opennwa::NestedWord::Position::ReturnType.

Referenced by main().

const_iterator opennwa::NestedWord::begin (  )  const

Returns an iterator to the first position in this nested word.

Referenced by opennwa::Nwa::isMemberNondet().

const_iterator opennwa::NestedWord::end (  )  const

Returns an iterator to one position past the end of this nested word.

Referenced by opennwa::Nwa::isMemberNondet().

size_t opennwa::NestedWord::size (  )  const

Returns the number of positions in this nested word.

bool opennwa::NestedWord::operator== ( NestedWord const &  other  )  const

Returns whether the two nested words are equal.

bool opennwa::NestedWord::operator!= ( NestedWord const &  other  )  const

Returns whether two nested words are unequal.


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