From 2459064b0ca85c5fb19cc2a83cc2110be6da4a06 Mon Sep 17 00:00:00 2001 From: Dominik Holland Date: Wed, 13 Apr 2022 10:59:54 +0200 Subject: [PATCH] Add support for antlr 4.10 The SERIALIZED_VERSION has changed and our existing Lexer can't be used anymore. Depending on the SERIALIZED_VERSION of the installed antlr4-python3-runtime a new Lexer is now used. --- qface/generator.py | 12 +- qface/idl/listener.py | 10 +- qface/idl/parser/T4.interp | 120 ++ qface/idl/parser/T4.tokens | 69 + qface/idl/parser/T4Lexer.interp | 141 ++ qface/idl/parser/T4Lexer.py | 218 +++ qface/idl/parser/T4Lexer.tokens | 69 + qface/idl/parser/T4Listener.py | 255 ++++ qface/idl/parser/T4Parser.py | 2243 +++++++++++++++++++++++++++++++ 9 files changed, 3132 insertions(+), 5 deletions(-) create mode 100644 qface/idl/parser/T4.interp create mode 100644 qface/idl/parser/T4.tokens create mode 100644 qface/idl/parser/T4Lexer.interp create mode 100644 qface/idl/parser/T4Lexer.py create mode 100644 qface/idl/parser/T4Lexer.tokens create mode 100644 qface/idl/parser/T4Listener.py create mode 100644 qface/idl/parser/T4Parser.py diff --git a/qface/generator.py b/qface/generator.py index 0bb86aa..d8e987f 100644 --- a/qface/generator.py +++ b/qface/generator.py @@ -15,9 +15,15 @@ import sys import os -from .idl.parser.TLexer import TLexer -from .idl.parser.TParser import TParser -from .idl.parser.TListener import TListener +import antlr4.atn.ATNDeserializer +if (antlr4.atn.ATNDeserializer.SERIALIZED_VERSION == 3): + from .idl.parser.TLexer import TLexer + from .idl.parser.TParser import TParser + from .idl.parser.TListener import TListener +elif (antlr4.atn.ATNDeserializer.SERIALIZED_VERSION == 4): + from .idl.parser.T4Lexer import T4Lexer as TLexer + from .idl.parser.T4Parser import T4Parser as TParser + from .idl.parser.T4Listener import T4Listener as TListener from .idl.profile import EProfile from .idl.domain import System from .idl.listener import DomainListener diff --git a/qface/idl/listener.py b/qface/idl/listener.py index 4ed7af4..db891f9 100644 --- a/qface/idl/listener.py +++ b/qface/idl/listener.py @@ -1,8 +1,14 @@ # Copyright (c) Pelagicore AB 2016 import logging -from .parser.TListener import TListener -from .parser.TParser import TParser +import antlr4.atn.ATNDeserializer +if (antlr4.atn.ATNDeserializer.SERIALIZED_VERSION == 3): + from .parser.TListener import TListener + from .parser.TParser import TParser +elif (antlr4.atn.ATNDeserializer.SERIALIZED_VERSION == 4): + from .parser.T4Listener import T4Listener as TListener + from .parser.T4Parser import T4Parser as TParser + from .domain import * from antlr4 import ParserRuleContext import yaml diff --git a/qface/idl/parser/T4.interp b/qface/idl/parser/T4.interp new file mode 100644 index 0000000..e943af1 --- /dev/null +++ b/qface/idl/parser/T4.interp @@ -0,0 +1,120 @@ +token literal names: +null +'import' +';' +'module' +'interface' +'extends' +'{' +'}' +'void' +'(' +')' +'const' +'signal' +'=' +'readonly' +',' +'bool' +'int' +'real' +'string' +'var' +'list' +'<' +'>' +'map' +'model' +'struct' +'enum' +'flag' +null +null +null +null +null +null +null +null +null +null +null +null +null + +token symbolic names: +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +STRING +DOUBLE_STRING +SINGLE_STRING +TAGLINE +INTCONSTANT +HEXCONSTANT +TAGIDENTIFIER +IDENTIFIER +VERSION +DOCCOMMENT +WHITESPACE +COMMENT +MULTICOMM + +rule names: +documentSymbol +headerSymbol +importSymbol +moduleSymbol +definitionSymbol +interfaceSymbol +interfaceMemberSymbol +operationSymbol +operationModifierSymbol +signalSymbol +propertySymbol +propertyModifierSymbol +operationParameterSymbol +tagSymbol +tagAttributeSymbol +typeSymbol +complexTypeSymbol +primitiveTypeSymbol +listTypeSymbol +mapTypeSymbol +modelTypeSymbol +structSymbol +structFieldSymbol +enumSymbol +enumTypeSymbol +enumMemberSymbol +intSymbol + + +atn: +[4, 1, 41, 336, 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, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 1, 0, 1, 0, 5, 0, 57, 8, 0, 10, 0, 12, 0, 60, 9, 0, 1, 1, 1, 1, 5, 1, 64, 8, 1, 10, 1, 12, 1, 67, 9, 1, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 73, 8, 2, 1, 3, 3, 3, 76, 8, 3, 1, 3, 5, 3, 79, 8, 3, 10, 3, 12, 3, 82, 9, 3, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 88, 8, 3, 1, 4, 1, 4, 1, 4, 3, 4, 93, 8, 4, 1, 5, 3, 5, 96, 8, 5, 1, 5, 5, 5, 99, 8, 5, 10, 5, 12, 5, 102, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 108, 8, 5, 1, 5, 1, 5, 5, 5, 112, 8, 5, 10, 5, 12, 5, 115, 9, 5, 1, 5, 1, 5, 3, 5, 119, 8, 5, 1, 6, 1, 6, 1, 6, 3, 6, 124, 8, 6, 1, 7, 3, 7, 127, 8, 7, 1, 7, 5, 7, 130, 8, 7, 10, 7, 12, 7, 133, 9, 7, 1, 7, 1, 7, 3, 7, 137, 8, 7, 1, 7, 1, 7, 1, 7, 5, 7, 142, 8, 7, 10, 7, 12, 7, 145, 9, 7, 1, 7, 1, 7, 3, 7, 149, 8, 7, 1, 7, 3, 7, 152, 8, 7, 1, 8, 1, 8, 1, 9, 3, 9, 157, 8, 9, 1, 9, 5, 9, 160, 8, 9, 10, 9, 12, 9, 163, 9, 9, 1, 9, 1, 9, 1, 9, 1, 9, 5, 9, 169, 8, 9, 10, 9, 12, 9, 172, 9, 9, 1, 9, 1, 9, 3, 9, 176, 8, 9, 1, 10, 3, 10, 179, 8, 10, 1, 10, 5, 10, 182, 8, 10, 10, 10, 12, 10, 185, 9, 10, 1, 10, 3, 10, 188, 8, 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 194, 8, 10, 1, 10, 3, 10, 197, 8, 10, 1, 11, 1, 11, 3, 11, 201, 8, 11, 1, 12, 1, 12, 1, 12, 3, 12, 206, 8, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 3, 14, 213, 8, 14, 1, 14, 3, 14, 216, 8, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 3, 15, 223, 8, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 232, 8, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 3, 21, 250, 8, 21, 1, 21, 5, 21, 253, 8, 21, 10, 21, 12, 21, 256, 9, 21, 1, 21, 1, 21, 1, 21, 1, 21, 5, 21, 262, 8, 21, 10, 21, 12, 21, 265, 9, 21, 1, 21, 1, 21, 3, 21, 269, 8, 21, 1, 22, 3, 22, 272, 8, 22, 1, 22, 5, 22, 275, 8, 22, 10, 22, 12, 22, 278, 9, 22, 1, 22, 1, 22, 1, 22, 1, 22, 3, 22, 284, 8, 22, 1, 22, 3, 22, 287, 8, 22, 1, 23, 3, 23, 290, 8, 23, 1, 23, 5, 23, 293, 8, 23, 10, 23, 12, 23, 296, 9, 23, 1, 23, 1, 23, 1, 23, 1, 23, 5, 23, 302, 8, 23, 10, 23, 12, 23, 305, 9, 23, 1, 23, 1, 23, 3, 23, 309, 8, 23, 1, 24, 1, 24, 3, 24, 313, 8, 24, 1, 25, 3, 25, 316, 8, 25, 1, 25, 5, 25, 319, 8, 25, 10, 25, 12, 25, 322, 9, 25, 1, 25, 1, 25, 1, 25, 3, 25, 327, 8, 25, 1, 25, 3, 25, 330, 8, 25, 1, 26, 1, 26, 3, 26, 334, 8, 26, 1, 26, 0, 0, 27, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 0, 0, 368, 0, 54, 1, 0, 0, 0, 2, 61, 1, 0, 0, 0, 4, 68, 1, 0, 0, 0, 6, 75, 1, 0, 0, 0, 8, 92, 1, 0, 0, 0, 10, 95, 1, 0, 0, 0, 12, 123, 1, 0, 0, 0, 14, 126, 1, 0, 0, 0, 16, 153, 1, 0, 0, 0, 18, 156, 1, 0, 0, 0, 20, 178, 1, 0, 0, 0, 22, 200, 1, 0, 0, 0, 24, 202, 1, 0, 0, 0, 26, 207, 1, 0, 0, 0, 28, 209, 1, 0, 0, 0, 30, 222, 1, 0, 0, 0, 32, 224, 1, 0, 0, 0, 34, 231, 1, 0, 0, 0, 36, 233, 1, 0, 0, 0, 38, 238, 1, 0, 0, 0, 40, 243, 1, 0, 0, 0, 42, 249, 1, 0, 0, 0, 44, 271, 1, 0, 0, 0, 46, 289, 1, 0, 0, 0, 48, 312, 1, 0, 0, 0, 50, 315, 1, 0, 0, 0, 52, 333, 1, 0, 0, 0, 54, 58, 3, 2, 1, 0, 55, 57, 3, 8, 4, 0, 56, 55, 1, 0, 0, 0, 57, 60, 1, 0, 0, 0, 58, 56, 1, 0, 0, 0, 58, 59, 1, 0, 0, 0, 59, 1, 1, 0, 0, 0, 60, 58, 1, 0, 0, 0, 61, 65, 3, 6, 3, 0, 62, 64, 3, 4, 2, 0, 63, 62, 1, 0, 0, 0, 64, 67, 1, 0, 0, 0, 65, 63, 1, 0, 0, 0, 65, 66, 1, 0, 0, 0, 66, 3, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 68, 69, 5, 1, 0, 0, 69, 70, 5, 36, 0, 0, 70, 72, 5, 37, 0, 0, 71, 73, 5, 2, 0, 0, 72, 71, 1, 0, 0, 0, 72, 73, 1, 0, 0, 0, 73, 5, 1, 0, 0, 0, 74, 76, 5, 38, 0, 0, 75, 74, 1, 0, 0, 0, 75, 76, 1, 0, 0, 0, 76, 80, 1, 0, 0, 0, 77, 79, 3, 26, 13, 0, 78, 77, 1, 0, 0, 0, 79, 82, 1, 0, 0, 0, 80, 78, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 83, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 83, 84, 5, 3, 0, 0, 84, 85, 5, 36, 0, 0, 85, 87, 5, 37, 0, 0, 86, 88, 5, 2, 0, 0, 87, 86, 1, 0, 0, 0, 87, 88, 1, 0, 0, 0, 88, 7, 1, 0, 0, 0, 89, 93, 3, 10, 5, 0, 90, 93, 3, 42, 21, 0, 91, 93, 3, 46, 23, 0, 92, 89, 1, 0, 0, 0, 92, 90, 1, 0, 0, 0, 92, 91, 1, 0, 0, 0, 93, 9, 1, 0, 0, 0, 94, 96, 5, 38, 0, 0, 95, 94, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 100, 1, 0, 0, 0, 97, 99, 3, 26, 13, 0, 98, 97, 1, 0, 0, 0, 99, 102, 1, 0, 0, 0, 100, 98, 1, 0, 0, 0, 100, 101, 1, 0, 0, 0, 101, 103, 1, 0, 0, 0, 102, 100, 1, 0, 0, 0, 103, 104, 5, 4, 0, 0, 104, 107, 5, 36, 0, 0, 105, 106, 5, 5, 0, 0, 106, 108, 5, 36, 0, 0, 107, 105, 1, 0, 0, 0, 107, 108, 1, 0, 0, 0, 108, 109, 1, 0, 0, 0, 109, 113, 5, 6, 0, 0, 110, 112, 3, 12, 6, 0, 111, 110, 1, 0, 0, 0, 112, 115, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 113, 114, 1, 0, 0, 0, 114, 116, 1, 0, 0, 0, 115, 113, 1, 0, 0, 0, 116, 118, 5, 7, 0, 0, 117, 119, 5, 2, 0, 0, 118, 117, 1, 0, 0, 0, 118, 119, 1, 0, 0, 0, 119, 11, 1, 0, 0, 0, 120, 124, 3, 14, 7, 0, 121, 124, 3, 20, 10, 0, 122, 124, 3, 18, 9, 0, 123, 120, 1, 0, 0, 0, 123, 121, 1, 0, 0, 0, 123, 122, 1, 0, 0, 0, 124, 13, 1, 0, 0, 0, 125, 127, 5, 38, 0, 0, 126, 125, 1, 0, 0, 0, 126, 127, 1, 0, 0, 0, 127, 131, 1, 0, 0, 0, 128, 130, 3, 26, 13, 0, 129, 128, 1, 0, 0, 0, 130, 133, 1, 0, 0, 0, 131, 129, 1, 0, 0, 0, 131, 132, 1, 0, 0, 0, 132, 136, 1, 0, 0, 0, 133, 131, 1, 0, 0, 0, 134, 137, 3, 30, 15, 0, 135, 137, 5, 8, 0, 0, 136, 134, 1, 0, 0, 0, 136, 135, 1, 0, 0, 0, 137, 138, 1, 0, 0, 0, 138, 139, 5, 36, 0, 0, 139, 143, 5, 9, 0, 0, 140, 142, 3, 24, 12, 0, 141, 140, 1, 0, 0, 0, 142, 145, 1, 0, 0, 0, 143, 141, 1, 0, 0, 0, 143, 144, 1, 0, 0, 0, 144, 146, 1, 0, 0, 0, 145, 143, 1, 0, 0, 0, 146, 148, 5, 10, 0, 0, 147, 149, 3, 16, 8, 0, 148, 147, 1, 0, 0, 0, 148, 149, 1, 0, 0, 0, 149, 151, 1, 0, 0, 0, 150, 152, 5, 2, 0, 0, 151, 150, 1, 0, 0, 0, 151, 152, 1, 0, 0, 0, 152, 15, 1, 0, 0, 0, 153, 154, 5, 11, 0, 0, 154, 17, 1, 0, 0, 0, 155, 157, 5, 38, 0, 0, 156, 155, 1, 0, 0, 0, 156, 157, 1, 0, 0, 0, 157, 161, 1, 0, 0, 0, 158, 160, 3, 26, 13, 0, 159, 158, 1, 0, 0, 0, 160, 163, 1, 0, 0, 0, 161, 159, 1, 0, 0, 0, 161, 162, 1, 0, 0, 0, 162, 164, 1, 0, 0, 0, 163, 161, 1, 0, 0, 0, 164, 165, 5, 12, 0, 0, 165, 166, 5, 36, 0, 0, 166, 170, 5, 9, 0, 0, 167, 169, 3, 24, 12, 0, 168, 167, 1, 0, 0, 0, 169, 172, 1, 0, 0, 0, 170, 168, 1, 0, 0, 0, 170, 171, 1, 0, 0, 0, 171, 173, 1, 0, 0, 0, 172, 170, 1, 0, 0, 0, 173, 175, 5, 10, 0, 0, 174, 176, 5, 2, 0, 0, 175, 174, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 19, 1, 0, 0, 0, 177, 179, 5, 38, 0, 0, 178, 177, 1, 0, 0, 0, 178, 179, 1, 0, 0, 0, 179, 183, 1, 0, 0, 0, 180, 182, 3, 26, 13, 0, 181, 180, 1, 0, 0, 0, 182, 185, 1, 0, 0, 0, 183, 181, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 187, 1, 0, 0, 0, 185, 183, 1, 0, 0, 0, 186, 188, 3, 22, 11, 0, 187, 186, 1, 0, 0, 0, 187, 188, 1, 0, 0, 0, 188, 189, 1, 0, 0, 0, 189, 190, 3, 30, 15, 0, 190, 193, 5, 36, 0, 0, 191, 192, 5, 13, 0, 0, 192, 194, 5, 29, 0, 0, 193, 191, 1, 0, 0, 0, 193, 194, 1, 0, 0, 0, 194, 196, 1, 0, 0, 0, 195, 197, 5, 2, 0, 0, 196, 195, 1, 0, 0, 0, 196, 197, 1, 0, 0, 0, 197, 21, 1, 0, 0, 0, 198, 201, 5, 14, 0, 0, 199, 201, 5, 11, 0, 0, 200, 198, 1, 0, 0, 0, 200, 199, 1, 0, 0, 0, 201, 23, 1, 0, 0, 0, 202, 203, 3, 30, 15, 0, 203, 205, 5, 36, 0, 0, 204, 206, 5, 15, 0, 0, 205, 204, 1, 0, 0, 0, 205, 206, 1, 0, 0, 0, 206, 25, 1, 0, 0, 0, 207, 208, 5, 32, 0, 0, 208, 27, 1, 0, 0, 0, 209, 212, 5, 36, 0, 0, 210, 211, 5, 13, 0, 0, 211, 213, 5, 36, 0, 0, 212, 210, 1, 0, 0, 0, 212, 213, 1, 0, 0, 0, 213, 215, 1, 0, 0, 0, 214, 216, 5, 15, 0, 0, 215, 214, 1, 0, 0, 0, 215, 216, 1, 0, 0, 0, 216, 29, 1, 0, 0, 0, 217, 223, 3, 34, 17, 0, 218, 223, 3, 32, 16, 0, 219, 223, 3, 36, 18, 0, 220, 223, 3, 38, 19, 0, 221, 223, 3, 40, 20, 0, 222, 217, 1, 0, 0, 0, 222, 218, 1, 0, 0, 0, 222, 219, 1, 0, 0, 0, 222, 220, 1, 0, 0, 0, 222, 221, 1, 0, 0, 0, 223, 31, 1, 0, 0, 0, 224, 225, 5, 36, 0, 0, 225, 33, 1, 0, 0, 0, 226, 232, 5, 16, 0, 0, 227, 232, 5, 17, 0, 0, 228, 232, 5, 18, 0, 0, 229, 232, 5, 19, 0, 0, 230, 232, 5, 20, 0, 0, 231, 226, 1, 0, 0, 0, 231, 227, 1, 0, 0, 0, 231, 228, 1, 0, 0, 0, 231, 229, 1, 0, 0, 0, 231, 230, 1, 0, 0, 0, 232, 35, 1, 0, 0, 0, 233, 234, 5, 21, 0, 0, 234, 235, 5, 22, 0, 0, 235, 236, 3, 30, 15, 0, 236, 237, 5, 23, 0, 0, 237, 37, 1, 0, 0, 0, 238, 239, 5, 24, 0, 0, 239, 240, 5, 22, 0, 0, 240, 241, 3, 30, 15, 0, 241, 242, 5, 23, 0, 0, 242, 39, 1, 0, 0, 0, 243, 244, 5, 25, 0, 0, 244, 245, 5, 22, 0, 0, 245, 246, 3, 30, 15, 0, 246, 247, 5, 23, 0, 0, 247, 41, 1, 0, 0, 0, 248, 250, 5, 38, 0, 0, 249, 248, 1, 0, 0, 0, 249, 250, 1, 0, 0, 0, 250, 254, 1, 0, 0, 0, 251, 253, 3, 26, 13, 0, 252, 251, 1, 0, 0, 0, 253, 256, 1, 0, 0, 0, 254, 252, 1, 0, 0, 0, 254, 255, 1, 0, 0, 0, 255, 257, 1, 0, 0, 0, 256, 254, 1, 0, 0, 0, 257, 258, 5, 26, 0, 0, 258, 259, 5, 36, 0, 0, 259, 263, 5, 6, 0, 0, 260, 262, 3, 44, 22, 0, 261, 260, 1, 0, 0, 0, 262, 265, 1, 0, 0, 0, 263, 261, 1, 0, 0, 0, 263, 264, 1, 0, 0, 0, 264, 266, 1, 0, 0, 0, 265, 263, 1, 0, 0, 0, 266, 268, 5, 7, 0, 0, 267, 269, 5, 2, 0, 0, 268, 267, 1, 0, 0, 0, 268, 269, 1, 0, 0, 0, 269, 43, 1, 0, 0, 0, 270, 272, 5, 38, 0, 0, 271, 270, 1, 0, 0, 0, 271, 272, 1, 0, 0, 0, 272, 276, 1, 0, 0, 0, 273, 275, 3, 26, 13, 0, 274, 273, 1, 0, 0, 0, 275, 278, 1, 0, 0, 0, 276, 274, 1, 0, 0, 0, 276, 277, 1, 0, 0, 0, 277, 279, 1, 0, 0, 0, 278, 276, 1, 0, 0, 0, 279, 280, 3, 30, 15, 0, 280, 283, 5, 36, 0, 0, 281, 282, 5, 13, 0, 0, 282, 284, 5, 29, 0, 0, 283, 281, 1, 0, 0, 0, 283, 284, 1, 0, 0, 0, 284, 286, 1, 0, 0, 0, 285, 287, 5, 2, 0, 0, 286, 285, 1, 0, 0, 0, 286, 287, 1, 0, 0, 0, 287, 45, 1, 0, 0, 0, 288, 290, 5, 38, 0, 0, 289, 288, 1, 0, 0, 0, 289, 290, 1, 0, 0, 0, 290, 294, 1, 0, 0, 0, 291, 293, 3, 26, 13, 0, 292, 291, 1, 0, 0, 0, 293, 296, 1, 0, 0, 0, 294, 292, 1, 0, 0, 0, 294, 295, 1, 0, 0, 0, 295, 297, 1, 0, 0, 0, 296, 294, 1, 0, 0, 0, 297, 298, 3, 48, 24, 0, 298, 299, 5, 36, 0, 0, 299, 303, 5, 6, 0, 0, 300, 302, 3, 50, 25, 0, 301, 300, 1, 0, 0, 0, 302, 305, 1, 0, 0, 0, 303, 301, 1, 0, 0, 0, 303, 304, 1, 0, 0, 0, 304, 306, 1, 0, 0, 0, 305, 303, 1, 0, 0, 0, 306, 308, 5, 7, 0, 0, 307, 309, 5, 2, 0, 0, 308, 307, 1, 0, 0, 0, 308, 309, 1, 0, 0, 0, 309, 47, 1, 0, 0, 0, 310, 313, 5, 27, 0, 0, 311, 313, 5, 28, 0, 0, 312, 310, 1, 0, 0, 0, 312, 311, 1, 0, 0, 0, 313, 49, 1, 0, 0, 0, 314, 316, 5, 38, 0, 0, 315, 314, 1, 0, 0, 0, 315, 316, 1, 0, 0, 0, 316, 320, 1, 0, 0, 0, 317, 319, 3, 26, 13, 0, 318, 317, 1, 0, 0, 0, 319, 322, 1, 0, 0, 0, 320, 318, 1, 0, 0, 0, 320, 321, 1, 0, 0, 0, 321, 323, 1, 0, 0, 0, 322, 320, 1, 0, 0, 0, 323, 326, 5, 36, 0, 0, 324, 325, 5, 13, 0, 0, 325, 327, 3, 52, 26, 0, 326, 324, 1, 0, 0, 0, 326, 327, 1, 0, 0, 0, 327, 329, 1, 0, 0, 0, 328, 330, 5, 15, 0, 0, 329, 328, 1, 0, 0, 0, 329, 330, 1, 0, 0, 0, 330, 51, 1, 0, 0, 0, 331, 334, 5, 33, 0, 0, 332, 334, 5, 34, 0, 0, 333, 331, 1, 0, 0, 0, 333, 332, 1, 0, 0, 0, 334, 53, 1, 0, 0, 0, 52, 58, 65, 72, 75, 80, 87, 92, 95, 100, 107, 113, 118, 123, 126, 131, 136, 143, 148, 151, 156, 161, 170, 175, 178, 183, 187, 193, 196, 200, 205, 212, 215, 222, 231, 249, 254, 263, 268, 271, 276, 283, 286, 289, 294, 303, 308, 312, 315, 320, 326, 329, 333] \ No newline at end of file diff --git a/qface/idl/parser/T4.tokens b/qface/idl/parser/T4.tokens new file mode 100644 index 0000000..5daf716 --- /dev/null +++ b/qface/idl/parser/T4.tokens @@ -0,0 +1,69 @@ +T__0=1 +T__1=2 +T__2=3 +T__3=4 +T__4=5 +T__5=6 +T__6=7 +T__7=8 +T__8=9 +T__9=10 +T__10=11 +T__11=12 +T__12=13 +T__13=14 +T__14=15 +T__15=16 +T__16=17 +T__17=18 +T__18=19 +T__19=20 +T__20=21 +T__21=22 +T__22=23 +T__23=24 +T__24=25 +T__25=26 +T__26=27 +T__27=28 +STRING=29 +DOUBLE_STRING=30 +SINGLE_STRING=31 +TAGLINE=32 +INTCONSTANT=33 +HEXCONSTANT=34 +TAGIDENTIFIER=35 +IDENTIFIER=36 +VERSION=37 +DOCCOMMENT=38 +WHITESPACE=39 +COMMENT=40 +MULTICOMM=41 +'import'=1 +';'=2 +'module'=3 +'interface'=4 +'extends'=5 +'{'=6 +'}'=7 +'void'=8 +'('=9 +')'=10 +'const'=11 +'signal'=12 +'='=13 +'readonly'=14 +','=15 +'bool'=16 +'int'=17 +'real'=18 +'string'=19 +'var'=20 +'list'=21 +'<'=22 +'>'=23 +'map'=24 +'model'=25 +'struct'=26 +'enum'=27 +'flag'=28 diff --git a/qface/idl/parser/T4Lexer.interp b/qface/idl/parser/T4Lexer.interp new file mode 100644 index 0000000..8707a62 --- /dev/null +++ b/qface/idl/parser/T4Lexer.interp @@ -0,0 +1,141 @@ +token literal names: +null +'import' +';' +'module' +'interface' +'extends' +'{' +'}' +'void' +'(' +')' +'const' +'signal' +'=' +'readonly' +',' +'bool' +'int' +'real' +'string' +'var' +'list' +'<' +'>' +'map' +'model' +'struct' +'enum' +'flag' +null +null +null +null +null +null +null +null +null +null +null +null +null + +token symbolic names: +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +STRING +DOUBLE_STRING +SINGLE_STRING +TAGLINE +INTCONSTANT +HEXCONSTANT +TAGIDENTIFIER +IDENTIFIER +VERSION +DOCCOMMENT +WHITESPACE +COMMENT +MULTICOMM + +rule names: +T__0 +T__1 +T__2 +T__3 +T__4 +T__5 +T__6 +T__7 +T__8 +T__9 +T__10 +T__11 +T__12 +T__13 +T__14 +T__15 +T__16 +T__17 +T__18 +T__19 +T__20 +T__21 +T__22 +T__23 +T__24 +T__25 +T__26 +T__27 +STRING +DOUBLE_STRING +SINGLE_STRING +TAGLINE +INTCONSTANT +HEXCONSTANT +TAGIDENTIFIER +IDENTIFIER +VERSION +DOCCOMMENT +WHITESPACE +COMMENT +MULTICOMM +ESC + +channel names: +DEFAULT_TOKEN_CHANNEL +HIDDEN + +mode names: +DEFAULT_MODE + +atn: +[4, 0, 41, 333, 6, -1, 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, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 3, 28, 222, 8, 28, 1, 29, 1, 29, 1, 29, 5, 29, 227, 8, 29, 10, 29, 12, 29, 230, 9, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 5, 30, 237, 8, 30, 10, 30, 12, 30, 240, 9, 30, 1, 30, 1, 30, 1, 31, 1, 31, 5, 31, 246, 8, 31, 10, 31, 12, 31, 249, 9, 31, 1, 32, 3, 32, 252, 8, 32, 1, 32, 4, 32, 255, 8, 32, 11, 32, 12, 32, 256, 1, 33, 1, 33, 1, 33, 1, 33, 4, 33, 263, 8, 33, 11, 33, 12, 33, 264, 1, 34, 1, 34, 1, 34, 5, 34, 270, 8, 34, 10, 34, 12, 34, 273, 9, 34, 1, 35, 1, 35, 5, 35, 277, 8, 35, 10, 35, 12, 35, 280, 9, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 5, 37, 291, 8, 37, 10, 37, 12, 37, 294, 9, 37, 1, 37, 1, 37, 1, 37, 1, 38, 4, 38, 300, 8, 38, 11, 38, 12, 38, 301, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 39, 5, 39, 310, 8, 39, 10, 39, 12, 39, 313, 9, 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 5, 40, 321, 8, 40, 10, 40, 12, 40, 324, 9, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 2, 292, 322, 0, 42, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 0, 1, 0, 10, 2, 0, 34, 34, 92, 92, 2, 0, 39, 39, 92, 92, 2, 0, 10, 10, 13, 13, 2, 0, 43, 43, 45, 45, 3, 0, 48, 57, 65, 70, 97, 102, 3, 0, 65, 90, 95, 95, 97, 122, 5, 0, 46, 46, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 3, 0, 9, 10, 13, 13, 32, 32, 8, 0, 34, 34, 47, 47, 92, 92, 98, 98, 102, 102, 110, 110, 114, 114, 116, 116, 346, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 1, 85, 1, 0, 0, 0, 3, 92, 1, 0, 0, 0, 5, 94, 1, 0, 0, 0, 7, 101, 1, 0, 0, 0, 9, 111, 1, 0, 0, 0, 11, 119, 1, 0, 0, 0, 13, 121, 1, 0, 0, 0, 15, 123, 1, 0, 0, 0, 17, 128, 1, 0, 0, 0, 19, 130, 1, 0, 0, 0, 21, 132, 1, 0, 0, 0, 23, 138, 1, 0, 0, 0, 25, 145, 1, 0, 0, 0, 27, 147, 1, 0, 0, 0, 29, 156, 1, 0, 0, 0, 31, 158, 1, 0, 0, 0, 33, 163, 1, 0, 0, 0, 35, 167, 1, 0, 0, 0, 37, 172, 1, 0, 0, 0, 39, 179, 1, 0, 0, 0, 41, 183, 1, 0, 0, 0, 43, 188, 1, 0, 0, 0, 45, 190, 1, 0, 0, 0, 47, 192, 1, 0, 0, 0, 49, 196, 1, 0, 0, 0, 51, 202, 1, 0, 0, 0, 53, 209, 1, 0, 0, 0, 55, 214, 1, 0, 0, 0, 57, 221, 1, 0, 0, 0, 59, 223, 1, 0, 0, 0, 61, 233, 1, 0, 0, 0, 63, 243, 1, 0, 0, 0, 65, 251, 1, 0, 0, 0, 67, 258, 1, 0, 0, 0, 69, 266, 1, 0, 0, 0, 71, 274, 1, 0, 0, 0, 73, 281, 1, 0, 0, 0, 75, 285, 1, 0, 0, 0, 77, 299, 1, 0, 0, 0, 79, 305, 1, 0, 0, 0, 81, 316, 1, 0, 0, 0, 83, 330, 1, 0, 0, 0, 85, 86, 5, 105, 0, 0, 86, 87, 5, 109, 0, 0, 87, 88, 5, 112, 0, 0, 88, 89, 5, 111, 0, 0, 89, 90, 5, 114, 0, 0, 90, 91, 5, 116, 0, 0, 91, 2, 1, 0, 0, 0, 92, 93, 5, 59, 0, 0, 93, 4, 1, 0, 0, 0, 94, 95, 5, 109, 0, 0, 95, 96, 5, 111, 0, 0, 96, 97, 5, 100, 0, 0, 97, 98, 5, 117, 0, 0, 98, 99, 5, 108, 0, 0, 99, 100, 5, 101, 0, 0, 100, 6, 1, 0, 0, 0, 101, 102, 5, 105, 0, 0, 102, 103, 5, 110, 0, 0, 103, 104, 5, 116, 0, 0, 104, 105, 5, 101, 0, 0, 105, 106, 5, 114, 0, 0, 106, 107, 5, 102, 0, 0, 107, 108, 5, 97, 0, 0, 108, 109, 5, 99, 0, 0, 109, 110, 5, 101, 0, 0, 110, 8, 1, 0, 0, 0, 111, 112, 5, 101, 0, 0, 112, 113, 5, 120, 0, 0, 113, 114, 5, 116, 0, 0, 114, 115, 5, 101, 0, 0, 115, 116, 5, 110, 0, 0, 116, 117, 5, 100, 0, 0, 117, 118, 5, 115, 0, 0, 118, 10, 1, 0, 0, 0, 119, 120, 5, 123, 0, 0, 120, 12, 1, 0, 0, 0, 121, 122, 5, 125, 0, 0, 122, 14, 1, 0, 0, 0, 123, 124, 5, 118, 0, 0, 124, 125, 5, 111, 0, 0, 125, 126, 5, 105, 0, 0, 126, 127, 5, 100, 0, 0, 127, 16, 1, 0, 0, 0, 128, 129, 5, 40, 0, 0, 129, 18, 1, 0, 0, 0, 130, 131, 5, 41, 0, 0, 131, 20, 1, 0, 0, 0, 132, 133, 5, 99, 0, 0, 133, 134, 5, 111, 0, 0, 134, 135, 5, 110, 0, 0, 135, 136, 5, 115, 0, 0, 136, 137, 5, 116, 0, 0, 137, 22, 1, 0, 0, 0, 138, 139, 5, 115, 0, 0, 139, 140, 5, 105, 0, 0, 140, 141, 5, 103, 0, 0, 141, 142, 5, 110, 0, 0, 142, 143, 5, 97, 0, 0, 143, 144, 5, 108, 0, 0, 144, 24, 1, 0, 0, 0, 145, 146, 5, 61, 0, 0, 146, 26, 1, 0, 0, 0, 147, 148, 5, 114, 0, 0, 148, 149, 5, 101, 0, 0, 149, 150, 5, 97, 0, 0, 150, 151, 5, 100, 0, 0, 151, 152, 5, 111, 0, 0, 152, 153, 5, 110, 0, 0, 153, 154, 5, 108, 0, 0, 154, 155, 5, 121, 0, 0, 155, 28, 1, 0, 0, 0, 156, 157, 5, 44, 0, 0, 157, 30, 1, 0, 0, 0, 158, 159, 5, 98, 0, 0, 159, 160, 5, 111, 0, 0, 160, 161, 5, 111, 0, 0, 161, 162, 5, 108, 0, 0, 162, 32, 1, 0, 0, 0, 163, 164, 5, 105, 0, 0, 164, 165, 5, 110, 0, 0, 165, 166, 5, 116, 0, 0, 166, 34, 1, 0, 0, 0, 167, 168, 5, 114, 0, 0, 168, 169, 5, 101, 0, 0, 169, 170, 5, 97, 0, 0, 170, 171, 5, 108, 0, 0, 171, 36, 1, 0, 0, 0, 172, 173, 5, 115, 0, 0, 173, 174, 5, 116, 0, 0, 174, 175, 5, 114, 0, 0, 175, 176, 5, 105, 0, 0, 176, 177, 5, 110, 0, 0, 177, 178, 5, 103, 0, 0, 178, 38, 1, 0, 0, 0, 179, 180, 5, 118, 0, 0, 180, 181, 5, 97, 0, 0, 181, 182, 5, 114, 0, 0, 182, 40, 1, 0, 0, 0, 183, 184, 5, 108, 0, 0, 184, 185, 5, 105, 0, 0, 185, 186, 5, 115, 0, 0, 186, 187, 5, 116, 0, 0, 187, 42, 1, 0, 0, 0, 188, 189, 5, 60, 0, 0, 189, 44, 1, 0, 0, 0, 190, 191, 5, 62, 0, 0, 191, 46, 1, 0, 0, 0, 192, 193, 5, 109, 0, 0, 193, 194, 5, 97, 0, 0, 194, 195, 5, 112, 0, 0, 195, 48, 1, 0, 0, 0, 196, 197, 5, 109, 0, 0, 197, 198, 5, 111, 0, 0, 198, 199, 5, 100, 0, 0, 199, 200, 5, 101, 0, 0, 200, 201, 5, 108, 0, 0, 201, 50, 1, 0, 0, 0, 202, 203, 5, 115, 0, 0, 203, 204, 5, 116, 0, 0, 204, 205, 5, 114, 0, 0, 205, 206, 5, 117, 0, 0, 206, 207, 5, 99, 0, 0, 207, 208, 5, 116, 0, 0, 208, 52, 1, 0, 0, 0, 209, 210, 5, 101, 0, 0, 210, 211, 5, 110, 0, 0, 211, 212, 5, 117, 0, 0, 212, 213, 5, 109, 0, 0, 213, 54, 1, 0, 0, 0, 214, 215, 5, 102, 0, 0, 215, 216, 5, 108, 0, 0, 216, 217, 5, 97, 0, 0, 217, 218, 5, 103, 0, 0, 218, 56, 1, 0, 0, 0, 219, 222, 3, 59, 29, 0, 220, 222, 3, 61, 30, 0, 221, 219, 1, 0, 0, 0, 221, 220, 1, 0, 0, 0, 222, 58, 1, 0, 0, 0, 223, 228, 5, 34, 0, 0, 224, 227, 3, 83, 41, 0, 225, 227, 8, 0, 0, 0, 226, 224, 1, 0, 0, 0, 226, 225, 1, 0, 0, 0, 227, 230, 1, 0, 0, 0, 228, 226, 1, 0, 0, 0, 228, 229, 1, 0, 0, 0, 229, 231, 1, 0, 0, 0, 230, 228, 1, 0, 0, 0, 231, 232, 5, 34, 0, 0, 232, 60, 1, 0, 0, 0, 233, 238, 5, 39, 0, 0, 234, 237, 3, 83, 41, 0, 235, 237, 8, 1, 0, 0, 236, 234, 1, 0, 0, 0, 236, 235, 1, 0, 0, 0, 237, 240, 1, 0, 0, 0, 238, 236, 1, 0, 0, 0, 238, 239, 1, 0, 0, 0, 239, 241, 1, 0, 0, 0, 240, 238, 1, 0, 0, 0, 241, 242, 5, 39, 0, 0, 242, 62, 1, 0, 0, 0, 243, 247, 5, 64, 0, 0, 244, 246, 8, 2, 0, 0, 245, 244, 1, 0, 0, 0, 246, 249, 1, 0, 0, 0, 247, 245, 1, 0, 0, 0, 247, 248, 1, 0, 0, 0, 248, 64, 1, 0, 0, 0, 249, 247, 1, 0, 0, 0, 250, 252, 7, 3, 0, 0, 251, 250, 1, 0, 0, 0, 251, 252, 1, 0, 0, 0, 252, 254, 1, 0, 0, 0, 253, 255, 2, 48, 57, 0, 254, 253, 1, 0, 0, 0, 255, 256, 1, 0, 0, 0, 256, 254, 1, 0, 0, 0, 256, 257, 1, 0, 0, 0, 257, 66, 1, 0, 0, 0, 258, 259, 5, 48, 0, 0, 259, 260, 5, 120, 0, 0, 260, 262, 1, 0, 0, 0, 261, 263, 7, 4, 0, 0, 262, 261, 1, 0, 0, 0, 263, 264, 1, 0, 0, 0, 264, 262, 1, 0, 0, 0, 264, 265, 1, 0, 0, 0, 265, 68, 1, 0, 0, 0, 266, 267, 5, 64, 0, 0, 267, 271, 7, 5, 0, 0, 268, 270, 7, 6, 0, 0, 269, 268, 1, 0, 0, 0, 270, 273, 1, 0, 0, 0, 271, 269, 1, 0, 0, 0, 271, 272, 1, 0, 0, 0, 272, 70, 1, 0, 0, 0, 273, 271, 1, 0, 0, 0, 274, 278, 7, 5, 0, 0, 275, 277, 7, 6, 0, 0, 276, 275, 1, 0, 0, 0, 277, 280, 1, 0, 0, 0, 278, 276, 1, 0, 0, 0, 278, 279, 1, 0, 0, 0, 279, 72, 1, 0, 0, 0, 280, 278, 1, 0, 0, 0, 281, 282, 7, 7, 0, 0, 282, 283, 5, 46, 0, 0, 283, 284, 7, 7, 0, 0, 284, 74, 1, 0, 0, 0, 285, 286, 5, 47, 0, 0, 286, 287, 5, 42, 0, 0, 287, 288, 5, 42, 0, 0, 288, 292, 1, 0, 0, 0, 289, 291, 9, 0, 0, 0, 290, 289, 1, 0, 0, 0, 291, 294, 1, 0, 0, 0, 292, 293, 1, 0, 0, 0, 292, 290, 1, 0, 0, 0, 293, 295, 1, 0, 0, 0, 294, 292, 1, 0, 0, 0, 295, 296, 5, 42, 0, 0, 296, 297, 5, 47, 0, 0, 297, 76, 1, 0, 0, 0, 298, 300, 7, 8, 0, 0, 299, 298, 1, 0, 0, 0, 300, 301, 1, 0, 0, 0, 301, 299, 1, 0, 0, 0, 301, 302, 1, 0, 0, 0, 302, 303, 1, 0, 0, 0, 303, 304, 6, 38, 0, 0, 304, 78, 1, 0, 0, 0, 305, 306, 5, 47, 0, 0, 306, 307, 5, 47, 0, 0, 307, 311, 1, 0, 0, 0, 308, 310, 8, 2, 0, 0, 309, 308, 1, 0, 0, 0, 310, 313, 1, 0, 0, 0, 311, 309, 1, 0, 0, 0, 311, 312, 1, 0, 0, 0, 312, 314, 1, 0, 0, 0, 313, 311, 1, 0, 0, 0, 314, 315, 6, 39, 0, 0, 315, 80, 1, 0, 0, 0, 316, 317, 5, 47, 0, 0, 317, 318, 5, 42, 0, 0, 318, 322, 1, 0, 0, 0, 319, 321, 9, 0, 0, 0, 320, 319, 1, 0, 0, 0, 321, 324, 1, 0, 0, 0, 322, 323, 1, 0, 0, 0, 322, 320, 1, 0, 0, 0, 323, 325, 1, 0, 0, 0, 324, 322, 1, 0, 0, 0, 325, 326, 5, 42, 0, 0, 326, 327, 5, 47, 0, 0, 327, 328, 1, 0, 0, 0, 328, 329, 6, 40, 0, 0, 329, 82, 1, 0, 0, 0, 330, 331, 5, 92, 0, 0, 331, 332, 7, 9, 0, 0, 332, 84, 1, 0, 0, 0, 16, 0, 221, 226, 228, 236, 238, 247, 251, 256, 264, 271, 278, 292, 301, 311, 322, 1, 6, 0, 0] \ No newline at end of file diff --git a/qface/idl/parser/T4Lexer.py b/qface/idl/parser/T4Lexer.py new file mode 100644 index 0000000..a3c7595 --- /dev/null +++ b/qface/idl/parser/T4Lexer.py @@ -0,0 +1,218 @@ +# Generated from T4.g4 by ANTLR 4.10 +from antlr4 import * +from io import StringIO +import sys +if sys.version_info[1] > 5: + from typing import TextIO +else: + from typing.io import TextIO + + +def serializedATN(): + return [ + 4,0,41,333,6,-1,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,2,10,7,10,2,11,7,11,2,12,7,12,2, + 13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7, + 19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2, + 26,7,26,2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30,2,31,7,31,2,32,7, + 32,2,33,7,33,2,34,7,34,2,35,7,35,2,36,7,36,2,37,7,37,2,38,7,38,2, + 39,7,39,2,40,7,40,2,41,7,41,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,1, + 1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3, + 1,3,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,5,1,5,1,6,1,6,1,7,1,7,1,7, + 1,7,1,7,1,8,1,8,1,9,1,9,1,10,1,10,1,10,1,10,1,10,1,10,1,11,1,11, + 1,11,1,11,1,11,1,11,1,11,1,12,1,12,1,13,1,13,1,13,1,13,1,13,1,13, + 1,13,1,13,1,13,1,14,1,14,1,15,1,15,1,15,1,15,1,15,1,16,1,16,1,16, + 1,16,1,17,1,17,1,17,1,17,1,17,1,18,1,18,1,18,1,18,1,18,1,18,1,18, + 1,19,1,19,1,19,1,19,1,20,1,20,1,20,1,20,1,20,1,21,1,21,1,22,1,22, + 1,23,1,23,1,23,1,23,1,24,1,24,1,24,1,24,1,24,1,24,1,25,1,25,1,25, + 1,25,1,25,1,25,1,25,1,26,1,26,1,26,1,26,1,26,1,27,1,27,1,27,1,27, + 1,27,1,28,1,28,3,28,222,8,28,1,29,1,29,1,29,5,29,227,8,29,10,29, + 12,29,230,9,29,1,29,1,29,1,30,1,30,1,30,5,30,237,8,30,10,30,12,30, + 240,9,30,1,30,1,30,1,31,1,31,5,31,246,8,31,10,31,12,31,249,9,31, + 1,32,3,32,252,8,32,1,32,4,32,255,8,32,11,32,12,32,256,1,33,1,33, + 1,33,1,33,4,33,263,8,33,11,33,12,33,264,1,34,1,34,1,34,5,34,270, + 8,34,10,34,12,34,273,9,34,1,35,1,35,5,35,277,8,35,10,35,12,35,280, + 9,35,1,36,1,36,1,36,1,36,1,37,1,37,1,37,1,37,1,37,5,37,291,8,37, + 10,37,12,37,294,9,37,1,37,1,37,1,37,1,38,4,38,300,8,38,11,38,12, + 38,301,1,38,1,38,1,39,1,39,1,39,1,39,5,39,310,8,39,10,39,12,39,313, + 9,39,1,39,1,39,1,40,1,40,1,40,1,40,5,40,321,8,40,10,40,12,40,324, + 9,40,1,40,1,40,1,40,1,40,1,40,1,41,1,41,1,41,2,292,322,0,42,1,1, + 3,2,5,3,7,4,9,5,11,6,13,7,15,8,17,9,19,10,21,11,23,12,25,13,27,14, + 29,15,31,16,33,17,35,18,37,19,39,20,41,21,43,22,45,23,47,24,49,25, + 51,26,53,27,55,28,57,29,59,30,61,31,63,32,65,33,67,34,69,35,71,36, + 73,37,75,38,77,39,79,40,81,41,83,0,1,0,10,2,0,34,34,92,92,2,0,39, + 39,92,92,2,0,10,10,13,13,2,0,43,43,45,45,3,0,48,57,65,70,97,102, + 3,0,65,90,95,95,97,122,5,0,46,46,48,57,65,90,95,95,97,122,1,0,48, + 57,3,0,9,10,13,13,32,32,8,0,34,34,47,47,92,92,98,98,102,102,110, + 110,114,114,116,116,346,0,1,1,0,0,0,0,3,1,0,0,0,0,5,1,0,0,0,0,7, + 1,0,0,0,0,9,1,0,0,0,0,11,1,0,0,0,0,13,1,0,0,0,0,15,1,0,0,0,0,17, + 1,0,0,0,0,19,1,0,0,0,0,21,1,0,0,0,0,23,1,0,0,0,0,25,1,0,0,0,0,27, + 1,0,0,0,0,29,1,0,0,0,0,31,1,0,0,0,0,33,1,0,0,0,0,35,1,0,0,0,0,37, + 1,0,0,0,0,39,1,0,0,0,0,41,1,0,0,0,0,43,1,0,0,0,0,45,1,0,0,0,0,47, + 1,0,0,0,0,49,1,0,0,0,0,51,1,0,0,0,0,53,1,0,0,0,0,55,1,0,0,0,0,57, + 1,0,0,0,0,59,1,0,0,0,0,61,1,0,0,0,0,63,1,0,0,0,0,65,1,0,0,0,0,67, + 1,0,0,0,0,69,1,0,0,0,0,71,1,0,0,0,0,73,1,0,0,0,0,75,1,0,0,0,0,77, + 1,0,0,0,0,79,1,0,0,0,0,81,1,0,0,0,1,85,1,0,0,0,3,92,1,0,0,0,5,94, + 1,0,0,0,7,101,1,0,0,0,9,111,1,0,0,0,11,119,1,0,0,0,13,121,1,0,0, + 0,15,123,1,0,0,0,17,128,1,0,0,0,19,130,1,0,0,0,21,132,1,0,0,0,23, + 138,1,0,0,0,25,145,1,0,0,0,27,147,1,0,0,0,29,156,1,0,0,0,31,158, + 1,0,0,0,33,163,1,0,0,0,35,167,1,0,0,0,37,172,1,0,0,0,39,179,1,0, + 0,0,41,183,1,0,0,0,43,188,1,0,0,0,45,190,1,0,0,0,47,192,1,0,0,0, + 49,196,1,0,0,0,51,202,1,0,0,0,53,209,1,0,0,0,55,214,1,0,0,0,57,221, + 1,0,0,0,59,223,1,0,0,0,61,233,1,0,0,0,63,243,1,0,0,0,65,251,1,0, + 0,0,67,258,1,0,0,0,69,266,1,0,0,0,71,274,1,0,0,0,73,281,1,0,0,0, + 75,285,1,0,0,0,77,299,1,0,0,0,79,305,1,0,0,0,81,316,1,0,0,0,83,330, + 1,0,0,0,85,86,5,105,0,0,86,87,5,109,0,0,87,88,5,112,0,0,88,89,5, + 111,0,0,89,90,5,114,0,0,90,91,5,116,0,0,91,2,1,0,0,0,92,93,5,59, + 0,0,93,4,1,0,0,0,94,95,5,109,0,0,95,96,5,111,0,0,96,97,5,100,0,0, + 97,98,5,117,0,0,98,99,5,108,0,0,99,100,5,101,0,0,100,6,1,0,0,0,101, + 102,5,105,0,0,102,103,5,110,0,0,103,104,5,116,0,0,104,105,5,101, + 0,0,105,106,5,114,0,0,106,107,5,102,0,0,107,108,5,97,0,0,108,109, + 5,99,0,0,109,110,5,101,0,0,110,8,1,0,0,0,111,112,5,101,0,0,112,113, + 5,120,0,0,113,114,5,116,0,0,114,115,5,101,0,0,115,116,5,110,0,0, + 116,117,5,100,0,0,117,118,5,115,0,0,118,10,1,0,0,0,119,120,5,123, + 0,0,120,12,1,0,0,0,121,122,5,125,0,0,122,14,1,0,0,0,123,124,5,118, + 0,0,124,125,5,111,0,0,125,126,5,105,0,0,126,127,5,100,0,0,127,16, + 1,0,0,0,128,129,5,40,0,0,129,18,1,0,0,0,130,131,5,41,0,0,131,20, + 1,0,0,0,132,133,5,99,0,0,133,134,5,111,0,0,134,135,5,110,0,0,135, + 136,5,115,0,0,136,137,5,116,0,0,137,22,1,0,0,0,138,139,5,115,0,0, + 139,140,5,105,0,0,140,141,5,103,0,0,141,142,5,110,0,0,142,143,5, + 97,0,0,143,144,5,108,0,0,144,24,1,0,0,0,145,146,5,61,0,0,146,26, + 1,0,0,0,147,148,5,114,0,0,148,149,5,101,0,0,149,150,5,97,0,0,150, + 151,5,100,0,0,151,152,5,111,0,0,152,153,5,110,0,0,153,154,5,108, + 0,0,154,155,5,121,0,0,155,28,1,0,0,0,156,157,5,44,0,0,157,30,1,0, + 0,0,158,159,5,98,0,0,159,160,5,111,0,0,160,161,5,111,0,0,161,162, + 5,108,0,0,162,32,1,0,0,0,163,164,5,105,0,0,164,165,5,110,0,0,165, + 166,5,116,0,0,166,34,1,0,0,0,167,168,5,114,0,0,168,169,5,101,0,0, + 169,170,5,97,0,0,170,171,5,108,0,0,171,36,1,0,0,0,172,173,5,115, + 0,0,173,174,5,116,0,0,174,175,5,114,0,0,175,176,5,105,0,0,176,177, + 5,110,0,0,177,178,5,103,0,0,178,38,1,0,0,0,179,180,5,118,0,0,180, + 181,5,97,0,0,181,182,5,114,0,0,182,40,1,0,0,0,183,184,5,108,0,0, + 184,185,5,105,0,0,185,186,5,115,0,0,186,187,5,116,0,0,187,42,1,0, + 0,0,188,189,5,60,0,0,189,44,1,0,0,0,190,191,5,62,0,0,191,46,1,0, + 0,0,192,193,5,109,0,0,193,194,5,97,0,0,194,195,5,112,0,0,195,48, + 1,0,0,0,196,197,5,109,0,0,197,198,5,111,0,0,198,199,5,100,0,0,199, + 200,5,101,0,0,200,201,5,108,0,0,201,50,1,0,0,0,202,203,5,115,0,0, + 203,204,5,116,0,0,204,205,5,114,0,0,205,206,5,117,0,0,206,207,5, + 99,0,0,207,208,5,116,0,0,208,52,1,0,0,0,209,210,5,101,0,0,210,211, + 5,110,0,0,211,212,5,117,0,0,212,213,5,109,0,0,213,54,1,0,0,0,214, + 215,5,102,0,0,215,216,5,108,0,0,216,217,5,97,0,0,217,218,5,103,0, + 0,218,56,1,0,0,0,219,222,3,59,29,0,220,222,3,61,30,0,221,219,1,0, + 0,0,221,220,1,0,0,0,222,58,1,0,0,0,223,228,5,34,0,0,224,227,3,83, + 41,0,225,227,8,0,0,0,226,224,1,0,0,0,226,225,1,0,0,0,227,230,1,0, + 0,0,228,226,1,0,0,0,228,229,1,0,0,0,229,231,1,0,0,0,230,228,1,0, + 0,0,231,232,5,34,0,0,232,60,1,0,0,0,233,238,5,39,0,0,234,237,3,83, + 41,0,235,237,8,1,0,0,236,234,1,0,0,0,236,235,1,0,0,0,237,240,1,0, + 0,0,238,236,1,0,0,0,238,239,1,0,0,0,239,241,1,0,0,0,240,238,1,0, + 0,0,241,242,5,39,0,0,242,62,1,0,0,0,243,247,5,64,0,0,244,246,8,2, + 0,0,245,244,1,0,0,0,246,249,1,0,0,0,247,245,1,0,0,0,247,248,1,0, + 0,0,248,64,1,0,0,0,249,247,1,0,0,0,250,252,7,3,0,0,251,250,1,0,0, + 0,251,252,1,0,0,0,252,254,1,0,0,0,253,255,2,48,57,0,254,253,1,0, + 0,0,255,256,1,0,0,0,256,254,1,0,0,0,256,257,1,0,0,0,257,66,1,0,0, + 0,258,259,5,48,0,0,259,260,5,120,0,0,260,262,1,0,0,0,261,263,7,4, + 0,0,262,261,1,0,0,0,263,264,1,0,0,0,264,262,1,0,0,0,264,265,1,0, + 0,0,265,68,1,0,0,0,266,267,5,64,0,0,267,271,7,5,0,0,268,270,7,6, + 0,0,269,268,1,0,0,0,270,273,1,0,0,0,271,269,1,0,0,0,271,272,1,0, + 0,0,272,70,1,0,0,0,273,271,1,0,0,0,274,278,7,5,0,0,275,277,7,6,0, + 0,276,275,1,0,0,0,277,280,1,0,0,0,278,276,1,0,0,0,278,279,1,0,0, + 0,279,72,1,0,0,0,280,278,1,0,0,0,281,282,7,7,0,0,282,283,5,46,0, + 0,283,284,7,7,0,0,284,74,1,0,0,0,285,286,5,47,0,0,286,287,5,42,0, + 0,287,288,5,42,0,0,288,292,1,0,0,0,289,291,9,0,0,0,290,289,1,0,0, + 0,291,294,1,0,0,0,292,293,1,0,0,0,292,290,1,0,0,0,293,295,1,0,0, + 0,294,292,1,0,0,0,295,296,5,42,0,0,296,297,5,47,0,0,297,76,1,0,0, + 0,298,300,7,8,0,0,299,298,1,0,0,0,300,301,1,0,0,0,301,299,1,0,0, + 0,301,302,1,0,0,0,302,303,1,0,0,0,303,304,6,38,0,0,304,78,1,0,0, + 0,305,306,5,47,0,0,306,307,5,47,0,0,307,311,1,0,0,0,308,310,8,2, + 0,0,309,308,1,0,0,0,310,313,1,0,0,0,311,309,1,0,0,0,311,312,1,0, + 0,0,312,314,1,0,0,0,313,311,1,0,0,0,314,315,6,39,0,0,315,80,1,0, + 0,0,316,317,5,47,0,0,317,318,5,42,0,0,318,322,1,0,0,0,319,321,9, + 0,0,0,320,319,1,0,0,0,321,324,1,0,0,0,322,323,1,0,0,0,322,320,1, + 0,0,0,323,325,1,0,0,0,324,322,1,0,0,0,325,326,5,42,0,0,326,327,5, + 47,0,0,327,328,1,0,0,0,328,329,6,40,0,0,329,82,1,0,0,0,330,331,5, + 92,0,0,331,332,7,9,0,0,332,84,1,0,0,0,16,0,221,226,228,236,238,247, + 251,256,264,271,278,292,301,311,322,1,6,0,0 + ] + +class T4Lexer(Lexer): + + atn = ATNDeserializer().deserialize(serializedATN()) + + decisionsToDFA = [ DFA(ds, i) for i, ds in enumerate(atn.decisionToState) ] + + T__0 = 1 + T__1 = 2 + T__2 = 3 + T__3 = 4 + T__4 = 5 + T__5 = 6 + T__6 = 7 + T__7 = 8 + T__8 = 9 + T__9 = 10 + T__10 = 11 + T__11 = 12 + T__12 = 13 + T__13 = 14 + T__14 = 15 + T__15 = 16 + T__16 = 17 + T__17 = 18 + T__18 = 19 + T__19 = 20 + T__20 = 21 + T__21 = 22 + T__22 = 23 + T__23 = 24 + T__24 = 25 + T__25 = 26 + T__26 = 27 + T__27 = 28 + STRING = 29 + DOUBLE_STRING = 30 + SINGLE_STRING = 31 + TAGLINE = 32 + INTCONSTANT = 33 + HEXCONSTANT = 34 + TAGIDENTIFIER = 35 + IDENTIFIER = 36 + VERSION = 37 + DOCCOMMENT = 38 + WHITESPACE = 39 + COMMENT = 40 + MULTICOMM = 41 + + channelNames = [ u"DEFAULT_TOKEN_CHANNEL", u"HIDDEN" ] + + modeNames = [ "DEFAULT_MODE" ] + + literalNames = [ "", + "'import'", "';'", "'module'", "'interface'", "'extends'", "'{'", + "'}'", "'void'", "'('", "')'", "'const'", "'signal'", "'='", + "'readonly'", "','", "'bool'", "'int'", "'real'", "'string'", + "'var'", "'list'", "'<'", "'>'", "'map'", "'model'", "'struct'", + "'enum'", "'flag'" ] + + symbolicNames = [ "", + "STRING", "DOUBLE_STRING", "SINGLE_STRING", "TAGLINE", "INTCONSTANT", + "HEXCONSTANT", "TAGIDENTIFIER", "IDENTIFIER", "VERSION", "DOCCOMMENT", + "WHITESPACE", "COMMENT", "MULTICOMM" ] + + ruleNames = [ "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", + "T__7", "T__8", "T__9", "T__10", "T__11", "T__12", "T__13", + "T__14", "T__15", "T__16", "T__17", "T__18", "T__19", + "T__20", "T__21", "T__22", "T__23", "T__24", "T__25", + "T__26", "T__27", "STRING", "DOUBLE_STRING", "SINGLE_STRING", + "TAGLINE", "INTCONSTANT", "HEXCONSTANT", "TAGIDENTIFIER", + "IDENTIFIER", "VERSION", "DOCCOMMENT", "WHITESPACE", "COMMENT", + "MULTICOMM", "ESC" ] + + grammarFileName = "T4.g4" + + def __init__(self, input=None, output:TextIO = sys.stdout): + super().__init__(input, output) + self.checkVersion("4.10") + self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache()) + self._actions = None + self._predicates = None + + diff --git a/qface/idl/parser/T4Lexer.tokens b/qface/idl/parser/T4Lexer.tokens new file mode 100644 index 0000000..5daf716 --- /dev/null +++ b/qface/idl/parser/T4Lexer.tokens @@ -0,0 +1,69 @@ +T__0=1 +T__1=2 +T__2=3 +T__3=4 +T__4=5 +T__5=6 +T__6=7 +T__7=8 +T__8=9 +T__9=10 +T__10=11 +T__11=12 +T__12=13 +T__13=14 +T__14=15 +T__15=16 +T__16=17 +T__17=18 +T__18=19 +T__19=20 +T__20=21 +T__21=22 +T__22=23 +T__23=24 +T__24=25 +T__25=26 +T__26=27 +T__27=28 +STRING=29 +DOUBLE_STRING=30 +SINGLE_STRING=31 +TAGLINE=32 +INTCONSTANT=33 +HEXCONSTANT=34 +TAGIDENTIFIER=35 +IDENTIFIER=36 +VERSION=37 +DOCCOMMENT=38 +WHITESPACE=39 +COMMENT=40 +MULTICOMM=41 +'import'=1 +';'=2 +'module'=3 +'interface'=4 +'extends'=5 +'{'=6 +'}'=7 +'void'=8 +'('=9 +')'=10 +'const'=11 +'signal'=12 +'='=13 +'readonly'=14 +','=15 +'bool'=16 +'int'=17 +'real'=18 +'string'=19 +'var'=20 +'list'=21 +'<'=22 +'>'=23 +'map'=24 +'model'=25 +'struct'=26 +'enum'=27 +'flag'=28 diff --git a/qface/idl/parser/T4Listener.py b/qface/idl/parser/T4Listener.py new file mode 100644 index 0000000..1450c16 --- /dev/null +++ b/qface/idl/parser/T4Listener.py @@ -0,0 +1,255 @@ +# Generated from T4.g4 by ANTLR 4.10 +from antlr4 import * +if __name__ is not None and "." in __name__: + from .T4Parser import T4Parser +else: + from T4Parser import T4Parser + +# This class defines a complete listener for a parse tree produced by T4Parser. +class T4Listener(ParseTreeListener): + + # Enter a parse tree produced by T4Parser#documentSymbol. + def enterDocumentSymbol(self, ctx:T4Parser.DocumentSymbolContext): + pass + + # Exit a parse tree produced by T4Parser#documentSymbol. + def exitDocumentSymbol(self, ctx:T4Parser.DocumentSymbolContext): + pass + + + # Enter a parse tree produced by T4Parser#headerSymbol. + def enterHeaderSymbol(self, ctx:T4Parser.HeaderSymbolContext): + pass + + # Exit a parse tree produced by T4Parser#headerSymbol. + def exitHeaderSymbol(self, ctx:T4Parser.HeaderSymbolContext): + pass + + + # Enter a parse tree produced by T4Parser#importSymbol. + def enterImportSymbol(self, ctx:T4Parser.ImportSymbolContext): + pass + + # Exit a parse tree produced by T4Parser#importSymbol. + def exitImportSymbol(self, ctx:T4Parser.ImportSymbolContext): + pass + + + # Enter a parse tree produced by T4Parser#moduleSymbol. + def enterModuleSymbol(self, ctx:T4Parser.ModuleSymbolContext): + pass + + # Exit a parse tree produced by T4Parser#moduleSymbol. + def exitModuleSymbol(self, ctx:T4Parser.ModuleSymbolContext): + pass + + + # Enter a parse tree produced by T4Parser#definitionSymbol. + def enterDefinitionSymbol(self, ctx:T4Parser.DefinitionSymbolContext): + pass + + # Exit a parse tree produced by T4Parser#definitionSymbol. + def exitDefinitionSymbol(self, ctx:T4Parser.DefinitionSymbolContext): + pass + + + # Enter a parse tree produced by T4Parser#interfaceSymbol. + def enterInterfaceSymbol(self, ctx:T4Parser.InterfaceSymbolContext): + pass + + # Exit a parse tree produced by T4Parser#interfaceSymbol. + def exitInterfaceSymbol(self, ctx:T4Parser.InterfaceSymbolContext): + pass + + + # Enter a parse tree produced by T4Parser#interfaceMemberSymbol. + def enterInterfaceMemberSymbol(self, ctx:T4Parser.InterfaceMemberSymbolContext): + pass + + # Exit a parse tree produced by T4Parser#interfaceMemberSymbol. + def exitInterfaceMemberSymbol(self, ctx:T4Parser.InterfaceMemberSymbolContext): + pass + + + # Enter a parse tree produced by T4Parser#operationSymbol. + def enterOperationSymbol(self, ctx:T4Parser.OperationSymbolContext): + pass + + # Exit a parse tree produced by T4Parser#operationSymbol. + def exitOperationSymbol(self, ctx:T4Parser.OperationSymbolContext): + pass + + + # Enter a parse tree produced by T4Parser#operationModifierSymbol. + def enterOperationModifierSymbol(self, ctx:T4Parser.OperationModifierSymbolContext): + pass + + # Exit a parse tree produced by T4Parser#operationModifierSymbol. + def exitOperationModifierSymbol(self, ctx:T4Parser.OperationModifierSymbolContext): + pass + + + # Enter a parse tree produced by T4Parser#signalSymbol. + def enterSignalSymbol(self, ctx:T4Parser.SignalSymbolContext): + pass + + # Exit a parse tree produced by T4Parser#signalSymbol. + def exitSignalSymbol(self, ctx:T4Parser.SignalSymbolContext): + pass + + + # Enter a parse tree produced by T4Parser#propertySymbol. + def enterPropertySymbol(self, ctx:T4Parser.PropertySymbolContext): + pass + + # Exit a parse tree produced by T4Parser#propertySymbol. + def exitPropertySymbol(self, ctx:T4Parser.PropertySymbolContext): + pass + + + # Enter a parse tree produced by T4Parser#propertyModifierSymbol. + def enterPropertyModifierSymbol(self, ctx:T4Parser.PropertyModifierSymbolContext): + pass + + # Exit a parse tree produced by T4Parser#propertyModifierSymbol. + def exitPropertyModifierSymbol(self, ctx:T4Parser.PropertyModifierSymbolContext): + pass + + + # Enter a parse tree produced by T4Parser#operationParameterSymbol. + def enterOperationParameterSymbol(self, ctx:T4Parser.OperationParameterSymbolContext): + pass + + # Exit a parse tree produced by T4Parser#operationParameterSymbol. + def exitOperationParameterSymbol(self, ctx:T4Parser.OperationParameterSymbolContext): + pass + + + # Enter a parse tree produced by T4Parser#tagSymbol. + def enterTagSymbol(self, ctx:T4Parser.TagSymbolContext): + pass + + # Exit a parse tree produced by T4Parser#tagSymbol. + def exitTagSymbol(self, ctx:T4Parser.TagSymbolContext): + pass + + + # Enter a parse tree produced by T4Parser#tagAttributeSymbol. + def enterTagAttributeSymbol(self, ctx:T4Parser.TagAttributeSymbolContext): + pass + + # Exit a parse tree produced by T4Parser#tagAttributeSymbol. + def exitTagAttributeSymbol(self, ctx:T4Parser.TagAttributeSymbolContext): + pass + + + # Enter a parse tree produced by T4Parser#typeSymbol. + def enterTypeSymbol(self, ctx:T4Parser.TypeSymbolContext): + pass + + # Exit a parse tree produced by T4Parser#typeSymbol. + def exitTypeSymbol(self, ctx:T4Parser.TypeSymbolContext): + pass + + + # Enter a parse tree produced by T4Parser#complexTypeSymbol. + def enterComplexTypeSymbol(self, ctx:T4Parser.ComplexTypeSymbolContext): + pass + + # Exit a parse tree produced by T4Parser#complexTypeSymbol. + def exitComplexTypeSymbol(self, ctx:T4Parser.ComplexTypeSymbolContext): + pass + + + # Enter a parse tree produced by T4Parser#primitiveTypeSymbol. + def enterPrimitiveTypeSymbol(self, ctx:T4Parser.PrimitiveTypeSymbolContext): + pass + + # Exit a parse tree produced by T4Parser#primitiveTypeSymbol. + def exitPrimitiveTypeSymbol(self, ctx:T4Parser.PrimitiveTypeSymbolContext): + pass + + + # Enter a parse tree produced by T4Parser#listTypeSymbol. + def enterListTypeSymbol(self, ctx:T4Parser.ListTypeSymbolContext): + pass + + # Exit a parse tree produced by T4Parser#listTypeSymbol. + def exitListTypeSymbol(self, ctx:T4Parser.ListTypeSymbolContext): + pass + + + # Enter a parse tree produced by T4Parser#mapTypeSymbol. + def enterMapTypeSymbol(self, ctx:T4Parser.MapTypeSymbolContext): + pass + + # Exit a parse tree produced by T4Parser#mapTypeSymbol. + def exitMapTypeSymbol(self, ctx:T4Parser.MapTypeSymbolContext): + pass + + + # Enter a parse tree produced by T4Parser#modelTypeSymbol. + def enterModelTypeSymbol(self, ctx:T4Parser.ModelTypeSymbolContext): + pass + + # Exit a parse tree produced by T4Parser#modelTypeSymbol. + def exitModelTypeSymbol(self, ctx:T4Parser.ModelTypeSymbolContext): + pass + + + # Enter a parse tree produced by T4Parser#structSymbol. + def enterStructSymbol(self, ctx:T4Parser.StructSymbolContext): + pass + + # Exit a parse tree produced by T4Parser#structSymbol. + def exitStructSymbol(self, ctx:T4Parser.StructSymbolContext): + pass + + + # Enter a parse tree produced by T4Parser#structFieldSymbol. + def enterStructFieldSymbol(self, ctx:T4Parser.StructFieldSymbolContext): + pass + + # Exit a parse tree produced by T4Parser#structFieldSymbol. + def exitStructFieldSymbol(self, ctx:T4Parser.StructFieldSymbolContext): + pass + + + # Enter a parse tree produced by T4Parser#enumSymbol. + def enterEnumSymbol(self, ctx:T4Parser.EnumSymbolContext): + pass + + # Exit a parse tree produced by T4Parser#enumSymbol. + def exitEnumSymbol(self, ctx:T4Parser.EnumSymbolContext): + pass + + + # Enter a parse tree produced by T4Parser#enumTypeSymbol. + def enterEnumTypeSymbol(self, ctx:T4Parser.EnumTypeSymbolContext): + pass + + # Exit a parse tree produced by T4Parser#enumTypeSymbol. + def exitEnumTypeSymbol(self, ctx:T4Parser.EnumTypeSymbolContext): + pass + + + # Enter a parse tree produced by T4Parser#enumMemberSymbol. + def enterEnumMemberSymbol(self, ctx:T4Parser.EnumMemberSymbolContext): + pass + + # Exit a parse tree produced by T4Parser#enumMemberSymbol. + def exitEnumMemberSymbol(self, ctx:T4Parser.EnumMemberSymbolContext): + pass + + + # Enter a parse tree produced by T4Parser#intSymbol. + def enterIntSymbol(self, ctx:T4Parser.IntSymbolContext): + pass + + # Exit a parse tree produced by T4Parser#intSymbol. + def exitIntSymbol(self, ctx:T4Parser.IntSymbolContext): + pass + + + +del T4Parser \ No newline at end of file diff --git a/qface/idl/parser/T4Parser.py b/qface/idl/parser/T4Parser.py new file mode 100644 index 0000000..df15673 --- /dev/null +++ b/qface/idl/parser/T4Parser.py @@ -0,0 +1,2243 @@ +# Generated from T4.g4 by ANTLR 4.10 +# encoding: utf-8 +from antlr4 import * +from io import StringIO +import sys +if sys.version_info[1] > 5: + from typing import TextIO +else: + from typing.io import TextIO + +def serializedATN(): + return [ + 4,1,41,336,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,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13, + 2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,20, + 7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7,26, + 1,0,1,0,5,0,57,8,0,10,0,12,0,60,9,0,1,1,1,1,5,1,64,8,1,10,1,12,1, + 67,9,1,1,2,1,2,1,2,1,2,3,2,73,8,2,1,3,3,3,76,8,3,1,3,5,3,79,8,3, + 10,3,12,3,82,9,3,1,3,1,3,1,3,1,3,3,3,88,8,3,1,4,1,4,1,4,3,4,93,8, + 4,1,5,3,5,96,8,5,1,5,5,5,99,8,5,10,5,12,5,102,9,5,1,5,1,5,1,5,1, + 5,3,5,108,8,5,1,5,1,5,5,5,112,8,5,10,5,12,5,115,9,5,1,5,1,5,3,5, + 119,8,5,1,6,1,6,1,6,3,6,124,8,6,1,7,3,7,127,8,7,1,7,5,7,130,8,7, + 10,7,12,7,133,9,7,1,7,1,7,3,7,137,8,7,1,7,1,7,1,7,5,7,142,8,7,10, + 7,12,7,145,9,7,1,7,1,7,3,7,149,8,7,1,7,3,7,152,8,7,1,8,1,8,1,9,3, + 9,157,8,9,1,9,5,9,160,8,9,10,9,12,9,163,9,9,1,9,1,9,1,9,1,9,5,9, + 169,8,9,10,9,12,9,172,9,9,1,9,1,9,3,9,176,8,9,1,10,3,10,179,8,10, + 1,10,5,10,182,8,10,10,10,12,10,185,9,10,1,10,3,10,188,8,10,1,10, + 1,10,1,10,1,10,3,10,194,8,10,1,10,3,10,197,8,10,1,11,1,11,3,11,201, + 8,11,1,12,1,12,1,12,3,12,206,8,12,1,13,1,13,1,14,1,14,1,14,3,14, + 213,8,14,1,14,3,14,216,8,14,1,15,1,15,1,15,1,15,1,15,3,15,223,8, + 15,1,16,1,16,1,17,1,17,1,17,1,17,1,17,3,17,232,8,17,1,18,1,18,1, + 18,1,18,1,18,1,19,1,19,1,19,1,19,1,19,1,20,1,20,1,20,1,20,1,20,1, + 21,3,21,250,8,21,1,21,5,21,253,8,21,10,21,12,21,256,9,21,1,21,1, + 21,1,21,1,21,5,21,262,8,21,10,21,12,21,265,9,21,1,21,1,21,3,21,269, + 8,21,1,22,3,22,272,8,22,1,22,5,22,275,8,22,10,22,12,22,278,9,22, + 1,22,1,22,1,22,1,22,3,22,284,8,22,1,22,3,22,287,8,22,1,23,3,23,290, + 8,23,1,23,5,23,293,8,23,10,23,12,23,296,9,23,1,23,1,23,1,23,1,23, + 5,23,302,8,23,10,23,12,23,305,9,23,1,23,1,23,3,23,309,8,23,1,24, + 1,24,3,24,313,8,24,1,25,3,25,316,8,25,1,25,5,25,319,8,25,10,25,12, + 25,322,9,25,1,25,1,25,1,25,3,25,327,8,25,1,25,3,25,330,8,25,1,26, + 1,26,3,26,334,8,26,1,26,0,0,27,0,2,4,6,8,10,12,14,16,18,20,22,24, + 26,28,30,32,34,36,38,40,42,44,46,48,50,52,0,0,368,0,54,1,0,0,0,2, + 61,1,0,0,0,4,68,1,0,0,0,6,75,1,0,0,0,8,92,1,0,0,0,10,95,1,0,0,0, + 12,123,1,0,0,0,14,126,1,0,0,0,16,153,1,0,0,0,18,156,1,0,0,0,20,178, + 1,0,0,0,22,200,1,0,0,0,24,202,1,0,0,0,26,207,1,0,0,0,28,209,1,0, + 0,0,30,222,1,0,0,0,32,224,1,0,0,0,34,231,1,0,0,0,36,233,1,0,0,0, + 38,238,1,0,0,0,40,243,1,0,0,0,42,249,1,0,0,0,44,271,1,0,0,0,46,289, + 1,0,0,0,48,312,1,0,0,0,50,315,1,0,0,0,52,333,1,0,0,0,54,58,3,2,1, + 0,55,57,3,8,4,0,56,55,1,0,0,0,57,60,1,0,0,0,58,56,1,0,0,0,58,59, + 1,0,0,0,59,1,1,0,0,0,60,58,1,0,0,0,61,65,3,6,3,0,62,64,3,4,2,0,63, + 62,1,0,0,0,64,67,1,0,0,0,65,63,1,0,0,0,65,66,1,0,0,0,66,3,1,0,0, + 0,67,65,1,0,0,0,68,69,5,1,0,0,69,70,5,36,0,0,70,72,5,37,0,0,71,73, + 5,2,0,0,72,71,1,0,0,0,72,73,1,0,0,0,73,5,1,0,0,0,74,76,5,38,0,0, + 75,74,1,0,0,0,75,76,1,0,0,0,76,80,1,0,0,0,77,79,3,26,13,0,78,77, + 1,0,0,0,79,82,1,0,0,0,80,78,1,0,0,0,80,81,1,0,0,0,81,83,1,0,0,0, + 82,80,1,0,0,0,83,84,5,3,0,0,84,85,5,36,0,0,85,87,5,37,0,0,86,88, + 5,2,0,0,87,86,1,0,0,0,87,88,1,0,0,0,88,7,1,0,0,0,89,93,3,10,5,0, + 90,93,3,42,21,0,91,93,3,46,23,0,92,89,1,0,0,0,92,90,1,0,0,0,92,91, + 1,0,0,0,93,9,1,0,0,0,94,96,5,38,0,0,95,94,1,0,0,0,95,96,1,0,0,0, + 96,100,1,0,0,0,97,99,3,26,13,0,98,97,1,0,0,0,99,102,1,0,0,0,100, + 98,1,0,0,0,100,101,1,0,0,0,101,103,1,0,0,0,102,100,1,0,0,0,103,104, + 5,4,0,0,104,107,5,36,0,0,105,106,5,5,0,0,106,108,5,36,0,0,107,105, + 1,0,0,0,107,108,1,0,0,0,108,109,1,0,0,0,109,113,5,6,0,0,110,112, + 3,12,6,0,111,110,1,0,0,0,112,115,1,0,0,0,113,111,1,0,0,0,113,114, + 1,0,0,0,114,116,1,0,0,0,115,113,1,0,0,0,116,118,5,7,0,0,117,119, + 5,2,0,0,118,117,1,0,0,0,118,119,1,0,0,0,119,11,1,0,0,0,120,124,3, + 14,7,0,121,124,3,20,10,0,122,124,3,18,9,0,123,120,1,0,0,0,123,121, + 1,0,0,0,123,122,1,0,0,0,124,13,1,0,0,0,125,127,5,38,0,0,126,125, + 1,0,0,0,126,127,1,0,0,0,127,131,1,0,0,0,128,130,3,26,13,0,129,128, + 1,0,0,0,130,133,1,0,0,0,131,129,1,0,0,0,131,132,1,0,0,0,132,136, + 1,0,0,0,133,131,1,0,0,0,134,137,3,30,15,0,135,137,5,8,0,0,136,134, + 1,0,0,0,136,135,1,0,0,0,137,138,1,0,0,0,138,139,5,36,0,0,139,143, + 5,9,0,0,140,142,3,24,12,0,141,140,1,0,0,0,142,145,1,0,0,0,143,141, + 1,0,0,0,143,144,1,0,0,0,144,146,1,0,0,0,145,143,1,0,0,0,146,148, + 5,10,0,0,147,149,3,16,8,0,148,147,1,0,0,0,148,149,1,0,0,0,149,151, + 1,0,0,0,150,152,5,2,0,0,151,150,1,0,0,0,151,152,1,0,0,0,152,15,1, + 0,0,0,153,154,5,11,0,0,154,17,1,0,0,0,155,157,5,38,0,0,156,155,1, + 0,0,0,156,157,1,0,0,0,157,161,1,0,0,0,158,160,3,26,13,0,159,158, + 1,0,0,0,160,163,1,0,0,0,161,159,1,0,0,0,161,162,1,0,0,0,162,164, + 1,0,0,0,163,161,1,0,0,0,164,165,5,12,0,0,165,166,5,36,0,0,166,170, + 5,9,0,0,167,169,3,24,12,0,168,167,1,0,0,0,169,172,1,0,0,0,170,168, + 1,0,0,0,170,171,1,0,0,0,171,173,1,0,0,0,172,170,1,0,0,0,173,175, + 5,10,0,0,174,176,5,2,0,0,175,174,1,0,0,0,175,176,1,0,0,0,176,19, + 1,0,0,0,177,179,5,38,0,0,178,177,1,0,0,0,178,179,1,0,0,0,179,183, + 1,0,0,0,180,182,3,26,13,0,181,180,1,0,0,0,182,185,1,0,0,0,183,181, + 1,0,0,0,183,184,1,0,0,0,184,187,1,0,0,0,185,183,1,0,0,0,186,188, + 3,22,11,0,187,186,1,0,0,0,187,188,1,0,0,0,188,189,1,0,0,0,189,190, + 3,30,15,0,190,193,5,36,0,0,191,192,5,13,0,0,192,194,5,29,0,0,193, + 191,1,0,0,0,193,194,1,0,0,0,194,196,1,0,0,0,195,197,5,2,0,0,196, + 195,1,0,0,0,196,197,1,0,0,0,197,21,1,0,0,0,198,201,5,14,0,0,199, + 201,5,11,0,0,200,198,1,0,0,0,200,199,1,0,0,0,201,23,1,0,0,0,202, + 203,3,30,15,0,203,205,5,36,0,0,204,206,5,15,0,0,205,204,1,0,0,0, + 205,206,1,0,0,0,206,25,1,0,0,0,207,208,5,32,0,0,208,27,1,0,0,0,209, + 212,5,36,0,0,210,211,5,13,0,0,211,213,5,36,0,0,212,210,1,0,0,0,212, + 213,1,0,0,0,213,215,1,0,0,0,214,216,5,15,0,0,215,214,1,0,0,0,215, + 216,1,0,0,0,216,29,1,0,0,0,217,223,3,34,17,0,218,223,3,32,16,0,219, + 223,3,36,18,0,220,223,3,38,19,0,221,223,3,40,20,0,222,217,1,0,0, + 0,222,218,1,0,0,0,222,219,1,0,0,0,222,220,1,0,0,0,222,221,1,0,0, + 0,223,31,1,0,0,0,224,225,5,36,0,0,225,33,1,0,0,0,226,232,5,16,0, + 0,227,232,5,17,0,0,228,232,5,18,0,0,229,232,5,19,0,0,230,232,5,20, + 0,0,231,226,1,0,0,0,231,227,1,0,0,0,231,228,1,0,0,0,231,229,1,0, + 0,0,231,230,1,0,0,0,232,35,1,0,0,0,233,234,5,21,0,0,234,235,5,22, + 0,0,235,236,3,30,15,0,236,237,5,23,0,0,237,37,1,0,0,0,238,239,5, + 24,0,0,239,240,5,22,0,0,240,241,3,30,15,0,241,242,5,23,0,0,242,39, + 1,0,0,0,243,244,5,25,0,0,244,245,5,22,0,0,245,246,3,30,15,0,246, + 247,5,23,0,0,247,41,1,0,0,0,248,250,5,38,0,0,249,248,1,0,0,0,249, + 250,1,0,0,0,250,254,1,0,0,0,251,253,3,26,13,0,252,251,1,0,0,0,253, + 256,1,0,0,0,254,252,1,0,0,0,254,255,1,0,0,0,255,257,1,0,0,0,256, + 254,1,0,0,0,257,258,5,26,0,0,258,259,5,36,0,0,259,263,5,6,0,0,260, + 262,3,44,22,0,261,260,1,0,0,0,262,265,1,0,0,0,263,261,1,0,0,0,263, + 264,1,0,0,0,264,266,1,0,0,0,265,263,1,0,0,0,266,268,5,7,0,0,267, + 269,5,2,0,0,268,267,1,0,0,0,268,269,1,0,0,0,269,43,1,0,0,0,270,272, + 5,38,0,0,271,270,1,0,0,0,271,272,1,0,0,0,272,276,1,0,0,0,273,275, + 3,26,13,0,274,273,1,0,0,0,275,278,1,0,0,0,276,274,1,0,0,0,276,277, + 1,0,0,0,277,279,1,0,0,0,278,276,1,0,0,0,279,280,3,30,15,0,280,283, + 5,36,0,0,281,282,5,13,0,0,282,284,5,29,0,0,283,281,1,0,0,0,283,284, + 1,0,0,0,284,286,1,0,0,0,285,287,5,2,0,0,286,285,1,0,0,0,286,287, + 1,0,0,0,287,45,1,0,0,0,288,290,5,38,0,0,289,288,1,0,0,0,289,290, + 1,0,0,0,290,294,1,0,0,0,291,293,3,26,13,0,292,291,1,0,0,0,293,296, + 1,0,0,0,294,292,1,0,0,0,294,295,1,0,0,0,295,297,1,0,0,0,296,294, + 1,0,0,0,297,298,3,48,24,0,298,299,5,36,0,0,299,303,5,6,0,0,300,302, + 3,50,25,0,301,300,1,0,0,0,302,305,1,0,0,0,303,301,1,0,0,0,303,304, + 1,0,0,0,304,306,1,0,0,0,305,303,1,0,0,0,306,308,5,7,0,0,307,309, + 5,2,0,0,308,307,1,0,0,0,308,309,1,0,0,0,309,47,1,0,0,0,310,313,5, + 27,0,0,311,313,5,28,0,0,312,310,1,0,0,0,312,311,1,0,0,0,313,49,1, + 0,0,0,314,316,5,38,0,0,315,314,1,0,0,0,315,316,1,0,0,0,316,320,1, + 0,0,0,317,319,3,26,13,0,318,317,1,0,0,0,319,322,1,0,0,0,320,318, + 1,0,0,0,320,321,1,0,0,0,321,323,1,0,0,0,322,320,1,0,0,0,323,326, + 5,36,0,0,324,325,5,13,0,0,325,327,3,52,26,0,326,324,1,0,0,0,326, + 327,1,0,0,0,327,329,1,0,0,0,328,330,5,15,0,0,329,328,1,0,0,0,329, + 330,1,0,0,0,330,51,1,0,0,0,331,334,5,33,0,0,332,334,5,34,0,0,333, + 331,1,0,0,0,333,332,1,0,0,0,334,53,1,0,0,0,52,58,65,72,75,80,87, + 92,95,100,107,113,118,123,126,131,136,143,148,151,156,161,170,175, + 178,183,187,193,196,200,205,212,215,222,231,249,254,263,268,271, + 276,283,286,289,294,303,308,312,315,320,326,329,333 + ] + +class T4Parser ( Parser ): + + grammarFileName = "T4.g4" + + atn = ATNDeserializer().deserialize(serializedATN()) + + decisionsToDFA = [ DFA(ds, i) for i, ds in enumerate(atn.decisionToState) ] + + sharedContextCache = PredictionContextCache() + + literalNames = [ "", "'import'", "';'", "'module'", "'interface'", + "'extends'", "'{'", "'}'", "'void'", "'('", "')'", + "'const'", "'signal'", "'='", "'readonly'", "','", + "'bool'", "'int'", "'real'", "'string'", "'var'", "'list'", + "'<'", "'>'", "'map'", "'model'", "'struct'", "'enum'", + "'flag'" ] + + symbolicNames = [ "", "", "", "", + "", "", "", "", + "", "", "", "", + "", "", "", "", + "", "", "", "", + "", "", "", "", + "", "", "", "", + "", "STRING", "DOUBLE_STRING", "SINGLE_STRING", + "TAGLINE", "INTCONSTANT", "HEXCONSTANT", "TAGIDENTIFIER", + "IDENTIFIER", "VERSION", "DOCCOMMENT", "WHITESPACE", + "COMMENT", "MULTICOMM" ] + + RULE_documentSymbol = 0 + RULE_headerSymbol = 1 + RULE_importSymbol = 2 + RULE_moduleSymbol = 3 + RULE_definitionSymbol = 4 + RULE_interfaceSymbol = 5 + RULE_interfaceMemberSymbol = 6 + RULE_operationSymbol = 7 + RULE_operationModifierSymbol = 8 + RULE_signalSymbol = 9 + RULE_propertySymbol = 10 + RULE_propertyModifierSymbol = 11 + RULE_operationParameterSymbol = 12 + RULE_tagSymbol = 13 + RULE_tagAttributeSymbol = 14 + RULE_typeSymbol = 15 + RULE_complexTypeSymbol = 16 + RULE_primitiveTypeSymbol = 17 + RULE_listTypeSymbol = 18 + RULE_mapTypeSymbol = 19 + RULE_modelTypeSymbol = 20 + RULE_structSymbol = 21 + RULE_structFieldSymbol = 22 + RULE_enumSymbol = 23 + RULE_enumTypeSymbol = 24 + RULE_enumMemberSymbol = 25 + RULE_intSymbol = 26 + + ruleNames = [ "documentSymbol", "headerSymbol", "importSymbol", "moduleSymbol", + "definitionSymbol", "interfaceSymbol", "interfaceMemberSymbol", + "operationSymbol", "operationModifierSymbol", "signalSymbol", + "propertySymbol", "propertyModifierSymbol", "operationParameterSymbol", + "tagSymbol", "tagAttributeSymbol", "typeSymbol", "complexTypeSymbol", + "primitiveTypeSymbol", "listTypeSymbol", "mapTypeSymbol", + "modelTypeSymbol", "structSymbol", "structFieldSymbol", + "enumSymbol", "enumTypeSymbol", "enumMemberSymbol", "intSymbol" ] + + EOF = Token.EOF + T__0=1 + T__1=2 + T__2=3 + T__3=4 + T__4=5 + T__5=6 + T__6=7 + T__7=8 + T__8=9 + T__9=10 + T__10=11 + T__11=12 + T__12=13 + T__13=14 + T__14=15 + T__15=16 + T__16=17 + T__17=18 + T__18=19 + T__19=20 + T__20=21 + T__21=22 + T__22=23 + T__23=24 + T__24=25 + T__25=26 + T__26=27 + T__27=28 + STRING=29 + DOUBLE_STRING=30 + SINGLE_STRING=31 + TAGLINE=32 + INTCONSTANT=33 + HEXCONSTANT=34 + TAGIDENTIFIER=35 + IDENTIFIER=36 + VERSION=37 + DOCCOMMENT=38 + WHITESPACE=39 + COMMENT=40 + MULTICOMM=41 + + def __init__(self, input:TokenStream, output:TextIO = sys.stdout): + super().__init__(input, output) + self.checkVersion("4.10") + self._interp = ParserATNSimulator(self, self.atn, self.decisionsToDFA, self.sharedContextCache) + self._predicates = None + + + + + class DocumentSymbolContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def headerSymbol(self): + return self.getTypedRuleContext(T4Parser.HeaderSymbolContext,0) + + + def definitionSymbol(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(T4Parser.DefinitionSymbolContext) + else: + return self.getTypedRuleContext(T4Parser.DefinitionSymbolContext,i) + + + def getRuleIndex(self): + return T4Parser.RULE_documentSymbol + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterDocumentSymbol" ): + listener.enterDocumentSymbol(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitDocumentSymbol" ): + listener.exitDocumentSymbol(self) + + + + + def documentSymbol(self): + + localctx = T4Parser.DocumentSymbolContext(self, self._ctx, self.state) + self.enterRule(localctx, 0, self.RULE_documentSymbol) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 54 + self.headerSymbol() + self.state = 58 + self._errHandler.sync(self) + _la = self._input.LA(1) + while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << T4Parser.T__3) | (1 << T4Parser.T__25) | (1 << T4Parser.T__26) | (1 << T4Parser.T__27) | (1 << T4Parser.TAGLINE) | (1 << T4Parser.DOCCOMMENT))) != 0): + self.state = 55 + self.definitionSymbol() + self.state = 60 + self._errHandler.sync(self) + _la = self._input.LA(1) + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class HeaderSymbolContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def moduleSymbol(self): + return self.getTypedRuleContext(T4Parser.ModuleSymbolContext,0) + + + def importSymbol(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(T4Parser.ImportSymbolContext) + else: + return self.getTypedRuleContext(T4Parser.ImportSymbolContext,i) + + + def getRuleIndex(self): + return T4Parser.RULE_headerSymbol + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterHeaderSymbol" ): + listener.enterHeaderSymbol(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitHeaderSymbol" ): + listener.exitHeaderSymbol(self) + + + + + def headerSymbol(self): + + localctx = T4Parser.HeaderSymbolContext(self, self._ctx, self.state) + self.enterRule(localctx, 2, self.RULE_headerSymbol) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 61 + self.moduleSymbol() + self.state = 65 + self._errHandler.sync(self) + _la = self._input.LA(1) + while _la==T4Parser.T__0: + self.state = 62 + self.importSymbol() + self.state = 67 + self._errHandler.sync(self) + _la = self._input.LA(1) + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class ImportSymbolContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + self.name = None # Token + self.version = None # Token + + def IDENTIFIER(self): + return self.getToken(T4Parser.IDENTIFIER, 0) + + def VERSION(self): + return self.getToken(T4Parser.VERSION, 0) + + def getRuleIndex(self): + return T4Parser.RULE_importSymbol + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterImportSymbol" ): + listener.enterImportSymbol(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitImportSymbol" ): + listener.exitImportSymbol(self) + + + + + def importSymbol(self): + + localctx = T4Parser.ImportSymbolContext(self, self._ctx, self.state) + self.enterRule(localctx, 4, self.RULE_importSymbol) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 68 + self.match(T4Parser.T__0) + self.state = 69 + localctx.name = self.match(T4Parser.IDENTIFIER) + self.state = 70 + localctx.version = self.match(T4Parser.VERSION) + self.state = 72 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la==T4Parser.T__1: + self.state = 71 + self.match(T4Parser.T__1) + + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class ModuleSymbolContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + self.comment = None # Token + self.name = None # Token + self.version = None # Token + + def IDENTIFIER(self): + return self.getToken(T4Parser.IDENTIFIER, 0) + + def VERSION(self): + return self.getToken(T4Parser.VERSION, 0) + + def tagSymbol(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(T4Parser.TagSymbolContext) + else: + return self.getTypedRuleContext(T4Parser.TagSymbolContext,i) + + + def DOCCOMMENT(self): + return self.getToken(T4Parser.DOCCOMMENT, 0) + + def getRuleIndex(self): + return T4Parser.RULE_moduleSymbol + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterModuleSymbol" ): + listener.enterModuleSymbol(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitModuleSymbol" ): + listener.exitModuleSymbol(self) + + + + + def moduleSymbol(self): + + localctx = T4Parser.ModuleSymbolContext(self, self._ctx, self.state) + self.enterRule(localctx, 6, self.RULE_moduleSymbol) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 75 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la==T4Parser.DOCCOMMENT: + self.state = 74 + localctx.comment = self.match(T4Parser.DOCCOMMENT) + + + self.state = 80 + self._errHandler.sync(self) + _la = self._input.LA(1) + while _la==T4Parser.TAGLINE: + self.state = 77 + self.tagSymbol() + self.state = 82 + self._errHandler.sync(self) + _la = self._input.LA(1) + + self.state = 83 + self.match(T4Parser.T__2) + self.state = 84 + localctx.name = self.match(T4Parser.IDENTIFIER) + self.state = 85 + localctx.version = self.match(T4Parser.VERSION) + self.state = 87 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la==T4Parser.T__1: + self.state = 86 + self.match(T4Parser.T__1) + + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class DefinitionSymbolContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def interfaceSymbol(self): + return self.getTypedRuleContext(T4Parser.InterfaceSymbolContext,0) + + + def structSymbol(self): + return self.getTypedRuleContext(T4Parser.StructSymbolContext,0) + + + def enumSymbol(self): + return self.getTypedRuleContext(T4Parser.EnumSymbolContext,0) + + + def getRuleIndex(self): + return T4Parser.RULE_definitionSymbol + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterDefinitionSymbol" ): + listener.enterDefinitionSymbol(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitDefinitionSymbol" ): + listener.exitDefinitionSymbol(self) + + + + + def definitionSymbol(self): + + localctx = T4Parser.DefinitionSymbolContext(self, self._ctx, self.state) + self.enterRule(localctx, 8, self.RULE_definitionSymbol) + try: + self.state = 92 + self._errHandler.sync(self) + la_ = self._interp.adaptivePredict(self._input,6,self._ctx) + if la_ == 1: + self.enterOuterAlt(localctx, 1) + self.state = 89 + self.interfaceSymbol() + pass + + elif la_ == 2: + self.enterOuterAlt(localctx, 2) + self.state = 90 + self.structSymbol() + pass + + elif la_ == 3: + self.enterOuterAlt(localctx, 3) + self.state = 91 + self.enumSymbol() + pass + + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class InterfaceSymbolContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + self.comment = None # Token + self.name = None # Token + self.extends = None # Token + + def IDENTIFIER(self, i:int=None): + if i is None: + return self.getTokens(T4Parser.IDENTIFIER) + else: + return self.getToken(T4Parser.IDENTIFIER, i) + + def tagSymbol(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(T4Parser.TagSymbolContext) + else: + return self.getTypedRuleContext(T4Parser.TagSymbolContext,i) + + + def interfaceMemberSymbol(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(T4Parser.InterfaceMemberSymbolContext) + else: + return self.getTypedRuleContext(T4Parser.InterfaceMemberSymbolContext,i) + + + def DOCCOMMENT(self): + return self.getToken(T4Parser.DOCCOMMENT, 0) + + def getRuleIndex(self): + return T4Parser.RULE_interfaceSymbol + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterInterfaceSymbol" ): + listener.enterInterfaceSymbol(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitInterfaceSymbol" ): + listener.exitInterfaceSymbol(self) + + + + + def interfaceSymbol(self): + + localctx = T4Parser.InterfaceSymbolContext(self, self._ctx, self.state) + self.enterRule(localctx, 10, self.RULE_interfaceSymbol) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 95 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la==T4Parser.DOCCOMMENT: + self.state = 94 + localctx.comment = self.match(T4Parser.DOCCOMMENT) + + + self.state = 100 + self._errHandler.sync(self) + _la = self._input.LA(1) + while _la==T4Parser.TAGLINE: + self.state = 97 + self.tagSymbol() + self.state = 102 + self._errHandler.sync(self) + _la = self._input.LA(1) + + self.state = 103 + self.match(T4Parser.T__3) + self.state = 104 + localctx.name = self.match(T4Parser.IDENTIFIER) + self.state = 107 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la==T4Parser.T__4: + self.state = 105 + self.match(T4Parser.T__4) + self.state = 106 + localctx.extends = self.match(T4Parser.IDENTIFIER) + + + self.state = 109 + self.match(T4Parser.T__5) + self.state = 113 + self._errHandler.sync(self) + _la = self._input.LA(1) + while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << T4Parser.T__7) | (1 << T4Parser.T__10) | (1 << T4Parser.T__11) | (1 << T4Parser.T__13) | (1 << T4Parser.T__15) | (1 << T4Parser.T__16) | (1 << T4Parser.T__17) | (1 << T4Parser.T__18) | (1 << T4Parser.T__19) | (1 << T4Parser.T__20) | (1 << T4Parser.T__23) | (1 << T4Parser.T__24) | (1 << T4Parser.TAGLINE) | (1 << T4Parser.IDENTIFIER) | (1 << T4Parser.DOCCOMMENT))) != 0): + self.state = 110 + self.interfaceMemberSymbol() + self.state = 115 + self._errHandler.sync(self) + _la = self._input.LA(1) + + self.state = 116 + self.match(T4Parser.T__6) + self.state = 118 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la==T4Parser.T__1: + self.state = 117 + self.match(T4Parser.T__1) + + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class InterfaceMemberSymbolContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def operationSymbol(self): + return self.getTypedRuleContext(T4Parser.OperationSymbolContext,0) + + + def propertySymbol(self): + return self.getTypedRuleContext(T4Parser.PropertySymbolContext,0) + + + def signalSymbol(self): + return self.getTypedRuleContext(T4Parser.SignalSymbolContext,0) + + + def getRuleIndex(self): + return T4Parser.RULE_interfaceMemberSymbol + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterInterfaceMemberSymbol" ): + listener.enterInterfaceMemberSymbol(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitInterfaceMemberSymbol" ): + listener.exitInterfaceMemberSymbol(self) + + + + + def interfaceMemberSymbol(self): + + localctx = T4Parser.InterfaceMemberSymbolContext(self, self._ctx, self.state) + self.enterRule(localctx, 12, self.RULE_interfaceMemberSymbol) + try: + self.state = 123 + self._errHandler.sync(self) + la_ = self._interp.adaptivePredict(self._input,12,self._ctx) + if la_ == 1: + self.enterOuterAlt(localctx, 1) + self.state = 120 + self.operationSymbol() + pass + + elif la_ == 2: + self.enterOuterAlt(localctx, 2) + self.state = 121 + self.propertySymbol() + pass + + elif la_ == 3: + self.enterOuterAlt(localctx, 3) + self.state = 122 + self.signalSymbol() + pass + + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class OperationSymbolContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + self.comment = None # Token + self.name = None # Token + + def IDENTIFIER(self): + return self.getToken(T4Parser.IDENTIFIER, 0) + + def typeSymbol(self): + return self.getTypedRuleContext(T4Parser.TypeSymbolContext,0) + + + def tagSymbol(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(T4Parser.TagSymbolContext) + else: + return self.getTypedRuleContext(T4Parser.TagSymbolContext,i) + + + def operationParameterSymbol(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(T4Parser.OperationParameterSymbolContext) + else: + return self.getTypedRuleContext(T4Parser.OperationParameterSymbolContext,i) + + + def operationModifierSymbol(self): + return self.getTypedRuleContext(T4Parser.OperationModifierSymbolContext,0) + + + def DOCCOMMENT(self): + return self.getToken(T4Parser.DOCCOMMENT, 0) + + def getRuleIndex(self): + return T4Parser.RULE_operationSymbol + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterOperationSymbol" ): + listener.enterOperationSymbol(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitOperationSymbol" ): + listener.exitOperationSymbol(self) + + + + + def operationSymbol(self): + + localctx = T4Parser.OperationSymbolContext(self, self._ctx, self.state) + self.enterRule(localctx, 14, self.RULE_operationSymbol) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 126 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la==T4Parser.DOCCOMMENT: + self.state = 125 + localctx.comment = self.match(T4Parser.DOCCOMMENT) + + + self.state = 131 + self._errHandler.sync(self) + _la = self._input.LA(1) + while _la==T4Parser.TAGLINE: + self.state = 128 + self.tagSymbol() + self.state = 133 + self._errHandler.sync(self) + _la = self._input.LA(1) + + self.state = 136 + self._errHandler.sync(self) + token = self._input.LA(1) + if token in [T4Parser.T__15, T4Parser.T__16, T4Parser.T__17, T4Parser.T__18, T4Parser.T__19, T4Parser.T__20, T4Parser.T__23, T4Parser.T__24, T4Parser.IDENTIFIER]: + self.state = 134 + self.typeSymbol() + pass + elif token in [T4Parser.T__7]: + self.state = 135 + self.match(T4Parser.T__7) + pass + else: + raise NoViableAltException(self) + + self.state = 138 + localctx.name = self.match(T4Parser.IDENTIFIER) + self.state = 139 + self.match(T4Parser.T__8) + self.state = 143 + self._errHandler.sync(self) + _la = self._input.LA(1) + while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << T4Parser.T__15) | (1 << T4Parser.T__16) | (1 << T4Parser.T__17) | (1 << T4Parser.T__18) | (1 << T4Parser.T__19) | (1 << T4Parser.T__20) | (1 << T4Parser.T__23) | (1 << T4Parser.T__24) | (1 << T4Parser.IDENTIFIER))) != 0): + self.state = 140 + self.operationParameterSymbol() + self.state = 145 + self._errHandler.sync(self) + _la = self._input.LA(1) + + self.state = 146 + self.match(T4Parser.T__9) + self.state = 148 + self._errHandler.sync(self) + la_ = self._interp.adaptivePredict(self._input,17,self._ctx) + if la_ == 1: + self.state = 147 + self.operationModifierSymbol() + + + self.state = 151 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la==T4Parser.T__1: + self.state = 150 + self.match(T4Parser.T__1) + + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class OperationModifierSymbolContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + self.is_const = None # Token + + + def getRuleIndex(self): + return T4Parser.RULE_operationModifierSymbol + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterOperationModifierSymbol" ): + listener.enterOperationModifierSymbol(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitOperationModifierSymbol" ): + listener.exitOperationModifierSymbol(self) + + + + + def operationModifierSymbol(self): + + localctx = T4Parser.OperationModifierSymbolContext(self, self._ctx, self.state) + self.enterRule(localctx, 16, self.RULE_operationModifierSymbol) + try: + self.enterOuterAlt(localctx, 1) + self.state = 153 + localctx.is_const = self.match(T4Parser.T__10) + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class SignalSymbolContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + self.comment = None # Token + self.name = None # Token + + def IDENTIFIER(self): + return self.getToken(T4Parser.IDENTIFIER, 0) + + def tagSymbol(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(T4Parser.TagSymbolContext) + else: + return self.getTypedRuleContext(T4Parser.TagSymbolContext,i) + + + def operationParameterSymbol(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(T4Parser.OperationParameterSymbolContext) + else: + return self.getTypedRuleContext(T4Parser.OperationParameterSymbolContext,i) + + + def DOCCOMMENT(self): + return self.getToken(T4Parser.DOCCOMMENT, 0) + + def getRuleIndex(self): + return T4Parser.RULE_signalSymbol + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterSignalSymbol" ): + listener.enterSignalSymbol(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitSignalSymbol" ): + listener.exitSignalSymbol(self) + + + + + def signalSymbol(self): + + localctx = T4Parser.SignalSymbolContext(self, self._ctx, self.state) + self.enterRule(localctx, 18, self.RULE_signalSymbol) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 156 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la==T4Parser.DOCCOMMENT: + self.state = 155 + localctx.comment = self.match(T4Parser.DOCCOMMENT) + + + self.state = 161 + self._errHandler.sync(self) + _la = self._input.LA(1) + while _la==T4Parser.TAGLINE: + self.state = 158 + self.tagSymbol() + self.state = 163 + self._errHandler.sync(self) + _la = self._input.LA(1) + + self.state = 164 + self.match(T4Parser.T__11) + self.state = 165 + localctx.name = self.match(T4Parser.IDENTIFIER) + self.state = 166 + self.match(T4Parser.T__8) + self.state = 170 + self._errHandler.sync(self) + _la = self._input.LA(1) + while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << T4Parser.T__15) | (1 << T4Parser.T__16) | (1 << T4Parser.T__17) | (1 << T4Parser.T__18) | (1 << T4Parser.T__19) | (1 << T4Parser.T__20) | (1 << T4Parser.T__23) | (1 << T4Parser.T__24) | (1 << T4Parser.IDENTIFIER))) != 0): + self.state = 167 + self.operationParameterSymbol() + self.state = 172 + self._errHandler.sync(self) + _la = self._input.LA(1) + + self.state = 173 + self.match(T4Parser.T__9) + self.state = 175 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la==T4Parser.T__1: + self.state = 174 + self.match(T4Parser.T__1) + + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class PropertySymbolContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + self.comment = None # Token + self.name = None # Token + self.value = None # Token + + def typeSymbol(self): + return self.getTypedRuleContext(T4Parser.TypeSymbolContext,0) + + + def IDENTIFIER(self): + return self.getToken(T4Parser.IDENTIFIER, 0) + + def tagSymbol(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(T4Parser.TagSymbolContext) + else: + return self.getTypedRuleContext(T4Parser.TagSymbolContext,i) + + + def propertyModifierSymbol(self): + return self.getTypedRuleContext(T4Parser.PropertyModifierSymbolContext,0) + + + def DOCCOMMENT(self): + return self.getToken(T4Parser.DOCCOMMENT, 0) + + def STRING(self): + return self.getToken(T4Parser.STRING, 0) + + def getRuleIndex(self): + return T4Parser.RULE_propertySymbol + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterPropertySymbol" ): + listener.enterPropertySymbol(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitPropertySymbol" ): + listener.exitPropertySymbol(self) + + + + + def propertySymbol(self): + + localctx = T4Parser.PropertySymbolContext(self, self._ctx, self.state) + self.enterRule(localctx, 20, self.RULE_propertySymbol) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 178 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la==T4Parser.DOCCOMMENT: + self.state = 177 + localctx.comment = self.match(T4Parser.DOCCOMMENT) + + + self.state = 183 + self._errHandler.sync(self) + _la = self._input.LA(1) + while _la==T4Parser.TAGLINE: + self.state = 180 + self.tagSymbol() + self.state = 185 + self._errHandler.sync(self) + _la = self._input.LA(1) + + self.state = 187 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la==T4Parser.T__10 or _la==T4Parser.T__13: + self.state = 186 + self.propertyModifierSymbol() + + + self.state = 189 + self.typeSymbol() + self.state = 190 + localctx.name = self.match(T4Parser.IDENTIFIER) + self.state = 193 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la==T4Parser.T__12: + self.state = 191 + self.match(T4Parser.T__12) + self.state = 192 + localctx.value = self.match(T4Parser.STRING) + + + self.state = 196 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la==T4Parser.T__1: + self.state = 195 + self.match(T4Parser.T__1) + + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class PropertyModifierSymbolContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + self.is_readonly = None # Token + self.is_const = None # Token + + + def getRuleIndex(self): + return T4Parser.RULE_propertyModifierSymbol + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterPropertyModifierSymbol" ): + listener.enterPropertyModifierSymbol(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitPropertyModifierSymbol" ): + listener.exitPropertyModifierSymbol(self) + + + + + def propertyModifierSymbol(self): + + localctx = T4Parser.PropertyModifierSymbolContext(self, self._ctx, self.state) + self.enterRule(localctx, 22, self.RULE_propertyModifierSymbol) + try: + self.state = 200 + self._errHandler.sync(self) + token = self._input.LA(1) + if token in [T4Parser.T__13]: + self.enterOuterAlt(localctx, 1) + self.state = 198 + localctx.is_readonly = self.match(T4Parser.T__13) + pass + elif token in [T4Parser.T__10]: + self.enterOuterAlt(localctx, 2) + self.state = 199 + localctx.is_const = self.match(T4Parser.T__10) + pass + else: + raise NoViableAltException(self) + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class OperationParameterSymbolContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + self.name = None # Token + + def typeSymbol(self): + return self.getTypedRuleContext(T4Parser.TypeSymbolContext,0) + + + def IDENTIFIER(self): + return self.getToken(T4Parser.IDENTIFIER, 0) + + def getRuleIndex(self): + return T4Parser.RULE_operationParameterSymbol + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterOperationParameterSymbol" ): + listener.enterOperationParameterSymbol(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitOperationParameterSymbol" ): + listener.exitOperationParameterSymbol(self) + + + + + def operationParameterSymbol(self): + + localctx = T4Parser.OperationParameterSymbolContext(self, self._ctx, self.state) + self.enterRule(localctx, 24, self.RULE_operationParameterSymbol) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 202 + self.typeSymbol() + self.state = 203 + localctx.name = self.match(T4Parser.IDENTIFIER) + self.state = 205 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la==T4Parser.T__14: + self.state = 204 + self.match(T4Parser.T__14) + + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class TagSymbolContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + self.line = None # Token + + def TAGLINE(self): + return self.getToken(T4Parser.TAGLINE, 0) + + def getRuleIndex(self): + return T4Parser.RULE_tagSymbol + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterTagSymbol" ): + listener.enterTagSymbol(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitTagSymbol" ): + listener.exitTagSymbol(self) + + + + + def tagSymbol(self): + + localctx = T4Parser.TagSymbolContext(self, self._ctx, self.state) + self.enterRule(localctx, 26, self.RULE_tagSymbol) + try: + self.enterOuterAlt(localctx, 1) + self.state = 207 + localctx.line = self.match(T4Parser.TAGLINE) + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class TagAttributeSymbolContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + self.name = None # Token + self.value = None # Token + + def IDENTIFIER(self, i:int=None): + if i is None: + return self.getTokens(T4Parser.IDENTIFIER) + else: + return self.getToken(T4Parser.IDENTIFIER, i) + + def getRuleIndex(self): + return T4Parser.RULE_tagAttributeSymbol + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterTagAttributeSymbol" ): + listener.enterTagAttributeSymbol(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitTagAttributeSymbol" ): + listener.exitTagAttributeSymbol(self) + + + + + def tagAttributeSymbol(self): + + localctx = T4Parser.TagAttributeSymbolContext(self, self._ctx, self.state) + self.enterRule(localctx, 28, self.RULE_tagAttributeSymbol) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 209 + localctx.name = self.match(T4Parser.IDENTIFIER) + self.state = 212 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la==T4Parser.T__12: + self.state = 210 + self.match(T4Parser.T__12) + self.state = 211 + localctx.value = self.match(T4Parser.IDENTIFIER) + + + self.state = 215 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la==T4Parser.T__14: + self.state = 214 + self.match(T4Parser.T__14) + + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class TypeSymbolContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def primitiveTypeSymbol(self): + return self.getTypedRuleContext(T4Parser.PrimitiveTypeSymbolContext,0) + + + def complexTypeSymbol(self): + return self.getTypedRuleContext(T4Parser.ComplexTypeSymbolContext,0) + + + def listTypeSymbol(self): + return self.getTypedRuleContext(T4Parser.ListTypeSymbolContext,0) + + + def mapTypeSymbol(self): + return self.getTypedRuleContext(T4Parser.MapTypeSymbolContext,0) + + + def modelTypeSymbol(self): + return self.getTypedRuleContext(T4Parser.ModelTypeSymbolContext,0) + + + def getRuleIndex(self): + return T4Parser.RULE_typeSymbol + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterTypeSymbol" ): + listener.enterTypeSymbol(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitTypeSymbol" ): + listener.exitTypeSymbol(self) + + + + + def typeSymbol(self): + + localctx = T4Parser.TypeSymbolContext(self, self._ctx, self.state) + self.enterRule(localctx, 30, self.RULE_typeSymbol) + try: + self.state = 222 + self._errHandler.sync(self) + token = self._input.LA(1) + if token in [T4Parser.T__15, T4Parser.T__16, T4Parser.T__17, T4Parser.T__18, T4Parser.T__19]: + self.enterOuterAlt(localctx, 1) + self.state = 217 + self.primitiveTypeSymbol() + pass + elif token in [T4Parser.IDENTIFIER]: + self.enterOuterAlt(localctx, 2) + self.state = 218 + self.complexTypeSymbol() + pass + elif token in [T4Parser.T__20]: + self.enterOuterAlt(localctx, 3) + self.state = 219 + self.listTypeSymbol() + pass + elif token in [T4Parser.T__23]: + self.enterOuterAlt(localctx, 4) + self.state = 220 + self.mapTypeSymbol() + pass + elif token in [T4Parser.T__24]: + self.enterOuterAlt(localctx, 5) + self.state = 221 + self.modelTypeSymbol() + pass + else: + raise NoViableAltException(self) + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class ComplexTypeSymbolContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + self.name = None # Token + + def IDENTIFIER(self): + return self.getToken(T4Parser.IDENTIFIER, 0) + + def getRuleIndex(self): + return T4Parser.RULE_complexTypeSymbol + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterComplexTypeSymbol" ): + listener.enterComplexTypeSymbol(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitComplexTypeSymbol" ): + listener.exitComplexTypeSymbol(self) + + + + + def complexTypeSymbol(self): + + localctx = T4Parser.ComplexTypeSymbolContext(self, self._ctx, self.state) + self.enterRule(localctx, 32, self.RULE_complexTypeSymbol) + try: + self.enterOuterAlt(localctx, 1) + self.state = 224 + localctx.name = self.match(T4Parser.IDENTIFIER) + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class PrimitiveTypeSymbolContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + self.name = None # Token + + + def getRuleIndex(self): + return T4Parser.RULE_primitiveTypeSymbol + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterPrimitiveTypeSymbol" ): + listener.enterPrimitiveTypeSymbol(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitPrimitiveTypeSymbol" ): + listener.exitPrimitiveTypeSymbol(self) + + + + + def primitiveTypeSymbol(self): + + localctx = T4Parser.PrimitiveTypeSymbolContext(self, self._ctx, self.state) + self.enterRule(localctx, 34, self.RULE_primitiveTypeSymbol) + try: + self.state = 231 + self._errHandler.sync(self) + token = self._input.LA(1) + if token in [T4Parser.T__15]: + self.enterOuterAlt(localctx, 1) + self.state = 226 + localctx.name = self.match(T4Parser.T__15) + pass + elif token in [T4Parser.T__16]: + self.enterOuterAlt(localctx, 2) + self.state = 227 + localctx.name = self.match(T4Parser.T__16) + pass + elif token in [T4Parser.T__17]: + self.enterOuterAlt(localctx, 3) + self.state = 228 + localctx.name = self.match(T4Parser.T__17) + pass + elif token in [T4Parser.T__18]: + self.enterOuterAlt(localctx, 4) + self.state = 229 + localctx.name = self.match(T4Parser.T__18) + pass + elif token in [T4Parser.T__19]: + self.enterOuterAlt(localctx, 5) + self.state = 230 + localctx.name = self.match(T4Parser.T__19) + pass + else: + raise NoViableAltException(self) + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class ListTypeSymbolContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + self.valueType = None # TypeSymbolContext + + def typeSymbol(self): + return self.getTypedRuleContext(T4Parser.TypeSymbolContext,0) + + + def getRuleIndex(self): + return T4Parser.RULE_listTypeSymbol + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterListTypeSymbol" ): + listener.enterListTypeSymbol(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitListTypeSymbol" ): + listener.exitListTypeSymbol(self) + + + + + def listTypeSymbol(self): + + localctx = T4Parser.ListTypeSymbolContext(self, self._ctx, self.state) + self.enterRule(localctx, 36, self.RULE_listTypeSymbol) + try: + self.enterOuterAlt(localctx, 1) + self.state = 233 + self.match(T4Parser.T__20) + self.state = 234 + self.match(T4Parser.T__21) + self.state = 235 + localctx.valueType = self.typeSymbol() + self.state = 236 + self.match(T4Parser.T__22) + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class MapTypeSymbolContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + self.valueType = None # TypeSymbolContext + + def typeSymbol(self): + return self.getTypedRuleContext(T4Parser.TypeSymbolContext,0) + + + def getRuleIndex(self): + return T4Parser.RULE_mapTypeSymbol + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterMapTypeSymbol" ): + listener.enterMapTypeSymbol(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitMapTypeSymbol" ): + listener.exitMapTypeSymbol(self) + + + + + def mapTypeSymbol(self): + + localctx = T4Parser.MapTypeSymbolContext(self, self._ctx, self.state) + self.enterRule(localctx, 38, self.RULE_mapTypeSymbol) + try: + self.enterOuterAlt(localctx, 1) + self.state = 238 + self.match(T4Parser.T__23) + self.state = 239 + self.match(T4Parser.T__21) + self.state = 240 + localctx.valueType = self.typeSymbol() + self.state = 241 + self.match(T4Parser.T__22) + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class ModelTypeSymbolContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + self.valueType = None # TypeSymbolContext + + def typeSymbol(self): + return self.getTypedRuleContext(T4Parser.TypeSymbolContext,0) + + + def getRuleIndex(self): + return T4Parser.RULE_modelTypeSymbol + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterModelTypeSymbol" ): + listener.enterModelTypeSymbol(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitModelTypeSymbol" ): + listener.exitModelTypeSymbol(self) + + + + + def modelTypeSymbol(self): + + localctx = T4Parser.ModelTypeSymbolContext(self, self._ctx, self.state) + self.enterRule(localctx, 40, self.RULE_modelTypeSymbol) + try: + self.enterOuterAlt(localctx, 1) + self.state = 243 + self.match(T4Parser.T__24) + self.state = 244 + self.match(T4Parser.T__21) + self.state = 245 + localctx.valueType = self.typeSymbol() + self.state = 246 + self.match(T4Parser.T__22) + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class StructSymbolContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + self.comment = None # Token + self.name = None # Token + + def IDENTIFIER(self): + return self.getToken(T4Parser.IDENTIFIER, 0) + + def tagSymbol(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(T4Parser.TagSymbolContext) + else: + return self.getTypedRuleContext(T4Parser.TagSymbolContext,i) + + + def structFieldSymbol(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(T4Parser.StructFieldSymbolContext) + else: + return self.getTypedRuleContext(T4Parser.StructFieldSymbolContext,i) + + + def DOCCOMMENT(self): + return self.getToken(T4Parser.DOCCOMMENT, 0) + + def getRuleIndex(self): + return T4Parser.RULE_structSymbol + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterStructSymbol" ): + listener.enterStructSymbol(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitStructSymbol" ): + listener.exitStructSymbol(self) + + + + + def structSymbol(self): + + localctx = T4Parser.StructSymbolContext(self, self._ctx, self.state) + self.enterRule(localctx, 42, self.RULE_structSymbol) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 249 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la==T4Parser.DOCCOMMENT: + self.state = 248 + localctx.comment = self.match(T4Parser.DOCCOMMENT) + + + self.state = 254 + self._errHandler.sync(self) + _la = self._input.LA(1) + while _la==T4Parser.TAGLINE: + self.state = 251 + self.tagSymbol() + self.state = 256 + self._errHandler.sync(self) + _la = self._input.LA(1) + + self.state = 257 + self.match(T4Parser.T__25) + self.state = 258 + localctx.name = self.match(T4Parser.IDENTIFIER) + self.state = 259 + self.match(T4Parser.T__5) + self.state = 263 + self._errHandler.sync(self) + _la = self._input.LA(1) + while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << T4Parser.T__15) | (1 << T4Parser.T__16) | (1 << T4Parser.T__17) | (1 << T4Parser.T__18) | (1 << T4Parser.T__19) | (1 << T4Parser.T__20) | (1 << T4Parser.T__23) | (1 << T4Parser.T__24) | (1 << T4Parser.TAGLINE) | (1 << T4Parser.IDENTIFIER) | (1 << T4Parser.DOCCOMMENT))) != 0): + self.state = 260 + self.structFieldSymbol() + self.state = 265 + self._errHandler.sync(self) + _la = self._input.LA(1) + + self.state = 266 + self.match(T4Parser.T__6) + self.state = 268 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la==T4Parser.T__1: + self.state = 267 + self.match(T4Parser.T__1) + + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class StructFieldSymbolContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + self.comment = None # Token + self.name = None # Token + self.value = None # Token + + def typeSymbol(self): + return self.getTypedRuleContext(T4Parser.TypeSymbolContext,0) + + + def IDENTIFIER(self): + return self.getToken(T4Parser.IDENTIFIER, 0) + + def tagSymbol(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(T4Parser.TagSymbolContext) + else: + return self.getTypedRuleContext(T4Parser.TagSymbolContext,i) + + + def DOCCOMMENT(self): + return self.getToken(T4Parser.DOCCOMMENT, 0) + + def STRING(self): + return self.getToken(T4Parser.STRING, 0) + + def getRuleIndex(self): + return T4Parser.RULE_structFieldSymbol + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterStructFieldSymbol" ): + listener.enterStructFieldSymbol(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitStructFieldSymbol" ): + listener.exitStructFieldSymbol(self) + + + + + def structFieldSymbol(self): + + localctx = T4Parser.StructFieldSymbolContext(self, self._ctx, self.state) + self.enterRule(localctx, 44, self.RULE_structFieldSymbol) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 271 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la==T4Parser.DOCCOMMENT: + self.state = 270 + localctx.comment = self.match(T4Parser.DOCCOMMENT) + + + self.state = 276 + self._errHandler.sync(self) + _la = self._input.LA(1) + while _la==T4Parser.TAGLINE: + self.state = 273 + self.tagSymbol() + self.state = 278 + self._errHandler.sync(self) + _la = self._input.LA(1) + + self.state = 279 + self.typeSymbol() + self.state = 280 + localctx.name = self.match(T4Parser.IDENTIFIER) + self.state = 283 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la==T4Parser.T__12: + self.state = 281 + self.match(T4Parser.T__12) + self.state = 282 + localctx.value = self.match(T4Parser.STRING) + + + self.state = 286 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la==T4Parser.T__1: + self.state = 285 + self.match(T4Parser.T__1) + + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class EnumSymbolContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + self.comment = None # Token + self.name = None # Token + + def enumTypeSymbol(self): + return self.getTypedRuleContext(T4Parser.EnumTypeSymbolContext,0) + + + def IDENTIFIER(self): + return self.getToken(T4Parser.IDENTIFIER, 0) + + def tagSymbol(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(T4Parser.TagSymbolContext) + else: + return self.getTypedRuleContext(T4Parser.TagSymbolContext,i) + + + def enumMemberSymbol(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(T4Parser.EnumMemberSymbolContext) + else: + return self.getTypedRuleContext(T4Parser.EnumMemberSymbolContext,i) + + + def DOCCOMMENT(self): + return self.getToken(T4Parser.DOCCOMMENT, 0) + + def getRuleIndex(self): + return T4Parser.RULE_enumSymbol + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterEnumSymbol" ): + listener.enterEnumSymbol(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitEnumSymbol" ): + listener.exitEnumSymbol(self) + + + + + def enumSymbol(self): + + localctx = T4Parser.EnumSymbolContext(self, self._ctx, self.state) + self.enterRule(localctx, 46, self.RULE_enumSymbol) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 289 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la==T4Parser.DOCCOMMENT: + self.state = 288 + localctx.comment = self.match(T4Parser.DOCCOMMENT) + + + self.state = 294 + self._errHandler.sync(self) + _la = self._input.LA(1) + while _la==T4Parser.TAGLINE: + self.state = 291 + self.tagSymbol() + self.state = 296 + self._errHandler.sync(self) + _la = self._input.LA(1) + + self.state = 297 + self.enumTypeSymbol() + self.state = 298 + localctx.name = self.match(T4Parser.IDENTIFIER) + self.state = 299 + self.match(T4Parser.T__5) + self.state = 303 + self._errHandler.sync(self) + _la = self._input.LA(1) + while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << T4Parser.TAGLINE) | (1 << T4Parser.IDENTIFIER) | (1 << T4Parser.DOCCOMMENT))) != 0): + self.state = 300 + self.enumMemberSymbol() + self.state = 305 + self._errHandler.sync(self) + _la = self._input.LA(1) + + self.state = 306 + self.match(T4Parser.T__6) + self.state = 308 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la==T4Parser.T__1: + self.state = 307 + self.match(T4Parser.T__1) + + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class EnumTypeSymbolContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + self.isEnum = None # Token + self.isFlag = None # Token + + + def getRuleIndex(self): + return T4Parser.RULE_enumTypeSymbol + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterEnumTypeSymbol" ): + listener.enterEnumTypeSymbol(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitEnumTypeSymbol" ): + listener.exitEnumTypeSymbol(self) + + + + + def enumTypeSymbol(self): + + localctx = T4Parser.EnumTypeSymbolContext(self, self._ctx, self.state) + self.enterRule(localctx, 48, self.RULE_enumTypeSymbol) + try: + self.state = 312 + self._errHandler.sync(self) + token = self._input.LA(1) + if token in [T4Parser.T__26]: + self.enterOuterAlt(localctx, 1) + self.state = 310 + localctx.isEnum = self.match(T4Parser.T__26) + pass + elif token in [T4Parser.T__27]: + self.enterOuterAlt(localctx, 2) + self.state = 311 + localctx.isFlag = self.match(T4Parser.T__27) + pass + else: + raise NoViableAltException(self) + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class EnumMemberSymbolContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + self.comment = None # Token + self.name = None # Token + + def IDENTIFIER(self): + return self.getToken(T4Parser.IDENTIFIER, 0) + + def tagSymbol(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(T4Parser.TagSymbolContext) + else: + return self.getTypedRuleContext(T4Parser.TagSymbolContext,i) + + + def intSymbol(self): + return self.getTypedRuleContext(T4Parser.IntSymbolContext,0) + + + def DOCCOMMENT(self): + return self.getToken(T4Parser.DOCCOMMENT, 0) + + def getRuleIndex(self): + return T4Parser.RULE_enumMemberSymbol + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterEnumMemberSymbol" ): + listener.enterEnumMemberSymbol(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitEnumMemberSymbol" ): + listener.exitEnumMemberSymbol(self) + + + + + def enumMemberSymbol(self): + + localctx = T4Parser.EnumMemberSymbolContext(self, self._ctx, self.state) + self.enterRule(localctx, 50, self.RULE_enumMemberSymbol) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 315 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la==T4Parser.DOCCOMMENT: + self.state = 314 + localctx.comment = self.match(T4Parser.DOCCOMMENT) + + + self.state = 320 + self._errHandler.sync(self) + _la = self._input.LA(1) + while _la==T4Parser.TAGLINE: + self.state = 317 + self.tagSymbol() + self.state = 322 + self._errHandler.sync(self) + _la = self._input.LA(1) + + self.state = 323 + localctx.name = self.match(T4Parser.IDENTIFIER) + self.state = 326 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la==T4Parser.T__12: + self.state = 324 + self.match(T4Parser.T__12) + self.state = 325 + self.intSymbol() + + + self.state = 329 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la==T4Parser.T__14: + self.state = 328 + self.match(T4Parser.T__14) + + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class IntSymbolContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + self.value = None # Token + + def INTCONSTANT(self): + return self.getToken(T4Parser.INTCONSTANT, 0) + + def HEXCONSTANT(self): + return self.getToken(T4Parser.HEXCONSTANT, 0) + + def getRuleIndex(self): + return T4Parser.RULE_intSymbol + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterIntSymbol" ): + listener.enterIntSymbol(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitIntSymbol" ): + listener.exitIntSymbol(self) + + + + + def intSymbol(self): + + localctx = T4Parser.IntSymbolContext(self, self._ctx, self.state) + self.enterRule(localctx, 52, self.RULE_intSymbol) + try: + self.state = 333 + self._errHandler.sync(self) + token = self._input.LA(1) + if token in [T4Parser.INTCONSTANT]: + self.enterOuterAlt(localctx, 1) + self.state = 331 + localctx.value = self.match(T4Parser.INTCONSTANT) + pass + elif token in [T4Parser.HEXCONSTANT]: + self.enterOuterAlt(localctx, 2) + self.state = 332 + localctx.value = self.match(T4Parser.HEXCONSTANT) + pass + else: + raise NoViableAltException(self) + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + + +