Home
last modified time | relevance | path

Searched refs:GrammarAST (Results 1 – 25 of 39) sorted by relevance

12

/external/antlr/tool/src/main/java/org/antlr/tool/
DGrammarAST.java56 public class GrammarAST extends CommonTree { class
92 public Set<GrammarAST> rewriteRefsShallow;
105 public Set<GrammarAST> rewriteRefsDeep;
140 public GrammarAST() {} in GrammarAST() method in GrammarAST
143 public GrammarAST(int t, String txt) { in GrammarAST() method in GrammarAST
148 public GrammarAST(Token token) { in GrammarAST() method in GrammarAST
158 GrammarAST t = ((GrammarAST)ast); in initialize()
326 public GrammarAST getLastChild() { in getLastChild()
329 return (GrammarAST)getChild(getChildCount() - 1); in getLastChild()
332 public GrammarAST getNextSibling() { in getNextSibling()
[all …]
DLeftRecursiveRuleAnalyzer.java26 public GrammarAST retvals;
55 public void setReturnValues(GrammarAST t) { in setReturnValues()
61 public void setTokenPrec(GrammarAST t, int alt) { in setTokenPrec()
86 public void binaryAlt(GrammarAST altTree, GrammarAST rewriteTree, int alt) { in binaryAlt()
87 altTree = GrammarAST.dupTree(altTree); in binaryAlt()
88 rewriteTree = GrammarAST.dupTree(rewriteTree); in binaryAlt()
113 public void ternaryAlt(GrammarAST altTree, GrammarAST rewriteTree, int alt) { in ternaryAlt()
114 altTree = GrammarAST.dupTree(altTree); in ternaryAlt()
115 rewriteTree = GrammarAST.dupTree(rewriteTree); in ternaryAlt()
138 public void prefixAlt(GrammarAST altTree, GrammarAST rewriteTree, int alt) { in prefixAlt()
[all …]
DRule.java63 public GrammarAST tree;
69 public GrammarAST argActionAST;
71 public GrammarAST EORNode;
129 protected List<GrammarAST> inlineActions = new ArrayList<GrammarAST>();
144 protected Map<String, List<GrammarAST>>[] altToTokenRefMap;
154 protected Map<String, List<GrammarAST>>[] altToRuleRefMap;
176 altToTokenRefMap = (Map<String, List<GrammarAST>>[])new Map<?, ?>[numberOfAlts+1]; in Rule()
177 altToRuleRefMap = (Map<String, List<GrammarAST>>[])new Map<?, ?>[numberOfAlts+1]; in Rule()
179 altToTokenRefMap[alt] = new HashMap<String, List<GrammarAST>>(); in Rule()
180 altToRuleRefMap[alt] = new HashMap<String, List<GrammarAST>>(); in Rule()
[all …]
DGrammar.java201 public GrammarAST blockAST;
207 public GrammarAST elementRef;
214 public LabelElementPair(Token label, GrammarAST elementRef) { in LabelElementPair()
372 protected Set<GrammarAST> ruleRefs = new HashSet<GrammarAST>();
374 protected Set<GrammarAST> scopedRuleRefs = new HashSet<GrammarAST>();
403 protected LinkedHashMap<String, GrammarAST> nameToSynpredASTMap;
457 protected GrammarAST grammarTree = null;
520 public Set<GrammarAST> blocksWithSynPreds = new HashSet<GrammarAST>();
538 public Set<GrammarAST> blocksWithSemPreds = new HashSet<GrammarAST>();
755 public void translateLeftRecursiveRule(GrammarAST ruleAST) { in translateLeftRecursiveRule()
[all …]
DAssignTokenTypesBehavior.java67 protected void trackString(GrammarAST t) { in trackString()
103 protected void trackToken(GrammarAST t) { in trackToken()
115 protected void trackTokenRule(GrammarAST t, in trackTokenRule()
116 GrammarAST modifier, in trackTokenRule()
117 GrammarAST block) in trackTokenRule()
153 alias(t, (GrammarAST)block.getChild(0).getChild(0)); in trackTokenRule()
161 protected void alias(GrammarAST t, GrammarAST s) { in alias()
DGrammarSanity.java188 public void checkRuleReference(GrammarAST scopeAST, in checkRuleReference()
189 GrammarAST refAST, in checkRuleReference()
190 GrammarAST argsAST, in checkRuleReference()
265 public void ensureAltIsSimpleNodeOrTree(GrammarAST altAST, in ensureAltIsSimpleNodeOrTree()
266 GrammarAST elementAST, in ensureAltIsSimpleNodeOrTree()
270 GrammarAST next = elementAST.getNextSibling(); in ensureAltIsSimpleNodeOrTree()
315 protected boolean isNextNonActionElementEOA(GrammarAST t) { in isNextNonActionElementEOA()
DAttributeScope.java87 public LinkedHashMap<String, GrammarAST> actions = new LinkedHashMap<String, GrammarAST>();
145 public final void defineNamedAction(GrammarAST nameAST, GrammarAST actionAST) in defineNamedAction()
148 GrammarAST a = actions.get(actionName); in defineNamedAction()
DGrammarSerializerFoo.java120 public void alt(GrammarAST alt) { in alt()
146 public void ruleRef(GrammarAST t) { in ruleRef()
157 public void token(GrammarAST t) { in token()
169 public void charLiteral(GrammarAST t) { in charLiteral()
184 public void wildcard(GrammarAST t) { in wildcard()
DNFAFactory.java118 public StateCluster build_Atom(int label, GrammarAST associatedAST) { in build_Atom()
128 public StateCluster build_Atom(GrammarAST atomAST) { in build_Atom()
136 public StateCluster build_Set(IntSet set, GrammarAST associatedAST) { in build_Set()
175 public StateCluster build_CharLiteralAtom(GrammarAST charLiteralAST) { in build_CharLiteralAtom()
197 public StateCluster build_StringLiteralAtom(GrammarAST stringLiteralAST) { in build_StringLiteralAtom()
258 public StateCluster build_SemanticPredicate(GrammarAST pred) { in build_SemanticPredicate()
278 public StateCluster build_Action(GrammarAST action) { in build_Action()
669 public StateCluster build_Wildcard(GrammarAST associatedAST) { in build_Wildcard()
684 public StateCluster build_WildcardTree(GrammarAST associatedAST) { in build_WildcardTree()
DNameSpaceChecker.java123 for (GrammarAST refAST : grammar.ruleRefs) { in lookForReferencesToUndefinedSymbols()
155 for (GrammarAST scopeAST : grammar.scopedRuleRefs) { // ^(DOT ID atom) in lookForReferencesToUndefinedSymbols()
157 GrammarAST refAST = (GrammarAST)scopeAST.getChild(1); in lookForReferencesToUndefinedSymbols()
DGrammarReport.java303 GrammarAST decisionAST = in getDFALocations()
474 public static boolean blockHasSynPred(GrammarAST blockAST) { in blockHasSynPred()
475 GrammarAST c1 = blockAST.findFirstType(ANTLRParser.SYN_SEMPRED); in blockHasSynPred()
476 GrammarAST c2 = blockAST.findFirstType(ANTLRParser.BACKTRACK_SEMPRED); in blockHasSynPred()
DGrammarAnalysisAbortedMessage.java46 GrammarAST decisionASTNode = probe.dfa.getDecisionASTNode(); in toString()
DNonRegularDecisionMessage.java51 GrammarAST decisionASTNode = probe.dfa.getDecisionASTNode(); in toString()
/external/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/
DLeftRecursiveRuleWalker.g39 ASTLabelType=GrammarAST;
80 public void setTokenPrec(GrammarAST t, int alt) {}
81 public void binaryAlt(GrammarAST altTree, GrammarAST rewriteTree, int alt) {}
82 public void ternaryAlt(GrammarAST altTree, GrammarAST rewriteTree, int alt) {}
83 public void prefixAlt(GrammarAST altTree, GrammarAST rewriteTree, int alt) {}
84 public void suffixAlt(GrammarAST altTree, GrammarAST rewriteTree, int alt) {}
85 public void otherAlt(GrammarAST altTree, GrammarAST rewriteTree, int alt) {}
86 public void setReturnValues(GrammarAST t) {}
167 GrammarAST rew = $start.getNextSibling();
197 prefix : ^( ALT (^(BACKTRACK_SEMPRED .*))? {setTokenPrec((GrammarAST)input.LT(1), outerAlt);} ({!((…
[all …]
DAssignTokenTypesWalker.g88 ASTLabelType = GrammarAST;
106 protected static GrammarAST stringAlias;
107 protected static GrammarAST charAlias;
108 protected static GrammarAST stringAlias2;
109 protected static GrammarAST charAlias2;
136 stringAlias = (GrammarAST)adaptor.create( BLOCK, "BLOCK" );
138 GrammarAST alt = (GrammarAST)adaptor.create( ALT, "ALT" );
148 charAlias = (GrammarAST)adaptor.create( BLOCK, "BLOCK" );
150 GrammarAST alt = (GrammarAST)adaptor.create( ALT, "ALT" );
160 stringAlias2 = (GrammarAST)adaptor.create( BLOCK, "BLOCK" );
[all …]
DDefineGrammarItemsWalker.g37 ASTLabelType = GrammarAST;
41 HashMap<GrammarAST, GrammarAST> actions;
53 protected GrammarAST root;
55 protected GrammarAST currentRewriteBlock;
56 protected GrammarAST currentRewriteRule;
80 GrammarAST p = root;
100 protected final void trackInlineAction( GrammarAST actionAST ) {
129 $AttributeScopeActions::actions = new HashMap<GrammarAST, GrammarAST>();
136 for (GrammarAST action : $AttributeScopeActions::actions.keySet())
167 GrammarAST nameAST=null, actionAST=null;
[all …]
DANTLR.g56 ASTLabelType=GrammarAST;
122 import org.antlr.tool.GrammarAST;
160 protected GrammarAST currentBlockAST = null;
169 private static class GrammarASTErrorNode extends GrammarAST {
254 GrammarAST t = new GrammarAST( payload );
262 GrammarAST t = new GrammarASTErrorNode(input, start, stop, e);
306 protected GrammarAST setToBlockWithSet(GrammarAST b) {
312 GrammarAST alt = (GrammarAST)adaptor.create(ALT, "ALT");
318 GrammarAST block = (GrammarAST)adaptor.create(BLOCK, b.getToken(), "BLOCK");
328 protected GrammarAST createBlockFromDupAlt(GrammarAST alt) {
[all …]
DCodeGenTreeWalker.g45 ASTLabelType=GrammarAST;
129 protected final ST getWildcardST(GrammarAST elementAST, GrammarAST ast_suffix, String label) {
139 GrammarAST elementAST,
140 GrammarAST ast_suffix,
168 GrammarAST elementAST,
169 GrammarAST ast_suffix,
230 protected final String getSTSuffix(GrammarAST elementAST, GrammarAST ast_suffix, String label) {
267 protected final List<String> getTokenTypesAsTargetLabels(Collection<GrammarAST> refs)
273 for ( GrammarAST t : refs )
369 String ruleName = ((GrammarAST)input.LT(1)).getChild(0).getText();
[all …]
DANTLRTreePrinter.g45 ASTLabelType = GrammarAST;
59 private ANTLRTreePrinter.block_return block(GrammarAST t, boolean forceParens) throws RecognitionEx…
65 public final int countAltsForBlock(GrammarAST t) {
307 // if ( parent.getType() == BLOCK && countAltsForBlock((GrammarAST)parent) > 1 )
406 GrammarAST predAST=grammar.getSyntacticPredicate(name);
DTreeToNFAConverter.g39 ASTLabelType = GrammarAST;
77 public final IntSet setRule(GrammarAST t) throws RecognitionException {
87 public final int testBlockAsSet( GrammarAST t ) throws RecognitionException {
106 public final int testSetRule( GrammarAST t ) throws RecognitionException {
177 private boolean hasElementOptions(GrammarAST node) {
380 GrammarAST blk = $start;
382 blk = (GrammarAST)blk.getChild(0);
384 GrammarAST eob = blk.getLastChild();
547 GrammarAST stNode = (GrammarAST)$n.getChild(0);
/external/antlr/tool/src/main/java/org/antlr/analysis/
DActionLabel.java31 import org.antlr.tool.GrammarAST;
34 public GrammarAST actionAST;
36 public ActionLabel(GrammarAST actionAST) { in ActionLabel()
DDecisionProbe.java36 import org.antlr.tool.GrammarAST;
443 GrammarAST blockAST = in issueWarnings()
470 GrammarAST decAST = dfa.getDecisionASTNode(); in issueWarnings()
471 GrammarAST altAST = (GrammarAST)decAST.getChild(altI-1); in issueWarnings()
472 GrammarAST delegatedTokensAlt = in issueWarnings()
473 (GrammarAST)altAST.getFirstChildWithType(ANTLRParser.DOT); in issueWarnings()
502 GrammarAST blockAST = in stripWildCardAlts()
505 GrammarAST lastAltAST; in stripWildCardAlts()
508 lastAltAST = (GrammarAST)blockAST.getChild(lastAlt.intValue()); in stripWildCardAlts()
511 lastAltAST = (GrammarAST)blockAST.getChild(lastAlt -1); in stripWildCardAlts()
DNFAState.java31 import org.antlr.tool.GrammarAST;
98 public GrammarAST associatedASTNode;
224 public void setDecisionASTNode(GrammarAST decisionASTNode) { in setDecisionASTNode()
DPredicateLabel.java31 import org.antlr.tool.GrammarAST;
42 public PredicateLabel(GrammarAST predicateASTNode) { in PredicateLabel()
/external/antlr/tool/src/main/java/org/antlr/codegen/
DCodeGenerator.java494 GrammarAST actionAST = in verifyActionScopesOkForTarget()
495 (GrammarAST)scopeActions.values().iterator().next(); in verifyActionScopesOkForTarget()
525 GrammarAST actionAST = (GrammarAST)entry.getValue(); in translateActionAttributeReferencesForSingleScope()
549 public void generateLocalFOLLOW(GrammarAST referencedElementNode, in generateLocalFOLLOW()
921 GrammarAST actionTree) in translateAction()
938 GrammarAST actionTree) in translateArgAction()
1090 GrammarAST rewriteTree = parseResult.getTree(); in translateTemplateConstructor()

12