org.antlr.tool
Class NameSpaceChecker

java.lang.Object
  extended by org.antlr.tool.NameSpaceChecker

public class NameSpaceChecker
extends java.lang.Object


Field Summary
protected  Grammar grammar
           
 
Constructor Summary
NameSpaceChecker(Grammar grammar)
           
 
Method Summary
 void checkConflicts()
           
protected  void checkForGlobalScopeTokenConflict(AttributeScope scope)
           
protected  void checkForLabelConflict(Rule r, antlr.Token label)
          Make sure a label doesn't conflict with another symbol.
 boolean checkForLabelTypeMismatch(Rule r, antlr.Token label, int type)
          If type of previous label differs from new label's type, that's an error.
protected  void checkForRuleArgumentAndReturnValueConflicts(Rule r)
           
protected  void checkForRuleDefinitionProblems(Rule r)
           
 void checkForRuleScopeAttributeConflict(Rule r, Attribute attribute)
          Check for collision of a rule-scope dynamic attribute with: arg, return value, rule name itself.
protected  void lookForReferencesToUndefinedSymbols()
          If ref to undefined rule, give error at first occurrence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

grammar

protected Grammar grammar
Constructor Detail

NameSpaceChecker

public NameSpaceChecker(Grammar grammar)
Method Detail

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.