Home
last modified time | relevance | path

Searched refs:grammar (Results 1 – 25 of 1165) sorted by relevance

12345678910>>...47

/external/antlr/tool/src/test/java/org/antlr/test/
DTestAutoAST.java39 String grammar = in testTokenList() local
46 String found = execParser("foo.g", grammar, "fooParser", "fooLexer", in testTokenList()
52 String grammar = in testTokenListInSingleAltBlock() local
59 String found = execParser("foo.g", grammar, "fooParser", "fooLexer", in testTokenListInSingleAltBlock()
65 String grammar = in testSimpleRootAtOuterLevel() local
72 String found = execParser("foo.g", grammar, "fooParser", "fooLexer", in testSimpleRootAtOuterLevel()
78 String grammar = in testSimpleRootAtOuterLevelReverse() local
85 String found = execParser("T.g", grammar, "TParser", "TLexer", in testSimpleRootAtOuterLevelReverse()
91 String grammar = in testBang() local
98 String found = execParser("T.g", grammar, "TParser", "TLexer", in testBang()
[all …]
DTestRewriteAST.java44 String grammar = in testDelete() local
51 String found = execParser("T.g", grammar, "TParser", "TLexer", in testDelete()
57 String grammar = in testSingleToken() local
64 String found = execParser("T.g", grammar, "TParser", "TLexer", in testSingleToken()
70 String grammar = in testSingleTokenToNewNode() local
77 String found = execParser("T.g", grammar, "TParser", "TLexer", in testSingleTokenToNewNode()
83 String grammar = in testSingleTokenToNewNodeRoot() local
90 String found = execParser("T.g", grammar, "TParser", "TLexer", in testSingleTokenToNewNodeRoot()
97 String grammar = in testSingleTokenToNewNode2() local
104 String found = execParser("TT.g", grammar, "TTParser", "TTLexer", in testSingleTokenToNewNode2()
[all …]
DTestTreeGrammarRewriteAST.java49 String grammar = in testFlatList() local
63 String found = execTreeParser("T.g", grammar, "TParser", "TP.g", in testFlatList()
69 String grammar = in testSimpleTree() local
83 String found = execTreeParser("T.g", grammar, "TParser", "TP.g", in testSimpleTree()
89 String grammar = in testNonImaginaryWithCtor() local
102 String found = execTreeParser("T.g", grammar, "TParser", "TP.g", in testNonImaginaryWithCtor()
108 String grammar = in testCombinedRewriteAndAuto() local
122 String found = execTreeParser("T.g", grammar, "TParser", "TP.g", in testCombinedRewriteAndAuto()
126 found = execTreeParser("T.g", grammar, "TParser", "TP.g", in testCombinedRewriteAndAuto()
132 String grammar = in testAvoidDup() local
[all …]
DTestSets.java45 String grammar = in testSeqDoesNotBecomeSet() local
51 String found = execParser("P.g", grammar, "PParser", "PLexer", in testSeqDoesNotBecomeSet()
57 String grammar = in testParserSet() local
60 String found = execParser("T.g", grammar, "TParser", "TLexer", in testParserSet()
66 String grammar = in testParserNotSet() local
69 String found = execParser("T.g", grammar, "TParser", "TLexer", in testParserNotSet()
75 String grammar = in testParserNotToken() local
78 String found = execParser("T.g", grammar, "TParser", "TLexer", in testParserNotToken()
84 String grammar = in testParserNotTokenWithLabel() local
87 String found = execParser("T.g", grammar, "TParser", "TLexer", in testParserNotTokenWithLabel()
[all …]
DTestHeteroAST.java41 String grammar = in testToken() local
52 String found = execParser("T.g", grammar, "TParser", "TLexer", in testToken()
58 String grammar = in testTokenCommonTree() local
64 String found = execParser("T.g", grammar, "TParser", "TLexer", in testTokenCommonTree()
70 String grammar = in testTokenWithQualifiedType() local
81 String found = execParser("T.g", grammar, "TParser", "TLexer", in testTokenWithQualifiedType()
87 String grammar = in testNamedType() local
98 String found = execParser("T.g", grammar, "TParser", "TLexer", in testNamedType()
105 String grammar = in testTokenWithLabel() local
116 String found = execParser("T.g", grammar, "TParser", "TLexer", in testTokenWithLabel()
[all …]
DTestSyntacticPredicateEvaluation.java36 String grammar = in testTwoPredsWithNakedAlt() local
55 String found = execParser("T.g", grammar, "TParser", "TLexer", in testTwoPredsWithNakedAlt()
64 found = execParser("T.g", grammar, "TParser", "TLexer", in testTwoPredsWithNakedAlt()
72 found = execParser("T.g", grammar, "TParser", "TLexer", in testTwoPredsWithNakedAlt()
85 String grammar = in testTwoPredsWithNakedAltNotLast() local
104 String found = execParser("T.g", grammar, "TParser", "TLexer", in testTwoPredsWithNakedAltNotLast()
113 found = execParser("T.g", grammar, "TParser", "TLexer", in testTwoPredsWithNakedAltNotLast()
121 found = execParser("T.g", grammar, "TParser", "TLexer", in testTwoPredsWithNakedAltNotLast()
133 String grammar = in testLexerPred() local
142 String found = execParser("T.g", grammar, "TParser", "TLexer", in testLexerPred()
[all …]
DTestSemanticPredicateEvaluation.java36 String grammar = in testSimpleCyclicDFAWithPredicate() local
41 String found = execParser("foo.g", grammar, "fooParser", "fooLexer", in testSimpleCyclicDFAWithPredicate()
47 String grammar = in testSimpleCyclicDFAWithInstanceVarPredicate() local
53 String found = execParser("foo.g", grammar, "fooParser", "fooLexer", in testSimpleCyclicDFAWithInstanceVarPredicate()
59 String grammar = in testPredicateValidation() local
69 String found = execParser("foo.g", grammar, "fooParser", "fooLexer", in testPredicateValidation()
75 String grammar = in testLexerPreds() local
81 String found = execParser("foo.g", grammar, "fooParser", "fooLexer", in testLexerPreds()
88 String grammar = in testLexerPreds2() local
94 String found = execParser("foo.g", grammar, "fooParser", "fooLexer", in testLexerPreds2()
[all …]
DTestTreeParsing.java36 String grammar = in testFlatList() local
50 String found = execTreeParser("T.g", grammar, "TParser", "TP.g", in testFlatList()
56 String grammar = in testSimpleTree() local
70 String found = execTreeParser("T.g", grammar, "TParser", "TP.g", in testSimpleTree()
76 String grammar = in testFlatVsTreeDecision() local
93 String found = execTreeParser("T.g", grammar, "TParser", "TP.g", in testFlatVsTreeDecision()
99 String grammar = in testFlatVsTreeDecision2() local
116 String found = execTreeParser("T.g", grammar, "TParser", "TP.g", in testFlatVsTreeDecision2()
123 String grammar = in testCyclicDFALookahead() local
139 String found = execTreeParser("T.g", grammar, "TParser", "TP.g", in testCyclicDFALookahead()
[all …]
DTestLeftRecursion.java14 String grammar = in testSimple() local
22 String found = execParser("T.g", grammar, "TParser", "TLexer", in testSimple()
29 String grammar = in testSemPred() local
37 String found = execParser("T.g", grammar, "TParser", "TLexer", in testSemPred()
44 String grammar = in testTernaryExpr() local
66 runTests(grammar, tests, "e"); in testTernaryExpr()
70 String grammar = in testDeclarationsUsingASTOperators() local
97 runTests(grammar, tests, "declarator"); in testDeclarationsUsingASTOperators()
101 String grammar = in testDeclarationsUsingRewriteOperators() local
128 runTests(grammar, tests, "declarator"); in testDeclarationsUsingRewriteOperators()
[all …]
DTestLexer.java48 String grammar = in testSetText() local
53 String found = execParser("P.g", grammar, "PParser", "PLexer", in testSetText()
61 String grammar = in testRefToRuleDoesNotSetTokenNorEmitAnother() local
67 String found = execParser("P.g", grammar, "PParser", "PLexer", in testRefToRuleDoesNotSetTokenNorEmitAnother()
75 String grammar = in testRefToRuleDoesNotSetChannel() local
81 String found = execParser("P.g", grammar, "PParser", "PLexer", in testRefToRuleDoesNotSetChannel()
87 String grammar = in testWeCanSetType() local
94 String found = execParser("P.g", grammar, "PParser", "PLexer", in testWeCanSetType()
102 String grammar = in testRefToFragment() local
108 String found = execParser("P.g", grammar, "PParser", "PLexer", in testRefToFragment()
[all …]
DTestJavaCodeGeneration.java43 String grammar = in testDupVarDefForPinchedState() local
50 "T.g", grammar, "TParser", null, false); in testDupVarDefForPinchedState()
57 String grammar = in testLabeledNotSetsInLexer() local
63 "T.g", grammar, null, "T", false); in testLabeledNotSetsInLexer()
70 String grammar = in testLabeledSetsInLexer() local
75 String found = execParser("T.g", grammar, "TParser", "TLexer", in testLabeledSetsInLexer()
82 String grammar = in testLabeledRangeInLexer() local
87 String found = execParser("T.g", grammar, "TParser", "TLexer", in testLabeledRangeInLexer()
94 String grammar = in testLabeledWildcardInLexer() local
99 String found = execParser("T.g", grammar, "TParser", "TLexer", in testLabeledWildcardInLexer()
[all …]
/external/antlr/runtime/Python/tests/
Dt058rewriteAST.py64 def execParser(self, grammar, grammarEntry, input, expectErrors=False): argument
65 lexerCls, parserCls = self.compileInlineGrammar(grammar)
92 def execTreeParser(self, grammar, grammarEntry, treeGrammar, treeEntry, input): argument
93 lexerCls, parserCls = self.compileInlineGrammar(grammar)
113 grammar = textwrap.dedent(
123 found = self.execParser(grammar, "a", "abc 34")
128 grammar = textwrap.dedent(
138 found = self.execParser(grammar, "a", "abc")
143 grammar = textwrap.dedent(
153 found = self.execParser(grammar, "a", "abc")
[all …]
Dt057autoAST.py64 def execParser(self, grammar, grammarEntry, input, expectErrors=False): argument
65 lexerCls, parserCls = self.compileInlineGrammar(grammar)
92 def execTreeParser(self, grammar, grammarEntry, treeGrammar, treeEntry, input): argument
93 lexerCls, parserCls = self.compileInlineGrammar(grammar)
113 grammar = textwrap.dedent(
123 found = self.execParser(grammar, "a", "abc 34")
128 grammar = textwrap.dedent(
138 found = self.execParser(grammar,"a", "abc 34")
143 grammar = textwrap.dedent(
153 found = self.execParser(grammar, "a", "abc 34")
[all …]
Dt051treeRewriteAST.py29 def execTreeParser(self, grammar, grammarEntry, treeGrammar, treeEntry, input): argument
30 lexerCls, parserCls = self.compileInlineGrammar(grammar)
50 grammar = textwrap.dedent(
77 grammar, 'a',
86 grammar = textwrap.dedent(
112 grammar, 'a',
121 grammar = textwrap.dedent(
147 grammar, 'a',
156 grammar, 'a',
165 grammar = textwrap.dedent(
[all …]
Dt053hetero.py63 def execParser(self, grammar, grammarEntry, input): argument
64 lexerCls, parserCls = self.compileInlineGrammar(grammar)
78 def execTreeParser(self, grammar, grammarEntry, treeGrammar, treeEntry, input): argument
79 lexerCls, parserCls = self.compileInlineGrammar(grammar)
101 grammar = textwrap.dedent(
121 grammar, 'a',
129 grammar = textwrap.dedent(
142 grammar, 'a',
149 grammar = textwrap.dedent(
168 grammar, 'a',
[all …]
Dt049treeparser.py35 def execTreeParser(self, grammar, grammarEntry, treeGrammar, treeEntry, input): argument
36 lexerCls, parserCls = self.compileInlineGrammar(grammar)
53 grammar = textwrap.dedent(
77 grammar, 'a',
87 grammar = textwrap.dedent(
111 grammar, 'a',
120 grammar = textwrap.dedent(
147 grammar, 'a',
155 grammar = textwrap.dedent(
182 grammar, 'a',
[all …]
/external/antlr/runtime/Python3/tests/
Dt058rewriteAST.py64 def execParser(self, grammar, grammarEntry, input, expectErrors=False): argument
65 lexerCls, parserCls = self.compileInlineGrammar(grammar)
92 def execTreeParser(self, grammar, grammarEntry, treeGrammar, treeEntry, input): argument
93 lexerCls, parserCls = self.compileInlineGrammar(grammar)
113 grammar = textwrap.dedent(
123 found = self.execParser(grammar, "a", "abc 34")
128 grammar = textwrap.dedent(
138 found = self.execParser(grammar, "a", "abc")
143 grammar = textwrap.dedent(
153 found = self.execParser(grammar, "a", "abc")
[all …]
Dt057autoAST.py64 def execParser(self, grammar, grammarEntry, input, expectErrors=False): argument
65 lexerCls, parserCls = self.compileInlineGrammar(grammar)
92 def execTreeParser(self, grammar, grammarEntry, treeGrammar, treeEntry, input): argument
93 lexerCls, parserCls = self.compileInlineGrammar(grammar)
113 grammar = textwrap.dedent(
123 found = self.execParser(grammar, "a", "abc 34")
128 grammar = textwrap.dedent(
138 found = self.execParser(grammar,"a", "abc 34")
143 grammar = textwrap.dedent(
153 found = self.execParser(grammar, "a", "abc 34")
[all …]
Dt051treeRewriteAST.py29 def execTreeParser(self, grammar, grammarEntry, treeGrammar, treeEntry, input): argument
30 lexerCls, parserCls = self.compileInlineGrammar(grammar)
50 grammar = textwrap.dedent(
77 grammar, 'a',
86 grammar = textwrap.dedent(
112 grammar, 'a',
121 grammar = textwrap.dedent(
147 grammar, 'a',
156 grammar, 'a',
165 grammar = textwrap.dedent(
[all …]
Dt053hetero.py63 def execParser(self, grammar, grammarEntry, input): argument
64 lexerCls, parserCls = self.compileInlineGrammar(grammar)
78 def execTreeParser(self, grammar, grammarEntry, treeGrammar, treeEntry, input): argument
79 lexerCls, parserCls = self.compileInlineGrammar(grammar)
101 grammar = textwrap.dedent(
121 grammar, 'a',
129 grammar = textwrap.dedent(
142 grammar, 'a',
149 grammar = textwrap.dedent(
168 grammar, 'a',
[all …]
/external/python/cpython3/Lib/test/test_peg_generator/
Dtest_first_sets.py11 from pegen.grammar import Grammar
16 grammar: Grammar = parse_string(grammar_source, GrammarParser)
17 return FirstSetCalculator(grammar.rules).calculate()
20 grammar = """
26 self.assertEqual(self.calculate_first_sets(grammar), {
34 grammar = """
38 self.assertEqual(self.calculate_first_sets(grammar), {
44 grammar = """
48 … self.assertEqual(self.calculate_first_sets(grammar), {"thing": {"NUMBER"}, "start": {"NUMBER"}})
51 grammar = """
[all …]
Dtest_pegen.py17 from pegen.grammar import GrammarVisitor, GrammarError, Grammar
35 grammar: Grammar = parse_string(grammar_source, GrammarParser)
36 rules = grammar.rules
37 self.assertEqual(str(grammar), textwrap.dedent(expected).strip())
59 grammar: Grammar = parse_string(grammar_source, GrammarParser)
60 self.assertEqual(str(grammar.rules["start"]), textwrap.dedent(expected).strip())
63 grammar = """
68 rules = parse_string(grammar, GrammarParser).rules
78 grammar = """
82 rules = parse_string(grammar, GrammarParser).rules
[all …]
/external/libtextclassifier/native/annotator/grammar/
Dgrammar-annotator_test.cc48 grammar_model.rules.reset(new grammar::RulesSetT); in TEST_F()
49 grammar::LocaleShardMap locale_shard_map = in TEST_F()
50 grammar::LocaleShardMap::CreateLocaleShardMap({""}); in TEST_F()
51 grammar::Rules rules(locale_shard_map); in TEST_F()
60 static_cast<grammar::CallbackId>(grammar::DefaultCallback::kRootRule), in TEST_F()
84 grammar_model.rules.reset(new grammar::RulesSetT); in TEST_F()
85 grammar::LocaleShardMap locale_shard_map = in TEST_F()
86 grammar::LocaleShardMap::CreateLocaleShardMap({""}); in TEST_F()
87 grammar::Rules rules(locale_shard_map); in TEST_F()
98 static_cast<grammar::CallbackId>(grammar::DefaultCallback::kRootRule), in TEST_F()
[all …]
/external/antlr/runtime/Ruby/test/functional/debugging/
Ddebug-mode.rb66 def parse( grammar, rule, input, options = {} ) argument
67 @grammar = inline_grammar( grammar )
91 grammar = %q<
99 parse( grammar, :a, 'a', :listener => listener )
114 grammar = %q<
121 debugger = parse( grammar, :a, 'a' )
144 grammar = %q<
151 debugger = parse( grammar, :a, "a b" )
181 grammar = %q<
189 debugger = parse( grammar, :a, "a" )
[all …]
/external/antlr/tool/src/main/java/org/antlr/tool/
DNameSpaceChecker.java38 protected Grammar grammar; field in NameSpaceChecker
40 public NameSpaceChecker(Grammar grammar) { in NameSpaceChecker() argument
41 this.grammar = grammar; in NameSpaceChecker()
45 …for (int i = CompositeGrammar.MIN_RULE_INDEX; i < grammar.composite.ruleIndexToRuleList.size(); i+… in checkConflicts()
46 Rule r = grammar.composite.ruleIndexToRuleList.elementAt(i); in checkConflicts()
68 for (AttributeScope scope : grammar.getGlobalScopes().values()) { in checkConflicts()
82 grammar, in checkForRuleArgumentAndReturnValueConflicts()
95 if ( (grammar.type==Grammar.PARSER||grammar.type==Grammar.TREE_PARSER) && in checkForRuleDefinitionProblems()
100 else if ( grammar.type==Grammar.LEXER && in checkForRuleDefinitionProblems()
106 else if ( grammar.getGlobalScope(ruleName)!=null ) { in checkForRuleDefinitionProblems()
[all …]

12345678910>>...47