forked from jasder/antlr
v4: Specify @Override
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9369]
This commit is contained in:
parent
afebb6138e
commit
c4bb346f9a
|
@ -46,11 +46,13 @@ public class ElementList<E> extends ArrayList<E> {
|
|||
/** If just 1 element, we still track cursor; next() will dup if
|
||||
* cursor beyond 1 element.
|
||||
*/
|
||||
@Override
|
||||
public boolean hasNext() {
|
||||
int n = size();
|
||||
return (n==1 && cursor<1) || (n>1 && cursor<n);
|
||||
}
|
||||
|
||||
@Override
|
||||
public E next() {
|
||||
int n = size();
|
||||
if ( n == 0 ) throw new RewriteEmptyStreamException("n/a");
|
||||
|
@ -73,6 +75,7 @@ public class ElementList<E> extends ArrayList<E> {
|
|||
return e;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove() { throw new UnsupportedOperationException(); }
|
||||
}
|
||||
|
||||
|
|
|
@ -57,19 +57,25 @@ public interface ParseTree extends SyntaxTree {
|
|||
public int s;
|
||||
public TokenNodeImpl(Token token) { this.token = token; }
|
||||
|
||||
@Override
|
||||
public ParseTree getChild(int i) {return null;}
|
||||
|
||||
@Override
|
||||
public Token getToken() {return token;}
|
||||
|
||||
@Override
|
||||
public ParseTree getParent() { return parent; }
|
||||
|
||||
@Override
|
||||
public Token getPayload() { return token; }
|
||||
|
||||
@Override
|
||||
public Interval getSourceInterval() {
|
||||
if ( token==null ) return Interval.INVALID;
|
||||
return new Interval(token.getTokenIndex(), token.getTokenIndex());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getChildCount() { return 0; }
|
||||
|
||||
@Override
|
||||
|
@ -78,6 +84,7 @@ public interface ParseTree extends SyntaxTree {
|
|||
return token.getText();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toStringTree() {
|
||||
return toString();
|
||||
}
|
||||
|
@ -98,6 +105,8 @@ public interface ParseTree extends SyntaxTree {
|
|||
}
|
||||
|
||||
// the following methods narrow the return type; they are not additional methods
|
||||
@Override
|
||||
ParseTree getParent();
|
||||
@Override
|
||||
ParseTree getChild(int i);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue