UNPKG

3.14 kBJavaScriptView Raw
1"use strict";
2/*!
3 * Copyright 2016 The ANTLR Project. All rights reserved.
4 * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information.
5 */
6var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
7 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
8 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
9 else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
10 return c > 3 && r && Object.defineProperty(target, key, r), r;
11};
12var __param = (this && this.__param) || function (paramIndex, decorator) {
13 return function (target, key) { decorator(target, key, paramIndex); }
14};
15Object.defineProperty(exports, "__esModule", { value: true });
16exports.LexerInterpreter = void 0;
17const Lexer_1 = require("./Lexer");
18const LexerATNSimulator_1 = require("./atn/LexerATNSimulator");
19const Decorators_1 = require("./Decorators");
20const Decorators_2 = require("./Decorators");
21let LexerInterpreter = class LexerInterpreter extends Lexer_1.Lexer {
22 constructor(grammarFileName, vocabulary, ruleNames, channelNames, modeNames, atn, input) {
23 super(input);
24 if (atn.grammarType !== 0 /* LEXER */) {
25 throw new Error("IllegalArgumentException: The ATN must be a lexer ATN.");
26 }
27 this._grammarFileName = grammarFileName;
28 this._atn = atn;
29 this._ruleNames = ruleNames.slice(0);
30 this._channelNames = channelNames.slice(0);
31 this._modeNames = modeNames.slice(0);
32 this._vocabulary = vocabulary;
33 this._interp = new LexerATNSimulator_1.LexerATNSimulator(atn, this);
34 }
35 get atn() {
36 return this._atn;
37 }
38 get grammarFileName() {
39 return this._grammarFileName;
40 }
41 get ruleNames() {
42 return this._ruleNames;
43 }
44 get channelNames() {
45 return this._channelNames;
46 }
47 get modeNames() {
48 return this._modeNames;
49 }
50 get vocabulary() {
51 return this._vocabulary;
52 }
53};
54__decorate([
55 Decorators_1.NotNull
56], LexerInterpreter.prototype, "_vocabulary", void 0);
57__decorate([
58 Decorators_2.Override
59], LexerInterpreter.prototype, "atn", null);
60__decorate([
61 Decorators_2.Override
62], LexerInterpreter.prototype, "grammarFileName", null);
63__decorate([
64 Decorators_2.Override
65], LexerInterpreter.prototype, "ruleNames", null);
66__decorate([
67 Decorators_2.Override
68], LexerInterpreter.prototype, "channelNames", null);
69__decorate([
70 Decorators_2.Override
71], LexerInterpreter.prototype, "modeNames", null);
72__decorate([
73 Decorators_2.Override
74], LexerInterpreter.prototype, "vocabulary", null);
75LexerInterpreter = __decorate([
76 __param(1, Decorators_1.NotNull)
77], LexerInterpreter);
78exports.LexerInterpreter = LexerInterpreter;
79//# sourceMappingURL=LexerInterpreter.js.map
\No newline at end of file