TagsBegin and TagsEnd provide iterators for visiting the tags in the tree's body.
- LVParseTree::TagIterator TagsBegin()
The following code prints out every tag in a parse tree.
LVParseTree::TagIterator Itr = Tree.TagsBegin();
LVParseTree::TagIterator End = Tree.TagsEnd();
for (; Itr != End; Itr++)
cout << Itr->Text() << ";" << endl;
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";
The TagIterator does not visit the tags in a tree's header. Use LVParseTree::HeaderTag to access the contents of those tags.