/** If you label a rule reference, you can access that rule's * return values as well as any predefined attributes. */ public Attribute getAttribute(String name) { AttributeScope rulePropertiesScope = RuleLabelScope.grammarTypeToRulePropertiesScope[grammar.type]; if ( rulePropertiesScope.getAttribute(name)!=null ) { return rulePropertiesScope.getAttribute(name); } if ( referencedRule.returnScope!=null ) { return referencedRule.returnScope.getAttribute(name); } return null; } }
/** If you label a rule reference, you can access that rule's * return values as well as any predefined attributes. */ public Attribute getAttribute(String name) { AttributeScope rulePropertiesScope = RuleLabelScope.grammarTypeToRulePropertiesScope[grammar.type]; if ( rulePropertiesScope.getAttribute(name)!=null ) { return rulePropertiesScope.getAttribute(name); } if ( referencedRule.returnScope!=null ) { return referencedRule.returnScope.getAttribute(name); } return null; } }
/** If you label a rule reference, you can access that rule's * return values as well as any predefined attributes. */ @Override public Attribute getAttribute(String name) { AttributeScope rulePropertiesScope = RuleLabelScope.grammarTypeToRulePropertiesScope[grammar.type]; if ( rulePropertiesScope.getAttribute(name)!=null ) { return rulePropertiesScope.getAttribute(name); } if ( referencedRule.returnScope!=null ) { return referencedRule.returnScope.getAttribute(name); } return null; } }
/** If you label a rule reference, you can access that rule's * return values as well as any predefined attributes. */ @Override public Attribute getAttribute(String name) { AttributeScope rulePropertiesScope = RuleLabelScope.grammarTypeToRulePropertiesScope[grammar.type]; if ( rulePropertiesScope.getAttribute(name)!=null ) { return rulePropertiesScope.getAttribute(name); } if ( referencedRule.returnScope!=null ) { return referencedRule.returnScope.getAttribute(name); } return null; } }
/** Get the arg, return value, or predefined property for this rule */ public AttributeScope getLocalAttributeScope(String name) { AttributeScope scope = null; if ( returnScope!=null && returnScope.getAttribute(name)!=null ) { scope = returnScope; } else if ( parameterScope!=null && parameterScope.getAttribute(name)!=null ) { scope = parameterScope; } else { AttributeScope rulePropertiesScope = RuleLabelScope.grammarTypeToRulePropertiesScope[grammar.type]; if ( rulePropertiesScope.getAttribute(name)!=null ) { scope = rulePropertiesScope; } } return scope; }
/** Get the arg, return value, or predefined property for this rule */ public AttributeScope getLocalAttributeScope(String name) { AttributeScope scope = null; if ( returnScope!=null && returnScope.getAttribute(name)!=null ) { scope = returnScope; } else if ( parameterScope!=null && parameterScope.getAttribute(name)!=null ) { scope = parameterScope; } else { AttributeScope rulePropertiesScope = RuleLabelScope.grammarTypeToRulePropertiesScope[grammar.type]; if ( rulePropertiesScope.getAttribute(name)!=null ) { scope = rulePropertiesScope; } } return scope; }
/** Get the arg, return value, or predefined property for this rule */ public AttributeScope getLocalAttributeScope(String name) { AttributeScope scope = null; if ( returnScope!=null && returnScope.getAttribute(name)!=null ) { scope = returnScope; } else if ( parameterScope!=null && parameterScope.getAttribute(name)!=null ) { scope = parameterScope; } else { AttributeScope rulePropertiesScope = RuleLabelScope.grammarTypeToRulePropertiesScope[grammar.type]; if ( rulePropertiesScope.getAttribute(name)!=null ) { scope = rulePropertiesScope; } } return scope; }
/** Get the arg, return value, or predefined property for this rule */ public AttributeScope getLocalAttributeScope(String name) { AttributeScope scope = null; if ( returnScope!=null && returnScope.getAttribute(name)!=null ) { scope = returnScope; } else if ( parameterScope!=null && parameterScope.getAttribute(name)!=null ) { scope = parameterScope; } else { AttributeScope rulePropertiesScope = RuleLabelScope.grammarTypeToRulePropertiesScope[grammar.type]; if ( rulePropertiesScope.getAttribute(name)!=null ) { scope = rulePropertiesScope; } } return scope; }
/** Return the scope containing name */ public AttributeScope getAttributeScope(String name) { AttributeScope scope = getLocalAttributeScope(name); if ( scope!=null ) { return scope; } if ( ruleScope!=null && ruleScope.getAttribute(name)!=null ) { scope = ruleScope; } return scope; }
/** Return the scope containing name */ public AttributeScope getAttributeScope(String name) { AttributeScope scope = getLocalAttributeScope(name); if ( scope!=null ) { return scope; } if ( ruleScope!=null && ruleScope.getAttribute(name)!=null ) { scope = ruleScope; } return scope; }
/** Return the scope containing name */ public AttributeScope getAttributeScope(String name) { AttributeScope scope = getLocalAttributeScope(name); if ( scope!=null ) { return scope; } if ( ruleScope!=null && ruleScope.getAttribute(name)!=null ) { scope = ruleScope; } return scope; }
/** Return the scope containing name */ public AttributeScope getAttributeScope(String name) { AttributeScope scope = getLocalAttributeScope(name); if ( scope!=null ) { return scope; } if ( ruleScope!=null && ruleScope.getAttribute(name)!=null ) { scope = ruleScope; } return scope; }
/** Check for collision of a rule-scope dynamic attribute with: * arg, return value, rule name itself. Labels are checked elsewhere. */ public void checkForRuleScopeAttributeConflict(Rule r, Attribute attribute) { int msgID = 0; Object arg2 = null; String attrName = attribute.name; if ( r.name.equals(attrName) ) { msgID = ErrorManager.MSG_ATTRIBUTE_CONFLICTS_WITH_RULE; arg2 = r.name; } else if ( (r.returnScope!=null&&r.returnScope.getAttribute(attrName)!=null) || (r.parameterScope!=null&&r.parameterScope.getAttribute(attrName)!=null) ) { msgID = ErrorManager.MSG_ATTRIBUTE_CONFLICTS_WITH_RULE_ARG_RETVAL; arg2 = r.name; } if ( msgID!=0 ) { ErrorManager.grammarError(msgID,grammar,r.tree.getToken(),attrName,arg2); } }
/** Check for collision of a rule-scope dynamic attribute with: * arg, return value, rule name itself. Labels are checked elsewhere. */ public void checkForRuleScopeAttributeConflict(Rule r, Attribute attribute) { int msgID = 0; Object arg2 = null; String attrName = attribute.name; if ( r.name.equals(attrName) ) { msgID = ErrorManager.MSG_ATTRIBUTE_CONFLICTS_WITH_RULE; arg2 = r.name; } else if ( (r.returnScope!=null&&r.returnScope.getAttribute(attrName)!=null) || (r.parameterScope!=null&&r.parameterScope.getAttribute(attrName)!=null) ) { msgID = ErrorManager.MSG_ATTRIBUTE_CONFLICTS_WITH_RULE_ARG_RETVAL; arg2 = r.name; } if ( msgID!=0 ) { ErrorManager.grammarError(msgID,grammar,r.tree.getToken(),attrName,arg2); } }
/** Check for collision of a rule-scope dynamic attribute with: * arg, return value, rule name itself. Labels are checked elsewhere. */ public void checkForRuleScopeAttributeConflict(Rule r, Attribute attribute) { int msgID = 0; Object arg2 = null; String attrName = attribute.name; if ( r.name.equals(attrName) ) { msgID = ErrorManager.MSG_ATTRIBUTE_CONFLICTS_WITH_RULE; arg2 = r.name; } else if ( (r.returnScope!=null&&r.returnScope.getAttribute(attrName)!=null) || (r.parameterScope!=null&&r.parameterScope.getAttribute(attrName)!=null) ) { msgID = ErrorManager.MSG_ATTRIBUTE_CONFLICTS_WITH_RULE_ARG_RETVAL; arg2 = r.name; } if ( msgID!=0 ) { ErrorManager.grammarError(msgID,grammar,r.tree.getToken(),attrName,arg2); } }
/** Check for collision of a rule-scope dynamic attribute with: * arg, return value, rule name itself. Labels are checked elsewhere. */ public void checkForRuleScopeAttributeConflict(Rule r, Attribute attribute) { int msgID = 0; Object arg2 = null; String attrName = attribute.name; if ( r.name.equals(attrName) ) { msgID = ErrorManager.MSG_ATTRIBUTE_CONFLICTS_WITH_RULE; arg2 = r.name; } else if ( (r.returnScope!=null&&r.returnScope.getAttribute(attrName)!=null) || (r.parameterScope!=null&&r.parameterScope.getAttribute(attrName)!=null) ) { msgID = ErrorManager.MSG_ATTRIBUTE_CONFLICTS_WITH_RULE_ARG_RETVAL; arg2 = r.name; } if ( msgID!=0 ) { ErrorManager.grammarError(msgID,grammar,r.tree.getToken(),attrName,arg2); } }
/** For $rulelabel.name, return the Attribute found for name. It * will be a predefined property or a return value. */ public Attribute getRuleLabelAttribute(String ruleName, String attrName) { Rule r = grammar.getRule(ruleName); AttributeScope scope = r.getLocalAttributeScope(attrName); if ( scope!=null && !scope.isParameterScope ) { return scope.getAttribute(attrName); } return null; }
/** For $rulelabel.name, return the Attribute found for name. It * will be a predefined property or a return value. */ public Attribute getRuleLabelAttribute(String ruleName, String attrName) { Rule r = grammar.getRule(ruleName); AttributeScope scope = r.getLocalAttributeScope(attrName); if ( scope!=null && !scope.isParameterScope ) { return scope.getAttribute(attrName); } return null; }
/** For $rulelabel.name, return the Attribute found for name. It * will be a predefined property or a return value. */ public Attribute getRuleLabelAttribute(String ruleName, String attrName) { Rule r = grammar.getRule(ruleName); AttributeScope scope = r.getLocalAttributeScope(attrName); if ( scope!=null && !scope.isParameterScope ) { return scope.getAttribute(attrName); } return null; }
msgID = ErrorManager.MSG_LABEL_CONFLICTS_WITH_TOKEN; else if ( r.ruleScope!=null && r.ruleScope.getAttribute(label.getText())!=null ) { msgID = ErrorManager.MSG_LABEL_CONFLICTS_WITH_RULE_SCOPE_ATTRIBUTE; arg2 = r.name; else if ( (r.returnScope!=null&&r.returnScope.getAttribute(label.getText())!=null) || (r.parameterScope!=null&&r.parameterScope.getAttribute(label.getText())!=null) )