From 80372d8729bb36c4bce42b90ad0590536ac695a5 Mon Sep 17 00:00:00 2001 From: Juergen Bocklage-Ryannel Date: Wed, 7 Mar 2018 13:20:17 +0100 Subject: adding default values to interface properties and struct members --- qface/idl/domain.py | 3 +- qface/idl/parser/T.g4 | 6 +- qface/idl/parser/T.interp | 111 +++++++++ qface/idl/parser/T.tokens | 6 +- qface/idl/parser/TLexer.interp | 128 +++++++++++ qface/idl/parser/TLexer.py | 25 ++- qface/idl/parser/TLexer.tokens | 6 +- qface/idl/parser/TListener.py | 2 +- qface/idl/parser/TParser.py | 500 +++++++++++++++++++++-------------------- qface/idl/parser/TVisitor.py | 2 +- tests/in/values.qface | 17 ++ tests/test_values.py | 26 +++ 12 files changed, 566 insertions(+), 266 deletions(-) create mode 100644 qface/idl/parser/T.interp create mode 100644 qface/idl/parser/TLexer.interp create mode 100644 tests/in/values.qface create mode 100644 tests/test_values.py diff --git a/qface/idl/domain.py b/qface/idl/domain.py index e82aeb3..1f33c02 100644 --- a/qface/idl/domain.py +++ b/qface/idl/domain.py @@ -122,7 +122,8 @@ class Symbol(NamedElement): self.comment = '' """comment which appeared in QFace right before symbol""" self._tags = dict() - + """a value attached to the symbol""" + self.value = None self._contentMap = ChainMap() self._dependencies = set() self.type = TypeSymbol('', self) diff --git a/qface/idl/parser/T.g4 b/qface/idl/parser/T.g4 index 9cfe4e7..cb60bdd 100644 --- a/qface/idl/parser/T.g4 +++ b/qface/idl/parser/T.g4 @@ -7,8 +7,8 @@ documentSymbol ; /** -module name; -import name; +module ; +import ; */ headerSymbol : moduleSymbol importSymbol* @@ -52,7 +52,7 @@ signalSymbol propertySymbol - : comment=DOCCOMMENT? tagSymbol* propertyModifierSymbol? typeSymbol name=IDENTIFIER ';'? + : comment=DOCCOMMENT? tagSymbol* propertyModifierSymbol? typeSymbol name=IDENTIFIER ('=' value=IDENTIFIER)? ';'? ; propertyModifierSymbol diff --git a/qface/idl/parser/T.interp b/qface/idl/parser/T.interp new file mode 100644 index 0000000..235a8e4 --- /dev/null +++ b/qface/idl/parser/T.interp @@ -0,0 +1,111 @@ +token literal names: +null +'import' +';' +'module' +'interface' +'extends' +'{' +'}' +'void' +'(' +')' +'const' +'signal' +'=' +'readonly' +',' +'bool' +'int' +'real' +'string' +'var' +'list' +'<' +'>' +'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 +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 +modelTypeSymbol +structSymbol +structFieldSymbol +enumSymbol +enumTypeSymbol +enumMemberSymbol +intSymbol + + +atn: +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 39, 326, 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, 3, 2, 3, 2, 7, 2, 57, 10, 2, 12, 2, 14, 2, 60, 11, 2, 3, 3, 3, 3, 7, 3, 64, 10, 3, 12, 3, 14, 3, 67, 11, 3, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 73, 10, 4, 3, 5, 5, 5, 76, 10, 5, 3, 5, 7, 5, 79, 10, 5, 12, 5, 14, 5, 82, 11, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 88, 10, 5, 3, 6, 3, 6, 3, 6, 5, 6, 93, 10, 6, 3, 7, 5, 7, 96, 10, 7, 3, 7, 7, 7, 99, 10, 7, 12, 7, 14, 7, 102, 11, 7, 3, 7, 3, 7, 3, 7, 3, 7, 5, 7, 108, 10, 7, 3, 7, 3, 7, 7, 7, 112, 10, 7, 12, 7, 14, 7, 115, 11, 7, 3, 7, 3, 7, 5, 7, 119, 10, 7, 3, 8, 3, 8, 3, 8, 5, 8, 124, 10, 8, 3, 9, 5, 9, 127, 10, 9, 3, 9, 7, 9, 130, 10, 9, 12, 9, 14, 9, 133, 11, 9, 3, 9, 3, 9, 5, 9, 137, 10, 9, 3, 9, 3, 9, 3, 9, 7, 9, 142, 10, 9, 12, 9, 14, 9, 145, 11, 9, 3, 9, 3, 9, 5, 9, 149, 10, 9, 3, 9, 5, 9, 152, 10, 9, 3, 10, 3, 10, 3, 11, 5, 11, 157, 10, 11, 3, 11, 7, 11, 160, 10, 11, 12, 11, 14, 11, 163, 11, 11, 3, 11, 3, 11, 3, 11, 3, 11, 7, 11, 169, 10, 11, 12, 11, 14, 11, 172, 11, 11, 3, 11, 3, 11, 5, 11, 176, 10, 11, 3, 12, 5, 12, 179, 10, 12, 3, 12, 7, 12, 182, 10, 12, 12, 12, 14, 12, 185, 11, 12, 3, 12, 5, 12, 188, 10, 12, 3, 12, 3, 12, 3, 12, 3, 12, 5, 12, 194, 10, 12, 3, 12, 5, 12, 197, 10, 12, 3, 13, 3, 13, 5, 13, 201, 10, 13, 3, 14, 3, 14, 3, 14, 5, 14, 206, 10, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 5, 16, 213, 10, 16, 3, 16, 5, 16, 216, 10, 16, 3, 17, 3, 17, 3, 17, 3, 17, 5, 17, 222, 10, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 5, 19, 231, 10, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 5, 22, 244, 10, 22, 3, 22, 7, 22, 247, 10, 22, 12, 22, 14, 22, 250, 11, 22, 3, 22, 3, 22, 3, 22, 3, 22, 7, 22, 256, 10, 22, 12, 22, 14, 22, 259, 11, 22, 3, 22, 3, 22, 5, 22, 263, 10, 22, 3, 23, 5, 23, 266, 10, 23, 3, 23, 7, 23, 269, 10, 23, 12, 23, 14, 23, 272, 11, 23, 3, 23, 3, 23, 3, 23, 5, 23, 277, 10, 23, 3, 24, 5, 24, 280, 10, 24, 3, 24, 7, 24, 283, 10, 24, 12, 24, 14, 24, 286, 11, 24, 3, 24, 3, 24, 3, 24, 3, 24, 7, 24, 292, 10, 24, 12, 24, 14, 24, 295, 11, 24, 3, 24, 3, 24, 5, 24, 299, 10, 24, 3, 25, 3, 25, 5, 25, 303, 10, 25, 3, 26, 5, 26, 306, 10, 26, 3, 26, 7, 26, 309, 10, 26, 12, 26, 14, 26, 312, 11, 26, 3, 26, 3, 26, 3, 26, 5, 26, 317, 10, 26, 3, 26, 5, 26, 320, 10, 26, 3, 27, 3, 27, 5, 27, 324, 10, 27, 3, 27, 2, 2, 28, 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, 2, 2, 2, 357, 2, 54, 3, 2, 2, 2, 4, 61, 3, 2, 2, 2, 6, 68, 3, 2, 2, 2, 8, 75, 3, 2, 2, 2, 10, 92, 3, 2, 2, 2, 12, 95, 3, 2, 2, 2, 14, 123, 3, 2, 2, 2, 16, 126, 3, 2, 2, 2, 18, 153, 3, 2, 2, 2, 20, 156, 3, 2, 2, 2, 22, 178, 3, 2, 2, 2, 24, 200, 3, 2, 2, 2, 26, 202, 3, 2, 2, 2, 28, 207, 3, 2, 2, 2, 30, 209, 3, 2, 2, 2, 32, 221, 3, 2, 2, 2, 34, 223, 3, 2, 2, 2, 36, 230, 3, 2, 2, 2, 38, 232, 3, 2, 2, 2, 40, 237, 3, 2, 2, 2, 42, 243, 3, 2, 2, 2, 44, 265, 3, 2, 2, 2, 46, 279, 3, 2, 2, 2, 48, 302, 3, 2, 2, 2, 50, 305, 3, 2, 2, 2, 52, 323, 3, 2, 2, 2, 54, 58, 5, 4, 3, 2, 55, 57, 5, 10, 6, 2, 56, 55, 3, 2, 2, 2, 57, 60, 3, 2, 2, 2, 58, 56, 3, 2, 2, 2, 58, 59, 3, 2, 2, 2, 59, 3, 3, 2, 2, 2, 60, 58, 3, 2, 2, 2, 61, 65, 5, 8, 5, 2, 62, 64, 5, 6, 4, 2, 63, 62, 3, 2, 2, 2, 64, 67, 3, 2, 2, 2, 65, 63, 3, 2, 2, 2, 65, 66, 3, 2, 2, 2, 66, 5, 3, 2, 2, 2, 67, 65, 3, 2, 2, 2, 68, 69, 7, 3, 2, 2, 69, 70, 7, 34, 2, 2, 70, 72, 7, 35, 2, 2, 71, 73, 7, 4, 2, 2, 72, 71, 3, 2, 2, 2, 72, 73, 3, 2, 2, 2, 73, 7, 3, 2, 2, 2, 74, 76, 7, 36, 2, 2, 75, 74, 3, 2, 2, 2, 75, 76, 3, 2, 2, 2, 76, 80, 3, 2, 2, 2, 77, 79, 5, 28, 15, 2, 78, 77, 3, 2, 2, 2, 79, 82, 3, 2, 2, 2, 80, 78, 3, 2, 2, 2, 80, 81, 3, 2, 2, 2, 81, 83, 3, 2, 2, 2, 82, 80, 3, 2, 2, 2, 83, 84, 7, 5, 2, 2, 84, 85, 7, 34, 2, 2, 85, 87, 7, 35, 2, 2, 86, 88, 7, 4, 2, 2, 87, 86, 3, 2, 2, 2, 87, 88, 3, 2, 2, 2, 88, 9, 3, 2, 2, 2, 89, 93, 5, 12, 7, 2, 90, 93, 5, 42, 22, 2, 91, 93, 5, 46, 24, 2, 92, 89, 3, 2, 2, 2, 92, 90, 3, 2, 2, 2, 92, 91, 3, 2, 2, 2, 93, 11, 3, 2, 2, 2, 94, 96, 7, 36, 2, 2, 95, 94, 3, 2, 2, 2, 95, 96, 3, 2, 2, 2, 96, 100, 3, 2, 2, 2, 97, 99, 5, 28, 15, 2, 98, 97, 3, 2, 2, 2, 99, 102, 3, 2, 2, 2, 100, 98, 3, 2, 2, 2, 100, 101, 3, 2, 2, 2, 101, 103, 3, 2, 2, 2, 102, 100, 3, 2, 2, 2, 103, 104, 7, 6, 2, 2, 104, 107, 7, 34, 2, 2, 105, 106, 7, 7, 2, 2, 106, 108, 7, 34, 2, 2, 107, 105, 3, 2, 2, 2, 107, 108, 3, 2, 2, 2, 108, 109, 3, 2, 2, 2, 109, 113, 7, 8, 2, 2, 110, 112, 5, 14, 8, 2, 111, 110, 3, 2, 2, 2, 112, 115, 3, 2, 2, 2, 113, 111, 3, 2, 2, 2, 113, 114, 3, 2, 2, 2, 114, 116, 3, 2, 2, 2, 115, 113, 3, 2, 2, 2, 116, 118, 7, 9, 2, 2, 117, 119, 7, 4, 2, 2, 118, 117, 3, 2, 2, 2, 118, 119, 3, 2, 2, 2, 119, 13, 3, 2, 2, 2, 120, 124, 5, 16, 9, 2, 121, 124, 5, 22, 12, 2, 122, 124, 5, 20, 11, 2, 123, 120, 3, 2, 2, 2, 123, 121, 3, 2, 2, 2, 123, 122, 3, 2, 2, 2, 124, 15, 3, 2, 2, 2, 125, 127, 7, 36, 2, 2, 126, 125, 3, 2, 2, 2, 126, 127, 3, 2, 2, 2, 127, 131, 3, 2, 2, 2, 128, 130, 5, 28, 15, 2, 129, 128, 3, 2, 2, 2, 130, 133, 3, 2, 2, 2, 131, 129, 3, 2, 2, 2, 131, 132, 3, 2, 2, 2, 132, 136, 3, 2, 2, 2, 133, 131, 3, 2, 2, 2, 134, 137, 5, 32, 17, 2, 135, 137, 7, 10, 2, 2, 136, 134, 3, 2, 2, 2, 136, 135, 3, 2, 2, 2, 137, 138, 3, 2, 2, 2, 138, 139, 7, 34, 2, 2, 139, 143, 7, 11, 2, 2, 140, 142, 5, 26, 14, 2, 141, 140, 3, 2, 2, 2, 142, 145, 3, 2, 2, 2, 143, 141, 3, 2, 2, 2, 143, 144, 3, 2, 2, 2, 144, 146, 3, 2, 2, 2, 145, 143, 3, 2, 2, 2, 146, 148, 7, 12, 2, 2, 147, 149, 5, 18, 10, 2, 148, 147, 3, 2, 2, 2, 148, 149, 3, 2, 2, 2, 149, 151, 3, 2, 2, 2, 150, 152, 7, 4, 2, 2, 151, 150, 3, 2, 2, 2, 151, 152, 3, 2, 2, 2, 152, 17, 3, 2, 2, 2, 153, 154, 7, 13, 2, 2, 154, 19, 3, 2, 2, 2, 155, 157, 7, 36, 2, 2, 156, 155, 3, 2, 2, 2, 156, 157, 3, 2, 2, 2, 157, 161, 3, 2, 2, 2, 158, 160, 5, 28, 15, 2, 159, 158, 3, 2, 2, 2, 160, 163, 3, 2, 2, 2, 161, 159, 3, 2, 2, 2, 161, 162, 3, 2, 2, 2, 162, 164, 3, 2, 2, 2, 163, 161, 3, 2, 2, 2, 164, 165, 7, 14, 2, 2, 165, 166, 7, 34, 2, 2, 166, 170, 7, 11, 2, 2, 167, 169, 5, 26, 14, 2, 168, 167, 3, 2, 2, 2, 169, 172, 3, 2, 2, 2, 170, 168, 3, 2, 2, 2, 170, 171, 3, 2, 2, 2, 171, 173, 3, 2, 2, 2, 172, 170, 3, 2, 2, 2, 173, 175, 7, 12, 2, 2, 174, 176, 7, 4, 2, 2, 175, 174, 3, 2, 2, 2, 175, 176, 3, 2, 2, 2, 176, 21, 3, 2, 2, 2, 177, 179, 7, 36, 2, 2, 178, 177, 3, 2, 2, 2, 178, 179, 3, 2, 2, 2, 179, 183, 3, 2, 2, 2, 180, 182, 5, 28, 15, 2, 181, 180, 3, 2, 2, 2, 182, 185, 3, 2, 2, 2, 183, 181, 3, 2, 2, 2, 183, 184, 3, 2, 2, 2, 184, 187, 3, 2, 2, 2, 185, 183, 3, 2, 2, 2, 186, 188, 5, 24, 13, 2, 187, 186, 3, 2, 2, 2, 187, 188, 3, 2, 2, 2, 188, 189, 3, 2, 2, 2, 189, 190, 5, 32, 17, 2, 190, 193, 7, 34, 2, 2, 191, 192, 7, 15, 2, 2, 192, 194, 7, 34, 2, 2, 193, 191, 3, 2, 2, 2, 193, 194, 3, 2, 2, 2, 194, 196, 3, 2, 2, 2, 195, 197, 7, 4, 2, 2, 196, 195, 3, 2, 2, 2, 196, 197, 3, 2, 2, 2, 197, 23, 3, 2, 2, 2, 198, 201, 7, 16, 2, 2, 199, 201, 7, 13, 2, 2, 200, 198, 3, 2, 2, 2, 200, 199, 3, 2, 2, 2, 201, 25, 3, 2, 2, 2, 202, 203, 5, 32, 17, 2, 203, 205, 7, 34, 2, 2, 204, 206, 7, 17, 2, 2, 205, 204, 3, 2, 2, 2, 205, 206, 3, 2, 2, 2, 206, 27, 3, 2, 2, 2, 207, 208, 7, 30, 2, 2, 208, 29, 3, 2, 2, 2, 209, 212, 7, 34, 2, 2, 210, 211, 7, 15, 2, 2, 211, 213, 7, 34, 2, 2, 212, 210, 3, 2, 2, 2, 212, 213, 3, 2, 2, 2, 213, 215, 3, 2, 2, 2, 214, 216, 7, 17, 2, 2, 215, 214, 3, 2, 2, 2, 215, 216, 3, 2, 2, 2, 216, 31, 3, 2, 2, 2, 217, 222, 5, 36, 19, 2, 218, 222, 5, 34, 18, 2, 219, 222, 5, 38, 20, 2, 220, 222, 5, 40, 21, 2, 221, 217, 3, 2, 2, 2, 221, 218, 3, 2, 2, 2, 221, 219, 3, 2, 2, 2, 221, 220, 3, 2, 2, 2, 222, 33, 3, 2, 2, 2, 223, 224, 7, 34, 2, 2, 224, 35, 3, 2, 2, 2, 225, 231, 7, 18, 2, 2, 226, 231, 7, 19, 2, 2, 227, 231, 7, 20, 2, 2, 228, 231, 7, 21, 2, 2, 229, 231, 7, 22, 2, 2, 230, 225, 3, 2, 2, 2, 230, 226, 3, 2, 2, 2, 230, 227, 3, 2, 2, 2, 230, 228, 3, 2, 2, 2, 230, 229, 3, 2, 2, 2, 231, 37, 3, 2, 2, 2, 232, 233, 7, 23, 2, 2, 233, 234, 7, 24, 2, 2, 234, 235, 5, 32, 17, 2, 235, 236, 7, 25, 2, 2, 236, 39, 3, 2, 2, 2, 237, 238, 7, 26, 2, 2, 238, 239, 7, 24, 2, 2, 239, 240, 5, 32, 17, 2, 240, 241, 7, 25, 2, 2, 241, 41, 3, 2, 2, 2, 242, 244, 7, 36, 2, 2, 243, 242, 3, 2, 2, 2, 243, 244, 3, 2, 2, 2, 244, 248, 3, 2, 2, 2, 245, 247, 5, 28, 15, 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, 251, 3, 2, 2, 2, 250, 248, 3, 2, 2, 2, 251, 252, 7, 27, 2, 2, 252, 253, 7, 34, 2, 2, 253, 257, 7, 8, 2, 2, 254, 256, 5, 44, 23, 2, 255, 254, 3, 2, 2, 2, 256, 259, 3, 2, 2, 2, 257, 255, 3, 2, 2, 2, 257, 258, 3, 2, 2, 2, 258, 260, 3, 2, 2, 2, 259, 257, 3, 2, 2, 2, 260, 262, 7, 9, 2, 2, 261, 263, 7, 4, 2, 2, 262, 261, 3, 2, 2, 2, 262, 263, 3, 2, 2, 2, 263, 43, 3, 2, 2, 2, 264, 266, 7, 36, 2, 2, 265, 264, 3, 2, 2, 2, 265, 266, 3, 2, 2, 2, 266, 270, 3, 2, 2, 2, 267, 269, 5, 28, 15, 2, 268, 267, 3, 2, 2, 2, 269, 272, 3, 2, 2, 2, 270, 268, 3, 2, 2, 2, 270, 271, 3, 2, 2, 2, 271, 273, 3, 2, 2, 2, 272, 270, 3, 2, 2, 2, 273, 274, 5, 32, 17, 2, 274, 276, 7, 34, 2, 2, 275, 277, 7, 4, 2, 2, 276, 275, 3, 2, 2, 2, 276, 277, 3, 2, 2, 2, 277, 45, 3, 2, 2, 2, 278, 280, 7, 36, 2, 2, 279, 278, 3, 2, 2, 2, 279, 280, 3, 2, 2, 2, 280, 284, 3, 2, 2, 2, 281, 283, 5, 28, 15, 2, 282, 281, 3, 2, 2, 2, 283, 286, 3, 2, 2, 2, 284, 282, 3, 2, 2, 2, 284, 285, 3, 2, 2, 2, 285, 287, 3, 2, 2, 2, 286, 284, 3, 2, 2, 2, 287, 288, 5, 48, 25, 2, 288, 289, 7, 34, 2, 2, 289, 293, 7, 8, 2, 2, 290, 292, 5, 50, 26, 2, 291, 290, 3, 2, 2, 2, 292, 295, 3, 2, 2, 2, 293, 291, 3, 2, 2, 2, 293, 294, 3, 2, 2, 2, 294, 296, 3, 2, 2, 2, 295, 293, 3, 2, 2, 2, 296, 298, 7, 9, 2, 2, 297, 299, 7, 4, 2, 2, 298, 297, 3, 2, 2, 2, 298, 299, 3, 2, 2, 2, 299, 47, 3, 2, 2, 2, 300, 303, 7, 28, 2, 2, 301, 303, 7, 29, 2, 2, 302, 300, 3, 2, 2, 2, 302, 301, 3, 2, 2, 2, 303, 49, 3, 2, 2, 2, 304, 306, 7, 36, 2, 2, 305, 304, 3, 2, 2, 2, 305, 306, 3, 2, 2, 2, 306, 310, 3, 2, 2, 2, 307, 309, 5, 28, 15, 2, 308, 307, 3, 2, 2, 2, 309, 312, 3, 2, 2, 2, 310, 308, 3, 2, 2, 2, 310, 311, 3, 2, 2, 2, 311, 313, 3, 2, 2, 2, 312, 310, 3, 2, 2, 2, 313, 316, 7, 34, 2, 2, 314, 315, 7, 15, 2, 2, 315, 317, 5, 52, 27, 2, 316, 314, 3, 2, 2, 2, 316, 317, 3, 2, 2, 2, 317, 319, 3, 2, 2, 2, 318, 320, 7, 17, 2, 2, 319, 318, 3, 2, 2, 2, 319, 320, 3, 2, 2, 2, 320, 51, 3, 2, 2, 2, 321, 324, 7, 31, 2, 2, 322, 324, 7, 32, 2, 2, 323, 321, 3, 2, 2, 2, 323, 322, 3, 2, 2, 2, 324, 53, 3, 2, 2, 2, 53, 58, 65, 72, 75, 80, 87, 92, 95, 100, 107, 113, 118, 123, 126, 131, 136, 143, 148, 151, 156, 161, 170, 175, 178, 183, 187, 193, 196, 200, 205, 212, 215, 221, 230, 243, 248, 257, 262, 265, 270, 276, 279, 284, 293, 298, 302, 305, 310, 316, 319, 323] \ No newline at end of file diff --git a/qface/idl/parser/T.tokens b/qface/idl/parser/T.tokens index 5f94603..5362da5 100644 --- a/qface/idl/parser/T.tokens +++ b/qface/idl/parser/T.tokens @@ -47,9 +47,9 @@ MULTICOMM=37 ')'=10 'const'=11 'signal'=12 -'readonly'=13 -','=14 -'='=15 +'='=13 +'readonly'=14 +','=15 'bool'=16 'int'=17 'real'=18 diff --git a/qface/idl/parser/TLexer.interp b/qface/idl/parser/TLexer.interp new file mode 100644 index 0000000..47a4243 --- /dev/null +++ b/qface/idl/parser/TLexer.interp @@ -0,0 +1,128 @@ +token literal names: +null +'import' +';' +'module' +'interface' +'extends' +'{' +'}' +'void' +'(' +')' +'const' +'signal' +'=' +'readonly' +',' +'bool' +'int' +'real' +'string' +'var' +'list' +'<' +'>' +'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 +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 +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, 39, 294, 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, 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, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 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, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 7, 29, 210, 10, 29, 12, 29, 14, 29, 213, 11, 29, 3, 30, 5, 30, 216, 10, 30, 3, 30, 6, 30, 219, 10, 30, 13, 30, 14, 30, 220, 3, 31, 3, 31, 3, 31, 3, 31, 6, 31, 227, 10, 31, 13, 31, 14, 31, 228, 3, 32, 3, 32, 3, 32, 7, 32, 234, 10, 32, 12, 32, 14, 32, 237, 11, 32, 3, 33, 3, 33, 7, 33, 241, 10, 33, 12, 33, 14, 33, 244, 11, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 7, 35, 255, 10, 35, 12, 35, 14, 35, 258, 11, 35, 3, 35, 3, 35, 3, 35, 3, 36, 6, 36, 264, 10, 36, 13, 36, 14, 36, 265, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 37, 7, 37, 274, 10, 37, 12, 37, 14, 37, 277, 11, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 38, 7, 38, 285, 10, 38, 12, 38, 14, 38, 288, 11, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 4, 256, 286, 2, 39, 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, 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, 303, 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, 3, 77, 3, 2, 2, 2, 5, 84, 3, 2, 2, 2, 7, 86, 3, 2, 2, 2, 9, 93, 3, 2, 2, 2, 11, 103, 3, 2, 2, 2, 13, 111, 3, 2, 2, 2, 15, 113, 3, 2, 2, 2, 17, 115, 3, 2, 2, 2, 19, 120, 3, 2, 2, 2, 21, 122, 3, 2, 2, 2, 23, 124, 3, 2, 2, 2, 25, 130, 3, 2, 2, 2, 27, 137, 3, 2, 2, 2, 29, 139, 3, 2, 2, 2, 31, 148, 3, 2, 2, 2, 33, 150, 3, 2, 2, 2, 35, 155, 3, 2, 2, 2, 37, 159, 3, 2, 2, 2, 39, 164, 3, 2, 2, 2, 41, 171, 3, 2, 2, 2, 43, 175, 3, 2, 2, 2, 45, 180, 3, 2, 2, 2, 47, 182, 3, 2, 2, 2, 49, 184, 3, 2, 2, 2, 51, 190, 3, 2, 2, 2, 53, 197, 3, 2, 2, 2, 55, 202, 3, 2, 2, 2, 57, 207, 3, 2, 2, 2, 59, 215, 3, 2, 2, 2, 61, 222, 3, 2, 2, 2, 63, 230, 3, 2, 2, 2, 65, 238, 3, 2, 2, 2, 67, 245, 3, 2, 2, 2, 69, 249, 3, 2, 2, 2, 71, 263, 3, 2, 2, 2, 73, 269, 3, 2, 2, 2, 75, 280, 3, 2, 2, 2, 77, 78, 7, 107, 2, 2, 78, 79, 7, 111, 2, 2, 79, 80, 7, 114, 2, 2, 80, 81, 7, 113, 2, 2, 81, 82, 7, 116, 2, 2, 82, 83, 7, 118, 2, 2, 83, 4, 3, 2, 2, 2, 84, 85, 7, 61, 2, 2, 85, 6, 3, 2, 2, 2, 86, 87, 7, 111, 2, 2, 87, 88, 7, 113, 2, 2, 88, 89, 7, 102, 2, 2, 89, 90, 7, 119, 2, 2, 90, 91, 7, 110, 2, 2, 91, 92, 7, 103, 2, 2, 92, 8, 3, 2, 2, 2, 93, 94, 7, 107, 2, 2, 94, 95, 7, 112, 2, 2, 95, 96, 7, 118, 2, 2, 96, 97, 7, 103, 2, 2, 97, 98, 7, 116, 2, 2, 98, 99, 7, 104, 2, 2, 99, 100, 7, 99, 2, 2, 100, 101, 7, 101, 2, 2, 101, 102, 7, 103, 2, 2, 102, 10, 3, 2, 2, 2, 103, 104, 7, 103, 2, 2, 104, 105, 7, 122, 2, 2, 105, 106, 7, 118, 2, 2, 106, 107, 7, 103, 2, 2, 107, 108, 7, 112, 2, 2, 108, 109, 7, 102, 2, 2, 109, 110, 7, 117, 2, 2, 110, 12, 3, 2, 2, 2, 111, 112, 7, 125, 2, 2, 112, 14, 3, 2, 2, 2, 113, 114, 7, 127, 2, 2, 114, 16, 3, 2, 2, 2, 115, 116, 7, 120, 2, 2, 116, 117, 7, 113, 2, 2, 117, 118, 7, 107, 2, 2, 118, 119, 7, 102, 2, 2, 119, 18, 3, 2, 2, 2, 120, 121, 7, 42, 2, 2, 121, 20, 3, 2, 2, 2, 122, 123, 7, 43, 2, 2, 123, 22, 3, 2, 2, 2, 124, 125, 7, 101, 2, 2, 125, 126, 7, 113, 2, 2, 126, 127, 7, 112, 2, 2, 127, 128, 7, 117, 2, 2, 128, 129, 7, 118, 2, 2, 129, 24, 3, 2, 2, 2, 130, 131, 7, 117, 2, 2, 131, 132, 7, 107, 2, 2, 132, 133, 7, 105, 2, 2, 133, 134, 7, 112, 2, 2, 134, 135, 7, 99, 2, 2, 135, 136, 7, 110, 2, 2, 136, 26, 3, 2, 2, 2, 137, 138, 7, 63, 2, 2, 138, 28, 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, 30, 3, 2, 2, 2, 148, 149, 7, 46, 2, 2, 149, 32, 3, 2, 2, 2, 150, 151, 7, 100, 2, 2, 151, 152, 7, 113, 2, 2, 152, 153, 7, 113, 2, 2, 153, 154, 7, 110, 2, 2, 154, 34, 3, 2, 2, 2, 155, 156, 7, 107, 2, 2, 156, 157, 7, 112, 2, 2, 157, 158, 7, 118, 2, 2, 158, 36, 3, 2, 2, 2, 159, 160, 7, 116, 2, 2, 160, 161, 7, 103, 2, 2, 161, 162, 7, 99, 2, 2, 162, 163, 7, 110, 2, 2, 163, 38, 3, 2, 2, 2, 164, 165, 7, 117, 2, 2, 165, 166, 7, 118, 2, 2, 166, 167, 7, 116, 2, 2, 167, 168, 7, 107, 2, 2, 168, 169, 7, 112, 2, 2, 169, 170, 7, 105, 2, 2, 170, 40, 3, 2, 2, 2, 171, 172, 7, 120, 2, 2, 172, 173, 7, 99, 2, 2, 173, 174, 7, 116, 2, 2, 174, 42, 3, 2, 2, 2, 175, 176, 7, 110, 2, 2, 176, 177, 7, 107, 2, 2, 177, 178, 7, 117, 2, 2, 178, 179, 7, 118, 2, 2, 179, 44, 3, 2, 2, 2, 180, 181, 7, 62, 2, 2, 181, 46, 3, 2, 2, 2, 182, 183, 7, 64, 2, 2, 183, 48, 3, 2, 2, 2, 184, 185, 7, 111, 2, 2, 185, 186, 7, 113, 2, 2, 186, 187, 7, 102, 2, 2, 187, 188, 7, 103, 2, 2, 188, 189, 7, 110, 2, 2, 189, 50, 3, 2, 2, 2, 190, 191, 7, 117, 2, 2, 191, 192, 7, 118, 2, 2, 192, 193, 7, 116, 2, 2, 193, 194, 7, 119, 2, 2, 194, 195, 7, 101, 2, 2, 195, 196, 7, 118, 2, 2, 196, 52, 3, 2, 2, 2, 197, 198, 7, 103, 2, 2, 198, 199, 7, 112, 2, 2, 199, 200, 7, 119, 2, 2, 200, 201, 7, 111, 2, 2, 201, 54, 3, 2, 2, 2, 202, 203, 7, 104, 2, 2, 203, 204, 7, 110, 2, 2, 204, 205, 7, 99, 2, 2, 205, 206, 7, 105, 2, 2, 206, 56, 3, 2, 2, 2, 207, 211, 7, 66, 2, 2, 208, 210, 10, 2, 2, 2, 209, 208, 3, 2, 2, 2, 210, 213, 3, 2, 2, 2, 211, 209, 3, 2, 2, 2, 211, 212, 3, 2, 2, 2, 212, 58, 3, 2, 2, 2, 213, 211, 3, 2, 2, 2, 214, 216, 9, 3, 2, 2, 215, 214, 3, 2, 2, 2, 215, 216, 3, 2, 2, 2, 216, 218, 3, 2, 2, 2, 217, 219, 4, 50, 59, 2, 218, 217, 3, 2, 2, 2, 219, 220, 3, 2, 2, 2, 220, 218, 3, 2, 2, 2, 220, 221, 3, 2, 2, 2, 221, 60, 3, 2, 2, 2, 222, 223, 7, 50, 2, 2, 223, 224, 7, 122, 2, 2, 224, 226, 3, 2, 2, 2, 225, 227, 9, 4, 2, 2, 226, 225, 3, 2, 2, 2, 227, 228, 3, 2, 2, 2, 228, 226, 3, 2, 2, 2, 228, 229, 3, 2, 2, 2, 229, 62, 3, 2, 2, 2, 230, 231, 7, 66, 2, 2, 231, 235, 9, 5, 2, 2, 232, 234, 9, 6, 2, 2, 233, 232, 3, 2, 2, 2, 234, 237, 3, 2, 2, 2, 235, 233, 3, 2, 2, 2, 235, 236, 3, 2, 2, 2, 236, 64, 3, 2, 2, 2, 237, 235, 3, 2, 2, 2, 238, 242, 9, 5, 2, 2, 239, 241, 9, 6, 2, 2, 240, 239, 3, 2, 2, 2, 241, 244, 3, 2, 2, 2, 242, 240, 3, 2, 2, 2, 242, 243, 3, 2, 2, 2, 243, 66, 3, 2, 2, 2, 244, 242, 3, 2, 2, 2, 245, 246, 9, 7, 2, 2, 246, 247, 7, 48, 2, 2, 247, 248, 9, 7, 2, 2, 248, 68, 3, 2, 2, 2, 249, 250, 7, 49, 2, 2, 250, 251, 7, 44, 2, 2, 251, 252, 7, 44, 2, 2, 252, 256, 3, 2, 2, 2, 253, 255, 11, 2, 2, 2, 254, 253, 3, 2, 2, 2, 255, 258, 3, 2, 2, 2, 256, 257, 3, 2, 2, 2, 256, 254, 3, 2, 2, 2, 257, 259, 3, 2, 2, 2, 258, 256, 3, 2, 2, 2, 259, 260, 7, 44, 2, 2, 260, 261, 7, 49, 2, 2, 261, 70, 3, 2, 2, 2, 262, 264, 9, 8, 2, 2, 263, 262, 3, 2, 2, 2, 264, 265, 3, 2, 2, 2, 265, 263, 3, 2, 2, 2, 265, 266, 3, 2, 2, 2, 266, 267, 3, 2, 2, 2, 267, 268, 8, 36, 2, 2, 268, 72, 3, 2, 2, 2, 269, 270, 7, 49, 2, 2, 270, 271, 7, 49, 2, 2, 271, 275, 3, 2, 2, 2, 272, 274, 10, 2, 2, 2, 273, 272, 3, 2, 2, 2, 274, 277, 3, 2, 2, 2, 275, 273, 3, 2, 2, 2, 275, 276, 3, 2, 2, 2, 276, 278, 3, 2, 2, 2, 277, 275, 3, 2, 2, 2, 278, 279, 8, 37, 2, 2, 279, 74, 3, 2, 2, 2, 280, 281, 7, 49, 2, 2, 281, 282, 7, 44, 2, 2, 282, 286, 3, 2, 2, 2, 283, 285, 11, 2, 2, 2, 284, 283, 3, 2, 2, 2, 285, 288, 3, 2, 2, 2, 286, 287, 3, 2, 2, 2, 286, 284, 3, 2, 2, 2, 287, 289, 3, 2, 2, 2, 288, 286, 3, 2, 2, 2, 289, 290, 7, 44, 2, 2, 290, 291, 7, 49, 2, 2, 291, 292, 3, 2, 2, 2, 292, 293, 8, 38, 2, 2, 293, 76, 3, 2, 2, 2, 13, 2, 211, 215, 220, 228, 235, 242, 256, 265, 275, 286, 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..c66bf36 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 @@ -18,8 +18,8 @@ def serializedATN(): 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\f\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\16\3\16\3\17\3\17\3") + buf.write("\17\3\17\3\17\3\17\3\17\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") @@ -49,7 +49,7 @@ def serializedATN(): 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\2\31\u0082\3\2\2\2\33\u0089\3\2\2\2\35\u008b\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") @@ -69,10 +69,10 @@ def serializedATN(): 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("\u008a\7?\2\2\u008a\34\3\2\2\2\u008b\u008c\7t\2\2\u008c") + buf.write("\u008d\7g\2\2\u008d\u008e\7c\2\2\u008e\u008f\7f\2\2\u008f") + buf.write("\u0090\7q\2\2\u0090\u0091\7p\2\2\u0091\u0092\7n\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") @@ -182,9 +182,10 @@ class TLexer(Lexer): literalNames = [ "", "'import'", "';'", "'module'", "'interface'", "'extends'", "'{'", - "'}'", "'void'", "'('", "')'", "'const'", "'signal'", "'readonly'", - "','", "'='", "'bool'", "'int'", "'real'", "'string'", "'var'", - "'list'", "'<'", "'>'", "'model'", "'struct'", "'enum'", "'flag'" ] + "'}'", "'void'", "'('", "')'", "'const'", "'signal'", "'='", + "'readonly'", "','", "'bool'", "'int'", "'real'", "'string'", + "'var'", "'list'", "'<'", "'>'", "'model'", "'struct'", "'enum'", + "'flag'" ] symbolicNames = [ "", "TAGLINE", "INTCONSTANT", "HEXCONSTANT", "TAGIDENTIFIER", "IDENTIFIER", @@ -202,7 +203,7 @@ class TLexer(Lexer): 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..5362da5 100644 --- a/qface/idl/parser/TLexer.tokens +++ b/qface/idl/parser/TLexer.tokens @@ -47,9 +47,9 @@ MULTICOMM=37 ')'=10 'const'=11 'signal'=12 -'readonly'=13 -','=14 -'='=15 +'='=13 +'readonly'=14 +','=15 'bool'=16 'int'=17 'real'=18 diff --git a/qface/idl/parser/TListener.py b/qface/idl/parser/TListener.py index 54e764a..b4c22f2 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 diff --git a/qface/idl/parser/TParser.py b/qface/idl/parser/TParser.py index b180f95..fb6f055 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 @@ -8,7 +8,7 @@ import sys 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("\u0146\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") @@ -25,139 +25,141 @@ def serializedATN(): 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("\f\u00b9\13\f\3\f\5\f\u00bc\n\f\3\f\3\f\3\f\3\f\5\f\u00c2") + buf.write("\n\f\3\f\5\f\u00c5\n\f\3\r\3\r\5\r\u00c9\n\r\3\16\3\16") + buf.write("\3\16\5\16\u00ce\n\16\3\17\3\17\3\20\3\20\3\20\5\20\u00d5") + buf.write("\n\20\3\20\5\20\u00d8\n\20\3\21\3\21\3\21\3\21\5\21\u00de") + buf.write("\n\21\3\22\3\22\3\23\3\23\3\23\3\23\3\23\5\23\u00e7\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\5\26\u00f4\n\26\3\26\7\26\u00f7\n\26\f\26\16\26") + buf.write("\u00fa\13\26\3\26\3\26\3\26\3\26\7\26\u0100\n\26\f\26") + buf.write("\16\26\u0103\13\26\3\26\3\26\5\26\u0107\n\26\3\27\5\27") + buf.write("\u010a\n\27\3\27\7\27\u010d\n\27\f\27\16\27\u0110\13\27") + buf.write("\3\27\3\27\3\27\5\27\u0115\n\27\3\30\5\30\u0118\n\30\3") + buf.write("\30\7\30\u011b\n\30\f\30\16\30\u011e\13\30\3\30\3\30\3") + buf.write("\30\3\30\7\30\u0124\n\30\f\30\16\30\u0127\13\30\3\30\3") + buf.write("\30\5\30\u012b\n\30\3\31\3\31\5\31\u012f\n\31\3\32\5\32") + buf.write("\u0132\n\32\3\32\7\32\u0135\n\32\f\32\16\32\u0138\13\32") + buf.write("\3\32\3\32\3\32\5\32\u013d\n\32\3\32\5\32\u0140\n\32\3") + buf.write("\33\3\33\5\33\u0144\n\33\3\33\2\2\34\2\4\6\b\n\f\16\20") + buf.write("\22\24\26\30\32\34\36 \"$&(*,.\60\62\64\2\2\2\u0165\2") + buf.write("\66\3\2\2\2\4=\3\2\2\2\6D\3\2\2\2\bK\3\2\2\2\n\\\3\2\2") + buf.write("\2\f_\3\2\2\2\16{\3\2\2\2\20~\3\2\2\2\22\u0099\3\2\2\2") + buf.write("\24\u009c\3\2\2\2\26\u00b2\3\2\2\2\30\u00c8\3\2\2\2\32") + buf.write("\u00ca\3\2\2\2\34\u00cf\3\2\2\2\36\u00d1\3\2\2\2 \u00dd") + buf.write("\3\2\2\2\"\u00df\3\2\2\2$\u00e6\3\2\2\2&\u00e8\3\2\2\2") + buf.write("(\u00ed\3\2\2\2*\u00f3\3\2\2\2,\u0109\3\2\2\2.\u0117\3") + buf.write("\2\2\2\60\u012e\3\2\2\2\62\u0131\3\2\2\2\64\u0143\3\2") + buf.write("\2\2\66:\5\4\3\2\679\5\n\6\28\67\3\2\2\29<\3\2\2\2:8\3") + buf.write("\2\2\2:;\3\2\2\2;\3\3\2\2\2<:\3\2\2\2=A\5\b\5\2>@\5\6") + buf.write("\4\2?>\3\2\2\2@C\3\2\2\2A?\3\2\2\2AB\3\2\2\2B\5\3\2\2") + buf.write("\2CA\3\2\2\2DE\7\3\2\2EF\7\"\2\2FH\7#\2\2GI\7\4\2\2HG") + buf.write("\3\2\2\2HI\3\2\2\2I\7\3\2\2\2JL\7$\2\2KJ\3\2\2\2KL\3\2") + buf.write("\2\2LP\3\2\2\2MO\5\34\17\2NM\3\2\2\2OR\3\2\2\2PN\3\2\2") + buf.write("\2PQ\3\2\2\2QS\3\2\2\2RP\3\2\2\2ST\7\5\2\2TU\7\"\2\2U") + buf.write("W\7#\2\2VX\7\4\2\2WV\3\2\2\2WX\3\2\2\2X\t\3\2\2\2Y]\5") + buf.write("\f\7\2Z]\5*\26\2[]\5.\30\2\\Y\3\2\2\2\\Z\3\2\2\2\\[\3") + buf.write("\2\2\2]\13\3\2\2\2^`\7$\2\2_^\3\2\2\2_`\3\2\2\2`d\3\2") + buf.write("\2\2ac\5\34\17\2ba\3\2\2\2cf\3\2\2\2db\3\2\2\2de\3\2\2") + buf.write("\2eg\3\2\2\2fd\3\2\2\2gh\7\6\2\2hk\7\"\2\2ij\7\7\2\2j") + buf.write("l\7\"\2\2ki\3\2\2\2kl\3\2\2\2lm\3\2\2\2mq\7\b\2\2np\5") + buf.write("\16\b\2on\3\2\2\2ps\3\2\2\2qo\3\2\2\2qr\3\2\2\2rt\3\2") + buf.write("\2\2sq\3\2\2\2tv\7\t\2\2uw\7\4\2\2vu\3\2\2\2vw\3\2\2\2") + buf.write("w\r\3\2\2\2x|\5\20\t\2y|\5\26\f\2z|\5\24\13\2{x\3\2\2") + buf.write("\2{y\3\2\2\2{z\3\2\2\2|\17\3\2\2\2}\177\7$\2\2~}\3\2\2") + buf.write("\2~\177\3\2\2\2\177\u0083\3\2\2\2\u0080\u0082\5\34\17") + buf.write("\2\u0081\u0080\3\2\2\2\u0082\u0085\3\2\2\2\u0083\u0081") + buf.write("\3\2\2\2\u0083\u0084\3\2\2\2\u0084\u0088\3\2\2\2\u0085") + buf.write("\u0083\3\2\2\2\u0086\u0089\5 \21\2\u0087\u0089\7\n\2\2") + buf.write("\u0088\u0086\3\2\2\2\u0088\u0087\3\2\2\2\u0089\u008a\3") + buf.write("\2\2\2\u008a\u008b\7\"\2\2\u008b\u008f\7\13\2\2\u008c") + buf.write("\u008e\5\32\16\2\u008d\u008c\3\2\2\2\u008e\u0091\3\2\2") + buf.write("\2\u008f\u008d\3\2\2\2\u008f\u0090\3\2\2\2\u0090\u0092") + buf.write("\3\2\2\2\u0091\u008f\3\2\2\2\u0092\u0094\7\f\2\2\u0093") + buf.write("\u0095\5\22\n\2\u0094\u0093\3\2\2\2\u0094\u0095\3\2\2") + buf.write("\2\u0095\u0097\3\2\2\2\u0096\u0098\7\4\2\2\u0097\u0096") + buf.write("\3\2\2\2\u0097\u0098\3\2\2\2\u0098\21\3\2\2\2\u0099\u009a") + buf.write("\7\r\2\2\u009a\23\3\2\2\2\u009b\u009d\7$\2\2\u009c\u009b") + buf.write("\3\2\2\2\u009c\u009d\3\2\2\2\u009d\u00a1\3\2\2\2\u009e") + buf.write("\u00a0\5\34\17\2\u009f\u009e\3\2\2\2\u00a0\u00a3\3\2\2") + buf.write("\2\u00a1\u009f\3\2\2\2\u00a1\u00a2\3\2\2\2\u00a2\u00a4") + buf.write("\3\2\2\2\u00a3\u00a1\3\2\2\2\u00a4\u00a5\7\16\2\2\u00a5") + buf.write("\u00a6\7\"\2\2\u00a6\u00aa\7\13\2\2\u00a7\u00a9\5\32\16") + buf.write("\2\u00a8\u00a7\3\2\2\2\u00a9\u00ac\3\2\2\2\u00aa\u00a8") + buf.write("\3\2\2\2\u00aa\u00ab\3\2\2\2\u00ab\u00ad\3\2\2\2\u00ac") + buf.write("\u00aa\3\2\2\2\u00ad\u00af\7\f\2\2\u00ae\u00b0\7\4\2\2") + buf.write("\u00af\u00ae\3\2\2\2\u00af\u00b0\3\2\2\2\u00b0\25\3\2") + buf.write("\2\2\u00b1\u00b3\7$\2\2\u00b2\u00b1\3\2\2\2\u00b2\u00b3") + buf.write("\3\2\2\2\u00b3\u00b7\3\2\2\2\u00b4\u00b6\5\34\17\2\u00b5") + buf.write("\u00b4\3\2\2\2\u00b6\u00b9\3\2\2\2\u00b7\u00b5\3\2\2\2") + buf.write("\u00b7\u00b8\3\2\2\2\u00b8\u00bb\3\2\2\2\u00b9\u00b7\3") + buf.write("\2\2\2\u00ba\u00bc\5\30\r\2\u00bb\u00ba\3\2\2\2\u00bb") + buf.write("\u00bc\3\2\2\2\u00bc\u00bd\3\2\2\2\u00bd\u00be\5 \21\2") + buf.write("\u00be\u00c1\7\"\2\2\u00bf\u00c0\7\17\2\2\u00c0\u00c2") + buf.write("\7\"\2\2\u00c1\u00bf\3\2\2\2\u00c1\u00c2\3\2\2\2\u00c2") + buf.write("\u00c4\3\2\2\2\u00c3\u00c5\7\4\2\2\u00c4\u00c3\3\2\2\2") + buf.write("\u00c4\u00c5\3\2\2\2\u00c5\27\3\2\2\2\u00c6\u00c9\7\20") + buf.write("\2\2\u00c7\u00c9\7\r\2\2\u00c8\u00c6\3\2\2\2\u00c8\u00c7") + buf.write("\3\2\2\2\u00c9\31\3\2\2\2\u00ca\u00cb\5 \21\2\u00cb\u00cd") + buf.write("\7\"\2\2\u00cc\u00ce\7\21\2\2\u00cd\u00cc\3\2\2\2\u00cd") + buf.write("\u00ce\3\2\2\2\u00ce\33\3\2\2\2\u00cf\u00d0\7\36\2\2\u00d0") + buf.write("\35\3\2\2\2\u00d1\u00d4\7\"\2\2\u00d2\u00d3\7\17\2\2\u00d3") + buf.write("\u00d5\7\"\2\2\u00d4\u00d2\3\2\2\2\u00d4\u00d5\3\2\2\2") + buf.write("\u00d5\u00d7\3\2\2\2\u00d6\u00d8\7\21\2\2\u00d7\u00d6") + buf.write("\3\2\2\2\u00d7\u00d8\3\2\2\2\u00d8\37\3\2\2\2\u00d9\u00de") + buf.write("\5$\23\2\u00da\u00de\5\"\22\2\u00db\u00de\5&\24\2\u00dc") + buf.write("\u00de\5(\25\2\u00dd\u00d9\3\2\2\2\u00dd\u00da\3\2\2\2") + buf.write("\u00dd\u00db\3\2\2\2\u00dd\u00dc\3\2\2\2\u00de!\3\2\2") + buf.write("\2\u00df\u00e0\7\"\2\2\u00e0#\3\2\2\2\u00e1\u00e7\7\22") + buf.write("\2\2\u00e2\u00e7\7\23\2\2\u00e3\u00e7\7\24\2\2\u00e4\u00e7") + buf.write("\7\25\2\2\u00e5\u00e7\7\26\2\2\u00e6\u00e1\3\2\2\2\u00e6") + buf.write("\u00e2\3\2\2\2\u00e6\u00e3\3\2\2\2\u00e6\u00e4\3\2\2\2") + buf.write("\u00e6\u00e5\3\2\2\2\u00e7%\3\2\2\2\u00e8\u00e9\7\27\2") + buf.write("\2\u00e9\u00ea\7\30\2\2\u00ea\u00eb\5 \21\2\u00eb\u00ec") + buf.write("\7\31\2\2\u00ec\'\3\2\2\2\u00ed\u00ee\7\32\2\2\u00ee\u00ef") + buf.write("\7\30\2\2\u00ef\u00f0\5 \21\2\u00f0\u00f1\7\31\2\2\u00f1") + buf.write(")\3\2\2\2\u00f2\u00f4\7$\2\2\u00f3\u00f2\3\2\2\2\u00f3") + buf.write("\u00f4\3\2\2\2\u00f4\u00f8\3\2\2\2\u00f5\u00f7\5\34\17") + buf.write("\2\u00f6\u00f5\3\2\2\2\u00f7\u00fa\3\2\2\2\u00f8\u00f6") + buf.write("\3\2\2\2\u00f8\u00f9\3\2\2\2\u00f9\u00fb\3\2\2\2\u00fa") + buf.write("\u00f8\3\2\2\2\u00fb\u00fc\7\33\2\2\u00fc\u00fd\7\"\2") + buf.write("\2\u00fd\u0101\7\b\2\2\u00fe\u0100\5,\27\2\u00ff\u00fe") + buf.write("\3\2\2\2\u0100\u0103\3\2\2\2\u0101\u00ff\3\2\2\2\u0101") + buf.write("\u0102\3\2\2\2\u0102\u0104\3\2\2\2\u0103\u0101\3\2\2\2") + buf.write("\u0104\u0106\7\t\2\2\u0105\u0107\7\4\2\2\u0106\u0105\3") + buf.write("\2\2\2\u0106\u0107\3\2\2\2\u0107+\3\2\2\2\u0108\u010a") + buf.write("\7$\2\2\u0109\u0108\3\2\2\2\u0109\u010a\3\2\2\2\u010a") + buf.write("\u010e\3\2\2\2\u010b\u010d\5\34\17\2\u010c\u010b\3\2\2") + buf.write("\2\u010d\u0110\3\2\2\2\u010e\u010c\3\2\2\2\u010e\u010f") + buf.write("\3\2\2\2\u010f\u0111\3\2\2\2\u0110\u010e\3\2\2\2\u0111") + buf.write("\u0112\5 \21\2\u0112\u0114\7\"\2\2\u0113\u0115\7\4\2\2") + buf.write("\u0114\u0113\3\2\2\2\u0114\u0115\3\2\2\2\u0115-\3\2\2") + buf.write("\2\u0116\u0118\7$\2\2\u0117\u0116\3\2\2\2\u0117\u0118") + buf.write("\3\2\2\2\u0118\u011c\3\2\2\2\u0119\u011b\5\34\17\2\u011a") + buf.write("\u0119\3\2\2\2\u011b\u011e\3\2\2\2\u011c\u011a\3\2\2\2") + buf.write("\u011c\u011d\3\2\2\2\u011d\u011f\3\2\2\2\u011e\u011c\3") + buf.write("\2\2\2\u011f\u0120\5\60\31\2\u0120\u0121\7\"\2\2\u0121") + buf.write("\u0125\7\b\2\2\u0122\u0124\5\62\32\2\u0123\u0122\3\2\2") + buf.write("\2\u0124\u0127\3\2\2\2\u0125\u0123\3\2\2\2\u0125\u0126") + buf.write("\3\2\2\2\u0126\u0128\3\2\2\2\u0127\u0125\3\2\2\2\u0128") + buf.write("\u012a\7\t\2\2\u0129\u012b\7\4\2\2\u012a\u0129\3\2\2\2") + buf.write("\u012a\u012b\3\2\2\2\u012b/\3\2\2\2\u012c\u012f\7\34\2") + buf.write("\2\u012d\u012f\7\35\2\2\u012e\u012c\3\2\2\2\u012e\u012d") + buf.write("\3\2\2\2\u012f\61\3\2\2\2\u0130\u0132\7$\2\2\u0131\u0130") + buf.write("\3\2\2\2\u0131\u0132\3\2\2\2\u0132\u0136\3\2\2\2\u0133") + buf.write("\u0135\5\34\17\2\u0134\u0133\3\2\2\2\u0135\u0138\3\2\2") + buf.write("\2\u0136\u0134\3\2\2\2\u0136\u0137\3\2\2\2\u0137\u0139") + buf.write("\3\2\2\2\u0138\u0136\3\2\2\2\u0139\u013c\7\"\2\2\u013a") + buf.write("\u013b\7\17\2\2\u013b\u013d\5\64\33\2\u013c\u013a\3\2") + buf.write("\2\2\u013c\u013d\3\2\2\2\u013d\u013f\3\2\2\2\u013e\u0140") + buf.write("\7\21\2\2\u013f\u013e\3\2\2\2\u013f\u0140\3\2\2\2\u0140") + buf.write("\63\3\2\2\2\u0141\u0144\7\37\2\2\u0142\u0144\7 \2\2\u0143") + buf.write("\u0141\3\2\2\2\u0143\u0142\3\2\2\2\u0144\65\3\2\2\2\65") 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("\u00aa\u00af\u00b2\u00b7\u00bb\u00c1\u00c4\u00c8\u00cd") + buf.write("\u00d4\u00d7\u00dd\u00e6\u00f3\u00f8\u0101\u0106\u0109") + buf.write("\u010e\u0114\u0117\u011c\u0125\u012a\u012e\u0131\u0136") + buf.write("\u013c\u013f\u0143") return buf.getvalue() @@ -173,7 +175,7 @@ class TParser ( Parser ): literalNames = [ "", "'import'", "';'", "'module'", "'interface'", "'extends'", "'{'", "'}'", "'void'", "'('", "')'", - "'const'", "'signal'", "'readonly'", "','", "'='", + "'const'", "'signal'", "'='", "'readonly'", "','", "'bool'", "'int'", "'real'", "'string'", "'var'", "'list'", "'<'", "'>'", "'model'", "'struct'", "'enum'", "'flag'" ] @@ -265,7 +267,7 @@ class TParser ( Parser ): 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 @@ -723,7 +725,7 @@ class TParser ( Parser ): self.state = 111 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): + while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << TParser.T__7) | (1 << TParser.T__10) | (1 << TParser.T__11) | (1 << TParser.T__13) | (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 self.interfaceMemberSymbol() self.state = 113 @@ -1114,13 +1116,17 @@ class TParser ( Parser ): self.parser = parser self.comment = None # Token self.name = None # Token + self.value = None # Token def typeSymbol(self): return self.getTypedRuleContext(TParser.TypeSymbolContext,0) - def IDENTIFIER(self): - return self.getToken(TParser.IDENTIFIER, 0) + def IDENTIFIER(self, i:int=None): + if i is None: + return self.getTokens(TParser.IDENTIFIER) + else: + return self.getToken(TParser.IDENTIFIER, i) def tagSymbol(self, i:int=None): if i is None: @@ -1184,7 +1190,7 @@ class TParser ( Parser ): self.state = 185 self._errHandler.sync(self) _la = self._input.LA(1) - if _la==TParser.T__10 or _la==TParser.T__12: + if _la==TParser.T__10 or _la==TParser.T__13: self.state = 184 self.propertyModifierSymbol() @@ -1193,11 +1199,21 @@ class TParser ( Parser ): self.typeSymbol() self.state = 188 localctx.name = self.match(TParser.IDENTIFIER) - self.state = 190 + self.state = 191 self._errHandler.sync(self) _la = self._input.LA(1) - if _la==TParser.T__1: + if _la==TParser.T__12: self.state = 189 + self.match(TParser.T__12) + self.state = 190 + localctx.value = self.match(TParser.IDENTIFIER) + + + self.state = 194 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la==TParser.T__1: + self.state = 193 self.match(TParser.T__1) @@ -1243,17 +1259,17 @@ class TParser ( Parser ): localctx = TParser.PropertyModifierSymbolContext(self, self._ctx, self.state) self.enterRule(localctx, 22, self.RULE_propertyModifierSymbol) try: - self.state = 194 + self.state = 198 self._errHandler.sync(self) token = self._input.LA(1) - if token in [TParser.T__12]: + if token in [TParser.T__13]: self.enterOuterAlt(localctx, 1) - self.state = 192 - localctx.is_readonly = self.match(TParser.T__12) + self.state = 196 + localctx.is_readonly = self.match(TParser.T__13) pass elif token in [TParser.T__10]: self.enterOuterAlt(localctx, 2) - self.state = 193 + self.state = 197 localctx.is_const = self.match(TParser.T__10) pass else: @@ -1308,16 +1324,16 @@ class TParser ( Parser ): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 196 + self.state = 200 self.typeSymbol() - self.state = 197 + self.state = 201 localctx.name = self.match(TParser.IDENTIFIER) - self.state = 199 + self.state = 203 self._errHandler.sync(self) _la = self._input.LA(1) - if _la==TParser.T__13: - self.state = 198 - self.match(TParser.T__13) + if _la==TParser.T__14: + self.state = 202 + self.match(TParser.T__14) except RecognitionException as re: @@ -1364,7 +1380,7 @@ class TParser ( Parser ): self.enterRule(localctx, 26, self.RULE_tagSymbol) try: self.enterOuterAlt(localctx, 1) - self.state = 201 + self.state = 205 localctx.line = self.match(TParser.TAGLINE) except RecognitionException as re: localctx.exception = re @@ -1415,24 +1431,24 @@ class TParser ( Parser ): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 203 + self.state = 207 localctx.name = self.match(TParser.IDENTIFIER) - self.state = 206 + self.state = 210 self._errHandler.sync(self) _la = self._input.LA(1) - if _la==TParser.T__14: - self.state = 204 - self.match(TParser.T__14) - self.state = 205 + if _la==TParser.T__12: + self.state = 208 + self.match(TParser.T__12) + self.state = 209 localctx.value = self.match(TParser.IDENTIFIER) - self.state = 209 + self.state = 213 self._errHandler.sync(self) _la = self._input.LA(1) - if _la==TParser.T__13: - self.state = 208 - self.match(TParser.T__13) + if _la==TParser.T__14: + self.state = 212 + self.match(TParser.T__14) except RecognitionException as re: @@ -1490,27 +1506,27 @@ class TParser ( Parser ): localctx = TParser.TypeSymbolContext(self, self._ctx, self.state) self.enterRule(localctx, 30, self.RULE_typeSymbol) try: - self.state = 215 + self.state = 219 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 = 215 self.primitiveTypeSymbol() pass elif token in [TParser.IDENTIFIER]: self.enterOuterAlt(localctx, 2) - self.state = 212 + self.state = 216 self.complexTypeSymbol() pass elif token in [TParser.T__20]: self.enterOuterAlt(localctx, 3) - self.state = 213 + self.state = 217 self.listTypeSymbol() pass elif token in [TParser.T__23]: self.enterOuterAlt(localctx, 4) - self.state = 214 + self.state = 218 self.modelTypeSymbol() pass else: @@ -1560,7 +1576,7 @@ class TParser ( Parser ): self.enterRule(localctx, 32, self.RULE_complexTypeSymbol) try: self.enterOuterAlt(localctx, 1) - self.state = 217 + self.state = 221 localctx.name = self.match(TParser.IDENTIFIER) except RecognitionException as re: localctx.exception = re @@ -1603,32 +1619,32 @@ class TParser ( Parser ): localctx = TParser.PrimitiveTypeSymbolContext(self, self._ctx, self.state) self.enterRule(localctx, 34, self.RULE_primitiveTypeSymbol) try: - self.state = 224 + self.state = 228 self._errHandler.sync(self) token = self._input.LA(1) if token in [TParser.T__15]: self.enterOuterAlt(localctx, 1) - self.state = 219 + self.state = 223 localctx.name = self.match(TParser.T__15) pass elif token in [TParser.T__16]: self.enterOuterAlt(localctx, 2) - self.state = 220 + self.state = 224 localctx.name = self.match(TParser.T__16) pass elif token in [TParser.T__17]: self.enterOuterAlt(localctx, 3) - self.state = 221 + self.state = 225 localctx.name = self.match(TParser.T__17) pass elif token in [TParser.T__18]: self.enterOuterAlt(localctx, 4) - self.state = 222 + self.state = 226 localctx.name = self.match(TParser.T__18) pass elif token in [TParser.T__19]: self.enterOuterAlt(localctx, 5) - self.state = 223 + self.state = 227 localctx.name = self.match(TParser.T__19) pass else: @@ -1679,13 +1695,13 @@ class TParser ( Parser ): self.enterRule(localctx, 36, self.RULE_listTypeSymbol) try: self.enterOuterAlt(localctx, 1) - self.state = 226 + self.state = 230 self.match(TParser.T__20) - self.state = 227 + self.state = 231 self.match(TParser.T__21) - self.state = 228 + self.state = 232 localctx.valueType = self.typeSymbol() - self.state = 229 + self.state = 233 self.match(TParser.T__22) except RecognitionException as re: localctx.exception = re @@ -1732,13 +1748,13 @@ class TParser ( Parser ): self.enterRule(localctx, 38, self.RULE_modelTypeSymbol) try: self.enterOuterAlt(localctx, 1) - self.state = 231 + self.state = 235 self.match(TParser.T__23) - self.state = 232 + self.state = 236 self.match(TParser.T__21) - self.state = 233 + self.state = 237 localctx.valueType = self.typeSymbol() - self.state = 234 + self.state = 238 self.match(TParser.T__22) except RecognitionException as re: localctx.exception = re @@ -1803,47 +1819,47 @@ class TParser ( Parser ): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 237 + self.state = 241 self._errHandler.sync(self) _la = self._input.LA(1) if _la==TParser.DOCCOMMENT: - self.state = 236 + self.state = 240 localctx.comment = self.match(TParser.DOCCOMMENT) - self.state = 242 + self.state = 246 self._errHandler.sync(self) _la = self._input.LA(1) while _la==TParser.TAGLINE: - self.state = 239 + self.state = 243 self.tagSymbol() - self.state = 244 + self.state = 248 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 245 + self.state = 249 self.match(TParser.T__24) - self.state = 246 + self.state = 250 localctx.name = self.match(TParser.IDENTIFIER) - self.state = 247 - self.match(TParser.T__5) self.state = 251 + self.match(TParser.T__5) + self.state = 255 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 + self.state = 252 self.structFieldSymbol() - self.state = 253 + self.state = 257 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 254 + self.state = 258 self.match(TParser.T__6) - self.state = 256 + self.state = 260 self._errHandler.sync(self) _la = self._input.LA(1) if _la==TParser.T__1: - self.state = 255 + self.state = 259 self.match(TParser.T__1) @@ -1907,33 +1923,33 @@ class TParser ( Parser ): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 259 + self.state = 263 self._errHandler.sync(self) _la = self._input.LA(1) if _la==TParser.DOCCOMMENT: - self.state = 258 + self.state = 262 localctx.comment = self.match(TParser.DOCCOMMENT) - self.state = 264 + self.state = 268 self._errHandler.sync(self) _la = self._input.LA(1) while _la==TParser.TAGLINE: - self.state = 261 + self.state = 265 self.tagSymbol() - self.state = 266 + self.state = 270 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 267 + self.state = 271 self.typeSymbol() - self.state = 268 + self.state = 272 localctx.name = self.match(TParser.IDENTIFIER) - self.state = 270 + self.state = 274 self._errHandler.sync(self) _la = self._input.LA(1) if _la==TParser.T__1: - self.state = 269 + self.state = 273 self.match(TParser.T__1) @@ -2004,47 +2020,47 @@ class TParser ( Parser ): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 273 + self.state = 277 self._errHandler.sync(self) _la = self._input.LA(1) if _la==TParser.DOCCOMMENT: - self.state = 272 + self.state = 276 localctx.comment = self.match(TParser.DOCCOMMENT) - self.state = 278 + self.state = 282 self._errHandler.sync(self) _la = self._input.LA(1) while _la==TParser.TAGLINE: - self.state = 275 + self.state = 279 self.tagSymbol() - self.state = 280 + self.state = 284 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 281 + self.state = 285 self.enumTypeSymbol() - self.state = 282 + self.state = 286 localctx.name = self.match(TParser.IDENTIFIER) - self.state = 283 - self.match(TParser.T__5) self.state = 287 + self.match(TParser.T__5) + self.state = 291 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 = 288 self.enumMemberSymbol() - self.state = 289 + self.state = 293 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 290 + self.state = 294 self.match(TParser.T__6) - self.state = 292 + self.state = 296 self._errHandler.sync(self) _la = self._input.LA(1) if _la==TParser.T__1: - self.state = 291 + self.state = 295 self.match(TParser.T__1) @@ -2090,17 +2106,17 @@ class TParser ( Parser ): localctx = TParser.EnumTypeSymbolContext(self, self._ctx, self.state) self.enterRule(localctx, 46, self.RULE_enumTypeSymbol) try: - self.state = 296 + self.state = 300 self._errHandler.sync(self) token = self._input.LA(1) if token in [TParser.T__25]: self.enterOuterAlt(localctx, 1) - self.state = 294 + self.state = 298 localctx.isEnum = self.match(TParser.T__25) pass elif token in [TParser.T__26]: self.enterOuterAlt(localctx, 2) - self.state = 295 + self.state = 299 localctx.isFlag = self.match(TParser.T__26) pass else: @@ -2166,42 +2182,42 @@ class TParser ( Parser ): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 299 + self.state = 303 self._errHandler.sync(self) _la = self._input.LA(1) if _la==TParser.DOCCOMMENT: - self.state = 298 + self.state = 302 localctx.comment = self.match(TParser.DOCCOMMENT) - self.state = 304 + self.state = 308 self._errHandler.sync(self) _la = self._input.LA(1) while _la==TParser.TAGLINE: - self.state = 301 + self.state = 305 self.tagSymbol() - self.state = 306 + self.state = 310 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 307 + self.state = 311 localctx.name = self.match(TParser.IDENTIFIER) - self.state = 310 + self.state = 314 self._errHandler.sync(self) _la = self._input.LA(1) - if _la==TParser.T__14: - self.state = 308 - self.match(TParser.T__14) - self.state = 309 + if _la==TParser.T__12: + self.state = 312 + self.match(TParser.T__12) + self.state = 313 self.intSymbol() - self.state = 313 + self.state = 317 self._errHandler.sync(self) _la = self._input.LA(1) - if _la==TParser.T__13: - self.state = 312 - self.match(TParser.T__13) + if _la==TParser.T__14: + self.state = 316 + self.match(TParser.T__14) except RecognitionException as re: @@ -2250,17 +2266,17 @@ class TParser ( Parser ): localctx = TParser.IntSymbolContext(self, self._ctx, self.state) self.enterRule(localctx, 50, self.RULE_intSymbol) try: - self.state = 317 + self.state = 321 self._errHandler.sync(self) token = self._input.LA(1) if token in [TParser.INTCONSTANT]: self.enterOuterAlt(localctx, 1) - self.state = 315 + self.state = 319 localctx.value = self.match(TParser.INTCONSTANT) pass elif token in [TParser.HEXCONSTANT]: self.enterOuterAlt(localctx, 2) - self.state = 316 + self.state = 320 localctx.value = self.match(TParser.HEXCONSTANT) pass else: diff --git a/qface/idl/parser/TVisitor.py b/qface/idl/parser/TVisitor.py index a87cdf4..6ea49d4 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 diff --git a/tests/in/values.qface b/tests/in/values.qface new file mode 100644 index 0000000..9992de0 --- /dev/null +++ b/tests/in/values.qface @@ -0,0 +1,17 @@ +module values 1.0 + +interface Namespace { + @value: 99 + int intValue + @value: 0.99 + real realValue + @value: "foo" + string message + @value: { name: "Hello", age: 101 }; + Person person +} + +struct Person { + string name; + int age; +} \ No newline at end of file diff --git a/tests/test_values.py b/tests/test_values.py new file mode 100644 index 0000000..a2f8c19 --- /dev/null +++ b/tests/test_values.py @@ -0,0 +1,26 @@ +from qface.generator import FileSystem +import logging +import logging.config +from path import Path + + +# logging.config.fileConfig('logging.ini') +logging.basicConfig() + +log = logging.getLogger(__name__) + +inputPath = Path('tests/in') +log.debug('input path folder: {0}'.format(inputPath.abspath())) + + +def loadValues(): + path = inputPath / 'values.qface' + return FileSystem.parse_document(path) + + +def test_values(): + system = loadValues() + # lookup module + interface = system.lookup('values.Namespace') + assert interface + -- cgit v1.2.1 From 44e4b287efc5c314c133adb81e771b4b65efe166 Mon Sep 17 00:00:00 2001 From: Juergen Bocklage-Ryannel Date: Thu, 8 Mar 2018 20:28:54 +0100 Subject: Added default values to properties and struct fields. --- docs/grammar.rst | 19 ++ qface/idl/listener.py | 8 +- qface/idl/parser/T.g4 | 9 +- qface/idl/parser/T.interp | 8 +- qface/idl/parser/T.tokens | 23 ++- qface/idl/parser/TLexer.interp | 12 +- qface/idl/parser/TLexer.py | 286 +++++++++++++++------------- qface/idl/parser/TLexer.tokens | 23 ++- qface/idl/parser/TParser.py | 378 +++++++++++++++++++------------------ tests/in/com.pelagicore.test.qface | 15 +- tests/in/values.qface | 16 +- tests/test_parser.py | 8 + tests/test_values.py | 12 +- 13 files changed, 462 insertions(+), 355 deletions(-) diff --git a/docs/grammar.rst b/docs/grammar.rst index a8048ea..2f148d4 100644 --- a/docs/grammar.rst +++ b/docs/grammar.rst @@ -250,3 +250,22 @@ Currently only brief, description, see and deprecated are supported doc tags. The QtCPP built-in generator generates valid Qt documentation out of these comments. +Default Values +============== + +QFace supports the assignment of default values to properties and struct fields. A default values is a text string +passed onto the generator. + +.. code-block:: js + + interface Counter { + int count = "0"; + Message lastMessage; + } + + struct Message { + string text = "NO DATA"; + } + +You can use quotes `'` or double-quotes `"` as a marker for text. There is no type check on qface side the +text-content is directly on to the generator. diff --git a/qface/idl/listener.py b/qface/idl/listener.py index cd5e399..8a0ed22 100644 --- a/qface/idl/listener.py +++ b/qface/idl/listener.py @@ -7,6 +7,8 @@ from .domain import * from antlr4 import ParserRuleContext import yaml import click +import codecs +import json try: from yaml import CSafeLoader as Loader, CDumper as Dumper @@ -84,7 +86,7 @@ class DomainListener(TListener): 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__) @@ -192,6 +194,8 @@ class DomainListener(TListener): self.parse_annotations(ctx, self.property) self.parse_type(ctx, self.property.type) contextMap[ctx] = self.property + if ctx.value: + self.property.value = codecs.decode(bytes(ctx.value.text[1:-1], 'utf-8'), 'unicode_escape') def exitPropertySymbol(self, ctx: TParser.PropertySymbolContext): self.property = None @@ -201,6 +205,8 @@ class DomainListener(TListener): name = ctx.name.text self.field = Field(name, self.struct) self.parse_annotations(ctx, self.field) + if ctx.value: + self.field.value = codecs.decode(bytes(ctx.value.text[1:-1], 'utf-8'), 'unicode_escape') contextMap[ctx] = self.field def exitStructFieldSymbol(self, ctx: TParser.StructFieldSymbolContext): diff --git a/qface/idl/parser/T.g4 b/qface/idl/parser/T.g4 index cb60bdd..714faeb 100644 --- a/qface/idl/parser/T.g4 +++ b/qface/idl/parser/T.g4 @@ -52,7 +52,7 @@ signalSymbol propertySymbol - : comment=DOCCOMMENT? tagSymbol* propertyModifierSymbol? typeSymbol name=IDENTIFIER ('=' value=IDENTIFIER)? ';'? + : comment=DOCCOMMENT? tagSymbol* propertyModifierSymbol? typeSymbol name=IDENTIFIER ('=' value=STRING)? ';'? ; propertyModifierSymbol @@ -104,7 +104,7 @@ structSymbol ; structFieldSymbol - : comment=DOCCOMMENT? tagSymbol* typeSymbol name=IDENTIFIER ';'? + : comment=DOCCOMMENT? tagSymbol* typeSymbol name=IDENTIFIER ('=' value=STRING)? ';'? ; enumSymbol @@ -125,6 +125,9 @@ intSymbol | value=HEXCONSTANT ; +STRING: DOUBLE_STRING | SINGLE_STRING; +DOUBLE_STRING : '"' ( ESC | ~ ["\\] )* '"'; +SINGLE_STRING : '\'' ( ESC | ~ ['\\] )* '\''; TAGLINE : '@' ~[\r\n]*; INTCONSTANT : ('+' | '-')? '0'..'9'+; HEXCONSTANT : '0x' ('0'..'9' | 'a'..'f' | 'A'..'F')+; @@ -135,4 +138,4 @@ DOCCOMMENT : '/**' .*? '*/'; WHITESPACE : [ \t\r\n]+ -> skip; COMMENT : '//' ~[\r\n]* -> skip; MULTICOMM : '/*' .*? '*/' -> skip; - +fragment ESC : '\\' ( ["\\/bfnrt] ); diff --git a/qface/idl/parser/T.interp b/qface/idl/parser/T.interp index 235a8e4..a06712b 100644 --- a/qface/idl/parser/T.interp +++ b/qface/idl/parser/T.interp @@ -37,6 +37,9 @@ null null null null +null +null +null token symbolic names: null @@ -67,6 +70,9 @@ null null null null +STRING +DOUBLE_STRING +SINGLE_STRING TAGLINE INTCONSTANT HEXCONSTANT @@ -108,4 +114,4 @@ intSymbol atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 39, 326, 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, 3, 2, 3, 2, 7, 2, 57, 10, 2, 12, 2, 14, 2, 60, 11, 2, 3, 3, 3, 3, 7, 3, 64, 10, 3, 12, 3, 14, 3, 67, 11, 3, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 73, 10, 4, 3, 5, 5, 5, 76, 10, 5, 3, 5, 7, 5, 79, 10, 5, 12, 5, 14, 5, 82, 11, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 88, 10, 5, 3, 6, 3, 6, 3, 6, 5, 6, 93, 10, 6, 3, 7, 5, 7, 96, 10, 7, 3, 7, 7, 7, 99, 10, 7, 12, 7, 14, 7, 102, 11, 7, 3, 7, 3, 7, 3, 7, 3, 7, 5, 7, 108, 10, 7, 3, 7, 3, 7, 7, 7, 112, 10, 7, 12, 7, 14, 7, 115, 11, 7, 3, 7, 3, 7, 5, 7, 119, 10, 7, 3, 8, 3, 8, 3, 8, 5, 8, 124, 10, 8, 3, 9, 5, 9, 127, 10, 9, 3, 9, 7, 9, 130, 10, 9, 12, 9, 14, 9, 133, 11, 9, 3, 9, 3, 9, 5, 9, 137, 10, 9, 3, 9, 3, 9, 3, 9, 7, 9, 142, 10, 9, 12, 9, 14, 9, 145, 11, 9, 3, 9, 3, 9, 5, 9, 149, 10, 9, 3, 9, 5, 9, 152, 10, 9, 3, 10, 3, 10, 3, 11, 5, 11, 157, 10, 11, 3, 11, 7, 11, 160, 10, 11, 12, 11, 14, 11, 163, 11, 11, 3, 11, 3, 11, 3, 11, 3, 11, 7, 11, 169, 10, 11, 12, 11, 14, 11, 172, 11, 11, 3, 11, 3, 11, 5, 11, 176, 10, 11, 3, 12, 5, 12, 179, 10, 12, 3, 12, 7, 12, 182, 10, 12, 12, 12, 14, 12, 185, 11, 12, 3, 12, 5, 12, 188, 10, 12, 3, 12, 3, 12, 3, 12, 3, 12, 5, 12, 194, 10, 12, 3, 12, 5, 12, 197, 10, 12, 3, 13, 3, 13, 5, 13, 201, 10, 13, 3, 14, 3, 14, 3, 14, 5, 14, 206, 10, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 5, 16, 213, 10, 16, 3, 16, 5, 16, 216, 10, 16, 3, 17, 3, 17, 3, 17, 3, 17, 5, 17, 222, 10, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 5, 19, 231, 10, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 5, 22, 244, 10, 22, 3, 22, 7, 22, 247, 10, 22, 12, 22, 14, 22, 250, 11, 22, 3, 22, 3, 22, 3, 22, 3, 22, 7, 22, 256, 10, 22, 12, 22, 14, 22, 259, 11, 22, 3, 22, 3, 22, 5, 22, 263, 10, 22, 3, 23, 5, 23, 266, 10, 23, 3, 23, 7, 23, 269, 10, 23, 12, 23, 14, 23, 272, 11, 23, 3, 23, 3, 23, 3, 23, 5, 23, 277, 10, 23, 3, 24, 5, 24, 280, 10, 24, 3, 24, 7, 24, 283, 10, 24, 12, 24, 14, 24, 286, 11, 24, 3, 24, 3, 24, 3, 24, 3, 24, 7, 24, 292, 10, 24, 12, 24, 14, 24, 295, 11, 24, 3, 24, 3, 24, 5, 24, 299, 10, 24, 3, 25, 3, 25, 5, 25, 303, 10, 25, 3, 26, 5, 26, 306, 10, 26, 3, 26, 7, 26, 309, 10, 26, 12, 26, 14, 26, 312, 11, 26, 3, 26, 3, 26, 3, 26, 5, 26, 317, 10, 26, 3, 26, 5, 26, 320, 10, 26, 3, 27, 3, 27, 5, 27, 324, 10, 27, 3, 27, 2, 2, 28, 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, 2, 2, 2, 357, 2, 54, 3, 2, 2, 2, 4, 61, 3, 2, 2, 2, 6, 68, 3, 2, 2, 2, 8, 75, 3, 2, 2, 2, 10, 92, 3, 2, 2, 2, 12, 95, 3, 2, 2, 2, 14, 123, 3, 2, 2, 2, 16, 126, 3, 2, 2, 2, 18, 153, 3, 2, 2, 2, 20, 156, 3, 2, 2, 2, 22, 178, 3, 2, 2, 2, 24, 200, 3, 2, 2, 2, 26, 202, 3, 2, 2, 2, 28, 207, 3, 2, 2, 2, 30, 209, 3, 2, 2, 2, 32, 221, 3, 2, 2, 2, 34, 223, 3, 2, 2, 2, 36, 230, 3, 2, 2, 2, 38, 232, 3, 2, 2, 2, 40, 237, 3, 2, 2, 2, 42, 243, 3, 2, 2, 2, 44, 265, 3, 2, 2, 2, 46, 279, 3, 2, 2, 2, 48, 302, 3, 2, 2, 2, 50, 305, 3, 2, 2, 2, 52, 323, 3, 2, 2, 2, 54, 58, 5, 4, 3, 2, 55, 57, 5, 10, 6, 2, 56, 55, 3, 2, 2, 2, 57, 60, 3, 2, 2, 2, 58, 56, 3, 2, 2, 2, 58, 59, 3, 2, 2, 2, 59, 3, 3, 2, 2, 2, 60, 58, 3, 2, 2, 2, 61, 65, 5, 8, 5, 2, 62, 64, 5, 6, 4, 2, 63, 62, 3, 2, 2, 2, 64, 67, 3, 2, 2, 2, 65, 63, 3, 2, 2, 2, 65, 66, 3, 2, 2, 2, 66, 5, 3, 2, 2, 2, 67, 65, 3, 2, 2, 2, 68, 69, 7, 3, 2, 2, 69, 70, 7, 34, 2, 2, 70, 72, 7, 35, 2, 2, 71, 73, 7, 4, 2, 2, 72, 71, 3, 2, 2, 2, 72, 73, 3, 2, 2, 2, 73, 7, 3, 2, 2, 2, 74, 76, 7, 36, 2, 2, 75, 74, 3, 2, 2, 2, 75, 76, 3, 2, 2, 2, 76, 80, 3, 2, 2, 2, 77, 79, 5, 28, 15, 2, 78, 77, 3, 2, 2, 2, 79, 82, 3, 2, 2, 2, 80, 78, 3, 2, 2, 2, 80, 81, 3, 2, 2, 2, 81, 83, 3, 2, 2, 2, 82, 80, 3, 2, 2, 2, 83, 84, 7, 5, 2, 2, 84, 85, 7, 34, 2, 2, 85, 87, 7, 35, 2, 2, 86, 88, 7, 4, 2, 2, 87, 86, 3, 2, 2, 2, 87, 88, 3, 2, 2, 2, 88, 9, 3, 2, 2, 2, 89, 93, 5, 12, 7, 2, 90, 93, 5, 42, 22, 2, 91, 93, 5, 46, 24, 2, 92, 89, 3, 2, 2, 2, 92, 90, 3, 2, 2, 2, 92, 91, 3, 2, 2, 2, 93, 11, 3, 2, 2, 2, 94, 96, 7, 36, 2, 2, 95, 94, 3, 2, 2, 2, 95, 96, 3, 2, 2, 2, 96, 100, 3, 2, 2, 2, 97, 99, 5, 28, 15, 2, 98, 97, 3, 2, 2, 2, 99, 102, 3, 2, 2, 2, 100, 98, 3, 2, 2, 2, 100, 101, 3, 2, 2, 2, 101, 103, 3, 2, 2, 2, 102, 100, 3, 2, 2, 2, 103, 104, 7, 6, 2, 2, 104, 107, 7, 34, 2, 2, 105, 106, 7, 7, 2, 2, 106, 108, 7, 34, 2, 2, 107, 105, 3, 2, 2, 2, 107, 108, 3, 2, 2, 2, 108, 109, 3, 2, 2, 2, 109, 113, 7, 8, 2, 2, 110, 112, 5, 14, 8, 2, 111, 110, 3, 2, 2, 2, 112, 115, 3, 2, 2, 2, 113, 111, 3, 2, 2, 2, 113, 114, 3, 2, 2, 2, 114, 116, 3, 2, 2, 2, 115, 113, 3, 2, 2, 2, 116, 118, 7, 9, 2, 2, 117, 119, 7, 4, 2, 2, 118, 117, 3, 2, 2, 2, 118, 119, 3, 2, 2, 2, 119, 13, 3, 2, 2, 2, 120, 124, 5, 16, 9, 2, 121, 124, 5, 22, 12, 2, 122, 124, 5, 20, 11, 2, 123, 120, 3, 2, 2, 2, 123, 121, 3, 2, 2, 2, 123, 122, 3, 2, 2, 2, 124, 15, 3, 2, 2, 2, 125, 127, 7, 36, 2, 2, 126, 125, 3, 2, 2, 2, 126, 127, 3, 2, 2, 2, 127, 131, 3, 2, 2, 2, 128, 130, 5, 28, 15, 2, 129, 128, 3, 2, 2, 2, 130, 133, 3, 2, 2, 2, 131, 129, 3, 2, 2, 2, 131, 132, 3, 2, 2, 2, 132, 136, 3, 2, 2, 2, 133, 131, 3, 2, 2, 2, 134, 137, 5, 32, 17, 2, 135, 137, 7, 10, 2, 2, 136, 134, 3, 2, 2, 2, 136, 135, 3, 2, 2, 2, 137, 138, 3, 2, 2, 2, 138, 139, 7, 34, 2, 2, 139, 143, 7, 11, 2, 2, 140, 142, 5, 26, 14, 2, 141, 140, 3, 2, 2, 2, 142, 145, 3, 2, 2, 2, 143, 141, 3, 2, 2, 2, 143, 144, 3, 2, 2, 2, 144, 146, 3, 2, 2, 2, 145, 143, 3, 2, 2, 2, 146, 148, 7, 12, 2, 2, 147, 149, 5, 18, 10, 2, 148, 147, 3, 2, 2, 2, 148, 149, 3, 2, 2, 2, 149, 151, 3, 2, 2, 2, 150, 152, 7, 4, 2, 2, 151, 150, 3, 2, 2, 2, 151, 152, 3, 2, 2, 2, 152, 17, 3, 2, 2, 2, 153, 154, 7, 13, 2, 2, 154, 19, 3, 2, 2, 2, 155, 157, 7, 36, 2, 2, 156, 155, 3, 2, 2, 2, 156, 157, 3, 2, 2, 2, 157, 161, 3, 2, 2, 2, 158, 160, 5, 28, 15, 2, 159, 158, 3, 2, 2, 2, 160, 163, 3, 2, 2, 2, 161, 159, 3, 2, 2, 2, 161, 162, 3, 2, 2, 2, 162, 164, 3, 2, 2, 2, 163, 161, 3, 2, 2, 2, 164, 165, 7, 14, 2, 2, 165, 166, 7, 34, 2, 2, 166, 170, 7, 11, 2, 2, 167, 169, 5, 26, 14, 2, 168, 167, 3, 2, 2, 2, 169, 172, 3, 2, 2, 2, 170, 168, 3, 2, 2, 2, 170, 171, 3, 2, 2, 2, 171, 173, 3, 2, 2, 2, 172, 170, 3, 2, 2, 2, 173, 175, 7, 12, 2, 2, 174, 176, 7, 4, 2, 2, 175, 174, 3, 2, 2, 2, 175, 176, 3, 2, 2, 2, 176, 21, 3, 2, 2, 2, 177, 179, 7, 36, 2, 2, 178, 177, 3, 2, 2, 2, 178, 179, 3, 2, 2, 2, 179, 183, 3, 2, 2, 2, 180, 182, 5, 28, 15, 2, 181, 180, 3, 2, 2, 2, 182, 185, 3, 2, 2, 2, 183, 181, 3, 2, 2, 2, 183, 184, 3, 2, 2, 2, 184, 187, 3, 2, 2, 2, 185, 183, 3, 2, 2, 2, 186, 188, 5, 24, 13, 2, 187, 186, 3, 2, 2, 2, 187, 188, 3, 2, 2, 2, 188, 189, 3, 2, 2, 2, 189, 190, 5, 32, 17, 2, 190, 193, 7, 34, 2, 2, 191, 192, 7, 15, 2, 2, 192, 194, 7, 34, 2, 2, 193, 191, 3, 2, 2, 2, 193, 194, 3, 2, 2, 2, 194, 196, 3, 2, 2, 2, 195, 197, 7, 4, 2, 2, 196, 195, 3, 2, 2, 2, 196, 197, 3, 2, 2, 2, 197, 23, 3, 2, 2, 2, 198, 201, 7, 16, 2, 2, 199, 201, 7, 13, 2, 2, 200, 198, 3, 2, 2, 2, 200, 199, 3, 2, 2, 2, 201, 25, 3, 2, 2, 2, 202, 203, 5, 32, 17, 2, 203, 205, 7, 34, 2, 2, 204, 206, 7, 17, 2, 2, 205, 204, 3, 2, 2, 2, 205, 206, 3, 2, 2, 2, 206, 27, 3, 2, 2, 2, 207, 208, 7, 30, 2, 2, 208, 29, 3, 2, 2, 2, 209, 212, 7, 34, 2, 2, 210, 211, 7, 15, 2, 2, 211, 213, 7, 34, 2, 2, 212, 210, 3, 2, 2, 2, 212, 213, 3, 2, 2, 2, 213, 215, 3, 2, 2, 2, 214, 216, 7, 17, 2, 2, 215, 214, 3, 2, 2, 2, 215, 216, 3, 2, 2, 2, 216, 31, 3, 2, 2, 2, 217, 222, 5, 36, 19, 2, 218, 222, 5, 34, 18, 2, 219, 222, 5, 38, 20, 2, 220, 222, 5, 40, 21, 2, 221, 217, 3, 2, 2, 2, 221, 218, 3, 2, 2, 2, 221, 219, 3, 2, 2, 2, 221, 220, 3, 2, 2, 2, 222, 33, 3, 2, 2, 2, 223, 224, 7, 34, 2, 2, 224, 35, 3, 2, 2, 2, 225, 231, 7, 18, 2, 2, 226, 231, 7, 19, 2, 2, 227, 231, 7, 20, 2, 2, 228, 231, 7, 21, 2, 2, 229, 231, 7, 22, 2, 2, 230, 225, 3, 2, 2, 2, 230, 226, 3, 2, 2, 2, 230, 227, 3, 2, 2, 2, 230, 228, 3, 2, 2, 2, 230, 229, 3, 2, 2, 2, 231, 37, 3, 2, 2, 2, 232, 233, 7, 23, 2, 2, 233, 234, 7, 24, 2, 2, 234, 235, 5, 32, 17, 2, 235, 236, 7, 25, 2, 2, 236, 39, 3, 2, 2, 2, 237, 238, 7, 26, 2, 2, 238, 239, 7, 24, 2, 2, 239, 240, 5, 32, 17, 2, 240, 241, 7, 25, 2, 2, 241, 41, 3, 2, 2, 2, 242, 244, 7, 36, 2, 2, 243, 242, 3, 2, 2, 2, 243, 244, 3, 2, 2, 2, 244, 248, 3, 2, 2, 2, 245, 247, 5, 28, 15, 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, 251, 3, 2, 2, 2, 250, 248, 3, 2, 2, 2, 251, 252, 7, 27, 2, 2, 252, 253, 7, 34, 2, 2, 253, 257, 7, 8, 2, 2, 254, 256, 5, 44, 23, 2, 255, 254, 3, 2, 2, 2, 256, 259, 3, 2, 2, 2, 257, 255, 3, 2, 2, 2, 257, 258, 3, 2, 2, 2, 258, 260, 3, 2, 2, 2, 259, 257, 3, 2, 2, 2, 260, 262, 7, 9, 2, 2, 261, 263, 7, 4, 2, 2, 262, 261, 3, 2, 2, 2, 262, 263, 3, 2, 2, 2, 263, 43, 3, 2, 2, 2, 264, 266, 7, 36, 2, 2, 265, 264, 3, 2, 2, 2, 265, 266, 3, 2, 2, 2, 266, 270, 3, 2, 2, 2, 267, 269, 5, 28, 15, 2, 268, 267, 3, 2, 2, 2, 269, 272, 3, 2, 2, 2, 270, 268, 3, 2, 2, 2, 270, 271, 3, 2, 2, 2, 271, 273, 3, 2, 2, 2, 272, 270, 3, 2, 2, 2, 273, 274, 5, 32, 17, 2, 274, 276, 7, 34, 2, 2, 275, 277, 7, 4, 2, 2, 276, 275, 3, 2, 2, 2, 276, 277, 3, 2, 2, 2, 277, 45, 3, 2, 2, 2, 278, 280, 7, 36, 2, 2, 279, 278, 3, 2, 2, 2, 279, 280, 3, 2, 2, 2, 280, 284, 3, 2, 2, 2, 281, 283, 5, 28, 15, 2, 282, 281, 3, 2, 2, 2, 283, 286, 3, 2, 2, 2, 284, 282, 3, 2, 2, 2, 284, 285, 3, 2, 2, 2, 285, 287, 3, 2, 2, 2, 286, 284, 3, 2, 2, 2, 287, 288, 5, 48, 25, 2, 288, 289, 7, 34, 2, 2, 289, 293, 7, 8, 2, 2, 290, 292, 5, 50, 26, 2, 291, 290, 3, 2, 2, 2, 292, 295, 3, 2, 2, 2, 293, 291, 3, 2, 2, 2, 293, 294, 3, 2, 2, 2, 294, 296, 3, 2, 2, 2, 295, 293, 3, 2, 2, 2, 296, 298, 7, 9, 2, 2, 297, 299, 7, 4, 2, 2, 298, 297, 3, 2, 2, 2, 298, 299, 3, 2, 2, 2, 299, 47, 3, 2, 2, 2, 300, 303, 7, 28, 2, 2, 301, 303, 7, 29, 2, 2, 302, 300, 3, 2, 2, 2, 302, 301, 3, 2, 2, 2, 303, 49, 3, 2, 2, 2, 304, 306, 7, 36, 2, 2, 305, 304, 3, 2, 2, 2, 305, 306, 3, 2, 2, 2, 306, 310, 3, 2, 2, 2, 307, 309, 5, 28, 15, 2, 308, 307, 3, 2, 2, 2, 309, 312, 3, 2, 2, 2, 310, 308, 3, 2, 2, 2, 310, 311, 3, 2, 2, 2, 311, 313, 3, 2, 2, 2, 312, 310, 3, 2, 2, 2, 313, 316, 7, 34, 2, 2, 314, 315, 7, 15, 2, 2, 315, 317, 5, 52, 27, 2, 316, 314, 3, 2, 2, 2, 316, 317, 3, 2, 2, 2, 317, 319, 3, 2, 2, 2, 318, 320, 7, 17, 2, 2, 319, 318, 3, 2, 2, 2, 319, 320, 3, 2, 2, 2, 320, 51, 3, 2, 2, 2, 321, 324, 7, 31, 2, 2, 322, 324, 7, 32, 2, 2, 323, 321, 3, 2, 2, 2, 323, 322, 3, 2, 2, 2, 324, 53, 3, 2, 2, 2, 53, 58, 65, 72, 75, 80, 87, 92, 95, 100, 107, 113, 118, 123, 126, 131, 136, 143, 148, 151, 156, 161, 170, 175, 178, 183, 187, 193, 196, 200, 205, 212, 215, 221, 230, 243, 248, 257, 262, 265, 270, 276, 279, 284, 293, 298, 302, 305, 310, 316, 319, 323] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 42, 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, 3, 2, 3, 2, 7, 2, 57, 10, 2, 12, 2, 14, 2, 60, 11, 2, 3, 3, 3, 3, 7, 3, 64, 10, 3, 12, 3, 14, 3, 67, 11, 3, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 73, 10, 4, 3, 5, 5, 5, 76, 10, 5, 3, 5, 7, 5, 79, 10, 5, 12, 5, 14, 5, 82, 11, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 88, 10, 5, 3, 6, 3, 6, 3, 6, 5, 6, 93, 10, 6, 3, 7, 5, 7, 96, 10, 7, 3, 7, 7, 7, 99, 10, 7, 12, 7, 14, 7, 102, 11, 7, 3, 7, 3, 7, 3, 7, 3, 7, 5, 7, 108, 10, 7, 3, 7, 3, 7, 7, 7, 112, 10, 7, 12, 7, 14, 7, 115, 11, 7, 3, 7, 3, 7, 5, 7, 119, 10, 7, 3, 8, 3, 8, 3, 8, 5, 8, 124, 10, 8, 3, 9, 5, 9, 127, 10, 9, 3, 9, 7, 9, 130, 10, 9, 12, 9, 14, 9, 133, 11, 9, 3, 9, 3, 9, 5, 9, 137, 10, 9, 3, 9, 3, 9, 3, 9, 7, 9, 142, 10, 9, 12, 9, 14, 9, 145, 11, 9, 3, 9, 3, 9, 5, 9, 149, 10, 9, 3, 9, 5, 9, 152, 10, 9, 3, 10, 3, 10, 3, 11, 5, 11, 157, 10, 11, 3, 11, 7, 11, 160, 10, 11, 12, 11, 14, 11, 163, 11, 11, 3, 11, 3, 11, 3, 11, 3, 11, 7, 11, 169, 10, 11, 12, 11, 14, 11, 172, 11, 11, 3, 11, 3, 11, 5, 11, 176, 10, 11, 3, 12, 5, 12, 179, 10, 12, 3, 12, 7, 12, 182, 10, 12, 12, 12, 14, 12, 185, 11, 12, 3, 12, 5, 12, 188, 10, 12, 3, 12, 3, 12, 3, 12, 3, 12, 5, 12, 194, 10, 12, 3, 12, 5, 12, 197, 10, 12, 3, 13, 3, 13, 5, 13, 201, 10, 13, 3, 14, 3, 14, 3, 14, 5, 14, 206, 10, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 5, 16, 213, 10, 16, 3, 16, 5, 16, 216, 10, 16, 3, 17, 3, 17, 3, 17, 3, 17, 5, 17, 222, 10, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 5, 19, 231, 10, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 5, 22, 244, 10, 22, 3, 22, 7, 22, 247, 10, 22, 12, 22, 14, 22, 250, 11, 22, 3, 22, 3, 22, 3, 22, 3, 22, 7, 22, 256, 10, 22, 12, 22, 14, 22, 259, 11, 22, 3, 22, 3, 22, 5, 22, 263, 10, 22, 3, 23, 5, 23, 266, 10, 23, 3, 23, 7, 23, 269, 10, 23, 12, 23, 14, 23, 272, 11, 23, 3, 23, 3, 23, 3, 23, 3, 23, 5, 23, 278, 10, 23, 3, 23, 5, 23, 281, 10, 23, 3, 24, 5, 24, 284, 10, 24, 3, 24, 7, 24, 287, 10, 24, 12, 24, 14, 24, 290, 11, 24, 3, 24, 3, 24, 3, 24, 3, 24, 7, 24, 296, 10, 24, 12, 24, 14, 24, 299, 11, 24, 3, 24, 3, 24, 5, 24, 303, 10, 24, 3, 25, 3, 25, 5, 25, 307, 10, 25, 3, 26, 5, 26, 310, 10, 26, 3, 26, 7, 26, 313, 10, 26, 12, 26, 14, 26, 316, 11, 26, 3, 26, 3, 26, 3, 26, 5, 26, 321, 10, 26, 3, 26, 5, 26, 324, 10, 26, 3, 27, 3, 27, 5, 27, 328, 10, 27, 3, 27, 2, 2, 28, 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, 2, 2, 2, 362, 2, 54, 3, 2, 2, 2, 4, 61, 3, 2, 2, 2, 6, 68, 3, 2, 2, 2, 8, 75, 3, 2, 2, 2, 10, 92, 3, 2, 2, 2, 12, 95, 3, 2, 2, 2, 14, 123, 3, 2, 2, 2, 16, 126, 3, 2, 2, 2, 18, 153, 3, 2, 2, 2, 20, 156, 3, 2, 2, 2, 22, 178, 3, 2, 2, 2, 24, 200, 3, 2, 2, 2, 26, 202, 3, 2, 2, 2, 28, 207, 3, 2, 2, 2, 30, 209, 3, 2, 2, 2, 32, 221, 3, 2, 2, 2, 34, 223, 3, 2, 2, 2, 36, 230, 3, 2, 2, 2, 38, 232, 3, 2, 2, 2, 40, 237, 3, 2, 2, 2, 42, 243, 3, 2, 2, 2, 44, 265, 3, 2, 2, 2, 46, 283, 3, 2, 2, 2, 48, 306, 3, 2, 2, 2, 50, 309, 3, 2, 2, 2, 52, 327, 3, 2, 2, 2, 54, 58, 5, 4, 3, 2, 55, 57, 5, 10, 6, 2, 56, 55, 3, 2, 2, 2, 57, 60, 3, 2, 2, 2, 58, 56, 3, 2, 2, 2, 58, 59, 3, 2, 2, 2, 59, 3, 3, 2, 2, 2, 60, 58, 3, 2, 2, 2, 61, 65, 5, 8, 5, 2, 62, 64, 5, 6, 4, 2, 63, 62, 3, 2, 2, 2, 64, 67, 3, 2, 2, 2, 65, 63, 3, 2, 2, 2, 65, 66, 3, 2, 2, 2, 66, 5, 3, 2, 2, 2, 67, 65, 3, 2, 2, 2, 68, 69, 7, 3, 2, 2, 69, 70, 7, 37, 2, 2, 70, 72, 7, 38, 2, 2, 71, 73, 7, 4, 2, 2, 72, 71, 3, 2, 2, 2, 72, 73, 3, 2, 2, 2, 73, 7, 3, 2, 2, 2, 74, 76, 7, 39, 2, 2, 75, 74, 3, 2, 2, 2, 75, 76, 3, 2, 2, 2, 76, 80, 3, 2, 2, 2, 77, 79, 5, 28, 15, 2, 78, 77, 3, 2, 2, 2, 79, 82, 3, 2, 2, 2, 80, 78, 3, 2, 2, 2, 80, 81, 3, 2, 2, 2, 81, 83, 3, 2, 2, 2, 82, 80, 3, 2, 2, 2, 83, 84, 7, 5, 2, 2, 84, 85, 7, 37, 2, 2, 85, 87, 7, 38, 2, 2, 86, 88, 7, 4, 2, 2, 87, 86, 3, 2, 2, 2, 87, 88, 3, 2, 2, 2, 88, 9, 3, 2, 2, 2, 89, 93, 5, 12, 7, 2, 90, 93, 5, 42, 22, 2, 91, 93, 5, 46, 24, 2, 92, 89, 3, 2, 2, 2, 92, 90, 3, 2, 2, 2, 92, 91, 3, 2, 2, 2, 93, 11, 3, 2, 2, 2, 94, 96, 7, 39, 2, 2, 95, 94, 3, 2, 2, 2, 95, 96, 3, 2, 2, 2, 96, 100, 3, 2, 2, 2, 97, 99, 5, 28, 15, 2, 98, 97, 3, 2, 2, 2, 99, 102, 3, 2, 2, 2, 100, 98, 3, 2, 2, 2, 100, 101, 3, 2, 2, 2, 101, 103, 3, 2, 2, 2, 102, 100, 3, 2, 2, 2, 103, 104, 7, 6, 2, 2, 104, 107, 7, 37, 2, 2, 105, 106, 7, 7, 2, 2, 106, 108, 7, 37, 2, 2, 107, 105, 3, 2, 2, 2, 107, 108, 3, 2, 2, 2, 108, 109, 3, 2, 2, 2, 109, 113, 7, 8, 2, 2, 110, 112, 5, 14, 8, 2, 111, 110, 3, 2, 2, 2, 112, 115, 3, 2, 2, 2, 113, 111, 3, 2, 2, 2, 113, 114, 3, 2, 2, 2, 114, 116, 3, 2, 2, 2, 115, 113, 3, 2, 2, 2, 116, 118, 7, 9, 2, 2, 117, 119, 7, 4, 2, 2, 118, 117, 3, 2, 2, 2, 118, 119, 3, 2, 2, 2, 119, 13, 3, 2, 2, 2, 120, 124, 5, 16, 9, 2, 121, 124, 5, 22, 12, 2, 122, 124, 5, 20, 11, 2, 123, 120, 3, 2, 2, 2, 123, 121, 3, 2, 2, 2, 123, 122, 3, 2, 2, 2, 124, 15, 3, 2, 2, 2, 125, 127, 7, 39, 2, 2, 126, 125, 3, 2, 2, 2, 126, 127, 3, 2, 2, 2, 127, 131, 3, 2, 2, 2, 128, 130, 5, 28, 15, 2, 129, 128, 3, 2, 2, 2, 130, 133, 3, 2, 2, 2, 131, 129, 3, 2, 2, 2, 131, 132, 3, 2, 2, 2, 132, 136, 3, 2, 2, 2, 133, 131, 3, 2, 2, 2, 134, 137, 5, 32, 17, 2, 135, 137, 7, 10, 2, 2, 136, 134, 3, 2, 2, 2, 136, 135, 3, 2, 2, 2, 137, 138, 3, 2, 2, 2, 138, 139, 7, 37, 2, 2, 139, 143, 7, 11, 2, 2, 140, 142, 5, 26, 14, 2, 141, 140, 3, 2, 2, 2, 142, 145, 3, 2, 2, 2, 143, 141, 3, 2, 2, 2, 143, 144, 3, 2, 2, 2, 144, 146, 3, 2, 2, 2, 145, 143, 3, 2, 2, 2, 146, 148, 7, 12, 2, 2, 147, 149, 5, 18, 10, 2, 148, 147, 3, 2, 2, 2, 148, 149, 3, 2, 2, 2, 149, 151, 3, 2, 2, 2, 150, 152, 7, 4, 2, 2, 151, 150, 3, 2, 2, 2, 151, 152, 3, 2, 2, 2, 152, 17, 3, 2, 2, 2, 153, 154, 7, 13, 2, 2, 154, 19, 3, 2, 2, 2, 155, 157, 7, 39, 2, 2, 156, 155, 3, 2, 2, 2, 156, 157, 3, 2, 2, 2, 157, 161, 3, 2, 2, 2, 158, 160, 5, 28, 15, 2, 159, 158, 3, 2, 2, 2, 160, 163, 3, 2, 2, 2, 161, 159, 3, 2, 2, 2, 161, 162, 3, 2, 2, 2, 162, 164, 3, 2, 2, 2, 163, 161, 3, 2, 2, 2, 164, 165, 7, 14, 2, 2, 165, 166, 7, 37, 2, 2, 166, 170, 7, 11, 2, 2, 167, 169, 5, 26, 14, 2, 168, 167, 3, 2, 2, 2, 169, 172, 3, 2, 2, 2, 170, 168, 3, 2, 2, 2, 170, 171, 3, 2, 2, 2, 171, 173, 3, 2, 2, 2, 172, 170, 3, 2, 2, 2, 173, 175, 7, 12, 2, 2, 174, 176, 7, 4, 2, 2, 175, 174, 3, 2, 2, 2, 175, 176, 3, 2, 2, 2, 176, 21, 3, 2, 2, 2, 177, 179, 7, 39, 2, 2, 178, 177, 3, 2, 2, 2, 178, 179, 3, 2, 2, 2, 179, 183, 3, 2, 2, 2, 180, 182, 5, 28, 15, 2, 181, 180, 3, 2, 2, 2, 182, 185, 3, 2, 2, 2, 183, 181, 3, 2, 2, 2, 183, 184, 3, 2, 2, 2, 184, 187, 3, 2, 2, 2, 185, 183, 3, 2, 2, 2, 186, 188, 5, 24, 13, 2, 187, 186, 3, 2, 2, 2, 187, 188, 3, 2, 2, 2, 188, 189, 3, 2, 2, 2, 189, 190, 5, 32, 17, 2, 190, 193, 7, 37, 2, 2, 191, 192, 7, 15, 2, 2, 192, 194, 7, 30, 2, 2, 193, 191, 3, 2, 2, 2, 193, 194, 3, 2, 2, 2, 194, 196, 3, 2, 2, 2, 195, 197, 7, 4, 2, 2, 196, 195, 3, 2, 2, 2, 196, 197, 3, 2, 2, 2, 197, 23, 3, 2, 2, 2, 198, 201, 7, 16, 2, 2, 199, 201, 7, 13, 2, 2, 200, 198, 3, 2, 2, 2, 200, 199, 3, 2, 2, 2, 201, 25, 3, 2, 2, 2, 202, 203, 5, 32, 17, 2, 203, 205, 7, 37, 2, 2, 204, 206, 7, 17, 2, 2, 205, 204, 3, 2, 2, 2, 205, 206, 3, 2, 2, 2, 206, 27, 3, 2, 2, 2, 207, 208, 7, 33, 2, 2, 208, 29, 3, 2, 2, 2, 209, 212, 7, 37, 2, 2, 210, 211, 7, 15, 2, 2, 211, 213, 7, 37, 2, 2, 212, 210, 3, 2, 2, 2, 212, 213, 3, 2, 2, 2, 213, 215, 3, 2, 2, 2, 214, 216, 7, 17, 2, 2, 215, 214, 3, 2, 2, 2, 215, 216, 3, 2, 2, 2, 216, 31, 3, 2, 2, 2, 217, 222, 5, 36, 19, 2, 218, 222, 5, 34, 18, 2, 219, 222, 5, 38, 20, 2, 220, 222, 5, 40, 21, 2, 221, 217, 3, 2, 2, 2, 221, 218, 3, 2, 2, 2, 221, 219, 3, 2, 2, 2, 221, 220, 3, 2, 2, 2, 222, 33, 3, 2, 2, 2, 223, 224, 7, 37, 2, 2, 224, 35, 3, 2, 2, 2, 225, 231, 7, 18, 2, 2, 226, 231, 7, 19, 2, 2, 227, 231, 7, 20, 2, 2, 228, 231, 7, 21, 2, 2, 229, 231, 7, 22, 2, 2, 230, 225, 3, 2, 2, 2, 230, 226, 3, 2, 2, 2, 230, 227, 3, 2, 2, 2, 230, 228, 3, 2, 2, 2, 230, 229, 3, 2, 2, 2, 231, 37, 3, 2, 2, 2, 232, 233, 7, 23, 2, 2, 233, 234, 7, 24, 2, 2, 234, 235, 5, 32, 17, 2, 235, 236, 7, 25, 2, 2, 236, 39, 3, 2, 2, 2, 237, 238, 7, 26, 2, 2, 238, 239, 7, 24, 2, 2, 239, 240, 5, 32, 17, 2, 240, 241, 7, 25, 2, 2, 241, 41, 3, 2, 2, 2, 242, 244, 7, 39, 2, 2, 243, 242, 3, 2, 2, 2, 243, 244, 3, 2, 2, 2, 244, 248, 3, 2, 2, 2, 245, 247, 5, 28, 15, 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, 251, 3, 2, 2, 2, 250, 248, 3, 2, 2, 2, 251, 252, 7, 27, 2, 2, 252, 253, 7, 37, 2, 2, 253, 257, 7, 8, 2, 2, 254, 256, 5, 44, 23, 2, 255, 254, 3, 2, 2, 2, 256, 259, 3, 2, 2, 2, 257, 255, 3, 2, 2, 2, 257, 258, 3, 2, 2, 2, 258, 260, 3, 2, 2, 2, 259, 257, 3, 2, 2, 2, 260, 262, 7, 9, 2, 2, 261, 263, 7, 4, 2, 2, 262, 261, 3, 2, 2, 2, 262, 263, 3, 2, 2, 2, 263, 43, 3, 2, 2, 2, 264, 266, 7, 39, 2, 2, 265, 264, 3, 2, 2, 2, 265, 266, 3, 2, 2, 2, 266, 270, 3, 2, 2, 2, 267, 269, 5, 28, 15, 2, 268, 267, 3, 2, 2, 2, 269, 272, 3, 2, 2, 2, 270, 268, 3, 2, 2, 2, 270, 271, 3, 2, 2, 2, 271, 273, 3, 2, 2, 2, 272, 270, 3, 2, 2, 2, 273, 274, 5, 32, 17, 2, 274, 277, 7, 37, 2, 2, 275, 276, 7, 15, 2, 2, 276, 278, 7, 30, 2, 2, 277, 275, 3, 2, 2, 2, 277, 278, 3, 2, 2, 2, 278, 280, 3, 2, 2, 2, 279, 281, 7, 4, 2, 2, 280, 279, 3, 2, 2, 2, 280, 281, 3, 2, 2, 2, 281, 45, 3, 2, 2, 2, 282, 284, 7, 39, 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, 48, 25, 2, 292, 293, 7, 37, 2, 2, 293, 297, 7, 8, 2, 2, 294, 296, 5, 50, 26, 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, 47, 3, 2, 2, 2, 304, 307, 7, 28, 2, 2, 305, 307, 7, 29, 2, 2, 306, 304, 3, 2, 2, 2, 306, 305, 3, 2, 2, 2, 307, 49, 3, 2, 2, 2, 308, 310, 7, 39, 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, 37, 2, 2, 318, 319, 7, 15, 2, 2, 319, 321, 5, 52, 27, 2, 320, 318, 3, 2, 2, 2, 320, 321, 3, 2, 2, 2, 321, 323, 3, 2, 2, 2, 322, 324, 7, 17, 2, 2, 323, 322, 3, 2, 2, 2, 323, 324, 3, 2, 2, 2, 324, 51, 3, 2, 2, 2, 325, 328, 7, 34, 2, 2, 326, 328, 7, 35, 2, 2, 327, 325, 3, 2, 2, 2, 327, 326, 3, 2, 2, 2, 328, 53, 3, 2, 2, 2, 54, 58, 65, 72, 75, 80, 87, 92, 95, 100, 107, 113, 118, 123, 126, 131, 136, 143, 148, 151, 156, 161, 170, 175, 178, 183, 187, 193, 196, 200, 205, 212, 215, 221, 230, 243, 248, 257, 262, 265, 270, 277, 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 5362da5..84d36e7 100644 --- a/qface/idl/parser/T.tokens +++ b/qface/idl/parser/T.tokens @@ -25,16 +25,19 @@ 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 +STRING=28 +DOUBLE_STRING=29 +SINGLE_STRING=30 +TAGLINE=31 +INTCONSTANT=32 +HEXCONSTANT=33 +TAGIDENTIFIER=34 +IDENTIFIER=35 +VERSION=36 +DOCCOMMENT=37 +WHITESPACE=38 +COMMENT=39 +MULTICOMM=40 'import'=1 ';'=2 'module'=3 diff --git a/qface/idl/parser/TLexer.interp b/qface/idl/parser/TLexer.interp index 47a4243..aabf6d0 100644 --- a/qface/idl/parser/TLexer.interp +++ b/qface/idl/parser/TLexer.interp @@ -37,6 +37,9 @@ null null null null +null +null +null token symbolic names: null @@ -67,6 +70,9 @@ null null null null +STRING +DOUBLE_STRING +SINGLE_STRING TAGLINE INTCONSTANT HEXCONSTANT @@ -106,6 +112,9 @@ T__23 T__24 T__25 T__26 +STRING +DOUBLE_STRING +SINGLE_STRING TAGLINE INTCONSTANT HEXCONSTANT @@ -116,6 +125,7 @@ DOCCOMMENT WHITESPACE COMMENT MULTICOMM +ESC channel names: DEFAULT_TOKEN_CHANNEL @@ -125,4 +135,4 @@ mode names: DEFAULT_MODE atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 39, 294, 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, 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, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 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, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 7, 29, 210, 10, 29, 12, 29, 14, 29, 213, 11, 29, 3, 30, 5, 30, 216, 10, 30, 3, 30, 6, 30, 219, 10, 30, 13, 30, 14, 30, 220, 3, 31, 3, 31, 3, 31, 3, 31, 6, 31, 227, 10, 31, 13, 31, 14, 31, 228, 3, 32, 3, 32, 3, 32, 7, 32, 234, 10, 32, 12, 32, 14, 32, 237, 11, 32, 3, 33, 3, 33, 7, 33, 241, 10, 33, 12, 33, 14, 33, 244, 11, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 7, 35, 255, 10, 35, 12, 35, 14, 35, 258, 11, 35, 3, 35, 3, 35, 3, 35, 3, 36, 6, 36, 264, 10, 36, 13, 36, 14, 36, 265, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 37, 7, 37, 274, 10, 37, 12, 37, 14, 37, 277, 11, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 38, 7, 38, 285, 10, 38, 12, 38, 14, 38, 288, 11, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 4, 256, 286, 2, 39, 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, 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, 303, 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, 3, 77, 3, 2, 2, 2, 5, 84, 3, 2, 2, 2, 7, 86, 3, 2, 2, 2, 9, 93, 3, 2, 2, 2, 11, 103, 3, 2, 2, 2, 13, 111, 3, 2, 2, 2, 15, 113, 3, 2, 2, 2, 17, 115, 3, 2, 2, 2, 19, 120, 3, 2, 2, 2, 21, 122, 3, 2, 2, 2, 23, 124, 3, 2, 2, 2, 25, 130, 3, 2, 2, 2, 27, 137, 3, 2, 2, 2, 29, 139, 3, 2, 2, 2, 31, 148, 3, 2, 2, 2, 33, 150, 3, 2, 2, 2, 35, 155, 3, 2, 2, 2, 37, 159, 3, 2, 2, 2, 39, 164, 3, 2, 2, 2, 41, 171, 3, 2, 2, 2, 43, 175, 3, 2, 2, 2, 45, 180, 3, 2, 2, 2, 47, 182, 3, 2, 2, 2, 49, 184, 3, 2, 2, 2, 51, 190, 3, 2, 2, 2, 53, 197, 3, 2, 2, 2, 55, 202, 3, 2, 2, 2, 57, 207, 3, 2, 2, 2, 59, 215, 3, 2, 2, 2, 61, 222, 3, 2, 2, 2, 63, 230, 3, 2, 2, 2, 65, 238, 3, 2, 2, 2, 67, 245, 3, 2, 2, 2, 69, 249, 3, 2, 2, 2, 71, 263, 3, 2, 2, 2, 73, 269, 3, 2, 2, 2, 75, 280, 3, 2, 2, 2, 77, 78, 7, 107, 2, 2, 78, 79, 7, 111, 2, 2, 79, 80, 7, 114, 2, 2, 80, 81, 7, 113, 2, 2, 81, 82, 7, 116, 2, 2, 82, 83, 7, 118, 2, 2, 83, 4, 3, 2, 2, 2, 84, 85, 7, 61, 2, 2, 85, 6, 3, 2, 2, 2, 86, 87, 7, 111, 2, 2, 87, 88, 7, 113, 2, 2, 88, 89, 7, 102, 2, 2, 89, 90, 7, 119, 2, 2, 90, 91, 7, 110, 2, 2, 91, 92, 7, 103, 2, 2, 92, 8, 3, 2, 2, 2, 93, 94, 7, 107, 2, 2, 94, 95, 7, 112, 2, 2, 95, 96, 7, 118, 2, 2, 96, 97, 7, 103, 2, 2, 97, 98, 7, 116, 2, 2, 98, 99, 7, 104, 2, 2, 99, 100, 7, 99, 2, 2, 100, 101, 7, 101, 2, 2, 101, 102, 7, 103, 2, 2, 102, 10, 3, 2, 2, 2, 103, 104, 7, 103, 2, 2, 104, 105, 7, 122, 2, 2, 105, 106, 7, 118, 2, 2, 106, 107, 7, 103, 2, 2, 107, 108, 7, 112, 2, 2, 108, 109, 7, 102, 2, 2, 109, 110, 7, 117, 2, 2, 110, 12, 3, 2, 2, 2, 111, 112, 7, 125, 2, 2, 112, 14, 3, 2, 2, 2, 113, 114, 7, 127, 2, 2, 114, 16, 3, 2, 2, 2, 115, 116, 7, 120, 2, 2, 116, 117, 7, 113, 2, 2, 117, 118, 7, 107, 2, 2, 118, 119, 7, 102, 2, 2, 119, 18, 3, 2, 2, 2, 120, 121, 7, 42, 2, 2, 121, 20, 3, 2, 2, 2, 122, 123, 7, 43, 2, 2, 123, 22, 3, 2, 2, 2, 124, 125, 7, 101, 2, 2, 125, 126, 7, 113, 2, 2, 126, 127, 7, 112, 2, 2, 127, 128, 7, 117, 2, 2, 128, 129, 7, 118, 2, 2, 129, 24, 3, 2, 2, 2, 130, 131, 7, 117, 2, 2, 131, 132, 7, 107, 2, 2, 132, 133, 7, 105, 2, 2, 133, 134, 7, 112, 2, 2, 134, 135, 7, 99, 2, 2, 135, 136, 7, 110, 2, 2, 136, 26, 3, 2, 2, 2, 137, 138, 7, 63, 2, 2, 138, 28, 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, 30, 3, 2, 2, 2, 148, 149, 7, 46, 2, 2, 149, 32, 3, 2, 2, 2, 150, 151, 7, 100, 2, 2, 151, 152, 7, 113, 2, 2, 152, 153, 7, 113, 2, 2, 153, 154, 7, 110, 2, 2, 154, 34, 3, 2, 2, 2, 155, 156, 7, 107, 2, 2, 156, 157, 7, 112, 2, 2, 157, 158, 7, 118, 2, 2, 158, 36, 3, 2, 2, 2, 159, 160, 7, 116, 2, 2, 160, 161, 7, 103, 2, 2, 161, 162, 7, 99, 2, 2, 162, 163, 7, 110, 2, 2, 163, 38, 3, 2, 2, 2, 164, 165, 7, 117, 2, 2, 165, 166, 7, 118, 2, 2, 166, 167, 7, 116, 2, 2, 167, 168, 7, 107, 2, 2, 168, 169, 7, 112, 2, 2, 169, 170, 7, 105, 2, 2, 170, 40, 3, 2, 2, 2, 171, 172, 7, 120, 2, 2, 172, 173, 7, 99, 2, 2, 173, 174, 7, 116, 2, 2, 174, 42, 3, 2, 2, 2, 175, 176, 7, 110, 2, 2, 176, 177, 7, 107, 2, 2, 177, 178, 7, 117, 2, 2, 178, 179, 7, 118, 2, 2, 179, 44, 3, 2, 2, 2, 180, 181, 7, 62, 2, 2, 181, 46, 3, 2, 2, 2, 182, 183, 7, 64, 2, 2, 183, 48, 3, 2, 2, 2, 184, 185, 7, 111, 2, 2, 185, 186, 7, 113, 2, 2, 186, 187, 7, 102, 2, 2, 187, 188, 7, 103, 2, 2, 188, 189, 7, 110, 2, 2, 189, 50, 3, 2, 2, 2, 190, 191, 7, 117, 2, 2, 191, 192, 7, 118, 2, 2, 192, 193, 7, 116, 2, 2, 193, 194, 7, 119, 2, 2, 194, 195, 7, 101, 2, 2, 195, 196, 7, 118, 2, 2, 196, 52, 3, 2, 2, 2, 197, 198, 7, 103, 2, 2, 198, 199, 7, 112, 2, 2, 199, 200, 7, 119, 2, 2, 200, 201, 7, 111, 2, 2, 201, 54, 3, 2, 2, 2, 202, 203, 7, 104, 2, 2, 203, 204, 7, 110, 2, 2, 204, 205, 7, 99, 2, 2, 205, 206, 7, 105, 2, 2, 206, 56, 3, 2, 2, 2, 207, 211, 7, 66, 2, 2, 208, 210, 10, 2, 2, 2, 209, 208, 3, 2, 2, 2, 210, 213, 3, 2, 2, 2, 211, 209, 3, 2, 2, 2, 211, 212, 3, 2, 2, 2, 212, 58, 3, 2, 2, 2, 213, 211, 3, 2, 2, 2, 214, 216, 9, 3, 2, 2, 215, 214, 3, 2, 2, 2, 215, 216, 3, 2, 2, 2, 216, 218, 3, 2, 2, 2, 217, 219, 4, 50, 59, 2, 218, 217, 3, 2, 2, 2, 219, 220, 3, 2, 2, 2, 220, 218, 3, 2, 2, 2, 220, 221, 3, 2, 2, 2, 221, 60, 3, 2, 2, 2, 222, 223, 7, 50, 2, 2, 223, 224, 7, 122, 2, 2, 224, 226, 3, 2, 2, 2, 225, 227, 9, 4, 2, 2, 226, 225, 3, 2, 2, 2, 227, 228, 3, 2, 2, 2, 228, 226, 3, 2, 2, 2, 228, 229, 3, 2, 2, 2, 229, 62, 3, 2, 2, 2, 230, 231, 7, 66, 2, 2, 231, 235, 9, 5, 2, 2, 232, 234, 9, 6, 2, 2, 233, 232, 3, 2, 2, 2, 234, 237, 3, 2, 2, 2, 235, 233, 3, 2, 2, 2, 235, 236, 3, 2, 2, 2, 236, 64, 3, 2, 2, 2, 237, 235, 3, 2, 2, 2, 238, 242, 9, 5, 2, 2, 239, 241, 9, 6, 2, 2, 240, 239, 3, 2, 2, 2, 241, 244, 3, 2, 2, 2, 242, 240, 3, 2, 2, 2, 242, 243, 3, 2, 2, 2, 243, 66, 3, 2, 2, 2, 244, 242, 3, 2, 2, 2, 245, 246, 9, 7, 2, 2, 246, 247, 7, 48, 2, 2, 247, 248, 9, 7, 2, 2, 248, 68, 3, 2, 2, 2, 249, 250, 7, 49, 2, 2, 250, 251, 7, 44, 2, 2, 251, 252, 7, 44, 2, 2, 252, 256, 3, 2, 2, 2, 253, 255, 11, 2, 2, 2, 254, 253, 3, 2, 2, 2, 255, 258, 3, 2, 2, 2, 256, 257, 3, 2, 2, 2, 256, 254, 3, 2, 2, 2, 257, 259, 3, 2, 2, 2, 258, 256, 3, 2, 2, 2, 259, 260, 7, 44, 2, 2, 260, 261, 7, 49, 2, 2, 261, 70, 3, 2, 2, 2, 262, 264, 9, 8, 2, 2, 263, 262, 3, 2, 2, 2, 264, 265, 3, 2, 2, 2, 265, 263, 3, 2, 2, 2, 265, 266, 3, 2, 2, 2, 266, 267, 3, 2, 2, 2, 267, 268, 8, 36, 2, 2, 268, 72, 3, 2, 2, 2, 269, 270, 7, 49, 2, 2, 270, 271, 7, 49, 2, 2, 271, 275, 3, 2, 2, 2, 272, 274, 10, 2, 2, 2, 273, 272, 3, 2, 2, 2, 274, 277, 3, 2, 2, 2, 275, 273, 3, 2, 2, 2, 275, 276, 3, 2, 2, 2, 276, 278, 3, 2, 2, 2, 277, 275, 3, 2, 2, 2, 278, 279, 8, 37, 2, 2, 279, 74, 3, 2, 2, 2, 280, 281, 7, 49, 2, 2, 281, 282, 7, 44, 2, 2, 282, 286, 3, 2, 2, 2, 283, 285, 11, 2, 2, 2, 284, 283, 3, 2, 2, 2, 285, 288, 3, 2, 2, 2, 286, 287, 3, 2, 2, 2, 286, 284, 3, 2, 2, 2, 287, 289, 3, 2, 2, 2, 288, 286, 3, 2, 2, 2, 289, 290, 7, 44, 2, 2, 290, 291, 7, 49, 2, 2, 291, 292, 3, 2, 2, 2, 292, 293, 8, 38, 2, 2, 293, 76, 3, 2, 2, 2, 13, 2, 211, 215, 220, 228, 235, 242, 256, 265, 275, 286, 3, 8, 2, 2] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 42, 329, 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, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 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, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 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, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 5, 29, 218, 10, 29, 3, 30, 3, 30, 3, 30, 7, 30, 223, 10, 30, 12, 30, 14, 30, 226, 11, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 7, 31, 233, 10, 31, 12, 31, 14, 31, 236, 11, 31, 3, 31, 3, 31, 3, 32, 3, 32, 7, 32, 242, 10, 32, 12, 32, 14, 32, 245, 11, 32, 3, 33, 5, 33, 248, 10, 33, 3, 33, 6, 33, 251, 10, 33, 13, 33, 14, 33, 252, 3, 34, 3, 34, 3, 34, 3, 34, 6, 34, 259, 10, 34, 13, 34, 14, 34, 260, 3, 35, 3, 35, 3, 35, 7, 35, 266, 10, 35, 12, 35, 14, 35, 269, 11, 35, 3, 36, 3, 36, 7, 36, 273, 10, 36, 12, 36, 14, 36, 276, 11, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 7, 38, 287, 10, 38, 12, 38, 14, 38, 290, 11, 38, 3, 38, 3, 38, 3, 38, 3, 39, 6, 39, 296, 10, 39, 13, 39, 14, 39, 297, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 40, 7, 40, 306, 10, 40, 12, 40, 14, 40, 309, 11, 40, 3, 40, 3, 40, 3, 41, 3, 41, 3, 41, 3, 41, 7, 41, 317, 10, 41, 12, 41, 14, 41, 320, 11, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 42, 3, 42, 3, 42, 4, 288, 318, 2, 43, 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, 79, 41, 81, 42, 83, 2, 3, 2, 12, 4, 2, 36, 36, 94, 94, 4, 2, 41, 41, 94, 94, 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, 10, 2, 36, 36, 49, 49, 94, 94, 100, 100, 104, 104, 112, 112, 116, 116, 118, 118, 2, 342, 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, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 3, 85, 3, 2, 2, 2, 5, 92, 3, 2, 2, 2, 7, 94, 3, 2, 2, 2, 9, 101, 3, 2, 2, 2, 11, 111, 3, 2, 2, 2, 13, 119, 3, 2, 2, 2, 15, 121, 3, 2, 2, 2, 17, 123, 3, 2, 2, 2, 19, 128, 3, 2, 2, 2, 21, 130, 3, 2, 2, 2, 23, 132, 3, 2, 2, 2, 25, 138, 3, 2, 2, 2, 27, 145, 3, 2, 2, 2, 29, 147, 3, 2, 2, 2, 31, 156, 3, 2, 2, 2, 33, 158, 3, 2, 2, 2, 35, 163, 3, 2, 2, 2, 37, 167, 3, 2, 2, 2, 39, 172, 3, 2, 2, 2, 41, 179, 3, 2, 2, 2, 43, 183, 3, 2, 2, 2, 45, 188, 3, 2, 2, 2, 47, 190, 3, 2, 2, 2, 49, 192, 3, 2, 2, 2, 51, 198, 3, 2, 2, 2, 53, 205, 3, 2, 2, 2, 55, 210, 3, 2, 2, 2, 57, 217, 3, 2, 2, 2, 59, 219, 3, 2, 2, 2, 61, 229, 3, 2, 2, 2, 63, 239, 3, 2, 2, 2, 65, 247, 3, 2, 2, 2, 67, 254, 3, 2, 2, 2, 69, 262, 3, 2, 2, 2, 71, 270, 3, 2, 2, 2, 73, 277, 3, 2, 2, 2, 75, 281, 3, 2, 2, 2, 77, 295, 3, 2, 2, 2, 79, 301, 3, 2, 2, 2, 81, 312, 3, 2, 2, 2, 83, 326, 3, 2, 2, 2, 85, 86, 7, 107, 2, 2, 86, 87, 7, 111, 2, 2, 87, 88, 7, 114, 2, 2, 88, 89, 7, 113, 2, 2, 89, 90, 7, 116, 2, 2, 90, 91, 7, 118, 2, 2, 91, 4, 3, 2, 2, 2, 92, 93, 7, 61, 2, 2, 93, 6, 3, 2, 2, 2, 94, 95, 7, 111, 2, 2, 95, 96, 7, 113, 2, 2, 96, 97, 7, 102, 2, 2, 97, 98, 7, 119, 2, 2, 98, 99, 7, 110, 2, 2, 99, 100, 7, 103, 2, 2, 100, 8, 3, 2, 2, 2, 101, 102, 7, 107, 2, 2, 102, 103, 7, 112, 2, 2, 103, 104, 7, 118, 2, 2, 104, 105, 7, 103, 2, 2, 105, 106, 7, 116, 2, 2, 106, 107, 7, 104, 2, 2, 107, 108, 7, 99, 2, 2, 108, 109, 7, 101, 2, 2, 109, 110, 7, 103, 2, 2, 110, 10, 3, 2, 2, 2, 111, 112, 7, 103, 2, 2, 112, 113, 7, 122, 2, 2, 113, 114, 7, 118, 2, 2, 114, 115, 7, 103, 2, 2, 115, 116, 7, 112, 2, 2, 116, 117, 7, 102, 2, 2, 117, 118, 7, 117, 2, 2, 118, 12, 3, 2, 2, 2, 119, 120, 7, 125, 2, 2, 120, 14, 3, 2, 2, 2, 121, 122, 7, 127, 2, 2, 122, 16, 3, 2, 2, 2, 123, 124, 7, 120, 2, 2, 124, 125, 7, 113, 2, 2, 125, 126, 7, 107, 2, 2, 126, 127, 7, 102, 2, 2, 127, 18, 3, 2, 2, 2, 128, 129, 7, 42, 2, 2, 129, 20, 3, 2, 2, 2, 130, 131, 7, 43, 2, 2, 131, 22, 3, 2, 2, 2, 132, 133, 7, 101, 2, 2, 133, 134, 7, 113, 2, 2, 134, 135, 7, 112, 2, 2, 135, 136, 7, 117, 2, 2, 136, 137, 7, 118, 2, 2, 137, 24, 3, 2, 2, 2, 138, 139, 7, 117, 2, 2, 139, 140, 7, 107, 2, 2, 140, 141, 7, 105, 2, 2, 141, 142, 7, 112, 2, 2, 142, 143, 7, 99, 2, 2, 143, 144, 7, 110, 2, 2, 144, 26, 3, 2, 2, 2, 145, 146, 7, 63, 2, 2, 146, 28, 3, 2, 2, 2, 147, 148, 7, 116, 2, 2, 148, 149, 7, 103, 2, 2, 149, 150, 7, 99, 2, 2, 150, 151, 7, 102, 2, 2, 151, 152, 7, 113, 2, 2, 152, 153, 7, 112, 2, 2, 153, 154, 7, 110, 2, 2, 154, 155, 7, 123, 2, 2, 155, 30, 3, 2, 2, 2, 156, 157, 7, 46, 2, 2, 157, 32, 3, 2, 2, 2, 158, 159, 7, 100, 2, 2, 159, 160, 7, 113, 2, 2, 160, 161, 7, 113, 2, 2, 161, 162, 7, 110, 2, 2, 162, 34, 3, 2, 2, 2, 163, 164, 7, 107, 2, 2, 164, 165, 7, 112, 2, 2, 165, 166, 7, 118, 2, 2, 166, 36, 3, 2, 2, 2, 167, 168, 7, 116, 2, 2, 168, 169, 7, 103, 2, 2, 169, 170, 7, 99, 2, 2, 170, 171, 7, 110, 2, 2, 171, 38, 3, 2, 2, 2, 172, 173, 7, 117, 2, 2, 173, 174, 7, 118, 2, 2, 174, 175, 7, 116, 2, 2, 175, 176, 7, 107, 2, 2, 176, 177, 7, 112, 2, 2, 177, 178, 7, 105, 2, 2, 178, 40, 3, 2, 2, 2, 179, 180, 7, 120, 2, 2, 180, 181, 7, 99, 2, 2, 181, 182, 7, 116, 2, 2, 182, 42, 3, 2, 2, 2, 183, 184, 7, 110, 2, 2, 184, 185, 7, 107, 2, 2, 185, 186, 7, 117, 2, 2, 186, 187, 7, 118, 2, 2, 187, 44, 3, 2, 2, 2, 188, 189, 7, 62, 2, 2, 189, 46, 3, 2, 2, 2, 190, 191, 7, 64, 2, 2, 191, 48, 3, 2, 2, 2, 192, 193, 7, 111, 2, 2, 193, 194, 7, 113, 2, 2, 194, 195, 7, 102, 2, 2, 195, 196, 7, 103, 2, 2, 196, 197, 7, 110, 2, 2, 197, 50, 3, 2, 2, 2, 198, 199, 7, 117, 2, 2, 199, 200, 7, 118, 2, 2, 200, 201, 7, 116, 2, 2, 201, 202, 7, 119, 2, 2, 202, 203, 7, 101, 2, 2, 203, 204, 7, 118, 2, 2, 204, 52, 3, 2, 2, 2, 205, 206, 7, 103, 2, 2, 206, 207, 7, 112, 2, 2, 207, 208, 7, 119, 2, 2, 208, 209, 7, 111, 2, 2, 209, 54, 3, 2, 2, 2, 210, 211, 7, 104, 2, 2, 211, 212, 7, 110, 2, 2, 212, 213, 7, 99, 2, 2, 213, 214, 7, 105, 2, 2, 214, 56, 3, 2, 2, 2, 215, 218, 5, 59, 30, 2, 216, 218, 5, 61, 31, 2, 217, 215, 3, 2, 2, 2, 217, 216, 3, 2, 2, 2, 218, 58, 3, 2, 2, 2, 219, 224, 7, 36, 2, 2, 220, 223, 5, 83, 42, 2, 221, 223, 10, 2, 2, 2, 222, 220, 3, 2, 2, 2, 222, 221, 3, 2, 2, 2, 223, 226, 3, 2, 2, 2, 224, 222, 3, 2, 2, 2, 224, 225, 3, 2, 2, 2, 225, 227, 3, 2, 2, 2, 226, 224, 3, 2, 2, 2, 227, 228, 7, 36, 2, 2, 228, 60, 3, 2, 2, 2, 229, 234, 7, 41, 2, 2, 230, 233, 5, 83, 42, 2, 231, 233, 10, 3, 2, 2, 232, 230, 3, 2, 2, 2, 232, 231, 3, 2, 2, 2, 233, 236, 3, 2, 2, 2, 234, 232, 3, 2, 2, 2, 234, 235, 3, 2, 2, 2, 235, 237, 3, 2, 2, 2, 236, 234, 3, 2, 2, 2, 237, 238, 7, 41, 2, 2, 238, 62, 3, 2, 2, 2, 239, 243, 7, 66, 2, 2, 240, 242, 10, 4, 2, 2, 241, 240, 3, 2, 2, 2, 242, 245, 3, 2, 2, 2, 243, 241, 3, 2, 2, 2, 243, 244, 3, 2, 2, 2, 244, 64, 3, 2, 2, 2, 245, 243, 3, 2, 2, 2, 246, 248, 9, 5, 2, 2, 247, 246, 3, 2, 2, 2, 247, 248, 3, 2, 2, 2, 248, 250, 3, 2, 2, 2, 249, 251, 4, 50, 59, 2, 250, 249, 3, 2, 2, 2, 251, 252, 3, 2, 2, 2, 252, 250, 3, 2, 2, 2, 252, 253, 3, 2, 2, 2, 253, 66, 3, 2, 2, 2, 254, 255, 7, 50, 2, 2, 255, 256, 7, 122, 2, 2, 256, 258, 3, 2, 2, 2, 257, 259, 9, 6, 2, 2, 258, 257, 3, 2, 2, 2, 259, 260, 3, 2, 2, 2, 260, 258, 3, 2, 2, 2, 260, 261, 3, 2, 2, 2, 261, 68, 3, 2, 2, 2, 262, 263, 7, 66, 2, 2, 263, 267, 9, 7, 2, 2, 264, 266, 9, 8, 2, 2, 265, 264, 3, 2, 2, 2, 266, 269, 3, 2, 2, 2, 267, 265, 3, 2, 2, 2, 267, 268, 3, 2, 2, 2, 268, 70, 3, 2, 2, 2, 269, 267, 3, 2, 2, 2, 270, 274, 9, 7, 2, 2, 271, 273, 9, 8, 2, 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, 72, 3, 2, 2, 2, 276, 274, 3, 2, 2, 2, 277, 278, 9, 9, 2, 2, 278, 279, 7, 48, 2, 2, 279, 280, 9, 9, 2, 2, 280, 74, 3, 2, 2, 2, 281, 282, 7, 49, 2, 2, 282, 283, 7, 44, 2, 2, 283, 284, 7, 44, 2, 2, 284, 288, 3, 2, 2, 2, 285, 287, 11, 2, 2, 2, 286, 285, 3, 2, 2, 2, 287, 290, 3, 2, 2, 2, 288, 289, 3, 2, 2, 2, 288, 286, 3, 2, 2, 2, 289, 291, 3, 2, 2, 2, 290, 288, 3, 2, 2, 2, 291, 292, 7, 44, 2, 2, 292, 293, 7, 49, 2, 2, 293, 76, 3, 2, 2, 2, 294, 296, 9, 10, 2, 2, 295, 294, 3, 2, 2, 2, 296, 297, 3, 2, 2, 2, 297, 295, 3, 2, 2, 2, 297, 298, 3, 2, 2, 2, 298, 299, 3, 2, 2, 2, 299, 300, 8, 39, 2, 2, 300, 78, 3, 2, 2, 2, 301, 302, 7, 49, 2, 2, 302, 303, 7, 49, 2, 2, 303, 307, 3, 2, 2, 2, 304, 306, 10, 4, 2, 2, 305, 304, 3, 2, 2, 2, 306, 309, 3, 2, 2, 2, 307, 305, 3, 2, 2, 2, 307, 308, 3, 2, 2, 2, 308, 310, 3, 2, 2, 2, 309, 307, 3, 2, 2, 2, 310, 311, 8, 40, 2, 2, 311, 80, 3, 2, 2, 2, 312, 313, 7, 49, 2, 2, 313, 314, 7, 44, 2, 2, 314, 318, 3, 2, 2, 2, 315, 317, 11, 2, 2, 2, 316, 315, 3, 2, 2, 2, 317, 320, 3, 2, 2, 2, 318, 319, 3, 2, 2, 2, 318, 316, 3, 2, 2, 2, 319, 321, 3, 2, 2, 2, 320, 318, 3, 2, 2, 2, 321, 322, 7, 44, 2, 2, 322, 323, 7, 49, 2, 2, 323, 324, 3, 2, 2, 2, 324, 325, 8, 41, 2, 2, 325, 82, 3, 2, 2, 2, 326, 327, 7, 94, 2, 2, 327, 328, 9, 11, 2, 2, 328, 84, 3, 2, 2, 2, 18, 2, 217, 222, 224, 232, 234, 243, 247, 252, 260, 267, 274, 288, 297, 307, 318, 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 c66bf36..a9d556e 100644 --- a/qface/idl/parser/TLexer.py +++ b/qface/idl/parser/TLexer.py @@ -7,127 +7,146 @@ import sys 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("\u0149\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\17\3\17\3") - buf.write("\17\3\17\3\17\3\17\3\17\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\u008b\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\7?\2\2\u008a\34\3\2\2\2\u008b\u008c\7t\2\2\u008c") - buf.write("\u008d\7g\2\2\u008d\u008e\7c\2\2\u008e\u008f\7f\2\2\u008f") - buf.write("\u0090\7q\2\2\u0090\u0091\7p\2\2\u0091\u0092\7n\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("\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\3\2\3\2\3\2\3\2\3\2\3") + buf.write("\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") + buf.write("\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") + buf.write("\6\3\6\3\7\3\7\3\b\3\b\3\t\3\t\3\t\3\t\3\t\3\n\3\n\3\13") + buf.write("\3\13\3\f\3\f\3\f\3\f\3\f\3\f\3\r\3\r\3\r\3\r\3\r\3\r") + buf.write("\3\r\3\16\3\16\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17") + buf.write("\3\17\3\20\3\20\3\21\3\21\3\21\3\21\3\21\3\22\3\22\3\22") + buf.write("\3\22\3\23\3\23\3\23\3\23\3\23\3\24\3\24\3\24\3\24\3\24") + buf.write("\3\24\3\24\3\25\3\25\3\25\3\25\3\26\3\26\3\26\3\26\3\26") + buf.write("\3\27\3\27\3\30\3\30\3\31\3\31\3\31\3\31\3\31\3\31\3\32") + buf.write("\3\32\3\32\3\32\3\32\3\32\3\32\3\33\3\33\3\33\3\33\3\33") + buf.write("\3\34\3\34\3\34\3\34\3\34\3\35\3\35\5\35\u00da\n\35\3") + buf.write("\36\3\36\3\36\7\36\u00df\n\36\f\36\16\36\u00e2\13\36\3") + buf.write("\36\3\36\3\37\3\37\3\37\7\37\u00e9\n\37\f\37\16\37\u00ec") + buf.write("\13\37\3\37\3\37\3 \3 \7 \u00f2\n \f \16 \u00f5\13 \3") + buf.write("!\5!\u00f8\n!\3!\6!\u00fb\n!\r!\16!\u00fc\3\"\3\"\3\"") + buf.write("\3\"\6\"\u0103\n\"\r\"\16\"\u0104\3#\3#\3#\7#\u010a\n") + buf.write("#\f#\16#\u010d\13#\3$\3$\7$\u0111\n$\f$\16$\u0114\13$") + buf.write("\3%\3%\3%\3%\3&\3&\3&\3&\3&\7&\u011f\n&\f&\16&\u0122\13") + buf.write("&\3&\3&\3&\3\'\6\'\u0128\n\'\r\'\16\'\u0129\3\'\3\'\3") + buf.write("(\3(\3(\3(\7(\u0132\n(\f(\16(\u0135\13(\3(\3(\3)\3)\3") + buf.write(")\3)\7)\u013d\n)\f)\16)\u0140\13)\3)\3)\3)\3)\3)\3*\3") + buf.write("*\3*\4\u0120\u013e\2+\3\3\5\4\7\5\t\6\13\7\r\b\17\t\21") + buf.write("\n\23\13\25\f\27\r\31\16\33\17\35\20\37\21!\22#\23%\24") + buf.write("\'\25)\26+\27-\30/\31\61\32\63\33\65\34\67\359\36;\37") + buf.write("= ?!A\"C#E$G%I&K\'M(O)Q*S\2\3\2\f\4\2$$^^\4\2))^^\4\2") + buf.write("\f\f\17\17\4\2--//\5\2\62;CHch\5\2C\\aac|\7\2\60\60\62") + buf.write(";C\\aac|\3\2\62;\5\2\13\f\17\17\"\"\n\2$$\61\61^^ddhh") + buf.write("ppttvv\2\u0156\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2\2\t") + buf.write("\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21\3") + buf.write("\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2\2\31\3\2") + buf.write("\2\2\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2\2\2\2!\3\2\2\2") + buf.write("\2#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)\3\2\2\2\2+\3\2\2") + buf.write("\2\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2\2\2\2\63\3\2\2\2\2\65") + buf.write("\3\2\2\2\2\67\3\2\2\2\29\3\2\2\2\2;\3\2\2\2\2=\3\2\2\2") + buf.write("\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2\2\2E\3\2\2\2\2G\3\2\2") + buf.write("\2\2I\3\2\2\2\2K\3\2\2\2\2M\3\2\2\2\2O\3\2\2\2\2Q\3\2") + buf.write("\2\2\3U\3\2\2\2\5\\\3\2\2\2\7^\3\2\2\2\te\3\2\2\2\13o") + buf.write("\3\2\2\2\rw\3\2\2\2\17y\3\2\2\2\21{\3\2\2\2\23\u0080\3") + buf.write("\2\2\2\25\u0082\3\2\2\2\27\u0084\3\2\2\2\31\u008a\3\2") + buf.write("\2\2\33\u0091\3\2\2\2\35\u0093\3\2\2\2\37\u009c\3\2\2") + buf.write("\2!\u009e\3\2\2\2#\u00a3\3\2\2\2%\u00a7\3\2\2\2\'\u00ac") + buf.write("\3\2\2\2)\u00b3\3\2\2\2+\u00b7\3\2\2\2-\u00bc\3\2\2\2") + buf.write("/\u00be\3\2\2\2\61\u00c0\3\2\2\2\63\u00c6\3\2\2\2\65\u00cd") + buf.write("\3\2\2\2\67\u00d2\3\2\2\29\u00d9\3\2\2\2;\u00db\3\2\2") + buf.write("\2=\u00e5\3\2\2\2?\u00ef\3\2\2\2A\u00f7\3\2\2\2C\u00fe") + buf.write("\3\2\2\2E\u0106\3\2\2\2G\u010e\3\2\2\2I\u0115\3\2\2\2") + buf.write("K\u0119\3\2\2\2M\u0127\3\2\2\2O\u012d\3\2\2\2Q\u0138\3") + buf.write("\2\2\2S\u0146\3\2\2\2UV\7k\2\2VW\7o\2\2WX\7r\2\2XY\7q") + buf.write("\2\2YZ\7t\2\2Z[\7v\2\2[\4\3\2\2\2\\]\7=\2\2]\6\3\2\2\2") + buf.write("^_\7o\2\2_`\7q\2\2`a\7f\2\2ab\7w\2\2bc\7n\2\2cd\7g\2\2") + buf.write("d\b\3\2\2\2ef\7k\2\2fg\7p\2\2gh\7v\2\2hi\7g\2\2ij\7t\2") + buf.write("\2jk\7h\2\2kl\7c\2\2lm\7e\2\2mn\7g\2\2n\n\3\2\2\2op\7") + buf.write("g\2\2pq\7z\2\2qr\7v\2\2rs\7g\2\2st\7p\2\2tu\7f\2\2uv\7") + buf.write("u\2\2v\f\3\2\2\2wx\7}\2\2x\16\3\2\2\2yz\7\177\2\2z\20") + buf.write("\3\2\2\2{|\7x\2\2|}\7q\2\2}~\7k\2\2~\177\7f\2\2\177\22") + buf.write("\3\2\2\2\u0080\u0081\7*\2\2\u0081\24\3\2\2\2\u0082\u0083") + buf.write("\7+\2\2\u0083\26\3\2\2\2\u0084\u0085\7e\2\2\u0085\u0086") + buf.write("\7q\2\2\u0086\u0087\7p\2\2\u0087\u0088\7u\2\2\u0088\u0089") + buf.write("\7v\2\2\u0089\30\3\2\2\2\u008a\u008b\7u\2\2\u008b\u008c") + buf.write("\7k\2\2\u008c\u008d\7i\2\2\u008d\u008e\7p\2\2\u008e\u008f") + buf.write("\7c\2\2\u008f\u0090\7n\2\2\u0090\32\3\2\2\2\u0091\u0092") + buf.write("\7?\2\2\u0092\34\3\2\2\2\u0093\u0094\7t\2\2\u0094\u0095") + buf.write("\7g\2\2\u0095\u0096\7c\2\2\u0096\u0097\7f\2\2\u0097\u0098") + buf.write("\7q\2\2\u0098\u0099\7p\2\2\u0099\u009a\7n\2\2\u009a\u009b") + buf.write("\7{\2\2\u009b\36\3\2\2\2\u009c\u009d\7.\2\2\u009d \3\2") + buf.write("\2\2\u009e\u009f\7d\2\2\u009f\u00a0\7q\2\2\u00a0\u00a1") + buf.write("\7q\2\2\u00a1\u00a2\7n\2\2\u00a2\"\3\2\2\2\u00a3\u00a4") + buf.write("\7k\2\2\u00a4\u00a5\7p\2\2\u00a5\u00a6\7v\2\2\u00a6$\3") + buf.write("\2\2\2\u00a7\u00a8\7t\2\2\u00a8\u00a9\7g\2\2\u00a9\u00aa") + buf.write("\7c\2\2\u00aa\u00ab\7n\2\2\u00ab&\3\2\2\2\u00ac\u00ad") + buf.write("\7u\2\2\u00ad\u00ae\7v\2\2\u00ae\u00af\7t\2\2\u00af\u00b0") + buf.write("\7k\2\2\u00b0\u00b1\7p\2\2\u00b1\u00b2\7i\2\2\u00b2(\3") + buf.write("\2\2\2\u00b3\u00b4\7x\2\2\u00b4\u00b5\7c\2\2\u00b5\u00b6") + buf.write("\7t\2\2\u00b6*\3\2\2\2\u00b7\u00b8\7n\2\2\u00b8\u00b9") + buf.write("\7k\2\2\u00b9\u00ba\7u\2\2\u00ba\u00bb\7v\2\2\u00bb,\3") + buf.write("\2\2\2\u00bc\u00bd\7>\2\2\u00bd.\3\2\2\2\u00be\u00bf\7") + buf.write("@\2\2\u00bf\60\3\2\2\2\u00c0\u00c1\7o\2\2\u00c1\u00c2") + buf.write("\7q\2\2\u00c2\u00c3\7f\2\2\u00c3\u00c4\7g\2\2\u00c4\u00c5") + buf.write("\7n\2\2\u00c5\62\3\2\2\2\u00c6\u00c7\7u\2\2\u00c7\u00c8") + buf.write("\7v\2\2\u00c8\u00c9\7t\2\2\u00c9\u00ca\7w\2\2\u00ca\u00cb") + buf.write("\7e\2\2\u00cb\u00cc\7v\2\2\u00cc\64\3\2\2\2\u00cd\u00ce") + buf.write("\7g\2\2\u00ce\u00cf\7p\2\2\u00cf\u00d0\7w\2\2\u00d0\u00d1") + buf.write("\7o\2\2\u00d1\66\3\2\2\2\u00d2\u00d3\7h\2\2\u00d3\u00d4") + buf.write("\7n\2\2\u00d4\u00d5\7c\2\2\u00d5\u00d6\7i\2\2\u00d68\3") + buf.write("\2\2\2\u00d7\u00da\5;\36\2\u00d8\u00da\5=\37\2\u00d9\u00d7") + buf.write("\3\2\2\2\u00d9\u00d8\3\2\2\2\u00da:\3\2\2\2\u00db\u00e0") + buf.write("\7$\2\2\u00dc\u00df\5S*\2\u00dd\u00df\n\2\2\2\u00de\u00dc") + buf.write("\3\2\2\2\u00de\u00dd\3\2\2\2\u00df\u00e2\3\2\2\2\u00e0") + buf.write("\u00de\3\2\2\2\u00e0\u00e1\3\2\2\2\u00e1\u00e3\3\2\2\2") + buf.write("\u00e2\u00e0\3\2\2\2\u00e3\u00e4\7$\2\2\u00e4<\3\2\2\2") + buf.write("\u00e5\u00ea\7)\2\2\u00e6\u00e9\5S*\2\u00e7\u00e9\n\3") + buf.write("\2\2\u00e8\u00e6\3\2\2\2\u00e8\u00e7\3\2\2\2\u00e9\u00ec") + buf.write("\3\2\2\2\u00ea\u00e8\3\2\2\2\u00ea\u00eb\3\2\2\2\u00eb") + buf.write("\u00ed\3\2\2\2\u00ec\u00ea\3\2\2\2\u00ed\u00ee\7)\2\2") + buf.write("\u00ee>\3\2\2\2\u00ef\u00f3\7B\2\2\u00f0\u00f2\n\4\2\2") + buf.write("\u00f1\u00f0\3\2\2\2\u00f2\u00f5\3\2\2\2\u00f3\u00f1\3") + buf.write("\2\2\2\u00f3\u00f4\3\2\2\2\u00f4@\3\2\2\2\u00f5\u00f3") + buf.write("\3\2\2\2\u00f6\u00f8\t\5\2\2\u00f7\u00f6\3\2\2\2\u00f7") + buf.write("\u00f8\3\2\2\2\u00f8\u00fa\3\2\2\2\u00f9\u00fb\4\62;\2") + buf.write("\u00fa\u00f9\3\2\2\2\u00fb\u00fc\3\2\2\2\u00fc\u00fa\3") + buf.write("\2\2\2\u00fc\u00fd\3\2\2\2\u00fdB\3\2\2\2\u00fe\u00ff") + buf.write("\7\62\2\2\u00ff\u0100\7z\2\2\u0100\u0102\3\2\2\2\u0101") + buf.write("\u0103\t\6\2\2\u0102\u0101\3\2\2\2\u0103\u0104\3\2\2\2") + buf.write("\u0104\u0102\3\2\2\2\u0104\u0105\3\2\2\2\u0105D\3\2\2") + buf.write("\2\u0106\u0107\7B\2\2\u0107\u010b\t\7\2\2\u0108\u010a") + buf.write("\t\b\2\2\u0109\u0108\3\2\2\2\u010a\u010d\3\2\2\2\u010b") + buf.write("\u0109\3\2\2\2\u010b\u010c\3\2\2\2\u010cF\3\2\2\2\u010d") + buf.write("\u010b\3\2\2\2\u010e\u0112\t\7\2\2\u010f\u0111\t\b\2\2") + buf.write("\u0110\u010f\3\2\2\2\u0111\u0114\3\2\2\2\u0112\u0110\3") + buf.write("\2\2\2\u0112\u0113\3\2\2\2\u0113H\3\2\2\2\u0114\u0112") + buf.write("\3\2\2\2\u0115\u0116\t\t\2\2\u0116\u0117\7\60\2\2\u0117") + buf.write("\u0118\t\t\2\2\u0118J\3\2\2\2\u0119\u011a\7\61\2\2\u011a") + buf.write("\u011b\7,\2\2\u011b\u011c\7,\2\2\u011c\u0120\3\2\2\2\u011d") + buf.write("\u011f\13\2\2\2\u011e\u011d\3\2\2\2\u011f\u0122\3\2\2") + buf.write("\2\u0120\u0121\3\2\2\2\u0120\u011e\3\2\2\2\u0121\u0123") + buf.write("\3\2\2\2\u0122\u0120\3\2\2\2\u0123\u0124\7,\2\2\u0124") + buf.write("\u0125\7\61\2\2\u0125L\3\2\2\2\u0126\u0128\t\n\2\2\u0127") + buf.write("\u0126\3\2\2\2\u0128\u0129\3\2\2\2\u0129\u0127\3\2\2\2") + buf.write("\u0129\u012a\3\2\2\2\u012a\u012b\3\2\2\2\u012b\u012c\b") + buf.write("\'\2\2\u012cN\3\2\2\2\u012d\u012e\7\61\2\2\u012e\u012f") + buf.write("\7\61\2\2\u012f\u0133\3\2\2\2\u0130\u0132\n\4\2\2\u0131") + buf.write("\u0130\3\2\2\2\u0132\u0135\3\2\2\2\u0133\u0131\3\2\2\2") + buf.write("\u0133\u0134\3\2\2\2\u0134\u0136\3\2\2\2\u0135\u0133\3") + buf.write("\2\2\2\u0136\u0137\b(\2\2\u0137P\3\2\2\2\u0138\u0139\7") + buf.write("\61\2\2\u0139\u013a\7,\2\2\u013a\u013e\3\2\2\2\u013b\u013d") + buf.write("\13\2\2\2\u013c\u013b\3\2\2\2\u013d\u0140\3\2\2\2\u013e") + buf.write("\u013f\3\2\2\2\u013e\u013c\3\2\2\2\u013f\u0141\3\2\2\2") + buf.write("\u0140\u013e\3\2\2\2\u0141\u0142\7,\2\2\u0142\u0143\7") + buf.write("\61\2\2\u0143\u0144\3\2\2\2\u0144\u0145\b)\2\2\u0145R") + buf.write("\3\2\2\2\u0146\u0147\7^\2\2\u0147\u0148\t\13\2\2\u0148") + buf.write("T\3\2\2\2\22\2\u00d9\u00de\u00e0\u00e8\u00ea\u00f3\u00f7") + buf.write("\u00fc\u0104\u010b\u0112\u0120\u0129\u0133\u013e\3\b\2") buf.write("\2") return buf.getvalue() @@ -165,16 +184,19 @@ 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 + STRING = 28 + DOUBLE_STRING = 29 + SINGLE_STRING = 30 + TAGLINE = 31 + INTCONSTANT = 32 + HEXCONSTANT = 33 + TAGIDENTIFIER = 34 + IDENTIFIER = 35 + VERSION = 36 + DOCCOMMENT = 37 + WHITESPACE = 38 + COMMENT = 39 + MULTICOMM = 40 channelNames = [ u"DEFAULT_TOKEN_CHANNEL", u"HIDDEN" ] @@ -188,16 +210,18 @@ class TLexer(Lexer): "'flag'" ] symbolicNames = [ "", - "TAGLINE", "INTCONSTANT", "HEXCONSTANT", "TAGIDENTIFIER", "IDENTIFIER", - "VERSION", "DOCCOMMENT", "WHITESPACE", "COMMENT", "MULTICOMM" ] + "STRING", "DOUBLE_STRING", "SINGLE_STRING", "TAGLINE", "INTCONSTANT", + "HEXCONSTANT", "TAGIDENTIFIER", "IDENTIFIER", "VERSION", "DOCCOMMENT", + "WHITESPACE", "COMMENT", "MULTICOMM" ] ruleNames = [ "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "T__8", "T__9", "T__10", "T__11", "T__12", "T__13", "T__14", "T__15", "T__16", "T__17", "T__18", "T__19", "T__20", "T__21", "T__22", "T__23", "T__24", "T__25", - "T__26", "TAGLINE", "INTCONSTANT", "HEXCONSTANT", "TAGIDENTIFIER", - "IDENTIFIER", "VERSION", "DOCCOMMENT", "WHITESPACE", "COMMENT", - "MULTICOMM" ] + "T__26", "STRING", "DOUBLE_STRING", "SINGLE_STRING", "TAGLINE", + "INTCONSTANT", "HEXCONSTANT", "TAGIDENTIFIER", "IDENTIFIER", + "VERSION", "DOCCOMMENT", "WHITESPACE", "COMMENT", "MULTICOMM", + "ESC" ] grammarFileName = "T.g4" diff --git a/qface/idl/parser/TLexer.tokens b/qface/idl/parser/TLexer.tokens index 5362da5..84d36e7 100644 --- a/qface/idl/parser/TLexer.tokens +++ b/qface/idl/parser/TLexer.tokens @@ -25,16 +25,19 @@ 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 +STRING=28 +DOUBLE_STRING=29 +SINGLE_STRING=30 +TAGLINE=31 +INTCONSTANT=32 +HEXCONSTANT=33 +TAGIDENTIFIER=34 +IDENTIFIER=35 +VERSION=36 +DOCCOMMENT=37 +WHITESPACE=38 +COMMENT=39 +MULTICOMM=40 'import'=1 ';'=2 'module'=3 diff --git a/qface/idl/parser/TParser.py b/qface/idl/parser/TParser.py index fb6f055..b79f6d1 100644 --- a/qface/idl/parser/TParser.py +++ b/qface/idl/parser/TParser.py @@ -7,8 +7,8 @@ import sys def serializedATN(): with StringIO() as buf: - buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\'") - buf.write("\u0146\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") @@ -35,131 +35,133 @@ def serializedATN(): buf.write("\u00fa\13\26\3\26\3\26\3\26\3\26\7\26\u0100\n\26\f\26") buf.write("\16\26\u0103\13\26\3\26\3\26\5\26\u0107\n\26\3\27\5\27") buf.write("\u010a\n\27\3\27\7\27\u010d\n\27\f\27\16\27\u0110\13\27") - buf.write("\3\27\3\27\3\27\5\27\u0115\n\27\3\30\5\30\u0118\n\30\3") - buf.write("\30\7\30\u011b\n\30\f\30\16\30\u011e\13\30\3\30\3\30\3") - buf.write("\30\3\30\7\30\u0124\n\30\f\30\16\30\u0127\13\30\3\30\3") - buf.write("\30\5\30\u012b\n\30\3\31\3\31\5\31\u012f\n\31\3\32\5\32") - buf.write("\u0132\n\32\3\32\7\32\u0135\n\32\f\32\16\32\u0138\13\32") - buf.write("\3\32\3\32\3\32\5\32\u013d\n\32\3\32\5\32\u0140\n\32\3") - buf.write("\33\3\33\5\33\u0144\n\33\3\33\2\2\34\2\4\6\b\n\f\16\20") - buf.write("\22\24\26\30\32\34\36 \"$&(*,.\60\62\64\2\2\2\u0165\2") - buf.write("\66\3\2\2\2\4=\3\2\2\2\6D\3\2\2\2\bK\3\2\2\2\n\\\3\2\2") - buf.write("\2\f_\3\2\2\2\16{\3\2\2\2\20~\3\2\2\2\22\u0099\3\2\2\2") - buf.write("\24\u009c\3\2\2\2\26\u00b2\3\2\2\2\30\u00c8\3\2\2\2\32") - buf.write("\u00ca\3\2\2\2\34\u00cf\3\2\2\2\36\u00d1\3\2\2\2 \u00dd") - buf.write("\3\2\2\2\"\u00df\3\2\2\2$\u00e6\3\2\2\2&\u00e8\3\2\2\2") - buf.write("(\u00ed\3\2\2\2*\u00f3\3\2\2\2,\u0109\3\2\2\2.\u0117\3") - buf.write("\2\2\2\60\u012e\3\2\2\2\62\u0131\3\2\2\2\64\u0143\3\2") - buf.write("\2\2\66:\5\4\3\2\679\5\n\6\28\67\3\2\2\29<\3\2\2\2:8\3") - buf.write("\2\2\2:;\3\2\2\2;\3\3\2\2\2<:\3\2\2\2=A\5\b\5\2>@\5\6") - buf.write("\4\2?>\3\2\2\2@C\3\2\2\2A?\3\2\2\2AB\3\2\2\2B\5\3\2\2") - buf.write("\2CA\3\2\2\2DE\7\3\2\2EF\7\"\2\2FH\7#\2\2GI\7\4\2\2HG") - buf.write("\3\2\2\2HI\3\2\2\2I\7\3\2\2\2JL\7$\2\2KJ\3\2\2\2KL\3\2") - buf.write("\2\2LP\3\2\2\2MO\5\34\17\2NM\3\2\2\2OR\3\2\2\2PN\3\2\2") - buf.write("\2PQ\3\2\2\2QS\3\2\2\2RP\3\2\2\2ST\7\5\2\2TU\7\"\2\2U") - buf.write("W\7#\2\2VX\7\4\2\2WV\3\2\2\2WX\3\2\2\2X\t\3\2\2\2Y]\5") - buf.write("\f\7\2Z]\5*\26\2[]\5.\30\2\\Y\3\2\2\2\\Z\3\2\2\2\\[\3") - buf.write("\2\2\2]\13\3\2\2\2^`\7$\2\2_^\3\2\2\2_`\3\2\2\2`d\3\2") - buf.write("\2\2ac\5\34\17\2ba\3\2\2\2cf\3\2\2\2db\3\2\2\2de\3\2\2") - buf.write("\2eg\3\2\2\2fd\3\2\2\2gh\7\6\2\2hk\7\"\2\2ij\7\7\2\2j") - buf.write("l\7\"\2\2ki\3\2\2\2kl\3\2\2\2lm\3\2\2\2mq\7\b\2\2np\5") - buf.write("\16\b\2on\3\2\2\2ps\3\2\2\2qo\3\2\2\2qr\3\2\2\2rt\3\2") - buf.write("\2\2sq\3\2\2\2tv\7\t\2\2uw\7\4\2\2vu\3\2\2\2vw\3\2\2\2") - buf.write("w\r\3\2\2\2x|\5\20\t\2y|\5\26\f\2z|\5\24\13\2{x\3\2\2") - buf.write("\2{y\3\2\2\2{z\3\2\2\2|\17\3\2\2\2}\177\7$\2\2~}\3\2\2") - buf.write("\2~\177\3\2\2\2\177\u0083\3\2\2\2\u0080\u0082\5\34\17") - buf.write("\2\u0081\u0080\3\2\2\2\u0082\u0085\3\2\2\2\u0083\u0081") - buf.write("\3\2\2\2\u0083\u0084\3\2\2\2\u0084\u0088\3\2\2\2\u0085") - buf.write("\u0083\3\2\2\2\u0086\u0089\5 \21\2\u0087\u0089\7\n\2\2") - buf.write("\u0088\u0086\3\2\2\2\u0088\u0087\3\2\2\2\u0089\u008a\3") - buf.write("\2\2\2\u008a\u008b\7\"\2\2\u008b\u008f\7\13\2\2\u008c") - buf.write("\u008e\5\32\16\2\u008d\u008c\3\2\2\2\u008e\u0091\3\2\2") - buf.write("\2\u008f\u008d\3\2\2\2\u008f\u0090\3\2\2\2\u0090\u0092") - buf.write("\3\2\2\2\u0091\u008f\3\2\2\2\u0092\u0094\7\f\2\2\u0093") - buf.write("\u0095\5\22\n\2\u0094\u0093\3\2\2\2\u0094\u0095\3\2\2") - buf.write("\2\u0095\u0097\3\2\2\2\u0096\u0098\7\4\2\2\u0097\u0096") - buf.write("\3\2\2\2\u0097\u0098\3\2\2\2\u0098\21\3\2\2\2\u0099\u009a") - buf.write("\7\r\2\2\u009a\23\3\2\2\2\u009b\u009d\7$\2\2\u009c\u009b") - buf.write("\3\2\2\2\u009c\u009d\3\2\2\2\u009d\u00a1\3\2\2\2\u009e") - buf.write("\u00a0\5\34\17\2\u009f\u009e\3\2\2\2\u00a0\u00a3\3\2\2") - buf.write("\2\u00a1\u009f\3\2\2\2\u00a1\u00a2\3\2\2\2\u00a2\u00a4") - buf.write("\3\2\2\2\u00a3\u00a1\3\2\2\2\u00a4\u00a5\7\16\2\2\u00a5") - buf.write("\u00a6\7\"\2\2\u00a6\u00aa\7\13\2\2\u00a7\u00a9\5\32\16") - buf.write("\2\u00a8\u00a7\3\2\2\2\u00a9\u00ac\3\2\2\2\u00aa\u00a8") - buf.write("\3\2\2\2\u00aa\u00ab\3\2\2\2\u00ab\u00ad\3\2\2\2\u00ac") - buf.write("\u00aa\3\2\2\2\u00ad\u00af\7\f\2\2\u00ae\u00b0\7\4\2\2") - buf.write("\u00af\u00ae\3\2\2\2\u00af\u00b0\3\2\2\2\u00b0\25\3\2") - buf.write("\2\2\u00b1\u00b3\7$\2\2\u00b2\u00b1\3\2\2\2\u00b2\u00b3") - buf.write("\3\2\2\2\u00b3\u00b7\3\2\2\2\u00b4\u00b6\5\34\17\2\u00b5") - buf.write("\u00b4\3\2\2\2\u00b6\u00b9\3\2\2\2\u00b7\u00b5\3\2\2\2") - buf.write("\u00b7\u00b8\3\2\2\2\u00b8\u00bb\3\2\2\2\u00b9\u00b7\3") - buf.write("\2\2\2\u00ba\u00bc\5\30\r\2\u00bb\u00ba\3\2\2\2\u00bb") - buf.write("\u00bc\3\2\2\2\u00bc\u00bd\3\2\2\2\u00bd\u00be\5 \21\2") - buf.write("\u00be\u00c1\7\"\2\2\u00bf\u00c0\7\17\2\2\u00c0\u00c2") - buf.write("\7\"\2\2\u00c1\u00bf\3\2\2\2\u00c1\u00c2\3\2\2\2\u00c2") - buf.write("\u00c4\3\2\2\2\u00c3\u00c5\7\4\2\2\u00c4\u00c3\3\2\2\2") - buf.write("\u00c4\u00c5\3\2\2\2\u00c5\27\3\2\2\2\u00c6\u00c9\7\20") - buf.write("\2\2\u00c7\u00c9\7\r\2\2\u00c8\u00c6\3\2\2\2\u00c8\u00c7") - buf.write("\3\2\2\2\u00c9\31\3\2\2\2\u00ca\u00cb\5 \21\2\u00cb\u00cd") - buf.write("\7\"\2\2\u00cc\u00ce\7\21\2\2\u00cd\u00cc\3\2\2\2\u00cd") - buf.write("\u00ce\3\2\2\2\u00ce\33\3\2\2\2\u00cf\u00d0\7\36\2\2\u00d0") - buf.write("\35\3\2\2\2\u00d1\u00d4\7\"\2\2\u00d2\u00d3\7\17\2\2\u00d3") - buf.write("\u00d5\7\"\2\2\u00d4\u00d2\3\2\2\2\u00d4\u00d5\3\2\2\2") - buf.write("\u00d5\u00d7\3\2\2\2\u00d6\u00d8\7\21\2\2\u00d7\u00d6") - buf.write("\3\2\2\2\u00d7\u00d8\3\2\2\2\u00d8\37\3\2\2\2\u00d9\u00de") - buf.write("\5$\23\2\u00da\u00de\5\"\22\2\u00db\u00de\5&\24\2\u00dc") - buf.write("\u00de\5(\25\2\u00dd\u00d9\3\2\2\2\u00dd\u00da\3\2\2\2") - buf.write("\u00dd\u00db\3\2\2\2\u00dd\u00dc\3\2\2\2\u00de!\3\2\2") - buf.write("\2\u00df\u00e0\7\"\2\2\u00e0#\3\2\2\2\u00e1\u00e7\7\22") - buf.write("\2\2\u00e2\u00e7\7\23\2\2\u00e3\u00e7\7\24\2\2\u00e4\u00e7") - buf.write("\7\25\2\2\u00e5\u00e7\7\26\2\2\u00e6\u00e1\3\2\2\2\u00e6") - buf.write("\u00e2\3\2\2\2\u00e6\u00e3\3\2\2\2\u00e6\u00e4\3\2\2\2") - buf.write("\u00e6\u00e5\3\2\2\2\u00e7%\3\2\2\2\u00e8\u00e9\7\27\2") - buf.write("\2\u00e9\u00ea\7\30\2\2\u00ea\u00eb\5 \21\2\u00eb\u00ec") - buf.write("\7\31\2\2\u00ec\'\3\2\2\2\u00ed\u00ee\7\32\2\2\u00ee\u00ef") - buf.write("\7\30\2\2\u00ef\u00f0\5 \21\2\u00f0\u00f1\7\31\2\2\u00f1") - buf.write(")\3\2\2\2\u00f2\u00f4\7$\2\2\u00f3\u00f2\3\2\2\2\u00f3") - buf.write("\u00f4\3\2\2\2\u00f4\u00f8\3\2\2\2\u00f5\u00f7\5\34\17") - buf.write("\2\u00f6\u00f5\3\2\2\2\u00f7\u00fa\3\2\2\2\u00f8\u00f6") - buf.write("\3\2\2\2\u00f8\u00f9\3\2\2\2\u00f9\u00fb\3\2\2\2\u00fa") - buf.write("\u00f8\3\2\2\2\u00fb\u00fc\7\33\2\2\u00fc\u00fd\7\"\2") - buf.write("\2\u00fd\u0101\7\b\2\2\u00fe\u0100\5,\27\2\u00ff\u00fe") - buf.write("\3\2\2\2\u0100\u0103\3\2\2\2\u0101\u00ff\3\2\2\2\u0101") - buf.write("\u0102\3\2\2\2\u0102\u0104\3\2\2\2\u0103\u0101\3\2\2\2") - buf.write("\u0104\u0106\7\t\2\2\u0105\u0107\7\4\2\2\u0106\u0105\3") - buf.write("\2\2\2\u0106\u0107\3\2\2\2\u0107+\3\2\2\2\u0108\u010a") - buf.write("\7$\2\2\u0109\u0108\3\2\2\2\u0109\u010a\3\2\2\2\u010a") - buf.write("\u010e\3\2\2\2\u010b\u010d\5\34\17\2\u010c\u010b\3\2\2") - buf.write("\2\u010d\u0110\3\2\2\2\u010e\u010c\3\2\2\2\u010e\u010f") - buf.write("\3\2\2\2\u010f\u0111\3\2\2\2\u0110\u010e\3\2\2\2\u0111") - buf.write("\u0112\5 \21\2\u0112\u0114\7\"\2\2\u0113\u0115\7\4\2\2") - buf.write("\u0114\u0113\3\2\2\2\u0114\u0115\3\2\2\2\u0115-\3\2\2") - buf.write("\2\u0116\u0118\7$\2\2\u0117\u0116\3\2\2\2\u0117\u0118") - buf.write("\3\2\2\2\u0118\u011c\3\2\2\2\u0119\u011b\5\34\17\2\u011a") - buf.write("\u0119\3\2\2\2\u011b\u011e\3\2\2\2\u011c\u011a\3\2\2\2") - buf.write("\u011c\u011d\3\2\2\2\u011d\u011f\3\2\2\2\u011e\u011c\3") - buf.write("\2\2\2\u011f\u0120\5\60\31\2\u0120\u0121\7\"\2\2\u0121") - buf.write("\u0125\7\b\2\2\u0122\u0124\5\62\32\2\u0123\u0122\3\2\2") - buf.write("\2\u0124\u0127\3\2\2\2\u0125\u0123\3\2\2\2\u0125\u0126") - buf.write("\3\2\2\2\u0126\u0128\3\2\2\2\u0127\u0125\3\2\2\2\u0128") - buf.write("\u012a\7\t\2\2\u0129\u012b\7\4\2\2\u012a\u0129\3\2\2\2") - buf.write("\u012a\u012b\3\2\2\2\u012b/\3\2\2\2\u012c\u012f\7\34\2") - buf.write("\2\u012d\u012f\7\35\2\2\u012e\u012c\3\2\2\2\u012e\u012d") - buf.write("\3\2\2\2\u012f\61\3\2\2\2\u0130\u0132\7$\2\2\u0131\u0130") - buf.write("\3\2\2\2\u0131\u0132\3\2\2\2\u0132\u0136\3\2\2\2\u0133") - buf.write("\u0135\5\34\17\2\u0134\u0133\3\2\2\2\u0135\u0138\3\2\2") - buf.write("\2\u0136\u0134\3\2\2\2\u0136\u0137\3\2\2\2\u0137\u0139") - buf.write("\3\2\2\2\u0138\u0136\3\2\2\2\u0139\u013c\7\"\2\2\u013a") - buf.write("\u013b\7\17\2\2\u013b\u013d\5\64\33\2\u013c\u013a\3\2") - buf.write("\2\2\u013c\u013d\3\2\2\2\u013d\u013f\3\2\2\2\u013e\u0140") - buf.write("\7\21\2\2\u013f\u013e\3\2\2\2\u013f\u0140\3\2\2\2\u0140") - buf.write("\63\3\2\2\2\u0141\u0144\7\37\2\2\u0142\u0144\7 \2\2\u0143") - buf.write("\u0141\3\2\2\2\u0143\u0142\3\2\2\2\u0144\65\3\2\2\2\65") - buf.write(":AHKPW\\_dkqv{~\u0083\u0088\u008f\u0094\u0097\u009c\u00a1") - buf.write("\u00aa\u00af\u00b2\u00b7\u00bb\u00c1\u00c4\u00c8\u00cd") - buf.write("\u00d4\u00d7\u00dd\u00e6\u00f3\u00f8\u0101\u0106\u0109") - buf.write("\u010e\u0114\u0117\u011c\u0125\u012a\u012e\u0131\u0136") - buf.write("\u013c\u013f\u0143") + buf.write("\3\27\3\27\3\27\3\27\5\27\u0116\n\27\3\27\5\27\u0119\n") + buf.write("\27\3\30\5\30\u011c\n\30\3\30\7\30\u011f\n\30\f\30\16") + buf.write("\30\u0122\13\30\3\30\3\30\3\30\3\30\7\30\u0128\n\30\f") + buf.write("\30\16\30\u012b\13\30\3\30\3\30\5\30\u012f\n\30\3\31\3") + buf.write("\31\5\31\u0133\n\31\3\32\5\32\u0136\n\32\3\32\7\32\u0139") + buf.write("\n\32\f\32\16\32\u013c\13\32\3\32\3\32\3\32\5\32\u0141") + buf.write("\n\32\3\32\5\32\u0144\n\32\3\33\3\33\5\33\u0148\n\33\3") + buf.write("\33\2\2\34\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \"$") + buf.write("&(*,.\60\62\64\2\2\2\u016a\2\66\3\2\2\2\4=\3\2\2\2\6D") + buf.write("\3\2\2\2\bK\3\2\2\2\n\\\3\2\2\2\f_\3\2\2\2\16{\3\2\2\2") + buf.write("\20~\3\2\2\2\22\u0099\3\2\2\2\24\u009c\3\2\2\2\26\u00b2") + buf.write("\3\2\2\2\30\u00c8\3\2\2\2\32\u00ca\3\2\2\2\34\u00cf\3") + buf.write("\2\2\2\36\u00d1\3\2\2\2 \u00dd\3\2\2\2\"\u00df\3\2\2\2") + buf.write("$\u00e6\3\2\2\2&\u00e8\3\2\2\2(\u00ed\3\2\2\2*\u00f3\3") + buf.write("\2\2\2,\u0109\3\2\2\2.\u011b\3\2\2\2\60\u0132\3\2\2\2") + buf.write("\62\u0135\3\2\2\2\64\u0147\3\2\2\2\66:\5\4\3\2\679\5\n") + buf.write("\6\28\67\3\2\2\29<\3\2\2\2:8\3\2\2\2:;\3\2\2\2;\3\3\2") + buf.write("\2\2<:\3\2\2\2=A\5\b\5\2>@\5\6\4\2?>\3\2\2\2@C\3\2\2\2") + buf.write("A?\3\2\2\2AB\3\2\2\2B\5\3\2\2\2CA\3\2\2\2DE\7\3\2\2EF") + buf.write("\7%\2\2FH\7&\2\2GI\7\4\2\2HG\3\2\2\2HI\3\2\2\2I\7\3\2") + buf.write("\2\2JL\7\'\2\2KJ\3\2\2\2KL\3\2\2\2LP\3\2\2\2MO\5\34\17") + buf.write("\2NM\3\2\2\2OR\3\2\2\2PN\3\2\2\2PQ\3\2\2\2QS\3\2\2\2R") + buf.write("P\3\2\2\2ST\7\5\2\2TU\7%\2\2UW\7&\2\2VX\7\4\2\2WV\3\2") + buf.write("\2\2WX\3\2\2\2X\t\3\2\2\2Y]\5\f\7\2Z]\5*\26\2[]\5.\30") + buf.write("\2\\Y\3\2\2\2\\Z\3\2\2\2\\[\3\2\2\2]\13\3\2\2\2^`\7\'") + buf.write("\2\2_^\3\2\2\2_`\3\2\2\2`d\3\2\2\2ac\5\34\17\2ba\3\2\2") + buf.write("\2cf\3\2\2\2db\3\2\2\2de\3\2\2\2eg\3\2\2\2fd\3\2\2\2g") + buf.write("h\7\6\2\2hk\7%\2\2ij\7\7\2\2jl\7%\2\2ki\3\2\2\2kl\3\2") + buf.write("\2\2lm\3\2\2\2mq\7\b\2\2np\5\16\b\2on\3\2\2\2ps\3\2\2") + buf.write("\2qo\3\2\2\2qr\3\2\2\2rt\3\2\2\2sq\3\2\2\2tv\7\t\2\2u") + buf.write("w\7\4\2\2vu\3\2\2\2vw\3\2\2\2w\r\3\2\2\2x|\5\20\t\2y|") + buf.write("\5\26\f\2z|\5\24\13\2{x\3\2\2\2{y\3\2\2\2{z\3\2\2\2|\17") + buf.write("\3\2\2\2}\177\7\'\2\2~}\3\2\2\2~\177\3\2\2\2\177\u0083") + buf.write("\3\2\2\2\u0080\u0082\5\34\17\2\u0081\u0080\3\2\2\2\u0082") + buf.write("\u0085\3\2\2\2\u0083\u0081\3\2\2\2\u0083\u0084\3\2\2\2") + buf.write("\u0084\u0088\3\2\2\2\u0085\u0083\3\2\2\2\u0086\u0089\5") + buf.write(" \21\2\u0087\u0089\7\n\2\2\u0088\u0086\3\2\2\2\u0088\u0087") + buf.write("\3\2\2\2\u0089\u008a\3\2\2\2\u008a\u008b\7%\2\2\u008b") + buf.write("\u008f\7\13\2\2\u008c\u008e\5\32\16\2\u008d\u008c\3\2") + buf.write("\2\2\u008e\u0091\3\2\2\2\u008f\u008d\3\2\2\2\u008f\u0090") + buf.write("\3\2\2\2\u0090\u0092\3\2\2\2\u0091\u008f\3\2\2\2\u0092") + buf.write("\u0094\7\f\2\2\u0093\u0095\5\22\n\2\u0094\u0093\3\2\2") + buf.write("\2\u0094\u0095\3\2\2\2\u0095\u0097\3\2\2\2\u0096\u0098") + buf.write("\7\4\2\2\u0097\u0096\3\2\2\2\u0097\u0098\3\2\2\2\u0098") + buf.write("\21\3\2\2\2\u0099\u009a\7\r\2\2\u009a\23\3\2\2\2\u009b") + buf.write("\u009d\7\'\2\2\u009c\u009b\3\2\2\2\u009c\u009d\3\2\2\2") + buf.write("\u009d\u00a1\3\2\2\2\u009e\u00a0\5\34\17\2\u009f\u009e") + buf.write("\3\2\2\2\u00a0\u00a3\3\2\2\2\u00a1\u009f\3\2\2\2\u00a1") + buf.write("\u00a2\3\2\2\2\u00a2\u00a4\3\2\2\2\u00a3\u00a1\3\2\2\2") + buf.write("\u00a4\u00a5\7\16\2\2\u00a5\u00a6\7%\2\2\u00a6\u00aa\7") + buf.write("\13\2\2\u00a7\u00a9\5\32\16\2\u00a8\u00a7\3\2\2\2\u00a9") + buf.write("\u00ac\3\2\2\2\u00aa\u00a8\3\2\2\2\u00aa\u00ab\3\2\2\2") + buf.write("\u00ab\u00ad\3\2\2\2\u00ac\u00aa\3\2\2\2\u00ad\u00af\7") + buf.write("\f\2\2\u00ae\u00b0\7\4\2\2\u00af\u00ae\3\2\2\2\u00af\u00b0") + buf.write("\3\2\2\2\u00b0\25\3\2\2\2\u00b1\u00b3\7\'\2\2\u00b2\u00b1") + buf.write("\3\2\2\2\u00b2\u00b3\3\2\2\2\u00b3\u00b7\3\2\2\2\u00b4") + buf.write("\u00b6\5\34\17\2\u00b5\u00b4\3\2\2\2\u00b6\u00b9\3\2\2") + buf.write("\2\u00b7\u00b5\3\2\2\2\u00b7\u00b8\3\2\2\2\u00b8\u00bb") + buf.write("\3\2\2\2\u00b9\u00b7\3\2\2\2\u00ba\u00bc\5\30\r\2\u00bb") + buf.write("\u00ba\3\2\2\2\u00bb\u00bc\3\2\2\2\u00bc\u00bd\3\2\2\2") + buf.write("\u00bd\u00be\5 \21\2\u00be\u00c1\7%\2\2\u00bf\u00c0\7") + buf.write("\17\2\2\u00c0\u00c2\7\36\2\2\u00c1\u00bf\3\2\2\2\u00c1") + buf.write("\u00c2\3\2\2\2\u00c2\u00c4\3\2\2\2\u00c3\u00c5\7\4\2\2") + buf.write("\u00c4\u00c3\3\2\2\2\u00c4\u00c5\3\2\2\2\u00c5\27\3\2") + buf.write("\2\2\u00c6\u00c9\7\20\2\2\u00c7\u00c9\7\r\2\2\u00c8\u00c6") + buf.write("\3\2\2\2\u00c8\u00c7\3\2\2\2\u00c9\31\3\2\2\2\u00ca\u00cb") + buf.write("\5 \21\2\u00cb\u00cd\7%\2\2\u00cc\u00ce\7\21\2\2\u00cd") + buf.write("\u00cc\3\2\2\2\u00cd\u00ce\3\2\2\2\u00ce\33\3\2\2\2\u00cf") + buf.write("\u00d0\7!\2\2\u00d0\35\3\2\2\2\u00d1\u00d4\7%\2\2\u00d2") + buf.write("\u00d3\7\17\2\2\u00d3\u00d5\7%\2\2\u00d4\u00d2\3\2\2\2") + buf.write("\u00d4\u00d5\3\2\2\2\u00d5\u00d7\3\2\2\2\u00d6\u00d8\7") + buf.write("\21\2\2\u00d7\u00d6\3\2\2\2\u00d7\u00d8\3\2\2\2\u00d8") + buf.write("\37\3\2\2\2\u00d9\u00de\5$\23\2\u00da\u00de\5\"\22\2\u00db") + buf.write("\u00de\5&\24\2\u00dc\u00de\5(\25\2\u00dd\u00d9\3\2\2\2") + buf.write("\u00dd\u00da\3\2\2\2\u00dd\u00db\3\2\2\2\u00dd\u00dc\3") + buf.write("\2\2\2\u00de!\3\2\2\2\u00df\u00e0\7%\2\2\u00e0#\3\2\2") + buf.write("\2\u00e1\u00e7\7\22\2\2\u00e2\u00e7\7\23\2\2\u00e3\u00e7") + buf.write("\7\24\2\2\u00e4\u00e7\7\25\2\2\u00e5\u00e7\7\26\2\2\u00e6") + buf.write("\u00e1\3\2\2\2\u00e6\u00e2\3\2\2\2\u00e6\u00e3\3\2\2\2") + buf.write("\u00e6\u00e4\3\2\2\2\u00e6\u00e5\3\2\2\2\u00e7%\3\2\2") + buf.write("\2\u00e8\u00e9\7\27\2\2\u00e9\u00ea\7\30\2\2\u00ea\u00eb") + buf.write("\5 \21\2\u00eb\u00ec\7\31\2\2\u00ec\'\3\2\2\2\u00ed\u00ee") + buf.write("\7\32\2\2\u00ee\u00ef\7\30\2\2\u00ef\u00f0\5 \21\2\u00f0") + buf.write("\u00f1\7\31\2\2\u00f1)\3\2\2\2\u00f2\u00f4\7\'\2\2\u00f3") + buf.write("\u00f2\3\2\2\2\u00f3\u00f4\3\2\2\2\u00f4\u00f8\3\2\2\2") + buf.write("\u00f5\u00f7\5\34\17\2\u00f6\u00f5\3\2\2\2\u00f7\u00fa") + buf.write("\3\2\2\2\u00f8\u00f6\3\2\2\2\u00f8\u00f9\3\2\2\2\u00f9") + buf.write("\u00fb\3\2\2\2\u00fa\u00f8\3\2\2\2\u00fb\u00fc\7\33\2") + buf.write("\2\u00fc\u00fd\7%\2\2\u00fd\u0101\7\b\2\2\u00fe\u0100") + buf.write("\5,\27\2\u00ff\u00fe\3\2\2\2\u0100\u0103\3\2\2\2\u0101") + buf.write("\u00ff\3\2\2\2\u0101\u0102\3\2\2\2\u0102\u0104\3\2\2\2") + buf.write("\u0103\u0101\3\2\2\2\u0104\u0106\7\t\2\2\u0105\u0107\7") + buf.write("\4\2\2\u0106\u0105\3\2\2\2\u0106\u0107\3\2\2\2\u0107+") + buf.write("\3\2\2\2\u0108\u010a\7\'\2\2\u0109\u0108\3\2\2\2\u0109") + buf.write("\u010a\3\2\2\2\u010a\u010e\3\2\2\2\u010b\u010d\5\34\17") + buf.write("\2\u010c\u010b\3\2\2\2\u010d\u0110\3\2\2\2\u010e\u010c") + buf.write("\3\2\2\2\u010e\u010f\3\2\2\2\u010f\u0111\3\2\2\2\u0110") + buf.write("\u010e\3\2\2\2\u0111\u0112\5 \21\2\u0112\u0115\7%\2\2") + buf.write("\u0113\u0114\7\17\2\2\u0114\u0116\7\36\2\2\u0115\u0113") + buf.write("\3\2\2\2\u0115\u0116\3\2\2\2\u0116\u0118\3\2\2\2\u0117") + buf.write("\u0119\7\4\2\2\u0118\u0117\3\2\2\2\u0118\u0119\3\2\2\2") + buf.write("\u0119-\3\2\2\2\u011a\u011c\7\'\2\2\u011b\u011a\3\2\2") + buf.write("\2\u011b\u011c\3\2\2\2\u011c\u0120\3\2\2\2\u011d\u011f") + buf.write("\5\34\17\2\u011e\u011d\3\2\2\2\u011f\u0122\3\2\2\2\u0120") + buf.write("\u011e\3\2\2\2\u0120\u0121\3\2\2\2\u0121\u0123\3\2\2\2") + buf.write("\u0122\u0120\3\2\2\2\u0123\u0124\5\60\31\2\u0124\u0125") + buf.write("\7%\2\2\u0125\u0129\7\b\2\2\u0126\u0128\5\62\32\2\u0127") + buf.write("\u0126\3\2\2\2\u0128\u012b\3\2\2\2\u0129\u0127\3\2\2\2") + buf.write("\u0129\u012a\3\2\2\2\u012a\u012c\3\2\2\2\u012b\u0129\3") + buf.write("\2\2\2\u012c\u012e\7\t\2\2\u012d\u012f\7\4\2\2\u012e\u012d") + buf.write("\3\2\2\2\u012e\u012f\3\2\2\2\u012f/\3\2\2\2\u0130\u0133") + buf.write("\7\34\2\2\u0131\u0133\7\35\2\2\u0132\u0130\3\2\2\2\u0132") + buf.write("\u0131\3\2\2\2\u0133\61\3\2\2\2\u0134\u0136\7\'\2\2\u0135") + buf.write("\u0134\3\2\2\2\u0135\u0136\3\2\2\2\u0136\u013a\3\2\2\2") + buf.write("\u0137\u0139\5\34\17\2\u0138\u0137\3\2\2\2\u0139\u013c") + buf.write("\3\2\2\2\u013a\u0138\3\2\2\2\u013a\u013b\3\2\2\2\u013b") + buf.write("\u013d\3\2\2\2\u013c\u013a\3\2\2\2\u013d\u0140\7%\2\2") + buf.write("\u013e\u013f\7\17\2\2\u013f\u0141\5\64\33\2\u0140\u013e") + buf.write("\3\2\2\2\u0140\u0141\3\2\2\2\u0141\u0143\3\2\2\2\u0142") + buf.write("\u0144\7\21\2\2\u0143\u0142\3\2\2\2\u0143\u0144\3\2\2") + buf.write("\2\u0144\63\3\2\2\2\u0145\u0148\7\"\2\2\u0146\u0148\7") + buf.write("#\2\2\u0147\u0145\3\2\2\2\u0147\u0146\3\2\2\2\u0148\65") + buf.write("\3\2\2\2\66:AHKPW\\_dkqv{~\u0083\u0088\u008f\u0094\u0097") + buf.write("\u009c\u00a1\u00aa\u00af\u00b2\u00b7\u00bb\u00c1\u00c4") + buf.write("\u00c8\u00cd\u00d4\u00d7\u00dd\u00e6\u00f3\u00f8\u0101") + buf.write("\u0106\u0109\u010e\u0115\u0118\u011b\u0120\u0129\u012e") + buf.write("\u0132\u0135\u013a\u0140\u0143\u0147") return buf.getvalue() @@ -186,9 +188,10 @@ class TParser ( Parser ): "", "", "", "", "", "", "", "", "", "", "", "", - "TAGLINE", "INTCONSTANT", "HEXCONSTANT", "TAGIDENTIFIER", - "IDENTIFIER", "VERSION", "DOCCOMMENT", "WHITESPACE", - "COMMENT", "MULTICOMM" ] + "STRING", "DOUBLE_STRING", "SINGLE_STRING", "TAGLINE", + "INTCONSTANT", "HEXCONSTANT", "TAGIDENTIFIER", "IDENTIFIER", + "VERSION", "DOCCOMMENT", "WHITESPACE", "COMMENT", + "MULTICOMM" ] RULE_documentSymbol = 0 RULE_headerSymbol = 1 @@ -254,16 +257,19 @@ 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 + STRING=28 + DOUBLE_STRING=29 + SINGLE_STRING=30 + TAGLINE=31 + INTCONSTANT=32 + HEXCONSTANT=33 + TAGIDENTIFIER=34 + IDENTIFIER=35 + VERSION=36 + DOCCOMMENT=37 + WHITESPACE=38 + COMMENT=39 + MULTICOMM=40 def __init__(self, input:TokenStream, output:TextIO = sys.stdout): super().__init__(input, output) @@ -1122,11 +1128,8 @@ class TParser ( Parser ): return self.getTypedRuleContext(TParser.TypeSymbolContext,0) - def IDENTIFIER(self, i:int=None): - if i is None: - return self.getTokens(TParser.IDENTIFIER) - else: - return self.getToken(TParser.IDENTIFIER, i) + def IDENTIFIER(self): + return self.getToken(TParser.IDENTIFIER, 0) def tagSymbol(self, i:int=None): if i is None: @@ -1142,6 +1145,9 @@ class TParser ( Parser ): def DOCCOMMENT(self): return self.getToken(TParser.DOCCOMMENT, 0) + def STRING(self): + return self.getToken(TParser.STRING, 0) + def getRuleIndex(self): return TParser.RULE_propertySymbol @@ -1206,7 +1212,7 @@ class TParser ( Parser ): self.state = 189 self.match(TParser.T__12) self.state = 190 - localctx.value = self.match(TParser.IDENTIFIER) + localctx.value = self.match(TParser.STRING) self.state = 194 @@ -1878,6 +1884,7 @@ class TParser ( Parser ): self.parser = parser self.comment = None # Token self.name = None # Token + self.value = None # Token def typeSymbol(self): return self.getTypedRuleContext(TParser.TypeSymbolContext,0) @@ -1896,6 +1903,9 @@ class TParser ( Parser ): def DOCCOMMENT(self): return self.getToken(TParser.DOCCOMMENT, 0) + def STRING(self): + return self.getToken(TParser.STRING, 0) + def getRuleIndex(self): return TParser.RULE_structFieldSymbol @@ -1945,11 +1955,21 @@ class TParser ( Parser ): self.typeSymbol() self.state = 272 localctx.name = self.match(TParser.IDENTIFIER) - self.state = 274 + self.state = 275 self._errHandler.sync(self) _la = self._input.LA(1) - if _la==TParser.T__1: + if _la==TParser.T__12: self.state = 273 + self.match(TParser.T__12) + self.state = 274 + localctx.value = self.match(TParser.STRING) + + + self.state = 278 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la==TParser.T__1: + self.state = 277 self.match(TParser.T__1) @@ -2020,47 +2040,47 @@ class TParser ( Parser ): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 277 + self.state = 281 self._errHandler.sync(self) _la = self._input.LA(1) if _la==TParser.DOCCOMMENT: - self.state = 276 + self.state = 280 localctx.comment = self.match(TParser.DOCCOMMENT) - self.state = 282 + self.state = 286 self._errHandler.sync(self) _la = self._input.LA(1) while _la==TParser.TAGLINE: - self.state = 279 + self.state = 283 self.tagSymbol() - self.state = 284 + self.state = 288 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 285 + self.state = 289 self.enumTypeSymbol() - self.state = 286 + self.state = 290 localctx.name = self.match(TParser.IDENTIFIER) - self.state = 287 - self.match(TParser.T__5) self.state = 291 + self.match(TParser.T__5) + 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 = 288 + self.state = 292 self.enumMemberSymbol() - self.state = 293 + self.state = 297 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 294 + self.state = 298 self.match(TParser.T__6) - self.state = 296 + self.state = 300 self._errHandler.sync(self) _la = self._input.LA(1) if _la==TParser.T__1: - self.state = 295 + self.state = 299 self.match(TParser.T__1) @@ -2106,17 +2126,17 @@ class TParser ( Parser ): localctx = TParser.EnumTypeSymbolContext(self, self._ctx, self.state) self.enterRule(localctx, 46, self.RULE_enumTypeSymbol) try: - self.state = 300 + self.state = 304 self._errHandler.sync(self) token = self._input.LA(1) if token in [TParser.T__25]: self.enterOuterAlt(localctx, 1) - self.state = 298 + self.state = 302 localctx.isEnum = self.match(TParser.T__25) pass elif token in [TParser.T__26]: self.enterOuterAlt(localctx, 2) - self.state = 299 + self.state = 303 localctx.isFlag = self.match(TParser.T__26) pass else: @@ -2182,41 +2202,41 @@ class TParser ( Parser ): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 303 + self.state = 307 self._errHandler.sync(self) _la = self._input.LA(1) if _la==TParser.DOCCOMMENT: - self.state = 302 + self.state = 306 localctx.comment = self.match(TParser.DOCCOMMENT) - self.state = 308 + self.state = 312 self._errHandler.sync(self) _la = self._input.LA(1) while _la==TParser.TAGLINE: - self.state = 305 + self.state = 309 self.tagSymbol() - self.state = 310 + self.state = 314 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 311 + self.state = 315 localctx.name = self.match(TParser.IDENTIFIER) - self.state = 314 + self.state = 318 self._errHandler.sync(self) _la = self._input.LA(1) if _la==TParser.T__12: - self.state = 312 + self.state = 316 self.match(TParser.T__12) - self.state = 313 + self.state = 317 self.intSymbol() - self.state = 317 + self.state = 321 self._errHandler.sync(self) _la = self._input.LA(1) if _la==TParser.T__14: - self.state = 316 + self.state = 320 self.match(TParser.T__14) @@ -2266,17 +2286,17 @@ class TParser ( Parser ): localctx = TParser.IntSymbolContext(self, self._ctx, self.state) self.enterRule(localctx, 50, self.RULE_intSymbol) try: - self.state = 321 + self.state = 325 self._errHandler.sync(self) token = self._input.LA(1) if token in [TParser.INTCONSTANT]: self.enterOuterAlt(localctx, 1) - self.state = 319 + self.state = 323 localctx.value = self.match(TParser.INTCONSTANT) pass elif token in [TParser.HEXCONSTANT]: self.enterOuterAlt(localctx, 2) - self.state = 320 + self.state = 324 localctx.value = self.match(TParser.HEXCONSTANT) pass else: diff --git a/tests/in/com.pelagicore.test.qface b/tests/in/com.pelagicore.test.qface index ae8a4f0..a5be518 100644 --- a/tests/in/com.pelagicore.test.qface +++ b/tests/in/com.pelagicore.test.qface @@ -2,13 +2,12 @@ module com.pelagicore.test 1.0; import common 1.0; -@service: { singleton: true} interface ContactService { State state; - int intValue; - readonly string stringValue; - bool boolValue; - real realValue; + int intValue = "2"; + readonly string stringValue = "hello"; + bool boolValue = "true"; + real realValue = "0.1"; var varValue; Contact currentContact; common.Date today; @@ -39,7 +38,7 @@ flag Phase { * The contact information */ struct Contact { - string name; - int age; - bool isMarried; + string name = "name"; + int age = "99"; + bool isMarried = "false"; } diff --git a/tests/in/values.qface b/tests/in/values.qface index 9992de0..3b7035d 100644 --- a/tests/in/values.qface +++ b/tests/in/values.qface @@ -1,17 +1,13 @@ module values 1.0 interface Namespace { - @value: 99 - int intValue - @value: 0.99 - real realValue - @value: "foo" - string message - @value: { name: "Hello", age: 101 }; - Person person + int intValue = "99" + real realValue = "0.99" + string message = "foo" + Person person = '{ name: "Hello", age: 101 }' } struct Person { - string name; - int age; + string name = "hello"; + int age = "99"; } \ No newline at end of file diff --git a/tests/test_parser.py b/tests/test_parser.py index f6bcedb..f2144d9 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -207,3 +207,11 @@ def test_parser_exceptions(): system = FileSystem.parse_document('not-exists') +def test_default_values(): + system = load_test() + interface = system.lookup('com.pelagicore.test.ContactService') + symbol = system.lookup('com.pelagicore.test.ContactService#intValue') + assert symbol.value == "2" + symbol = system.lookup('com.pelagicore.test.ContactService#realValue') + assert symbol.value == "0.1" + diff --git a/tests/test_values.py b/tests/test_values.py index a2f8c19..9ce93d1 100644 --- a/tests/test_values.py +++ b/tests/test_values.py @@ -10,7 +10,6 @@ logging.basicConfig() log = logging.getLogger(__name__) inputPath = Path('tests/in') -log.debug('input path folder: {0}'.format(inputPath.abspath())) def loadValues(): @@ -20,7 +19,18 @@ def loadValues(): def test_values(): system = loadValues() + assert system # lookup module interface = system.lookup('values.Namespace') assert interface + properties = interface._propertyMap + assert properties['intValue'].value == "99" + assert properties['realValue'].value == "0.99" + assert properties['message'].value == "foo" + assert properties['person'].value == '{ name: "Hello", age: 101 }' + struct = system.lookup('values.Person') + assert struct + fields = struct._fieldMap + assert fields["name"].value == "hello" + assert fields["age"].value == "99" -- cgit v1.2.1 From 8d6244e8ee133f9c8cec9ee01bab0f81dfb619d6 Mon Sep 17 00:00:00 2001 From: Juergen Bocklage-Ryannel Date: Thu, 8 Mar 2018 20:42:10 +0100 Subject: clean up of value parsing --- qface/idl/listener.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/qface/idl/listener.py b/qface/idl/listener.py index e343a3c..0692322 100644 --- a/qface/idl/listener.py +++ b/qface/idl/listener.py @@ -23,6 +23,10 @@ log = logging.getLogger(__name__) contextMap = {} +def escape_decode(s): + """removes \-escapes from str""" + return codecs.decode(bytes(s, 'utf-8'), 'unicode_escape') + class QFaceListener(TListener): def __init__(self, system, profile=EProfile.FULL): super().__init__() @@ -110,6 +114,10 @@ class DomainListener(QFaceListener): except yaml.YAMLError as exc: click.secho(str(exc), fg='red') + def parse_value(self, ctx, symbol): + if ctx.value: + symbol.value = escape_decode(ctx.value.text[1:-1]) + def enterEveryRule(self, ctx): log.debug('enter ' + ctx.__class__.__name__) @@ -215,18 +223,10 @@ class DomainListener(QFaceListener): 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) + self.parse_value(ctx, self.property) contextMap[ctx] = self.property - if ctx.value: - self.property.value = codecs.decode(bytes(ctx.value.text[1:-1], 'utf-8'), 'unicode_escape') def exitPropertySymbol(self, ctx: TParser.PropertySymbolContext): self.property = None @@ -236,8 +236,7 @@ class DomainListener(QFaceListener): name = ctx.name.text self.field = Field(name, self.struct) self.parse_annotations(ctx, self.field) - if ctx.value: - self.field.value = codecs.decode(bytes(ctx.value.text[1:-1], 'utf-8'), 'unicode_escape') + self.parse_value(ctx, self.field) contextMap[ctx] = self.field def exitStructFieldSymbol(self, ctx: TParser.StructFieldSymbolContext): -- cgit v1.2.1 From 1b4d8f528b03013ec7ea89d3746e9d2eccd4e3e6 Mon Sep 17 00:00:00 2001 From: Juergen Bocklage-Ryannel Date: Thu, 8 Mar 2018 20:45:21 +0100 Subject: added default values feature to profile --- qface/idl/listener.py | 1 + qface/idl/profile.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/qface/idl/listener.py b/qface/idl/listener.py index 0692322..2d8bfb6 100644 --- a/qface/idl/listener.py +++ b/qface/idl/listener.py @@ -115,6 +115,7 @@ class DomainListener(QFaceListener): click.secho(str(exc), fg='red') def parse_value(self, ctx, symbol): + self.check_support(EFeature.DEFAULT_VALUES) if ctx.value: symbol.value = escape_decode(ctx.value.text[1:-1]) diff --git a/qface/idl/profile.py b/qface/idl/profile.py index b75aecc..2dd4b23 100644 --- a/qface/idl/profile.py +++ b/qface/idl/profile.py @@ -21,6 +21,7 @@ class EFeature(Enum): EXTEND_INTERFACE = 'extend_interface' IMPORT = 'import' MAPS = 'maps' + DEFAULT_VALUES = 'default_values' class EProfile(Enum): @@ -34,7 +35,8 @@ _profiles = { EProfile.ADVANCED: set([ EFeature.EXTEND_INTERFACE, EFeature.IMPORT, - EFeature.MAPS + EFeature.MAPS, + EFeature.DEFAULT_VALUES ]), EProfile.FULL: set(EFeature) } -- cgit v1.2.1 From 04a3536fc59212e7ac3b2481d77b6e792d5c8408 Mon Sep 17 00:00:00 2001 From: Juergen Bocklage-Ryannel Date: Wed, 2 May 2018 11:12:26 +0200 Subject: renamed property macro to prioperty_decl macro --- qface/templates/qface/qtcpp.j2 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/qface/templates/qface/qtcpp.j2 b/qface/templates/qface/qtcpp.j2 index 97e1c8d..31c91fe 100644 --- a/qface/templates/qface/qtcpp.j2 +++ b/qface/templates/qface/qtcpp.j2 @@ -13,7 +13,7 @@ {% endif %} {%- endmacro %} -{% macro property(property, notifiable=True) -%} +{% macro property_decl(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 %} @@ -38,11 +38,9 @@ void {{symbol}}{{postfix}}({{symbol|parameters}}); \qmlproperty {{property.type}} {{class}}::{{property}} {% with doc = property.comment|parse_doc %} \brief {{doc.brief}} - {{doc.description}} {% endwith %} */ - void {{class}}::set{{property|upperfirst}}({{ property|parameterType }}) { {% if notifiable %} @@ -53,7 +51,6 @@ void {{class}}::set{{property|upperfirst}}({{ property|parameterType }}) {% else %} m_{{property}} = {{property}}; {% endif %} - } {%- endmacro %} -- cgit v1.2.1 From d881beb5f7f0f3d22c7bbfea6407a445c1f23578 Mon Sep 17 00:00:00 2001 From: Juergen Bocklage-Ryannel Date: Wed, 2 May 2018 11:12:52 +0200 Subject: Ensure watched file entries are always folders --- qface/watch.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qface/watch.py b/qface/watch.py index 9501f25..1a9ef23 100644 --- a/qface/watch.py +++ b/qface/watch.py @@ -42,6 +42,8 @@ def monitor(script, src, dst, args): click.secho('watch recursive: {0}'.format(script.dirname()), fg='blue') observer.schedule(event_handler, script.dirname(), recursive=True) for entry in src: + if entry.isfile(): + entry = entry.parent click.secho('watch recursive: {0}'.format(entry), fg='blue') observer.schedule(event_handler, entry, recursive=True) event_handler.run() # run always once -- cgit v1.2.1 From aafdc0716e7a85678045237353148582db5cc4da Mon Sep 17 00:00:00 2001 From: jacky309 Date: Fri, 16 Mar 2018 14:27:55 +0100 Subject: Domain.py: fix qualified_name() (#73) --- qface/idl/domain.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qface/idl/domain.py b/qface/idl/domain.py index 5c97bd7..7949e6c 100644 --- a/qface/idl/domain.py +++ b/qface/idl/domain.py @@ -106,7 +106,11 @@ class NamedElement(object): if self.module == self: return self.module.name else: - return '{0}.{1}'.format(self.module.name, self.name) + if "." not in self.name: + return '{0}.{1}'.format(self.module.name, self.name) + else: + # We have a fully qualified reference, just return it + return self.name def toJson(self): o = OrderedDict() -- cgit v1.2.1 From 8e61f95667272e52db8f933bdc3e6442081d2b7c Mon Sep 17 00:00:00 2001 From: Juergen Bocklage-Ryannel Date: Wed, 2 May 2018 11:16:04 +0200 Subject: ignore htmlcov folder --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index ada7038..41976ad 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ dist/* .coverage .vscode +htmlcov -- cgit v1.2.1 From 70fed7a8f8aa58f4910168947037ef68f611c562 Mon Sep 17 00:00:00 2001 From: weimerb Date: Wed, 2 May 2018 11:59:27 +0200 Subject: Improve documentation (#77) Fixed mostly spelling errors, but also phrasing and technical issues. --- docs/annotations.rst | 12 ++++++------ docs/builtin.rst | 4 ++-- docs/grammar.rst | 30 +++++++++++++++--------------- docs/index.rst | 10 +++++----- docs/motivation.rst | 24 ++++++++++++------------ docs/usage.rst | 6 +++--- 6 files changed, 43 insertions(+), 43 deletions(-) diff --git a/docs/annotations.rst b/docs/annotations.rst index 1092f6e..73436c8 100644 --- a/docs/annotations.rst +++ b/docs/annotations.rst @@ -2,10 +2,10 @@ Annotations *********** -Annotations is a way to add meta information to your interface definition. It +Annotations allow to add meta information to your interface definition. It is available to each symbol in the interface. -Annotations allows an interface author to extend the existing interface with additional meta information, called tags, aka annotations. One or several annotations can precede a module, ``interface``, ``struct`` or ``enum``. They are also allowed before an ``operation``, ``property`` or ``signal``. Everywhere where a documentation comment is allowed you can also add annotations. +With annotations an interface author can extend the existing interface with additional meta information, called tags, aka annotations. One or several annotations can precede a module, ``interface``, ``struct`` or ``enum``. They are also allowed before an ``operation``, ``property`` or ``signal``. Everywhere where a documentation comment is allowed you can also add annotations. An annotation looks like this @@ -16,9 +16,9 @@ An annotation looks like this } -An in code annotation precedes a symbol and it starts with an ``@`` sign. A symbol can have more than one one annotation line. Each line should be one individual annotation. The content is YAML content. All ``@`` signs preceding a symbol are collected and then evaluated using a YAML parser. +An embedded annotation precedes a symbol and it starts with an ``@`` sign. A symbol can have more than one annotation line. Each line should be one individual annotation. The content is YAML content. All ``@`` signs preceding a symbol are collected and then evaluated using a YAML parser. -For larger annotations you can use the external annotation document feature. +For larger annotations you can use the external annotation document feature (see below). .. code-block:: python @@ -63,12 +63,12 @@ On the root level should be a fully qualified name of a symbol. The symbol will Merging Annotations =================== -The external annotations will be merged on top of the embedded annotations on per symbol base. Dictionaries will be merged. If a merge can not be done then the external document based annotations will override the embedded annotations. +The external annotations will be merged on top of the embedded annotations per symbol. Dictionaries will be merged. If a merge can not be done then the external document based annotations will override the embedded annotations. Generators ========== -The annotation are available later when navigating the domain model. +Annotations are available later when navigating the domain model. .. code-block:: jinja2 diff --git a/docs/builtin.rst b/docs/builtin.rst index a24f424..b0a339b 100644 --- a/docs/builtin.rst +++ b/docs/builtin.rst @@ -1,7 +1,7 @@ Generator Examples ================== -QFace does provide soem real world generators which are hosted as separated projects. Their purpose is merely to showcase how to write a code generator with QFace. They are working and complete examples of a general purpose generators. +QFace does provide some real world generators which are hosted as separated projects. Their purpose is merely to showcase how to write a code generator with QFace. They are working and complete examples of general purpose generators. `qface-qtcpp`_ @@ -22,7 +22,7 @@ QFace does provide soem real world generators which are hosted as separated proj Hosted at: https://github.com/Pelagicore/qface-qtro -From the QML user interface perspective the QtCPP and QtQML generators bth provide the same API and are interchangeable. +From the QML user interface perspective the QtCPP and QtQML generators both provide the same API and are interchangeable. diff --git a/docs/grammar.rst b/docs/grammar.rst index cb73e8d..a4c2663 100644 --- a/docs/grammar.rst +++ b/docs/grammar.rst @@ -4,7 +4,7 @@ Grammar QFace (Qt interface language) is an Interface Description Language (IDL). While it is primarily designed to define an interface between Qt, QML and C++, it is intended to be flexible enough also to be used in other contexts. -The grammar of QFace is well defined and is based on the concepts of modules as larger collection of information. +The grammar of QFace is well defined and is based on the concept of modules as larger collections of information. A module can have several interfaces, structs and/or enums/flags. @@ -37,7 +37,7 @@ A QFace document always describes one module. Each document can contain one or m Module ====== -A module is identified name. A module should be normally a URI where all parts are lowercase (e.g. `entertainment.tuner`). A module may import other modules with the primary purpose being to ensure that dependencies are declared inside the QFace file. +A module is identified by its name. A module should be normally a URI where all parts are lowercase (e.g. `entertainment.tuner`). A module may import other modules with the primary purpose being to ensure that dependencies are declared inside the QFace file. .. code-block:: js @@ -50,7 +50,7 @@ A module is identified name. A module should be normally a URI where all parts a Interface ========= -An interface is a collection of properties, operation and signals. Properties carry data, whereas the operations normally modify the data. Signals are used to notify the user of changes. +An interface is a collection of properties, operations and signals. Properties carry data, whereas the operations normally modify the data. Signals are used to notify the user of changes. .. code-block:: js @@ -60,7 +60,7 @@ An interface is a collection of properties, operation and signals. Properties ca signal error(string message); } -QFace allows to extends interfaces using the ``extends`` keyword after the interface name. +QFace allows to extend interfaces using the ``extends`` keyword after the interface name. .. code-block:: js @@ -75,12 +75,12 @@ QFace allows to extends interfaces using the ``extends`` keyword after the inter .. note:: - For the sake of simplicity as an API designer you should carefully evaluate if this is required. The typical way in QFace to allow extension is normally to write your own code-generator and use type annotations. + For the sake of simplicity, as an API designer you should carefully evaluate if this is required. The typical way in QFace to allow extensions is normally to write your own code-generator and use type annotations. .. code-block:: js - @station + @extends: Station interface WeatherStation { real temperature; } @@ -139,7 +139,7 @@ The value assignment for the enum type is sequential beginning from 0. To specif Error = 3 } -The flag type defines an enumeration type where these different values are treated as a bit mask. The values are in the sequence of the 2^n. +The flag type defines an enumeration type where different values are treated as a bit mask. The values are in the sequence of the 2^n. .. code-block:: js @@ -155,9 +155,9 @@ The flag type defines an enumeration type where these different values are treat Types ===== -Types are either local and can be references simply by its name, or they are from external module in this case they need to be referenced with the fully qualified name (``.``). A type can be an interface, struct, enum or flag. It is also possible to reference the inner members of the symbols with the fragment syntax (``.#``). +Types are either local and can be referenced simply by their names, or they are from external modules. In the latter case they need to be referenced with the fully qualified name (``.``). A type can be an interface, struct, enum or flag. It is also possible to reference the inner members of the symbols with the fragment syntax (``.#``). -A module consist of either one or more interfaces, structs and enums/flags. They can come in any number or combination. The interface is the only type which can contain properties, operations and signals. The struct is merely a container to transport structured data. An enum/flag allows the user to encode information used inside the struct or interface as data-type. +A module consists of either one or more interfaces, structs and enums/flags. They can come in any number or combination. The interface is the only type which can contain properties, operations and signals. The struct is merely a container to transport structured data. An enum/flag allows the user to encode information used inside the struct or interface as data-type. Below is an example of a QFace file. @@ -234,14 +234,14 @@ A nested type is a complex type which nests another type. These are container ty 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 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 chosen by the generator. This allows for example the generator 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. +A model is a special type of a list. It should be able to stream (e.g. add/change/remove) the data and the changes should be reflected by a more advanced API. Also the data could in general grow infinitely and the generator should provide some form of pagination or window API. You should use a model if you expect the data it represents to grow in a way that it may influence the performance of your API. Annotations =========== -Annotation allow the writer to add meta data to an interface document. It uses the `@` notation followed by valid YAML one line content. +Annotations allow the writer to add meta data to an interface document. It uses the `@` notation followed by valid YAML one line content. .. code-block:: js @@ -272,7 +272,7 @@ Default Values ============== QFace supports the assignment of default values to properties and struct fields. A default values is a text string -passed onto the generator. +passed to the generator. .. code-block:: js @@ -285,5 +285,5 @@ passed onto the generator. string text = "NO DATA"; } -You can use quotes `'` or double-quotes `"` as a marker for text. There is no type check on qface side the -text-content is directly on to the generator. +You can use quotes `'` or double-quotes `"` as a marker for text. There is no type check on QFace side. The +text-content is directly passed to the generator. diff --git a/docs/index.rst b/docs/index.rst index ed5f38a..0212095 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -4,7 +4,7 @@ QFace QFace is a flexible API generator inspired by the Qt API idioms. It uses a common IDL format (called QFace interface document) to define an API. QFace is optimized to write a custom generator based on the common IDL format. -There exists already several code generators for common use cases. These can be used as is or can be used as a base for a custom generator. +Several code generators for common use cases have already been implemented. These can be used as is or can be used as a base for a custom generator. .. toctree:: :maxdepth: 1 @@ -24,7 +24,7 @@ There exists already several code generators for common use cases. These can be Features ======== -The list fo features is plit between features which are based on the choosen IDL and features wich are provided by the generator itself. +The list fo features is plit between features which are based on the chosen IDL and features which are provided by the generator itself. .. rubric:: IDL Features @@ -47,7 +47,7 @@ The list fo features is plit between features which are based on the choosen IDL Quick Start =========== -QFace is a generator framework and is bundled with several reference code generator. +QFace is a generator framework and is bundled with several reference code generators. To install qface you need to have python3 installed and typically also pip3 @@ -73,7 +73,7 @@ and then Custom Generator ---------------- -For your own generator you need several ingredients. A QFace interface file here called "sample.qface" a small script which loads and parses the document. And one or more template files, which generate the resulting code. +For your own generator you need several ingredients. A QFace interface file (here called "sample.qface"), a small script which loads and parses the document (generator.py) and one or more template files, used by the script to generate the resulting code. The QFace document could look like this @@ -127,7 +127,7 @@ And a "org.example.txt" file named after the module should be generated. Bundled Generators ------------------ -QFace has some gnerators which are bundled with the QFace library. They live in their own reposiutories. These generators are documented in the repositories. +QFace has some generators which are bundled with the QFace library. They live in their own repositories. These generators are documented in their respective repositories. .. rubric:: See Also diff --git a/docs/motivation.rst b/docs/motivation.rst index 2b54801..299c160 100644 --- a/docs/motivation.rst +++ b/docs/motivation.rst @@ -7,7 +7,7 @@ QFace is an attempt to establish one interface description language with an easy The IDL ======= -The IDL uses common API concept such as modules, interfaces, properties, structs and enums/flags. Additionally it knows about lists and models. A list is an array of primitive or complex types. A model is an indicator for large data sets which are typical used via a defined interface or via pagination. +The IDL uses common API concept such as modules, interfaces, properties, structs and enums/flags. Additionally it knows about lists, maps and models. A list is an array of primitive or complex types. A map is an associative array of key/value pairs. A model is an indicator for large data sets which are typically used via a defined interface or via pagination. .. code-block:: js @@ -41,48 +41,48 @@ Complex Types * Struct * Enum * Flag -* Array +* List +* Map * Model -The language as such does not provide any support for maps or dictionaries. The reason for not providing a map container type is that keys in dictionaries requires a hash which can not always be guaranteed to be available in complex types. Why another IDL =============== -There exists many IDLs. Most of them are bound to a certain technology or library or are limited for a specific use. Only a few IDL exists which are independent from a technology. From these few which are known to the author none satisfied the requirement from the author to be Qt compatible and easy to use. Also the IDL should be easy to use and easy to be install and to be extendable. The unique mix of technologies used in QFace allows it to provide a solid stable IDL with a powerful generation framework. +Many IDLs are already in existence. Most of them are bound to a certain technology or library or are limited for a specific use. Only a few IDLs exist which are independent from a technology. From these few which are known to the author none satisfied the requirement from the author to be Qt compatible and easy to use. Also the IDL should be easy to install and be extendable. The unique mix of technologies used in QFace allows it to provide a solid stable IDL with a powerful generation framework. Defining APIs ============= -There are many opinions how to define APIs and what is the best way. The porposal of QFace is that is many project find QFace useful and use the same IDL there will be a large set of generators and at the end APIs can be compared and unified also if they will be used with different technologies. +There are many opinions how to define APIs and what the best way is. The idea of QFace is that many projects find it useful and use the same IDL. Consequently, there will be a large set of generators and finally APIs can be compared and unified also if they will be used with different technologies. -Even inside on e technolgy there are often discussions about how an interface shall be coded. QFace allows the different parties to create their own generators based on the same API. Ideally at the end the knowledge how an interface shall be coded will reside in the provided generator. +Even inside one technology there are often discussions about how an interface shall be coded. QFace allows the different parties to create their own generators based on the same API. Ideally at the end the knowledge how an interface shall be coded will reside in the provided generator. Large Projects ============== -In larger projects there is the need to make available to QML a large set of operating services. It is less about defining new visual items in C++, more about creating an abstraction of a service and make it available to the HMI developer inside QML. +In larger projects there is the need to make a large set of operating services available to QML. It is less about defining new visual items in C++, more about creating an abstraction of a service and make it available to the HMI developer inside QML. -This can be a challenge when you create many of these plugins and in the middle of the project you figure out you have issues with your current design. Or if the customer in the next project wants to use a different HMI technology. All the knowledge is inside these plugins. +This can be a challenge when you create many of these plugins and in the middle of the project you figure out that you have issues with your current design or if the customer in the next project wants to use a different HMI technology. All the knowledge is inside these plugins. With QFace these companies can be certain that QFace does not lock them into the HMI technology and smaller design issues can be fixed by fixing the generator. Remote Services =============== -Some projects use network communication to communicate from the HMI to the services, which might run on a different process or event networked device. QFace was not designed for remote services as it does not define any storage types (e.g. int32, int16, int64), it only knows an int and does not define how large the int shall be. For this QFace needs to rely on the author of the generators to have a defined protocol to exchange data. +Some projects use network communication to communicate from the HMI to the services, which might run on a different process or even a networked device. QFace was not designed for remote services as it does not define any storage types (e.g. int32, int16, int64), it only knows an int and does not define how large the int shall be. For this QFace needs to rely on the author of the generators to have a defined protocol to exchange data. Complex APIs ============ QFace is purposely designed to have limited features. The goal is to make QFace easy to use with an easy to remember syntax so that you don't need to be an expert to write interface files. -QFace does not suppot unions or extending from other interfaces or that a struct extends other structs. If you look for these features than QFace is probably the wrong choice. +QFace does not support unions or structs that extend other structs. If you look for these features, QFace is probably the wrong choice. Limitations =========== -Like other code generation tools, QFace is limited by how much information you can place inside your interface files. In such cases code generation might not make sense and QFace will also help. +Like other code generation tools, QFace is limited by how much information you can place inside your interface files. In excessive cases code generation might not make sense and hence QFace will also not help. -QFace allows you to use annotation which can add meta information to the interface files. But the generator needs to be designed to understand this meta information. Only the structure of these annotations are defined not the information they carry. Annotations might help to add information to an interface document to better control the code generation process. +QFace allows you to use annotations which can add meta information to the interface files. But the generator needs to be designed to understand this meta information. Only the structure of these annotations are defined not the information they carry. Annotations might help to add information to an interface document to better control the code generation process. diff --git a/docs/usage.rst b/docs/usage.rst index 7105bfa..74a1714 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -9,7 +9,7 @@ QFace requires one or more IDL files as input file and a generator to produce ou .. figure:: qface_concept.jpg -To use qface you need to write your own generator. A generatopr is a small python script which reads the qface document and write code using a generator. +To use QFace you need to write your own generator. A generator is a small python script which reads the QFace document and writes code using template files. .. code-block:: python @@ -51,7 +51,7 @@ The code generation is driven by a small script which iterates over the domain m generator.write('{{output}}/modules.csv', 'modules.csv', ctx) -This script reads the input directory returns a system object form the domain model. This is used as the root object for the code generation inside the template language. +This script reads the input directory and returns a system object from the domain model. This is used as the root object for the code generation inside the template language. .. code-block:: jinja @@ -67,4 +67,4 @@ This script reads the input directory returns a system object form the domain mo {% endfor -%} {% endfor %} -The template iterates over the domain objects and generates text which is written into a file. Using the generator write method ``generator.write(path, template, context)`` the output file path can also be specified using the template syntax . +The template iterates over the domain objects and generates text which is written into the output file. Using the generator write method ``generator.write(path, template, context)`` the output file path can be specified. -- cgit v1.2.1 From 4259be34223d1e19eac2ebb40a1311553f913478 Mon Sep 17 00:00:00 2001 From: Juergen Bocklage-Ryannel Date: Thu, 3 May 2018 10:33:53 +0200 Subject: added force option to generator. Force will force overwriting files (so ignoring preserved). --- qface/generator.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/qface/generator.py b/qface/generator.py index 91049ba..e65ad15 100644 --- a/qface/generator.py +++ b/qface/generator.py @@ -73,7 +73,7 @@ class Generator(object): strict = False """ enables strict code generation """ - def __init__(self, search_path, context={}): + def __init__(self, search_path, context={}, force=False): loader = ChoiceLoader([ FileSystemLoader(search_path), PackageLoader('qface') @@ -88,6 +88,7 @@ class Generator(object): self._destination = Path() self._source = '' self.context = context + self.force = force @property def destination(self): @@ -165,12 +166,13 @@ class Generator(object): sys.exit(1) def _write(self, file_path: Path, template: str, context: dict, preserve: bool = False, force: bool = False): + force = self.force or force path = self.destination / Path(self.apply(file_path, context)) path.parent.makedirs_p() logger.info('write {0}'.format(path)) data = self.render(template, context) if self._has_different_content(data, path) or force: - if path.exists() and preserve: + if path.exists() and preserve and not force: click.secho('preserve: {0}'.format(path), fg='blue') else: click.secho('create: {0}'.format(path), fg='blue') @@ -190,8 +192,8 @@ class Generator(object): class RuleGenerator(Generator): """Generates documents based on a rule YAML document""" - def __init__(self, search_path: str, destination:Path, context:dict={}, features:set=set()): - super().__init__(search_path, context) + def __init__(self, search_path: str, destination:Path, context:dict={}, features:set=set(), force=False): + super().__init__(search_path, context, force) self.context.update({ 'dst': destination, 'project': Path(destination).name, -- cgit v1.2.1 From 2d6a4f42259cb137988538d5f2392d4602da1c9d Mon Sep 17 00:00:00 2001 From: Juergen Bocklage-Ryannel Date: Thu, 1 Nov 2018 16:15:31 -0400 Subject: update watch code --- qface/watch.py | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/qface/watch.py b/qface/watch.py index 1a9ef23..e5d86ba 100644 --- a/qface/watch.py +++ b/qface/watch.py @@ -3,16 +3,18 @@ from watchdog.observers import Observer import click from path import Path import time -from .shell import sh +from subprocess import call """ Provides an API to monitor the file system """ + class RunScriptChangeHandler(FileSystemEventHandler): - def __init__(self, script): + def __init__(self, args, cwd): super().__init__() - self.script = script + self.args = args + self.cwd = cwd self.is_running = False def on_modified(self, event): @@ -24,24 +26,19 @@ class RunScriptChangeHandler(FileSystemEventHandler): if self.is_running: return self.is_running = True - sh(str(self.script), cwd=Path.getcwd()) + call(self.args, cwd=self.cwd) self.is_running = False -def monitor(script, src, dst, args): +def monitor(args, watch, cwd=Path.getcwd()): """ reloads the script given by argv when src files changes """ - src = src if isinstance(src, (list, tuple)) else [src] - dst = Path(dst).expand().abspath() - src = [Path(entry).expand().abspath() for entry in src] - command = ' '.join(args) - print('command: ', command) - event_handler = RunScriptChangeHandler(command) + watch = watch if isinstance(watch, (list, tuple)) else [watch] + watch = [Path(entry).expand().abspath() for entry in watch] + event_handler = RunScriptChangeHandler(args, cwd) observer = Observer() - click.secho('watch recursive: {0}'.format(script.dirname()), fg='blue') - observer.schedule(event_handler, script.dirname(), recursive=True) - for entry in src: + for entry in watch: if entry.isfile(): entry = entry.parent click.secho('watch recursive: {0}'.format(entry), fg='blue') -- cgit v1.2.1 From 29aea8282fb874b57fac80c275c4601d9a1be70f Mon Sep 17 00:00:00 2001 From: Juergen Bocklage-Ryannel Date: Thu, 1 Nov 2018 16:18:53 -0400 Subject: update watch --- qface/watch.py | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/qface/watch.py b/qface/watch.py index e5d86ba..117fcea 100644 --- a/qface/watch.py +++ b/qface/watch.py @@ -3,7 +3,7 @@ from watchdog.observers import Observer import click from path import Path import time -from subprocess import call +from .shell import sh """ Provides an API to monitor the file system @@ -11,10 +11,9 @@ Provides an API to monitor the file system class RunScriptChangeHandler(FileSystemEventHandler): - def __init__(self, args, cwd): + def __init__(self, script): super().__init__() - self.args = args - self.cwd = cwd + self.script = script self.is_running = False def on_modified(self, event): @@ -26,19 +25,26 @@ class RunScriptChangeHandler(FileSystemEventHandler): if self.is_running: return self.is_running = True - call(self.args, cwd=self.cwd) + sh(self.script, cwd=Path.getcwd()) self.is_running = False -def monitor(args, watch, cwd=Path.getcwd()): +def monitor(script_dir, src, dst, argv): """ reloads the script given by argv when src files changes """ - watch = watch if isinstance(watch, (list, tuple)) else [watch] - watch = [Path(entry).expand().abspath() for entry in watch] - event_handler = RunScriptChangeHandler(args, cwd) + if script_dir.isfile(): + script_dir = script_dir.dirname() + src = src if isinstance(src, (list, tuple)) else [src] + dst = Path(dst).expand().abspath() + src = [Path(entry).expand().abspath() for entry in src] + command = ' '.join(argv) + print('command: ', command) + event_handler = RunScriptChangeHandler(command) observer = Observer() - for entry in watch: + click.secho('watch recursive: {0}'.format(script_dir), fg='blue') + observer.schedule(event_handler, script_dir, recursive=True) + for entry in src: if entry.isfile(): entry = entry.parent click.secho('watch recursive: {0}'.format(entry), fg='blue') -- cgit v1.2.1 From bcf4bf537b6c651429cca73fb775fdbfd7344cd5 Mon Sep 17 00:00:00 2001 From: Juergen Bocklage-Ryannel Date: Thu, 1 Nov 2018 16:19:31 -0400 Subject: add parse stream operation --- qface/generator.py | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/qface/generator.py b/qface/generator.py index e65ad15..14509ae 100644 --- a/qface/generator.py +++ b/qface/generator.py @@ -5,14 +5,15 @@ from jinja2 import Environment, Template, Undefined, StrictUndefined from jinja2 import FileSystemLoader, PackageLoader, ChoiceLoader from jinja2 import TemplateSyntaxError, TemplateNotFound, TemplateError from path import Path -from antlr4 import FileStream, CommonTokenStream, ParseTreeWalker +from antlr4 import InputStream, FileStream, CommonTokenStream, ParseTreeWalker from antlr4.error import DiagnosticErrorListener, ErrorListener import shelve import logging import hashlib import yaml import click -import sys, os +import sys +import os from .idl.parser.TLexer import TLexer from .idl.parser.TParser import TParser @@ -20,7 +21,6 @@ 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 from .filters import filters from jinja2.debug import make_traceback as _make_traceback @@ -33,6 +33,16 @@ except ImportError: logger = logging.getLogger(__name__) +def merge(a, b): + "merges b into a recursively if a and b are dicts" + for key in b: + if isinstance(a.get(key), dict) and isinstance(b.get(key), dict): + merge(a[key], b[key]) + else: + a[key] = b[key] + return a + + def template_error_handler(traceback): exc_type, exc_obj, exc_tb = traceback.exc_info error = exc_obj @@ -272,6 +282,11 @@ class FileSystem(object): if error and FileSystem.strict: sys.exit(-1) + @staticmethod + def parse_text(text: str, system: System = None, profile=EProfile.FULL): + stream = InputStream(text) + return FileSystem._parse_stream(stream, system, "", profile) + @staticmethod def _parse_document(document: Path, system: System = None, profile=EProfile.FULL): """Parses a document and returns the resulting domain system @@ -286,7 +301,7 @@ class FileSystem(object): return system @staticmethod - def _parse_stream(stream, system: System = None, document=None, profile=EProfile.FULL): + def _parse_stream(stream: InputStream, system: System = None, document=None, profile=EProfile.FULL): logger.debug('parse stream') system = system or System() -- cgit v1.2.1 From 267f694abbc08abb7cc7b0756ba0b4dadc11cf53 Mon Sep 17 00:00:00 2001 From: Juergen Bocklage-Ryannel Date: Thu, 1 Nov 2018 16:19:54 -0400 Subject: fix issue with doc line arrays --- qface/templates/qface/qtcpp.j2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qface/templates/qface/qtcpp.j2 b/qface/templates/qface/qtcpp.j2 index 31c91fe..40309ab 100644 --- a/qface/templates/qface/qtcpp.j2 +++ b/qface/templates/qface/qtcpp.j2 @@ -37,8 +37,8 @@ void {{symbol}}{{postfix}}({{symbol|parameters}}); /*! \qmlproperty {{property.type}} {{class}}::{{property}} {% with doc = property.comment|parse_doc %} - \brief {{doc.brief}} - {{doc.description}} + \brief {{doc.brief|join(" ")}} + {{doc.description|join("\n ")}} {% endwith %} */ void {{class}}::set{{property|upperfirst}}({{ property|parameterType }}) @@ -68,7 +68,7 @@ void {{class}}::set{{property|upperfirst}}({{ property|parameterType }}) \qmlmethod {{operation.type}} {{class}}::{{operation}}({{operation|parameters}}) {% with doc = operation.comment|parse_doc %} \brief {{doc.brief}} - {{doc.description}} + {{doc.description|join("\n ")}} {% endwith %} */ {{operation|returnType}} {{class}}::{{operation}}({{operation|parameters}}) -- cgit v1.2.1 From 4131d2a2d7ba644af4fb632601f2f15853f621a7 Mon Sep 17 00:00:00 2001 From: Juergen Bocklage-Ryannel Date: Thu, 1 Nov 2018 16:20:59 -0400 Subject: ensure correct domain model vocabulary is used --- docs/domain.rst | 4 ++-- docs/extending.rst | 6 ++++-- docs/usage.rst | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/domain.rst b/docs/domain.rst index bf8f1c1..df27987 100644 --- a/docs/domain.rst +++ b/docs/domain.rst @@ -12,10 +12,10 @@ The IDL is converted into an in memory domain model (see qface/idl/domain.py) - System - Module - Import - - Service + - Interface - Property - Operation - - Event + - Signal - Enum - Flag - Struct diff --git a/docs/extending.rst b/docs/extending.rst index 910c086..faf4ccb 100644 --- a/docs/extending.rst +++ b/docs/extending.rst @@ -81,10 +81,12 @@ The rules document is divided into several targets. Each target can have an own : : - context: {} - destination: '' + context: { : } + destination: documents: : + preserve: + : * ```` is a name of the current target (e.g. client, server, plugin) * ```` must be either system, module, interface, struct or enum diff --git a/docs/usage.rst b/docs/usage.rst index 74a1714..87216c7 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -57,7 +57,7 @@ This script reads the input directory and returns a system object from the domai {% for module in system.modules %} {%- for interface in module.interfaces -%} - SERVICE, {{module}}.{{interface}} + INTERFACE, {{module}}.{{interface}} {% endfor -%} {%- for struct in module.structs -%} STRUCT , {{module}}.{{struct}} -- cgit v1.2.1 From 57421d7cfd220bbdbcb18345f532959e28e87fe8 Mon Sep 17 00:00:00 2001 From: Juergen Bocklage-Ryannel Date: Thu, 1 Nov 2018 16:21:28 -0400 Subject: add command line interface to qface --- qface/cli.py | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 qface/cli.py diff --git a/qface/cli.py b/qface/cli.py new file mode 100644 index 0000000..f0b06b0 --- /dev/null +++ b/qface/cli.py @@ -0,0 +1,40 @@ +import sys +import click +from path import Path +from qface.generator import FileSystem, RuleGenerator +from qface.watch import monitor + + +def run(config, src, dst, force=False, features=None): + project = Path(dst).name + system = FileSystem.parse(src) + template_dir = config.dirname() / 'templates' + + context = { + 'dst': dst, + 'system': system, + 'project': project, + 'features': features, + } + + generator = RuleGenerator(template_dir, destination=dst, context=context, features=features, force=force) + generator.process_rules(config, system) + + +@click.command() +@click.option('--config', '-c', type=click.Path(exists=True)) +@click.option('--reload/--no-reload', default=False) +@click.option('--features', '-f', multiple=True) +@click.option('--force/--no-force', default=True, help="Force writing of target files, ignores preserve") +@click.argument('src', nargs=-1, type=click.Path(exists=True)) +@click.argument('dst', nargs=1, type=click.Path(exists=False, file_okay=False)) +def app(config, src, dst, features, reload, force): + """Takes several files or directories as src and generates the code + in the given dst directory.""" + config = Path(config) + if reload: + argv = sys.argv.copy() + argv.remove('--reload') + monitor(config.dirname(), src, dst, argv) + else: + run(config, src, dst, force) -- cgit v1.2.1 From aaa34d863f6529063117b2093151355a2b29e467 Mon Sep 17 00:00:00 2001 From: Juergen Bocklage-Ryannel Date: Thu, 1 Nov 2018 16:21:53 -0400 Subject: move merge to generator and add module info helper --- qface/utils.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/qface/utils.py b/qface/utils.py index 3122d38..f816b58 100644 --- a/qface/utils.py +++ b/qface/utils.py @@ -1,10 +1,11 @@ +from .generator import FileSystem +from .helper import doc -def merge(a, b): - "merges b into a recursively if a and b are dicts" - for key in b: - if isinstance(a.get(key), dict) and isinstance(b.get(key), dict): - merge(a[key], b[key]) - else: - a[key] = b[key] - return a +def module_info(text): + system = FileSystem.parse_text(text) + module = list(system.modules)[0] + return { + 'title': module.name, + 'brief': " ".join(doc.parse_doc(module.comment).brief) + } -- cgit v1.2.1 From 91ce3ba01712ae326d4a9c6df14ed268a93f2987 Mon Sep 17 00:00:00 2001 From: Juergen Bocklage-Ryannel Date: Thu, 1 Nov 2018 17:54:49 -0400 Subject: update travis ci --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8f76043..9b5aea1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: python python: - - "3.5" + - "3.7" install: "pip install -r requirements.txt" -script: ./cli.py test_ci +script: ./cli.py test-ci -- cgit v1.2.1 From c93019f848728b8fce3e706bedd9bbe72fd67364 Mon Sep 17 00:00:00 2001 From: Juergen Bocklage-Ryannel Date: Thu, 1 Nov 2018 17:56:36 -0400 Subject: update travis to python 3.6 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9b5aea1..15c96ea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: python python: - - "3.7" + - "3.6" install: "pip install -r requirements.txt" script: ./cli.py test-ci -- cgit v1.2.1 From ffa5e14659ea6c7c7ffd25725089678c239a9155 Mon Sep 17 00:00:00 2001 From: Juergen Bocklage-Ryannel Date: Thu, 22 Nov 2018 13:10:34 +0100 Subject: - add new qface binary to launch external rule files - add ns to qtcpp/qtqml filters - restructured rules format, docs are now a list - changed monitor signature --- qface/app.py | 46 ++++++++++++++++++++++++++++++++++++++++++ qface/filters.py | 9 ++++++++- qface/generator.py | 11 ++++++++-- qface/helper/qtcpp.py | 32 ++++++++++++++--------------- qface/helper/qtqml.py | 12 +++++------ qface/templates/qface/qtcpp.j2 | 4 ++-- qface/watch.py | 9 ++++----- setup.py | 7 ++++++- 8 files changed, 97 insertions(+), 33 deletions(-) create mode 100644 qface/app.py diff --git a/qface/app.py b/qface/app.py new file mode 100644 index 0000000..800744a --- /dev/null +++ b/qface/app.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python3 +# Copyright (c) Pelagicore AB 2016 + +import sys +import click +import logging +from path import Path +from qface.generator import FileSystem, RuleGenerator +from qface.watch import monitor + +here = Path(__file__).dirname() +logging.basicConfig() + + +def run(spec, src, dst): + spec = Path(spec) + project = Path(dst).name + system = FileSystem.parse(src) + + context = { + 'dst': dst, + 'system': system, + 'project': project, + } + + generator = RuleGenerator(search_path=spec.dirname() / 'templates', destination=dst, context=context) + generator.process_rules(spec, system) + + +@click.command() +@click.option('--spec', type=click.Path(exists=True, file_okay=True)) +@click.option('--dst', type=click.Path(exists=False, file_okay=False)) +@click.option('--reload/--no-reload', default=False, help="Auto reload script on changes") +@click.argument('src', nargs=-1, type=click.Path(exists=True)) +def main(spec, dst, reload, src): + spec = Path(spec) + if reload: + argv = sys.argv.copy() + argv.remove('--reload') + monitor(args=argv, watch=src + (spec.dirname(),)) + else: + run(spec, src, dst) + + +if __name__ == '__main__': + main() diff --git a/qface/filters.py b/qface/filters.py index de424a4..eba3c55 100644 --- a/qface/filters.py +++ b/qface/filters.py @@ -1,6 +1,6 @@ import json import hashlib - +from .helper import qtqml def jsonify(symbol): """ returns json format for symbol """ @@ -35,6 +35,10 @@ def path(symbol): return str(symbol).replace('.', '/') +def identifier(s): + return str(s).lower().replace('.', '_') + + filters = { 'jsonify': jsonify, 'upper_first': upper_first, @@ -43,4 +47,7 @@ filters = { 'lowerfirst': lower_first, 'hash': hash, 'path': path, + 'identifier': identifier, } + +filters.update(qtqml.Filters.get_filters()) diff --git a/qface/generator.py b/qface/generator.py index e65ad15..1e1da41 100644 --- a/qface/generator.py +++ b/qface/generator.py @@ -238,9 +238,11 @@ class RuleGenerator(Generator): self.context.update(rule.get('context', {})) self.destination = rule.get('destination', None) self.source = rule.get('source', None) - for target, source in rule.get('documents', {}).items(): + for entry in rule.get('documents', []): + target, source = self._resolve_rule_document(entry) self.write(target, source) - for target, source in rule.get('preserve', {}).items(): + for entry in rule.get('preserve', []): + target, source = self._resolve_rule_document(entry) self.write(target, source, preserve=True) def _shall_proceed(self, obj): @@ -252,6 +254,11 @@ class RuleGenerator(Generator): result = self.features.intersection(set(conditions)) return bool(len(result)) + def _resolve_rule_document(self, entry): + if type(entry) is dict: + return next(iter(entry.items())) + return (entry, entry) + class FileSystem(object): """QFace helper functions to work with the file system""" diff --git a/qface/helper/qtcpp.py b/qface/helper/qtcpp.py index 2c64e74..1ffa865 100644 --- a/qface/helper/qtcpp.py +++ b/qface/helper/qtcpp.py @@ -234,20 +234,20 @@ class Filters(object): @staticmethod def get_filters(): return { - 'defaultValue': Filters.defaultValue, - 'returnType': Filters.returnType, - 'parameterType': Filters.parameterType, - 'open_ns': Filters.open_ns, - 'close_ns': Filters.close_ns, - 'using_ns': Filters.using_ns, - 'ns': Filters.ns, - 'fqn': Filters.fqn, - 'signalName': Filters.signalName, - 'parameters': Filters.parameters, - 'signature': Filters.signature, - 'identifier': Filters.identifier, - 'path': Filters.path, - 'className': Filters.className, - 'source_dependencies': Filters.source_dependencies, - 'header_dependencies': Filters.header_dependencies, + 'qt.defaultValue': Filters.defaultValue, + 'qt.returnType': Filters.returnType, + 'qt.parameterType': Filters.parameterType, + 'qt.cpp_open_ns': Filters.open_ns, + 'qt.close_ns': Filters.close_ns, + 'qt.using_ns': Filters.using_ns, + 'qt.ns': Filters.ns, + 'qt.fqn': Filters.fqn, + 'qt.signalName': Filters.signalName, + 'qt.parameters': Filters.parameters, + 'qt.signature': Filters.signature, + 'qt.identifier': Filters.identifier, + 'qt.path': Filters.path, + 'qt.className': Filters.className, + 'qt.source_dependencies': Filters.source_dependencies, + 'qt.header_dependencies': Filters.header_dependencies, } diff --git a/qface/helper/qtqml.py b/qface/helper/qtqml.py index e29311f..915607d 100644 --- a/qface/helper/qtqml.py +++ b/qface/helper/qtqml.py @@ -60,10 +60,10 @@ class Filters(object): return t @staticmethod - def path(s): - return str(s).replace('.', '/') - - @staticmethod - def identifier(s): - return str(s).lower().replace('.', '_') + def get_filters(): + return { + 'qml.className': Filters.className, + 'qml.defaultValue': Filters.defaultValue, + 'qml.propertyType': Filters.propertyType, + } diff --git a/qface/templates/qface/qtcpp.j2 b/qface/templates/qface/qtcpp.j2 index 31c91fe..e522233 100644 --- a/qface/templates/qface/qtcpp.j2 +++ b/qface/templates/qface/qtcpp.j2 @@ -26,7 +26,7 @@ void set{{property|upperfirst}}({{ property|parameterType }}){{ending}} {%- endmacro %} {% macro signal_decl(symbol, postfix="") -%} -void {{symbol}}{{postfix}}({{symbol|parameters}}); +void {{symbol}}{{postfix}}(); {%- endmacro %} {% macro property_member_decl(property) -%} @@ -46,7 +46,7 @@ void {{class}}::set{{property|upperfirst}}({{ property|parameterType }}) {% if notifiable %} if (m_{{property}} != {{property}}) { m_{{property}} = {{property}}; - Q_EMIT {{property}}Changed({{property}}); + Q_EMIT {{property}}Changed(); } {% else %} m_{{property}} = {{property}}; diff --git a/qface/watch.py b/qface/watch.py index e5d86ba..29bc30f 100644 --- a/qface/watch.py +++ b/qface/watch.py @@ -11,10 +11,9 @@ Provides an API to monitor the file system class RunScriptChangeHandler(FileSystemEventHandler): - def __init__(self, args, cwd): + def __init__(self, args): super().__init__() self.args = args - self.cwd = cwd self.is_running = False def on_modified(self, event): @@ -26,17 +25,17 @@ class RunScriptChangeHandler(FileSystemEventHandler): if self.is_running: return self.is_running = True - call(self.args, cwd=self.cwd) + call(self.args, cwd=Path.getcwd()) self.is_running = False -def monitor(args, watch, cwd=Path.getcwd()): +def monitor(args, watch): """ reloads the script given by argv when src files changes """ watch = watch if isinstance(watch, (list, tuple)) else [watch] watch = [Path(entry).expand().abspath() for entry in watch] - event_handler = RunScriptChangeHandler(args, cwd) + event_handler = RunScriptChangeHandler(args) observer = Observer() for entry in watch: if entry.isfile(): diff --git a/setup.py b/setup.py index 8792426..d7b65eb 100644 --- a/setup.py +++ b/setup.py @@ -64,5 +64,10 @@ setup( 'watchdog', 'ipdb', ], - } + }, + entry_points={ + 'console_scripts': [ + 'qface = qface.app:main' + ], + }, ) -- cgit v1.2.1 From 56e3acc8df35c16a93a68954698cdcfdb1c1c3d4 Mon Sep 17 00:00:00 2001 From: Juergen Bocklage-Ryannel Date: Thu, 22 Nov 2018 13:21:54 +0100 Subject: remove dependency to sh function --- qface/watch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qface/watch.py b/qface/watch.py index 33fae01..29bc30f 100644 --- a/qface/watch.py +++ b/qface/watch.py @@ -3,7 +3,7 @@ from watchdog.observers import Observer import click from path import Path import time -from .shell import sh +from subprocess import call """ Provides an API to monitor the file system @@ -25,7 +25,7 @@ class RunScriptChangeHandler(FileSystemEventHandler): if self.is_running: return self.is_running = True - sh(self.args, cwd=Path.getcwd()) + call(self.args, cwd=Path.getcwd()) self.is_running = False -- cgit v1.2.1 From 22840dd0a67644afd20c1b9c4dfffa2c23cb4c6d Mon Sep 17 00:00:00 2001 From: Juergen Bocklage-Ryannel Date: Thu, 22 Nov 2018 14:38:23 +0100 Subject: - update macros to use ns filters - add path to generator out = dest / path / document - pre-register qtml/qtcpp/doc/basic filters --- qface/filters.py | 5 +++++ qface/generator.py | 29 ++++++++++++++++++++++------- qface/helper/doc.py | 6 ++++++ qface/helper/qtcpp.py | 6 +++++- qface/templates/qface/qtcpp.j2 | 20 ++++++++++---------- 5 files changed, 48 insertions(+), 18 deletions(-) diff --git a/qface/filters.py b/qface/filters.py index eba3c55..5969a64 100644 --- a/qface/filters.py +++ b/qface/filters.py @@ -1,6 +1,9 @@ import json import hashlib from .helper import qtqml +from .helper import qtcpp +from .helper import doc + def jsonify(symbol): """ returns json format for symbol """ @@ -51,3 +54,5 @@ filters = { } filters.update(qtqml.Filters.get_filters()) +filters.update(qtcpp.Filters.get_filters()) +filters.update(doc.get_filters()) diff --git a/qface/generator.py b/qface/generator.py index b19cfa2..eb3172d 100644 --- a/qface/generator.py +++ b/qface/generator.py @@ -96,6 +96,7 @@ class Generator(object): self.env.exception_handler = template_error_handler self.env.filters.update(filters) self._destination = Path() + self._path = Path() self._source = '' self.context = context self.force = force @@ -107,8 +108,21 @@ class Generator(object): @destination.setter def destination(self, dst): - if dst: - self._destination = Path(self.apply(dst, self.context)) + self._destination = dst + + @property + def resolved_path(self): + return self.destination / self.path + + @property + def path(self): + return self._path + + @path.setter + def path(self, path): + if not path: + return + self._path = Path(self.apply(path)) @property def source(self): @@ -147,7 +161,8 @@ class Generator(object): template = self.get_template(name) return template.render(context) - def apply(self, template, context): + def apply(self, template, context={}): + context.update(self.context) """Return the rendered text of a template instance""" return self.env.from_string(template).render(context) @@ -177,7 +192,7 @@ class Generator(object): def _write(self, file_path: Path, template: str, context: dict, preserve: bool = False, force: bool = False): force = self.force or force - path = self.destination / Path(self.apply(file_path, context)) + path = self.resolved_path / Path(self.apply(file_path, context)) path.parent.makedirs_p() logger.info('write {0}'.format(path)) data = self.render(template, context) @@ -209,7 +224,7 @@ class RuleGenerator(Generator): 'project': Path(destination).name, 'features': features, }) - self.destination = '{{dst}}' + self.destination = destination self.features = features def process_rules(self, path: Path, system: System): @@ -228,7 +243,7 @@ class RuleGenerator(Generator): if not self._shall_proceed(rules): return self.context.update(rules.get('context', {})) - self.destination = rules.get('destination', '{{dst}}') + self.path = rules.get('path', '') self.source = rules.get('source', None) self._process_rule(rules.get('system', None), {'system': system}) for module in system.modules: @@ -246,7 +261,7 @@ class RuleGenerator(Generator): return self.context.update(context) self.context.update(rule.get('context', {})) - self.destination = rule.get('destination', None) + self.path = rule.get('path', None) self.source = rule.get('source', None) for entry in rule.get('documents', []): target, source = self._resolve_rule_document(entry) diff --git a/qface/helper/doc.py b/qface/helper/doc.py index 2b1df51..2b99b57 100644 --- a/qface/helper/doc.py +++ b/qface/helper/doc.py @@ -83,3 +83,9 @@ def parse_doc(s): else: # append any loose lines to description doc.add_tag('description', line) return doc + + +def get_filters(): + return { + 'parse_doc': parse_doc, + } diff --git a/qface/helper/qtcpp.py b/qface/helper/qtcpp.py index 1ffa865..aeae6f0 100644 --- a/qface/helper/qtcpp.py +++ b/qface/helper/qtcpp.py @@ -3,7 +3,11 @@ Provides helper functionality specificially for Qt C++/QML code generators """ import qface.idl.domain as domain from jinja2 import environmentfilter -from ..filters import upper_first + + +def upper_first(s): + s = str(s) + return s[0].upper() + s[1:] class Filters(object): diff --git a/qface/templates/qface/qtcpp.j2 b/qface/templates/qface/qtcpp.j2 index 67b68f8..729bfc9 100644 --- a/qface/templates/qface/qtcpp.j2 +++ b/qface/templates/qface/qtcpp.j2 @@ -14,15 +14,15 @@ {%- endmacro %} {% macro property_decl(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 %}) +Q_PROPERTY({{property|qt.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, ending=";") -%} -void set{{property|upperfirst}}({{ property|parameterType }}){{ending}} +void set{{property|upperfirst}}({{ property|qt.parameterType }}){{ending}} {%- endmacro %} {% macro property_getter_decl(property, ending=";") -%} -{{property|returnType}} {{property}}() const{{ending}} +{{property|qt.returnType}} {{property}}() const{{ending}} {%- endmacro %} {% macro signal_decl(symbol, postfix="") -%} @@ -30,7 +30,7 @@ void {{symbol}}{{postfix}}(); {%- endmacro %} {% macro property_member_decl(property) -%} -{{property|returnType}} m_{{property}}; +{{property|qt.returnType}} m_{{property}}; {%- endmacro %} {% macro property_setter_impl(class, property, notifiable=True) -%} @@ -41,7 +41,7 @@ void {{symbol}}{{postfix}}(); {{doc.description|join("\n ")}} {% endwith %} */ -void {{class}}::set{{property|upperfirst}}({{ property|parameterType }}) +void {{class}}::set{{property|upperfirst}}({{ property|qt.parameterType }}) { {% if notifiable %} if (m_{{property}} != {{property}}) { @@ -56,7 +56,7 @@ void {{class}}::set{{property|upperfirst}}({{ property|parameterType }}) {% macro property_getter_impl(class, property) -%} -{{property|returnType}} {{class}}::{{property}}() const +{{property|qt.returnType}} {{class}}::{{property}}() const { return m_{{property}}; } @@ -65,24 +65,24 @@ void {{class}}::set{{property|upperfirst}}({{ property|parameterType }}) {% macro operation_impl(class, operation) -%} /*! - \qmlmethod {{operation.type}} {{class}}::{{operation}}({{operation|parameters}}) + \qmlmethod {{operation.type}} {{class}}::{{operation}}({{operation|qt.parameters}}) {% with doc = operation.comment|parse_doc %} \brief {{doc.brief}} {{doc.description|join("\n ")}} {% endwith %} */ -{{operation|returnType}} {{class}}::{{operation}}({{operation|parameters}}) +{{operation|qt.returnType}} {{class}}::{{operation}}({{operation|qt.parameters}}) { {% for parameter in operation.parameters %} Q_UNUSED({{parameter.name}}); {% endfor %} qWarning() << "{{class}}::{{operation}}(...) not implemented"; - return {{operation|defaultValue}}; + return {{operation|qt.defaultValue}}; } {%- endmacro %} {% macro operation_decl(operation, ending=";") -%} - virtual {{operation|returnType}} {{operation}}({{operation|parameters}}){{ending}} + virtual {{operation|qt.returnType}} {{operation}}({{operation|qt.parameters}}){{ending}} {%- endmacro %} {% macro autogenerated(prefix="//") -%} -- cgit v1.2.1 From f354532d7cc9e3663b005f5413baf03833c60398 Mon Sep 17 00:00:00 2001 From: Juergen Bocklage-Ryannel Date: Mon, 24 Dec 2018 13:28:16 +0100 Subject: - introduce qface script mode - add ability to load dynamic filters for qface script mode - extract generic filters - fixed some issues with cpp macros --- docs/index.rst | 1 + docs/script.rst | 40 +++++++++++++++++++++++++ qface/__about__.py | 4 +-- qface/app.py | 42 +++++++++++++++++++------- qface/filters.py | 68 ++++++++++++------------------------------ qface/generator.py | 7 +++-- qface/helper/generic.py | 52 ++++++++++++++++++++++++++++++++ qface/helper/qtcpp.py | 6 ++-- qface/templates/qface/qtcpp.j2 | 12 ++++---- qface/utils.py | 13 ++++++++ 10 files changed, 173 insertions(+), 72 deletions(-) create mode 100644 docs/script.rst create mode 100644 qface/helper/generic.py diff --git a/docs/index.rst b/docs/index.rst index 0212095..12a05b7 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -18,6 +18,7 @@ Several code generators for common use cases have already been implemented. Thes json domain extending + script api diff --git a/docs/script.rst b/docs/script.rst new file mode 100644 index 0000000..fb3def2 --- /dev/null +++ b/docs/script.rst @@ -0,0 +1,40 @@ +*********** +Script Mode +*********** + +In the script mode, qface is used as the qface exectuable. In this mode the code generator consits of a rule document and template files and optionally a filter module. + +Whereas normally the generator writer create an own python package in this module only some documents are needed and the qface script is used. + +Setup +===== + +To get started create a `qface-rules.yml` document and a templates folder:: + + qface-rules.yml + templates/ + + +In the rules file you provide the code generation rules accoring to the rule generator documentation. The templates folder will contain the required templates. + +Filters +======= + +To provide extra filder you need to create a `filters.py` document with the declaration of your filters:: + + def echo(s): + print(s) + return "World" + + filters['echo'] = echo + +The filters module will be loaded by qface and all entries to the filters dictionary are added to the global lists of Jinja filters. + +Running +======= + +To run now the generator you can simply call:: + + qface --rules qface-rules.yml --target out counter.qface + +This will take your rules and generate the files inside the out folder based on the `counter.qface` interface file. diff --git a/qface/__about__.py b/qface/__about__.py index e63ff15..0ed253d 100644 --- a/qface/__about__.py +++ b/qface/__about__.py @@ -9,7 +9,7 @@ except NameError: __title__ = "qface" __summary__ = "A generator framework based on a common modern IDL" __url__ = "https://pelagicore.github.io/qface/" -__version__ = "1.9.1" +__version__ = "2.0.0" __author__ = "JRyannel" -__author_email__ = "qface-generator@googlegroups.com" +__author_email__ = "" __copyright__ = "2019 Pelagicore" diff --git a/qface/app.py b/qface/app.py index 800744a..38a26d6 100644 --- a/qface/app.py +++ b/qface/app.py @@ -7,39 +7,61 @@ import logging from path import Path from qface.generator import FileSystem, RuleGenerator from qface.watch import monitor +from qface.utils import load_filters here = Path(__file__).dirname() logging.basicConfig() -def run(spec, src, dst): +def run(spec, src, dst, features, force): spec = Path(spec) project = Path(dst).name system = FileSystem.parse(src) - context = { + extra_filters_path = spec.dirname() / 'filters.py' + extra_filters = load_filters(extra_filters_path) + + ctx = { 'dst': dst, 'system': system, 'project': project, } - generator = RuleGenerator(search_path=spec.dirname() / 'templates', destination=dst, context=context) + generator = RuleGenerator( + search_path=spec.dirname() / 'templates', + destination=dst, + context=ctx, + features=features, + force=force + ) + generator.filters = extra_filters generator.process_rules(spec, system) @click.command() -@click.option('--spec', type=click.Path(exists=True, file_okay=True)) -@click.option('--dst', type=click.Path(exists=False, file_okay=False)) +@click.option('--rules', type=click.Path(exists=True, file_okay=True)) +@click.option('--target', type=click.Path(exists=False, file_okay=False)) @click.option('--reload/--no-reload', default=False, help="Auto reload script on changes") -@click.argument('src', nargs=-1, type=click.Path(exists=True)) -def main(spec, dst, reload, src): - spec = Path(spec) +@click.option('--scaffold/--no-scaffold', default=False, help="Add extrac scaffolding code") +@click.option('--watch', type=click.Path(exists=False, file_okay=False)) +@click.option('--feature', multiple=True) +@click.option('--force/--no-force', default=False, help="forces overwriting of files") +@click.argument('source', nargs=-1, type=click.Path(exists=True)) +def main(rules, target, reload, source, watch, scaffold, feature, force): + rules = Path(rules) if reload: argv = sys.argv.copy() argv.remove('--reload') - monitor(args=argv, watch=src + (spec.dirname(),)) + watch_list = list(source) + watch_list.append(rules.dirname()) + if watch: + watch_list.append(watch) + monitor(args=argv, watch=watch_list) else: - run(spec, src, dst) + features = set(feature) + if scaffold: + features.add('scaffold') + run(rules, source, target, features=features, force=force) if __name__ == '__main__': diff --git a/qface/filters.py b/qface/filters.py index 5969a64..236c7b3 100644 --- a/qface/filters.py +++ b/qface/filters.py @@ -1,58 +1,28 @@ -import json -import hashlib +from .helper import generic from .helper import qtqml from .helper import qtcpp from .helper import doc +import importlib.util -def jsonify(symbol): - """ returns json format for symbol """ - try: - # all symbols have a toJson method, try it - return json.dumps(symbol.toJson(), indent=' ') - except AttributeError: - pass - return json.dumps(symbol, indent=' ') +def get_filters(): + filters = {} + filters.update(generic.get_filters()) + filters.update(qtqml.Filters.get_filters()) + filters.update(qtcpp.Filters.get_filters()) + filters.update(doc.get_filters()) + return filters -def upper_first(s): - """ uppercase first letter """ - s = str(s) - return s[0].upper() + s[1:] +def load_filters(path): + if not path.exists(): + print('filter module does not exist') + return {} + extra_filters = {} + spec = importlib.util.spec_from_file_location('filters', path.abspath()) + filters_module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(filters_module) + filters_module.get_filters(extra_filters) + return extra_filters -def lower_first(s): - s = str(s) - return s[0].lower() + s[1:] - - -def hash(symbol, hash_type='sha1'): - """ create a hash code from symbol """ - code = hashlib.new(hash_type) - code.update(str(symbol).encode('utf-8')) - return code.hexdigest() - - -def path(symbol): - """ replaces '.' with '/' """ - return str(symbol).replace('.', '/') - - -def identifier(s): - return str(s).lower().replace('.', '_') - - -filters = { - 'jsonify': jsonify, - 'upper_first': upper_first, - 'lower_first': lower_first, - 'upperfirst': upper_first, - 'lowerfirst': lower_first, - 'hash': hash, - 'path': path, - 'identifier': identifier, -} - -filters.update(qtqml.Filters.get_filters()) -filters.update(qtcpp.Filters.get_filters()) -filters.update(doc.get_filters()) diff --git a/qface/generator.py b/qface/generator.py index eb3172d..b4f93df 100644 --- a/qface/generator.py +++ b/qface/generator.py @@ -21,7 +21,7 @@ from .idl.parser.TListener import TListener from .idl.profile import EProfile from .idl.domain import System from .idl.listener import DomainListener -from .filters import filters +from .filters import get_filters from jinja2.debug import make_traceback as _make_traceback @@ -94,7 +94,7 @@ class Generator(object): lstrip_blocks=True, ) self.env.exception_handler = template_error_handler - self.env.filters.update(filters) + self.env.filters.update(get_filters()) self._destination = Path() self._path = Path() self._source = '' @@ -170,6 +170,9 @@ class Generator(object): """Using a template file name it renders a template into a file given a context """ + if not file_path or not template: + click.secho('source or target missing for document') + return if not context: context = self.context error = False diff --git a/qface/helper/generic.py b/qface/helper/generic.py new file mode 100644 index 0000000..713952d --- /dev/null +++ b/qface/helper/generic.py @@ -0,0 +1,52 @@ +import json +import hashlib + + +def jsonify(symbol): + """ returns json format for symbol """ + try: + # all symbols have a toJson method, try it + return json.dumps(symbol.toJson(), indent=' ') + except AttributeError: + pass + return json.dumps(symbol, indent=' ') + + +def upper_first(s): + """ uppercase first letter """ + s = str(s) + return s[0].upper() + s[1:] + + +def lower_first(s): + s = str(s) + return s[0].lower() + s[1:] + + +def hash(symbol, hash_type='sha1'): + """ create a hash code from symbol """ + code = hashlib.new(hash_type) + code.update(str(symbol).encode('utf-8')) + return code.hexdigest() + + +def path(symbol): + """ replaces '.' with '/' """ + return str(symbol).replace('.', '/') + + +def identifier(s): + return str(s).lower().replace('.', '_') + + +def get_filters(): + return { + 'jsonify': jsonify, + 'upper_first': upper_first, + 'lower_first': lower_first, + 'upperfirst': upper_first, + 'lowerfirst': lower_first, + 'hash': hash, + 'path': path, + 'identifier': identifier, + } diff --git a/qface/helper/qtcpp.py b/qface/helper/qtcpp.py index aeae6f0..c9e6835 100644 --- a/qface/helper/qtcpp.py +++ b/qface/helper/qtcpp.py @@ -36,7 +36,7 @@ class Filters(object): return 'QVariant()' elif t.is_void: return '' - elif t.is_enum: + elif t.is_enumeration: value = next(iter(t.reference.members)) return '{0}::{0}Enum::{1}'.format(symbol.type, value) elif symbol.kind == 'enum': @@ -58,7 +58,7 @@ class Filters(object): @staticmethod def parameterType(symbol): prefix = Filters.classPrefix - if symbol.type.is_enum: + if symbol.type.is_enumeration: return '{0}::{0}Enum {1}'.format(symbol.type, symbol) if symbol.type.is_void or symbol.type.is_primitive: if symbol.type.is_string: @@ -88,7 +88,7 @@ class Filters(object): def returnType(symbol): prefix = Filters.classPrefix t = symbol.type - if t.is_enum: + if t.is_enumeration: return '{0}::{0}Enum'.format(symbol.type) if symbol.type.is_void or symbol.type.is_primitive: if t.is_string: diff --git a/qface/templates/qface/qtcpp.j2 b/qface/templates/qface/qtcpp.j2 index 729bfc9..b2e3bff 100644 --- a/qface/templates/qface/qtcpp.j2 +++ b/qface/templates/qface/qtcpp.j2 @@ -14,15 +14,15 @@ {%- endmacro %} {% macro property_decl(property, notifiable=True) -%} -Q_PROPERTY({{property|qt.returnType}} {{property}} READ {{property}} {% if not property.readonly %}WRITE set{{property|upperfirst}}{% endif %}{% if not property.const and notifiable %} NOTIFY {{property}}Changed{% endif %}) +Q_PROPERTY({{property|qt.returnType}} {{property}} READ {{property}} {% if not property.readonly %}WRITE push{{property|upperfirst}}{% endif %}{% if not property.const and notifiable %} NOTIFY {{property}}Changed{% endif %}) {%- endmacro %} -{% macro property_setter_decl(property, ending=";") -%} -void set{{property|upperfirst}}({{ property|qt.parameterType }}){{ending}} +{% macro property_setter_decl(property, ending=";", prefix='virtual') -%} +{{prefix}} void push{{property|upperfirst}}({{ property|qt.parameterType }}){{ending}} {%- endmacro %} -{% macro property_getter_decl(property, ending=";") -%} -{{property|qt.returnType}} {{property}}() const{{ending}} +{% macro property_getter_decl(property, ending=";", prefix='virtual') -%} +{{prefix}} {{property|qt.returnType}} {{property}}() const{{ending}} {%- endmacro %} {% macro signal_decl(symbol, postfix="") -%} @@ -41,7 +41,7 @@ void {{symbol}}{{postfix}}(); {{doc.description|join("\n ")}} {% endwith %} */ -void {{class}}::set{{property|upperfirst}}({{ property|qt.parameterType }}) +void {{class}}::push{{property|upperfirst}}({{ property|qt.parameterType }}) { {% if notifiable %} if (m_{{property}} != {{property}}) { diff --git a/qface/utils.py b/qface/utils.py index f816b58..889d862 100644 --- a/qface/utils.py +++ b/qface/utils.py @@ -9,3 +9,16 @@ def module_info(text): 'title': module.name, 'brief': " ".join(doc.parse_doc(module.comment).brief) } + + +def load_filters(path): + if not path.exists(): + print('filter module does not exist') + return {} + + ctx = { + 'filters': {} + } + exec(path.text(), ctx) + return ctx['filters'] + -- cgit v1.2.1