程序包 org.antlr.tool
类 NameSpaceChecker
- java.lang.Object
-
- org.antlr.tool.NameSpaceChecker
-
public class NameSpaceChecker extends java.lang.Object
-
-
构造器概要
构造器 构造器 说明 NameSpaceChecker(Grammar grammar)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidcheckConflicts()protected voidcheckForGlobalScopeTokenConflict(AttributeScope scope)protected voidcheckForLabelConflict(Rule r, Token label)Make sure a label doesn't conflict with another symbol.booleancheckForLabelTypeMismatch(Rule r, Token label, int type)If type of previous label differs from new label's type, that's an error.protected voidcheckForRuleArgumentAndReturnValueConflicts(Rule r)protected voidcheckForRuleDefinitionProblems(Rule r)voidcheckForRuleScopeAttributeConflict(Rule r, Attribute attribute)Check for collision of a rule-scope dynamic attribute with: arg, return value, rule name itself.protected voidlookForReferencesToUndefinedSymbols()If ref to undefined rule, give error at first occurrence.
-
-
-
字段详细资料
-
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, 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.
-
-