Mode mode = jEdit.getMode(modeName);
mode = jEdit.getMode(modeName);
	public void endElement (String name)	{		if (name == null) return;		String tag = peekElement();		if (name.equalsIgnoreCase(tag))		{			if (tag == "MODE")			{				Mode mode = jEdit.getMode(modeName);				if (mode == null)				{					mode = new Mode(modeName);					jEdit.addMode(mode);				}				mode.setTokenMarker(marker);			}			else if (tag == "PROPERTY")			{				setProperty(propName,propValue);			}			else if (tag == "KEYWORDS")			{				keywords.setIgnoreCase(lastIgnoreCase);				lastIgnoreCase = true;			}			else if (tag == "RULES")			{				marker.addRuleSet(lastSetName, rules);				rules.setKeywords(keywords);				lastSetName = null;				lastEscape = null;				lastIgnoreCase = true;				lastDefaultID = GenericTokenMarker.NULL;				rules = null;			}			else if (tag == "TERMINATE")			{				setTerminateChar(termChar);				termChar = -1;			}			else if (tag == "WHITESPACE")			{				addRule(ParserRuleFactory.createWhitespaceRule(					lastStart));				lastStart = null;				lastEnd = null;			}			else if (tag == "EOL_SPAN")			{				addRule(ParserRuleFactory.createEOLSpanRule(					lastStart,lastTokenID,lastAtLineStart,					lastExcludeMatch));				lastStart = null;				lastEnd = null;				lastTokenID = 0;				lastAtLineStart = false;				lastExcludeMatch = false;			}			else if (tag == "MARK_PREVIOUS")			{				addRule(ParserRuleFactory					.createMarkPreviousRule(lastStart,					lastTokenID,lastAtLineStart,					lastExcludeMatch));				lastStart = null;				lastEnd = null;				lastTokenID = 0;				lastAtLineStart = false;				lastExcludeMatch = false;			}			else if (tag == "MARK_FOLLOWING")			{				addRule(ParserRuleFactory					.createMarkFollowingRule(lastStart,					lastTokenID,lastAtLineStart,					lastExcludeMatch));				lastStart = null;				lastEnd = null;				lastTokenID = 0;				lastAtLineStart = false;				lastExcludeMatch = false;			}			else if (tag == "SEQ")			{				addRule(ParserRuleFactory.createSequenceRule(					lastStart,lastTokenID,lastAtLineStart));				lastStart = null;				lastEnd = null;				lastTokenID = 0;				lastAtLineStart = false;			}			else if (tag == "END")			{				if (lastDelegateSet == null)				{					addRule(ParserRuleFactory						.createSpanRule(lastStart,						lastEnd,lastTokenID,						lastNoLineBreak,						lastAtLineStart,						lastExcludeMatch,						lastNoWordBreak));				}				else				{					addRule(ParserRuleFactory						.createDelegateSpanRule(						lastStart,lastEnd,						lastDelegateSet,						lastTokenID,lastNoLineBreak,						lastAtLineStart,						lastExcludeMatch,						lastNoWordBreak));				}				lastStart = null;				lastEnd = null;				lastTokenID = 0;				lastAtLineStart = false;				lastNoLineBreak = false;				lastExcludeMatch = false;				lastNoWordBreak = false;				lastDelegateSet = null;			}			else if (tag == "KEYWORD1")			{				addKeyword(lastKeyword, Token.KEYWORD1);			}			else if (tag == "KEYWORD2")			{				addKeyword(lastKeyword, Token.KEYWORD2);			}			else if (tag == "KEYWORD3")			{				addKeyword(lastKeyword, Token.KEYWORD3);			}			else if (tag == "COMMENT1")			{				addKeyword(lastKeyword, Token.COMMENT1);			}			else if (tag == "COMMENT2")			{				addKeyword(lastKeyword, Token.COMMENT2);			}			else if (tag == "LITERAL1")			{				addKeyword(lastKeyword, Token.LITERAL1);			}			else if (tag == "LITERAL2")			{				addKeyword(lastKeyword, Token.LITERAL2);			}			else if (tag == "LABEL")			{				addKeyword(lastKeyword, Token.LABEL);			}			else if (tag == "OPERATOR")			{				addKeyword(lastKeyword, Token.OPERATOR);			}			else if (tag == "NULL")			{				addKeyword(lastKeyword, Token.NULL);			}			popElement();		}		else		{			// can't happen			throw new InternalError();		}	}