1
/*******************************************************************************
2
* Copyright (c) 2004, 2008, 2013 IBM Corporation and others.
3
* All rights reserved. This program and the accompanying materials
4
* are made available under the terms of the Eclipse Public License v1.0
5
* which accompanies this distribution, and is available at
6
* http://www.eclipse.org/legal/epl-v10.html
9
* IBM Corporation - initial implementation
10
* Anton Leherbauer - adding tokens for preprocessing directives
11
* Markus Schorn - classification of preprocessing directives.
12
* Red Hat Inc. - modified for use in SystemTap
13
*******************************************************************************/
14
package org.eclipse.linuxtools.internal.systemtap.ui.ide.editors.stp;
16
import java.io.IOException;
17
import java.io.Reader;
18
import java.util.Stack;
20
public class ScannerContext {
21
private Reader fReader;
23
private Stack<Integer> fUndo = new Stack<Integer>();
25
public ScannerContext() {
28
public ScannerContext initialize(Reader r) {
34
public ScannerContext initialize(Reader r, int offset) {
37
} catch (IOException exc) {
38
throw new RuntimeException(exc);
45
public int read() throws IOException {
47
return fReader.read();
54
public final int getOffset() {
62
public final Reader getReader() {
66
public final int undoStackSize() {
74
public final int popUndo() {
75
return fUndo.pop().intValue();
80
* @param undo The undo to set
82
public void pushUndo(int undo) {
83
this.fUndo.push(new Integer(undo));