if (!RulePosition.isRulePositionOfType(lastRulePosition, BindingValueRule.class) && !RulePosition.isRulePositionOfType(lastRulePosition, StringLiteralRule.class)) {
if (!RulePosition.isRulePositionOfType(lastRulePosition, BindingValueRule.class) && !RulePosition.isRulePositionOfType(lastRulePosition, StringLiteralRule.class) && !RulePosition.isRulePositionOfType(lastRulePosition, WOOGNLRule.class)) {
	protected synchronized void parse() {		myElements.clear();		myProblems.clear();		WodScanner scanner = WodScanner.wodScannerForDocument(myDocument);		DocumentWodBinding lastBinding = null;		DocumentWodElement element = null;		RulePosition savedRulePosition = null;		RulePosition lastRulePosition = null;		boolean stringLiteralIsABindingName = false;		RulePosition rulePosition;		while ((rulePosition = scanner.nextRulePosition()) != null) {			boolean whitespace = false;			boolean comment = false;			if (RulePosition.isRulePositionOfType(rulePosition, WhitespaceRule.class)) {				whitespace = true;			} else if (RulePosition.isRulePositionOfType(rulePosition, ICommentRule.class)) {				comment = true;				if (lastBinding != null) {					try {						String commentText = rulePosition.getText();						if (commentText.startsWith("//")) {							commentText = commentText.substring(2).trim();							if ("VALID".equalsIgnoreCase(commentText)) {								lastBinding.setValidate(false);							}						}					} catch (BadLocationException e) {						e.printStackTrace();					}				}			} else if (RulePosition.isRulePositionOfType(rulePosition, ElementNameRule.class)) {				if (lastRulePosition != null && !RulePosition.isOperatorOfType(lastRulePosition, CloseDefinitionWordDetector.class)) {					addProblem("The element name '" + rulePosition._getTextWithoutException() + "' can only appear at the beginning of the document or after a '}'", rulePosition, false);				}				savedRulePosition = rulePosition;				element = null;			} else if (RulePosition.isOperatorOfType(rulePosition, ElementTypeOperatorWordDetector.class)) {				if (!RulePosition.isRulePositionOfType(lastRulePosition, ElementNameRule.class)) {					addProblem("A ':' can only appear after an element name", rulePosition, false);				}			} else if (RulePosition.isRulePositionOfType(rulePosition, ElementTypeRule.class)) {				if (!RulePosition.isOperatorOfType(lastRulePosition, ElementTypeOperatorWordDetector.class)) {					addProblem("The element type '" + rulePosition._getTextWithoutException() + "' can only appear after a ':'", rulePosition, false);				} else {					element = new DocumentWodElement(savedRulePosition, rulePosition, this);					addElement(element);					savedRulePosition = null;				}			} else if (RulePosition.isOperatorOfType(rulePosition, OpenDefinitionWordDetector.class)) {				if (!RulePosition.isRulePositionOfType(lastRulePosition, ElementTypeRule.class)) {					addProblem("A '{' can only appear after an element type", rulePosition, false);				}			} else if (RulePosition.isRulePositionOfType(rulePosition, StringLiteralRule.class)) {				boolean literalIsValue = RulePosition.isOperatorOfType(lastRulePosition, AssignmentOperatorWordDetector.class);				boolean literalIsName = !literalIsValue && (RulePosition.isOperatorOfType(lastRulePosition, EndAssignmentWordDetector.class) || RulePosition.isOperatorOfType(lastRulePosition, OpenDefinitionWordDetector.class));				if (!literalIsValue && !literalIsName) {					addProblem("The string literal '" + rulePosition._getTextWithoutException() + "' can only appear after a '{', '=', or ';'.", rulePosition, false);					savedRulePosition = null;				} else if (literalIsName) {					savedRulePosition = rulePosition;				} else if (literalIsValue) {					lastBinding = addBinding(element, savedRulePosition, rulePosition);					savedRulePosition = null;				}			} else if (RulePosition.isRulePositionOfType(rulePosition, BindingNameRule.class)) {				if (!RulePosition.isOperatorOfType(lastRulePosition, OpenDefinitionWordDetector.class) && !RulePosition.isOperatorOfType(lastRulePosition, EndAssignmentWordDetector.class)) {					addProblem("The binding name '" + rulePosition._getTextWithoutException() + "' can only appear after a '{' or a ';'", rulePosition, false);				}				savedRulePosition = rulePosition;				lastBinding = null;			} else if (RulePosition.isOperatorOfType(rulePosition, AssignmentOperatorWordDetector.class)) {				if (!RulePosition.isRulePositionOfType(lastRulePosition, BindingNameRule.class) && !RulePosition.isRulePositionOfType(lastRulePosition, StringLiteralRule.class)) {					addProblem("An '=' can only appear after a binding name", rulePosition, false);				}			} else if (RulePosition.isRulePositionOfType(rulePosition, BindingValueRule.class)) {				if (!RulePosition.isOperatorOfType(lastRulePosition, AssignmentOperatorWordDetector.class)) {					addProblem("The binding value '" + rulePosition._getTextWithoutException() + "' can only appear after an '='", rulePosition, false);				} else {					lastBinding = addBinding(element, savedRulePosition, rulePosition);				}				savedRulePosition = null;			} else if (RulePosition.isOperatorOfType(rulePosition, EndAssignmentWordDetector.class)) {				if (!RulePosition.isRulePositionOfType(lastRulePosition, BindingValueRule.class) && !RulePosition.isRulePositionOfType(lastRulePosition, StringLiteralRule.class)) {					addProblem("A ';' can only appear after a binding value", rulePosition, false);				}			} else if (RulePosition.isOperatorOfType(rulePosition, CloseDefinitionWordDetector.class)) {				if (!RulePosition.isOperatorOfType(lastRulePosition, OpenDefinitionWordDetector.class) && !RulePosition.isOperatorOfType(lastRulePosition, EndAssignmentWordDetector.class)) {					addProblem("A '}' can only appear after a ';' or a '{'", rulePosition, false);				} else {					element = null;				}				lastBinding = null;			} else {				addProblem("'" + rulePosition._getTextWithoutException() + "' is an unknown keyword", rulePosition, false);			}			if (!whitespace && !comment) {				lastRulePosition = rulePosition;			}		}		if (lastRulePosition != null && !RulePosition.isOperatorOfType(lastRulePosition, CloseDefinitionWordDetector.class)) {			addProblem("The last entry in a WOD file must be a '}'.", lastRulePosition, false);		}	}