831 lines
30 KiB
TypeScript
831 lines
30 KiB
TypeScript
|
|
import * as antlr from "antlr4ng";
|
|
import { Token } from "antlr4ng";
|
|
|
|
import { QuixosLockVisitor } from "./QuixosLockVisitor.js";
|
|
|
|
// for running tests with parameters, TODO: discuss strategy for typed parameters in CI
|
|
// eslint-disable-next-line no-unused-vars
|
|
type int = number;
|
|
|
|
|
|
export class QuixosLockParser extends antlr.Parser {
|
|
public static readonly QUIXOS_LOCK = 1;
|
|
public static readonly FRAGMENT = 2;
|
|
public static readonly VERSION = 3;
|
|
public static readonly QUIXOS = 4;
|
|
public static readonly SOURCE = 5;
|
|
public static readonly INTERFACE = 6;
|
|
public static readonly PACKAGE = 7;
|
|
public static readonly REPOSITORY = 8;
|
|
public static readonly COMMIT = 9;
|
|
public static readonly POLICY = 10;
|
|
public static readonly REF = 11;
|
|
public static readonly PINNED = 12;
|
|
public static readonly TRACK_RELEASE = 13;
|
|
public static readonly TRACK_DEVELOPMENT = 14;
|
|
public static readonly IMPORT = 15;
|
|
public static readonly LBRACE = 16;
|
|
public static readonly RBRACE = 17;
|
|
public static readonly SEMI = 18;
|
|
public static readonly INTEGER = 19;
|
|
public static readonly IDENTIFIER = 20;
|
|
public static readonly STRING_LITERAL = 21;
|
|
public static readonly LINE_COMMENT = 22;
|
|
public static readonly BLOCK_COMMENT = 23;
|
|
public static readonly WS = 24;
|
|
public static readonly RULE_document = 0;
|
|
public static readonly RULE_quixosEntry = 1;
|
|
public static readonly RULE_resourceEntry = 2;
|
|
public static readonly RULE_importEntry = 3;
|
|
public static readonly RULE_resourceKind = 4;
|
|
public static readonly RULE_sourceBlock = 5;
|
|
public static readonly RULE_quixosSourceBlock = 6;
|
|
public static readonly RULE_sourcePolicy = 7;
|
|
public static readonly RULE_identifier = 8;
|
|
public static readonly RULE_stringLiteral = 9;
|
|
|
|
public static readonly literalNames = [
|
|
null, "'quixos-lock'", "'fragment'", "'version'", "'quixos'", "'source'",
|
|
"'interface'", "'package'", "'repository'", "'commit'", "'policy'",
|
|
"'ref'", "'pinned'", "'track-release'", "'track-development'", "'import'",
|
|
"'{'", "'}'", "';'"
|
|
];
|
|
|
|
public static readonly symbolicNames = [
|
|
null, "QUIXOS_LOCK", "FRAGMENT", "VERSION", "QUIXOS", "SOURCE",
|
|
"INTERFACE", "PACKAGE", "REPOSITORY", "COMMIT", "POLICY", "REF",
|
|
"PINNED", "TRACK_RELEASE", "TRACK_DEVELOPMENT", "IMPORT", "LBRACE",
|
|
"RBRACE", "SEMI", "INTEGER", "IDENTIFIER", "STRING_LITERAL", "LINE_COMMENT",
|
|
"BLOCK_COMMENT", "WS"
|
|
];
|
|
public static readonly ruleNames = [
|
|
"document", "quixosEntry", "resourceEntry", "importEntry", "resourceKind",
|
|
"sourceBlock", "quixosSourceBlock", "sourcePolicy", "identifier",
|
|
"stringLiteral",
|
|
];
|
|
|
|
public get grammarFileName(): string { return "QuixosLock.g4"; }
|
|
public get literalNames(): (string | null)[] { return QuixosLockParser.literalNames; }
|
|
public get symbolicNames(): (string | null)[] { return QuixosLockParser.symbolicNames; }
|
|
public get ruleNames(): string[] { return QuixosLockParser.ruleNames; }
|
|
public get serializedATN(): number[] { return QuixosLockParser._serializedATN; }
|
|
|
|
protected createFailedPredicateException(predicate?: string, message?: string): antlr.FailedPredicateException {
|
|
return new antlr.FailedPredicateException(this, predicate, message);
|
|
}
|
|
|
|
public constructor(input: antlr.TokenStream) {
|
|
super(input);
|
|
this.interpreter = new antlr.ParserATNSimulator(this, QuixosLockParser._ATN, QuixosLockParser.decisionsToDFA, new antlr.PredictionContextCache());
|
|
}
|
|
public document(): DocumentContext {
|
|
let localContext = new DocumentContext(this.context, this.state);
|
|
this.enterRule(localContext, 0, QuixosLockParser.RULE_document);
|
|
let _la: number;
|
|
try {
|
|
this.enterOuterAlt(localContext, 1);
|
|
{
|
|
this.state = 20;
|
|
this.match(QuixosLockParser.QUIXOS_LOCK);
|
|
this.state = 22;
|
|
this.errorHandler.sync(this);
|
|
_la = this.tokenStream.LA(1);
|
|
if (_la === 2) {
|
|
{
|
|
this.state = 21;
|
|
this.match(QuixosLockParser.FRAGMENT);
|
|
}
|
|
}
|
|
|
|
this.state = 24;
|
|
this.match(QuixosLockParser.VERSION);
|
|
this.state = 25;
|
|
this.match(QuixosLockParser.INTEGER);
|
|
this.state = 26;
|
|
this.match(QuixosLockParser.LBRACE);
|
|
this.state = 32;
|
|
this.errorHandler.sync(this);
|
|
_la = this.tokenStream.LA(1);
|
|
while ((((_la) & ~0x1F) === 0 && ((1 << _la) & 32976) !== 0)) {
|
|
{
|
|
this.state = 30;
|
|
this.errorHandler.sync(this);
|
|
switch (this.tokenStream.LA(1)) {
|
|
case QuixosLockParser.QUIXOS:
|
|
{
|
|
this.state = 27;
|
|
this.quixosEntry();
|
|
}
|
|
break;
|
|
case QuixosLockParser.IMPORT:
|
|
{
|
|
this.state = 28;
|
|
this.importEntry();
|
|
}
|
|
break;
|
|
case QuixosLockParser.INTERFACE:
|
|
case QuixosLockParser.PACKAGE:
|
|
{
|
|
this.state = 29;
|
|
this.resourceEntry();
|
|
}
|
|
break;
|
|
default:
|
|
throw new antlr.NoViableAltException(this);
|
|
}
|
|
}
|
|
this.state = 34;
|
|
this.errorHandler.sync(this);
|
|
_la = this.tokenStream.LA(1);
|
|
}
|
|
this.state = 35;
|
|
this.match(QuixosLockParser.RBRACE);
|
|
this.state = 36;
|
|
this.match(QuixosLockParser.EOF);
|
|
}
|
|
}
|
|
catch (re) {
|
|
if (re instanceof antlr.RecognitionException) {
|
|
this.errorHandler.reportError(this, re);
|
|
this.errorHandler.recover(this, re);
|
|
} else {
|
|
throw re;
|
|
}
|
|
}
|
|
finally {
|
|
this.exitRule();
|
|
}
|
|
return localContext;
|
|
}
|
|
public quixosEntry(): QuixosEntryContext {
|
|
let localContext = new QuixosEntryContext(this.context, this.state);
|
|
this.enterRule(localContext, 2, QuixosLockParser.RULE_quixosEntry);
|
|
try {
|
|
this.enterOuterAlt(localContext, 1);
|
|
{
|
|
this.state = 38;
|
|
this.match(QuixosLockParser.QUIXOS);
|
|
this.state = 39;
|
|
this.match(QuixosLockParser.SOURCE);
|
|
this.state = 40;
|
|
this.quixosSourceBlock();
|
|
}
|
|
}
|
|
catch (re) {
|
|
if (re instanceof antlr.RecognitionException) {
|
|
this.errorHandler.reportError(this, re);
|
|
this.errorHandler.recover(this, re);
|
|
} else {
|
|
throw re;
|
|
}
|
|
}
|
|
finally {
|
|
this.exitRule();
|
|
}
|
|
return localContext;
|
|
}
|
|
public resourceEntry(): ResourceEntryContext {
|
|
let localContext = new ResourceEntryContext(this.context, this.state);
|
|
this.enterRule(localContext, 4, QuixosLockParser.RULE_resourceEntry);
|
|
try {
|
|
this.enterOuterAlt(localContext, 1);
|
|
{
|
|
this.state = 42;
|
|
this.resourceKind();
|
|
this.state = 43;
|
|
this.identifier();
|
|
this.state = 44;
|
|
this.match(QuixosLockParser.SOURCE);
|
|
this.state = 45;
|
|
this.sourceBlock();
|
|
}
|
|
}
|
|
catch (re) {
|
|
if (re instanceof antlr.RecognitionException) {
|
|
this.errorHandler.reportError(this, re);
|
|
this.errorHandler.recover(this, re);
|
|
} else {
|
|
throw re;
|
|
}
|
|
}
|
|
finally {
|
|
this.exitRule();
|
|
}
|
|
return localContext;
|
|
}
|
|
public importEntry(): ImportEntryContext {
|
|
let localContext = new ImportEntryContext(this.context, this.state);
|
|
this.enterRule(localContext, 6, QuixosLockParser.RULE_importEntry);
|
|
try {
|
|
this.enterOuterAlt(localContext, 1);
|
|
{
|
|
this.state = 47;
|
|
this.match(QuixosLockParser.IMPORT);
|
|
this.state = 48;
|
|
this.stringLiteral();
|
|
this.state = 49;
|
|
this.match(QuixosLockParser.SEMI);
|
|
}
|
|
}
|
|
catch (re) {
|
|
if (re instanceof antlr.RecognitionException) {
|
|
this.errorHandler.reportError(this, re);
|
|
this.errorHandler.recover(this, re);
|
|
} else {
|
|
throw re;
|
|
}
|
|
}
|
|
finally {
|
|
this.exitRule();
|
|
}
|
|
return localContext;
|
|
}
|
|
public resourceKind(): ResourceKindContext {
|
|
let localContext = new ResourceKindContext(this.context, this.state);
|
|
this.enterRule(localContext, 8, QuixosLockParser.RULE_resourceKind);
|
|
let _la: number;
|
|
try {
|
|
this.enterOuterAlt(localContext, 1);
|
|
{
|
|
this.state = 51;
|
|
_la = this.tokenStream.LA(1);
|
|
if(!(_la === 6 || _la === 7)) {
|
|
this.errorHandler.recoverInline(this);
|
|
}
|
|
else {
|
|
this.errorHandler.reportMatch(this);
|
|
this.consume();
|
|
}
|
|
}
|
|
}
|
|
catch (re) {
|
|
if (re instanceof antlr.RecognitionException) {
|
|
this.errorHandler.reportError(this, re);
|
|
this.errorHandler.recover(this, re);
|
|
} else {
|
|
throw re;
|
|
}
|
|
}
|
|
finally {
|
|
this.exitRule();
|
|
}
|
|
return localContext;
|
|
}
|
|
public sourceBlock(): SourceBlockContext {
|
|
let localContext = new SourceBlockContext(this.context, this.state);
|
|
this.enterRule(localContext, 10, QuixosLockParser.RULE_sourceBlock);
|
|
try {
|
|
this.enterOuterAlt(localContext, 1);
|
|
{
|
|
this.state = 53;
|
|
this.match(QuixosLockParser.LBRACE);
|
|
this.state = 54;
|
|
this.match(QuixosLockParser.REPOSITORY);
|
|
this.state = 55;
|
|
this.stringLiteral();
|
|
this.state = 56;
|
|
this.match(QuixosLockParser.SEMI);
|
|
this.state = 57;
|
|
this.match(QuixosLockParser.COMMIT);
|
|
this.state = 58;
|
|
this.stringLiteral();
|
|
this.state = 59;
|
|
this.match(QuixosLockParser.SEMI);
|
|
this.state = 60;
|
|
this.match(QuixosLockParser.RBRACE);
|
|
}
|
|
}
|
|
catch (re) {
|
|
if (re instanceof antlr.RecognitionException) {
|
|
this.errorHandler.reportError(this, re);
|
|
this.errorHandler.recover(this, re);
|
|
} else {
|
|
throw re;
|
|
}
|
|
}
|
|
finally {
|
|
this.exitRule();
|
|
}
|
|
return localContext;
|
|
}
|
|
public quixosSourceBlock(): QuixosSourceBlockContext {
|
|
let localContext = new QuixosSourceBlockContext(this.context, this.state);
|
|
this.enterRule(localContext, 12, QuixosLockParser.RULE_quixosSourceBlock);
|
|
let _la: number;
|
|
try {
|
|
this.enterOuterAlt(localContext, 1);
|
|
{
|
|
this.state = 62;
|
|
this.match(QuixosLockParser.LBRACE);
|
|
this.state = 63;
|
|
this.match(QuixosLockParser.REPOSITORY);
|
|
this.state = 64;
|
|
this.stringLiteral();
|
|
this.state = 65;
|
|
this.match(QuixosLockParser.SEMI);
|
|
this.state = 73;
|
|
this.errorHandler.sync(this);
|
|
_la = this.tokenStream.LA(1);
|
|
if (_la === 10) {
|
|
{
|
|
this.state = 66;
|
|
this.match(QuixosLockParser.POLICY);
|
|
this.state = 67;
|
|
this.sourcePolicy();
|
|
this.state = 68;
|
|
this.match(QuixosLockParser.SEMI);
|
|
this.state = 69;
|
|
this.match(QuixosLockParser.REF);
|
|
this.state = 70;
|
|
this.stringLiteral();
|
|
this.state = 71;
|
|
this.match(QuixosLockParser.SEMI);
|
|
}
|
|
}
|
|
|
|
this.state = 75;
|
|
this.match(QuixosLockParser.COMMIT);
|
|
this.state = 76;
|
|
this.stringLiteral();
|
|
this.state = 77;
|
|
this.match(QuixosLockParser.SEMI);
|
|
this.state = 78;
|
|
this.match(QuixosLockParser.RBRACE);
|
|
}
|
|
}
|
|
catch (re) {
|
|
if (re instanceof antlr.RecognitionException) {
|
|
this.errorHandler.reportError(this, re);
|
|
this.errorHandler.recover(this, re);
|
|
} else {
|
|
throw re;
|
|
}
|
|
}
|
|
finally {
|
|
this.exitRule();
|
|
}
|
|
return localContext;
|
|
}
|
|
public sourcePolicy(): SourcePolicyContext {
|
|
let localContext = new SourcePolicyContext(this.context, this.state);
|
|
this.enterRule(localContext, 14, QuixosLockParser.RULE_sourcePolicy);
|
|
let _la: number;
|
|
try {
|
|
this.enterOuterAlt(localContext, 1);
|
|
{
|
|
this.state = 80;
|
|
_la = this.tokenStream.LA(1);
|
|
if(!((((_la) & ~0x1F) === 0 && ((1 << _la) & 28672) !== 0))) {
|
|
this.errorHandler.recoverInline(this);
|
|
}
|
|
else {
|
|
this.errorHandler.reportMatch(this);
|
|
this.consume();
|
|
}
|
|
}
|
|
}
|
|
catch (re) {
|
|
if (re instanceof antlr.RecognitionException) {
|
|
this.errorHandler.reportError(this, re);
|
|
this.errorHandler.recover(this, re);
|
|
} else {
|
|
throw re;
|
|
}
|
|
}
|
|
finally {
|
|
this.exitRule();
|
|
}
|
|
return localContext;
|
|
}
|
|
public identifier(): IdentifierContext {
|
|
let localContext = new IdentifierContext(this.context, this.state);
|
|
this.enterRule(localContext, 16, QuixosLockParser.RULE_identifier);
|
|
try {
|
|
this.enterOuterAlt(localContext, 1);
|
|
{
|
|
this.state = 82;
|
|
this.match(QuixosLockParser.IDENTIFIER);
|
|
}
|
|
}
|
|
catch (re) {
|
|
if (re instanceof antlr.RecognitionException) {
|
|
this.errorHandler.reportError(this, re);
|
|
this.errorHandler.recover(this, re);
|
|
} else {
|
|
throw re;
|
|
}
|
|
}
|
|
finally {
|
|
this.exitRule();
|
|
}
|
|
return localContext;
|
|
}
|
|
public stringLiteral(): StringLiteralContext {
|
|
let localContext = new StringLiteralContext(this.context, this.state);
|
|
this.enterRule(localContext, 18, QuixosLockParser.RULE_stringLiteral);
|
|
try {
|
|
this.enterOuterAlt(localContext, 1);
|
|
{
|
|
this.state = 84;
|
|
this.match(QuixosLockParser.STRING_LITERAL);
|
|
}
|
|
}
|
|
catch (re) {
|
|
if (re instanceof antlr.RecognitionException) {
|
|
this.errorHandler.reportError(this, re);
|
|
this.errorHandler.recover(this, re);
|
|
} else {
|
|
throw re;
|
|
}
|
|
}
|
|
finally {
|
|
this.exitRule();
|
|
}
|
|
return localContext;
|
|
}
|
|
|
|
public static readonly _serializedATN: number[] = [
|
|
4,1,24,87,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,
|
|
6,2,7,7,7,2,8,7,8,2,9,7,9,1,0,1,0,3,0,23,8,0,1,0,1,0,1,0,1,0,1,0,
|
|
1,0,5,0,31,8,0,10,0,12,0,34,9,0,1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,2,
|
|
1,2,1,2,1,2,1,2,1,3,1,3,1,3,1,3,1,4,1,4,1,5,1,5,1,5,1,5,1,5,1,5,
|
|
1,5,1,5,1,5,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,3,6,74,8,
|
|
6,1,6,1,6,1,6,1,6,1,6,1,7,1,7,1,8,1,8,1,9,1,9,1,9,0,0,10,0,2,4,6,
|
|
8,10,12,14,16,18,0,2,1,0,6,7,1,0,12,14,81,0,20,1,0,0,0,2,38,1,0,
|
|
0,0,4,42,1,0,0,0,6,47,1,0,0,0,8,51,1,0,0,0,10,53,1,0,0,0,12,62,1,
|
|
0,0,0,14,80,1,0,0,0,16,82,1,0,0,0,18,84,1,0,0,0,20,22,5,1,0,0,21,
|
|
23,5,2,0,0,22,21,1,0,0,0,22,23,1,0,0,0,23,24,1,0,0,0,24,25,5,3,0,
|
|
0,25,26,5,19,0,0,26,32,5,16,0,0,27,31,3,2,1,0,28,31,3,6,3,0,29,31,
|
|
3,4,2,0,30,27,1,0,0,0,30,28,1,0,0,0,30,29,1,0,0,0,31,34,1,0,0,0,
|
|
32,30,1,0,0,0,32,33,1,0,0,0,33,35,1,0,0,0,34,32,1,0,0,0,35,36,5,
|
|
17,0,0,36,37,5,0,0,1,37,1,1,0,0,0,38,39,5,4,0,0,39,40,5,5,0,0,40,
|
|
41,3,12,6,0,41,3,1,0,0,0,42,43,3,8,4,0,43,44,3,16,8,0,44,45,5,5,
|
|
0,0,45,46,3,10,5,0,46,5,1,0,0,0,47,48,5,15,0,0,48,49,3,18,9,0,49,
|
|
50,5,18,0,0,50,7,1,0,0,0,51,52,7,0,0,0,52,9,1,0,0,0,53,54,5,16,0,
|
|
0,54,55,5,8,0,0,55,56,3,18,9,0,56,57,5,18,0,0,57,58,5,9,0,0,58,59,
|
|
3,18,9,0,59,60,5,18,0,0,60,61,5,17,0,0,61,11,1,0,0,0,62,63,5,16,
|
|
0,0,63,64,5,8,0,0,64,65,3,18,9,0,65,73,5,18,0,0,66,67,5,10,0,0,67,
|
|
68,3,14,7,0,68,69,5,18,0,0,69,70,5,11,0,0,70,71,3,18,9,0,71,72,5,
|
|
18,0,0,72,74,1,0,0,0,73,66,1,0,0,0,73,74,1,0,0,0,74,75,1,0,0,0,75,
|
|
76,5,9,0,0,76,77,3,18,9,0,77,78,5,18,0,0,78,79,5,17,0,0,79,13,1,
|
|
0,0,0,80,81,7,1,0,0,81,15,1,0,0,0,82,83,5,20,0,0,83,17,1,0,0,0,84,
|
|
85,5,21,0,0,85,19,1,0,0,0,4,22,30,32,73
|
|
];
|
|
|
|
private static __ATN: antlr.ATN;
|
|
public static get _ATN(): antlr.ATN {
|
|
if (!QuixosLockParser.__ATN) {
|
|
QuixosLockParser.__ATN = new antlr.ATNDeserializer().deserialize(QuixosLockParser._serializedATN);
|
|
}
|
|
|
|
return QuixosLockParser.__ATN;
|
|
}
|
|
|
|
|
|
private static readonly vocabulary = new antlr.Vocabulary(QuixosLockParser.literalNames, QuixosLockParser.symbolicNames, []);
|
|
|
|
public override get vocabulary(): antlr.Vocabulary {
|
|
return QuixosLockParser.vocabulary;
|
|
}
|
|
|
|
private static readonly decisionsToDFA = QuixosLockParser._ATN.decisionToState.map( (ds: antlr.DecisionState, index: number) => new antlr.DFA(ds, index) );
|
|
}
|
|
|
|
export class DocumentContext extends antlr.ParserRuleContext {
|
|
public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) {
|
|
super(parent, invokingState);
|
|
}
|
|
public QUIXOS_LOCK(): antlr.TerminalNode {
|
|
return this.getToken(QuixosLockParser.QUIXOS_LOCK, 0)!;
|
|
}
|
|
public VERSION(): antlr.TerminalNode {
|
|
return this.getToken(QuixosLockParser.VERSION, 0)!;
|
|
}
|
|
public INTEGER(): antlr.TerminalNode {
|
|
return this.getToken(QuixosLockParser.INTEGER, 0)!;
|
|
}
|
|
public LBRACE(): antlr.TerminalNode {
|
|
return this.getToken(QuixosLockParser.LBRACE, 0)!;
|
|
}
|
|
public RBRACE(): antlr.TerminalNode {
|
|
return this.getToken(QuixosLockParser.RBRACE, 0)!;
|
|
}
|
|
public EOF(): antlr.TerminalNode {
|
|
return this.getToken(QuixosLockParser.EOF, 0)!;
|
|
}
|
|
public FRAGMENT(): antlr.TerminalNode | null {
|
|
return this.getToken(QuixosLockParser.FRAGMENT, 0);
|
|
}
|
|
public quixosEntry(): QuixosEntryContext[];
|
|
public quixosEntry(i: number): QuixosEntryContext | null;
|
|
public quixosEntry(i?: number): QuixosEntryContext[] | QuixosEntryContext | null {
|
|
if (i === undefined) {
|
|
return this.getRuleContexts(QuixosEntryContext);
|
|
}
|
|
|
|
return this.getRuleContext(i, QuixosEntryContext);
|
|
}
|
|
public importEntry(): ImportEntryContext[];
|
|
public importEntry(i: number): ImportEntryContext | null;
|
|
public importEntry(i?: number): ImportEntryContext[] | ImportEntryContext | null {
|
|
if (i === undefined) {
|
|
return this.getRuleContexts(ImportEntryContext);
|
|
}
|
|
|
|
return this.getRuleContext(i, ImportEntryContext);
|
|
}
|
|
public resourceEntry(): ResourceEntryContext[];
|
|
public resourceEntry(i: number): ResourceEntryContext | null;
|
|
public resourceEntry(i?: number): ResourceEntryContext[] | ResourceEntryContext | null {
|
|
if (i === undefined) {
|
|
return this.getRuleContexts(ResourceEntryContext);
|
|
}
|
|
|
|
return this.getRuleContext(i, ResourceEntryContext);
|
|
}
|
|
public override get ruleIndex(): number {
|
|
return QuixosLockParser.RULE_document;
|
|
}
|
|
public override accept<Result>(visitor: QuixosLockVisitor<Result>): Result | null {
|
|
if (visitor.visitDocument) {
|
|
return visitor.visitDocument(this);
|
|
} else {
|
|
return visitor.visitChildren(this);
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
export class QuixosEntryContext extends antlr.ParserRuleContext {
|
|
public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) {
|
|
super(parent, invokingState);
|
|
}
|
|
public QUIXOS(): antlr.TerminalNode {
|
|
return this.getToken(QuixosLockParser.QUIXOS, 0)!;
|
|
}
|
|
public SOURCE(): antlr.TerminalNode {
|
|
return this.getToken(QuixosLockParser.SOURCE, 0)!;
|
|
}
|
|
public quixosSourceBlock(): QuixosSourceBlockContext {
|
|
return this.getRuleContext(0, QuixosSourceBlockContext)!;
|
|
}
|
|
public override get ruleIndex(): number {
|
|
return QuixosLockParser.RULE_quixosEntry;
|
|
}
|
|
public override accept<Result>(visitor: QuixosLockVisitor<Result>): Result | null {
|
|
if (visitor.visitQuixosEntry) {
|
|
return visitor.visitQuixosEntry(this);
|
|
} else {
|
|
return visitor.visitChildren(this);
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
export class ResourceEntryContext extends antlr.ParserRuleContext {
|
|
public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) {
|
|
super(parent, invokingState);
|
|
}
|
|
public resourceKind(): ResourceKindContext {
|
|
return this.getRuleContext(0, ResourceKindContext)!;
|
|
}
|
|
public identifier(): IdentifierContext {
|
|
return this.getRuleContext(0, IdentifierContext)!;
|
|
}
|
|
public SOURCE(): antlr.TerminalNode {
|
|
return this.getToken(QuixosLockParser.SOURCE, 0)!;
|
|
}
|
|
public sourceBlock(): SourceBlockContext {
|
|
return this.getRuleContext(0, SourceBlockContext)!;
|
|
}
|
|
public override get ruleIndex(): number {
|
|
return QuixosLockParser.RULE_resourceEntry;
|
|
}
|
|
public override accept<Result>(visitor: QuixosLockVisitor<Result>): Result | null {
|
|
if (visitor.visitResourceEntry) {
|
|
return visitor.visitResourceEntry(this);
|
|
} else {
|
|
return visitor.visitChildren(this);
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
export class ImportEntryContext extends antlr.ParserRuleContext {
|
|
public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) {
|
|
super(parent, invokingState);
|
|
}
|
|
public IMPORT(): antlr.TerminalNode {
|
|
return this.getToken(QuixosLockParser.IMPORT, 0)!;
|
|
}
|
|
public stringLiteral(): StringLiteralContext {
|
|
return this.getRuleContext(0, StringLiteralContext)!;
|
|
}
|
|
public SEMI(): antlr.TerminalNode {
|
|
return this.getToken(QuixosLockParser.SEMI, 0)!;
|
|
}
|
|
public override get ruleIndex(): number {
|
|
return QuixosLockParser.RULE_importEntry;
|
|
}
|
|
public override accept<Result>(visitor: QuixosLockVisitor<Result>): Result | null {
|
|
if (visitor.visitImportEntry) {
|
|
return visitor.visitImportEntry(this);
|
|
} else {
|
|
return visitor.visitChildren(this);
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
export class ResourceKindContext extends antlr.ParserRuleContext {
|
|
public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) {
|
|
super(parent, invokingState);
|
|
}
|
|
public INTERFACE(): antlr.TerminalNode | null {
|
|
return this.getToken(QuixosLockParser.INTERFACE, 0);
|
|
}
|
|
public PACKAGE(): antlr.TerminalNode | null {
|
|
return this.getToken(QuixosLockParser.PACKAGE, 0);
|
|
}
|
|
public override get ruleIndex(): number {
|
|
return QuixosLockParser.RULE_resourceKind;
|
|
}
|
|
public override accept<Result>(visitor: QuixosLockVisitor<Result>): Result | null {
|
|
if (visitor.visitResourceKind) {
|
|
return visitor.visitResourceKind(this);
|
|
} else {
|
|
return visitor.visitChildren(this);
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
export class SourceBlockContext extends antlr.ParserRuleContext {
|
|
public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) {
|
|
super(parent, invokingState);
|
|
}
|
|
public LBRACE(): antlr.TerminalNode {
|
|
return this.getToken(QuixosLockParser.LBRACE, 0)!;
|
|
}
|
|
public REPOSITORY(): antlr.TerminalNode {
|
|
return this.getToken(QuixosLockParser.REPOSITORY, 0)!;
|
|
}
|
|
public stringLiteral(): StringLiteralContext[];
|
|
public stringLiteral(i: number): StringLiteralContext | null;
|
|
public stringLiteral(i?: number): StringLiteralContext[] | StringLiteralContext | null {
|
|
if (i === undefined) {
|
|
return this.getRuleContexts(StringLiteralContext);
|
|
}
|
|
|
|
return this.getRuleContext(i, StringLiteralContext);
|
|
}
|
|
public SEMI(): antlr.TerminalNode[];
|
|
public SEMI(i: number): antlr.TerminalNode | null;
|
|
public SEMI(i?: number): antlr.TerminalNode | null | antlr.TerminalNode[] {
|
|
if (i === undefined) {
|
|
return this.getTokens(QuixosLockParser.SEMI);
|
|
} else {
|
|
return this.getToken(QuixosLockParser.SEMI, i);
|
|
}
|
|
}
|
|
public COMMIT(): antlr.TerminalNode {
|
|
return this.getToken(QuixosLockParser.COMMIT, 0)!;
|
|
}
|
|
public RBRACE(): antlr.TerminalNode {
|
|
return this.getToken(QuixosLockParser.RBRACE, 0)!;
|
|
}
|
|
public override get ruleIndex(): number {
|
|
return QuixosLockParser.RULE_sourceBlock;
|
|
}
|
|
public override accept<Result>(visitor: QuixosLockVisitor<Result>): Result | null {
|
|
if (visitor.visitSourceBlock) {
|
|
return visitor.visitSourceBlock(this);
|
|
} else {
|
|
return visitor.visitChildren(this);
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
export class QuixosSourceBlockContext extends antlr.ParserRuleContext {
|
|
public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) {
|
|
super(parent, invokingState);
|
|
}
|
|
public LBRACE(): antlr.TerminalNode {
|
|
return this.getToken(QuixosLockParser.LBRACE, 0)!;
|
|
}
|
|
public REPOSITORY(): antlr.TerminalNode {
|
|
return this.getToken(QuixosLockParser.REPOSITORY, 0)!;
|
|
}
|
|
public stringLiteral(): StringLiteralContext[];
|
|
public stringLiteral(i: number): StringLiteralContext | null;
|
|
public stringLiteral(i?: number): StringLiteralContext[] | StringLiteralContext | null {
|
|
if (i === undefined) {
|
|
return this.getRuleContexts(StringLiteralContext);
|
|
}
|
|
|
|
return this.getRuleContext(i, StringLiteralContext);
|
|
}
|
|
public SEMI(): antlr.TerminalNode[];
|
|
public SEMI(i: number): antlr.TerminalNode | null;
|
|
public SEMI(i?: number): antlr.TerminalNode | null | antlr.TerminalNode[] {
|
|
if (i === undefined) {
|
|
return this.getTokens(QuixosLockParser.SEMI);
|
|
} else {
|
|
return this.getToken(QuixosLockParser.SEMI, i);
|
|
}
|
|
}
|
|
public COMMIT(): antlr.TerminalNode {
|
|
return this.getToken(QuixosLockParser.COMMIT, 0)!;
|
|
}
|
|
public RBRACE(): antlr.TerminalNode {
|
|
return this.getToken(QuixosLockParser.RBRACE, 0)!;
|
|
}
|
|
public POLICY(): antlr.TerminalNode | null {
|
|
return this.getToken(QuixosLockParser.POLICY, 0);
|
|
}
|
|
public sourcePolicy(): SourcePolicyContext | null {
|
|
return this.getRuleContext(0, SourcePolicyContext);
|
|
}
|
|
public REF(): antlr.TerminalNode | null {
|
|
return this.getToken(QuixosLockParser.REF, 0);
|
|
}
|
|
public override get ruleIndex(): number {
|
|
return QuixosLockParser.RULE_quixosSourceBlock;
|
|
}
|
|
public override accept<Result>(visitor: QuixosLockVisitor<Result>): Result | null {
|
|
if (visitor.visitQuixosSourceBlock) {
|
|
return visitor.visitQuixosSourceBlock(this);
|
|
} else {
|
|
return visitor.visitChildren(this);
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
export class SourcePolicyContext extends antlr.ParserRuleContext {
|
|
public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) {
|
|
super(parent, invokingState);
|
|
}
|
|
public PINNED(): antlr.TerminalNode | null {
|
|
return this.getToken(QuixosLockParser.PINNED, 0);
|
|
}
|
|
public TRACK_RELEASE(): antlr.TerminalNode | null {
|
|
return this.getToken(QuixosLockParser.TRACK_RELEASE, 0);
|
|
}
|
|
public TRACK_DEVELOPMENT(): antlr.TerminalNode | null {
|
|
return this.getToken(QuixosLockParser.TRACK_DEVELOPMENT, 0);
|
|
}
|
|
public override get ruleIndex(): number {
|
|
return QuixosLockParser.RULE_sourcePolicy;
|
|
}
|
|
public override accept<Result>(visitor: QuixosLockVisitor<Result>): Result | null {
|
|
if (visitor.visitSourcePolicy) {
|
|
return visitor.visitSourcePolicy(this);
|
|
} else {
|
|
return visitor.visitChildren(this);
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
export class IdentifierContext extends antlr.ParserRuleContext {
|
|
public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) {
|
|
super(parent, invokingState);
|
|
}
|
|
public IDENTIFIER(): antlr.TerminalNode {
|
|
return this.getToken(QuixosLockParser.IDENTIFIER, 0)!;
|
|
}
|
|
public override get ruleIndex(): number {
|
|
return QuixosLockParser.RULE_identifier;
|
|
}
|
|
public override accept<Result>(visitor: QuixosLockVisitor<Result>): Result | null {
|
|
if (visitor.visitIdentifier) {
|
|
return visitor.visitIdentifier(this);
|
|
} else {
|
|
return visitor.visitChildren(this);
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
export class StringLiteralContext extends antlr.ParserRuleContext {
|
|
public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) {
|
|
super(parent, invokingState);
|
|
}
|
|
public STRING_LITERAL(): antlr.TerminalNode {
|
|
return this.getToken(QuixosLockParser.STRING_LITERAL, 0)!;
|
|
}
|
|
public override get ruleIndex(): number {
|
|
return QuixosLockParser.RULE_stringLiteral;
|
|
}
|
|
public override accept<Result>(visitor: QuixosLockVisitor<Result>): Result | null {
|
|
if (visitor.visitStringLiteral) {
|
|
return visitor.visitStringLiteral(this);
|
|
} else {
|
|
return visitor.visitChildren(this);
|
|
}
|
|
}
|
|
}
|