Top Fields Constructors Methods
org.antlr.tool

public Class NameSpaceChecker

extends Object
Class Inheritance
Imports
org.antlr.analysis.Label, org.antlr.runtime.Token, java.util.Iterator, .List, .Set

Field Summary

Modifier and TypeField and Description
protected Grammar

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
protected void
protected void
checkForLabelConflict(Rule r, Token label)

Make sure a label doesn't conflict with another symbol.

public boolean
checkForLabelTypeMismatch(Rule r, Token label, int type)

If type of previous label differs from new label's type, that's an error.

protected void
protected void
public 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.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

grammarback to summary
protected Grammar grammar

Constructor Detail

NameSpaceCheckerback to summary
public NameSpaceChecker(Grammar grammar)

Method Detail

checkConflictsback to summary
public void checkConflicts()
checkForGlobalScopeTokenConflictback to summary
protected void checkForGlobalScopeTokenConflict(AttributeScope scope)
checkForLabelConflictback to summary
protected void checkForLabelConflict(Rule r, 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.

checkForLabelTypeMismatchback to summary
public boolean checkForLabelTypeMismatch(Rule r, Token label, int type)

If type of previous label differs from new label's type, that's an error.

checkForRuleArgumentAndReturnValueConflictsback to summary
protected void checkForRuleArgumentAndReturnValueConflicts(Rule r)
checkForRuleDefinitionProblemsback to summary
protected void checkForRuleDefinitionProblems(Rule r)
checkForRuleScopeAttributeConflictback to summary
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.

lookForReferencesToUndefinedSymbolsback to summary
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.