2 * Copyright (c) 2020 PANTHEON.tech, s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.yangtools.yang.parser.rfc7950.antlr;
10 import static com.google.common.base.Preconditions.checkState;
12 import org.antlr.v4.runtime.WritableToken;
14 abstract class AbstractToken implements WritableToken {
15 private int tokenIndex = -1;
18 public final int getChannel() {
19 return DEFAULT_CHANNEL;
23 public final int getTokenIndex() {
28 public final void setTokenIndex(final int index) {
29 checkState(tokenIndex == -1);
34 public final void setText(final String text) {
35 throw new UnsupportedOperationException();
39 public final void setType(final int ttype) {
40 throw new UnsupportedOperationException();
44 public final void setLine(final int line) {
45 throw new UnsupportedOperationException();
49 public final void setCharPositionInLine(final int pos) {
50 throw new UnsupportedOperationException();
54 public final void setChannel(final int channel) {
55 throw new UnsupportedOperationException();