Searched defs:grammar (Results 1 - 25 of 53) sorted by relevance

123

/external/antlr/antlr-3.4/tool/src/main/java/org/antlr/analysis/
H A DNFAConversionThread.java36 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 DDFAOptimizer.java130 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 DNFA.java33 /** 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 DLL1Analyzer.java30 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/python/cpython2/Lib/lib2to3/pgen2/
H A Dconv.py7 parser from a grammar file in Python's grammar notation. But I don't
19 On the other hand, symbol numbers (representing the grammar's
20 non-terminals) are assigned by pgen based on the actual grammar
24 equivalent grammar tables directly from the Grammar.txt input file
33 from pgen2 import grammar, token namespace
36 class Converter(grammar.Grammar):
48 """Load the grammar tables from the text files written by pgen."""
57 nonterminals of the grammar as numbers. We build two tables
90 #include "grammar
[all...]
/external/python/cpython3/Lib/lib2to3/pgen2/
H A Dconv.py7 parser from a grammar file in Python's grammar notation. But I don't
19 On the other hand, symbol numbers (representing the grammar's
20 non-terminals) are assigned by pgen based on the actual grammar
24 equivalent grammar tables directly from the Grammar.txt input file
33 from pgen2 import grammar, token namespace
36 class Converter(grammar.Grammar):
48 """Load the grammar tables from the text files written by pgen."""
57 nonterminals of the grammar as numbers. We build two tables
90 #include "grammar
[all...]
/external/antlr/antlr-3.4/gunit/src/main/java/org/antlr/gunit/swingui/runner/
H A DParserLoader.java40 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 DJavaTarget.java40 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 DCPPTarget.java88 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 DDelphiTarget.java51 Grammar grammar,
49 chooseWhereCyclicDFAsGo(Tool tool, CodeGenerator generator, Grammar grammar, ST recognizerST, ST cyclicDFAST) argument
H A DObjCTarget.java41 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 DActionScriptTarget.java52 String name = generator.grammar.getTokenDisplayName(ttype);
128 Grammar grammar,
126 chooseWhereCyclicDFAsGo(Tool tool, CodeGenerator generator, Grammar grammar, ST recognizerST, ST cyclicDFAST) argument
H A DCSharp3Target.java82 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 DCTarget.java44 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...]
/external/antlr/antlr-3.4/tool/src/main/java/org/antlr/tool/
H A DFASerializer.java57 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 DGrammarSyntaxMessage.java34 /** 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 DBuildDependencyGenerator.java41 /** 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 DNameSpaceChecker.java38 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 DCompositeGrammarTree.java36 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 DDOTGenerator.java32 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 DGrammarSanity.java33 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...]
/external/annotation-tools/annotation-file-utilities/
H A Dannotation-file-format.tex155 \section{Grammar\label{grammar}}
158 the form of a grammar. Section~\ref{grammar-conventions} details the conventions
159 of the grammar. Section~\ref{java-file-grammar} shows how to represent the
161 file. Section~\ref{annotations-grammar} shows how to add annotations to an
164 \subsection{Grammar conventions\label{grammar-conventions}}
171 (one or more) denote plurality of a grammar element.
176 We use the hash/pound/octothorpe symbol (``\#'') for comments within the grammar.
189 This is omitted from the grammar fo
[all...]
/external/antlr/antlr-3.4/tool/src/test/java/org/antlr/test/
H A DTestLeftRecursion.java10 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/python/cpython2/Lib/lib2to3/tests/
H A Dsupport.py19 grammar = pgen2_driver.load_grammar(grammar_path) variable
20 driver = pgen2_driver.Driver(grammar, convert=pytree.convert)
/external/python/cpython3/Lib/lib2to3/tests/
H A Dsupport.py17 grammar = pgen2_driver.load_grammar(grammar_path) variable
18 driver = pgen2_driver.Driver(grammar, convert=pytree.convert)

Completed in 562 milliseconds

123