Populate xpath/ hierarchy
[yangtools.git] / parser / yang-parser-rfc7950 / src / main / java / org / opendaylight / yangtools / yang / parser / rfc7950 / antlr / Token44444.java
1 /*
2  * Copyright (c) 2020 PANTHEON.tech, s.r.o. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.yangtools.yang.parser.rfc7950.antlr;
9
10 import org.antlr.v4.runtime.CharStream;
11 import org.antlr.v4.runtime.TokenSource;
12 import org.antlr.v4.runtime.misc.Pair;
13
14 /**
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..
17  *
18  * <p>
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.
21  */
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;
28
29     Token44444(final Pair<TokenSource, CharStream> source, final int type, final int line, final int charPositionInLine,
30             final int startIndex, final int stopIndex) {
31         super(source);
32         this.type = type;
33         this.line = line;
34         this.charPositionInLine = charPositionInLine;
35         this.startIndex = startIndex;
36         this.stopIndex = stopIndex;
37     }
38
39     @Override
40     public int getType() {
41         return type;
42     }
43
44     @Override
45     public int getLine() {
46         return line;
47     }
48
49     @Override
50     public int getCharPositionInLine() {
51         return charPositionInLine;
52     }
53
54     @Override
55     public int getStartIndex() {
56         return startIndex;
57     }
58
59     @Override
60     public int getStopIndex() {
61         return stopIndex;
62     }
63 }