public static void grammarError(int msgID, Grammar g, Token token) { grammarError(msgID,g,token,null,null); }
public static void grammarError(int msgID, Grammar g, Token token) { grammarError(msgID,g,token,null,null); }
public static void grammarError(int msgID, Grammar g, Token token) { grammarError(msgID,g,token,null,null); }
public static void grammarError(int msgID, Grammar g, Token token) { grammarError(msgID,g,token,null,null); }
protected void checkForRuleArgumentAndReturnValueConflicts(Rule r) { if ( r.returnScope!=null ) { Set conflictingKeys = r.returnScope.intersection(r.parameterScope); if (conflictingKeys!=null) { for (Iterator it = conflictingKeys.iterator(); it.hasNext();) { String key = (String) it.next(); ErrorManager.grammarError( ErrorManager.MSG_ARG_RETVAL_CONFLICT, grammar, r.tree.getToken(), key, r.name); } } } }
public void checkElementRefUniqueness(String ref, boolean isToken) { List refs = null; if ( isToken ) { refs = enclosingRule.getTokenRefsInAlt(ref, outerAltNum); } else { refs = enclosingRule.getRuleRefsInAlt(ref, outerAltNum); } if ( refs!=null && refs.size()>1 ) { ErrorManager.grammarError(ErrorManager.MSG_NONUNIQUE_REF, grammar, actionToken, ref); } }
public void checkElementRefUniqueness(String ref, boolean isToken) { List<GrammarAST> refs = null; if ( isToken ) { refs = enclosingRule.getTokenRefsInAlt(ref, outerAltNum); } else { refs = enclosingRule.getRuleRefsInAlt(ref, outerAltNum); } if ( refs!=null && refs.size()>1 ) { ErrorManager.grammarError(ErrorManager.MSG_NONUNIQUE_REF, grammar, actionToken, ref); } }
public void checkElementRefUniqueness(String ref, boolean isToken) { List<GrammarAST> refs = null; if ( isToken ) { refs = enclosingRule.getTokenRefsInAlt(ref, outerAltNum); } else { refs = enclosingRule.getRuleRefsInAlt(ref, outerAltNum); } if ( refs!=null && refs.size()>1 ) { ErrorManager.grammarError(ErrorManager.MSG_NONUNIQUE_REF, grammar, actionToken, ref); } }
protected void checkForRuleArgumentAndReturnValueConflicts(Rule r) { if ( r.returnScope!=null ) { Set<String> conflictingKeys = r.returnScope.intersection(r.parameterScope); if (conflictingKeys!=null) { for (String key : conflictingKeys) { ErrorManager.grammarError( ErrorManager.MSG_ARG_RETVAL_CONFLICT, grammar, r.tree.getToken(), key, r.name); } } } }
protected void checkForRuleArgumentAndReturnValueConflicts(Rule r) { if ( r.returnScope!=null ) { Set<String> conflictingKeys = r.returnScope.intersection(r.parameterScope); if (conflictingKeys!=null) { for (String key : conflictingKeys) { ErrorManager.grammarError( ErrorManager.MSG_ARG_RETVAL_CONFLICT, grammar, r.tree.getToken(), key, r.name); } } } }
/** Given @scope::name {action} define it for this attribute scope. Later, * the code generator will ask for the actions table. */ public final void defineNamedAction(GrammarAST nameAST, GrammarAST actionAST) { String actionName = nameAST.getText(); GrammarAST a = actions.get(actionName); if (a != null) { ErrorManager.grammarError(ErrorManager.MSG_ACTION_REDEFINITION, grammar, nameAST.getToken(), nameAST.getText()); } else { actions.put(actionName, actionAST); } }
/** Given @scope::name {action} define it for this attribute scope. Later, * the code generator will ask for the actions table. */ public final void defineNamedAction(GrammarAST nameAST, GrammarAST actionAST) { String actionName = nameAST.getText(); GrammarAST a = actions.get(actionName); if (a != null) { ErrorManager.grammarError(ErrorManager.MSG_ACTION_REDEFINITION, grammar, nameAST.getToken(), nameAST.getText()); } else { actions.put(actionName, actionAST); } }
protected void checkForGlobalScopeTokenConflict(AttributeScope scope) { if ( grammar.getTokenType(scope.getName())!=Label.INVALID ) { ErrorManager.grammarError(ErrorManager.MSG_SYMBOL_CONFLICTS_WITH_GLOBAL_SCOPE, grammar, null, scope.getName()); } }
protected void checkForGlobalScopeTokenConflict(AttributeScope scope) { if ( grammar.getTokenType(scope.getName())!=Label.INVALID ) { ErrorManager.grammarError(ErrorManager.MSG_SYMBOL_CONFLICTS_WITH_GLOBAL_SCOPE, grammar, null, scope.getName()); } }
protected void checkForGlobalScopeTokenConflict(AttributeScope scope) { if ( grammar.getTokenType(scope.getName())!=Label.INVALID ) { ErrorManager.grammarError(ErrorManager.MSG_SYMBOL_CONFLICTS_WITH_GLOBAL_SCOPE, grammar, null, scope.getName()); } }
protected void checkForGlobalScopeTokenConflict(AttributeScope scope) { if ( grammar.getTokenType(scope.getName())!=Label.INVALID ) { ErrorManager.grammarError(ErrorManager.MSG_SYMBOL_CONFLICTS_WITH_GLOBAL_SCOPE, grammar, null, scope.getName()); } }
public void defineRuleListLabel(String ruleName, Token label, GrammarAST element) { Rule r = getLocallyDefinedRule(ruleName); if ( r!=null ) { if ( !r.getHasMultipleReturnValues() ) { ErrorManager.grammarError( ErrorManager.MSG_LIST_LABEL_INVALID_UNLESS_RETVAL_STRUCT,this, label,label.getText()); } defineLabel(r, label, element, RULE_LIST_LABEL); } }
public void defineRuleListLabel(String ruleName, Token label, GrammarAST element) { Rule r = getLocallyDefinedRule(ruleName); if ( r!=null ) { if ( !r.getHasMultipleReturnValues() ) { ErrorManager.grammarError( ErrorManager.MSG_LIST_LABEL_INVALID_UNLESS_RETVAL_STRUCT,this, label,label.getText()); } defineLabel(r, label, element, RULE_LIST_LABEL); } }
public void defineRuleListLabel(String ruleName, antlr.Token label, GrammarAST element) { Rule r = getLocallyDefinedRule(ruleName); if ( r!=null ) { if ( !r.getHasMultipleReturnValues() ) { ErrorManager.grammarError( ErrorManager.MSG_LIST_LABEL_INVALID_UNLESS_RETVAL_STRUCT,this, label,label.getText()); } defineLabel(r, label, element, RULE_LIST_LABEL); } }
public void defineRuleListLabel(String ruleName, antlr.Token label, GrammarAST element) { Rule r = getLocallyDefinedRule(ruleName); if ( r!=null ) { if ( !r.getHasMultipleReturnValues() ) { ErrorManager.grammarError( ErrorManager.MSG_LIST_LABEL_INVALID_UNLESS_RETVAL_STRUCT,this, label,label.getText()); } defineLabel(r, label, element, RULE_LIST_LABEL); } }