/external/antlr/antlr-3.4/tool/src/main/java/org/antlr/analysis/ |
H A D | NFAConversionThread.java | 36 Grammar grammar; field in class:NFAConversionThread 39 public NFAConversionThread(Grammar grammar, argument 44 this.grammar = grammar; 51 NFAState decisionStartState = grammar.getDecisionNFAStartState(decision); 53 grammar.createLookaheadDFA(decision,true);
|
H A D | DFAOptimizer.java | 130 protected Grammar grammar; field in class:DFAOptimizer 132 public DFAOptimizer(Grammar grammar) { argument 133 this.grammar = grammar; 137 // optimize each DFA in this grammar 139 decisionNumber<=grammar.getNumberOfDecisions(); 142 DFA dfa = grammar.getLookaheadDFA(decisionNumber); 196 edge.label.toString(d.dfa.nfa.grammar)+"->"+ 225 edge.label.toString(d.dfa.nfa.grammar)+"->"+
|
H A D | NFA.java | 33 /** An NFA (collection of NFAStates) constructed from a grammar. This 34 * NFA is one big machine for entire grammar. Decision points are recorded 41 /** This NFA represents which grammar? */ 42 public Grammar grammar; field in class:NFA 50 this.grammar = g; 54 return grammar.composite.getNewNFAStateNumber(); 58 grammar.composite.addState(state); 62 return grammar.composite.getState(s);
|
H A D | LL1Analyzer.java | 30 import org.antlr.grammar.v3.ANTLRParser; 56 public Grammar grammar; field in class:LL1Analyzer 64 public LL1Analyzer(Grammar grammar) { argument 65 this.grammar = grammar; 86 // walk every rule in this grammar and compare FIRST set with 95 if ( importedRule != null ) { // exists in imported grammar 96 // System.out.println(r.name+" exists in imported grammar: FIRST="+importedRule.FIRST); 154 //System.out.println("< FIRST("+s.enclosingRule.name+") in rule "+s.enclosingRule+"="+look.toString(this.grammar)); 166 //System.out.println("< FOLLOW("+r+") in rule "+r.startState.enclosingRule+"="+f.toString(this.grammar)); [all...] |
/external/antlr/antlr-3.4/gunit/src/main/java/org/antlr/gunit/swingui/runner/ |
H A D | ParserLoader.java | 40 private String grammar; field in class:ParserLoader 55 grammar = grammarName; 91 if(name.startsWith(grammar)) {
|
/external/antlr/antlr-3.4/tool/src/main/java/org/antlr/codegen/ |
H A D | JavaTarget.java | 40 Grammar grammar, 48 protected void performGrammarAnalysis(CodeGenerator generator, Grammar grammar) { argument 49 super.performGrammarAnalysis(generator, grammar); 50 for (Rule rule : grammar.getRules()) { 53 Set<Rule> delegatedRules = grammar.getDelegatedRules(); 38 chooseWhereCyclicDFAsGo(Tool tool, CodeGenerator generator, Grammar grammar, ST recognizerST, ST cyclicDFAST) argument
|
H A D | CPPTarget.java | 88 Grammar grammar, 93 generator.write(headerFileST, grammar.name+extName); 96 /** Convert from an ANTLR char literal found in a grammar file to 106 if( codegen.grammar.getMaxCharValue() > 255 ) 113 /** Convert from an ANTLR string literal found in a grammar file to 123 if( codegen.grammar.getMaxCharValue() > 255 ) 133 int maxval = 255; // codegen.grammar.get????(); 86 genRecognizerHeaderFile(Tool tool, CodeGenerator generator, Grammar grammar, ST headerFileST, String extName) argument
|
H A D | DelphiTarget.java | 51 Grammar grammar, 49 chooseWhereCyclicDFAsGo(Tool tool, CodeGenerator generator, Grammar grammar, ST recognizerST, ST cyclicDFAST) argument
|
H A D | ObjCTarget.java | 41 Grammar grammar, 46 generator.write(headerFileST, grammar.name + Grammar.grammarTypeToFileNameSuffix[grammar.type] + extName); 64 /** Convert from an ANTLR string literal found in a grammar file to 83 String name = generator.grammar.getTokenDisplayName(ttype); 89 //return generator.grammar.name + Grammar.grammarTypeToFileNameSuffix[generator.grammar.type] + "_" + name; 96 String name = generator.grammar.getTokenDisplayName(tokenType); 105 return generator.grammar.name + Grammar.grammarTypeToFileNameSuffix[generator.grammar 39 genRecognizerHeaderFile(Tool tool, CodeGenerator generator, Grammar grammar, ST headerFileST, String extName) argument [all...] |
H A D | ActionScriptTarget.java | 52 String name = generator.grammar.getTokenDisplayName(ttype); 128 Grammar grammar, 126 chooseWhereCyclicDFAsGo(Tool tool, CodeGenerator generator, Grammar grammar, ST recognizerST, ST cyclicDFAST) argument
|
H A D | CSharp3Target.java | 82 protected void genRecognizerFile(Tool tool, CodeGenerator generator, Grammar grammar, ST outputFileST) throws IOException argument 84 if (!grammar.getGrammarIsRoot()) 86 Grammar rootGrammar = grammar.composite.getRootGrammar(); 87 String actionScope = grammar.getDefaultActionScope(grammar.type); 92 actions = grammar.getActions().get(actionScope); 96 grammar.getActions().put(actionScope, actions); 104 super.genRecognizerFile(tool, generator, grammar, outputFileST);
|
H A D | CTarget.java | 44 Grammar grammar, 52 String fileName = generator.getRecognizerFileName(grammar.name, grammar.type); 59 Grammar grammar, 67 String fileName = generator.getRecognizerFileName(grammar.name, grammar.type); 75 Grammar grammar, 81 /** Is scope in @scope::name {action} valid for this kind of grammar? 183 /** Convert from an ANTLR string literal found in a grammar file to 276 * Overrides the standard grammar analysi 42 genRecognizerFile(Tool tool, CodeGenerator generator, Grammar grammar, ST outputFileST) argument 57 genRecognizerHeaderFile(Tool tool, CodeGenerator generator, Grammar grammar, ST headerFileST, String extName) argument 73 chooseWhereCyclicDFAsGo(Tool tool, CodeGenerator generator, Grammar grammar, ST recognizerST, ST cyclicDFAST) argument 291 performGrammarAnalysis(CodeGenerator generator, Grammar grammar) argument [all...] |
H A D | RubyTarget.java | 306 Grammar grammar, 314 and then generate code from that. It keeps the combo/parser grammar object 315 and the lexer grammar object, as well as their respective code generator and 321 - if this method is called with a combo grammar, and the action map 322 in the grammar contains an entry for the named scope "all", 323 add an entry to sharedActionBlocks mapping the grammar name to 326 (one that's extracted from a combo grammar), check to see if 327 there's an entry in sharedActionBlocks for the lexer's grammar name. 341 if ( grammar.type == Grammar.COMBINED ) { 342 Map<String, Map<String, Object>> actions = grammar 303 genRecognizerFile( Tool tool, CodeGenerator generator, Grammar grammar, ST outputFileST ) argument [all...] |
H A D | Target.java | 88 Grammar grammar, 93 generator.getRecognizerFileName(grammar.name, grammar.type); 99 Grammar grammar, 108 Grammar grammar) 110 // Build NFAs from the grammar AST 111 grammar.buildNFA(); 114 grammar.createLookaheadDFAs(); 117 /** Is scope in @scope::name {action} valid for this kind of grammar? 144 String name = generator.grammar 86 genRecognizerFile(Tool tool, CodeGenerator generator, Grammar grammar, ST outputFileST) argument 97 genRecognizerHeaderFile(Tool tool, CodeGenerator generator, Grammar grammar, ST headerFileST, String extName) argument 107 performGrammarAnalysis(CodeGenerator generator, Grammar grammar) argument [all...] |
/external/antlr/antlr-3.4/tool/src/main/java/org/antlr/tool/ |
H A D | FASerializer.java | 57 protected Grammar grammar; field in class:FASerializer 59 /** This aspect is associated with a grammar; used to get token names */ 60 public FASerializer(Grammar grammar) { argument 61 this.grammar = grammar; 172 preds.genExpr(grammar.generator, 173 grammar.generator.getTemplates(), null).render() 177 buf.append("-"+edge.label.toString(grammar)+predsStr+"->");
|
H A D | GrammarSyntaxMessage.java | 34 /** A problem with the syntax of your antlr grammar such as 44 Grammar grammar, 48 this(msgID,grammar,offendingToken,null,exception); 52 Grammar grammar, 60 this.g = grammar; 71 // TODO: have to update all v2 grammar files for this. or use errormanager and tool to get the current grammar 43 GrammarSyntaxMessage(int msgID, Grammar grammar, Token offendingToken, RecognitionException exception) argument 51 GrammarSyntaxMessage(int msgID, Grammar grammar, Token offendingToken, Object arg, RecognitionException exception) argument
|
H A D | BuildDependencyGenerator.java | 41 /** Given a grammar file, show the dependencies on .tokens etc... 43 * For example, combined grammar T.g (no token import) generates: 49 * For tree grammar TP with import of T.tokens: 63 * So this output shows what the grammar depends on *and* what it generates. 65 * Operate on one grammar file at a time. If given a list of .g on the 81 protected Grammar grammar; field in class:BuildDependencyGenerator 89 grammar = tool.getRootGrammar(grammarFileName); 90 String language = (String) grammar.getOption("language"); 91 generator = new CodeGenerator(tool, grammar, language); 111 generator.getRecognizerFileName(grammar [all...] |
H A D | NameSpaceChecker.java | 38 protected Grammar grammar; field in class:NameSpaceChecker 40 public NameSpaceChecker(Grammar grammar) { argument 41 this.grammar = grammar; 45 for (int i = CompositeGrammar.MIN_RULE_INDEX; i < grammar.composite.ruleIndexToRuleList.size(); i++) { 46 Rule r = grammar.composite.ruleIndexToRuleList.elementAt(i); 70 Iterator it = grammar.getGlobalScopes().values().iterator(); 87 grammar, 100 if ( (grammar.type==Grammar.PARSER||grammar [all...] |
H A D | CompositeGrammarTree.java | 36 public Grammar grammar; field in class:CompositeGrammarTree 42 grammar = g; 57 /** Find a rule by looking in current grammar then down towards the 61 Rule r = grammar.getLocallyDefinedRule(ruleName); 69 /** Find an option by looking up towards the root grammar rather than down */ 71 if ( grammar.tool!=null && key!=null && key.equals("language") && 72 grammar.tool.forcedLanguageOption!=null ) { 73 return grammar.tool.forcedLanguageOption; 75 Object o = grammar.getLocallyDefinedOption(key); 89 if ( this.grammar [all...] |
H A D | DOTGenerator.java | 32 import org.antlr.grammar.v3.ANTLRParser; 56 protected Grammar grammar; field in class:DOTGenerator 58 /** This aspect is associated with a grammar */ 59 public DOTGenerator(Grammar grammar) { argument 60 this.grammar = grammar; 213 if ( rr.rule.grammar != grammar ) { 214 edgeST.add("label", "<" + rr.rule.grammar.name + "." + rr.rule.name + ">"); 246 Collection rules = grammar [all...] |
H A D | GrammarSanity.java | 33 import org.antlr.grammar.v3.ANTLRParser; 48 protected Grammar grammar; field in class:GrammarSanity 49 public GrammarSanity(Grammar grammar) { argument 50 this.grammar = grammar; 59 grammar.buildNFA(); // make sure we have NFAs 60 grammar.leftRecursiveRules = new HashSet(); 62 for (int i = 0; i < grammar.composite.ruleIndexToRuleList.size(); i++) { 63 Rule r = grammar.composite.ruleIndexToRuleList.elementAt(i); 111 grammar [all...] |
H A D | Interpreter.java | 44 * You create an interpreter for a grammar and an input stream. This object 47 * for a lexer grammar of course. 50 protected Grammar grammar; field in class:Interpreter 74 public Interpreter(Grammar grammar, IntStream input) { argument 75 this.grammar = grammar; 80 if ( grammar.type!=Grammar.LEXER ) { 129 if ( grammar.type!=Grammar.LEXER ) { 134 // Build NFAs/DFAs from the grammar AST if NFAs haven't been built yet 135 if ( grammar [all...] |
H A D | AttributeScope.java | 63 public Grammar grammar; field in class:AttributeScope 92 public AttributeScope(Grammar grammar, String name, Token derivedFromToken) { argument 93 this.grammar = grammar; 128 grammar, 150 grammar,
|
/external/antlr/antlr-3.4/tool/src/test/java/org/antlr/test/ |
H A D | TestLeftRecursion.java | 10 String grammar = 11 "grammar T;\n" + 18 String found = execParser("T.g", grammar, "TParser", "TLexer", 25 String grammar = 26 "grammar T;\n" + 33 String found = execParser("T.g", grammar, "TParser", "TLexer", 40 String grammar = 41 "grammar T;\n" + 62 runTests(grammar, tests, "e"); 66 String grammar 357 runTests(String grammar, String[] tests, String startRule) argument [all...] |
/external/bison/src/ |
H A D | parse-gram.y | 82 node. This is because a single named-ref in the grammar may 108 /* Bison's grammar can initial empty locations, hence a default 230 prologue_declarations "%%" grammar epilogue.opt 540 | The grammar section: between the two %%. | 543 grammar: label 545 | grammar rules_or_grammar_declaration 548 /* As a Bison extension, one can use the grammar declarations in the 549 body of the grammar. */
|