Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2009 itemis AG (http://www.itemis.eu) and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html /
 
 package org.eclipse.xtext.ui.editor.contentassist.antlr;
 

Author(s):
Sebastian Zarnekow - Initial contribution and API
	public interface StreamListener {
		void announceEof(int lookAhead);
		void announceMark(int marker);
		void announceRewind(int marker);
	}
	private boolean attemptedToConsumePastEof = false;
		super();
	}
	public ObservableXtextTokenStream(TokenSource tokenSourceint channel) {
		super(tokenSourcechannel);
	}
	public ObservableXtextTokenStream(TokenSource tokenSourceITokenDefProvider tokenDefProvider) {
		super(tokenSourcetokenDefProvider);
	}
	public int LA(int i) {
		Token lookaheadToken = LT(i);
		int result = lookaheadToken.getType();
		if (result == . && getListener() != null)
		return result;
	}
	public int mark() {
		int result = super.mark();
		if (getListener() != null)
		return result;
	}
	public void rewind(int marker) {
		if (marker != .size())
		if (getListener() != null)
		super.rewind(marker);
	}
	public void consume() {
		if (getListener() != null) {
			if (getFirstMarker() == -1 && getCurrentLookAhead() <= 1 &&  >= .size()) {
				}
else {
			}
		}
		super.consume();
	}
	public void setListener(StreamListener listener) {
		this. = listener;
	}
		return ;
	}
New to GrepCode? Check out our FAQ X