diff --git a/docs/extending.rst b/docs/extending.rst index 5252ed0..910c086 100644 --- a/docs/extending.rst +++ b/docs/extending.rst @@ -195,3 +195,33 @@ See below for a simple example {% endwith %} Each tag in the JavaDoc styled comment, will be converted into a property of the object returned by `parse_doc`. All lines without a tag will be merged into the description tag. + + +Language Profiles +================= + + +QFace supports the notion of profile. A profile is a set of features supported by the named profile. The intention of a profile is to make it easier for generator writers to stick to a limited set of language features, also if the overall language is evolving. + +Currently there exists three language profiles: + +* Micro - A limited set of languages features. The base profile. It does not allow importing of other modules or extending an interface, neither does it support maps. +* Advanced - Builds upon micro and allows imports, maps, interface extension. +* Full - Builds up on advanced and will also contain experimental language features. + +The current features defined are: +- const oeprations +- const properties +- imports +- maps +- interface extensions + +The profiles and features are defined in the `qface.idl.profile` module. + +.. code-block:: py + + from qface.generator import FileSystem + from qface.idl.profile import EProfile + + system = FileSystem.parse(input=input, profile=EProfile.MICRO) + diff --git a/docs/grammar.rst b/docs/grammar.rst index a8048ea..eb6546d 100644 --- a/docs/grammar.rst +++ b/docs/grammar.rst @@ -180,6 +180,8 @@ Below is an example of a QFace file. list primitiveList; list complexList; + map simpleMap; + map complexMap; model primitiveModel; model complexModel; } @@ -220,6 +222,22 @@ Below is an example of a QFace file. } + +Nested Types +============ + +A nested type is a complex type which nests another type. These are container types, e.g. list, map or model. + +.. code-block:: language + + list colors + map stations + model weather + +A list is an array of the provided value type. A map specifies only the value type. The key-type should be generic (e.g. a string type) and can be freely choosen by the generator. This allows for example the geenrator to add an id to each structure and use it as a key in the map. + +A model is a special type of a list, it defines the model type can stream the data (e.g. add/change/remove) and the changes should be reflected by a more advanced API. Also the data could in general grow unlimited and the generator should provide some form of pagination or window API. You should use a model if you expect the data it represents can grow in a way it may influence the performance of your API. + Annotations =========== diff --git a/qface/__about__.py b/qface/__about__.py index e63ff15..2b8012d 100644 --- a/qface/__about__.py +++ b/qface/__about__.py @@ -9,7 +9,7 @@ __title__ = "qface" __summary__ = "A generator framework based on a common modern IDL" __url__ = "https://pelagicore.github.io/qface/" -__version__ = "1.9.1" +__version__ = "1.10" __author__ = "JRyannel" __author_email__ = "qface-generator@googlegroups.com" -__copyright__ = "2019 Pelagicore" +__copyright__ = "2018 Pelagicore" diff --git a/qface/generator.py b/qface/generator.py index eb7b24a..91049ba 100644 --- a/qface/generator.py +++ b/qface/generator.py @@ -17,6 +17,7 @@ from .idl.parser.TLexer import TLexer from .idl.parser.TParser import TParser from .idl.parser.TListener import TListener +from .idl.profile import EProfile from .idl.domain import System from .idl.listener import DomainListener from .utils import merge @@ -256,10 +257,10 @@ class FileSystem(object): """ enables strict parsing """ @staticmethod - def parse_document(document: Path, system: System = None): + def parse_document(document: Path, system: System = None, profile=EProfile.FULL): error = False try: - return FileSystem._parse_document(document, system) + return FileSystem._parse_document(document, system, profile) except FileNotFoundError as e: click.secho('{0}: error: file not found'.format(document), fg='red', err=True) error = True @@ -270,7 +271,7 @@ def parse_document(document: Path, system: System = None): sys.exit(-1) @staticmethod - def _parse_document(document: Path, system: System = None): + def _parse_document(document: Path, system: System = None, profile=EProfile.FULL): """Parses a document and returns the resulting domain system :param path: document path to parse @@ -278,12 +279,12 @@ def _parse_document(document: Path, system: System = None): """ logger.debug('parse document: {0}'.format(document)) stream = FileStream(str(document), encoding='utf-8') - system = FileSystem._parse_stream(stream, system, document) + system = FileSystem._parse_stream(stream, system, document, profile) FileSystem.merge_annotations(system, document.stripext() + '.yaml') return system @staticmethod - def _parse_stream(stream, system: System = None, document=None): + def _parse_stream(stream, system: System = None, document=None, profile=EProfile.FULL): logger.debug('parse stream') system = system or System() @@ -293,7 +294,7 @@ def _parse_stream(stream, system: System = None, document=None): parser.addErrorListener(ReportingErrorListener(document)) tree = parser.documentSymbol() walker = ParseTreeWalker() - walker.walk(DomainListener(system), tree) + walker.walk(DomainListener(system, profile), tree) return system @staticmethod @@ -311,7 +312,7 @@ def merge_annotations(system, document): merge(symbol.tags, data) @staticmethod - def parse(input, identifier: str = None, use_cache=False, clear_cache=True, pattern="*.qface"): + def parse(input, identifier: str = None, use_cache=False, clear_cache=True, pattern="*.qface", profile=EProfile.FULL): """Input can be either a file or directory or a list of files or directory. A directory will be parsed recursively. The function returns the resulting system. Stores the result of the run in the domain cache named after the identifier. diff --git a/qface/helper/qtcpp.py b/qface/helper/qtcpp.py index dc37f2a..2c64e74 100644 --- a/qface/helper/qtcpp.py +++ b/qface/helper/qtcpp.py @@ -18,7 +18,7 @@ def className(symbol): @staticmethod def defaultValue(symbol): prefix = Filters.classPrefix - t = symbol.type # type: qface.domain.TypeSymbol + t = symbol.type if t.is_primitive: if t.is_int: return 'int(0)' @@ -33,30 +33,29 @@ def defaultValue(symbol): elif t.is_void: return '' elif t.is_enum: - module_name = upper_first(t.reference.module.module_name) value = next(iter(t.reference.members)) - return '{0}{1}Module::{2}'.format(prefix, module_name, value) + return '{0}::{0}Enum::{1}'.format(symbol.type, value) + elif symbol.kind == 'enum': + value = next(iter(symbol.members)) + return '{0}::{1}'.format(symbol, value) elif t.is_flag: return '0' - elif symbol.type.is_list: - nested = Filters.returnType(symbol.type.nested) + elif t.is_list: + nested = Filters.returnType(t.nested) return 'QVariantList()'.format(nested) - elif symbol.type.is_struct: - return '{0}{1}()'.format(prefix, symbol.type) - elif symbol.type.is_model: - nested = symbol.type.nested - if nested.is_primitive: - return 'new {0}VariantModel(this)'.format(prefix) - elif nested.is_complex: - return 'new {0}{1}Model(this)'.format(prefix, nested) - return 'XXX' + elif t.is_struct: + return '{0}{1}()'.format(prefix, t) + elif t.is_model: + return 'new VariantModel(this)' + elif t.is_interface: + return 'nullptr' + raise Exception("Unknown symbol type" + repr(symbol)) @staticmethod def parameterType(symbol): prefix = Filters.classPrefix - module_name = upper_first(symbol.module.module_name) if symbol.type.is_enum: - return '{0}{1}Module::{2} {3}'.format(prefix, module_name, symbol.type, symbol) + return '{0}::{0}Enum {1}'.format(symbol.type, symbol) if symbol.type.is_void or symbol.type.is_primitive: if symbol.type.is_string: return 'const QString &{0}'.format(symbol) @@ -73,22 +72,20 @@ def parameterType(symbol): nested = Filters.returnType(symbol.type.nested) return 'const QVariantList &{1}'.format(nested, symbol) elif symbol.type.is_model: - nested = symbol.type.nested - if nested.is_primitive: - return '{0}VariantModel *{1}'.format(prefix, symbol) - elif nested.is_complex: - return '{0}{1}Model *{2}'.format(prefix, nested, symbol) - else: - return 'const {0}{1} &{2}'.format(prefix, symbol.type, symbol) - return 'XXX' + return 'VariantModel *{0}'.format(symbol) + elif symbol.type.is_complex: + if symbol.type.is_interface: + return '{0}Base *{1}'.format(symbol.type, symbol) + else: + return 'const {0}{1} &{2}'.format(prefix, symbol.type, symbol) + raise Exception("Unknown symbol type") @staticmethod def returnType(symbol): prefix = Filters.classPrefix - module_name = upper_first(symbol.module.module_name) t = symbol.type if t.is_enum: - return '{0}{1}Module::{2}'.format(prefix, module_name, symbol.type) + return '{0}::{0}Enum'.format(symbol.type) if symbol.type.is_void or symbol.type.is_primitive: if t.is_string: return 'QString' @@ -108,14 +105,44 @@ def returnType(symbol): nested = Filters.returnType(symbol.type.nested) return 'QVariantList'.format(nested) elif symbol.type.is_model: - nested = symbol.type.nested - if nested.is_primitive: - return '{0}VariantModel *'.format(prefix) - elif nested.is_complex: - return '{0}{1}Model *'.format(prefix, nested) - else: - return '{0}{1}'.format(prefix, symbol.type) - return 'XXX' + return 'VariantModel *' + elif symbol.type.is_complex: + if symbol.type.is_interface: + return '{0}Base *'.format(symbol.type) + else: + return '{0}{1}'.format(prefix, symbol.type) + raise Exception("Unknown symbol type") + + @staticmethod + def header_dependencies(symbol): + types = symbol.dependencies + lines = [] + for t in types: + if t.is_primitive: + continue + if t.is_model: + lines.append('class VariantModel;') + if t.is_interface: + lines.append('class {0};'.format(t)) + if t.is_struct: + lines.append('#include "{0}.h"'.format(t)) + return "\n".join(lines) + + @staticmethod + def source_dependencies(symbol): + types = symbol.dependencies + lines = [] + module_name = symbol.module.module_name + if not symbol.kind == 'module': + lines.append('#include "{0}module.h"'.format(module_name.lower())) + for t in types: + if t.is_primitive: + continue + if t.is_model: + lines.append('#include "variantmodel.h"') + if t.is_interface: + lines.append('#include "{0}.h"'.format(t.name.lower())) + return "\n".join(lines) @staticmethod def open_ns(symbol): @@ -221,4 +248,6 @@ def get_filters(): 'identifier': Filters.identifier, 'path': Filters.path, 'className': Filters.className, + 'source_dependencies': Filters.source_dependencies, + 'header_dependencies': Filters.header_dependencies, } diff --git a/qface/idl/domain.py b/qface/idl/domain.py index 75a2950..4c52b1a 100644 --- a/qface/idl/domain.py +++ b/qface/idl/domain.py @@ -124,6 +124,7 @@ def __init__(self, name: str, module: 'Module'): self._tags = dict() self._contentMap = ChainMap() + self._dependencies = set() self.type = TypeSymbol('', self) self.kind = self.__class__.__name__.lower() """ the associated type information """ @@ -162,6 +163,12 @@ def contents(self): """ return general list of symbol contents """ return self._contentMap.values() + @property + def dependencies(self): + if not self._dependencies: + self._dependencies = [x.type for x in self.contents] + return self._dependencies + def toJson(self): o = super().toJson() if self.type.is_valid: @@ -184,6 +191,8 @@ def __init__(self, name: str, parent: NamedElement): """ if type represents a complex type """ self.is_list = False # type:bool """ if type represents a list of nested types """ + self.is_map = False # type:bool + """ if type represents a map of nested types. A key type is not defined """ self.is_model = False # type:bool """ if type represents a model of nested types """ self.nested = None @@ -197,6 +206,7 @@ def is_valid(self): return (self.is_primitive and self.name) \ or (self.is_complex and self.name) \ or (self.is_list and self.nested) \ + or (self.is_map and self.nested) \ or (self.is_model and self.nested) @property @@ -226,7 +236,7 @@ def is_var(self): @property def is_enumeration(self): - '''checks if type is complex and insytance of type Enum''' + '''checks if type is complex and instance of type Enum''' return self.is_complex and isinstance(self.reference, Enum) @property @@ -278,6 +288,8 @@ def toJson(self): o['complex'] = self.is_complex if self.is_list: o['list'] = self.is_list + if self.is_map: + o['map'] = self.is_map if self.is_model: o['model'] = self.is_model if self.nested: diff --git a/qface/idl/listener.py b/qface/idl/listener.py index 34a0c64..5fafa4f 100644 --- a/qface/idl/listener.py +++ b/qface/idl/listener.py @@ -7,11 +7,12 @@ from antlr4 import ParserRuleContext import yaml import click +from .profile import get_features, EProfile, EFeature try: - from yaml import CLoader as Loader, CDumper as Dumper + from yaml import CSafeLoader as Loader, CDumper as Dumper except ImportError: - from yaml import Loader, Dumper + from yaml import SafeLoader as Loader, Dumper log = logging.getLogger(__name__) @@ -20,15 +21,28 @@ contextMap = {} -class DomainListener(TListener): +class QFaceListener(TListener): + def __init__(self, system, profile=EProfile.FULL): + super().__init__() + click.secho('qface uses language profile: {}'.format(profile), fg='blue') + self.lang_features = get_features(profile) + self.system = system or System() # type:System + + def check_support(self, feature, report=True): + if feature not in self.lang_features and report: + click.secho('Unsuported language feature: {}'.format(EFeature.IMPORT), fg='red') + return False + return True + + +class DomainListener(QFaceListener): """The domain listener is called by the parser to fill the domain data struture. As a result a system is passed back""" - def __init__(self, system): - super(DomainListener, self).__init__() + def __init__(self, system, profile=EProfile.FULL): + super().__init__(system, profile) contextMap.clear() - self.system = system or System() # type:System self.module = None # type:Module self.interface = None # type:Interface self.struct = None # type:Struct @@ -63,6 +77,14 @@ def parse_type(self, ctx: ParserRuleContext, type: TypeSymbol): type.name = 'list' type.nested = TypeSymbol("", type) self.parse_type(ctxSymbol, type.nested) + elif ctx.typeSymbol().mapTypeSymbol(): + self.check_support(EFeature.MAPS) + # type:TParser.ListTypeSymbolContext + ctxSymbol = ctx.typeSymbol().mapTypeSymbol() + type.is_map = True + type.name = 'map' + type.nested = TypeSymbol("", type) + self.parse_type(ctxSymbol, type.nested) elif ctx.typeSymbol().modelTypeSymbol(): # type:TParser.ModelTypeSymbolContext ctxSymbol = ctx.typeSymbol().modelTypeSymbol() @@ -84,7 +106,7 @@ def parse_annotations(self, ctx, symbol): data = yaml.load('\n'.join(lines), Loader=Loader) symbol._tags = data except yaml.YAMLError as exc: - click.secho(exc, fg='red') + click.secho(str(exc), fg='red') def enterEveryRule(self, ctx): log.debug('enter ' + ctx.__class__.__name__) @@ -186,9 +208,18 @@ def enterPropertySymbol(self, ctx: TParser.PropertySymbolContext): name = ctx.name.text self.property = Property(name, self.interface) modifier = ctx.propertyModifierSymbol() + if modifier: self.property.readonly = bool(modifier.is_readonly) self.property.const = bool(modifier.is_const) + + # if ctx.value: + # try: + # value = yaml.load(ctx.value.text, Loader=Loader) + # self.property._value = value + # except yaml.YAMLError as exc: + # click.secho(exc, fg='red') + self.parse_annotations(ctx, self.property) self.parse_type(ctx, self.property.type) contextMap[ctx] = self.property @@ -227,6 +258,7 @@ def exitEnumMemberSymbol(self, ctx: TParser.EnumMemberSymbolContext): def enterImportSymbol(self, ctx: TParser.ImportSymbolContext): assert self.module + self.check_support(EFeature.IMPORT) name = ctx.name.text version = ctx.version.text self.module._importMap[name] = '{0} {1}'.format(name, version) diff --git a/qface/idl/parser/T.g4 b/qface/idl/parser/T.g4 index 9cfe4e7..8d07623 100644 --- a/qface/idl/parser/T.g4 +++ b/qface/idl/parser/T.g4 @@ -76,6 +76,7 @@ typeSymbol : primitiveTypeSymbol | complexTypeSymbol | listTypeSymbol + | mapTypeSymbol | modelTypeSymbol ; @@ -95,6 +96,10 @@ listTypeSymbol : 'list' '<' valueType=typeSymbol '>' ; +mapTypeSymbol + : 'map' '<' valueType=typeSymbol '>' + ; + modelTypeSymbol : 'model' '<' valueType=typeSymbol '>' ; diff --git a/qface/idl/parser/T.interp b/qface/idl/parser/T.interp new file mode 100644 index 0000000..9047ec1 --- /dev/null +++ b/qface/idl/parser/T.interp @@ -0,0 +1,114 @@ +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 + +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 +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: +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 40, 330, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 3, 2, 3, 2, 7, 2, 59, 10, 2, 12, 2, 14, 2, 62, 11, 2, 3, 3, 3, 3, 7, 3, 66, 10, 3, 12, 3, 14, 3, 69, 11, 3, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 75, 10, 4, 3, 5, 5, 5, 78, 10, 5, 3, 5, 7, 5, 81, 10, 5, 12, 5, 14, 5, 84, 11, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 90, 10, 5, 3, 6, 3, 6, 3, 6, 5, 6, 95, 10, 6, 3, 7, 5, 7, 98, 10, 7, 3, 7, 7, 7, 101, 10, 7, 12, 7, 14, 7, 104, 11, 7, 3, 7, 3, 7, 3, 7, 3, 7, 5, 7, 110, 10, 7, 3, 7, 3, 7, 7, 7, 114, 10, 7, 12, 7, 14, 7, 117, 11, 7, 3, 7, 3, 7, 5, 7, 121, 10, 7, 3, 8, 3, 8, 3, 8, 5, 8, 126, 10, 8, 3, 9, 5, 9, 129, 10, 9, 3, 9, 7, 9, 132, 10, 9, 12, 9, 14, 9, 135, 11, 9, 3, 9, 3, 9, 5, 9, 139, 10, 9, 3, 9, 3, 9, 3, 9, 7, 9, 144, 10, 9, 12, 9, 14, 9, 147, 11, 9, 3, 9, 3, 9, 5, 9, 151, 10, 9, 3, 9, 5, 9, 154, 10, 9, 3, 10, 3, 10, 3, 11, 5, 11, 159, 10, 11, 3, 11, 7, 11, 162, 10, 11, 12, 11, 14, 11, 165, 11, 11, 3, 11, 3, 11, 3, 11, 3, 11, 7, 11, 171, 10, 11, 12, 11, 14, 11, 174, 11, 11, 3, 11, 3, 11, 5, 11, 178, 10, 11, 3, 12, 5, 12, 181, 10, 12, 3, 12, 7, 12, 184, 10, 12, 12, 12, 14, 12, 187, 11, 12, 3, 12, 5, 12, 190, 10, 12, 3, 12, 3, 12, 3, 12, 5, 12, 195, 10, 12, 3, 13, 3, 13, 5, 13, 199, 10, 13, 3, 14, 3, 14, 3, 14, 5, 14, 204, 10, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 5, 16, 211, 10, 16, 3, 16, 5, 16, 214, 10, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 5, 17, 221, 10, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 5, 19, 230, 10, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 23, 5, 23, 248, 10, 23, 3, 23, 7, 23, 251, 10, 23, 12, 23, 14, 23, 254, 11, 23, 3, 23, 3, 23, 3, 23, 3, 23, 7, 23, 260, 10, 23, 12, 23, 14, 23, 263, 11, 23, 3, 23, 3, 23, 5, 23, 267, 10, 23, 3, 24, 5, 24, 270, 10, 24, 3, 24, 7, 24, 273, 10, 24, 12, 24, 14, 24, 276, 11, 24, 3, 24, 3, 24, 3, 24, 5, 24, 281, 10, 24, 3, 25, 5, 25, 284, 10, 25, 3, 25, 7, 25, 287, 10, 25, 12, 25, 14, 25, 290, 11, 25, 3, 25, 3, 25, 3, 25, 3, 25, 7, 25, 296, 10, 25, 12, 25, 14, 25, 299, 11, 25, 3, 25, 3, 25, 5, 25, 303, 10, 25, 3, 26, 3, 26, 5, 26, 307, 10, 26, 3, 27, 5, 27, 310, 10, 27, 3, 27, 7, 27, 313, 10, 27, 12, 27, 14, 27, 316, 11, 27, 3, 27, 3, 27, 3, 27, 5, 27, 321, 10, 27, 3, 27, 5, 27, 324, 10, 27, 3, 28, 3, 28, 5, 28, 328, 10, 28, 3, 28, 2, 2, 29, 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, 54, 2, 2, 2, 360, 2, 56, 3, 2, 2, 2, 4, 63, 3, 2, 2, 2, 6, 70, 3, 2, 2, 2, 8, 77, 3, 2, 2, 2, 10, 94, 3, 2, 2, 2, 12, 97, 3, 2, 2, 2, 14, 125, 3, 2, 2, 2, 16, 128, 3, 2, 2, 2, 18, 155, 3, 2, 2, 2, 20, 158, 3, 2, 2, 2, 22, 180, 3, 2, 2, 2, 24, 198, 3, 2, 2, 2, 26, 200, 3, 2, 2, 2, 28, 205, 3, 2, 2, 2, 30, 207, 3, 2, 2, 2, 32, 220, 3, 2, 2, 2, 34, 222, 3, 2, 2, 2, 36, 229, 3, 2, 2, 2, 38, 231, 3, 2, 2, 2, 40, 236, 3, 2, 2, 2, 42, 241, 3, 2, 2, 2, 44, 247, 3, 2, 2, 2, 46, 269, 3, 2, 2, 2, 48, 283, 3, 2, 2, 2, 50, 306, 3, 2, 2, 2, 52, 309, 3, 2, 2, 2, 54, 327, 3, 2, 2, 2, 56, 60, 5, 4, 3, 2, 57, 59, 5, 10, 6, 2, 58, 57, 3, 2, 2, 2, 59, 62, 3, 2, 2, 2, 60, 58, 3, 2, 2, 2, 60, 61, 3, 2, 2, 2, 61, 3, 3, 2, 2, 2, 62, 60, 3, 2, 2, 2, 63, 67, 5, 8, 5, 2, 64, 66, 5, 6, 4, 2, 65, 64, 3, 2, 2, 2, 66, 69, 3, 2, 2, 2, 67, 65, 3, 2, 2, 2, 67, 68, 3, 2, 2, 2, 68, 5, 3, 2, 2, 2, 69, 67, 3, 2, 2, 2, 70, 71, 7, 3, 2, 2, 71, 72, 7, 35, 2, 2, 72, 74, 7, 36, 2, 2, 73, 75, 7, 4, 2, 2, 74, 73, 3, 2, 2, 2, 74, 75, 3, 2, 2, 2, 75, 7, 3, 2, 2, 2, 76, 78, 7, 37, 2, 2, 77, 76, 3, 2, 2, 2, 77, 78, 3, 2, 2, 2, 78, 82, 3, 2, 2, 2, 79, 81, 5, 28, 15, 2, 80, 79, 3, 2, 2, 2, 81, 84, 3, 2, 2, 2, 82, 80, 3, 2, 2, 2, 82, 83, 3, 2, 2, 2, 83, 85, 3, 2, 2, 2, 84, 82, 3, 2, 2, 2, 85, 86, 7, 5, 2, 2, 86, 87, 7, 35, 2, 2, 87, 89, 7, 36, 2, 2, 88, 90, 7, 4, 2, 2, 89, 88, 3, 2, 2, 2, 89, 90, 3, 2, 2, 2, 90, 9, 3, 2, 2, 2, 91, 95, 5, 12, 7, 2, 92, 95, 5, 44, 23, 2, 93, 95, 5, 48, 25, 2, 94, 91, 3, 2, 2, 2, 94, 92, 3, 2, 2, 2, 94, 93, 3, 2, 2, 2, 95, 11, 3, 2, 2, 2, 96, 98, 7, 37, 2, 2, 97, 96, 3, 2, 2, 2, 97, 98, 3, 2, 2, 2, 98, 102, 3, 2, 2, 2, 99, 101, 5, 28, 15, 2, 100, 99, 3, 2, 2, 2, 101, 104, 3, 2, 2, 2, 102, 100, 3, 2, 2, 2, 102, 103, 3, 2, 2, 2, 103, 105, 3, 2, 2, 2, 104, 102, 3, 2, 2, 2, 105, 106, 7, 6, 2, 2, 106, 109, 7, 35, 2, 2, 107, 108, 7, 7, 2, 2, 108, 110, 7, 35, 2, 2, 109, 107, 3, 2, 2, 2, 109, 110, 3, 2, 2, 2, 110, 111, 3, 2, 2, 2, 111, 115, 7, 8, 2, 2, 112, 114, 5, 14, 8, 2, 113, 112, 3, 2, 2, 2, 114, 117, 3, 2, 2, 2, 115, 113, 3, 2, 2, 2, 115, 116, 3, 2, 2, 2, 116, 118, 3, 2, 2, 2, 117, 115, 3, 2, 2, 2, 118, 120, 7, 9, 2, 2, 119, 121, 7, 4, 2, 2, 120, 119, 3, 2, 2, 2, 120, 121, 3, 2, 2, 2, 121, 13, 3, 2, 2, 2, 122, 126, 5, 16, 9, 2, 123, 126, 5, 22, 12, 2, 124, 126, 5, 20, 11, 2, 125, 122, 3, 2, 2, 2, 125, 123, 3, 2, 2, 2, 125, 124, 3, 2, 2, 2, 126, 15, 3, 2, 2, 2, 127, 129, 7, 37, 2, 2, 128, 127, 3, 2, 2, 2, 128, 129, 3, 2, 2, 2, 129, 133, 3, 2, 2, 2, 130, 132, 5, 28, 15, 2, 131, 130, 3, 2, 2, 2, 132, 135, 3, 2, 2, 2, 133, 131, 3, 2, 2, 2, 133, 134, 3, 2, 2, 2, 134, 138, 3, 2, 2, 2, 135, 133, 3, 2, 2, 2, 136, 139, 5, 32, 17, 2, 137, 139, 7, 10, 2, 2, 138, 136, 3, 2, 2, 2, 138, 137, 3, 2, 2, 2, 139, 140, 3, 2, 2, 2, 140, 141, 7, 35, 2, 2, 141, 145, 7, 11, 2, 2, 142, 144, 5, 26, 14, 2, 143, 142, 3, 2, 2, 2, 144, 147, 3, 2, 2, 2, 145, 143, 3, 2, 2, 2, 145, 146, 3, 2, 2, 2, 146, 148, 3, 2, 2, 2, 147, 145, 3, 2, 2, 2, 148, 150, 7, 12, 2, 2, 149, 151, 5, 18, 10, 2, 150, 149, 3, 2, 2, 2, 150, 151, 3, 2, 2, 2, 151, 153, 3, 2, 2, 2, 152, 154, 7, 4, 2, 2, 153, 152, 3, 2, 2, 2, 153, 154, 3, 2, 2, 2, 154, 17, 3, 2, 2, 2, 155, 156, 7, 13, 2, 2, 156, 19, 3, 2, 2, 2, 157, 159, 7, 37, 2, 2, 158, 157, 3, 2, 2, 2, 158, 159, 3, 2, 2, 2, 159, 163, 3, 2, 2, 2, 160, 162, 5, 28, 15, 2, 161, 160, 3, 2, 2, 2, 162, 165, 3, 2, 2, 2, 163, 161, 3, 2, 2, 2, 163, 164, 3, 2, 2, 2, 164, 166, 3, 2, 2, 2, 165, 163, 3, 2, 2, 2, 166, 167, 7, 14, 2, 2, 167, 168, 7, 35, 2, 2, 168, 172, 7, 11, 2, 2, 169, 171, 5, 26, 14, 2, 170, 169, 3, 2, 2, 2, 171, 174, 3, 2, 2, 2, 172, 170, 3, 2, 2, 2, 172, 173, 3, 2, 2, 2, 173, 175, 3, 2, 2, 2, 174, 172, 3, 2, 2, 2, 175, 177, 7, 12, 2, 2, 176, 178, 7, 4, 2, 2, 177, 176, 3, 2, 2, 2, 177, 178, 3, 2, 2, 2, 178, 21, 3, 2, 2, 2, 179, 181, 7, 37, 2, 2, 180, 179, 3, 2, 2, 2, 180, 181, 3, 2, 2, 2, 181, 185, 3, 2, 2, 2, 182, 184, 5, 28, 15, 2, 183, 182, 3, 2, 2, 2, 184, 187, 3, 2, 2, 2, 185, 183, 3, 2, 2, 2, 185, 186, 3, 2, 2, 2, 186, 189, 3, 2, 2, 2, 187, 185, 3, 2, 2, 2, 188, 190, 5, 24, 13, 2, 189, 188, 3, 2, 2, 2, 189, 190, 3, 2, 2, 2, 190, 191, 3, 2, 2, 2, 191, 192, 5, 32, 17, 2, 192, 194, 7, 35, 2, 2, 193, 195, 7, 4, 2, 2, 194, 193, 3, 2, 2, 2, 194, 195, 3, 2, 2, 2, 195, 23, 3, 2, 2, 2, 196, 199, 7, 15, 2, 2, 197, 199, 7, 13, 2, 2, 198, 196, 3, 2, 2, 2, 198, 197, 3, 2, 2, 2, 199, 25, 3, 2, 2, 2, 200, 201, 5, 32, 17, 2, 201, 203, 7, 35, 2, 2, 202, 204, 7, 16, 2, 2, 203, 202, 3, 2, 2, 2, 203, 204, 3, 2, 2, 2, 204, 27, 3, 2, 2, 2, 205, 206, 7, 31, 2, 2, 206, 29, 3, 2, 2, 2, 207, 210, 7, 35, 2, 2, 208, 209, 7, 17, 2, 2, 209, 211, 7, 35, 2, 2, 210, 208, 3, 2, 2, 2, 210, 211, 3, 2, 2, 2, 211, 213, 3, 2, 2, 2, 212, 214, 7, 16, 2, 2, 213, 212, 3, 2, 2, 2, 213, 214, 3, 2, 2, 2, 214, 31, 3, 2, 2, 2, 215, 221, 5, 36, 19, 2, 216, 221, 5, 34, 18, 2, 217, 221, 5, 38, 20, 2, 218, 221, 5, 40, 21, 2, 219, 221, 5, 42, 22, 2, 220, 215, 3, 2, 2, 2, 220, 216, 3, 2, 2, 2, 220, 217, 3, 2, 2, 2, 220, 218, 3, 2, 2, 2, 220, 219, 3, 2, 2, 2, 221, 33, 3, 2, 2, 2, 222, 223, 7, 35, 2, 2, 223, 35, 3, 2, 2, 2, 224, 230, 7, 18, 2, 2, 225, 230, 7, 19, 2, 2, 226, 230, 7, 20, 2, 2, 227, 230, 7, 21, 2, 2, 228, 230, 7, 22, 2, 2, 229, 224, 3, 2, 2, 2, 229, 225, 3, 2, 2, 2, 229, 226, 3, 2, 2, 2, 229, 227, 3, 2, 2, 2, 229, 228, 3, 2, 2, 2, 230, 37, 3, 2, 2, 2, 231, 232, 7, 23, 2, 2, 232, 233, 7, 24, 2, 2, 233, 234, 5, 32, 17, 2, 234, 235, 7, 25, 2, 2, 235, 39, 3, 2, 2, 2, 236, 237, 7, 26, 2, 2, 237, 238, 7, 24, 2, 2, 238, 239, 5, 32, 17, 2, 239, 240, 7, 25, 2, 2, 240, 41, 3, 2, 2, 2, 241, 242, 7, 27, 2, 2, 242, 243, 7, 24, 2, 2, 243, 244, 5, 32, 17, 2, 244, 245, 7, 25, 2, 2, 245, 43, 3, 2, 2, 2, 246, 248, 7, 37, 2, 2, 247, 246, 3, 2, 2, 2, 247, 248, 3, 2, 2, 2, 248, 252, 3, 2, 2, 2, 249, 251, 5, 28, 15, 2, 250, 249, 3, 2, 2, 2, 251, 254, 3, 2, 2, 2, 252, 250, 3, 2, 2, 2, 252, 253, 3, 2, 2, 2, 253, 255, 3, 2, 2, 2, 254, 252, 3, 2, 2, 2, 255, 256, 7, 28, 2, 2, 256, 257, 7, 35, 2, 2, 257, 261, 7, 8, 2, 2, 258, 260, 5, 46, 24, 2, 259, 258, 3, 2, 2, 2, 260, 263, 3, 2, 2, 2, 261, 259, 3, 2, 2, 2, 261, 262, 3, 2, 2, 2, 262, 264, 3, 2, 2, 2, 263, 261, 3, 2, 2, 2, 264, 266, 7, 9, 2, 2, 265, 267, 7, 4, 2, 2, 266, 265, 3, 2, 2, 2, 266, 267, 3, 2, 2, 2, 267, 45, 3, 2, 2, 2, 268, 270, 7, 37, 2, 2, 269, 268, 3, 2, 2, 2, 269, 270, 3, 2, 2, 2, 270, 274, 3, 2, 2, 2, 271, 273, 5, 28, 15, 2, 272, 271, 3, 2, 2, 2, 273, 276, 3, 2, 2, 2, 274, 272, 3, 2, 2, 2, 274, 275, 3, 2, 2, 2, 275, 277, 3, 2, 2, 2, 276, 274, 3, 2, 2, 2, 277, 278, 5, 32, 17, 2, 278, 280, 7, 35, 2, 2, 279, 281, 7, 4, 2, 2, 280, 279, 3, 2, 2, 2, 280, 281, 3, 2, 2, 2, 281, 47, 3, 2, 2, 2, 282, 284, 7, 37, 2, 2, 283, 282, 3, 2, 2, 2, 283, 284, 3, 2, 2, 2, 284, 288, 3, 2, 2, 2, 285, 287, 5, 28, 15, 2, 286, 285, 3, 2, 2, 2, 287, 290, 3, 2, 2, 2, 288, 286, 3, 2, 2, 2, 288, 289, 3, 2, 2, 2, 289, 291, 3, 2, 2, 2, 290, 288, 3, 2, 2, 2, 291, 292, 5, 50, 26, 2, 292, 293, 7, 35, 2, 2, 293, 297, 7, 8, 2, 2, 294, 296, 5, 52, 27, 2, 295, 294, 3, 2, 2, 2, 296, 299, 3, 2, 2, 2, 297, 295, 3, 2, 2, 2, 297, 298, 3, 2, 2, 2, 298, 300, 3, 2, 2, 2, 299, 297, 3, 2, 2, 2, 300, 302, 7, 9, 2, 2, 301, 303, 7, 4, 2, 2, 302, 301, 3, 2, 2, 2, 302, 303, 3, 2, 2, 2, 303, 49, 3, 2, 2, 2, 304, 307, 7, 29, 2, 2, 305, 307, 7, 30, 2, 2, 306, 304, 3, 2, 2, 2, 306, 305, 3, 2, 2, 2, 307, 51, 3, 2, 2, 2, 308, 310, 7, 37, 2, 2, 309, 308, 3, 2, 2, 2, 309, 310, 3, 2, 2, 2, 310, 314, 3, 2, 2, 2, 311, 313, 5, 28, 15, 2, 312, 311, 3, 2, 2, 2, 313, 316, 3, 2, 2, 2, 314, 312, 3, 2, 2, 2, 314, 315, 3, 2, 2, 2, 315, 317, 3, 2, 2, 2, 316, 314, 3, 2, 2, 2, 317, 320, 7, 35, 2, 2, 318, 319, 7, 17, 2, 2, 319, 321, 5, 54, 28, 2, 320, 318, 3, 2, 2, 2, 320, 321, 3, 2, 2, 2, 321, 323, 3, 2, 2, 2, 322, 324, 7, 16, 2, 2, 323, 322, 3, 2, 2, 2, 323, 324, 3, 2, 2, 2, 324, 53, 3, 2, 2, 2, 325, 328, 7, 32, 2, 2, 326, 328, 7, 33, 2, 2, 327, 325, 3, 2, 2, 2, 327, 326, 3, 2, 2, 2, 328, 55, 3, 2, 2, 2, 52, 60, 67, 74, 77, 82, 89, 94, 97, 102, 109, 115, 120, 125, 128, 133, 138, 145, 150, 153, 158, 163, 172, 177, 180, 185, 189, 194, 198, 203, 210, 213, 220, 229, 247, 252, 261, 266, 269, 274, 280, 283, 288, 297, 302, 306, 309, 314, 320, 323, 327] \ No newline at end of file diff --git a/qface/idl/parser/T.tokens b/qface/idl/parser/T.tokens index 5f94603..4f861bd 100644 --- a/qface/idl/parser/T.tokens +++ b/qface/idl/parser/T.tokens @@ -25,16 +25,17 @@ T__23=24 T__24=25 T__25=26 T__26=27 -TAGLINE=28 -INTCONSTANT=29 -HEXCONSTANT=30 -TAGIDENTIFIER=31 -IDENTIFIER=32 -VERSION=33 -DOCCOMMENT=34 -WHITESPACE=35 -COMMENT=36 -MULTICOMM=37 +T__27=28 +TAGLINE=29 +INTCONSTANT=30 +HEXCONSTANT=31 +TAGIDENTIFIER=32 +IDENTIFIER=33 +VERSION=34 +DOCCOMMENT=35 +WHITESPACE=36 +COMMENT=37 +MULTICOMM=38 'import'=1 ';'=2 'module'=3 @@ -58,7 +59,8 @@ MULTICOMM=37 'list'=21 '<'=22 '>'=23 -'model'=24 -'struct'=25 -'enum'=26 -'flag'=27 +'map'=24 +'model'=25 +'struct'=26 +'enum'=27 +'flag'=28 diff --git a/qface/idl/parser/TLexer.interp b/qface/idl/parser/TLexer.interp new file mode 100644 index 0000000..5f065b5 --- /dev/null +++ b/qface/idl/parser/TLexer.interp @@ -0,0 +1,131 @@ +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 + +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 +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 +TAGLINE +INTCONSTANT +HEXCONSTANT +TAGIDENTIFIER +IDENTIFIER +VERSION +DOCCOMMENT +WHITESPACE +COMMENT +MULTICOMM + +channel names: +DEFAULT_TOKEN_CHANNEL +HIDDEN + +mode names: +DEFAULT_MODE + +atn: +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 40, 300, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 7, 30, 216, 10, 30, 12, 30, 14, 30, 219, 11, 30, 3, 31, 5, 31, 222, 10, 31, 3, 31, 6, 31, 225, 10, 31, 13, 31, 14, 31, 226, 3, 32, 3, 32, 3, 32, 3, 32, 6, 32, 233, 10, 32, 13, 32, 14, 32, 234, 3, 33, 3, 33, 3, 33, 7, 33, 240, 10, 33, 12, 33, 14, 33, 243, 11, 33, 3, 34, 3, 34, 7, 34, 247, 10, 34, 12, 34, 14, 34, 250, 11, 34, 3, 35, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 7, 36, 261, 10, 36, 12, 36, 14, 36, 264, 11, 36, 3, 36, 3, 36, 3, 36, 3, 37, 6, 37, 270, 10, 37, 13, 37, 14, 37, 271, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 38, 7, 38, 280, 10, 38, 12, 38, 14, 38, 283, 11, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 39, 7, 39, 291, 10, 39, 12, 39, 14, 39, 294, 11, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 4, 262, 292, 2, 40, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 73, 38, 75, 39, 77, 40, 3, 2, 9, 4, 2, 12, 12, 15, 15, 4, 2, 45, 45, 47, 47, 5, 2, 50, 59, 67, 72, 99, 104, 5, 2, 67, 92, 97, 97, 99, 124, 7, 2, 48, 48, 50, 59, 67, 92, 97, 97, 99, 124, 3, 2, 50, 59, 5, 2, 11, 12, 15, 15, 34, 34, 2, 309, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 3, 79, 3, 2, 2, 2, 5, 86, 3, 2, 2, 2, 7, 88, 3, 2, 2, 2, 9, 95, 3, 2, 2, 2, 11, 105, 3, 2, 2, 2, 13, 113, 3, 2, 2, 2, 15, 115, 3, 2, 2, 2, 17, 117, 3, 2, 2, 2, 19, 122, 3, 2, 2, 2, 21, 124, 3, 2, 2, 2, 23, 126, 3, 2, 2, 2, 25, 132, 3, 2, 2, 2, 27, 139, 3, 2, 2, 2, 29, 148, 3, 2, 2, 2, 31, 150, 3, 2, 2, 2, 33, 152, 3, 2, 2, 2, 35, 157, 3, 2, 2, 2, 37, 161, 3, 2, 2, 2, 39, 166, 3, 2, 2, 2, 41, 173, 3, 2, 2, 2, 43, 177, 3, 2, 2, 2, 45, 182, 3, 2, 2, 2, 47, 184, 3, 2, 2, 2, 49, 186, 3, 2, 2, 2, 51, 190, 3, 2, 2, 2, 53, 196, 3, 2, 2, 2, 55, 203, 3, 2, 2, 2, 57, 208, 3, 2, 2, 2, 59, 213, 3, 2, 2, 2, 61, 221, 3, 2, 2, 2, 63, 228, 3, 2, 2, 2, 65, 236, 3, 2, 2, 2, 67, 244, 3, 2, 2, 2, 69, 251, 3, 2, 2, 2, 71, 255, 3, 2, 2, 2, 73, 269, 3, 2, 2, 2, 75, 275, 3, 2, 2, 2, 77, 286, 3, 2, 2, 2, 79, 80, 7, 107, 2, 2, 80, 81, 7, 111, 2, 2, 81, 82, 7, 114, 2, 2, 82, 83, 7, 113, 2, 2, 83, 84, 7, 116, 2, 2, 84, 85, 7, 118, 2, 2, 85, 4, 3, 2, 2, 2, 86, 87, 7, 61, 2, 2, 87, 6, 3, 2, 2, 2, 88, 89, 7, 111, 2, 2, 89, 90, 7, 113, 2, 2, 90, 91, 7, 102, 2, 2, 91, 92, 7, 119, 2, 2, 92, 93, 7, 110, 2, 2, 93, 94, 7, 103, 2, 2, 94, 8, 3, 2, 2, 2, 95, 96, 7, 107, 2, 2, 96, 97, 7, 112, 2, 2, 97, 98, 7, 118, 2, 2, 98, 99, 7, 103, 2, 2, 99, 100, 7, 116, 2, 2, 100, 101, 7, 104, 2, 2, 101, 102, 7, 99, 2, 2, 102, 103, 7, 101, 2, 2, 103, 104, 7, 103, 2, 2, 104, 10, 3, 2, 2, 2, 105, 106, 7, 103, 2, 2, 106, 107, 7, 122, 2, 2, 107, 108, 7, 118, 2, 2, 108, 109, 7, 103, 2, 2, 109, 110, 7, 112, 2, 2, 110, 111, 7, 102, 2, 2, 111, 112, 7, 117, 2, 2, 112, 12, 3, 2, 2, 2, 113, 114, 7, 125, 2, 2, 114, 14, 3, 2, 2, 2, 115, 116, 7, 127, 2, 2, 116, 16, 3, 2, 2, 2, 117, 118, 7, 120, 2, 2, 118, 119, 7, 113, 2, 2, 119, 120, 7, 107, 2, 2, 120, 121, 7, 102, 2, 2, 121, 18, 3, 2, 2, 2, 122, 123, 7, 42, 2, 2, 123, 20, 3, 2, 2, 2, 124, 125, 7, 43, 2, 2, 125, 22, 3, 2, 2, 2, 126, 127, 7, 101, 2, 2, 127, 128, 7, 113, 2, 2, 128, 129, 7, 112, 2, 2, 129, 130, 7, 117, 2, 2, 130, 131, 7, 118, 2, 2, 131, 24, 3, 2, 2, 2, 132, 133, 7, 117, 2, 2, 133, 134, 7, 107, 2, 2, 134, 135, 7, 105, 2, 2, 135, 136, 7, 112, 2, 2, 136, 137, 7, 99, 2, 2, 137, 138, 7, 110, 2, 2, 138, 26, 3, 2, 2, 2, 139, 140, 7, 116, 2, 2, 140, 141, 7, 103, 2, 2, 141, 142, 7, 99, 2, 2, 142, 143, 7, 102, 2, 2, 143, 144, 7, 113, 2, 2, 144, 145, 7, 112, 2, 2, 145, 146, 7, 110, 2, 2, 146, 147, 7, 123, 2, 2, 147, 28, 3, 2, 2, 2, 148, 149, 7, 46, 2, 2, 149, 30, 3, 2, 2, 2, 150, 151, 7, 63, 2, 2, 151, 32, 3, 2, 2, 2, 152, 153, 7, 100, 2, 2, 153, 154, 7, 113, 2, 2, 154, 155, 7, 113, 2, 2, 155, 156, 7, 110, 2, 2, 156, 34, 3, 2, 2, 2, 157, 158, 7, 107, 2, 2, 158, 159, 7, 112, 2, 2, 159, 160, 7, 118, 2, 2, 160, 36, 3, 2, 2, 2, 161, 162, 7, 116, 2, 2, 162, 163, 7, 103, 2, 2, 163, 164, 7, 99, 2, 2, 164, 165, 7, 110, 2, 2, 165, 38, 3, 2, 2, 2, 166, 167, 7, 117, 2, 2, 167, 168, 7, 118, 2, 2, 168, 169, 7, 116, 2, 2, 169, 170, 7, 107, 2, 2, 170, 171, 7, 112, 2, 2, 171, 172, 7, 105, 2, 2, 172, 40, 3, 2, 2, 2, 173, 174, 7, 120, 2, 2, 174, 175, 7, 99, 2, 2, 175, 176, 7, 116, 2, 2, 176, 42, 3, 2, 2, 2, 177, 178, 7, 110, 2, 2, 178, 179, 7, 107, 2, 2, 179, 180, 7, 117, 2, 2, 180, 181, 7, 118, 2, 2, 181, 44, 3, 2, 2, 2, 182, 183, 7, 62, 2, 2, 183, 46, 3, 2, 2, 2, 184, 185, 7, 64, 2, 2, 185, 48, 3, 2, 2, 2, 186, 187, 7, 111, 2, 2, 187, 188, 7, 99, 2, 2, 188, 189, 7, 114, 2, 2, 189, 50, 3, 2, 2, 2, 190, 191, 7, 111, 2, 2, 191, 192, 7, 113, 2, 2, 192, 193, 7, 102, 2, 2, 193, 194, 7, 103, 2, 2, 194, 195, 7, 110, 2, 2, 195, 52, 3, 2, 2, 2, 196, 197, 7, 117, 2, 2, 197, 198, 7, 118, 2, 2, 198, 199, 7, 116, 2, 2, 199, 200, 7, 119, 2, 2, 200, 201, 7, 101, 2, 2, 201, 202, 7, 118, 2, 2, 202, 54, 3, 2, 2, 2, 203, 204, 7, 103, 2, 2, 204, 205, 7, 112, 2, 2, 205, 206, 7, 119, 2, 2, 206, 207, 7, 111, 2, 2, 207, 56, 3, 2, 2, 2, 208, 209, 7, 104, 2, 2, 209, 210, 7, 110, 2, 2, 210, 211, 7, 99, 2, 2, 211, 212, 7, 105, 2, 2, 212, 58, 3, 2, 2, 2, 213, 217, 7, 66, 2, 2, 214, 216, 10, 2, 2, 2, 215, 214, 3, 2, 2, 2, 216, 219, 3, 2, 2, 2, 217, 215, 3, 2, 2, 2, 217, 218, 3, 2, 2, 2, 218, 60, 3, 2, 2, 2, 219, 217, 3, 2, 2, 2, 220, 222, 9, 3, 2, 2, 221, 220, 3, 2, 2, 2, 221, 222, 3, 2, 2, 2, 222, 224, 3, 2, 2, 2, 223, 225, 4, 50, 59, 2, 224, 223, 3, 2, 2, 2, 225, 226, 3, 2, 2, 2, 226, 224, 3, 2, 2, 2, 226, 227, 3, 2, 2, 2, 227, 62, 3, 2, 2, 2, 228, 229, 7, 50, 2, 2, 229, 230, 7, 122, 2, 2, 230, 232, 3, 2, 2, 2, 231, 233, 9, 4, 2, 2, 232, 231, 3, 2, 2, 2, 233, 234, 3, 2, 2, 2, 234, 232, 3, 2, 2, 2, 234, 235, 3, 2, 2, 2, 235, 64, 3, 2, 2, 2, 236, 237, 7, 66, 2, 2, 237, 241, 9, 5, 2, 2, 238, 240, 9, 6, 2, 2, 239, 238, 3, 2, 2, 2, 240, 243, 3, 2, 2, 2, 241, 239, 3, 2, 2, 2, 241, 242, 3, 2, 2, 2, 242, 66, 3, 2, 2, 2, 243, 241, 3, 2, 2, 2, 244, 248, 9, 5, 2, 2, 245, 247, 9, 6, 2, 2, 246, 245, 3, 2, 2, 2, 247, 250, 3, 2, 2, 2, 248, 246, 3, 2, 2, 2, 248, 249, 3, 2, 2, 2, 249, 68, 3, 2, 2, 2, 250, 248, 3, 2, 2, 2, 251, 252, 9, 7, 2, 2, 252, 253, 7, 48, 2, 2, 253, 254, 9, 7, 2, 2, 254, 70, 3, 2, 2, 2, 255, 256, 7, 49, 2, 2, 256, 257, 7, 44, 2, 2, 257, 258, 7, 44, 2, 2, 258, 262, 3, 2, 2, 2, 259, 261, 11, 2, 2, 2, 260, 259, 3, 2, 2, 2, 261, 264, 3, 2, 2, 2, 262, 263, 3, 2, 2, 2, 262, 260, 3, 2, 2, 2, 263, 265, 3, 2, 2, 2, 264, 262, 3, 2, 2, 2, 265, 266, 7, 44, 2, 2, 266, 267, 7, 49, 2, 2, 267, 72, 3, 2, 2, 2, 268, 270, 9, 8, 2, 2, 269, 268, 3, 2, 2, 2, 270, 271, 3, 2, 2, 2, 271, 269, 3, 2, 2, 2, 271, 272, 3, 2, 2, 2, 272, 273, 3, 2, 2, 2, 273, 274, 8, 37, 2, 2, 274, 74, 3, 2, 2, 2, 275, 276, 7, 49, 2, 2, 276, 277, 7, 49, 2, 2, 277, 281, 3, 2, 2, 2, 278, 280, 10, 2, 2, 2, 279, 278, 3, 2, 2, 2, 280, 283, 3, 2, 2, 2, 281, 279, 3, 2, 2, 2, 281, 282, 3, 2, 2, 2, 282, 284, 3, 2, 2, 2, 283, 281, 3, 2, 2, 2, 284, 285, 8, 38, 2, 2, 285, 76, 3, 2, 2, 2, 286, 287, 7, 49, 2, 2, 287, 288, 7, 44, 2, 2, 288, 292, 3, 2, 2, 2, 289, 291, 11, 2, 2, 2, 290, 289, 3, 2, 2, 2, 291, 294, 3, 2, 2, 2, 292, 293, 3, 2, 2, 2, 292, 290, 3, 2, 2, 2, 293, 295, 3, 2, 2, 2, 294, 292, 3, 2, 2, 2, 295, 296, 7, 44, 2, 2, 296, 297, 7, 49, 2, 2, 297, 298, 3, 2, 2, 2, 298, 299, 8, 39, 2, 2, 299, 78, 3, 2, 2, 2, 13, 2, 217, 221, 226, 234, 241, 248, 262, 271, 281, 292, 3, 8, 2, 2] \ No newline at end of file diff --git a/qface/idl/parser/TLexer.py b/qface/idl/parser/TLexer.py index cb108c4..ec6e345 100644 --- a/qface/idl/parser/TLexer.py +++ b/qface/idl/parser/TLexer.py @@ -1,4 +1,4 @@ -# Generated from T.g4 by ANTLR 4.7 +# Generated from T.g4 by ANTLR 4.7.1 from antlr4 import * from io import StringIO from typing.io import TextIO @@ -7,128 +7,131 @@ def serializedATN(): with StringIO() as buf: - buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2\'") - buf.write("\u0126\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7") + buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2(") + buf.write("\u012c\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7") buf.write("\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r") buf.write("\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23") buf.write("\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30") buf.write("\4\31\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36") buf.write("\t\36\4\37\t\37\4 \t \4!\t!\4\"\t\"\4#\t#\4$\t$\4%\t%") - buf.write("\4&\t&\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\3\3\3\3\4\3\4\3\4") - buf.write("\3\4\3\4\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3") - buf.write("\5\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\7\3\7\3\b\3\b\3\t") - buf.write("\3\t\3\t\3\t\3\t\3\n\3\n\3\13\3\13\3\f\3\f\3\f\3\f\3\f") - buf.write("\3\f\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\16\3\16\3\16\3\16\3") - buf.write("\16\3\16\3\16\3\16\3\16\3\17\3\17\3\20\3\20\3\21\3\21") - buf.write("\3\21\3\21\3\21\3\22\3\22\3\22\3\22\3\23\3\23\3\23\3\23") - buf.write("\3\23\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\25\3\25\3\25") - buf.write("\3\25\3\26\3\26\3\26\3\26\3\26\3\27\3\27\3\30\3\30\3\31") - buf.write("\3\31\3\31\3\31\3\31\3\31\3\32\3\32\3\32\3\32\3\32\3\32") - buf.write("\3\32\3\33\3\33\3\33\3\33\3\33\3\34\3\34\3\34\3\34\3\34") - buf.write("\3\35\3\35\7\35\u00d2\n\35\f\35\16\35\u00d5\13\35\3\36") - buf.write("\5\36\u00d8\n\36\3\36\6\36\u00db\n\36\r\36\16\36\u00dc") - buf.write("\3\37\3\37\3\37\3\37\6\37\u00e3\n\37\r\37\16\37\u00e4") - buf.write("\3 \3 \3 \7 \u00ea\n \f \16 \u00ed\13 \3!\3!\7!\u00f1") - buf.write("\n!\f!\16!\u00f4\13!\3\"\3\"\3\"\3\"\3#\3#\3#\3#\3#\7") - buf.write("#\u00ff\n#\f#\16#\u0102\13#\3#\3#\3#\3$\6$\u0108\n$\r") - buf.write("$\16$\u0109\3$\3$\3%\3%\3%\3%\7%\u0112\n%\f%\16%\u0115") - buf.write("\13%\3%\3%\3&\3&\3&\3&\7&\u011d\n&\f&\16&\u0120\13&\3") - buf.write("&\3&\3&\3&\3&\4\u0100\u011e\2\'\3\3\5\4\7\5\t\6\13\7\r") - buf.write("\b\17\t\21\n\23\13\25\f\27\r\31\16\33\17\35\20\37\21!") - buf.write("\22#\23%\24\'\25)\26+\27-\30/\31\61\32\63\33\65\34\67") - buf.write("\359\36;\37= ?!A\"C#E$G%I&K\'\3\2\t\4\2\f\f\17\17\4\2") - buf.write("--//\5\2\62;CHch\5\2C\\aac|\7\2\60\60\62;C\\aac|\3\2\62") - buf.write(";\5\2\13\f\17\17\"\"\2\u012f\2\3\3\2\2\2\2\5\3\2\2\2\2") - buf.write("\7\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3") - buf.write("\2\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2") - buf.write("\2\2\2\31\3\2\2\2\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2\2") - buf.write("\2\2!\3\2\2\2\2#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)\3\2") - buf.write("\2\2\2+\3\2\2\2\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2\2\2\2\63") - buf.write("\3\2\2\2\2\65\3\2\2\2\2\67\3\2\2\2\29\3\2\2\2\2;\3\2\2") - buf.write("\2\2=\3\2\2\2\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2\2\2E\3\2") - buf.write("\2\2\2G\3\2\2\2\2I\3\2\2\2\2K\3\2\2\2\3M\3\2\2\2\5T\3") - buf.write("\2\2\2\7V\3\2\2\2\t]\3\2\2\2\13g\3\2\2\2\ro\3\2\2\2\17") - buf.write("q\3\2\2\2\21s\3\2\2\2\23x\3\2\2\2\25z\3\2\2\2\27|\3\2") - buf.write("\2\2\31\u0082\3\2\2\2\33\u0089\3\2\2\2\35\u0092\3\2\2") - buf.write("\2\37\u0094\3\2\2\2!\u0096\3\2\2\2#\u009b\3\2\2\2%\u009f") - buf.write("\3\2\2\2\'\u00a4\3\2\2\2)\u00ab\3\2\2\2+\u00af\3\2\2\2") - buf.write("-\u00b4\3\2\2\2/\u00b6\3\2\2\2\61\u00b8\3\2\2\2\63\u00be") - buf.write("\3\2\2\2\65\u00c5\3\2\2\2\67\u00ca\3\2\2\29\u00cf\3\2") - buf.write("\2\2;\u00d7\3\2\2\2=\u00de\3\2\2\2?\u00e6\3\2\2\2A\u00ee") - buf.write("\3\2\2\2C\u00f5\3\2\2\2E\u00f9\3\2\2\2G\u0107\3\2\2\2") - buf.write("I\u010d\3\2\2\2K\u0118\3\2\2\2MN\7k\2\2NO\7o\2\2OP\7r") - buf.write("\2\2PQ\7q\2\2QR\7t\2\2RS\7v\2\2S\4\3\2\2\2TU\7=\2\2U\6") - buf.write("\3\2\2\2VW\7o\2\2WX\7q\2\2XY\7f\2\2YZ\7w\2\2Z[\7n\2\2") - buf.write("[\\\7g\2\2\\\b\3\2\2\2]^\7k\2\2^_\7p\2\2_`\7v\2\2`a\7") - buf.write("g\2\2ab\7t\2\2bc\7h\2\2cd\7c\2\2de\7e\2\2ef\7g\2\2f\n") - buf.write("\3\2\2\2gh\7g\2\2hi\7z\2\2ij\7v\2\2jk\7g\2\2kl\7p\2\2") - buf.write("lm\7f\2\2mn\7u\2\2n\f\3\2\2\2op\7}\2\2p\16\3\2\2\2qr\7") - buf.write("\177\2\2r\20\3\2\2\2st\7x\2\2tu\7q\2\2uv\7k\2\2vw\7f\2") - buf.write("\2w\22\3\2\2\2xy\7*\2\2y\24\3\2\2\2z{\7+\2\2{\26\3\2\2") - buf.write("\2|}\7e\2\2}~\7q\2\2~\177\7p\2\2\177\u0080\7u\2\2\u0080") - buf.write("\u0081\7v\2\2\u0081\30\3\2\2\2\u0082\u0083\7u\2\2\u0083") - buf.write("\u0084\7k\2\2\u0084\u0085\7i\2\2\u0085\u0086\7p\2\2\u0086") - buf.write("\u0087\7c\2\2\u0087\u0088\7n\2\2\u0088\32\3\2\2\2\u0089") - buf.write("\u008a\7t\2\2\u008a\u008b\7g\2\2\u008b\u008c\7c\2\2\u008c") - buf.write("\u008d\7f\2\2\u008d\u008e\7q\2\2\u008e\u008f\7p\2\2\u008f") - buf.write("\u0090\7n\2\2\u0090\u0091\7{\2\2\u0091\34\3\2\2\2\u0092") - buf.write("\u0093\7.\2\2\u0093\36\3\2\2\2\u0094\u0095\7?\2\2\u0095") - buf.write(" \3\2\2\2\u0096\u0097\7d\2\2\u0097\u0098\7q\2\2\u0098") - buf.write("\u0099\7q\2\2\u0099\u009a\7n\2\2\u009a\"\3\2\2\2\u009b") - buf.write("\u009c\7k\2\2\u009c\u009d\7p\2\2\u009d\u009e\7v\2\2\u009e") - buf.write("$\3\2\2\2\u009f\u00a0\7t\2\2\u00a0\u00a1\7g\2\2\u00a1") - buf.write("\u00a2\7c\2\2\u00a2\u00a3\7n\2\2\u00a3&\3\2\2\2\u00a4") - buf.write("\u00a5\7u\2\2\u00a5\u00a6\7v\2\2\u00a6\u00a7\7t\2\2\u00a7") - buf.write("\u00a8\7k\2\2\u00a8\u00a9\7p\2\2\u00a9\u00aa\7i\2\2\u00aa") - buf.write("(\3\2\2\2\u00ab\u00ac\7x\2\2\u00ac\u00ad\7c\2\2\u00ad") - buf.write("\u00ae\7t\2\2\u00ae*\3\2\2\2\u00af\u00b0\7n\2\2\u00b0") - buf.write("\u00b1\7k\2\2\u00b1\u00b2\7u\2\2\u00b2\u00b3\7v\2\2\u00b3") - buf.write(",\3\2\2\2\u00b4\u00b5\7>\2\2\u00b5.\3\2\2\2\u00b6\u00b7") - buf.write("\7@\2\2\u00b7\60\3\2\2\2\u00b8\u00b9\7o\2\2\u00b9\u00ba") - buf.write("\7q\2\2\u00ba\u00bb\7f\2\2\u00bb\u00bc\7g\2\2\u00bc\u00bd") - buf.write("\7n\2\2\u00bd\62\3\2\2\2\u00be\u00bf\7u\2\2\u00bf\u00c0") - buf.write("\7v\2\2\u00c0\u00c1\7t\2\2\u00c1\u00c2\7w\2\2\u00c2\u00c3") - buf.write("\7e\2\2\u00c3\u00c4\7v\2\2\u00c4\64\3\2\2\2\u00c5\u00c6") - buf.write("\7g\2\2\u00c6\u00c7\7p\2\2\u00c7\u00c8\7w\2\2\u00c8\u00c9") - buf.write("\7o\2\2\u00c9\66\3\2\2\2\u00ca\u00cb\7h\2\2\u00cb\u00cc") - buf.write("\7n\2\2\u00cc\u00cd\7c\2\2\u00cd\u00ce\7i\2\2\u00ce8\3") - buf.write("\2\2\2\u00cf\u00d3\7B\2\2\u00d0\u00d2\n\2\2\2\u00d1\u00d0") - buf.write("\3\2\2\2\u00d2\u00d5\3\2\2\2\u00d3\u00d1\3\2\2\2\u00d3") - buf.write("\u00d4\3\2\2\2\u00d4:\3\2\2\2\u00d5\u00d3\3\2\2\2\u00d6") - buf.write("\u00d8\t\3\2\2\u00d7\u00d6\3\2\2\2\u00d7\u00d8\3\2\2\2") - buf.write("\u00d8\u00da\3\2\2\2\u00d9\u00db\4\62;\2\u00da\u00d9\3") - buf.write("\2\2\2\u00db\u00dc\3\2\2\2\u00dc\u00da\3\2\2\2\u00dc\u00dd") - buf.write("\3\2\2\2\u00dd<\3\2\2\2\u00de\u00df\7\62\2\2\u00df\u00e0") - buf.write("\7z\2\2\u00e0\u00e2\3\2\2\2\u00e1\u00e3\t\4\2\2\u00e2") - buf.write("\u00e1\3\2\2\2\u00e3\u00e4\3\2\2\2\u00e4\u00e2\3\2\2\2") - buf.write("\u00e4\u00e5\3\2\2\2\u00e5>\3\2\2\2\u00e6\u00e7\7B\2\2") - buf.write("\u00e7\u00eb\t\5\2\2\u00e8\u00ea\t\6\2\2\u00e9\u00e8\3") - buf.write("\2\2\2\u00ea\u00ed\3\2\2\2\u00eb\u00e9\3\2\2\2\u00eb\u00ec") - buf.write("\3\2\2\2\u00ec@\3\2\2\2\u00ed\u00eb\3\2\2\2\u00ee\u00f2") - buf.write("\t\5\2\2\u00ef\u00f1\t\6\2\2\u00f0\u00ef\3\2\2\2\u00f1") - buf.write("\u00f4\3\2\2\2\u00f2\u00f0\3\2\2\2\u00f2\u00f3\3\2\2\2") - buf.write("\u00f3B\3\2\2\2\u00f4\u00f2\3\2\2\2\u00f5\u00f6\t\7\2") - buf.write("\2\u00f6\u00f7\7\60\2\2\u00f7\u00f8\t\7\2\2\u00f8D\3\2") - buf.write("\2\2\u00f9\u00fa\7\61\2\2\u00fa\u00fb\7,\2\2\u00fb\u00fc") - buf.write("\7,\2\2\u00fc\u0100\3\2\2\2\u00fd\u00ff\13\2\2\2\u00fe") - buf.write("\u00fd\3\2\2\2\u00ff\u0102\3\2\2\2\u0100\u0101\3\2\2\2") - buf.write("\u0100\u00fe\3\2\2\2\u0101\u0103\3\2\2\2\u0102\u0100\3") - buf.write("\2\2\2\u0103\u0104\7,\2\2\u0104\u0105\7\61\2\2\u0105F") - buf.write("\3\2\2\2\u0106\u0108\t\b\2\2\u0107\u0106\3\2\2\2\u0108") - buf.write("\u0109\3\2\2\2\u0109\u0107\3\2\2\2\u0109\u010a\3\2\2\2") - buf.write("\u010a\u010b\3\2\2\2\u010b\u010c\b$\2\2\u010cH\3\2\2\2") - buf.write("\u010d\u010e\7\61\2\2\u010e\u010f\7\61\2\2\u010f\u0113") - buf.write("\3\2\2\2\u0110\u0112\n\2\2\2\u0111\u0110\3\2\2\2\u0112") - buf.write("\u0115\3\2\2\2\u0113\u0111\3\2\2\2\u0113\u0114\3\2\2\2") - buf.write("\u0114\u0116\3\2\2\2\u0115\u0113\3\2\2\2\u0116\u0117\b") - buf.write("%\2\2\u0117J\3\2\2\2\u0118\u0119\7\61\2\2\u0119\u011a") - buf.write("\7,\2\2\u011a\u011e\3\2\2\2\u011b\u011d\13\2\2\2\u011c") - buf.write("\u011b\3\2\2\2\u011d\u0120\3\2\2\2\u011e\u011f\3\2\2\2") - buf.write("\u011e\u011c\3\2\2\2\u011f\u0121\3\2\2\2\u0120\u011e\3") - buf.write("\2\2\2\u0121\u0122\7,\2\2\u0122\u0123\7\61\2\2\u0123\u0124") - buf.write("\3\2\2\2\u0124\u0125\b&\2\2\u0125L\3\2\2\2\r\2\u00d3\u00d7") - buf.write("\u00dc\u00e4\u00eb\u00f2\u0100\u0109\u0113\u011e\3\b\2") - buf.write("\2") + buf.write("\4&\t&\4\'\t\'\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\3\3\3\3\4") + buf.write("\3\4\3\4\3\4\3\4\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3") + buf.write("\5\3\5\3\5\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\7\3\7\3\b") + buf.write("\3\b\3\t\3\t\3\t\3\t\3\t\3\n\3\n\3\13\3\13\3\f\3\f\3\f") + buf.write("\3\f\3\f\3\f\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\16\3\16\3\16") + buf.write("\3\16\3\16\3\16\3\16\3\16\3\16\3\17\3\17\3\20\3\20\3\21") + buf.write("\3\21\3\21\3\21\3\21\3\22\3\22\3\22\3\22\3\23\3\23\3\23") + buf.write("\3\23\3\23\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\25\3\25") + buf.write("\3\25\3\25\3\26\3\26\3\26\3\26\3\26\3\27\3\27\3\30\3\30") + buf.write("\3\31\3\31\3\31\3\31\3\32\3\32\3\32\3\32\3\32\3\32\3\33") + buf.write("\3\33\3\33\3\33\3\33\3\33\3\33\3\34\3\34\3\34\3\34\3\34") + buf.write("\3\35\3\35\3\35\3\35\3\35\3\36\3\36\7\36\u00d8\n\36\f") + buf.write("\36\16\36\u00db\13\36\3\37\5\37\u00de\n\37\3\37\6\37\u00e1") + buf.write("\n\37\r\37\16\37\u00e2\3 \3 \3 \3 \6 \u00e9\n \r \16 ") + buf.write("\u00ea\3!\3!\3!\7!\u00f0\n!\f!\16!\u00f3\13!\3\"\3\"\7") + buf.write("\"\u00f7\n\"\f\"\16\"\u00fa\13\"\3#\3#\3#\3#\3$\3$\3$") + buf.write("\3$\3$\7$\u0105\n$\f$\16$\u0108\13$\3$\3$\3$\3%\6%\u010e") + buf.write("\n%\r%\16%\u010f\3%\3%\3&\3&\3&\3&\7&\u0118\n&\f&\16&") + buf.write("\u011b\13&\3&\3&\3\'\3\'\3\'\3\'\7\'\u0123\n\'\f\'\16") + buf.write("\'\u0126\13\'\3\'\3\'\3\'\3\'\3\'\4\u0106\u0124\2(\3\3") + buf.write("\5\4\7\5\t\6\13\7\r\b\17\t\21\n\23\13\25\f\27\r\31\16") + buf.write("\33\17\35\20\37\21!\22#\23%\24\'\25)\26+\27-\30/\31\61") + buf.write("\32\63\33\65\34\67\359\36;\37= ?!A\"C#E$G%I&K\'M(\3\2") + buf.write("\t\4\2\f\f\17\17\4\2--//\5\2\62;CHch\5\2C\\aac|\7\2\60") + buf.write("\60\62;C\\aac|\3\2\62;\5\2\13\f\17\17\"\"\2\u0135\2\3") + buf.write("\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13\3\2") + buf.write("\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21\3\2\2\2\2\23\3\2\2") + buf.write("\2\2\25\3\2\2\2\2\27\3\2\2\2\2\31\3\2\2\2\2\33\3\2\2\2") + buf.write("\2\35\3\2\2\2\2\37\3\2\2\2\2!\3\2\2\2\2#\3\2\2\2\2%\3") + buf.write("\2\2\2\2\'\3\2\2\2\2)\3\2\2\2\2+\3\2\2\2\2-\3\2\2\2\2") + buf.write("/\3\2\2\2\2\61\3\2\2\2\2\63\3\2\2\2\2\65\3\2\2\2\2\67") + buf.write("\3\2\2\2\29\3\2\2\2\2;\3\2\2\2\2=\3\2\2\2\2?\3\2\2\2\2") + buf.write("A\3\2\2\2\2C\3\2\2\2\2E\3\2\2\2\2G\3\2\2\2\2I\3\2\2\2") + buf.write("\2K\3\2\2\2\2M\3\2\2\2\3O\3\2\2\2\5V\3\2\2\2\7X\3\2\2") + buf.write("\2\t_\3\2\2\2\13i\3\2\2\2\rq\3\2\2\2\17s\3\2\2\2\21u\3") + buf.write("\2\2\2\23z\3\2\2\2\25|\3\2\2\2\27~\3\2\2\2\31\u0084\3") + buf.write("\2\2\2\33\u008b\3\2\2\2\35\u0094\3\2\2\2\37\u0096\3\2") + buf.write("\2\2!\u0098\3\2\2\2#\u009d\3\2\2\2%\u00a1\3\2\2\2\'\u00a6") + buf.write("\3\2\2\2)\u00ad\3\2\2\2+\u00b1\3\2\2\2-\u00b6\3\2\2\2") + buf.write("/\u00b8\3\2\2\2\61\u00ba\3\2\2\2\63\u00be\3\2\2\2\65\u00c4") + buf.write("\3\2\2\2\67\u00cb\3\2\2\29\u00d0\3\2\2\2;\u00d5\3\2\2") + buf.write("\2=\u00dd\3\2\2\2?\u00e4\3\2\2\2A\u00ec\3\2\2\2C\u00f4") + buf.write("\3\2\2\2E\u00fb\3\2\2\2G\u00ff\3\2\2\2I\u010d\3\2\2\2") + buf.write("K\u0113\3\2\2\2M\u011e\3\2\2\2OP\7k\2\2PQ\7o\2\2QR\7r") + buf.write("\2\2RS\7q\2\2ST\7t\2\2TU\7v\2\2U\4\3\2\2\2VW\7=\2\2W\6") + buf.write("\3\2\2\2XY\7o\2\2YZ\7q\2\2Z[\7f\2\2[\\\7w\2\2\\]\7n\2") + buf.write("\2]^\7g\2\2^\b\3\2\2\2_`\7k\2\2`a\7p\2\2ab\7v\2\2bc\7") + buf.write("g\2\2cd\7t\2\2de\7h\2\2ef\7c\2\2fg\7e\2\2gh\7g\2\2h\n") + buf.write("\3\2\2\2ij\7g\2\2jk\7z\2\2kl\7v\2\2lm\7g\2\2mn\7p\2\2") + buf.write("no\7f\2\2op\7u\2\2p\f\3\2\2\2qr\7}\2\2r\16\3\2\2\2st\7") + buf.write("\177\2\2t\20\3\2\2\2uv\7x\2\2vw\7q\2\2wx\7k\2\2xy\7f\2") + buf.write("\2y\22\3\2\2\2z{\7*\2\2{\24\3\2\2\2|}\7+\2\2}\26\3\2\2") + buf.write("\2~\177\7e\2\2\177\u0080\7q\2\2\u0080\u0081\7p\2\2\u0081") + buf.write("\u0082\7u\2\2\u0082\u0083\7v\2\2\u0083\30\3\2\2\2\u0084") + buf.write("\u0085\7u\2\2\u0085\u0086\7k\2\2\u0086\u0087\7i\2\2\u0087") + buf.write("\u0088\7p\2\2\u0088\u0089\7c\2\2\u0089\u008a\7n\2\2\u008a") + buf.write("\32\3\2\2\2\u008b\u008c\7t\2\2\u008c\u008d\7g\2\2\u008d") + buf.write("\u008e\7c\2\2\u008e\u008f\7f\2\2\u008f\u0090\7q\2\2\u0090") + buf.write("\u0091\7p\2\2\u0091\u0092\7n\2\2\u0092\u0093\7{\2\2\u0093") + buf.write("\34\3\2\2\2\u0094\u0095\7.\2\2\u0095\36\3\2\2\2\u0096") + buf.write("\u0097\7?\2\2\u0097 \3\2\2\2\u0098\u0099\7d\2\2\u0099") + buf.write("\u009a\7q\2\2\u009a\u009b\7q\2\2\u009b\u009c\7n\2\2\u009c") + buf.write("\"\3\2\2\2\u009d\u009e\7k\2\2\u009e\u009f\7p\2\2\u009f") + buf.write("\u00a0\7v\2\2\u00a0$\3\2\2\2\u00a1\u00a2\7t\2\2\u00a2") + buf.write("\u00a3\7g\2\2\u00a3\u00a4\7c\2\2\u00a4\u00a5\7n\2\2\u00a5") + buf.write("&\3\2\2\2\u00a6\u00a7\7u\2\2\u00a7\u00a8\7v\2\2\u00a8") + buf.write("\u00a9\7t\2\2\u00a9\u00aa\7k\2\2\u00aa\u00ab\7p\2\2\u00ab") + buf.write("\u00ac\7i\2\2\u00ac(\3\2\2\2\u00ad\u00ae\7x\2\2\u00ae") + buf.write("\u00af\7c\2\2\u00af\u00b0\7t\2\2\u00b0*\3\2\2\2\u00b1") + buf.write("\u00b2\7n\2\2\u00b2\u00b3\7k\2\2\u00b3\u00b4\7u\2\2\u00b4") + buf.write("\u00b5\7v\2\2\u00b5,\3\2\2\2\u00b6\u00b7\7>\2\2\u00b7") + buf.write(".\3\2\2\2\u00b8\u00b9\7@\2\2\u00b9\60\3\2\2\2\u00ba\u00bb") + buf.write("\7o\2\2\u00bb\u00bc\7c\2\2\u00bc\u00bd\7r\2\2\u00bd\62") + buf.write("\3\2\2\2\u00be\u00bf\7o\2\2\u00bf\u00c0\7q\2\2\u00c0\u00c1") + buf.write("\7f\2\2\u00c1\u00c2\7g\2\2\u00c2\u00c3\7n\2\2\u00c3\64") + buf.write("\3\2\2\2\u00c4\u00c5\7u\2\2\u00c5\u00c6\7v\2\2\u00c6\u00c7") + buf.write("\7t\2\2\u00c7\u00c8\7w\2\2\u00c8\u00c9\7e\2\2\u00c9\u00ca") + buf.write("\7v\2\2\u00ca\66\3\2\2\2\u00cb\u00cc\7g\2\2\u00cc\u00cd") + buf.write("\7p\2\2\u00cd\u00ce\7w\2\2\u00ce\u00cf\7o\2\2\u00cf8\3") + buf.write("\2\2\2\u00d0\u00d1\7h\2\2\u00d1\u00d2\7n\2\2\u00d2\u00d3") + buf.write("\7c\2\2\u00d3\u00d4\7i\2\2\u00d4:\3\2\2\2\u00d5\u00d9") + buf.write("\7B\2\2\u00d6\u00d8\n\2\2\2\u00d7\u00d6\3\2\2\2\u00d8") + buf.write("\u00db\3\2\2\2\u00d9\u00d7\3\2\2\2\u00d9\u00da\3\2\2\2") + buf.write("\u00da<\3\2\2\2\u00db\u00d9\3\2\2\2\u00dc\u00de\t\3\2") + buf.write("\2\u00dd\u00dc\3\2\2\2\u00dd\u00de\3\2\2\2\u00de\u00e0") + buf.write("\3\2\2\2\u00df\u00e1\4\62;\2\u00e0\u00df\3\2\2\2\u00e1") + buf.write("\u00e2\3\2\2\2\u00e2\u00e0\3\2\2\2\u00e2\u00e3\3\2\2\2") + buf.write("\u00e3>\3\2\2\2\u00e4\u00e5\7\62\2\2\u00e5\u00e6\7z\2") + buf.write("\2\u00e6\u00e8\3\2\2\2\u00e7\u00e9\t\4\2\2\u00e8\u00e7") + buf.write("\3\2\2\2\u00e9\u00ea\3\2\2\2\u00ea\u00e8\3\2\2\2\u00ea") + buf.write("\u00eb\3\2\2\2\u00eb@\3\2\2\2\u00ec\u00ed\7B\2\2\u00ed") + buf.write("\u00f1\t\5\2\2\u00ee\u00f0\t\6\2\2\u00ef\u00ee\3\2\2\2") + buf.write("\u00f0\u00f3\3\2\2\2\u00f1\u00ef\3\2\2\2\u00f1\u00f2\3") + buf.write("\2\2\2\u00f2B\3\2\2\2\u00f3\u00f1\3\2\2\2\u00f4\u00f8") + buf.write("\t\5\2\2\u00f5\u00f7\t\6\2\2\u00f6\u00f5\3\2\2\2\u00f7") + buf.write("\u00fa\3\2\2\2\u00f8\u00f6\3\2\2\2\u00f8\u00f9\3\2\2\2") + buf.write("\u00f9D\3\2\2\2\u00fa\u00f8\3\2\2\2\u00fb\u00fc\t\7\2") + buf.write("\2\u00fc\u00fd\7\60\2\2\u00fd\u00fe\t\7\2\2\u00feF\3\2") + buf.write("\2\2\u00ff\u0100\7\61\2\2\u0100\u0101\7,\2\2\u0101\u0102") + buf.write("\7,\2\2\u0102\u0106\3\2\2\2\u0103\u0105\13\2\2\2\u0104") + buf.write("\u0103\3\2\2\2\u0105\u0108\3\2\2\2\u0106\u0107\3\2\2\2") + buf.write("\u0106\u0104\3\2\2\2\u0107\u0109\3\2\2\2\u0108\u0106\3") + buf.write("\2\2\2\u0109\u010a\7,\2\2\u010a\u010b\7\61\2\2\u010bH") + buf.write("\3\2\2\2\u010c\u010e\t\b\2\2\u010d\u010c\3\2\2\2\u010e") + buf.write("\u010f\3\2\2\2\u010f\u010d\3\2\2\2\u010f\u0110\3\2\2\2") + buf.write("\u0110\u0111\3\2\2\2\u0111\u0112\b%\2\2\u0112J\3\2\2\2") + buf.write("\u0113\u0114\7\61\2\2\u0114\u0115\7\61\2\2\u0115\u0119") + buf.write("\3\2\2\2\u0116\u0118\n\2\2\2\u0117\u0116\3\2\2\2\u0118") + buf.write("\u011b\3\2\2\2\u0119\u0117\3\2\2\2\u0119\u011a\3\2\2\2") + buf.write("\u011a\u011c\3\2\2\2\u011b\u0119\3\2\2\2\u011c\u011d\b") + buf.write("&\2\2\u011dL\3\2\2\2\u011e\u011f\7\61\2\2\u011f\u0120") + buf.write("\7,\2\2\u0120\u0124\3\2\2\2\u0121\u0123\13\2\2\2\u0122") + buf.write("\u0121\3\2\2\2\u0123\u0126\3\2\2\2\u0124\u0125\3\2\2\2") + buf.write("\u0124\u0122\3\2\2\2\u0125\u0127\3\2\2\2\u0126\u0124\3") + buf.write("\2\2\2\u0127\u0128\7,\2\2\u0128\u0129\7\61\2\2\u0129\u012a") + buf.write("\3\2\2\2\u012a\u012b\b\'\2\2\u012bN\3\2\2\2\r\2\u00d9") + buf.write("\u00dd\u00e2\u00ea\u00f1\u00f8\u0106\u010f\u0119\u0124") + buf.write("\3\b\2\2") return buf.getvalue() @@ -165,16 +168,17 @@ class TLexer(Lexer): T__24 = 25 T__25 = 26 T__26 = 27 - TAGLINE = 28 - INTCONSTANT = 29 - HEXCONSTANT = 30 - TAGIDENTIFIER = 31 - IDENTIFIER = 32 - VERSION = 33 - DOCCOMMENT = 34 - WHITESPACE = 35 - COMMENT = 36 - MULTICOMM = 37 + T__27 = 28 + TAGLINE = 29 + INTCONSTANT = 30 + HEXCONSTANT = 31 + TAGIDENTIFIER = 32 + IDENTIFIER = 33 + VERSION = 34 + DOCCOMMENT = 35 + WHITESPACE = 36 + COMMENT = 37 + MULTICOMM = 38 channelNames = [ u"DEFAULT_TOKEN_CHANNEL", u"HIDDEN" ] @@ -184,7 +188,8 @@ class TLexer(Lexer): "'import'", "';'", "'module'", "'interface'", "'extends'", "'{'", "'}'", "'void'", "'('", "')'", "'const'", "'signal'", "'readonly'", "','", "'='", "'bool'", "'int'", "'real'", "'string'", "'var'", - "'list'", "'<'", "'>'", "'model'", "'struct'", "'enum'", "'flag'" ] + "'list'", "'<'", "'>'", "'map'", "'model'", "'struct'", "'enum'", + "'flag'" ] symbolicNames = [ "", "TAGLINE", "INTCONSTANT", "HEXCONSTANT", "TAGIDENTIFIER", "IDENTIFIER", @@ -194,15 +199,15 @@ class TLexer(Lexer): "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", "TAGLINE", "INTCONSTANT", "HEXCONSTANT", "TAGIDENTIFIER", - "IDENTIFIER", "VERSION", "DOCCOMMENT", "WHITESPACE", "COMMENT", - "MULTICOMM" ] + "T__26", "T__27", "TAGLINE", "INTCONSTANT", "HEXCONSTANT", + "TAGIDENTIFIER", "IDENTIFIER", "VERSION", "DOCCOMMENT", + "WHITESPACE", "COMMENT", "MULTICOMM" ] grammarFileName = "T.g4" def __init__(self, input=None, output:TextIO = sys.stdout): super().__init__(input, output) - self.checkVersion("4.7") + self.checkVersion("4.7.1") self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache()) self._actions = None self._predicates = None diff --git a/qface/idl/parser/TLexer.tokens b/qface/idl/parser/TLexer.tokens index 5f94603..4f861bd 100644 --- a/qface/idl/parser/TLexer.tokens +++ b/qface/idl/parser/TLexer.tokens @@ -25,16 +25,17 @@ T__23=24 T__24=25 T__25=26 T__26=27 -TAGLINE=28 -INTCONSTANT=29 -HEXCONSTANT=30 -TAGIDENTIFIER=31 -IDENTIFIER=32 -VERSION=33 -DOCCOMMENT=34 -WHITESPACE=35 -COMMENT=36 -MULTICOMM=37 +T__27=28 +TAGLINE=29 +INTCONSTANT=30 +HEXCONSTANT=31 +TAGIDENTIFIER=32 +IDENTIFIER=33 +VERSION=34 +DOCCOMMENT=35 +WHITESPACE=36 +COMMENT=37 +MULTICOMM=38 'import'=1 ';'=2 'module'=3 @@ -58,7 +59,8 @@ MULTICOMM=37 'list'=21 '<'=22 '>'=23 -'model'=24 -'struct'=25 -'enum'=26 -'flag'=27 +'map'=24 +'model'=25 +'struct'=26 +'enum'=27 +'flag'=28 diff --git a/qface/idl/parser/TListener.py b/qface/idl/parser/TListener.py index 54e764a..238fdb0 100644 --- a/qface/idl/parser/TListener.py +++ b/qface/idl/parser/TListener.py @@ -1,4 +1,4 @@ -# Generated from T.g4 by ANTLR 4.7 +# Generated from T.g4 by ANTLR 4.7.1 from antlr4 import * if __name__ is not None and "." in __name__: from .TParser import TParser @@ -179,6 +179,15 @@ def exitListTypeSymbol(self, ctx:TParser.ListTypeSymbolContext): pass + # Enter a parse tree produced by TParser#mapTypeSymbol. + def enterMapTypeSymbol(self, ctx:TParser.MapTypeSymbolContext): + pass + + # Exit a parse tree produced by TParser#mapTypeSymbol. + def exitMapTypeSymbol(self, ctx:TParser.MapTypeSymbolContext): + pass + + # Enter a parse tree produced by TParser#modelTypeSymbol. def enterModelTypeSymbol(self, ctx:TParser.ModelTypeSymbolContext): pass diff --git a/qface/idl/parser/TParser.py b/qface/idl/parser/TParser.py index b180f95..e8a929c 100644 --- a/qface/idl/parser/TParser.py +++ b/qface/idl/parser/TParser.py @@ -1,4 +1,4 @@ -# Generated from T.g4 by ANTLR 4.7 +# Generated from T.g4 by ANTLR 4.7.1 # encoding: utf-8 from antlr4 import * from io import StringIO @@ -7,157 +7,160 @@ def serializedATN(): with StringIO() as buf: - buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\'") - buf.write("\u0142\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") + buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3(") + buf.write("\u014a\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") buf.write("\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r\4\16") buf.write("\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23\t\23") buf.write("\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31") - buf.write("\t\31\4\32\t\32\4\33\t\33\3\2\3\2\7\29\n\2\f\2\16\2<\13") - buf.write("\2\3\3\3\3\7\3@\n\3\f\3\16\3C\13\3\3\4\3\4\3\4\3\4\5\4") - buf.write("I\n\4\3\5\5\5L\n\5\3\5\7\5O\n\5\f\5\16\5R\13\5\3\5\3\5") - buf.write("\3\5\3\5\5\5X\n\5\3\6\3\6\3\6\5\6]\n\6\3\7\5\7`\n\7\3") - buf.write("\7\7\7c\n\7\f\7\16\7f\13\7\3\7\3\7\3\7\3\7\5\7l\n\7\3") - buf.write("\7\3\7\7\7p\n\7\f\7\16\7s\13\7\3\7\3\7\5\7w\n\7\3\b\3") - buf.write("\b\3\b\5\b|\n\b\3\t\5\t\177\n\t\3\t\7\t\u0082\n\t\f\t") - buf.write("\16\t\u0085\13\t\3\t\3\t\5\t\u0089\n\t\3\t\3\t\3\t\7\t") - buf.write("\u008e\n\t\f\t\16\t\u0091\13\t\3\t\3\t\5\t\u0095\n\t\3") - buf.write("\t\5\t\u0098\n\t\3\n\3\n\3\13\5\13\u009d\n\13\3\13\7\13") - buf.write("\u00a0\n\13\f\13\16\13\u00a3\13\13\3\13\3\13\3\13\3\13") - buf.write("\7\13\u00a9\n\13\f\13\16\13\u00ac\13\13\3\13\3\13\5\13") - buf.write("\u00b0\n\13\3\f\5\f\u00b3\n\f\3\f\7\f\u00b6\n\f\f\f\16") - buf.write("\f\u00b9\13\f\3\f\5\f\u00bc\n\f\3\f\3\f\3\f\5\f\u00c1") - buf.write("\n\f\3\r\3\r\5\r\u00c5\n\r\3\16\3\16\3\16\5\16\u00ca\n") - buf.write("\16\3\17\3\17\3\20\3\20\3\20\5\20\u00d1\n\20\3\20\5\20") - buf.write("\u00d4\n\20\3\21\3\21\3\21\3\21\5\21\u00da\n\21\3\22\3") - buf.write("\22\3\23\3\23\3\23\3\23\3\23\5\23\u00e3\n\23\3\24\3\24") - buf.write("\3\24\3\24\3\24\3\25\3\25\3\25\3\25\3\25\3\26\5\26\u00f0") - buf.write("\n\26\3\26\7\26\u00f3\n\26\f\26\16\26\u00f6\13\26\3\26") - buf.write("\3\26\3\26\3\26\7\26\u00fc\n\26\f\26\16\26\u00ff\13\26") - buf.write("\3\26\3\26\5\26\u0103\n\26\3\27\5\27\u0106\n\27\3\27\7") - buf.write("\27\u0109\n\27\f\27\16\27\u010c\13\27\3\27\3\27\3\27\5") - buf.write("\27\u0111\n\27\3\30\5\30\u0114\n\30\3\30\7\30\u0117\n") - buf.write("\30\f\30\16\30\u011a\13\30\3\30\3\30\3\30\3\30\7\30\u0120") - buf.write("\n\30\f\30\16\30\u0123\13\30\3\30\3\30\5\30\u0127\n\30") - buf.write("\3\31\3\31\5\31\u012b\n\31\3\32\5\32\u012e\n\32\3\32\7") - buf.write("\32\u0131\n\32\f\32\16\32\u0134\13\32\3\32\3\32\3\32\5") - buf.write("\32\u0139\n\32\3\32\5\32\u013c\n\32\3\33\3\33\5\33\u0140") - buf.write("\n\33\3\33\2\2\34\2\4\6\b\n\f\16\20\22\24\26\30\32\34") - buf.write("\36 \"$&(*,.\60\62\64\2\2\2\u0160\2\66\3\2\2\2\4=\3\2") - buf.write("\2\2\6D\3\2\2\2\bK\3\2\2\2\n\\\3\2\2\2\f_\3\2\2\2\16{") - buf.write("\3\2\2\2\20~\3\2\2\2\22\u0099\3\2\2\2\24\u009c\3\2\2\2") - buf.write("\26\u00b2\3\2\2\2\30\u00c4\3\2\2\2\32\u00c6\3\2\2\2\34") - buf.write("\u00cb\3\2\2\2\36\u00cd\3\2\2\2 \u00d9\3\2\2\2\"\u00db") - buf.write("\3\2\2\2$\u00e2\3\2\2\2&\u00e4\3\2\2\2(\u00e9\3\2\2\2") - buf.write("*\u00ef\3\2\2\2,\u0105\3\2\2\2.\u0113\3\2\2\2\60\u012a") - buf.write("\3\2\2\2\62\u012d\3\2\2\2\64\u013f\3\2\2\2\66:\5\4\3\2") - buf.write("\679\5\n\6\28\67\3\2\2\29<\3\2\2\2:8\3\2\2\2:;\3\2\2\2") - buf.write(";\3\3\2\2\2<:\3\2\2\2=A\5\b\5\2>@\5\6\4\2?>\3\2\2\2@C") - buf.write("\3\2\2\2A?\3\2\2\2AB\3\2\2\2B\5\3\2\2\2CA\3\2\2\2DE\7") - buf.write("\3\2\2EF\7\"\2\2FH\7#\2\2GI\7\4\2\2HG\3\2\2\2HI\3\2\2") - buf.write("\2I\7\3\2\2\2JL\7$\2\2KJ\3\2\2\2KL\3\2\2\2LP\3\2\2\2M") - buf.write("O\5\34\17\2NM\3\2\2\2OR\3\2\2\2PN\3\2\2\2PQ\3\2\2\2QS") - buf.write("\3\2\2\2RP\3\2\2\2ST\7\5\2\2TU\7\"\2\2UW\7#\2\2VX\7\4") - buf.write("\2\2WV\3\2\2\2WX\3\2\2\2X\t\3\2\2\2Y]\5\f\7\2Z]\5*\26") - buf.write("\2[]\5.\30\2\\Y\3\2\2\2\\Z\3\2\2\2\\[\3\2\2\2]\13\3\2") - buf.write("\2\2^`\7$\2\2_^\3\2\2\2_`\3\2\2\2`d\3\2\2\2ac\5\34\17") - buf.write("\2ba\3\2\2\2cf\3\2\2\2db\3\2\2\2de\3\2\2\2eg\3\2\2\2f") - buf.write("d\3\2\2\2gh\7\6\2\2hk\7\"\2\2ij\7\7\2\2jl\7\"\2\2ki\3") - buf.write("\2\2\2kl\3\2\2\2lm\3\2\2\2mq\7\b\2\2np\5\16\b\2on\3\2") - buf.write("\2\2ps\3\2\2\2qo\3\2\2\2qr\3\2\2\2rt\3\2\2\2sq\3\2\2\2") - buf.write("tv\7\t\2\2uw\7\4\2\2vu\3\2\2\2vw\3\2\2\2w\r\3\2\2\2x|") - buf.write("\5\20\t\2y|\5\26\f\2z|\5\24\13\2{x\3\2\2\2{y\3\2\2\2{") - buf.write("z\3\2\2\2|\17\3\2\2\2}\177\7$\2\2~}\3\2\2\2~\177\3\2\2") - buf.write("\2\177\u0083\3\2\2\2\u0080\u0082\5\34\17\2\u0081\u0080") - buf.write("\3\2\2\2\u0082\u0085\3\2\2\2\u0083\u0081\3\2\2\2\u0083") - buf.write("\u0084\3\2\2\2\u0084\u0088\3\2\2\2\u0085\u0083\3\2\2\2") - buf.write("\u0086\u0089\5 \21\2\u0087\u0089\7\n\2\2\u0088\u0086\3") - buf.write("\2\2\2\u0088\u0087\3\2\2\2\u0089\u008a\3\2\2\2\u008a\u008b") - buf.write("\7\"\2\2\u008b\u008f\7\13\2\2\u008c\u008e\5\32\16\2\u008d") - buf.write("\u008c\3\2\2\2\u008e\u0091\3\2\2\2\u008f\u008d\3\2\2\2") - buf.write("\u008f\u0090\3\2\2\2\u0090\u0092\3\2\2\2\u0091\u008f\3") - buf.write("\2\2\2\u0092\u0094\7\f\2\2\u0093\u0095\5\22\n\2\u0094") - buf.write("\u0093\3\2\2\2\u0094\u0095\3\2\2\2\u0095\u0097\3\2\2\2") - buf.write("\u0096\u0098\7\4\2\2\u0097\u0096\3\2\2\2\u0097\u0098\3") - buf.write("\2\2\2\u0098\21\3\2\2\2\u0099\u009a\7\r\2\2\u009a\23\3") - buf.write("\2\2\2\u009b\u009d\7$\2\2\u009c\u009b\3\2\2\2\u009c\u009d") - buf.write("\3\2\2\2\u009d\u00a1\3\2\2\2\u009e\u00a0\5\34\17\2\u009f") - buf.write("\u009e\3\2\2\2\u00a0\u00a3\3\2\2\2\u00a1\u009f\3\2\2\2") - buf.write("\u00a1\u00a2\3\2\2\2\u00a2\u00a4\3\2\2\2\u00a3\u00a1\3") - buf.write("\2\2\2\u00a4\u00a5\7\16\2\2\u00a5\u00a6\7\"\2\2\u00a6") - buf.write("\u00aa\7\13\2\2\u00a7\u00a9\5\32\16\2\u00a8\u00a7\3\2") - buf.write("\2\2\u00a9\u00ac\3\2\2\2\u00aa\u00a8\3\2\2\2\u00aa\u00ab") - buf.write("\3\2\2\2\u00ab\u00ad\3\2\2\2\u00ac\u00aa\3\2\2\2\u00ad") - buf.write("\u00af\7\f\2\2\u00ae\u00b0\7\4\2\2\u00af\u00ae\3\2\2\2") - buf.write("\u00af\u00b0\3\2\2\2\u00b0\25\3\2\2\2\u00b1\u00b3\7$\2") - buf.write("\2\u00b2\u00b1\3\2\2\2\u00b2\u00b3\3\2\2\2\u00b3\u00b7") - buf.write("\3\2\2\2\u00b4\u00b6\5\34\17\2\u00b5\u00b4\3\2\2\2\u00b6") - buf.write("\u00b9\3\2\2\2\u00b7\u00b5\3\2\2\2\u00b7\u00b8\3\2\2\2") - buf.write("\u00b8\u00bb\3\2\2\2\u00b9\u00b7\3\2\2\2\u00ba\u00bc\5") - buf.write("\30\r\2\u00bb\u00ba\3\2\2\2\u00bb\u00bc\3\2\2\2\u00bc") - buf.write("\u00bd\3\2\2\2\u00bd\u00be\5 \21\2\u00be\u00c0\7\"\2\2") - buf.write("\u00bf\u00c1\7\4\2\2\u00c0\u00bf\3\2\2\2\u00c0\u00c1\3") - buf.write("\2\2\2\u00c1\27\3\2\2\2\u00c2\u00c5\7\17\2\2\u00c3\u00c5") - buf.write("\7\r\2\2\u00c4\u00c2\3\2\2\2\u00c4\u00c3\3\2\2\2\u00c5") - buf.write("\31\3\2\2\2\u00c6\u00c7\5 \21\2\u00c7\u00c9\7\"\2\2\u00c8") - buf.write("\u00ca\7\20\2\2\u00c9\u00c8\3\2\2\2\u00c9\u00ca\3\2\2") - buf.write("\2\u00ca\33\3\2\2\2\u00cb\u00cc\7\36\2\2\u00cc\35\3\2") - buf.write("\2\2\u00cd\u00d0\7\"\2\2\u00ce\u00cf\7\21\2\2\u00cf\u00d1") - buf.write("\7\"\2\2\u00d0\u00ce\3\2\2\2\u00d0\u00d1\3\2\2\2\u00d1") - buf.write("\u00d3\3\2\2\2\u00d2\u00d4\7\20\2\2\u00d3\u00d2\3\2\2") - buf.write("\2\u00d3\u00d4\3\2\2\2\u00d4\37\3\2\2\2\u00d5\u00da\5") - buf.write("$\23\2\u00d6\u00da\5\"\22\2\u00d7\u00da\5&\24\2\u00d8") - buf.write("\u00da\5(\25\2\u00d9\u00d5\3\2\2\2\u00d9\u00d6\3\2\2\2") - buf.write("\u00d9\u00d7\3\2\2\2\u00d9\u00d8\3\2\2\2\u00da!\3\2\2") - buf.write("\2\u00db\u00dc\7\"\2\2\u00dc#\3\2\2\2\u00dd\u00e3\7\22") - buf.write("\2\2\u00de\u00e3\7\23\2\2\u00df\u00e3\7\24\2\2\u00e0\u00e3") - buf.write("\7\25\2\2\u00e1\u00e3\7\26\2\2\u00e2\u00dd\3\2\2\2\u00e2") - buf.write("\u00de\3\2\2\2\u00e2\u00df\3\2\2\2\u00e2\u00e0\3\2\2\2") - buf.write("\u00e2\u00e1\3\2\2\2\u00e3%\3\2\2\2\u00e4\u00e5\7\27\2") - buf.write("\2\u00e5\u00e6\7\30\2\2\u00e6\u00e7\5 \21\2\u00e7\u00e8") - buf.write("\7\31\2\2\u00e8\'\3\2\2\2\u00e9\u00ea\7\32\2\2\u00ea\u00eb") - buf.write("\7\30\2\2\u00eb\u00ec\5 \21\2\u00ec\u00ed\7\31\2\2\u00ed") - buf.write(")\3\2\2\2\u00ee\u00f0\7$\2\2\u00ef\u00ee\3\2\2\2\u00ef") - buf.write("\u00f0\3\2\2\2\u00f0\u00f4\3\2\2\2\u00f1\u00f3\5\34\17") - buf.write("\2\u00f2\u00f1\3\2\2\2\u00f3\u00f6\3\2\2\2\u00f4\u00f2") - buf.write("\3\2\2\2\u00f4\u00f5\3\2\2\2\u00f5\u00f7\3\2\2\2\u00f6") - buf.write("\u00f4\3\2\2\2\u00f7\u00f8\7\33\2\2\u00f8\u00f9\7\"\2") - buf.write("\2\u00f9\u00fd\7\b\2\2\u00fa\u00fc\5,\27\2\u00fb\u00fa") - buf.write("\3\2\2\2\u00fc\u00ff\3\2\2\2\u00fd\u00fb\3\2\2\2\u00fd") - buf.write("\u00fe\3\2\2\2\u00fe\u0100\3\2\2\2\u00ff\u00fd\3\2\2\2") - buf.write("\u0100\u0102\7\t\2\2\u0101\u0103\7\4\2\2\u0102\u0101\3") - buf.write("\2\2\2\u0102\u0103\3\2\2\2\u0103+\3\2\2\2\u0104\u0106") - buf.write("\7$\2\2\u0105\u0104\3\2\2\2\u0105\u0106\3\2\2\2\u0106") - buf.write("\u010a\3\2\2\2\u0107\u0109\5\34\17\2\u0108\u0107\3\2\2") - buf.write("\2\u0109\u010c\3\2\2\2\u010a\u0108\3\2\2\2\u010a\u010b") - buf.write("\3\2\2\2\u010b\u010d\3\2\2\2\u010c\u010a\3\2\2\2\u010d") - buf.write("\u010e\5 \21\2\u010e\u0110\7\"\2\2\u010f\u0111\7\4\2\2") - buf.write("\u0110\u010f\3\2\2\2\u0110\u0111\3\2\2\2\u0111-\3\2\2") - buf.write("\2\u0112\u0114\7$\2\2\u0113\u0112\3\2\2\2\u0113\u0114") - buf.write("\3\2\2\2\u0114\u0118\3\2\2\2\u0115\u0117\5\34\17\2\u0116") - buf.write("\u0115\3\2\2\2\u0117\u011a\3\2\2\2\u0118\u0116\3\2\2\2") - buf.write("\u0118\u0119\3\2\2\2\u0119\u011b\3\2\2\2\u011a\u0118\3") - buf.write("\2\2\2\u011b\u011c\5\60\31\2\u011c\u011d\7\"\2\2\u011d") - buf.write("\u0121\7\b\2\2\u011e\u0120\5\62\32\2\u011f\u011e\3\2\2") - buf.write("\2\u0120\u0123\3\2\2\2\u0121\u011f\3\2\2\2\u0121\u0122") - buf.write("\3\2\2\2\u0122\u0124\3\2\2\2\u0123\u0121\3\2\2\2\u0124") - buf.write("\u0126\7\t\2\2\u0125\u0127\7\4\2\2\u0126\u0125\3\2\2\2") - buf.write("\u0126\u0127\3\2\2\2\u0127/\3\2\2\2\u0128\u012b\7\34\2") - buf.write("\2\u0129\u012b\7\35\2\2\u012a\u0128\3\2\2\2\u012a\u0129") - buf.write("\3\2\2\2\u012b\61\3\2\2\2\u012c\u012e\7$\2\2\u012d\u012c") - buf.write("\3\2\2\2\u012d\u012e\3\2\2\2\u012e\u0132\3\2\2\2\u012f") - buf.write("\u0131\5\34\17\2\u0130\u012f\3\2\2\2\u0131\u0134\3\2\2") - buf.write("\2\u0132\u0130\3\2\2\2\u0132\u0133\3\2\2\2\u0133\u0135") - buf.write("\3\2\2\2\u0134\u0132\3\2\2\2\u0135\u0138\7\"\2\2\u0136") - buf.write("\u0137\7\21\2\2\u0137\u0139\5\64\33\2\u0138\u0136\3\2") - buf.write("\2\2\u0138\u0139\3\2\2\2\u0139\u013b\3\2\2\2\u013a\u013c") - buf.write("\7\20\2\2\u013b\u013a\3\2\2\2\u013b\u013c\3\2\2\2\u013c") - buf.write("\63\3\2\2\2\u013d\u0140\7\37\2\2\u013e\u0140\7 \2\2\u013f") - buf.write("\u013d\3\2\2\2\u013f\u013e\3\2\2\2\u0140\65\3\2\2\2\64") - buf.write(":AHKPW\\_dkqv{~\u0083\u0088\u008f\u0094\u0097\u009c\u00a1") - buf.write("\u00aa\u00af\u00b2\u00b7\u00bb\u00c0\u00c4\u00c9\u00d0") - buf.write("\u00d3\u00d9\u00e2\u00ef\u00f4\u00fd\u0102\u0105\u010a") - buf.write("\u0110\u0113\u0118\u0121\u0126\u012a\u012d\u0132\u0138") - buf.write("\u013b\u013f") + buf.write("\t\31\4\32\t\32\4\33\t\33\4\34\t\34\3\2\3\2\7\2;\n\2\f") + buf.write("\2\16\2>\13\2\3\3\3\3\7\3B\n\3\f\3\16\3E\13\3\3\4\3\4") + buf.write("\3\4\3\4\5\4K\n\4\3\5\5\5N\n\5\3\5\7\5Q\n\5\f\5\16\5T") + buf.write("\13\5\3\5\3\5\3\5\3\5\5\5Z\n\5\3\6\3\6\3\6\5\6_\n\6\3") + buf.write("\7\5\7b\n\7\3\7\7\7e\n\7\f\7\16\7h\13\7\3\7\3\7\3\7\3") + buf.write("\7\5\7n\n\7\3\7\3\7\7\7r\n\7\f\7\16\7u\13\7\3\7\3\7\5") + buf.write("\7y\n\7\3\b\3\b\3\b\5\b~\n\b\3\t\5\t\u0081\n\t\3\t\7\t") + buf.write("\u0084\n\t\f\t\16\t\u0087\13\t\3\t\3\t\5\t\u008b\n\t\3") + buf.write("\t\3\t\3\t\7\t\u0090\n\t\f\t\16\t\u0093\13\t\3\t\3\t\5") + buf.write("\t\u0097\n\t\3\t\5\t\u009a\n\t\3\n\3\n\3\13\5\13\u009f") + buf.write("\n\13\3\13\7\13\u00a2\n\13\f\13\16\13\u00a5\13\13\3\13") + buf.write("\3\13\3\13\3\13\7\13\u00ab\n\13\f\13\16\13\u00ae\13\13") + buf.write("\3\13\3\13\5\13\u00b2\n\13\3\f\5\f\u00b5\n\f\3\f\7\f\u00b8") + buf.write("\n\f\f\f\16\f\u00bb\13\f\3\f\5\f\u00be\n\f\3\f\3\f\3\f") + buf.write("\5\f\u00c3\n\f\3\r\3\r\5\r\u00c7\n\r\3\16\3\16\3\16\5") + buf.write("\16\u00cc\n\16\3\17\3\17\3\20\3\20\3\20\5\20\u00d3\n\20") + buf.write("\3\20\5\20\u00d6\n\20\3\21\3\21\3\21\3\21\3\21\5\21\u00dd") + buf.write("\n\21\3\22\3\22\3\23\3\23\3\23\3\23\3\23\5\23\u00e6\n") + buf.write("\23\3\24\3\24\3\24\3\24\3\24\3\25\3\25\3\25\3\25\3\25") + buf.write("\3\26\3\26\3\26\3\26\3\26\3\27\5\27\u00f8\n\27\3\27\7") + buf.write("\27\u00fb\n\27\f\27\16\27\u00fe\13\27\3\27\3\27\3\27\3") + buf.write("\27\7\27\u0104\n\27\f\27\16\27\u0107\13\27\3\27\3\27\5") + buf.write("\27\u010b\n\27\3\30\5\30\u010e\n\30\3\30\7\30\u0111\n") + buf.write("\30\f\30\16\30\u0114\13\30\3\30\3\30\3\30\5\30\u0119\n") + buf.write("\30\3\31\5\31\u011c\n\31\3\31\7\31\u011f\n\31\f\31\16") + buf.write("\31\u0122\13\31\3\31\3\31\3\31\3\31\7\31\u0128\n\31\f") + buf.write("\31\16\31\u012b\13\31\3\31\3\31\5\31\u012f\n\31\3\32\3") + buf.write("\32\5\32\u0133\n\32\3\33\5\33\u0136\n\33\3\33\7\33\u0139") + buf.write("\n\33\f\33\16\33\u013c\13\33\3\33\3\33\3\33\5\33\u0141") + buf.write("\n\33\3\33\5\33\u0144\n\33\3\34\3\34\5\34\u0148\n\34\3") + buf.write("\34\2\2\35\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \"$") + buf.write("&(*,.\60\62\64\66\2\2\2\u0168\28\3\2\2\2\4?\3\2\2\2\6") + buf.write("F\3\2\2\2\bM\3\2\2\2\n^\3\2\2\2\fa\3\2\2\2\16}\3\2\2\2") + buf.write("\20\u0080\3\2\2\2\22\u009b\3\2\2\2\24\u009e\3\2\2\2\26") + buf.write("\u00b4\3\2\2\2\30\u00c6\3\2\2\2\32\u00c8\3\2\2\2\34\u00cd") + buf.write("\3\2\2\2\36\u00cf\3\2\2\2 \u00dc\3\2\2\2\"\u00de\3\2\2") + buf.write("\2$\u00e5\3\2\2\2&\u00e7\3\2\2\2(\u00ec\3\2\2\2*\u00f1") + buf.write("\3\2\2\2,\u00f7\3\2\2\2.\u010d\3\2\2\2\60\u011b\3\2\2") + buf.write("\2\62\u0132\3\2\2\2\64\u0135\3\2\2\2\66\u0147\3\2\2\2") + buf.write("8<\5\4\3\29;\5\n\6\2:9\3\2\2\2;>\3\2\2\2<:\3\2\2\2<=\3") + buf.write("\2\2\2=\3\3\2\2\2><\3\2\2\2?C\5\b\5\2@B\5\6\4\2A@\3\2") + buf.write("\2\2BE\3\2\2\2CA\3\2\2\2CD\3\2\2\2D\5\3\2\2\2EC\3\2\2") + buf.write("\2FG\7\3\2\2GH\7#\2\2HJ\7$\2\2IK\7\4\2\2JI\3\2\2\2JK\3") + buf.write("\2\2\2K\7\3\2\2\2LN\7%\2\2ML\3\2\2\2MN\3\2\2\2NR\3\2\2") + buf.write("\2OQ\5\34\17\2PO\3\2\2\2QT\3\2\2\2RP\3\2\2\2RS\3\2\2\2") + buf.write("SU\3\2\2\2TR\3\2\2\2UV\7\5\2\2VW\7#\2\2WY\7$\2\2XZ\7\4") + buf.write("\2\2YX\3\2\2\2YZ\3\2\2\2Z\t\3\2\2\2[_\5\f\7\2\\_\5,\27") + buf.write("\2]_\5\60\31\2^[\3\2\2\2^\\\3\2\2\2^]\3\2\2\2_\13\3\2") + buf.write("\2\2`b\7%\2\2a`\3\2\2\2ab\3\2\2\2bf\3\2\2\2ce\5\34\17") + buf.write("\2dc\3\2\2\2eh\3\2\2\2fd\3\2\2\2fg\3\2\2\2gi\3\2\2\2h") + buf.write("f\3\2\2\2ij\7\6\2\2jm\7#\2\2kl\7\7\2\2ln\7#\2\2mk\3\2") + buf.write("\2\2mn\3\2\2\2no\3\2\2\2os\7\b\2\2pr\5\16\b\2qp\3\2\2") + buf.write("\2ru\3\2\2\2sq\3\2\2\2st\3\2\2\2tv\3\2\2\2us\3\2\2\2v") + buf.write("x\7\t\2\2wy\7\4\2\2xw\3\2\2\2xy\3\2\2\2y\r\3\2\2\2z~\5") + buf.write("\20\t\2{~\5\26\f\2|~\5\24\13\2}z\3\2\2\2}{\3\2\2\2}|\3") + buf.write("\2\2\2~\17\3\2\2\2\177\u0081\7%\2\2\u0080\177\3\2\2\2") + buf.write("\u0080\u0081\3\2\2\2\u0081\u0085\3\2\2\2\u0082\u0084\5") + buf.write("\34\17\2\u0083\u0082\3\2\2\2\u0084\u0087\3\2\2\2\u0085") + buf.write("\u0083\3\2\2\2\u0085\u0086\3\2\2\2\u0086\u008a\3\2\2\2") + buf.write("\u0087\u0085\3\2\2\2\u0088\u008b\5 \21\2\u0089\u008b\7") + buf.write("\n\2\2\u008a\u0088\3\2\2\2\u008a\u0089\3\2\2\2\u008b\u008c") + buf.write("\3\2\2\2\u008c\u008d\7#\2\2\u008d\u0091\7\13\2\2\u008e") + buf.write("\u0090\5\32\16\2\u008f\u008e\3\2\2\2\u0090\u0093\3\2\2") + buf.write("\2\u0091\u008f\3\2\2\2\u0091\u0092\3\2\2\2\u0092\u0094") + buf.write("\3\2\2\2\u0093\u0091\3\2\2\2\u0094\u0096\7\f\2\2\u0095") + buf.write("\u0097\5\22\n\2\u0096\u0095\3\2\2\2\u0096\u0097\3\2\2") + buf.write("\2\u0097\u0099\3\2\2\2\u0098\u009a\7\4\2\2\u0099\u0098") + buf.write("\3\2\2\2\u0099\u009a\3\2\2\2\u009a\21\3\2\2\2\u009b\u009c") + buf.write("\7\r\2\2\u009c\23\3\2\2\2\u009d\u009f\7%\2\2\u009e\u009d") + buf.write("\3\2\2\2\u009e\u009f\3\2\2\2\u009f\u00a3\3\2\2\2\u00a0") + buf.write("\u00a2\5\34\17\2\u00a1\u00a0\3\2\2\2\u00a2\u00a5\3\2\2") + buf.write("\2\u00a3\u00a1\3\2\2\2\u00a3\u00a4\3\2\2\2\u00a4\u00a6") + buf.write("\3\2\2\2\u00a5\u00a3\3\2\2\2\u00a6\u00a7\7\16\2\2\u00a7") + buf.write("\u00a8\7#\2\2\u00a8\u00ac\7\13\2\2\u00a9\u00ab\5\32\16") + buf.write("\2\u00aa\u00a9\3\2\2\2\u00ab\u00ae\3\2\2\2\u00ac\u00aa") + buf.write("\3\2\2\2\u00ac\u00ad\3\2\2\2\u00ad\u00af\3\2\2\2\u00ae") + buf.write("\u00ac\3\2\2\2\u00af\u00b1\7\f\2\2\u00b0\u00b2\7\4\2\2") + buf.write("\u00b1\u00b0\3\2\2\2\u00b1\u00b2\3\2\2\2\u00b2\25\3\2") + buf.write("\2\2\u00b3\u00b5\7%\2\2\u00b4\u00b3\3\2\2\2\u00b4\u00b5") + buf.write("\3\2\2\2\u00b5\u00b9\3\2\2\2\u00b6\u00b8\5\34\17\2\u00b7") + buf.write("\u00b6\3\2\2\2\u00b8\u00bb\3\2\2\2\u00b9\u00b7\3\2\2\2") + buf.write("\u00b9\u00ba\3\2\2\2\u00ba\u00bd\3\2\2\2\u00bb\u00b9\3") + buf.write("\2\2\2\u00bc\u00be\5\30\r\2\u00bd\u00bc\3\2\2\2\u00bd") + buf.write("\u00be\3\2\2\2\u00be\u00bf\3\2\2\2\u00bf\u00c0\5 \21\2") + buf.write("\u00c0\u00c2\7#\2\2\u00c1\u00c3\7\4\2\2\u00c2\u00c1\3") + buf.write("\2\2\2\u00c2\u00c3\3\2\2\2\u00c3\27\3\2\2\2\u00c4\u00c7") + buf.write("\7\17\2\2\u00c5\u00c7\7\r\2\2\u00c6\u00c4\3\2\2\2\u00c6") + buf.write("\u00c5\3\2\2\2\u00c7\31\3\2\2\2\u00c8\u00c9\5 \21\2\u00c9") + buf.write("\u00cb\7#\2\2\u00ca\u00cc\7\20\2\2\u00cb\u00ca\3\2\2\2") + buf.write("\u00cb\u00cc\3\2\2\2\u00cc\33\3\2\2\2\u00cd\u00ce\7\37") + buf.write("\2\2\u00ce\35\3\2\2\2\u00cf\u00d2\7#\2\2\u00d0\u00d1\7") + buf.write("\21\2\2\u00d1\u00d3\7#\2\2\u00d2\u00d0\3\2\2\2\u00d2\u00d3") + buf.write("\3\2\2\2\u00d3\u00d5\3\2\2\2\u00d4\u00d6\7\20\2\2\u00d5") + buf.write("\u00d4\3\2\2\2\u00d5\u00d6\3\2\2\2\u00d6\37\3\2\2\2\u00d7") + buf.write("\u00dd\5$\23\2\u00d8\u00dd\5\"\22\2\u00d9\u00dd\5&\24") + buf.write("\2\u00da\u00dd\5(\25\2\u00db\u00dd\5*\26\2\u00dc\u00d7") + buf.write("\3\2\2\2\u00dc\u00d8\3\2\2\2\u00dc\u00d9\3\2\2\2\u00dc") + buf.write("\u00da\3\2\2\2\u00dc\u00db\3\2\2\2\u00dd!\3\2\2\2\u00de") + buf.write("\u00df\7#\2\2\u00df#\3\2\2\2\u00e0\u00e6\7\22\2\2\u00e1") + buf.write("\u00e6\7\23\2\2\u00e2\u00e6\7\24\2\2\u00e3\u00e6\7\25") + buf.write("\2\2\u00e4\u00e6\7\26\2\2\u00e5\u00e0\3\2\2\2\u00e5\u00e1") + buf.write("\3\2\2\2\u00e5\u00e2\3\2\2\2\u00e5\u00e3\3\2\2\2\u00e5") + buf.write("\u00e4\3\2\2\2\u00e6%\3\2\2\2\u00e7\u00e8\7\27\2\2\u00e8") + buf.write("\u00e9\7\30\2\2\u00e9\u00ea\5 \21\2\u00ea\u00eb\7\31\2") + buf.write("\2\u00eb\'\3\2\2\2\u00ec\u00ed\7\32\2\2\u00ed\u00ee\7") + buf.write("\30\2\2\u00ee\u00ef\5 \21\2\u00ef\u00f0\7\31\2\2\u00f0") + buf.write(")\3\2\2\2\u00f1\u00f2\7\33\2\2\u00f2\u00f3\7\30\2\2\u00f3") + buf.write("\u00f4\5 \21\2\u00f4\u00f5\7\31\2\2\u00f5+\3\2\2\2\u00f6") + buf.write("\u00f8\7%\2\2\u00f7\u00f6\3\2\2\2\u00f7\u00f8\3\2\2\2") + buf.write("\u00f8\u00fc\3\2\2\2\u00f9\u00fb\5\34\17\2\u00fa\u00f9") + buf.write("\3\2\2\2\u00fb\u00fe\3\2\2\2\u00fc\u00fa\3\2\2\2\u00fc") + buf.write("\u00fd\3\2\2\2\u00fd\u00ff\3\2\2\2\u00fe\u00fc\3\2\2\2") + buf.write("\u00ff\u0100\7\34\2\2\u0100\u0101\7#\2\2\u0101\u0105\7") + buf.write("\b\2\2\u0102\u0104\5.\30\2\u0103\u0102\3\2\2\2\u0104\u0107") + buf.write("\3\2\2\2\u0105\u0103\3\2\2\2\u0105\u0106\3\2\2\2\u0106") + buf.write("\u0108\3\2\2\2\u0107\u0105\3\2\2\2\u0108\u010a\7\t\2\2") + buf.write("\u0109\u010b\7\4\2\2\u010a\u0109\3\2\2\2\u010a\u010b\3") + buf.write("\2\2\2\u010b-\3\2\2\2\u010c\u010e\7%\2\2\u010d\u010c\3") + buf.write("\2\2\2\u010d\u010e\3\2\2\2\u010e\u0112\3\2\2\2\u010f\u0111") + buf.write("\5\34\17\2\u0110\u010f\3\2\2\2\u0111\u0114\3\2\2\2\u0112") + buf.write("\u0110\3\2\2\2\u0112\u0113\3\2\2\2\u0113\u0115\3\2\2\2") + buf.write("\u0114\u0112\3\2\2\2\u0115\u0116\5 \21\2\u0116\u0118\7") + buf.write("#\2\2\u0117\u0119\7\4\2\2\u0118\u0117\3\2\2\2\u0118\u0119") + buf.write("\3\2\2\2\u0119/\3\2\2\2\u011a\u011c\7%\2\2\u011b\u011a") + buf.write("\3\2\2\2\u011b\u011c\3\2\2\2\u011c\u0120\3\2\2\2\u011d") + buf.write("\u011f\5\34\17\2\u011e\u011d\3\2\2\2\u011f\u0122\3\2\2") + buf.write("\2\u0120\u011e\3\2\2\2\u0120\u0121\3\2\2\2\u0121\u0123") + buf.write("\3\2\2\2\u0122\u0120\3\2\2\2\u0123\u0124\5\62\32\2\u0124") + buf.write("\u0125\7#\2\2\u0125\u0129\7\b\2\2\u0126\u0128\5\64\33") + buf.write("\2\u0127\u0126\3\2\2\2\u0128\u012b\3\2\2\2\u0129\u0127") + buf.write("\3\2\2\2\u0129\u012a\3\2\2\2\u012a\u012c\3\2\2\2\u012b") + buf.write("\u0129\3\2\2\2\u012c\u012e\7\t\2\2\u012d\u012f\7\4\2\2") + buf.write("\u012e\u012d\3\2\2\2\u012e\u012f\3\2\2\2\u012f\61\3\2") + buf.write("\2\2\u0130\u0133\7\35\2\2\u0131\u0133\7\36\2\2\u0132\u0130") + buf.write("\3\2\2\2\u0132\u0131\3\2\2\2\u0133\63\3\2\2\2\u0134\u0136") + buf.write("\7%\2\2\u0135\u0134\3\2\2\2\u0135\u0136\3\2\2\2\u0136") + buf.write("\u013a\3\2\2\2\u0137\u0139\5\34\17\2\u0138\u0137\3\2\2") + buf.write("\2\u0139\u013c\3\2\2\2\u013a\u0138\3\2\2\2\u013a\u013b") + buf.write("\3\2\2\2\u013b\u013d\3\2\2\2\u013c\u013a\3\2\2\2\u013d") + buf.write("\u0140\7#\2\2\u013e\u013f\7\21\2\2\u013f\u0141\5\66\34") + buf.write("\2\u0140\u013e\3\2\2\2\u0140\u0141\3\2\2\2\u0141\u0143") + buf.write("\3\2\2\2\u0142\u0144\7\20\2\2\u0143\u0142\3\2\2\2\u0143") + buf.write("\u0144\3\2\2\2\u0144\65\3\2\2\2\u0145\u0148\7 \2\2\u0146") + buf.write("\u0148\7!\2\2\u0147\u0145\3\2\2\2\u0147\u0146\3\2\2\2") + buf.write("\u0148\67\3\2\2\2\64'", "'model'", "'struct'", "'enum'", "'flag'" ] + "'<'", "'>'", "'map'", "'model'", "'struct'", "'enum'", + "'flag'" ] symbolicNames = [ "", "", "", "", "", "", "", "", @@ -184,9 +188,9 @@ class TParser ( Parser ): "", "", "", "", "", "", "", "", "", "", "", "", - "TAGLINE", "INTCONSTANT", "HEXCONSTANT", "TAGIDENTIFIER", - "IDENTIFIER", "VERSION", "DOCCOMMENT", "WHITESPACE", - "COMMENT", "MULTICOMM" ] + "", "TAGLINE", "INTCONSTANT", "HEXCONSTANT", + "TAGIDENTIFIER", "IDENTIFIER", "VERSION", "DOCCOMMENT", + "WHITESPACE", "COMMENT", "MULTICOMM" ] RULE_documentSymbol = 0 RULE_headerSymbol = 1 @@ -207,22 +211,23 @@ class TParser ( Parser ): RULE_complexTypeSymbol = 16 RULE_primitiveTypeSymbol = 17 RULE_listTypeSymbol = 18 - RULE_modelTypeSymbol = 19 - RULE_structSymbol = 20 - RULE_structFieldSymbol = 21 - RULE_enumSymbol = 22 - RULE_enumTypeSymbol = 23 - RULE_enumMemberSymbol = 24 - RULE_intSymbol = 25 + 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", "modelTypeSymbol", - "structSymbol", "structFieldSymbol", "enumSymbol", "enumTypeSymbol", - "enumMemberSymbol", "intSymbol" ] + "primitiveTypeSymbol", "listTypeSymbol", "mapTypeSymbol", + "modelTypeSymbol", "structSymbol", "structFieldSymbol", + "enumSymbol", "enumTypeSymbol", "enumMemberSymbol", "intSymbol" ] EOF = Token.EOF T__0=1 @@ -252,20 +257,21 @@ class TParser ( Parser ): T__24=25 T__25=26 T__26=27 - TAGLINE=28 - INTCONSTANT=29 - HEXCONSTANT=30 - TAGIDENTIFIER=31 - IDENTIFIER=32 - VERSION=33 - DOCCOMMENT=34 - WHITESPACE=35 - COMMENT=36 - MULTICOMM=37 + T__27=28 + TAGLINE=29 + INTCONSTANT=30 + HEXCONSTANT=31 + TAGIDENTIFIER=32 + IDENTIFIER=33 + VERSION=34 + DOCCOMMENT=35 + WHITESPACE=36 + COMMENT=37 + MULTICOMM=38 def __init__(self, input:TokenStream, output:TextIO = sys.stdout): super().__init__(input, output) - self.checkVersion("4.7") + self.checkVersion("4.7.1") self._interp = ParserATNSimulator(self, self.atn, self.decisionsToDFA, self.sharedContextCache) self._predicates = None @@ -315,15 +321,15 @@ def documentSymbol(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 52 + self.state = 54 self.headerSymbol() - self.state = 56 + self.state = 58 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << TParser.T__3) | (1 << TParser.T__24) | (1 << TParser.T__25) | (1 << TParser.T__26) | (1 << TParser.TAGLINE) | (1 << TParser.DOCCOMMENT))) != 0): - self.state = 53 + while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << TParser.T__3) | (1 << TParser.T__25) | (1 << TParser.T__26) | (1 << TParser.T__27) | (1 << TParser.TAGLINE) | (1 << TParser.DOCCOMMENT))) != 0): + self.state = 55 self.definitionSymbol() - self.state = 58 + self.state = 60 self._errHandler.sync(self) _la = self._input.LA(1) @@ -379,15 +385,15 @@ def headerSymbol(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 59 + self.state = 61 self.moduleSymbol() - self.state = 63 + self.state = 65 self._errHandler.sync(self) _la = self._input.LA(1) while _la==TParser.T__0: - self.state = 60 + self.state = 62 self.importSymbol() - self.state = 65 + self.state = 67 self._errHandler.sync(self) _la = self._input.LA(1) @@ -440,17 +446,17 @@ def importSymbol(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 66 + self.state = 68 self.match(TParser.T__0) - self.state = 67 + self.state = 69 localctx.name = self.match(TParser.IDENTIFIER) - self.state = 68 - localctx.version = self.match(TParser.VERSION) self.state = 70 + localctx.version = self.match(TParser.VERSION) + self.state = 72 self._errHandler.sync(self) _la = self._input.LA(1) if _la==TParser.T__1: - self.state = 69 + self.state = 71 self.match(TParser.T__1) @@ -514,35 +520,35 @@ def moduleSymbol(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 73 + self.state = 75 self._errHandler.sync(self) _la = self._input.LA(1) if _la==TParser.DOCCOMMENT: - self.state = 72 + self.state = 74 localctx.comment = self.match(TParser.DOCCOMMENT) - self.state = 78 + self.state = 80 self._errHandler.sync(self) _la = self._input.LA(1) while _la==TParser.TAGLINE: - self.state = 75 + self.state = 77 self.tagSymbol() - self.state = 80 + self.state = 82 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 81 + self.state = 83 self.match(TParser.T__2) - self.state = 82 + self.state = 84 localctx.name = self.match(TParser.IDENTIFIER) - self.state = 83 - localctx.version = self.match(TParser.VERSION) self.state = 85 + localctx.version = self.match(TParser.VERSION) + self.state = 87 self._errHandler.sync(self) _la = self._input.LA(1) if _la==TParser.T__1: - self.state = 84 + self.state = 86 self.match(TParser.T__1) @@ -597,24 +603,24 @@ def definitionSymbol(self): localctx = TParser.DefinitionSymbolContext(self, self._ctx, self.state) self.enterRule(localctx, 8, self.RULE_definitionSymbol) try: - self.state = 90 + 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 = 87 + self.state = 89 self.interfaceSymbol() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 88 + self.state = 90 self.structSymbol() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 89 + self.state = 91 self.enumSymbol() pass @@ -686,57 +692,57 @@ def interfaceSymbol(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 93 + self.state = 95 self._errHandler.sync(self) _la = self._input.LA(1) if _la==TParser.DOCCOMMENT: - self.state = 92 + self.state = 94 localctx.comment = self.match(TParser.DOCCOMMENT) - self.state = 98 + self.state = 100 self._errHandler.sync(self) _la = self._input.LA(1) while _la==TParser.TAGLINE: - self.state = 95 + self.state = 97 self.tagSymbol() - self.state = 100 + self.state = 102 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 101 + self.state = 103 self.match(TParser.T__3) - self.state = 102 + self.state = 104 localctx.name = self.match(TParser.IDENTIFIER) - self.state = 105 + self.state = 107 self._errHandler.sync(self) _la = self._input.LA(1) if _la==TParser.T__4: - self.state = 103 + self.state = 105 self.match(TParser.T__4) - self.state = 104 + self.state = 106 localctx.extends = self.match(TParser.IDENTIFIER) - self.state = 107 + self.state = 109 self.match(TParser.T__5) - self.state = 111 + self.state = 113 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << TParser.T__7) | (1 << TParser.T__10) | (1 << TParser.T__11) | (1 << TParser.T__12) | (1 << TParser.T__15) | (1 << TParser.T__16) | (1 << TParser.T__17) | (1 << TParser.T__18) | (1 << TParser.T__19) | (1 << TParser.T__20) | (1 << TParser.T__23) | (1 << TParser.TAGLINE) | (1 << TParser.IDENTIFIER) | (1 << TParser.DOCCOMMENT))) != 0): - self.state = 108 + while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << TParser.T__7) | (1 << TParser.T__10) | (1 << TParser.T__11) | (1 << TParser.T__12) | (1 << TParser.T__15) | (1 << TParser.T__16) | (1 << TParser.T__17) | (1 << TParser.T__18) | (1 << TParser.T__19) | (1 << TParser.T__20) | (1 << TParser.T__23) | (1 << TParser.T__24) | (1 << TParser.TAGLINE) | (1 << TParser.IDENTIFIER) | (1 << TParser.DOCCOMMENT))) != 0): + self.state = 110 self.interfaceMemberSymbol() - self.state = 113 + self.state = 115 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 114 - self.match(TParser.T__6) self.state = 116 + self.match(TParser.T__6) + self.state = 118 self._errHandler.sync(self) _la = self._input.LA(1) if _la==TParser.T__1: - self.state = 115 + self.state = 117 self.match(TParser.T__1) @@ -791,24 +797,24 @@ def interfaceMemberSymbol(self): localctx = TParser.InterfaceMemberSymbolContext(self, self._ctx, self.state) self.enterRule(localctx, 12, self.RULE_interfaceMemberSymbol) try: - self.state = 121 + 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 = 118 + self.state = 120 self.operationSymbol() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 119 + self.state = 121 self.propertySymbol() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 120 + self.state = 122 self.signalSymbol() pass @@ -884,67 +890,67 @@ def operationSymbol(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 124 + self.state = 126 self._errHandler.sync(self) _la = self._input.LA(1) if _la==TParser.DOCCOMMENT: - self.state = 123 + self.state = 125 localctx.comment = self.match(TParser.DOCCOMMENT) - self.state = 129 + self.state = 131 self._errHandler.sync(self) _la = self._input.LA(1) while _la==TParser.TAGLINE: - self.state = 126 + self.state = 128 self.tagSymbol() - self.state = 131 + self.state = 133 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 134 + self.state = 136 self._errHandler.sync(self) token = self._input.LA(1) - if token in [TParser.T__15, TParser.T__16, TParser.T__17, TParser.T__18, TParser.T__19, TParser.T__20, TParser.T__23, TParser.IDENTIFIER]: - self.state = 132 + if token in [TParser.T__15, TParser.T__16, TParser.T__17, TParser.T__18, TParser.T__19, TParser.T__20, TParser.T__23, TParser.T__24, TParser.IDENTIFIER]: + self.state = 134 self.typeSymbol() pass elif token in [TParser.T__7]: - self.state = 133 + self.state = 135 self.match(TParser.T__7) pass else: raise NoViableAltException(self) - self.state = 136 + self.state = 138 localctx.name = self.match(TParser.IDENTIFIER) - self.state = 137 + self.state = 139 self.match(TParser.T__8) - self.state = 141 + self.state = 143 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << TParser.T__15) | (1 << TParser.T__16) | (1 << TParser.T__17) | (1 << TParser.T__18) | (1 << TParser.T__19) | (1 << TParser.T__20) | (1 << TParser.T__23) | (1 << TParser.IDENTIFIER))) != 0): - self.state = 138 + while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << TParser.T__15) | (1 << TParser.T__16) | (1 << TParser.T__17) | (1 << TParser.T__18) | (1 << TParser.T__19) | (1 << TParser.T__20) | (1 << TParser.T__23) | (1 << TParser.T__24) | (1 << TParser.IDENTIFIER))) != 0): + self.state = 140 self.operationParameterSymbol() - self.state = 143 + self.state = 145 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 144 - self.match(TParser.T__9) self.state = 146 + self.match(TParser.T__9) + self.state = 148 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input,17,self._ctx) if la_ == 1: - self.state = 145 + self.state = 147 self.operationModifierSymbol() - self.state = 149 + self.state = 151 self._errHandler.sync(self) _la = self._input.LA(1) if _la==TParser.T__1: - self.state = 148 + self.state = 150 self.match(TParser.T__1) @@ -990,7 +996,7 @@ def operationModifierSymbol(self): self.enterRule(localctx, 16, self.RULE_operationModifierSymbol) try: self.enterOuterAlt(localctx, 1) - self.state = 151 + self.state = 153 localctx.is_const = self.match(TParser.T__10) except RecognitionException as re: localctx.exception = re @@ -1055,47 +1061,47 @@ def signalSymbol(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 154 + self.state = 156 self._errHandler.sync(self) _la = self._input.LA(1) if _la==TParser.DOCCOMMENT: - self.state = 153 + self.state = 155 localctx.comment = self.match(TParser.DOCCOMMENT) - self.state = 159 + self.state = 161 self._errHandler.sync(self) _la = self._input.LA(1) while _la==TParser.TAGLINE: - self.state = 156 + self.state = 158 self.tagSymbol() - self.state = 161 + self.state = 163 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 162 + self.state = 164 self.match(TParser.T__11) - self.state = 163 + self.state = 165 localctx.name = self.match(TParser.IDENTIFIER) - self.state = 164 + self.state = 166 self.match(TParser.T__8) - self.state = 168 + self.state = 170 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << TParser.T__15) | (1 << TParser.T__16) | (1 << TParser.T__17) | (1 << TParser.T__18) | (1 << TParser.T__19) | (1 << TParser.T__20) | (1 << TParser.T__23) | (1 << TParser.IDENTIFIER))) != 0): - self.state = 165 + while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << TParser.T__15) | (1 << TParser.T__16) | (1 << TParser.T__17) | (1 << TParser.T__18) | (1 << TParser.T__19) | (1 << TParser.T__20) | (1 << TParser.T__23) | (1 << TParser.T__24) | (1 << TParser.IDENTIFIER))) != 0): + self.state = 167 self.operationParameterSymbol() - self.state = 170 + self.state = 172 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 171 - self.match(TParser.T__9) self.state = 173 + self.match(TParser.T__9) + self.state = 175 self._errHandler.sync(self) _la = self._input.LA(1) if _la==TParser.T__1: - self.state = 172 + self.state = 174 self.match(TParser.T__1) @@ -1163,41 +1169,41 @@ def propertySymbol(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 176 + self.state = 178 self._errHandler.sync(self) _la = self._input.LA(1) if _la==TParser.DOCCOMMENT: - self.state = 175 + self.state = 177 localctx.comment = self.match(TParser.DOCCOMMENT) - self.state = 181 + self.state = 183 self._errHandler.sync(self) _la = self._input.LA(1) while _la==TParser.TAGLINE: - self.state = 178 + self.state = 180 self.tagSymbol() - self.state = 183 + self.state = 185 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 185 + self.state = 187 self._errHandler.sync(self) _la = self._input.LA(1) if _la==TParser.T__10 or _la==TParser.T__12: - self.state = 184 + self.state = 186 self.propertyModifierSymbol() - self.state = 187 + self.state = 189 self.typeSymbol() - self.state = 188 - localctx.name = self.match(TParser.IDENTIFIER) self.state = 190 + localctx.name = self.match(TParser.IDENTIFIER) + self.state = 192 self._errHandler.sync(self) _la = self._input.LA(1) if _la==TParser.T__1: - self.state = 189 + self.state = 191 self.match(TParser.T__1) @@ -1243,17 +1249,17 @@ def propertyModifierSymbol(self): localctx = TParser.PropertyModifierSymbolContext(self, self._ctx, self.state) self.enterRule(localctx, 22, self.RULE_propertyModifierSymbol) try: - self.state = 194 + self.state = 196 self._errHandler.sync(self) token = self._input.LA(1) if token in [TParser.T__12]: self.enterOuterAlt(localctx, 1) - self.state = 192 + self.state = 194 localctx.is_readonly = self.match(TParser.T__12) pass elif token in [TParser.T__10]: self.enterOuterAlt(localctx, 2) - self.state = 193 + self.state = 195 localctx.is_const = self.match(TParser.T__10) pass else: @@ -1308,15 +1314,15 @@ def operationParameterSymbol(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 196 + self.state = 198 self.typeSymbol() - self.state = 197 - localctx.name = self.match(TParser.IDENTIFIER) self.state = 199 + localctx.name = self.match(TParser.IDENTIFIER) + self.state = 201 self._errHandler.sync(self) _la = self._input.LA(1) if _la==TParser.T__13: - self.state = 198 + self.state = 200 self.match(TParser.T__13) @@ -1364,7 +1370,7 @@ def tagSymbol(self): self.enterRule(localctx, 26, self.RULE_tagSymbol) try: self.enterOuterAlt(localctx, 1) - self.state = 201 + self.state = 203 localctx.line = self.match(TParser.TAGLINE) except RecognitionException as re: localctx.exception = re @@ -1415,23 +1421,23 @@ def tagAttributeSymbol(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 203 + self.state = 205 localctx.name = self.match(TParser.IDENTIFIER) - self.state = 206 + self.state = 208 self._errHandler.sync(self) _la = self._input.LA(1) if _la==TParser.T__14: - self.state = 204 + self.state = 206 self.match(TParser.T__14) - self.state = 205 + self.state = 207 localctx.value = self.match(TParser.IDENTIFIER) - self.state = 209 + self.state = 211 self._errHandler.sync(self) _la = self._input.LA(1) if _la==TParser.T__13: - self.state = 208 + self.state = 210 self.match(TParser.T__13) @@ -1461,6 +1467,10 @@ def listTypeSymbol(self): return self.getTypedRuleContext(TParser.ListTypeSymbolContext,0) + def mapTypeSymbol(self): + return self.getTypedRuleContext(TParser.MapTypeSymbolContext,0) + + def modelTypeSymbol(self): return self.getTypedRuleContext(TParser.ModelTypeSymbolContext,0) @@ -1490,27 +1500,32 @@ def typeSymbol(self): localctx = TParser.TypeSymbolContext(self, self._ctx, self.state) self.enterRule(localctx, 30, self.RULE_typeSymbol) try: - self.state = 215 + self.state = 218 self._errHandler.sync(self) token = self._input.LA(1) if token in [TParser.T__15, TParser.T__16, TParser.T__17, TParser.T__18, TParser.T__19]: self.enterOuterAlt(localctx, 1) - self.state = 211 + self.state = 213 self.primitiveTypeSymbol() pass elif token in [TParser.IDENTIFIER]: self.enterOuterAlt(localctx, 2) - self.state = 212 + self.state = 214 self.complexTypeSymbol() pass elif token in [TParser.T__20]: self.enterOuterAlt(localctx, 3) - self.state = 213 + self.state = 215 self.listTypeSymbol() pass elif token in [TParser.T__23]: self.enterOuterAlt(localctx, 4) - self.state = 214 + self.state = 216 + self.mapTypeSymbol() + pass + elif token in [TParser.T__24]: + self.enterOuterAlt(localctx, 5) + self.state = 217 self.modelTypeSymbol() pass else: @@ -1560,7 +1575,7 @@ def complexTypeSymbol(self): self.enterRule(localctx, 32, self.RULE_complexTypeSymbol) try: self.enterOuterAlt(localctx, 1) - self.state = 217 + self.state = 220 localctx.name = self.match(TParser.IDENTIFIER) except RecognitionException as re: localctx.exception = re @@ -1603,32 +1618,32 @@ def primitiveTypeSymbol(self): localctx = TParser.PrimitiveTypeSymbolContext(self, self._ctx, self.state) self.enterRule(localctx, 34, self.RULE_primitiveTypeSymbol) try: - self.state = 224 + self.state = 227 self._errHandler.sync(self) token = self._input.LA(1) if token in [TParser.T__15]: self.enterOuterAlt(localctx, 1) - self.state = 219 + self.state = 222 localctx.name = self.match(TParser.T__15) pass elif token in [TParser.T__16]: self.enterOuterAlt(localctx, 2) - self.state = 220 + self.state = 223 localctx.name = self.match(TParser.T__16) pass elif token in [TParser.T__17]: self.enterOuterAlt(localctx, 3) - self.state = 221 + self.state = 224 localctx.name = self.match(TParser.T__17) pass elif token in [TParser.T__18]: self.enterOuterAlt(localctx, 4) - self.state = 222 + self.state = 225 localctx.name = self.match(TParser.T__18) pass elif token in [TParser.T__19]: self.enterOuterAlt(localctx, 5) - self.state = 223 + self.state = 226 localctx.name = self.match(TParser.T__19) pass else: @@ -1679,13 +1694,66 @@ def listTypeSymbol(self): self.enterRule(localctx, 36, self.RULE_listTypeSymbol) try: self.enterOuterAlt(localctx, 1) - self.state = 226 + self.state = 229 self.match(TParser.T__20) - self.state = 227 + self.state = 230 self.match(TParser.T__21) - self.state = 228 + self.state = 231 localctx.valueType = self.typeSymbol() - self.state = 229 + self.state = 232 + self.match(TParser.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): + + 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(TParser.TypeSymbolContext,0) + + + def getRuleIndex(self): + return TParser.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 accept(self, visitor:ParseTreeVisitor): + if hasattr( visitor, "visitMapTypeSymbol" ): + return visitor.visitMapTypeSymbol(self) + else: + return visitor.visitChildren(self) + + + + + def mapTypeSymbol(self): + + localctx = TParser.MapTypeSymbolContext(self, self._ctx, self.state) + self.enterRule(localctx, 38, self.RULE_mapTypeSymbol) + try: + self.enterOuterAlt(localctx, 1) + self.state = 234 + self.match(TParser.T__23) + self.state = 235 + self.match(TParser.T__21) + self.state = 236 + localctx.valueType = self.typeSymbol() + self.state = 237 self.match(TParser.T__22) except RecognitionException as re: localctx.exception = re @@ -1729,16 +1797,16 @@ def accept(self, visitor:ParseTreeVisitor): def modelTypeSymbol(self): localctx = TParser.ModelTypeSymbolContext(self, self._ctx, self.state) - self.enterRule(localctx, 38, self.RULE_modelTypeSymbol) + self.enterRule(localctx, 40, self.RULE_modelTypeSymbol) try: self.enterOuterAlt(localctx, 1) - self.state = 231 - self.match(TParser.T__23) - self.state = 232 + self.state = 239 + self.match(TParser.T__24) + self.state = 240 self.match(TParser.T__21) - self.state = 233 + self.state = 241 localctx.valueType = self.typeSymbol() - self.state = 234 + self.state = 242 self.match(TParser.T__22) except RecognitionException as re: localctx.exception = re @@ -1799,51 +1867,51 @@ def accept(self, visitor:ParseTreeVisitor): def structSymbol(self): localctx = TParser.StructSymbolContext(self, self._ctx, self.state) - self.enterRule(localctx, 40, self.RULE_structSymbol) + self.enterRule(localctx, 42, self.RULE_structSymbol) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 237 + self.state = 245 self._errHandler.sync(self) _la = self._input.LA(1) if _la==TParser.DOCCOMMENT: - self.state = 236 + self.state = 244 localctx.comment = self.match(TParser.DOCCOMMENT) - self.state = 242 + self.state = 250 self._errHandler.sync(self) _la = self._input.LA(1) while _la==TParser.TAGLINE: - self.state = 239 + self.state = 247 self.tagSymbol() - self.state = 244 + self.state = 252 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 245 - self.match(TParser.T__24) - self.state = 246 + self.state = 253 + self.match(TParser.T__25) + self.state = 254 localctx.name = self.match(TParser.IDENTIFIER) - self.state = 247 + self.state = 255 self.match(TParser.T__5) - self.state = 251 + self.state = 259 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << TParser.T__15) | (1 << TParser.T__16) | (1 << TParser.T__17) | (1 << TParser.T__18) | (1 << TParser.T__19) | (1 << TParser.T__20) | (1 << TParser.T__23) | (1 << TParser.TAGLINE) | (1 << TParser.IDENTIFIER) | (1 << TParser.DOCCOMMENT))) != 0): - self.state = 248 + while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << TParser.T__15) | (1 << TParser.T__16) | (1 << TParser.T__17) | (1 << TParser.T__18) | (1 << TParser.T__19) | (1 << TParser.T__20) | (1 << TParser.T__23) | (1 << TParser.T__24) | (1 << TParser.TAGLINE) | (1 << TParser.IDENTIFIER) | (1 << TParser.DOCCOMMENT))) != 0): + self.state = 256 self.structFieldSymbol() - self.state = 253 + self.state = 261 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 254 + self.state = 262 self.match(TParser.T__6) - self.state = 256 + self.state = 264 self._errHandler.sync(self) _la = self._input.LA(1) if _la==TParser.T__1: - self.state = 255 + self.state = 263 self.match(TParser.T__1) @@ -1903,37 +1971,37 @@ def accept(self, visitor:ParseTreeVisitor): def structFieldSymbol(self): localctx = TParser.StructFieldSymbolContext(self, self._ctx, self.state) - self.enterRule(localctx, 42, self.RULE_structFieldSymbol) + self.enterRule(localctx, 44, self.RULE_structFieldSymbol) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 259 + self.state = 267 self._errHandler.sync(self) _la = self._input.LA(1) if _la==TParser.DOCCOMMENT: - self.state = 258 + self.state = 266 localctx.comment = self.match(TParser.DOCCOMMENT) - self.state = 264 + self.state = 272 self._errHandler.sync(self) _la = self._input.LA(1) while _la==TParser.TAGLINE: - self.state = 261 + self.state = 269 self.tagSymbol() - self.state = 266 + self.state = 274 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 267 + self.state = 275 self.typeSymbol() - self.state = 268 + self.state = 276 localctx.name = self.match(TParser.IDENTIFIER) - self.state = 270 + self.state = 278 self._errHandler.sync(self) _la = self._input.LA(1) if _la==TParser.T__1: - self.state = 269 + self.state = 277 self.match(TParser.T__1) @@ -2000,51 +2068,51 @@ def accept(self, visitor:ParseTreeVisitor): def enumSymbol(self): localctx = TParser.EnumSymbolContext(self, self._ctx, self.state) - self.enterRule(localctx, 44, self.RULE_enumSymbol) + self.enterRule(localctx, 46, self.RULE_enumSymbol) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 273 + self.state = 281 self._errHandler.sync(self) _la = self._input.LA(1) if _la==TParser.DOCCOMMENT: - self.state = 272 + self.state = 280 localctx.comment = self.match(TParser.DOCCOMMENT) - self.state = 278 + self.state = 286 self._errHandler.sync(self) _la = self._input.LA(1) while _la==TParser.TAGLINE: - self.state = 275 + self.state = 283 self.tagSymbol() - self.state = 280 + self.state = 288 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 281 + self.state = 289 self.enumTypeSymbol() - self.state = 282 + self.state = 290 localctx.name = self.match(TParser.IDENTIFIER) - self.state = 283 + self.state = 291 self.match(TParser.T__5) - self.state = 287 + self.state = 295 self._errHandler.sync(self) _la = self._input.LA(1) while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << TParser.TAGLINE) | (1 << TParser.IDENTIFIER) | (1 << TParser.DOCCOMMENT))) != 0): - self.state = 284 + self.state = 292 self.enumMemberSymbol() - self.state = 289 + self.state = 297 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 290 + self.state = 298 self.match(TParser.T__6) - self.state = 292 + self.state = 300 self._errHandler.sync(self) _la = self._input.LA(1) if _la==TParser.T__1: - self.state = 291 + self.state = 299 self.match(TParser.T__1) @@ -2088,20 +2156,20 @@ def accept(self, visitor:ParseTreeVisitor): def enumTypeSymbol(self): localctx = TParser.EnumTypeSymbolContext(self, self._ctx, self.state) - self.enterRule(localctx, 46, self.RULE_enumTypeSymbol) + self.enterRule(localctx, 48, self.RULE_enumTypeSymbol) try: - self.state = 296 + self.state = 304 self._errHandler.sync(self) token = self._input.LA(1) - if token in [TParser.T__25]: + if token in [TParser.T__26]: self.enterOuterAlt(localctx, 1) - self.state = 294 - localctx.isEnum = self.match(TParser.T__25) + self.state = 302 + localctx.isEnum = self.match(TParser.T__26) pass - elif token in [TParser.T__26]: + elif token in [TParser.T__27]: self.enterOuterAlt(localctx, 2) - self.state = 295 - localctx.isFlag = self.match(TParser.T__26) + self.state = 303 + localctx.isFlag = self.match(TParser.T__27) pass else: raise NoViableAltException(self) @@ -2162,45 +2230,45 @@ def accept(self, visitor:ParseTreeVisitor): def enumMemberSymbol(self): localctx = TParser.EnumMemberSymbolContext(self, self._ctx, self.state) - self.enterRule(localctx, 48, self.RULE_enumMemberSymbol) + self.enterRule(localctx, 50, self.RULE_enumMemberSymbol) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 299 + self.state = 307 self._errHandler.sync(self) _la = self._input.LA(1) if _la==TParser.DOCCOMMENT: - self.state = 298 + self.state = 306 localctx.comment = self.match(TParser.DOCCOMMENT) - self.state = 304 + self.state = 312 self._errHandler.sync(self) _la = self._input.LA(1) while _la==TParser.TAGLINE: - self.state = 301 + self.state = 309 self.tagSymbol() - self.state = 306 + self.state = 314 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 307 + self.state = 315 localctx.name = self.match(TParser.IDENTIFIER) - self.state = 310 + self.state = 318 self._errHandler.sync(self) _la = self._input.LA(1) if _la==TParser.T__14: - self.state = 308 + self.state = 316 self.match(TParser.T__14) - self.state = 309 + self.state = 317 self.intSymbol() - self.state = 313 + self.state = 321 self._errHandler.sync(self) _la = self._input.LA(1) if _la==TParser.T__13: - self.state = 312 + self.state = 320 self.match(TParser.T__13) @@ -2248,19 +2316,19 @@ def accept(self, visitor:ParseTreeVisitor): def intSymbol(self): localctx = TParser.IntSymbolContext(self, self._ctx, self.state) - self.enterRule(localctx, 50, self.RULE_intSymbol) + self.enterRule(localctx, 52, self.RULE_intSymbol) try: - self.state = 317 + self.state = 325 self._errHandler.sync(self) token = self._input.LA(1) if token in [TParser.INTCONSTANT]: self.enterOuterAlt(localctx, 1) - self.state = 315 + self.state = 323 localctx.value = self.match(TParser.INTCONSTANT) pass elif token in [TParser.HEXCONSTANT]: self.enterOuterAlt(localctx, 2) - self.state = 316 + self.state = 324 localctx.value = self.match(TParser.HEXCONSTANT) pass else: diff --git a/qface/idl/parser/TVisitor.py b/qface/idl/parser/TVisitor.py index a87cdf4..a3f4472 100644 --- a/qface/idl/parser/TVisitor.py +++ b/qface/idl/parser/TVisitor.py @@ -1,4 +1,4 @@ -# Generated from T.g4 by ANTLR 4.7 +# Generated from T.g4 by ANTLR 4.7.1 from antlr4 import * if __name__ is not None and "." in __name__: from .TParser import TParser @@ -104,6 +104,11 @@ def visitListTypeSymbol(self, ctx:TParser.ListTypeSymbolContext): return self.visitChildren(ctx) + # Visit a parse tree produced by TParser#mapTypeSymbol. + def visitMapTypeSymbol(self, ctx:TParser.MapTypeSymbolContext): + return self.visitChildren(ctx) + + # Visit a parse tree produced by TParser#modelTypeSymbol. def visitModelTypeSymbol(self, ctx:TParser.ModelTypeSymbolContext): return self.visitChildren(ctx) diff --git a/qface/idl/profile.py b/qface/idl/profile.py index 4b376c9..b75aecc 100644 --- a/qface/idl/profile.py +++ b/qface/idl/profile.py @@ -1,36 +1,44 @@ # Copyright (c) Pelagicore AB 2016 +""" +A profile is a set of features describing a qface language profile. +The language profile tells the parser which language aspects are +supported for the particular choosen profile. + +from profile import get_features, EProfile, EFeature + +features = get_features(EProfile.ADVANCED) + +if EFeature.CONST_OPERATION in features: + # parse this aspect of the language + +""" from enum import Enum class EFeature(Enum): - CONST_PROPERTY = 'const_property' + CONST_OPERATION = 'const_operation' EXTEND_INTERFACE = 'extend_interface' + IMPORT = 'import' + MAPS = 'maps' class EProfile(Enum): - BASIC = 'basic' + MICRO = 'micro' ADVANCED = 'advanced' - ALL = 'advanced' - + FULL = 'full' -class Profile: - def __init__(self, features=set()): - self.features = features - @staticmethod - def get_profile(cls, name): - if name is EProfile.BASIC: - return Profile(features=[ - ]) - if name is EProfile.ADVANCED: - return Profile(features=[ - EFeature.CONST_PROPERTY, - EFeature.EXTEND_INTERFACE - ]) - if name is EProfile.ALL: - return Profile(features=[ - ]) - return [] +_profiles = { + EProfile.MICRO: set(), + EProfile.ADVANCED: set([ + EFeature.EXTEND_INTERFACE, + EFeature.IMPORT, + EFeature.MAPS + ]), + EProfile.FULL: set(EFeature) +} +def get_features(name): + return _profiles.get(name, set()) diff --git a/qface/templates/qface/qtcpp.j2 b/qface/templates/qface/qtcpp.j2 index c2b13db..97e1c8d 100644 --- a/qface/templates/qface/qtcpp.j2 +++ b/qface/templates/qface/qtcpp.j2 @@ -1,34 +1,39 @@ -{%+ macro enum_decl(enum) %} - enum {{enum}} { +{%+ macro enum_decl(enum) -%} + enum {{enum}}Enum { {% for member in enum.members %} {{member.name}} = {{member.value}}{% if not loop.last %},{%endif%} {% endfor %} }; - Q_ENUM({{enum}}) + {% if enum.is_flag %} + Q_DECLARE_FLAGS({{enum}}Enums, {{enum}}Enum) + Q_FLAG({{enum}}Enum) + {% else %} + Q_ENUM({{enum}}Enum) + {% endif %} {%- endmacro %} -{% macro property(property) -%} -Q_PROPERTY({{property|returnType}} {{property}} READ {{property}} {% if not property.readonly %}WRITE set{{property|upperfirst}} {% endif %}{% if not property.const %}NOTIFY {{property}}Changed{% endif %}) +{% macro property(property, notifiable=True) -%} +Q_PROPERTY({{property|returnType}} {{property}} READ {{property}} {% if not property.readonly %}WRITE set{{property|upperfirst}}{% endif %}{% if not property.const and notifiable %} NOTIFY {{property}}Changed{% endif %}) {%- endmacro %} -{% macro property_setter_decl(property) -%} -virtual void set{{property|upperfirst}}({{ property|parameterType }}); +{% macro property_setter_decl(property, ending=";") -%} +void set{{property|upperfirst}}({{ property|parameterType }}){{ending}} {%- endmacro %} -{% macro property_getter_decl(property) -%} -virtual {{property|returnType}} {{property}}() const; +{% macro property_getter_decl(property, ending=";") -%} +{{property|returnType}} {{property}}() const{{ending}} {%- endmacro %} {% macro signal_decl(symbol, postfix="") -%} void {{symbol}}{{postfix}}({{symbol|parameters}}); {%- endmacro %} -{% macro property_member_decl(property) %} +{% macro property_member_decl(property) -%} {{property|returnType}} m_{{property}}; {%- endmacro %} -{% macro property_setter_impl(class, property) -%} +{% macro property_setter_impl(class, property, notifiable=True) -%} /*! \qmlproperty {{property.type}} {{class}}::{{property}} {% with doc = property.comment|parse_doc %} @@ -40,10 +45,15 @@ void {{symbol}}{{postfix}}({{symbol|parameters}}); void {{class}}::set{{property|upperfirst}}({{ property|parameterType }}) { +{% if notifiable %} if (m_{{property}} != {{property}}) { m_{{property}} = {{property}}; Q_EMIT {{property}}Changed({{property}}); } +{% else %} + m_{{property}} = {{property}}; +{% endif %} + } {%- endmacro %} @@ -56,7 +66,7 @@ void {{class}}::set{{property|upperfirst}}({{ property|parameterType }}) {%- endmacro %} -{% macro operation_impl(class, operation) %} +{% macro operation_impl(class, operation) -%} /*! \qmlmethod {{operation.type}} {{class}}::{{operation}}({{operation|parameters}}) {% with doc = operation.comment|parse_doc %} @@ -72,24 +82,22 @@ void {{class}}::set{{property|upperfirst}}({{ property|parameterType }}) qWarning() << "{{class}}::{{operation}}(...) not implemented"; return {{operation|defaultValue}}; } -{% endmacro %} +{%- endmacro %} -{% macro operation_decl(operation) %} - virtual {{operation|returnType}} {{operation}}({{operation|parameters}}); -{% endmacro %} +{% macro operation_decl(operation, ending=";") -%} + virtual {{operation|returnType}} {{operation}}({{operation|parameters}}){{ending}} +{%- endmacro %} -{% macro autogenerated(prefix="//") %} +{% macro autogenerated(prefix="//") -%} {{prefix}} This is an auto-generated file. {{prefix}} Do not edit! All changes made to it will be lost. -{% endmacro %} - -{% macro preserved(prefix="//") %} +{%- endmacro %} +{% macro preserved(prefix="//") -%} {{prefix}} This is a preserved file. {{prefix}} Changes will not be overriden by the generator. {{prefix}} To reset the file you need to delete it first. - -{% endmacro %} +{%- endmacro %} diff --git a/requirements.txt b/requirements.txt index be67b91..d3aa418 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -antlr4-python3-runtime==4.7 +antlr4-python3-runtime==4.7.1 typing jinja2 click diff --git a/setup.py b/setup.py index 295c53e..8792426 100644 --- a/setup.py +++ b/setup.py @@ -45,7 +45,7 @@ include_package_data=True, install_requires=[ 'click', - 'antlr4-python3-runtime==4.7', + 'antlr4-python3-runtime==4.7.1', 'jinja2', 'path.py', 'pyyaml', diff --git a/tests/in/com.pelagicore.ivi.tuner.qface b/tests/in/com.pelagicore.ivi.tuner.qface index 725d4d5..5d5b7ad 100644 --- a/tests/in/com.pelagicore.ivi.tuner.qface +++ b/tests/in/com.pelagicore.ivi.tuner.qface @@ -27,6 +27,8 @@ interface Tuner extends BaseTuner { list primitiveList; list complexList; + map primitiveMap; + map complexMap; model primitiveModel; model complexModel; @@ -73,6 +75,10 @@ struct Station { int stationId; /** member name */ string name; + list primitiveList; + list complexList; + map primitiveMap; + map complexMap; } diff --git a/tests/test_parser.py b/tests/test_parser.py index f6bcedb..61d680c 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -157,6 +157,60 @@ def test_list(): assert property.type.nested.name == 'Station' +def test_struct_list(): + system = load_tuner() + struct = system.lookup('com.pelagicore.ivi.tuner.Station') + field = struct._fieldMap['primitiveList'] + assert type(field) is domain.Field + assert field.type.name == 'list' + assert field.type.is_list is True + assert field.type.nested.is_primitive + assert field.type.nested.name == 'int' + + field = struct._fieldMap['complexList'] + assert type(field) is domain.Field + assert field.type.name == 'list' + assert field.type.is_list is True + assert field.type.nested.is_complex + assert field.type.nested.name == 'Station' + + +def test_map(): + system = load_tuner() + interface = system.lookup('com.pelagicore.ivi.tuner.Tuner') + property = interface._propertyMap['primitiveMap'] + assert type(property) is domain.Property + assert property.type.name == 'map' + assert property.type.is_map is True + assert property.type.nested.is_primitive + assert property.type.nested.name == 'int' + + property = interface._propertyMap['complexMap'] + assert type(property) is domain.Property + assert property.type.name == 'map' + assert property.type.is_map is True + assert property.type.nested.is_complex + assert property.type.nested.name == 'Station' + + +def test_struct_map(): + system = load_tuner() + struct = system.lookup('com.pelagicore.ivi.tuner.Station') + field = struct._fieldMap['primitiveMap'] + assert type(field) is domain.Field + assert field.type.name == 'map' + assert field.type.is_map is True + assert field.type.nested.is_primitive + assert field.type.nested.name == 'int' + + field = struct._fieldMap['complexMap'] + assert type(field) is domain.Field + assert field.type.name == 'map' + assert field.type.is_map is True + assert field.type.nested.is_complex + assert field.type.nested.name == 'Station' + + def test_model(): system = load_tuner() interface = system.lookup('com.pelagicore.ivi.tuner.Tuner') diff --git a/tests/test_qtcpp_helper.py b/tests/test_qtcpp_helper.py index de83448..083d16f 100644 --- a/tests/test_qtcpp_helper.py +++ b/tests/test_qtcpp_helper.py @@ -83,7 +83,7 @@ def test_return_type(): # check for enum prop = interface._propertyMap['status'] answer = qtcpp.Filters.returnType(prop) - assert answer == 'ExampleModule::Status' + assert answer == 'Status::StatusEnum' # check for list of primitive prop = interface._propertyMap['list001'] @@ -103,7 +103,7 @@ def test_return_type(): # check for model of structs prop = interface._propertyMap['model002'] answer = qtcpp.Filters.returnType(prop) - assert answer == 'MessageModel *' + assert answer == 'VariantModel *' def test_default_value(): @@ -134,7 +134,7 @@ def test_default_value(): # check for enum prop = interface._propertyMap['status'] answer = qtcpp.Filters.defaultValue(prop) - assert answer == 'ExampleModule::ON' + assert answer == 'Status::StatusEnum::ON' # check for flag prop = interface._propertyMap['state'] @@ -159,7 +159,7 @@ def test_default_value(): # check for model of structs prop = interface._propertyMap['model002'] answer = qtcpp.Filters.defaultValue(prop) - assert answer == 'new MessageModel(this)' + assert answer == 'new VariantModel(this)' def test_parameter_type(): @@ -191,7 +191,7 @@ def test_parameter_type(): # check for enum prop = interface._propertyMap['status'] answer = qtcpp.Filters.parameterType(prop) - assert answer == 'ExampleModule::Status {0}'.format(prop.name) + assert answer == 'Status::StatusEnum {0}'.format(prop.name) # check for list of primitive prop = interface._propertyMap['list001'] @@ -211,7 +211,7 @@ def test_parameter_type(): # check for model of structs prop = interface._propertyMap['model002'] answer = qtcpp.Filters.parameterType(prop) - assert answer == 'MessageModel *{0}'.format(prop.name) + assert answer == 'VariantModel *{0}'.format(prop.name) def test_namespace():