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 org.antlr.v4.runtime.CharStream;
11 import org.antlr.v4.runtime.TokenSource;
12 import org.antlr.v4.runtime.misc.Pair;
15 * Large general token implementation. This cuts {@code channel}, {@code text} fields completely, as we typically
16 * we do not use them. All other fields are retained..
19 * This class ends up costing 40/56/40/48 bytes instead of 48/64/48/48 bytes, a saving of 12-33%, while still being
20 * applicable in all situations.
22 final class Token44444 extends AbstractSourceToken {
23 private final int type;
24 private final int line;
25 private final int charPositionInLine;
26 private final int startIndex;
27 private final int stopIndex;
29 Token44444(final Pair<TokenSource, CharStream> source, final int type, final int line, final int charPositionInLine,
30 final int startIndex, final int stopIndex) {
34 this.charPositionInLine = charPositionInLine;
35 this.startIndex = startIndex;
36 this.stopIndex = stopIndex;
40 public int getType() {
45 public int getLine() {
50 public int getCharPositionInLine() {
51 return charPositionInLine;
55 public int getStartIndex() {
60 public int getStopIndex() {