Ginga  0.13.6.1771-df200
The iTV middleware.
ParserState Class Reference
Collaboration diagram for ParserState:

Public Types

enum  Error {
  ERROR_NONE = 0, ERROR_ELT_UNKNOWN, ERROR_ELT_MISSING_PARENT, ERROR_ELT_BAD_PARENT,
  ERROR_ELT_UNKNOWN_ATTRIBUTE, ERROR_ELT_MISSING_ATTRIBUTE, ERROR_ELT_BAD_ATTRIBUTE, ERROR_ELT_UNKNOWN_CHILD,
  ERROR_ELT_MISSING_CHILD, ERROR_ELT_BAD_CHILD
}
 

Public Member Functions

 ParserState (int, int)
 
 ~ParserState ()
 
ParserState::Error getError (string *)
 
Documentprocess (xmlDoc *)
 

Static Public Member Functions

static bool pushNcl (ParserState *, ParserElt *)
 
static bool popNcl (ParserState *, ParserElt *)
 
static bool pushRegion (ParserState *, ParserElt *)
 
static bool popRegion (ParserState *, ParserElt *)
 
static bool pushDescriptorParam (ParserState *, ParserElt *)
 
static bool pushCausalConnector (ParserState *, ParserElt *)
 
static bool popCausalConnector (ParserState *, ParserElt *)
 
static bool pushCompoundCondition (ParserState *, ParserElt *)
 
static bool pushSimpleCondition (ParserState *, ParserElt *)
 
static bool pushCompoundStatement (ParserState *, ParserElt *)
 
static bool popCompoundStatement (ParserState *, ParserElt *)
 
static bool popAssessmentStatement (ParserState *, ParserElt *)
 
static bool pushAttributeAssessment (ParserState *, ParserElt *)
 
static bool pushContext (ParserState *, ParserElt *)
 
static bool popContext (ParserState *, ParserElt *)
 
static bool pushPort (ParserState *, ParserElt *)
 
static bool pushMedia (ParserState *, ParserElt *)
 
static bool popMedia (ParserState *, ParserElt *)
 
static bool pushArea (ParserState *, ParserElt *)
 
static bool pushProperty (ParserState *, ParserElt *)
 
static bool pushLink (ParserState *, ParserElt *)
 
static bool pushLinkParam (ParserState *, ParserElt *)
 
static bool pushBind (ParserState *, ParserElt *)
 

Private Member Functions

string genId ()
 
bool isInUniqueSet (const string &)
 
void addToUniqueSet (const string &)
 
bool getData (const string &, void **)
 
bool setData (const string &, void *, UserDataCleanFunc fn=nullptr)
 
bool errElt (xmlNode *, ParserState::Error, const string &)
 
bool errEltUnknown (xmlNode *)
 
bool errEltMissingParent (xmlNode *)
 
bool errEltBadParent (xmlNode *, const string &)
 
bool errEltUnknownAttribute (xmlNode *, const string &)
 
bool errEltMissingAttribute (xmlNode *, const string &)
 
bool errEltBadAttribute (xmlNode *, const string &, const string &, const string &explain="")
 
bool errEltUnknownChild (xmlNode *, const string &)
 
bool errEltMissingChild (xmlNode *, const list< string > &)
 
bool errEltBadChild (xmlNode *, const string &, const string &explain="")
 
bool eltCacheIndex (xmlNode *, ParserElt **)
 
bool eltCacheIndexParent (xmlNode *, ParserElt **)
 
bool eltCacheIndexById (const string &, ParserElt **, const list< string > &)
 
bool eltCacheIndexByTag (const list< string > &, list< ParserElt * > *)
 
bool eltCacheAdd (ParserElt *)
 
ObjectobjStackPeek ()
 
ObjectobjStackPop ()
 
void objStackPush (Object *)
 
bool resolveComponentRef (Context *, ParserElt *, Object **)
 
bool resolveGhostBindRef (Context *, ParserElt *, string *)
 
bool resolveInterfaceRef (Context *, ParserElt *, Event **)
 
string resolveLinkParamRef (const string &, const map< string, string > *, const map< string, string > *, const map< string, string > *)
 
bool processNode (xmlNode *)
 

Private Attributes

Document_doc
 
xmlDoc * _xml
 
Rect _rect
 
int _genid
 
set< string > _unique
 
UserData _udata
 
ParserState::Error _error
 
string _errorMsg
 
map< xmlNode *, ParserElt * > _eltCache
 
list< Object * > _objStack
 

Member Enumeration Documentation

Enumerator
ERROR_NONE 
ERROR_ELT_UNKNOWN 
ERROR_ELT_MISSING_PARENT 
ERROR_ELT_BAD_PARENT 
ERROR_ELT_UNKNOWN_ATTRIBUTE 
ERROR_ELT_MISSING_ATTRIBUTE 
ERROR_ELT_BAD_ATTRIBUTE 
ERROR_ELT_UNKNOWN_CHILD 
ERROR_ELT_MISSING_CHILD 
ERROR_ELT_BAD_CHILD 

