Browse
 
Tools
Rss Categories

LVParseTree::TagsBegin and LVParseTree::TagsEnd

Reference Number: AA-00974 Views: 7246 0 Rating/ Voters

TagsBegin and TagsEnd provide iterators for visiting the tags in the tree's body.

Function

  • LVParseTree::TagIterator TagsBegin()

    LVParseTree::TagIterator TagsEnd()

Example

The following code prints out every tag in a parse tree.

  1. LVParseTree::TagIterator Itr = Tree.TagsBegin();
  2. LVParseTree::TagIterator End = Tree.TagsEnd();

  3. for (; Itr != End; Itr++)
  4. {
  5. cout << Itr->Text() << ";" << endl;
  6. }

If the grammar was the top level navigation example grammar, and the engine recognized "go back", the the above code would print out:

out = "APPLICATION_BACK";

Remark

The TagIterator does not visit the tags in a tree's header. Use LVParseTree::HeaderTag to access the contents of those tags.