congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
GrammarAST.getType
Code IndexAdd Tabnine to your IDE (free)

How to use
getType
method
in
org.antlr.v4.tool.ast.GrammarAST

Best Java code snippets using org.antlr.v4.tool.ast.GrammarAST.getType (Showing top 20 results out of 315)

origin: org.antlr/antlr4

public CommonTree getFirstDescendantWithType(int type) {
  if ( getType()==type ) return this;
  if ( children==null ) return null;
  for (Object c : children) {
    GrammarAST t = (GrammarAST)c;
    if ( t.getType()==type ) return t;
    CommonTree d = t.getFirstDescendantWithType(type);
    if ( d!=null ) return d;
  }
  return null;
}
origin: com.impetus.fabric/fabric-jdbc-driver-shaded

public CommonTree getFirstDescendantWithType(int type) {
  if ( getType()==type ) return this;
  if ( children==null ) return null;
  for (Object c : children) {
    GrammarAST t = (GrammarAST)c;
    if ( t.getType()==type ) return t;
    CommonTree d = t.getFirstDescendantWithType(type);
    if ( d!=null ) return d;
  }
  return null;
}
origin: uk.co.nichesolutions/antlr4

public CommonTree getFirstDescendantWithType(int type) {
  if ( getType()==type ) return this;
  if ( children==null ) return null;
  for (Object c : children) {
    GrammarAST t = (GrammarAST)c;
    if ( t.getType()==type ) return t;
    CommonTree d = t.getFirstDescendantWithType(type);
    if ( d!=null ) return d;
  }
  return null;
}
origin: org.antlr/antlr4

@Override
protected void exitSubrule(GrammarAST tree) {
  if (tree.getType() == CLOSURE || tree.getType() == POSITIVE_CLOSURE) {
    for (Map.Entry<String, MutableInt> entry : frequencies.peek().entrySet()) {
      entry.getValue().v = 2;
    }
  }
  if (tree.getType() == CLOSURE || tree.getType() == OPTIONAL) {
    // Everything inside a closure is optional, so the minimum
    // number of occurrences for all elements is 0.
    minFrequencies.peek().clear();
  }
}
origin: uk.co.nichesolutions/antlr4

@Override
protected void exitSubrule(GrammarAST tree) {
  if (tree.getType() == CLOSURE || tree.getType() == POSITIVE_CLOSURE) {
    for (Map.Entry<String, MutableInt> entry : frequencies.peek().entrySet()) {
      entry.getValue().v = 2;
    }
  }
}
origin: com.impetus.fabric/fabric-jdbc-driver-shaded

  @Override
  protected void exitLexerSubrule(GrammarAST tree) {
    if (tree.getType() == CLOSURE || tree.getType() == POSITIVE_CLOSURE) {
      for (Map.Entry<String, MutableInt> entry : frequencies.peek().entrySet()) {
        entry.getValue().v = 2;
      }
    }
  }
}
origin: com.impetus.fabric/fabric-jdbc-driver-shaded

@Override
protected void exitSubrule(GrammarAST tree) {
  if (tree.getType() == CLOSURE || tree.getType() == POSITIVE_CLOSURE) {
    for (Map.Entry<String, MutableInt> entry : frequencies.peek().entrySet()) {
      entry.getValue().v = 2;
    }
  }
}
origin: com.tunnelvisionlabs/antlr4

@Override
public Object pre(Object t) {
  if ( ((GrammarAST)t).getType() == 3 ) {
    return expandParameterizedLoop((GrammarAST)t);
  }
  return t;
}
@Override
origin: uk.co.nichesolutions/antlr4

@Override
public Object pre(Object t) {
  if ( ((GrammarAST)t).getType() == 3 ) {
    return expandParameterizedLoop((GrammarAST)t);
  }
  return t;
}
@Override
origin: org.antlr/antlr4

@Override
public Object pre(Object t) {
  if ( ((GrammarAST)t).getType() == 3 ) {
    return expandParameterizedLoop((GrammarAST)t);
  }
  return t;
}
@Override
origin: io.virtdata/virtdata-lib-realer

public CommonTree getFirstDescendantWithType(org.antlr.runtime.BitSet types) {
  if ( types.member(getType()) ) return this;
  if ( children==null ) return null;
  for (Object c : children) {
    GrammarAST t = (GrammarAST)c;
    if ( types.member(t.getType()) ) return t;
    CommonTree d = t.getFirstDescendantWithType(types);
    if ( d!=null ) return d;
  }
  return null;
}
origin: uk.co.nichesolutions/antlr4

