org.antlr.tool
Class NameSpaceChecker
java.lang.Object
org.antlr.tool.NameSpaceChecker
public class NameSpaceChecker
- extends java.lang.Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
grammar
protected Grammar grammar
NameSpaceChecker
public NameSpaceChecker(Grammar grammar)
checkConflicts
public void checkConflicts()
checkForRuleArgumentAndReturnValueConflicts
protected void checkForRuleArgumentAndReturnValueConflicts(Rule r)
checkForRuleDefinitionProblems
protected void checkForRuleDefinitionProblems(Rule r)
lookForReferencesToUndefinedSymbols
protected void lookForReferencesToUndefinedSymbols()
- If ref to undefined rule, give error at first occurrence.
Give error if you cannot find the scope override on a rule reference.
If you ref ID in a combined grammar and don't define ID as a lexer rule
it is an error.
checkForGlobalScopeTokenConflict
protected void checkForGlobalScopeTokenConflict(AttributeScope scope)
checkForRuleScopeAttributeConflict
public void checkForRuleScopeAttributeConflict(Rule r,
Attribute attribute)
- Check for collision of a rule-scope dynamic attribute with:
arg, return value, rule name itself. Labels are checked elsewhere.
checkForLabelConflict
protected void checkForLabelConflict(Rule r,
antlr.Token label)
- Make sure a label doesn't conflict with another symbol.
Labels must not conflict with: rules, tokens, scope names,
return values, parameters, and rule-scope dynamic attributes
defined in surrounding rule.
checkForLabelTypeMismatch
public boolean checkForLabelTypeMismatch(Rule r,
antlr.Token label,
int type)
- If type of previous label differs from new label's type, that's an error.
Copyright © 2013. All Rights Reserved.