public Event produce () {
String anchor = null, tagHandle = null, tagSuffix = null;
if (tokenizer.peekNextTokenType() == ANCHOR) {
anchor = ((AnchorToken)tokenizer.getNextToken()).getInstanceName();
if (tokenizer.peekNextTokenType() == TAG) {
TagToken tagToken = (TagToken)tokenizer.getNextToken();
tagHandle = tagToken.getHandle();
tagSuffix = tagToken.getSuffix();
}
} else if (tokenizer.peekNextTokenType() == TAG) {
TagToken tagToken = (TagToken)tokenizer.getNextToken();
tagHandle = tagToken.getHandle();
tagSuffix = tagToken.getSuffix();
if (tokenizer.peekNextTokenType() == ANCHOR) anchor = ((AnchorToken)tokenizer.getNextToken()).getInstanceName();
}
String tag = null;
if (tagHandle != null && !tagHandle.equals("!")) {
if (!tagHandles.containsKey(tagHandle)) throw new ParserException("Undefined tag handle: " + tagHandle);