public CommonTree getFirstDescendantWithType(org.antlr.runtime.BitSet types) {
  if ( types.member(getType()) ) return this;
  if ( children==null ) return null;
  for (Object c : children) {
    GrammarAST t = (GrammarAST)c;
    if ( types.member(t.getType()) ) return t;
    CommonTree d = t.getFirstDescendantWithType(types);
    if ( d!=null ) return d;
  }
  return null;
}
origin: org.antlr/antlr4

public CommonTree getFirstDescendantWithType(org.antlr.runtime.BitSet types) {
  if ( types.member(getType()) ) return this;
  if ( children==null ) return null;
  for (Object c : children) {
    GrammarAST t = (GrammarAST)c;
    if ( types.member(t.getType()) ) return t;
    CommonTree d = t.getFirstDescendantWithType(types);
    if ( d!=null ) return d;
  }
  return null;
}
origin: org.antlr/antlr4

private String getName(GrammarAST token) {
  String tokenText = token.getText();
  String tokenName = token.getType() != STRING_LITERAL ? tokenText : token.g.getTokenName(tokenText);
  return tokenName == null || tokenName.startsWith("T__") ? null : tokenName; // Do not include tokens with auto generated names
}
origin: org.antlr/antlr4

@Override
public void label(GrammarAST op, GrammarAST ID, GrammarAST element) {
  LabelElementPair lp = new LabelElementPair(g, ID, element, op.getType());
  currentRule.alt[currentOuterAltNumber].labelDefs.map(ID.getText(), lp);
}
origin: com.impetus.fabric/fabric-jdbc-driver-shaded

public void getNodesWithTypePreorderDFS_(List<GrammarAST> nodes, IntervalSet types) {
  if ( types.contains(this.getType()) ) nodes.add(this);
  // walk all children of root.
  for (int i= 0; i < getChildCount(); i++) {
    GrammarAST child = (GrammarAST)getChild(i);
    child.getNodesWithTypePreorderDFS_(nodes, types);
  }
}
origin: uk.co.nichesolutions/antlr4

public void getNodesWithTypePreorderDFS_(List<GrammarAST> nodes, IntervalSet types) {
  if ( types.contains(this.getType()) ) nodes.add(this);
  // walk all children of root.
  for (int i= 0; i < getChildCount(); i++) {
    GrammarAST child = (GrammarAST)getChild(i);
    child.getNodesWithTypePreorderDFS_(nodes, types);
  }
}
origin: io.virtdata/virtdata-lib-realer

public void getNodesWithTypePreorderDFS_(List<GrammarAST> nodes, IntervalSet types) {
  if ( types.contains(this.getType()) ) nodes.add(this);
  // walk all children of root.
  for (int i= 0; i < getChildCount(); i++) {
    GrammarAST child = (GrammarAST)getChild(i);
    child.getNodesWithTypePreorderDFS_(nodes, types);
  }
}
origin: io.virtdata/virtdata-lib-realer

@Override
public void label(GrammarAST op, GrammarAST ID, GrammarAST element) {
  LabelElementPair lp = new LabelElementPair(g, ID, element, op.getType());
  currentRule.alt[currentOuterAltNumber].labelDefs.map(ID.getText(), lp);
}
origin: org.antlr/antlr4

public void getNodesWithTypePreorderDFS_(List<GrammarAST> nodes, IntervalSet types) {
  if ( types.contains(this.getType()) ) nodes.add(this);
  // walk all children of root.
  for (int i= 0; i < getChildCount(); i++) {
    GrammarAST child = (GrammarAST)getChild(i);
    child.getNodesWithTypePreorderDFS_(nodes, types);
  }
}
org.antlr.v4.tool.astGrammarASTgetType

Popular methods of GrammarAST

  • getText
  • getToken
  • getAllChildrenWithType
  • getChild
  • getChildCount
  • getParent
  • <init>
  • addChild
  • addChildren
  • deleteChild
  • dupNode
  • freshenParentAndChildIndexes
  • dupNode,
  • freshenParentAndChildIndexes,
  • getAltLabel,
  • getAncestor,
  • getAncestors,
  • getCharPositionInLine,
  • getChildIndex,
  • getChildren,
  • getChildrenAsArray,
  • getFirstChildWithType

Popular in Java

  • Making http post requests using okhttp
  • getResourceAsStream (ClassLoader)
  • getSystemService (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now