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()); } }
/** 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; }
protected void finish() { int numEntryPoints = factory.build_EOFStates( grammar.getRules() ); if ( numEntryPoints == 0 ) { ErrorManager.grammarWarning( ErrorManager.MSG_NO_GRAMMAR_START_RULE, grammar, null, grammar.name ); } }
/** From char 'c' build StateCluster o-intValue(c)->o */ public StateCluster build_CharLiteralAtom(GrammarAST charLiteralAST) { int c = Grammar.getCharValueFromGrammarCharLiteral(charLiteralAST.getText()); return build_Atom(c, charLiteralAST); }
/** ANALYZE ACTIONS, LOOKING FOR LABEL AND ATTR REFS, sanity check */ public void checkNameSpaceAndActions() { examineAllExecutableActions(); checkAllRulesForUselessLabels(); nameSpaceChecker.checkConflicts(); }
public CommonToken scan(String startRule, List<NFAState> visitedStates) throws RecognitionException { LexerActionGetTokenType actions = new LexerActionGetTokenType(grammar); scan(startRule, actions, visitedStates); return actions.token; }
/** From char 'c' build StateCluster o-intValue(c)->o * can include unicode spec likes '\u0024' later. Accepts * actual unicode 16-bit now, of course, by default. * TODO not supplemental char clean! */ public StateCluster build_CharRange(String a, String b) { int from = Grammar.getCharValueFromGrammarCharLiteral(a); int to = Grammar.getCharValueFromGrammarCharLiteral(b); return build_Range(from, to); }
/** Define a label defined in a rule r; check the validity then ask the * Rule object to actually define it. */ protected void defineLabel(Rule r, Token label, GrammarAST element, int type) { boolean err = nameSpaceChecker.checkForLabelTypeMismatch(r, label, type); if ( err ) { return; } r.defineLabel(label, element, type); }
/** 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; }
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()); } }
/** 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; }
/** From char 'c' build StateCluster o-intValue(c)->o */ public StateCluster build_CharLiteralAtom(GrammarAST charLiteralAST) { int c = Grammar.getCharValueFromGrammarCharLiteral(charLiteralAST.getText()); return build_Atom(c, charLiteralAST); }
protected void finish() { int numEntryPoints = factory.build_EOFStates( grammar.getRules() ); if ( numEntryPoints == 0 ) { ErrorManager.grammarWarning( ErrorManager.MSG_NO_GRAMMAR_START_RULE, grammar, null, grammar.name ); } }
public CommonToken scan(String startRule, List visitedStates) throws RecognitionException { LexerActionGetTokenType actions = new LexerActionGetTokenType(grammar); scan(startRule, actions, visitedStates); return actions.token; }
/** From char 'c' build StateCluster o-intValue(c)->o * can include unicode spec likes '\u0024' later. Accepts * actual unicode 16-bit now, of course, by default. * TODO not supplemental char clean! */ public StateCluster build_CharRange(String a, String b) { int from = Grammar.getCharValueFromGrammarCharLiteral(a); int to = Grammar.getCharValueFromGrammarCharLiteral(b); return build_Range(from, to); }
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()); } }
/** 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; }
/** From char 'c' build StateCluster o-intValue(c)->o */ public StateCluster build_CharLiteralAtom(GrammarAST charLiteralAST) { int c = Grammar.getCharValueFromGrammarCharLiteral(charLiteralAST.getText()); return build_Atom(c, charLiteralAST); }
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()); } }
/** From char 'c' build StateCluster o-intValue(c)->o */ public StateCluster build_CharLiteralAtom(GrammarAST charLiteralAST) { int c = Grammar.getCharValueFromGrammarCharLiteral(charLiteralAST.getText()); return build_Atom(c, charLiteralAST); }