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