LVParseTree::TagsBegin and LVParseTree::TagsEnd

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

Function

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.  
  4. for (; Itr != End; Itr++)
  5. {
  6. cout << Itr->Text() << ";" << endl;
  7. }

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.

See Also

© 2012 LumenVox LLC. All rights reserved.