astenumerator.java

来自「Java写的词法/语法分析器。可生成JAVA语言或者是C++的词法和语法分析器。」· Java 代码 · 共 38 行

JAVA
38
字号
package antlr.collections.impl;/* ANTLR Translator Generator * Project led by Terence Parr at http://www.jGuru.com * Software rights: http://www.antlr.org/RIGHTS.html * * $Id: //depot/code/org.antlr/release/antlr-2.7.0/antlr/collections/impl/ASTEnumerator.java#1 $ */import antlr.collections.impl.Vector;import antlr.collections.ASTEnumeration;import antlr.collections.AST;import java.util.NoSuchElementException;public class ASTEnumerator implements antlr.collections.ASTEnumeration {	/** The list of root nodes for subtrees that match */	VectorEnumerator nodes;	int i = 0;public ASTEnumerator(Vector v) {		nodes = new VectorEnumerator(v);}public boolean hasMoreNodes() {	synchronized (nodes) {		return i <= nodes.vector.lastElement;	}}public antlr.collections.AST nextNode() {	synchronized (nodes) {		if (i <= nodes.vector.lastElement) {			return (AST)nodes.vector.data[i++];		}		throw new NoSuchElementException("ASTEnumerator");	}}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?