void UpdateSpanStateVariables() 
		{
			inSpan = (currentSpanStack != null && currentSpanStack.Count > 0);
			activeSpan = inSpan ? (Span)currentSpanStack.Peek() : null;
			activeRuleSet = GetRuleSetForSpan(activeSpan);
		}
		public HighlightRuleSet GetRuleSetForSpan(Span aSpan)
		{
			if (aSpan == null) {
				return this.defaultRuleSet;
			} else {
				if (aSpan.RuleSet != null)
				{
					if (aSpan.RuleSet.Reference != null) {
						return aSpan.RuleSet.Highlighter.GetRuleSetForSpan(null);
					} else {
						return aSpan.RuleSet;
					}
				} else {
					return null;
				}
			}
		}