Class NameSpaceChecker


  • public class NameSpaceChecker
    extends java.lang.Object
    • 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,
                                             org.antlr.runtime.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,
                                                 org.antlr.runtime.Token label,
                                                 int type)
        If type of previous label differs from new label's type, that's an error.