001/*
002 * Copyright (c) 2012-2018 Institut National des Sciences Appliquées de Lyon (INSA Lyon) and others
003 *
004 * This program and the accompanying materials are made available under the
005 * terms of the Eclipse Public License 2.0 which is available at
006 * http://www.eclipse.org/legal/epl-2.0.
007 *
008 * SPDX-License-Identifier: EPL-2.0
009 */
010
011package org.eclipse.golo.compiler.parser;
012
013import java.io.InputStream;
014import java.io.Reader;
015
016/**
017 * Golo parser extension allowing to track token offsets.
018 */
019public class GoloOffsetParser extends GoloParser {
020
021  private void hookInputs() {
022    jj_input_stream = new JavaOffsetCharStream(jj_input_stream);
023    token_source = new GoloOffsetParserTokenManager(jj_input_stream);
024  }
025
026  public GoloOffsetParser(InputStream stream) {
027    super(stream);
028    hookInputs();
029  }
030
031  public GoloOffsetParser(InputStream stream, String encoding) {
032    super(stream, encoding);
033    hookInputs();
034  }
035
036  public GoloOffsetParser(Reader stream) {
037    super(stream);
038    hookInputs();
039  }
040
041  public GoloOffsetParser(GoloParserTokenManager tm) {
042    super(tm);
043    hookInputs();
044  }
045}