From e2dbb085acae202b02f9db287f22e658070a19ae Mon Sep 17 00:00:00 2001 From: sharwell Date: Thu, 17 Nov 2011 18:40:00 -0800 Subject: [PATCH] v4: Specify @Override [git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9367] --- .../antlr/v4/runtime/tree/CommonASTNodeStream.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/runtime/Java/src/org/antlr/v4/runtime/tree/CommonASTNodeStream.java b/runtime/Java/src/org/antlr/v4/runtime/tree/CommonASTNodeStream.java index 12a519cc1..73ff3b863 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/tree/CommonASTNodeStream.java +++ b/runtime/Java/src/org/antlr/v4/runtime/tree/CommonASTNodeStream.java @@ -72,6 +72,7 @@ public class CommonASTNodeStream extends LookaheadStream it = new ASTIterator(adaptor,root); } + @Override public void reset() { super.reset(); it.reset(); @@ -83,6 +84,7 @@ public class CommonASTNodeStream extends LookaheadStream /** Pull elements from tree iterator. Track tree level 0..max_level. * If nil rooted tree, don't give initial nil and DOWN nor final UP. */ + @Override public T nextElement() { T t = it.next(); //System.out.println("pulled "+adaptor.getType(t)); @@ -100,26 +102,34 @@ public class CommonASTNodeStream extends LookaheadStream return t; } + @Override public boolean isEOF(T o) { return adaptor.getType(o) == Token.EOF; } + @Override public void setUniqueNavigationNodes(boolean uniqueNavigationNodes) { } + @Override public T getTreeSource() { return root; } + @Override public String getSourceName() { return getTokenStream().getSourceName(); } + @Override public TokenStream getTokenStream() { return tokens; } public void setTokenStream(TokenStream tokens) { this.tokens = tokens; } + @Override public ASTAdaptor getTreeAdaptor() { return adaptor; } public void setTreeAdaptor(ASTAdaptor adaptor) { this.adaptor = adaptor; } + @Override public T get(int i) { throw new UnsupportedOperationException("Absolute node indexes are meaningless in an unbuffered stream"); } + @Override public int LA(int i) { return adaptor.getType(LT(i)); } /** Make stream jump to a new location, saving old location. @@ -144,6 +154,7 @@ public class CommonASTNodeStream extends LookaheadStream // TREE REWRITE INTERFACE + @Override public void replaceChildren(T parent, int startChildIndex, int stopChildIndex, T t) { if ( parent!=null ) { adaptor.replaceChildren(parent, startChildIndex, stopChildIndex, t); @@ -154,6 +165,7 @@ public class CommonASTNodeStream extends LookaheadStream * node, then we have to walk it back until we see the first non-UP node. * Then, just get the token indexes and look into the token stream. */ + @Override public String toString(T start, T stop) { if ( tokens==null ) throw new UnsupportedOperationException("can't print from null token stream in node stream"); if ( start==null || stop==null ) return "";