org.antlr.runtime.tree.Tree.isNil()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(101)

本文整理了Java中org.antlr.runtime.tree.Tree.isNil()方法的一些代码示例,展示了Tree.isNil()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tree.isNil()方法的具体详情如下:
包路径:org.antlr.runtime.tree.Tree
类名称:Tree
方法名:isNil

Tree.isNil介绍

[英]Indicates the node is a nil node but may still have children, meaning the tree is a flat list.
[中]指示该节点为nil节点,但可能仍有子节点,这意味着该树是一个平面列表。

代码示例

代码示例来源:origin: apache/hive

Tree otherP = otherStack.pop();
if (p.isNil() != otherP.isNil()) {
 return false;
if (!p.isNil()) {
 if (!p.toString().equals(otherP.toString())) {
  return false;

代码示例来源:origin: apache/drill

Tree otherP = otherStack.pop();
if (p.isNil() != otherP.isNil()) {
 return false;
if (!p.isNil()) {
 if (!p.toString().equals(otherP.toString())) {
  return false;

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

@Override
public boolean isNil(Object tree) {
  return ((Tree)tree).isNil();
}

代码示例来源:origin: io.virtdata/virtdata-lib-realer

@Override
public boolean isNil(Object tree) {
  return ((Tree)tree).isNil();
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

public boolean isNil(Object tree) {
  return ((Tree)tree).isNil();
}

代码示例来源:origin: antlr/antlr3

@Override
public boolean isNil(Object tree) {
  return ((Tree)tree).isNil();
}

代码示例来源:origin: antlr/antlr3

@Override
public boolean isNil(Object tree) {
  return ((Tree)tree).isNil();
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.antlr-runtime

@Override
public boolean isNil(Object tree) {
  return ((Tree)tree).isNil();
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

public void setChild(int i, Tree t) {
  if ( t==null ) {
    return;
  }
  if ( t.isNil() ) {
    throw new IllegalArgumentException("Can't set single child to a list");
  }
  if ( children==null ) {
    children = createChildrenList();
  }
  children.set(i, t);
  t.setParent(this);
  t.setChildIndex(i);
}

代码示例来源:origin: antlr/antlr3

@Override
public void setChild(int i, Tree t) {
  if ( t==null ) {
    return;
  }
  if ( t.isNil() ) {
    throw new IllegalArgumentException("Can't set single child to a list");
  }
  if ( children==null ) {
    children = createChildrenList();
  }
  children.set(i, t);
  t.setParent(this);
  t.setChildIndex(i);
}

代码示例来源:origin: antlr/antlr3

@Override
public void setChild(int i, Tree t) {
  if ( t==null ) {
    return;
  }
  if ( t.isNil() ) {
    throw new IllegalArgumentException("Can't set single child to a list");
  }
  if ( children==null ) {
    children = createChildrenList();
  }
  children.set(i, t);
  t.setParent(this);
  t.setChildIndex(i);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.antlr-runtime

@Override
public void setChild(int i, Tree t) {
  if ( t==null ) {
    return;
  }
  if ( t.isNil() ) {
    throw new IllegalArgumentException("Can't set single child to a list");
  }
  if ( children==null ) {
    children = createChildrenList();
  }
  children.set(i, t);
  t.setParent(this);
  t.setChildIndex(i);
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

@Override
public void setChild(int i, Tree t) {
  if ( t==null ) {
    return;
  }
  if ( t.isNil() ) {
    throw new IllegalArgumentException("Can't set single child to a list");
  }
  if ( children==null ) {
    children = createChildrenList();
  }
  children.set(i, t);
  t.setParent(this);
  t.setChildIndex(i);
}

代码示例来源:origin: io.virtdata/virtdata-lib-realer

@Override
public void setChild(int i, Tree t) {
  if ( t==null ) {
    return;
  }
  if ( t.isNil() ) {
    throw new IllegalArgumentException("Can't set single child to a list");
  }
  if ( children==null ) {
    children = createChildrenList();
  }
  children.set(i, t);
  t.setParent(this);
  t.setChildIndex(i);
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

/** Transform ^(nil x) to x and nil to null */
public Object rulePostProcessing(Object root) {
  //System.out.println("rulePostProcessing: "+((Tree)root).toStringTree());
  Tree r = (Tree)root;
  if ( r!=null && r.isNil() ) {
    if ( r.getChildCount()==0 ) {
      r = null;
    }
    else if ( r.getChildCount()==1 ) {
      r = (Tree)r.getChild(0);
      // whoever invokes rule will set parent and child index
      r.setParent(null);
      r.setChildIndex(-1);
    }
  }
  return r;
}

代码示例来源:origin: antlr/antlr3

/** Transform ^(nil x) to x and nil to null */
@Override
public Object rulePostProcessing(Object root) {
  //System.out.println("rulePostProcessing: "+((Tree)root).toStringTree());
  Tree r = (Tree)root;
  if ( r!=null && r.isNil() ) {
    if ( r.getChildCount()==0 ) {
      r = null;
    }
    else if ( r.getChildCount()==1 ) {
      r = r.getChild(0);
      // whoever invokes rule will set parent and child index
      r.setParent(null);
      r.setChildIndex(-1);
    }
  }
  return r;
}

代码示例来源:origin: antlr/antlr3

/** Transform ^(nil x) to x and nil to null */
@Override
public Object rulePostProcessing(Object root) {
  //System.out.println("rulePostProcessing: "+((Tree)root).toStringTree());
  Tree r = (Tree)root;
  if ( r!=null && r.isNil() ) {
    if ( r.getChildCount()==0 ) {
      r = null;
    }
    else if ( r.getChildCount()==1 ) {
      r = r.getChild(0);
      // whoever invokes rule will set parent and child index
      r.setParent(null);
      r.setChildIndex(-1);
    }
  }
  return r;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.antlr-runtime

/** Transform ^(nil x) to x and nil to null */
@Override
public Object rulePostProcessing(Object root) {
  //System.out.println("rulePostProcessing: "+((Tree)root).toStringTree());
  Tree r = (Tree)root;
  if ( r!=null && r.isNil() ) {
    if ( r.getChildCount()==0 ) {
      r = null;
    }
    else if ( r.getChildCount()==1 ) {
      r = r.getChild(0);
      // whoever invokes rule will set parent and child index
      r.setParent(null);
      r.setChildIndex(-1);
    }
  }
  return r;
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

/** Transform ^(nil x) to x and nil to null */
@Override
public Object rulePostProcessing(Object root) {
  //System.out.println("rulePostProcessing: "+((Tree)root).toStringTree());
  Tree r = (Tree)root;
  if ( r!=null && r.isNil() ) {
    if ( r.getChildCount()==0 ) {
      r = null;
    }
    else if ( r.getChildCount()==1 ) {
      r = r.getChild(0);
      // whoever invokes rule will set parent and child index
      r.setParent(null);
      r.setChildIndex(-1);
    }
  }
  return r;
}

代码示例来源:origin: io.virtdata/virtdata-lib-realer

/** Transform ^(nil x) to x and nil to null */
@Override
public Object rulePostProcessing(Object root) {
  //System.out.println("rulePostProcessing: "+((Tree)root).toStringTree());
  Tree r = (Tree)root;
  if ( r!=null && r.isNil() ) {
    if ( r.getChildCount()==0 ) {
      r = null;
    }
    else if ( r.getChildCount()==1 ) {
      r = r.getChild(0);
      // whoever invokes rule will set parent and child index
      r.setParent(null);
      r.setChildIndex(-1);
    }
  }
  return r;
}

相关文章