Constructor & Destructor Documentation

ParserState::ParserState ( int  width,
int  height 
)

References ERROR_NONE.

ParserState::~ParserState ( )

Member Function Documentation

void ParserState::addToUniqueSet ( const string &  str)
private
bool ParserState::eltCacheAdd ( ParserElt elt)
private

References ParserElt::getNode().

bool ParserState::eltCacheIndex ( xmlNode *  node,
ParserElt **  result 
)
private

References g_assert_nonnull(), and tryset.

Referenced by popNcl().

bool ParserState::eltCacheIndexById ( const string &  id,
ParserElt **  result,
const list< string > &  tags 
)
private

References tryset.

Referenced by popContext(), and popNcl().

bool ParserState::eltCacheIndexByTag ( const list< string > &  tags,
list< ParserElt * > *  result 
)
private

References g_assert_nonnull().

Referenced by popNcl().

bool ParserState::eltCacheIndexParent ( xmlNode *  node,
ParserElt **  result 
)
private
bool ParserState::errElt ( xmlNode *  node,
ParserState::Error  error,
const string &  message 
)
private
bool ParserState::errEltBadAttribute ( xmlNode *  node,
const string &  name,
const string &  value,
const string &  explain = "" 
)
private
bool ParserState::errEltBadChild ( xmlNode *  node,
const string &  child,
const string &  explain = "" 
)
private
bool ParserState::errEltBadParent ( xmlNode *  node,
const string &  parent 
)
private

References ERROR_ELT_BAD_PARENT.

bool ParserState::errEltMissingAttribute ( xmlNode *  node,
const string &  name 
)
private
bool ParserState::errEltMissingChild ( xmlNode *  node,
const list< string > &  children 
)
private
bool ParserState::errEltMissingParent ( xmlNode *  node)
private
bool ParserState::errEltUnknown ( xmlNode *  node)
private

References ERROR_ELT_UNKNOWN.

bool ParserState::errEltUnknownAttribute ( xmlNode *  node,
const string &  name 
)
private
bool ParserState::errEltUnknownChild ( xmlNode *  node,
const string &  name 
)
private
string ParserState::genId ( )
private

References xstrbuild().

bool ParserState::getData ( const string &  key,
void **  result 
)
private

References ParserElt::_udata, and UserData::getData().

Referenced by popRegion().

ParserState::Error ParserState::getError ( string *  message)

References tryset.

Referenced by process().

bool ParserState::isInUniqueSet ( const string &  str)
private
Object * ParserState::objStackPeek ( )
private
Object * ParserState::objStackPop ( )
private

Referenced by popContext(), popMedia(), and popNcl().

void ParserState::objStackPush ( Object obj)
private

References g_assert_nonnull().

Referenced by pushContext(), pushMedia(), and pushNcl().

bool ParserState::popCausalConnector ( ParserState st,
ParserElt elt 
)
static
bool ParserState::popMedia ( ParserState ,
ParserElt  
)
static

References g_assert(), instanceof, and objStackPop().

bool ParserState::popRegion ( ParserState st,
ParserElt elt 
)
static
Document * ParserState::process ( xmlDoc *  xml)

References g_assert_nonnull(), and unlikely.

Referenced by process().

bool ParserState::pushCausalConnector ( ParserState st,
ParserElt elt 
)
static
bool ParserState::pushCompoundCondition ( ParserState ,
ParserElt  
)
static
bool ParserState::pushDescriptorParam ( ParserState st,
ParserElt elt 
)
static
bool ParserState::pushLink ( ParserState ,
ParserElt  
)
static
bool ParserState::pushLinkParam ( ParserState st,
ParserElt elt 
)
static
bool ParserState::pushNcl ( ParserState st,
ParserElt elt 
)
static
bool ParserState::pushPort ( ParserState st,
ParserElt elt 
)
static
bool ParserState::resolveComponentRef ( Context parent,
ParserElt elt,
Object **  result 
)
private
bool ParserState::resolveGhostBindRef ( Context parent,
ParserElt bind_elt,
string *  result 
)
private
string ParserState::resolveLinkParamRef ( const string &  value,
const map< string, string > *  bindParams,
const map< string, string > *  linkParams,
const map< string, string > *  ghosts 
)
private

Referenced by popNcl().

bool ParserState::setData ( const string &  key,
void *  value,
UserDataCleanFunc  fn = nullptr 
)
private

Member Data Documentation

Document* ParserState::_doc
private

Referenced by popNcl(), pushMedia(), and pushNcl().

map<xmlNode *, ParserElt *> ParserState::_eltCache
private
ParserState::Error ParserState::_error
private
string ParserState::_errorMsg
private
int ParserState::_genid
private
list<Object *> ParserState::_objStack
private
Rect ParserState::_rect
private

Referenced by popRegion(), and pushRegion().

UserData ParserState::_udata
private
set<string> ParserState::_unique
private
xmlDoc* ParserState::_xml
private

Referenced by pushMedia().


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