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 java.util.Objects.requireNonNull;
12 import org.antlr.v4.runtime.CharStream;
13 import org.antlr.v4.runtime.TokenSource;
15 final class ExplicitTextToken extends AbstractToken {
16 private final int type;
17 private final String text;
19 ExplicitTextToken(final int type, final String text) {
21 this.text = requireNonNull(text);
25 public String getText() {
30 public int getType() {
35 public int getLine() {
36 // TODO: this mimics CommonToken, but is probably not right
41 public int getCharPositionInLine() {
46 public int getStartIndex() {
47 // TODO: this mimics CommonToken, but is probably not right
52 public int getStopIndex() {
53 // TODO: this mimics CommonToken, but is probably not right
58 public TokenSource getTokenSource() {
63 public CharStream getInputStream() {