From c58e9b195c463cb75080fc673d1e573c8e3e1364 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Mon, 20 Feb 2023 22:23:54 +0100 Subject: [PATCH 01/27] Some grammar fixes. --- pyVHDLParser/ANTLR4/VHDLLexer.g4 | 6 +++--- pyVHDLParser/ANTLR4/VHDLParser.g4 | 19 +++++++++---------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/pyVHDLParser/ANTLR4/VHDLLexer.g4 b/pyVHDLParser/ANTLR4/VHDLLexer.g4 index eec095397..b6d356b4b 100644 --- a/pyVHDLParser/ANTLR4/VHDLLexer.g4 +++ b/pyVHDLParser/ANTLR4/VHDLLexer.g4 @@ -11,7 +11,7 @@ // // // License: // // ================================================================================================================== // -// Copyright 2017-2022 Patrick Lehmann - Boetzingen, Germany // +// Copyright 2017-2023 Patrick Lehmann - Boetzingen, Germany // // Copyright 2016-2017 Patrick Lehmann - Dresden, Germany // // // // Licensed under the Apache License, Version 2.0 (the "License"); // @@ -218,13 +218,13 @@ OP_XOR: 'xor'; OP_EQ: '='; OP_NE: '/='; OP_LT: '<'; -OP_LE: '<=)'; +//OP_LE: '<='; OP_GT: '>'; OP_GE: '>='; OP_IEQ: '?='; OP_INE: '?/='; OP_ILT: '?<'; -OP_ILE: '?<=)'; +OP_ILE: '?<='; OP_IGT: '?>'; OP_IGE: '?>='; OP_PLUS: '+'; diff --git a/pyVHDLParser/ANTLR4/VHDLParser.g4 b/pyVHDLParser/ANTLR4/VHDLParser.g4 index cdbb139ca..95e448393 100644 --- a/pyVHDLParser/ANTLR4/VHDLParser.g4 +++ b/pyVHDLParser/ANTLR4/VHDLParser.g4 @@ -11,7 +11,7 @@ // // // License: // // ================================================================================================================== // -// Copyright 2017-2022 Patrick Lehmann - Boetzingen, Germany // +// Copyright 2017-2023 Patrick Lehmann - Boetzingen, Germany // // Copyright 2016-2017 Patrick Lehmann - Dresden, Germany // // // // Licensed under the Apache License, Version 2.0 (the "License"); // @@ -824,7 +824,7 @@ rule_Expression | left=rule_Expression operator=( OP_MUL | OP_DIV | OP_MOD | OP_REM ) right=rule_Expression #binaryOp | left=rule_Expression operator=( OP_PLUS | OP_MINUS | OP_CONCAT ) right=rule_Expression #binaryOp | left=rule_Expression operator=( OP_SLL | OP_SRL | OP_SLA | OP_SRA | OP_ROL | OP_ROR ) right=rule_Expression #binaryOp - | left=rule_Expression operator=( OP_EQ | OP_NE | OP_LT | OP_LE | OP_GT | OP_GE | OP_IEQ | OP_INE | OP_ILT | OP_ILE | OP_IGT | OP_IGE ) right=rule_Expression #binaryOp + | left=rule_Expression operator=( OP_EQ | OP_NE | OP_LT | TOK_SIG_ASSIGN | OP_GT | OP_GE | OP_IEQ | OP_INE | OP_ILT | OP_ILE | OP_IGT | OP_IGE ) right=rule_Expression #binaryOp | left=rule_Expression operator=( OP_AND | OP_OR | OP_NAND | OP_NOR | OP_XOR | OP_XNOR ) right=rule_Expression #binaryOp ; @@ -941,7 +941,7 @@ rule_FunctionSpecification KW_FUNCTION rule_Designator // TODO: insert subprogram_header ( KW_PARAMETER? TOK_LP rule_FormalParameterList TOK_RP )? - KW_RETURN ( returnIdentifier=LIT_IDENTIFIER )? rule_Name + KW_RETURN ( returnIdentifier=LIT_IDENTIFIER KW_OF )? rule_Name ; /* @@ -974,7 +974,7 @@ rule_GenerateStatementBody rule_GenericClause : KW_GENERIC TOK_LP - elements+=rule_InterfaceElement ( TOK_SEMICOL elements+=rule_InterfaceElement )* + elements+=rule_InterfaceElement ( TOK_SEMICOL elements+=rule_InterfaceElement )* TOK_SEMICOL? TOK_RP TOK_SEMICOL ; @@ -1145,8 +1145,7 @@ rule_InterfaceFunctionSpecification ; rule_InterfaceList - : interfaceElements+=rule_InterfaceElement ( TOK_SEMICOL interfaceElements+=rule_InterfaceElement )* - TOK_SEMICOL? + : interfaceElements+=rule_InterfaceElement ( TOK_SEMICOL interfaceElements+=rule_InterfaceElement )* TOK_SEMICOL? ; // rule_InterfaceObjectDeclaration @@ -1287,7 +1286,7 @@ rule_ModeIndication rule_ModeViewDeclaration : KW_VIEW name=LIT_IDENTIFIER KW_OF rule_SubtypeIndication KW_IS rule_ModeViewElementDefinition* - KW_END KW_VIEW name2=LIT_IDENTIFIER TOK_SEMICOL + KW_END KW_VIEW name2=LIT_IDENTIFIER? TOK_SEMICOL ; rule_ModeViewElementDefinition @@ -1461,7 +1460,7 @@ rule_PlainReturnStatement rule_PortClause : KW_PORT TOK_LP - ports+=rule_InterfaceSignalDeclaration ( TOK_SEMICOL ports+=rule_InterfaceSignalDeclaration )* + ports+=rule_InterfaceSignalDeclaration ( TOK_SEMICOL ports+=rule_InterfaceSignalDeclaration )* TOK_SEMICOL? TOK_RP TOK_SEMICOL ; @@ -1827,7 +1826,7 @@ rule_SequentialBlockStatement declaredItems+=rule_ProcessDeclarativeItem* KW_BEGIN statements+=rule_SequentialStatement* - KW_END KW_BLOCK? label2=LIT_IDENTIFIER TOK_SEMICOL + KW_END KW_BLOCK? label2=LIT_IDENTIFIER? TOK_SEMICOL ; // rule_SequentialBlockDeclarativePart @@ -2124,7 +2123,7 @@ tolerance_aspect // handled by lexer rule_TypeConversion - : rule_TypeMark TOK_LP rule_Expression TOK_RP + : rule_Name TOK_LP rule_Expression TOK_RP ; rule_TypeDeclaration From fd5173f1c402d790c7a9364aa3fbadd26decae62 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Mon, 20 Feb 2023 22:43:46 +0100 Subject: [PATCH 02/27] Fixed rule_ConcurrentSelectedSignalAssignment. --- pyVHDLParser/ANTLR4/VHDLParser.g4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyVHDLParser/ANTLR4/VHDLParser.g4 b/pyVHDLParser/ANTLR4/VHDLParser.g4 index 95e448393..5709e64ce 100644 --- a/pyVHDLParser/ANTLR4/VHDLParser.g4 +++ b/pyVHDLParser/ANTLR4/VHDLParser.g4 @@ -455,7 +455,7 @@ rule_ConcurrentSelectedSignalAssignment target=rule_Target TOK_SIG_ASSIGN guarded=KW_GUARDED? delayMechanism=rule_DelayMechanism? - conditionalWaveforms=rule_ConditionalWaveforms + selectedWaveforms=rule_SelectedWaveforms TOK_SEMICOL ; From db7d1e45086322c1cc8490b05310ac30aaa4c673 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 21 Feb 2023 00:27:50 +0100 Subject: [PATCH 03/27] Updated generated Python code from ANTLR4 (v4.12.0). --- pyVHDLParser/ANTLR4/VHDLLexer.g4 | 2 +- pyVHDLParser/ANTLR4/VHDLLexer.py | 804 +- pyVHDLParser/ANTLR4/VHDLParser.py | 8622 +++++++++++----------- pyVHDLParser/ANTLR4/VHDLParserVisitor.py | 39 +- 4 files changed, 4904 insertions(+), 4563 deletions(-) diff --git a/pyVHDLParser/ANTLR4/VHDLLexer.g4 b/pyVHDLParser/ANTLR4/VHDLLexer.g4 index b6d356b4b..32fbd562e 100644 --- a/pyVHDLParser/ANTLR4/VHDLLexer.g4 +++ b/pyVHDLParser/ANTLR4/VHDLLexer.g4 @@ -307,7 +307,7 @@ LIT_OTHER_CHARACTER */ fragment BasicIdentifier: [a-z] ('_'? [a-z0-9])* ; -fragment ExtendedIdentifier: '\\' ([a-z0-9] | '_')+ '\\' ; +fragment ExtendedIdentifier: '\\' .+? '\\' ; LIT_IDENTIFIER : BasicIdentifier diff --git a/pyVHDLParser/ANTLR4/VHDLLexer.py b/pyVHDLParser/ANTLR4/VHDLLexer.py index f7cf590ec..6bba8a841 100644 --- a/pyVHDLParser/ANTLR4/VHDLLexer.py +++ b/pyVHDLParser/ANTLR4/VHDLLexer.py @@ -1,3 +1,4 @@ +# Generated from .\VHDLLexer.g4 by ANTLR 4.12.0 from sys import stdout from typing import TextIO @@ -6,7 +7,7 @@ def serializedATN(): return ( - 4, 0, 164, 1384, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, + 4, 0, 163, 1377, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, @@ -28,99 +29,98 @@ def serializedATN(): 149, 2, 150, 7, 150, 2, 151, 7, 151, 2, 152, 7, 152, 2, 153, 7, 153, 2, 154, 7, 154, 2, 155, 7, 155, 2, 156, 7, 156, 2, 157, 7, 157, 2, 158, 7, 158, 2, 159, 7, 159, 2, 160, 7, 160, 2, 161, 7, 161, 2, 162, 7, 162, 2, 163, 7, 163, 2, 164, 7, 164, 2, 165, 7, 165, 2, 166, 7, 166, 2, 167, 7, 167, 2, 168, 7, 168, 2, 169, 7, 169, 2, 170, 7, 170, 2, 171, - 7, 171, 2, 172, 7, 172, 2, 173, 7, 173, 2, 174, 7, 174, 2, 175, 7, 175, 2, 176, 7, 176, 2, 177, 7, 177, 1, 0, 4, 0, - 359, 8, 0, 11, 0, 12, 0, 360, 1, 0, 1, 0, 1, 1, 4, 1, 366, 8, 1, 11, 1, 12, 1, 367, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, - 2, 5, 2, 376, 8, 2, 10, 2, 12, 2, 379, 9, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 5, 3, 387, 8, 3, 10, 3, 12, 3, 390, - 9, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 5, 4, 399, 8, 4, 10, 4, 12, 4, 402, 9, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, - 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, - 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, - 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, - 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, - 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, - 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, - 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, - 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, - 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, - 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, - 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, - 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, - 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, - 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, - 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, - 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, - 43, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, 1, 47, - 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 49, 1, 49, 1, 49, 1, 50, 1, - 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 52, 1, 52, 1, 52, 1, 52, - 1, 52, 1, 52, 1, 52, 1, 52, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, - 54, 1, 55, 1, 55, 1, 55, 1, 55, 1, 56, 1, 56, 1, 56, 1, 56, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 58, 1, 58, 1, 58, - 1, 58, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 60, 1, 60, 1, 60, 1, 60, 1, 61, 1, 61, 1, 61, 1, 61, 1, 62, 1, 62, 1, - 62, 1, 62, 1, 62, 1, 63, 1, 63, 1, 63, 1, 64, 1, 64, 1, 64, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 66, 1, 66, 1, 66, - 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 68, 1, 68, 1, 68, 1, 68, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, - 69, 1, 69, 1, 69, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 71, 1, 71, 1, 71, 1, 71, - 1, 71, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 73, 1, 73, 1, 73, 1, 73, 1, 73, 1, - 73, 1, 73, 1, 73, 1, 74, 1, 74, 1, 74, 1, 74, 1, 74, 1, 74, 1, 74, 1, 74, 1, 74, 1, 74, 1, 75, 1, 75, 1, 75, 1, 75, - 1, 75, 1, 75, 1, 75, 1, 75, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 77, 1, 77, 1, - 77, 1, 77, 1, 77, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 79, 1, 79, 1, 79, 1, 79, 1, 79, 1, 79, 1, 79, 1, 80, - 1, 80, 1, 80, 1, 80, 1, 80, 1, 80, 1, 80, 1, 80, 1, 80, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 82, 1, - 82, 1, 82, 1, 82, 1, 82, 1, 82, 1, 82, 1, 82, 1, 83, 1, 83, 1, 83, 1, 83, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, - 1, 84, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 86, 1, 86, 1, 86, 1, 86, 1, 87, 1, 87, 1, 87, 1, 87, 1, - 88, 1, 88, 1, 88, 1, 88, 1, 88, 1, 88, 1, 88, 1, 88, 1, 88, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 90, - 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 92, 1, - 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 93, 1, 93, 1, 93, 1, 93, 1, 94, 1, 94, 1, 94, 1, 94, 1, 95, 1, 95, 1, 95, - 1, 95, 1, 96, 1, 96, 1, 96, 1, 96, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 98, 1, 98, 1, 98, 1, - 98, 1, 98, 1, 98, 1, 98, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 100, 1, 100, 1, 100, 1, - 100, 1, 100, 1, 101, 1, 101, 1, 101, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, - 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, - 104, 1, 104, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, 1, 107, - 1, 107, 1, 107, 1, 107, 1, 108, 1, 108, 1, 108, 1, 108, 1, 108, 1, 108, 1, 108, 1, 108, 1, 108, 1, 109, 1, 109, 1, - 109, 1, 109, 1, 109, 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, 1, 111, 1, 111, 1, 111, 1, 111, 1, 111, 1, 111, 1, 112, - 1, 112, 1, 112, 1, 112, 1, 112, 1, 112, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 114, 1, 114, 1, 114, 1, - 114, 1, 114, 1, 115, 1, 115, 1, 115, 1, 115, 1, 115, 1, 116, 1, 116, 1, 116, 1, 116, 1, 116, 1, 117, 1, 117, 1, 117, - 1, 117, 1, 117, 1, 117, 1, 118, 1, 118, 1, 118, 1, 118, 1, 118, 1, 119, 1, 119, 1, 119, 1, 119, 1, 120, 1, 120, 1, - 121, 1, 121, 1, 121, 1, 122, 1, 122, 1, 123, 1, 123, 1, 123, 1, 123, 1, 124, 1, 124, 1, 125, 1, 125, 1, 125, 1, 126, - 1, 126, 1, 126, 1, 127, 1, 127, 1, 127, 1, 127, 1, 128, 1, 128, 1, 128, 1, 129, 1, 129, 1, 129, 1, 129, 1, 129, 1, - 130, 1, 130, 1, 130, 1, 131, 1, 131, 1, 131, 1, 131, 1, 132, 1, 132, 1, 133, 1, 133, 1, 134, 1, 134, 1, 135, 1, 135, - 1, 136, 1, 136, 1, 136, 1, 137, 1, 137, 1, 138, 1, 138, 1, 138, 1, 139, 1, 139, 1, 139, 1, 140, 1, 140, 1, 140, 1, - 141, 1, 141, 1, 141, 1, 142, 1, 142, 1, 142, 1, 143, 1, 143, 1, 144, 1, 144, 1, 145, 1, 145, 1, 146, 1, 146, 1, 147, - 1, 147, 1, 147, 1, 148, 1, 148, 1, 148, 1, 149, 1, 149, 1, 150, 1, 150, 1, 151, 1, 151, 1, 152, 1, 152, 1, 153, 1, - 153, 1, 154, 1, 154, 1, 155, 1, 155, 1, 156, 1, 156, 1, 157, 1, 157, 1, 158, 1, 158, 1, 159, 1, 159, 1, 160, 1, 160, - 1, 161, 1, 161, 1, 162, 1, 162, 5, 162, 1244, 8, 162, 10, 162, 12, 162, 1247, 9, 162, 1, 163, 1, 163, 1, 163, 5, - 163, 1252, 8, 163, 10, 163, 12, 163, 1255, 9, 163, 1, 164, 1, 164, 3, 164, 1259, 8, 164, 1, 164, 1, 164, 1, 165, 1, - 165, 1, 165, 1, 165, 3, 165, 1267, 8, 165, 1, 166, 1, 166, 1, 166, 1, 166, 1, 166, 3, 166, 1274, 8, 166, 1, 166, 1, - 166, 3, 166, 1278, 8, 166, 1, 167, 1, 167, 1, 167, 3, 167, 1283, 8, 167, 1, 168, 3, 168, 1286, 8, 168, 1, 168, 3, - 168, 1289, 8, 168, 1, 168, 1, 168, 1, 168, 4, 168, 1294, 8, 168, 11, 168, 12, 168, 1295, 1, 168, 1, 168, 1, 169, 3, - 169, 1301, 8, 169, 1, 169, 3, 169, 1304, 8, 169, 1, 169, 1, 169, 1, 169, 4, 169, 1309, 8, 169, 11, 169, 12, 169, - 1310, 1, 169, 1, 169, 1, 170, 3, 170, 1316, 8, 170, 1, 170, 1, 170, 1, 170, 4, 170, 1321, 8, 170, 11, 170, 12, 170, - 1322, 1, 170, 1, 170, 1, 171, 3, 171, 1328, 8, 171, 1, 171, 3, 171, 1331, 8, 171, 1, 171, 1, 171, 1, 171, 4, 171, - 1336, 8, 171, 11, 171, 12, 171, 1337, 1, 171, 1, 171, 1, 172, 1, 172, 1, 172, 1, 172, 3, 172, 1346, 8, 172, 1, 173, - 1, 173, 1, 173, 1, 173, 1, 174, 1, 174, 1, 174, 1, 174, 5, 174, 1356, 8, 174, 10, 174, 12, 174, 1359, 9, 174, 1, - 174, 1, 174, 1, 175, 1, 175, 3, 175, 1365, 8, 175, 1, 175, 5, 175, 1368, 8, 175, 10, 175, 12, 175, 1371, 9, 175, 1, - 176, 1, 176, 4, 176, 1375, 8, 176, 11, 176, 12, 176, 1376, 1, 176, 1, 176, 1, 177, 1, 177, 3, 177, 1383, 8, 177, 1, - 388, 0, 178, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, - 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, - 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, - 44, 89, 45, 91, 46, 93, 47, 95, 48, 97, 49, 99, 50, 101, 51, 103, 52, 105, 53, 107, 54, 109, 55, 111, 56, 113, 57, - 115, 58, 117, 59, 119, 60, 121, 61, 123, 62, 125, 63, 127, 64, 129, 65, 131, 66, 133, 67, 135, 68, 137, 69, 139, 70, - 141, 71, 143, 72, 145, 73, 147, 74, 149, 75, 151, 76, 153, 77, 155, 78, 157, 79, 159, 80, 161, 81, 163, 82, 165, 83, - 167, 84, 169, 85, 171, 86, 173, 87, 175, 88, 177, 89, 179, 90, 181, 91, 183, 92, 185, 93, 187, 94, 189, 95, 191, 96, - 193, 97, 195, 98, 197, 99, 199, 100, 201, 101, 203, 102, 205, 103, 207, 104, 209, 105, 211, 106, 213, 107, 215, 108, - 217, 109, 219, 110, 221, 111, 223, 112, 225, 113, 227, 114, 229, 115, 231, 116, 233, 117, 235, 118, 237, 119, 239, - 120, 241, 121, 243, 122, 245, 123, 247, 124, 249, 125, 251, 126, 253, 127, 255, 128, 257, 129, 259, 130, 261, 131, - 263, 132, 265, 133, 267, 134, 269, 135, 271, 136, 273, 137, 275, 138, 277, 139, 279, 140, 281, 141, 283, 142, 285, - 143, 287, 144, 289, 145, 291, 146, 293, 147, 295, 148, 297, 149, 299, 150, 301, 151, 303, 152, 305, 153, 307, 154, - 309, 155, 311, 156, 313, 157, 315, 158, 317, 159, 319, 0, 321, 0, 323, 0, 325, 0, 327, 0, 329, 0, 331, 0, 333, 0, - 335, 160, 337, 0, 339, 0, 341, 0, 343, 0, 345, 161, 347, 162, 349, 163, 351, 0, 353, 0, 355, 164, 1, 0, 38, 2, 0, - 10, 10, 13, 13, 3, 0, 8, 9, 12, 12, 32, 32, 2, 0, 65, 65, 97, 97, 2, 0, 66, 66, 98, 98, 2, 0, 83, 83, 115, 115, 2, - 0, 67, 67, 99, 99, 2, 0, 69, 69, 101, 101, 2, 0, 70, 70, 102, 102, 2, 0, 84, 84, 116, 116, 2, 0, 82, 82, 114, 114, - 2, 0, 76, 76, 108, 108, 2, 0, 73, 73, 105, 105, 2, 0, 78, 78, 110, 110, 2, 0, 68, 68, 100, 100, 2, 0, 72, 72, 104, - 104, 2, 0, 85, 85, 117, 117, 2, 0, 89, 89, 121, 121, 2, 0, 77, 77, 109, 109, 2, 0, 71, 71, 103, 103, 2, 0, 79, 79, - 111, 111, 2, 0, 75, 75, 107, 107, 2, 0, 80, 80, 112, 112, 2, 0, 88, 88, 120, 120, 2, 0, 86, 86, 118, 118, 2, 0, 87, - 87, 119, 119, 2, 0, 74, 74, 106, 106, 2, 0, 81, 81, 113, 113, 2, 0, 65, 90, 97, 122, 1, 0, 48, 57, 3, 0, 48, 57, 65, - 90, 97, 122, 2, 0, 48, 57, 95, 95, 2, 0, 43, 43, 45, 45, 4, 0, 83, 83, 85, 85, 115, 115, 117, 117, 2, 0, 48, 49, 95, - 95, 2, 0, 48, 55, 95, 95, 4, 0, 48, 57, 65, 70, 95, 95, 97, 102, 3, 0, 10, 10, 13, 13, 34, 34, 4, 0, 48, 57, 65, 90, - 95, 95, 97, 122, 1403, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, - 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, - 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, + 7, 171, 2, 172, 7, 172, 2, 173, 7, 173, 2, 174, 7, 174, 2, 175, 7, 175, 2, 176, 7, 176, 1, 0, 4, 0, 357, 8, 0, 11, + 0, 12, 0, 358, 1, 0, 1, 0, 1, 1, 4, 1, 364, 8, 1, 11, 1, 12, 1, 365, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 374, + 8, 2, 10, 2, 12, 2, 377, 9, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 5, 3, 385, 8, 3, 10, 3, 12, 3, 388, 9, 3, 1, 3, + 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 5, 4, 397, 8, 4, 10, 4, 12, 4, 400, 9, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, + 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, + 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, + 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, + 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, + 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, + 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, + 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, + 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, + 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, + 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, + 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, + 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, + 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, + 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, + 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, + 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, + 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, 1, 47, 1, 47, 1, + 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 49, 1, 49, 1, 49, 1, 50, 1, 50, 1, 50, + 1, 50, 1, 50, 1, 50, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, + 52, 1, 52, 1, 52, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 55, + 1, 55, 1, 55, 1, 55, 1, 56, 1, 56, 1, 56, 1, 56, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 58, 1, 58, 1, 58, 1, 58, 1, + 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 60, 1, 60, 1, 60, 1, 60, 1, 61, 1, 61, 1, 61, 1, 61, 1, 62, 1, 62, 1, 62, 1, 62, + 1, 62, 1, 63, 1, 63, 1, 63, 1, 64, 1, 64, 1, 64, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 66, 1, 66, 1, 66, 1, 67, 1, + 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 68, 1, 68, 1, 68, 1, 68, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, + 1, 69, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 71, 1, 71, 1, 71, 1, 71, 1, 71, 1, + 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 73, 1, 73, 1, 73, 1, 73, 1, 73, 1, 73, 1, 73, + 1, 73, 1, 74, 1, 74, 1, 74, 1, 74, 1, 74, 1, 74, 1, 74, 1, 74, 1, 74, 1, 74, 1, 75, 1, 75, 1, 75, 1, 75, 1, 75, 1, + 75, 1, 75, 1, 75, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 77, 1, 77, 1, 77, 1, 77, + 1, 77, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 79, 1, 79, 1, 79, 1, 79, 1, 79, 1, 79, 1, 79, 1, 80, 1, 80, 1, + 80, 1, 80, 1, 80, 1, 80, 1, 80, 1, 80, 1, 80, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 82, 1, 82, 1, 82, + 1, 82, 1, 82, 1, 82, 1, 82, 1, 82, 1, 83, 1, 83, 1, 83, 1, 83, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, + 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 86, 1, 86, 1, 86, 1, 86, 1, 87, 1, 87, 1, 87, 1, 87, 1, 88, 1, 88, + 1, 88, 1, 88, 1, 88, 1, 88, 1, 88, 1, 88, 1, 88, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 90, 1, 90, 1, + 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 92, 1, 92, 1, 92, + 1, 92, 1, 92, 1, 92, 1, 92, 1, 93, 1, 93, 1, 93, 1, 93, 1, 94, 1, 94, 1, 94, 1, 94, 1, 95, 1, 95, 1, 95, 1, 95, 1, + 96, 1, 96, 1, 96, 1, 96, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 98, 1, 98, 1, 98, 1, 98, 1, 98, + 1, 98, 1, 98, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, + 1, 101, 1, 101, 1, 101, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 103, 1, + 103, 1, 103, 1, 103, 1, 103, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, + 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, 1, 107, 1, 107, 1, + 107, 1, 107, 1, 108, 1, 108, 1, 108, 1, 108, 1, 108, 1, 108, 1, 108, 1, 108, 1, 108, 1, 109, 1, 109, 1, 109, 1, 109, + 1, 109, 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, 1, 111, 1, 111, 1, 111, 1, 111, 1, 111, 1, 111, 1, 112, 1, 112, 1, + 112, 1, 112, 1, 112, 1, 112, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 114, 1, 114, 1, 114, 1, 114, 1, 114, + 1, 115, 1, 115, 1, 115, 1, 115, 1, 115, 1, 116, 1, 116, 1, 116, 1, 116, 1, 116, 1, 117, 1, 117, 1, 117, 1, 117, 1, + 117, 1, 117, 1, 118, 1, 118, 1, 118, 1, 118, 1, 118, 1, 119, 1, 119, 1, 119, 1, 119, 1, 120, 1, 120, 1, 121, 1, 121, + 1, 121, 1, 122, 1, 122, 1, 123, 1, 123, 1, 124, 1, 124, 1, 124, 1, 125, 1, 125, 1, 125, 1, 126, 1, 126, 1, 126, 1, + 126, 1, 127, 1, 127, 1, 127, 1, 128, 1, 128, 1, 128, 1, 128, 1, 129, 1, 129, 1, 129, 1, 130, 1, 130, 1, 130, 1, 130, + 1, 131, 1, 131, 1, 132, 1, 132, 1, 133, 1, 133, 1, 134, 1, 134, 1, 135, 1, 135, 1, 135, 1, 136, 1, 136, 1, 137, 1, + 137, 1, 137, 1, 138, 1, 138, 1, 138, 1, 139, 1, 139, 1, 139, 1, 140, 1, 140, 1, 140, 1, 141, 1, 141, 1, 141, 1, 142, + 1, 142, 1, 143, 1, 143, 1, 144, 1, 144, 1, 145, 1, 145, 1, 146, 1, 146, 1, 146, 1, 147, 1, 147, 1, 147, 1, 148, 1, + 148, 1, 149, 1, 149, 1, 150, 1, 150, 1, 151, 1, 151, 1, 152, 1, 152, 1, 153, 1, 153, 1, 154, 1, 154, 1, 155, 1, 155, + 1, 156, 1, 156, 1, 157, 1, 157, 1, 158, 1, 158, 1, 159, 1, 159, 1, 160, 1, 160, 1, 161, 1, 161, 5, 161, 1237, 8, + 161, 10, 161, 12, 161, 1240, 9, 161, 1, 162, 1, 162, 1, 162, 5, 162, 1245, 8, 162, 10, 162, 12, 162, 1248, 9, 162, + 1, 163, 1, 163, 3, 163, 1252, 8, 163, 1, 163, 1, 163, 1, 164, 1, 164, 1, 164, 1, 164, 3, 164, 1260, 8, 164, 1, 165, + 1, 165, 1, 165, 1, 165, 1, 165, 3, 165, 1267, 8, 165, 1, 165, 1, 165, 3, 165, 1271, 8, 165, 1, 166, 1, 166, 1, 166, + 3, 166, 1276, 8, 166, 1, 167, 3, 167, 1279, 8, 167, 1, 167, 3, 167, 1282, 8, 167, 1, 167, 1, 167, 1, 167, 4, 167, + 1287, 8, 167, 11, 167, 12, 167, 1288, 1, 167, 1, 167, 1, 168, 3, 168, 1294, 8, 168, 1, 168, 3, 168, 1297, 8, 168, 1, + 168, 1, 168, 1, 168, 4, 168, 1302, 8, 168, 11, 168, 12, 168, 1303, 1, 168, 1, 168, 1, 169, 3, 169, 1309, 8, 169, 1, + 169, 1, 169, 1, 169, 4, 169, 1314, 8, 169, 11, 169, 12, 169, 1315, 1, 169, 1, 169, 1, 170, 3, 170, 1321, 8, 170, 1, + 170, 3, 170, 1324, 8, 170, 1, 170, 1, 170, 1, 170, 4, 170, 1329, 8, 170, 11, 170, 12, 170, 1330, 1, 170, 1, 170, 1, + 171, 1, 171, 1, 171, 1, 171, 3, 171, 1339, 8, 171, 1, 172, 1, 172, 1, 172, 1, 172, 1, 173, 1, 173, 1, 173, 1, 173, + 5, 173, 1349, 8, 173, 10, 173, 12, 173, 1352, 9, 173, 1, 173, 1, 173, 1, 174, 1, 174, 3, 174, 1358, 8, 174, 1, 174, + 5, 174, 1361, 8, 174, 10, 174, 12, 174, 1364, 9, 174, 1, 175, 1, 175, 4, 175, 1368, 8, 175, 11, 175, 12, 175, 1369, + 1, 175, 1, 175, 1, 176, 1, 176, 3, 176, 1376, 8, 176, 2, 386, 1369, 0, 177, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, + 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, + 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, + 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, 46, 93, 47, 95, 48, 97, 49, 99, 50, 101, + 51, 103, 52, 105, 53, 107, 54, 109, 55, 111, 56, 113, 57, 115, 58, 117, 59, 119, 60, 121, 61, 123, 62, 125, 63, 127, + 64, 129, 65, 131, 66, 133, 67, 135, 68, 137, 69, 139, 70, 141, 71, 143, 72, 145, 73, 147, 74, 149, 75, 151, 76, 153, + 77, 155, 78, 157, 79, 159, 80, 161, 81, 163, 82, 165, 83, 167, 84, 169, 85, 171, 86, 173, 87, 175, 88, 177, 89, 179, + 90, 181, 91, 183, 92, 185, 93, 187, 94, 189, 95, 191, 96, 193, 97, 195, 98, 197, 99, 199, 100, 201, 101, 203, 102, + 205, 103, 207, 104, 209, 105, 211, 106, 213, 107, 215, 108, 217, 109, 219, 110, 221, 111, 223, 112, 225, 113, 227, + 114, 229, 115, 231, 116, 233, 117, 235, 118, 237, 119, 239, 120, 241, 121, 243, 122, 245, 123, 247, 124, 249, 125, + 251, 126, 253, 127, 255, 128, 257, 129, 259, 130, 261, 131, 263, 132, 265, 133, 267, 134, 269, 135, 271, 136, 273, + 137, 275, 138, 277, 139, 279, 140, 281, 141, 283, 142, 285, 143, 287, 144, 289, 145, 291, 146, 293, 147, 295, 148, + 297, 149, 299, 150, 301, 151, 303, 152, 305, 153, 307, 154, 309, 155, 311, 156, 313, 157, 315, 158, 317, 0, 319, 0, + 321, 0, 323, 0, 325, 0, 327, 0, 329, 0, 331, 0, 333, 159, 335, 0, 337, 0, 339, 0, 341, 0, 343, 160, 345, 161, 347, + 162, 349, 0, 351, 0, 353, 163, 1, 0, 37, 2, 0, 10, 10, 13, 13, 3, 0, 8, 9, 12, 12, 32, 32, 2, 0, 65, 65, 97, 97, 2, + 0, 66, 66, 98, 98, 2, 0, 83, 83, 115, 115, 2, 0, 67, 67, 99, 99, 2, 0, 69, 69, 101, 101, 2, 0, 70, 70, 102, 102, 2, + 0, 84, 84, 116, 116, 2, 0, 82, 82, 114, 114, 2, 0, 76, 76, 108, 108, 2, 0, 73, 73, 105, 105, 2, 0, 78, 78, 110, 110, + 2, 0, 68, 68, 100, 100, 2, 0, 72, 72, 104, 104, 2, 0, 85, 85, 117, 117, 2, 0, 89, 89, 121, 121, 2, 0, 77, 77, 109, + 109, 2, 0, 71, 71, 103, 103, 2, 0, 79, 79, 111, 111, 2, 0, 75, 75, 107, 107, 2, 0, 80, 80, 112, 112, 2, 0, 88, 88, + 120, 120, 2, 0, 86, 86, 118, 118, 2, 0, 87, 87, 119, 119, 2, 0, 74, 74, 106, 106, 2, 0, 81, 81, 113, 113, 2, 0, 65, + 90, 97, 122, 1, 0, 48, 57, 3, 0, 48, 57, 65, 90, 97, 122, 2, 0, 48, 57, 95, 95, 2, 0, 43, 43, 45, 45, 4, 0, 83, 83, + 85, 85, 115, 115, 117, 117, 2, 0, 48, 49, 95, 95, 2, 0, 48, 55, 95, 95, 4, 0, 48, 57, 65, 70, 95, 95, 97, 102, 3, 0, + 10, 10, 13, 13, 34, 34, 1396, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, + 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, + 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, @@ -145,256 +145,255 @@ def serializedATN(): 0, 0, 0, 283, 1, 0, 0, 0, 0, 285, 1, 0, 0, 0, 0, 287, 1, 0, 0, 0, 0, 289, 1, 0, 0, 0, 0, 291, 1, 0, 0, 0, 0, 293, 1, 0, 0, 0, 0, 295, 1, 0, 0, 0, 0, 297, 1, 0, 0, 0, 0, 299, 1, 0, 0, 0, 0, 301, 1, 0, 0, 0, 0, 303, 1, 0, 0, 0, 0, 305, 1, 0, 0, 0, 0, 307, 1, 0, 0, 0, 0, 309, 1, 0, 0, 0, 0, 311, 1, 0, 0, 0, 0, 313, 1, 0, 0, 0, 0, 315, 1, 0, 0, 0, 0, - 317, 1, 0, 0, 0, 0, 335, 1, 0, 0, 0, 0, 345, 1, 0, 0, 0, 0, 347, 1, 0, 0, 0, 0, 349, 1, 0, 0, 0, 0, 355, 1, 0, 0, 0, - 1, 358, 1, 0, 0, 0, 3, 365, 1, 0, 0, 0, 5, 371, 1, 0, 0, 0, 7, 382, 1, 0, 0, 0, 9, 396, 1, 0, 0, 0, 11, 405, 1, 0, - 0, 0, 13, 409, 1, 0, 0, 0, 15, 416, 1, 0, 0, 0, 17, 422, 1, 0, 0, 0, 19, 428, 1, 0, 0, 0, 21, 432, 1, 0, 0, 0, 23, - 436, 1, 0, 0, 0, 25, 449, 1, 0, 0, 0, 27, 455, 1, 0, 0, 0, 29, 462, 1, 0, 0, 0, 31, 472, 1, 0, 0, 0, 33, 479, 1, 0, - 0, 0, 35, 485, 1, 0, 0, 0, 37, 491, 1, 0, 0, 0, 39, 496, 1, 0, 0, 0, 41, 503, 1, 0, 0, 0, 43, 507, 1, 0, 0, 0, 45, - 512, 1, 0, 0, 0, 47, 522, 1, 0, 0, 0, 49, 536, 1, 0, 0, 0, 51, 545, 1, 0, 0, 0, 53, 553, 1, 0, 0, 0, 55, 559, 1, 0, - 0, 0, 57, 567, 1, 0, 0, 0, 59, 578, 1, 0, 0, 0, 61, 585, 1, 0, 0, 0, 63, 590, 1, 0, 0, 0, 65, 596, 1, 0, 0, 0, 67, - 600, 1, 0, 0, 0, 69, 607, 1, 0, 0, 0, 71, 612, 1, 0, 0, 0, 73, 617, 1, 0, 0, 0, 75, 621, 1, 0, 0, 0, 77, 627, 1, 0, - 0, 0, 79, 636, 1, 0, 0, 0, 81, 645, 1, 0, 0, 0, 83, 654, 1, 0, 0, 0, 85, 662, 1, 0, 0, 0, 87, 670, 1, 0, 0, 0, 89, - 676, 1, 0, 0, 0, 91, 679, 1, 0, 0, 0, 93, 686, 1, 0, 0, 0, 95, 689, 1, 0, 0, 0, 97, 698, 1, 0, 0, 0, 99, 704, 1, 0, - 0, 0, 101, 707, 1, 0, 0, 0, 103, 713, 1, 0, 0, 0, 105, 721, 1, 0, 0, 0, 107, 729, 1, 0, 0, 0, 109, 734, 1, 0, 0, 0, - 111, 742, 1, 0, 0, 0, 113, 746, 1, 0, 0, 0, 115, 750, 1, 0, 0, 0, 117, 755, 1, 0, 0, 0, 119, 759, 1, 0, 0, 0, 121, - 764, 1, 0, 0, 0, 123, 768, 1, 0, 0, 0, 125, 772, 1, 0, 0, 0, 127, 777, 1, 0, 0, 0, 129, 780, 1, 0, 0, 0, 131, 783, - 1, 0, 0, 0, 133, 788, 1, 0, 0, 0, 135, 791, 1, 0, 0, 0, 137, 798, 1, 0, 0, 0, 139, 802, 1, 0, 0, 0, 141, 810, 1, 0, - 0, 0, 143, 820, 1, 0, 0, 0, 145, 825, 1, 0, 0, 0, 147, 835, 1, 0, 0, 0, 149, 843, 1, 0, 0, 0, 151, 853, 1, 0, 0, 0, - 153, 861, 1, 0, 0, 0, 155, 871, 1, 0, 0, 0, 157, 876, 1, 0, 0, 0, 159, 882, 1, 0, 0, 0, 161, 889, 1, 0, 0, 0, 163, - 898, 1, 0, 0, 0, 165, 905, 1, 0, 0, 0, 167, 913, 1, 0, 0, 0, 169, 917, 1, 0, 0, 0, 171, 924, 1, 0, 0, 0, 173, 931, - 1, 0, 0, 0, 175, 935, 1, 0, 0, 0, 177, 939, 1, 0, 0, 0, 179, 948, 1, 0, 0, 0, 181, 955, 1, 0, 0, 0, 183, 964, 1, 0, - 0, 0, 185, 971, 1, 0, 0, 0, 187, 978, 1, 0, 0, 0, 189, 982, 1, 0, 0, 0, 191, 986, 1, 0, 0, 0, 193, 990, 1, 0, 0, 0, - 195, 994, 1, 0, 0, 0, 197, 1002, 1, 0, 0, 0, 199, 1009, 1, 0, 0, 0, 201, 1018, 1, 0, 0, 0, 203, 1023, 1, 0, 0, 0, - 205, 1026, 1, 0, 0, 0, 207, 1036, 1, 0, 0, 0, 209, 1041, 1, 0, 0, 0, 211, 1052, 1, 0, 0, 0, 213, 1058, 1, 0, 0, 0, - 215, 1064, 1, 0, 0, 0, 217, 1068, 1, 0, 0, 0, 219, 1077, 1, 0, 0, 0, 221, 1082, 1, 0, 0, 0, 223, 1087, 1, 0, 0, 0, - 225, 1093, 1, 0, 0, 0, 227, 1099, 1, 0, 0, 0, 229, 1105, 1, 0, 0, 0, 231, 1110, 1, 0, 0, 0, 233, 1115, 1, 0, 0, 0, - 235, 1120, 1, 0, 0, 0, 237, 1126, 1, 0, 0, 0, 239, 1131, 1, 0, 0, 0, 241, 1135, 1, 0, 0, 0, 243, 1137, 1, 0, 0, 0, - 245, 1140, 1, 0, 0, 0, 247, 1142, 1, 0, 0, 0, 249, 1146, 1, 0, 0, 0, 251, 1148, 1, 0, 0, 0, 253, 1151, 1, 0, 0, 0, - 255, 1154, 1, 0, 0, 0, 257, 1158, 1, 0, 0, 0, 259, 1161, 1, 0, 0, 0, 261, 1166, 1, 0, 0, 0, 263, 1169, 1, 0, 0, 0, - 265, 1173, 1, 0, 0, 0, 267, 1175, 1, 0, 0, 0, 269, 1177, 1, 0, 0, 0, 271, 1179, 1, 0, 0, 0, 273, 1181, 1, 0, 0, 0, - 275, 1184, 1, 0, 0, 0, 277, 1186, 1, 0, 0, 0, 279, 1189, 1, 0, 0, 0, 281, 1192, 1, 0, 0, 0, 283, 1195, 1, 0, 0, 0, - 285, 1198, 1, 0, 0, 0, 287, 1201, 1, 0, 0, 0, 289, 1203, 1, 0, 0, 0, 291, 1205, 1, 0, 0, 0, 293, 1207, 1, 0, 0, 0, - 295, 1209, 1, 0, 0, 0, 297, 1212, 1, 0, 0, 0, 299, 1215, 1, 0, 0, 0, 301, 1217, 1, 0, 0, 0, 303, 1219, 1, 0, 0, 0, - 305, 1221, 1, 0, 0, 0, 307, 1223, 1, 0, 0, 0, 309, 1225, 1, 0, 0, 0, 311, 1227, 1, 0, 0, 0, 313, 1229, 1, 0, 0, 0, - 315, 1231, 1, 0, 0, 0, 317, 1233, 1, 0, 0, 0, 319, 1235, 1, 0, 0, 0, 321, 1237, 1, 0, 0, 0, 323, 1239, 1, 0, 0, 0, - 325, 1241, 1, 0, 0, 0, 327, 1248, 1, 0, 0, 0, 329, 1256, 1, 0, 0, 0, 331, 1262, 1, 0, 0, 0, 333, 1268, 1, 0, 0, 0, - 335, 1282, 1, 0, 0, 0, 337, 1285, 1, 0, 0, 0, 339, 1300, 1, 0, 0, 0, 341, 1315, 1, 0, 0, 0, 343, 1327, 1, 0, 0, 0, - 345, 1345, 1, 0, 0, 0, 347, 1347, 1, 0, 0, 0, 349, 1351, 1, 0, 0, 0, 351, 1362, 1, 0, 0, 0, 353, 1372, 1, 0, 0, 0, - 355, 1382, 1, 0, 0, 0, 357, 359, 7, 0, 0, 0, 358, 357, 1, 0, 0, 0, 359, 360, 1, 0, 0, 0, 360, 358, 1, 0, 0, 0, 360, - 361, 1, 0, 0, 0, 361, 362, 1, 0, 0, 0, 362, 363, 6, 0, 0, 0, 363, 2, 1, 0, 0, 0, 364, 366, 7, 1, 0, 0, 365, 364, 1, - 0, 0, 0, 366, 367, 1, 0, 0, 0, 367, 365, 1, 0, 0, 0, 367, 368, 1, 0, 0, 0, 368, 369, 1, 0, 0, 0, 369, 370, 6, 1, 0, - 0, 370, 4, 1, 0, 0, 0, 371, 372, 5, 45, 0, 0, 372, 373, 5, 45, 0, 0, 373, 377, 1, 0, 0, 0, 374, 376, 8, 0, 0, 0, - 375, 374, 1, 0, 0, 0, 376, 379, 1, 0, 0, 0, 377, 375, 1, 0, 0, 0, 377, 378, 1, 0, 0, 0, 378, 380, 1, 0, 0, 0, 379, - 377, 1, 0, 0, 0, 380, 381, 6, 2, 1, 0, 381, 6, 1, 0, 0, 0, 382, 383, 5, 47, 0, 0, 383, 384, 5, 42, 0, 0, 384, 388, - 1, 0, 0, 0, 385, 387, 9, 0, 0, 0, 386, 385, 1, 0, 0, 0, 387, 390, 1, 0, 0, 0, 388, 389, 1, 0, 0, 0, 388, 386, 1, 0, - 0, 0, 389, 391, 1, 0, 0, 0, 390, 388, 1, 0, 0, 0, 391, 392, 5, 42, 0, 0, 392, 393, 5, 47, 0, 0, 393, 394, 1, 0, 0, - 0, 394, 395, 6, 3, 1, 0, 395, 8, 1, 0, 0, 0, 396, 400, 5, 96, 0, 0, 397, 399, 8, 0, 0, 0, 398, 397, 1, 0, 0, 0, 399, - 402, 1, 0, 0, 0, 400, 398, 1, 0, 0, 0, 400, 401, 1, 0, 0, 0, 401, 403, 1, 0, 0, 0, 402, 400, 1, 0, 0, 0, 403, 404, - 6, 4, 2, 0, 404, 10, 1, 0, 0, 0, 405, 406, 7, 2, 0, 0, 406, 407, 7, 3, 0, 0, 407, 408, 7, 4, 0, 0, 408, 12, 1, 0, 0, - 0, 409, 410, 7, 2, 0, 0, 410, 411, 7, 5, 0, 0, 411, 412, 7, 5, 0, 0, 412, 413, 7, 6, 0, 0, 413, 414, 7, 4, 0, 0, - 414, 415, 7, 4, 0, 0, 415, 14, 1, 0, 0, 0, 416, 417, 7, 2, 0, 0, 417, 418, 7, 7, 0, 0, 418, 419, 7, 8, 0, 0, 419, - 420, 7, 6, 0, 0, 420, 421, 7, 9, 0, 0, 421, 16, 1, 0, 0, 0, 422, 423, 7, 2, 0, 0, 423, 424, 7, 10, 0, 0, 424, 425, - 7, 11, 0, 0, 425, 426, 7, 2, 0, 0, 426, 427, 7, 4, 0, 0, 427, 18, 1, 0, 0, 0, 428, 429, 7, 2, 0, 0, 429, 430, 7, 10, - 0, 0, 430, 431, 7, 10, 0, 0, 431, 20, 1, 0, 0, 0, 432, 433, 7, 2, 0, 0, 433, 434, 7, 12, 0, 0, 434, 435, 7, 13, 0, - 0, 435, 22, 1, 0, 0, 0, 436, 437, 7, 2, 0, 0, 437, 438, 7, 9, 0, 0, 438, 439, 7, 5, 0, 0, 439, 440, 7, 14, 0, 0, - 440, 441, 7, 11, 0, 0, 441, 442, 7, 8, 0, 0, 442, 443, 7, 6, 0, 0, 443, 444, 7, 5, 0, 0, 444, 445, 7, 8, 0, 0, 445, - 446, 7, 15, 0, 0, 446, 447, 7, 9, 0, 0, 447, 448, 7, 6, 0, 0, 448, 24, 1, 0, 0, 0, 449, 450, 7, 2, 0, 0, 450, 451, - 7, 9, 0, 0, 451, 452, 7, 9, 0, 0, 452, 453, 7, 2, 0, 0, 453, 454, 7, 16, 0, 0, 454, 26, 1, 0, 0, 0, 455, 456, 7, 2, - 0, 0, 456, 457, 7, 4, 0, 0, 457, 458, 7, 4, 0, 0, 458, 459, 7, 6, 0, 0, 459, 460, 7, 9, 0, 0, 460, 461, 7, 8, 0, 0, - 461, 28, 1, 0, 0, 0, 462, 463, 7, 2, 0, 0, 463, 464, 7, 8, 0, 0, 464, 465, 7, 8, 0, 0, 465, 466, 7, 9, 0, 0, 466, - 467, 7, 11, 0, 0, 467, 468, 7, 3, 0, 0, 468, 469, 7, 15, 0, 0, 469, 470, 7, 8, 0, 0, 470, 471, 7, 6, 0, 0, 471, 30, - 1, 0, 0, 0, 472, 473, 7, 2, 0, 0, 473, 474, 7, 4, 0, 0, 474, 475, 7, 4, 0, 0, 475, 476, 7, 15, 0, 0, 476, 477, 7, - 17, 0, 0, 477, 478, 7, 6, 0, 0, 478, 32, 1, 0, 0, 0, 479, 480, 7, 3, 0, 0, 480, 481, 7, 6, 0, 0, 481, 482, 7, 18, 0, - 0, 482, 483, 7, 11, 0, 0, 483, 484, 7, 12, 0, 0, 484, 34, 1, 0, 0, 0, 485, 486, 7, 3, 0, 0, 486, 487, 7, 10, 0, 0, - 487, 488, 7, 19, 0, 0, 488, 489, 7, 5, 0, 0, 489, 490, 7, 20, 0, 0, 490, 36, 1, 0, 0, 0, 491, 492, 7, 3, 0, 0, 492, - 493, 7, 19, 0, 0, 493, 494, 7, 13, 0, 0, 494, 495, 7, 16, 0, 0, 495, 38, 1, 0, 0, 0, 496, 497, 7, 3, 0, 0, 497, 498, - 7, 15, 0, 0, 498, 499, 7, 7, 0, 0, 499, 500, 7, 7, 0, 0, 500, 501, 7, 6, 0, 0, 501, 502, 7, 9, 0, 0, 502, 40, 1, 0, - 0, 0, 503, 504, 7, 3, 0, 0, 504, 505, 7, 15, 0, 0, 505, 506, 7, 4, 0, 0, 506, 42, 1, 0, 0, 0, 507, 508, 7, 5, 0, 0, - 508, 509, 7, 2, 0, 0, 509, 510, 7, 4, 0, 0, 510, 511, 7, 6, 0, 0, 511, 44, 1, 0, 0, 0, 512, 513, 7, 5, 0, 0, 513, - 514, 7, 19, 0, 0, 514, 515, 7, 17, 0, 0, 515, 516, 7, 21, 0, 0, 516, 517, 7, 19, 0, 0, 517, 518, 7, 12, 0, 0, 518, - 519, 7, 6, 0, 0, 519, 520, 7, 12, 0, 0, 520, 521, 7, 8, 0, 0, 521, 46, 1, 0, 0, 0, 522, 523, 7, 5, 0, 0, 523, 524, - 7, 19, 0, 0, 524, 525, 7, 12, 0, 0, 525, 526, 7, 7, 0, 0, 526, 527, 7, 11, 0, 0, 527, 528, 7, 18, 0, 0, 528, 529, 7, - 15, 0, 0, 529, 530, 7, 9, 0, 0, 530, 531, 7, 2, 0, 0, 531, 532, 7, 8, 0, 0, 532, 533, 7, 11, 0, 0, 533, 534, 7, 19, - 0, 0, 534, 535, 7, 12, 0, 0, 535, 48, 1, 0, 0, 0, 536, 537, 7, 5, 0, 0, 537, 538, 7, 19, 0, 0, 538, 539, 7, 12, 0, - 0, 539, 540, 7, 4, 0, 0, 540, 541, 7, 8, 0, 0, 541, 542, 7, 2, 0, 0, 542, 543, 7, 12, 0, 0, 543, 544, 7, 8, 0, 0, - 544, 50, 1, 0, 0, 0, 545, 546, 7, 5, 0, 0, 546, 547, 7, 19, 0, 0, 547, 548, 7, 12, 0, 0, 548, 549, 7, 8, 0, 0, 549, - 550, 7, 6, 0, 0, 550, 551, 7, 22, 0, 0, 551, 552, 7, 8, 0, 0, 552, 52, 1, 0, 0, 0, 553, 554, 7, 5, 0, 0, 554, 555, - 7, 19, 0, 0, 555, 556, 7, 23, 0, 0, 556, 557, 7, 6, 0, 0, 557, 558, 7, 9, 0, 0, 558, 54, 1, 0, 0, 0, 559, 560, 7, - 13, 0, 0, 560, 561, 7, 6, 0, 0, 561, 562, 7, 7, 0, 0, 562, 563, 7, 2, 0, 0, 563, 564, 7, 15, 0, 0, 564, 565, 7, 10, - 0, 0, 565, 566, 7, 8, 0, 0, 566, 56, 1, 0, 0, 0, 567, 568, 7, 13, 0, 0, 568, 569, 7, 11, 0, 0, 569, 570, 7, 4, 0, 0, - 570, 571, 7, 5, 0, 0, 571, 572, 7, 19, 0, 0, 572, 573, 7, 12, 0, 0, 573, 574, 7, 12, 0, 0, 574, 575, 7, 6, 0, 0, - 575, 576, 7, 5, 0, 0, 576, 577, 7, 8, 0, 0, 577, 58, 1, 0, 0, 0, 578, 579, 7, 13, 0, 0, 579, 580, 7, 19, 0, 0, 580, - 581, 7, 24, 0, 0, 581, 582, 7, 12, 0, 0, 582, 583, 7, 8, 0, 0, 583, 584, 7, 19, 0, 0, 584, 60, 1, 0, 0, 0, 585, 586, - 7, 6, 0, 0, 586, 587, 7, 10, 0, 0, 587, 588, 7, 4, 0, 0, 588, 589, 7, 6, 0, 0, 589, 62, 1, 0, 0, 0, 590, 591, 7, 6, - 0, 0, 591, 592, 7, 10, 0, 0, 592, 593, 7, 4, 0, 0, 593, 594, 7, 11, 0, 0, 594, 595, 7, 7, 0, 0, 595, 64, 1, 0, 0, 0, - 596, 597, 7, 6, 0, 0, 597, 598, 7, 12, 0, 0, 598, 599, 7, 13, 0, 0, 599, 66, 1, 0, 0, 0, 600, 601, 7, 6, 0, 0, 601, - 602, 7, 12, 0, 0, 602, 603, 7, 8, 0, 0, 603, 604, 7, 11, 0, 0, 604, 605, 7, 8, 0, 0, 605, 606, 7, 16, 0, 0, 606, 68, - 1, 0, 0, 0, 607, 608, 7, 6, 0, 0, 608, 609, 7, 22, 0, 0, 609, 610, 7, 11, 0, 0, 610, 611, 7, 8, 0, 0, 611, 70, 1, 0, - 0, 0, 612, 613, 7, 7, 0, 0, 613, 614, 7, 11, 0, 0, 614, 615, 7, 10, 0, 0, 615, 616, 7, 6, 0, 0, 616, 72, 1, 0, 0, 0, - 617, 618, 7, 7, 0, 0, 618, 619, 7, 19, 0, 0, 619, 620, 7, 9, 0, 0, 620, 74, 1, 0, 0, 0, 621, 622, 7, 7, 0, 0, 622, - 623, 7, 19, 0, 0, 623, 624, 7, 9, 0, 0, 624, 625, 7, 5, 0, 0, 625, 626, 7, 6, 0, 0, 626, 76, 1, 0, 0, 0, 627, 628, - 7, 7, 0, 0, 628, 629, 7, 15, 0, 0, 629, 630, 7, 12, 0, 0, 630, 631, 7, 5, 0, 0, 631, 632, 7, 8, 0, 0, 632, 633, 7, - 11, 0, 0, 633, 634, 7, 19, 0, 0, 634, 635, 7, 12, 0, 0, 635, 78, 1, 0, 0, 0, 636, 637, 7, 7, 0, 0, 637, 638, 7, 2, - 0, 0, 638, 639, 7, 11, 0, 0, 639, 640, 7, 9, 0, 0, 640, 641, 7, 12, 0, 0, 641, 642, 7, 6, 0, 0, 642, 643, 7, 4, 0, - 0, 643, 644, 7, 4, 0, 0, 644, 80, 1, 0, 0, 0, 645, 646, 7, 18, 0, 0, 646, 647, 7, 6, 0, 0, 647, 648, 7, 12, 0, 0, - 648, 649, 7, 6, 0, 0, 649, 650, 7, 9, 0, 0, 650, 651, 7, 2, 0, 0, 651, 652, 7, 8, 0, 0, 652, 653, 7, 6, 0, 0, 653, - 82, 1, 0, 0, 0, 654, 655, 7, 18, 0, 0, 655, 656, 7, 6, 0, 0, 656, 657, 7, 12, 0, 0, 657, 658, 7, 6, 0, 0, 658, 659, - 7, 9, 0, 0, 659, 660, 7, 11, 0, 0, 660, 661, 7, 5, 0, 0, 661, 84, 1, 0, 0, 0, 662, 663, 7, 18, 0, 0, 663, 664, 7, - 15, 0, 0, 664, 665, 7, 2, 0, 0, 665, 666, 7, 9, 0, 0, 666, 667, 7, 13, 0, 0, 667, 668, 7, 6, 0, 0, 668, 669, 7, 13, - 0, 0, 669, 86, 1, 0, 0, 0, 670, 671, 7, 18, 0, 0, 671, 672, 7, 9, 0, 0, 672, 673, 7, 19, 0, 0, 673, 674, 7, 15, 0, - 0, 674, 675, 7, 21, 0, 0, 675, 88, 1, 0, 0, 0, 676, 677, 7, 11, 0, 0, 677, 678, 7, 7, 0, 0, 678, 90, 1, 0, 0, 0, - 679, 680, 7, 11, 0, 0, 680, 681, 7, 17, 0, 0, 681, 682, 7, 21, 0, 0, 682, 683, 7, 15, 0, 0, 683, 684, 7, 9, 0, 0, - 684, 685, 7, 6, 0, 0, 685, 92, 1, 0, 0, 0, 686, 687, 7, 11, 0, 0, 687, 688, 7, 12, 0, 0, 688, 94, 1, 0, 0, 0, 689, - 690, 7, 11, 0, 0, 690, 691, 7, 12, 0, 0, 691, 692, 7, 6, 0, 0, 692, 693, 7, 9, 0, 0, 693, 694, 7, 8, 0, 0, 694, 695, - 7, 11, 0, 0, 695, 696, 7, 2, 0, 0, 696, 697, 7, 10, 0, 0, 697, 96, 1, 0, 0, 0, 698, 699, 7, 11, 0, 0, 699, 700, 7, - 12, 0, 0, 700, 701, 7, 19, 0, 0, 701, 702, 7, 15, 0, 0, 702, 703, 7, 8, 0, 0, 703, 98, 1, 0, 0, 0, 704, 705, 7, 11, - 0, 0, 705, 706, 7, 4, 0, 0, 706, 100, 1, 0, 0, 0, 707, 708, 7, 10, 0, 0, 708, 709, 7, 2, 0, 0, 709, 710, 7, 3, 0, 0, - 710, 711, 7, 6, 0, 0, 711, 712, 7, 10, 0, 0, 712, 102, 1, 0, 0, 0, 713, 714, 7, 10, 0, 0, 714, 715, 7, 11, 0, 0, - 715, 716, 7, 3, 0, 0, 716, 717, 7, 9, 0, 0, 717, 718, 7, 2, 0, 0, 718, 719, 7, 9, 0, 0, 719, 720, 7, 16, 0, 0, 720, - 104, 1, 0, 0, 0, 721, 722, 7, 10, 0, 0, 722, 723, 7, 11, 0, 0, 723, 724, 7, 12, 0, 0, 724, 725, 7, 20, 0, 0, 725, - 726, 7, 2, 0, 0, 726, 727, 7, 18, 0, 0, 727, 728, 7, 6, 0, 0, 728, 106, 1, 0, 0, 0, 729, 730, 7, 10, 0, 0, 730, 731, - 7, 19, 0, 0, 731, 732, 7, 19, 0, 0, 732, 733, 7, 21, 0, 0, 733, 108, 1, 0, 0, 0, 734, 735, 7, 10, 0, 0, 735, 736, 7, - 11, 0, 0, 736, 737, 7, 8, 0, 0, 737, 738, 7, 6, 0, 0, 738, 739, 7, 9, 0, 0, 739, 740, 7, 2, 0, 0, 740, 741, 7, 10, - 0, 0, 741, 110, 1, 0, 0, 0, 742, 743, 7, 17, 0, 0, 743, 744, 7, 2, 0, 0, 744, 745, 7, 21, 0, 0, 745, 112, 1, 0, 0, - 0, 746, 747, 7, 17, 0, 0, 747, 748, 7, 19, 0, 0, 748, 749, 7, 13, 0, 0, 749, 114, 1, 0, 0, 0, 750, 751, 7, 12, 0, 0, - 751, 752, 7, 2, 0, 0, 752, 753, 7, 12, 0, 0, 753, 754, 7, 13, 0, 0, 754, 116, 1, 0, 0, 0, 755, 756, 7, 12, 0, 0, - 756, 757, 7, 6, 0, 0, 757, 758, 7, 24, 0, 0, 758, 118, 1, 0, 0, 0, 759, 760, 7, 12, 0, 0, 760, 761, 7, 6, 0, 0, 761, - 762, 7, 22, 0, 0, 762, 763, 7, 8, 0, 0, 763, 120, 1, 0, 0, 0, 764, 765, 7, 12, 0, 0, 765, 766, 7, 19, 0, 0, 766, - 767, 7, 9, 0, 0, 767, 122, 1, 0, 0, 0, 768, 769, 7, 12, 0, 0, 769, 770, 7, 19, 0, 0, 770, 771, 7, 8, 0, 0, 771, 124, - 1, 0, 0, 0, 772, 773, 7, 12, 0, 0, 773, 774, 7, 15, 0, 0, 774, 775, 7, 10, 0, 0, 775, 776, 7, 10, 0, 0, 776, 126, 1, - 0, 0, 0, 777, 778, 7, 19, 0, 0, 778, 779, 7, 7, 0, 0, 779, 128, 1, 0, 0, 0, 780, 781, 7, 19, 0, 0, 781, 782, 7, 12, - 0, 0, 782, 130, 1, 0, 0, 0, 783, 784, 7, 19, 0, 0, 784, 785, 7, 21, 0, 0, 785, 786, 7, 6, 0, 0, 786, 787, 7, 12, 0, - 0, 787, 132, 1, 0, 0, 0, 788, 789, 7, 19, 0, 0, 789, 790, 7, 9, 0, 0, 790, 134, 1, 0, 0, 0, 791, 792, 7, 19, 0, 0, - 792, 793, 7, 8, 0, 0, 793, 794, 7, 14, 0, 0, 794, 795, 7, 6, 0, 0, 795, 796, 7, 9, 0, 0, 796, 797, 7, 4, 0, 0, 797, - 136, 1, 0, 0, 0, 798, 799, 7, 19, 0, 0, 799, 800, 7, 15, 0, 0, 800, 801, 7, 8, 0, 0, 801, 138, 1, 0, 0, 0, 802, 803, - 7, 21, 0, 0, 803, 804, 7, 2, 0, 0, 804, 805, 7, 5, 0, 0, 805, 806, 7, 20, 0, 0, 806, 807, 7, 2, 0, 0, 807, 808, 7, - 18, 0, 0, 808, 809, 7, 6, 0, 0, 809, 140, 1, 0, 0, 0, 810, 811, 7, 21, 0, 0, 811, 812, 7, 2, 0, 0, 812, 813, 7, 9, - 0, 0, 813, 814, 7, 2, 0, 0, 814, 815, 7, 17, 0, 0, 815, 816, 7, 6, 0, 0, 816, 817, 7, 8, 0, 0, 817, 818, 7, 6, 0, 0, - 818, 819, 7, 9, 0, 0, 819, 142, 1, 0, 0, 0, 820, 821, 7, 21, 0, 0, 821, 822, 7, 19, 0, 0, 822, 823, 7, 9, 0, 0, 823, - 824, 7, 8, 0, 0, 824, 144, 1, 0, 0, 0, 825, 826, 7, 21, 0, 0, 826, 827, 7, 19, 0, 0, 827, 828, 7, 4, 0, 0, 828, 829, - 7, 8, 0, 0, 829, 830, 7, 21, 0, 0, 830, 831, 7, 19, 0, 0, 831, 832, 7, 12, 0, 0, 832, 833, 7, 6, 0, 0, 833, 834, 7, - 13, 0, 0, 834, 146, 1, 0, 0, 0, 835, 836, 7, 21, 0, 0, 836, 837, 7, 9, 0, 0, 837, 838, 7, 11, 0, 0, 838, 839, 7, 23, - 0, 0, 839, 840, 7, 2, 0, 0, 840, 841, 7, 8, 0, 0, 841, 842, 7, 6, 0, 0, 842, 148, 1, 0, 0, 0, 843, 844, 7, 21, 0, 0, - 844, 845, 7, 9, 0, 0, 845, 846, 7, 19, 0, 0, 846, 847, 7, 5, 0, 0, 847, 848, 7, 6, 0, 0, 848, 849, 7, 13, 0, 0, 849, - 850, 7, 15, 0, 0, 850, 851, 7, 9, 0, 0, 851, 852, 7, 6, 0, 0, 852, 150, 1, 0, 0, 0, 853, 854, 7, 21, 0, 0, 854, 855, - 7, 9, 0, 0, 855, 856, 7, 19, 0, 0, 856, 857, 7, 5, 0, 0, 857, 858, 7, 6, 0, 0, 858, 859, 7, 4, 0, 0, 859, 860, 7, 4, - 0, 0, 860, 152, 1, 0, 0, 0, 861, 862, 7, 21, 0, 0, 862, 863, 7, 9, 0, 0, 863, 864, 7, 19, 0, 0, 864, 865, 7, 8, 0, - 0, 865, 866, 7, 6, 0, 0, 866, 867, 7, 5, 0, 0, 867, 868, 7, 8, 0, 0, 868, 869, 7, 6, 0, 0, 869, 870, 7, 13, 0, 0, - 870, 154, 1, 0, 0, 0, 871, 872, 7, 21, 0, 0, 872, 873, 7, 15, 0, 0, 873, 874, 7, 9, 0, 0, 874, 875, 7, 6, 0, 0, 875, - 156, 1, 0, 0, 0, 876, 877, 7, 9, 0, 0, 877, 878, 7, 2, 0, 0, 878, 879, 7, 12, 0, 0, 879, 880, 7, 18, 0, 0, 880, 881, - 7, 6, 0, 0, 881, 158, 1, 0, 0, 0, 882, 883, 7, 9, 0, 0, 883, 884, 7, 6, 0, 0, 884, 885, 7, 5, 0, 0, 885, 886, 7, 19, - 0, 0, 886, 887, 7, 9, 0, 0, 887, 888, 7, 13, 0, 0, 888, 160, 1, 0, 0, 0, 889, 890, 7, 9, 0, 0, 890, 891, 7, 6, 0, 0, - 891, 892, 7, 18, 0, 0, 892, 893, 7, 11, 0, 0, 893, 894, 7, 4, 0, 0, 894, 895, 7, 8, 0, 0, 895, 896, 7, 6, 0, 0, 896, - 897, 7, 9, 0, 0, 897, 162, 1, 0, 0, 0, 898, 899, 7, 9, 0, 0, 899, 900, 7, 6, 0, 0, 900, 901, 7, 25, 0, 0, 901, 902, - 7, 6, 0, 0, 902, 903, 7, 5, 0, 0, 903, 904, 7, 8, 0, 0, 904, 164, 1, 0, 0, 0, 905, 906, 7, 9, 0, 0, 906, 907, 7, 6, - 0, 0, 907, 908, 7, 10, 0, 0, 908, 909, 7, 6, 0, 0, 909, 910, 7, 2, 0, 0, 910, 911, 7, 4, 0, 0, 911, 912, 7, 6, 0, 0, - 912, 166, 1, 0, 0, 0, 913, 914, 7, 9, 0, 0, 914, 915, 7, 6, 0, 0, 915, 916, 7, 17, 0, 0, 916, 168, 1, 0, 0, 0, 917, - 918, 7, 9, 0, 0, 918, 919, 7, 6, 0, 0, 919, 920, 7, 21, 0, 0, 920, 921, 7, 19, 0, 0, 921, 922, 7, 9, 0, 0, 922, 923, - 7, 8, 0, 0, 923, 170, 1, 0, 0, 0, 924, 925, 7, 9, 0, 0, 925, 926, 7, 6, 0, 0, 926, 927, 7, 8, 0, 0, 927, 928, 7, 15, - 0, 0, 928, 929, 7, 9, 0, 0, 929, 930, 7, 12, 0, 0, 930, 172, 1, 0, 0, 0, 931, 932, 7, 9, 0, 0, 932, 933, 7, 19, 0, - 0, 933, 934, 7, 10, 0, 0, 934, 174, 1, 0, 0, 0, 935, 936, 7, 9, 0, 0, 936, 937, 7, 19, 0, 0, 937, 938, 7, 9, 0, 0, - 938, 176, 1, 0, 0, 0, 939, 940, 7, 9, 0, 0, 940, 941, 7, 6, 0, 0, 941, 942, 7, 4, 0, 0, 942, 943, 7, 8, 0, 0, 943, - 944, 7, 9, 0, 0, 944, 945, 7, 11, 0, 0, 945, 946, 7, 5, 0, 0, 946, 947, 7, 8, 0, 0, 947, 178, 1, 0, 0, 0, 948, 949, - 7, 4, 0, 0, 949, 950, 7, 6, 0, 0, 950, 951, 7, 10, 0, 0, 951, 952, 7, 6, 0, 0, 952, 953, 7, 5, 0, 0, 953, 954, 7, 8, - 0, 0, 954, 180, 1, 0, 0, 0, 955, 956, 7, 4, 0, 0, 956, 957, 7, 6, 0, 0, 957, 958, 7, 23, 0, 0, 958, 959, 7, 6, 0, 0, - 959, 960, 7, 9, 0, 0, 960, 961, 7, 11, 0, 0, 961, 962, 7, 8, 0, 0, 962, 963, 7, 16, 0, 0, 963, 182, 1, 0, 0, 0, 964, - 965, 7, 4, 0, 0, 965, 966, 7, 14, 0, 0, 966, 967, 7, 2, 0, 0, 967, 968, 7, 9, 0, 0, 968, 969, 7, 6, 0, 0, 969, 970, - 7, 13, 0, 0, 970, 184, 1, 0, 0, 0, 971, 972, 7, 4, 0, 0, 972, 973, 7, 11, 0, 0, 973, 974, 7, 18, 0, 0, 974, 975, 7, - 12, 0, 0, 975, 976, 7, 2, 0, 0, 976, 977, 7, 10, 0, 0, 977, 186, 1, 0, 0, 0, 978, 979, 7, 4, 0, 0, 979, 980, 7, 10, - 0, 0, 980, 981, 7, 2, 0, 0, 981, 188, 1, 0, 0, 0, 982, 983, 7, 4, 0, 0, 983, 984, 7, 10, 0, 0, 984, 985, 7, 10, 0, - 0, 985, 190, 1, 0, 0, 0, 986, 987, 7, 4, 0, 0, 987, 988, 7, 9, 0, 0, 988, 989, 7, 2, 0, 0, 989, 192, 1, 0, 0, 0, - 990, 991, 7, 4, 0, 0, 991, 992, 7, 9, 0, 0, 992, 993, 7, 10, 0, 0, 993, 194, 1, 0, 0, 0, 994, 995, 7, 4, 0, 0, 995, - 996, 7, 15, 0, 0, 996, 997, 7, 3, 0, 0, 997, 998, 7, 8, 0, 0, 998, 999, 7, 16, 0, 0, 999, 1000, 7, 21, 0, 0, 1000, - 1001, 7, 6, 0, 0, 1001, 196, 1, 0, 0, 0, 1002, 1003, 7, 4, 0, 0, 1003, 1004, 7, 8, 0, 0, 1004, 1005, 7, 9, 0, 0, - 1005, 1006, 7, 19, 0, 0, 1006, 1007, 7, 12, 0, 0, 1007, 1008, 7, 18, 0, 0, 1008, 198, 1, 0, 0, 0, 1009, 1010, 7, 4, - 0, 0, 1010, 1011, 7, 6, 0, 0, 1011, 1012, 7, 26, 0, 0, 1012, 1013, 7, 15, 0, 0, 1013, 1014, 7, 6, 0, 0, 1014, 1015, - 7, 12, 0, 0, 1015, 1016, 7, 5, 0, 0, 1016, 1017, 7, 6, 0, 0, 1017, 200, 1, 0, 0, 0, 1018, 1019, 7, 8, 0, 0, 1019, - 1020, 7, 14, 0, 0, 1020, 1021, 7, 6, 0, 0, 1021, 1022, 7, 12, 0, 0, 1022, 202, 1, 0, 0, 0, 1023, 1024, 7, 8, 0, 0, - 1024, 1025, 7, 19, 0, 0, 1025, 204, 1, 0, 0, 0, 1026, 1027, 7, 8, 0, 0, 1027, 1028, 7, 9, 0, 0, 1028, 1029, 7, 2, 0, - 0, 1029, 1030, 7, 12, 0, 0, 1030, 1031, 7, 4, 0, 0, 1031, 1032, 7, 21, 0, 0, 1032, 1033, 7, 19, 0, 0, 1033, 1034, 7, - 9, 0, 0, 1034, 1035, 7, 8, 0, 0, 1035, 206, 1, 0, 0, 0, 1036, 1037, 7, 8, 0, 0, 1037, 1038, 7, 16, 0, 0, 1038, 1039, - 7, 21, 0, 0, 1039, 1040, 7, 6, 0, 0, 1040, 208, 1, 0, 0, 0, 1041, 1042, 7, 15, 0, 0, 1042, 1043, 7, 12, 0, 0, 1043, - 1044, 7, 2, 0, 0, 1044, 1045, 7, 7, 0, 0, 1045, 1046, 7, 7, 0, 0, 1046, 1047, 7, 6, 0, 0, 1047, 1048, 7, 5, 0, 0, - 1048, 1049, 7, 8, 0, 0, 1049, 1050, 7, 6, 0, 0, 1050, 1051, 7, 13, 0, 0, 1051, 210, 1, 0, 0, 0, 1052, 1053, 7, 15, - 0, 0, 1053, 1054, 7, 12, 0, 0, 1054, 1055, 7, 11, 0, 0, 1055, 1056, 7, 8, 0, 0, 1056, 1057, 7, 4, 0, 0, 1057, 212, - 1, 0, 0, 0, 1058, 1059, 7, 15, 0, 0, 1059, 1060, 7, 12, 0, 0, 1060, 1061, 7, 8, 0, 0, 1061, 1062, 7, 11, 0, 0, 1062, - 1063, 7, 10, 0, 0, 1063, 214, 1, 0, 0, 0, 1064, 1065, 7, 15, 0, 0, 1065, 1066, 7, 4, 0, 0, 1066, 1067, 7, 6, 0, 0, - 1067, 216, 1, 0, 0, 0, 1068, 1069, 7, 23, 0, 0, 1069, 1070, 7, 2, 0, 0, 1070, 1071, 7, 9, 0, 0, 1071, 1072, 7, 11, - 0, 0, 1072, 1073, 7, 2, 0, 0, 1073, 1074, 7, 3, 0, 0, 1074, 1075, 7, 10, 0, 0, 1075, 1076, 7, 6, 0, 0, 1076, 218, 1, - 0, 0, 0, 1077, 1078, 7, 23, 0, 0, 1078, 1079, 7, 11, 0, 0, 1079, 1080, 7, 6, 0, 0, 1080, 1081, 7, 24, 0, 0, 1081, - 220, 1, 0, 0, 0, 1082, 1083, 7, 23, 0, 0, 1083, 1084, 7, 21, 0, 0, 1084, 1085, 7, 20, 0, 0, 1085, 1086, 7, 18, 0, 0, - 1086, 222, 1, 0, 0, 0, 1087, 1088, 7, 23, 0, 0, 1088, 1089, 7, 17, 0, 0, 1089, 1090, 7, 19, 0, 0, 1090, 1091, 7, 13, - 0, 0, 1091, 1092, 7, 6, 0, 0, 1092, 224, 1, 0, 0, 0, 1093, 1094, 7, 23, 0, 0, 1094, 1095, 7, 21, 0, 0, 1095, 1096, - 7, 9, 0, 0, 1096, 1097, 7, 19, 0, 0, 1097, 1098, 7, 21, 0, 0, 1098, 226, 1, 0, 0, 0, 1099, 1100, 7, 23, 0, 0, 1100, - 1101, 7, 15, 0, 0, 1101, 1102, 7, 12, 0, 0, 1102, 1103, 7, 11, 0, 0, 1103, 1104, 7, 8, 0, 0, 1104, 228, 1, 0, 0, 0, - 1105, 1106, 7, 24, 0, 0, 1106, 1107, 7, 2, 0, 0, 1107, 1108, 7, 11, 0, 0, 1108, 1109, 7, 8, 0, 0, 1109, 230, 1, 0, - 0, 0, 1110, 1111, 7, 24, 0, 0, 1111, 1112, 7, 11, 0, 0, 1112, 1113, 7, 8, 0, 0, 1113, 1114, 7, 14, 0, 0, 1114, 232, - 1, 0, 0, 0, 1115, 1116, 7, 24, 0, 0, 1116, 1117, 7, 14, 0, 0, 1117, 1118, 7, 6, 0, 0, 1118, 1119, 7, 12, 0, 0, 1119, - 234, 1, 0, 0, 0, 1120, 1121, 7, 24, 0, 0, 1121, 1122, 7, 14, 0, 0, 1122, 1123, 7, 11, 0, 0, 1123, 1124, 7, 10, 0, 0, - 1124, 1125, 7, 6, 0, 0, 1125, 236, 1, 0, 0, 0, 1126, 1127, 7, 22, 0, 0, 1127, 1128, 7, 12, 0, 0, 1128, 1129, 7, 19, - 0, 0, 1129, 1130, 7, 9, 0, 0, 1130, 238, 1, 0, 0, 0, 1131, 1132, 7, 22, 0, 0, 1132, 1133, 7, 19, 0, 0, 1133, 1134, - 7, 9, 0, 0, 1134, 240, 1, 0, 0, 0, 1135, 1136, 5, 61, 0, 0, 1136, 242, 1, 0, 0, 0, 1137, 1138, 5, 47, 0, 0, 1138, - 1139, 5, 61, 0, 0, 1139, 244, 1, 0, 0, 0, 1140, 1141, 5, 60, 0, 0, 1141, 246, 1, 0, 0, 0, 1142, 1143, 5, 60, 0, 0, - 1143, 1144, 5, 61, 0, 0, 1144, 1145, 5, 41, 0, 0, 1145, 248, 1, 0, 0, 0, 1146, 1147, 5, 62, 0, 0, 1147, 250, 1, 0, - 0, 0, 1148, 1149, 5, 62, 0, 0, 1149, 1150, 5, 61, 0, 0, 1150, 252, 1, 0, 0, 0, 1151, 1152, 5, 63, 0, 0, 1152, 1153, - 5, 61, 0, 0, 1153, 254, 1, 0, 0, 0, 1154, 1155, 5, 63, 0, 0, 1155, 1156, 5, 47, 0, 0, 1156, 1157, 5, 61, 0, 0, 1157, - 256, 1, 0, 0, 0, 1158, 1159, 5, 63, 0, 0, 1159, 1160, 5, 60, 0, 0, 1160, 258, 1, 0, 0, 0, 1161, 1162, 5, 63, 0, 0, - 1162, 1163, 5, 60, 0, 0, 1163, 1164, 5, 61, 0, 0, 1164, 1165, 5, 41, 0, 0, 1165, 260, 1, 0, 0, 0, 1166, 1167, 5, 63, - 0, 0, 1167, 1168, 5, 62, 0, 0, 1168, 262, 1, 0, 0, 0, 1169, 1170, 5, 63, 0, 0, 1170, 1171, 5, 62, 0, 0, 1171, 1172, - 5, 61, 0, 0, 1172, 264, 1, 0, 0, 0, 1173, 1174, 5, 43, 0, 0, 1174, 266, 1, 0, 0, 0, 1175, 1176, 5, 45, 0, 0, 1176, - 268, 1, 0, 0, 0, 1177, 1178, 5, 42, 0, 0, 1178, 270, 1, 0, 0, 0, 1179, 1180, 5, 47, 0, 0, 1180, 272, 1, 0, 0, 0, - 1181, 1182, 5, 42, 0, 0, 1182, 1183, 5, 42, 0, 0, 1183, 274, 1, 0, 0, 0, 1184, 1185, 5, 38, 0, 0, 1185, 276, 1, 0, - 0, 0, 1186, 1187, 5, 63, 0, 0, 1187, 1188, 5, 63, 0, 0, 1188, 278, 1, 0, 0, 0, 1189, 1190, 5, 61, 0, 0, 1190, 1191, - 5, 62, 0, 0, 1191, 280, 1, 0, 0, 0, 1192, 1193, 5, 60, 0, 0, 1193, 1194, 5, 61, 0, 0, 1194, 282, 1, 0, 0, 0, 1195, - 1196, 5, 58, 0, 0, 1196, 1197, 5, 61, 0, 0, 1197, 284, 1, 0, 0, 0, 1198, 1199, 5, 60, 0, 0, 1199, 1200, 5, 62, 0, 0, - 1200, 286, 1, 0, 0, 0, 1201, 1202, 5, 40, 0, 0, 1202, 288, 1, 0, 0, 0, 1203, 1204, 5, 41, 0, 0, 1204, 290, 1, 0, 0, - 0, 1205, 1206, 5, 91, 0, 0, 1206, 292, 1, 0, 0, 0, 1207, 1208, 5, 93, 0, 0, 1208, 294, 1, 0, 0, 0, 1209, 1210, 5, - 60, 0, 0, 1210, 1211, 5, 60, 0, 0, 1211, 296, 1, 0, 0, 0, 1212, 1213, 5, 62, 0, 0, 1213, 1214, 5, 62, 0, 0, 1214, - 298, 1, 0, 0, 0, 1215, 1216, 5, 58, 0, 0, 1216, 300, 1, 0, 0, 0, 1217, 1218, 5, 59, 0, 0, 1218, 302, 1, 0, 0, 0, - 1219, 1220, 5, 44, 0, 0, 1220, 304, 1, 0, 0, 0, 1221, 1222, 5, 124, 0, 0, 1222, 306, 1, 0, 0, 0, 1223, 1224, 5, 46, - 0, 0, 1224, 308, 1, 0, 0, 0, 1225, 1226, 5, 63, 0, 0, 1226, 310, 1, 0, 0, 0, 1227, 1228, 5, 64, 0, 0, 1228, 312, 1, - 0, 0, 0, 1229, 1230, 5, 94, 0, 0, 1230, 314, 1, 0, 0, 0, 1231, 1232, 5, 39, 0, 0, 1232, 316, 1, 0, 0, 0, 1233, 1234, - 5, 34, 0, 0, 1234, 318, 1, 0, 0, 0, 1235, 1236, 7, 27, 0, 0, 1236, 320, 1, 0, 0, 0, 1237, 1238, 7, 28, 0, 0, 1238, - 322, 1, 0, 0, 0, 1239, 1240, 7, 29, 0, 0, 1240, 324, 1, 0, 0, 0, 1241, 1245, 7, 28, 0, 0, 1242, 1244, 7, 30, 0, 0, - 1243, 1242, 1, 0, 0, 0, 1244, 1247, 1, 0, 0, 0, 1245, 1243, 1, 0, 0, 0, 1245, 1246, 1, 0, 0, 0, 1246, 326, 1, 0, 0, - 0, 1247, 1245, 1, 0, 0, 0, 1248, 1253, 3, 323, 161, 0, 1249, 1252, 5, 95, 0, 0, 1250, 1252, 3, 323, 161, 0, 1251, - 1249, 1, 0, 0, 0, 1251, 1250, 1, 0, 0, 0, 1252, 1255, 1, 0, 0, 0, 1253, 1251, 1, 0, 0, 0, 1253, 1254, 1, 0, 0, 0, - 1254, 328, 1, 0, 0, 0, 1255, 1253, 1, 0, 0, 0, 1256, 1258, 7, 6, 0, 0, 1257, 1259, 7, 31, 0, 0, 1258, 1257, 1, 0, 0, - 0, 1258, 1259, 1, 0, 0, 0, 1259, 1260, 1, 0, 0, 0, 1260, 1261, 3, 325, 162, 0, 1261, 330, 1, 0, 0, 0, 1262, 1263, 3, - 325, 162, 0, 1263, 1264, 5, 46, 0, 0, 1264, 1266, 3, 325, 162, 0, 1265, 1267, 3, 329, 164, 0, 1266, 1265, 1, 0, 0, - 0, 1266, 1267, 1, 0, 0, 0, 1267, 332, 1, 0, 0, 0, 1268, 1269, 3, 325, 162, 0, 1269, 1270, 5, 35, 0, 0, 1270, 1273, - 3, 327, 163, 0, 1271, 1272, 5, 46, 0, 0, 1272, 1274, 3, 327, 163, 0, 1273, 1271, 1, 0, 0, 0, 1273, 1274, 1, 0, 0, 0, - 1274, 1275, 1, 0, 0, 0, 1275, 1277, 5, 35, 0, 0, 1276, 1278, 3, 329, 164, 0, 1277, 1276, 1, 0, 0, 0, 1277, 1278, 1, - 0, 0, 0, 1278, 334, 1, 0, 0, 0, 1279, 1283, 3, 325, 162, 0, 1280, 1283, 3, 331, 165, 0, 1281, 1283, 3, 333, 166, 0, - 1282, 1279, 1, 0, 0, 0, 1282, 1280, 1, 0, 0, 0, 1282, 1281, 1, 0, 0, 0, 1283, 336, 1, 0, 0, 0, 1284, 1286, 3, 325, - 162, 0, 1285, 1284, 1, 0, 0, 0, 1285, 1286, 1, 0, 0, 0, 1286, 1288, 1, 0, 0, 0, 1287, 1289, 7, 32, 0, 0, 1288, 1287, - 1, 0, 0, 0, 1288, 1289, 1, 0, 0, 0, 1289, 1290, 1, 0, 0, 0, 1290, 1291, 7, 3, 0, 0, 1291, 1293, 5, 34, 0, 0, 1292, - 1294, 7, 33, 0, 0, 1293, 1292, 1, 0, 0, 0, 1294, 1295, 1, 0, 0, 0, 1295, 1293, 1, 0, 0, 0, 1295, 1296, 1, 0, 0, 0, - 1296, 1297, 1, 0, 0, 0, 1297, 1298, 5, 34, 0, 0, 1298, 338, 1, 0, 0, 0, 1299, 1301, 3, 325, 162, 0, 1300, 1299, 1, - 0, 0, 0, 1300, 1301, 1, 0, 0, 0, 1301, 1303, 1, 0, 0, 0, 1302, 1304, 7, 32, 0, 0, 1303, 1302, 1, 0, 0, 0, 1303, - 1304, 1, 0, 0, 0, 1304, 1305, 1, 0, 0, 0, 1305, 1306, 7, 19, 0, 0, 1306, 1308, 5, 34, 0, 0, 1307, 1309, 7, 34, 0, 0, - 1308, 1307, 1, 0, 0, 0, 1309, 1310, 1, 0, 0, 0, 1310, 1308, 1, 0, 0, 0, 1310, 1311, 1, 0, 0, 0, 1311, 1312, 1, 0, 0, - 0, 1312, 1313, 5, 34, 0, 0, 1313, 340, 1, 0, 0, 0, 1314, 1316, 3, 325, 162, 0, 1315, 1314, 1, 0, 0, 0, 1315, 1316, - 1, 0, 0, 0, 1316, 1317, 1, 0, 0, 0, 1317, 1318, 7, 13, 0, 0, 1318, 1320, 5, 34, 0, 0, 1319, 1321, 7, 30, 0, 0, 1320, - 1319, 1, 0, 0, 0, 1321, 1322, 1, 0, 0, 0, 1322, 1320, 1, 0, 0, 0, 1322, 1323, 1, 0, 0, 0, 1323, 1324, 1, 0, 0, 0, - 1324, 1325, 5, 34, 0, 0, 1325, 342, 1, 0, 0, 0, 1326, 1328, 3, 325, 162, 0, 1327, 1326, 1, 0, 0, 0, 1327, 1328, 1, - 0, 0, 0, 1328, 1330, 1, 0, 0, 0, 1329, 1331, 7, 32, 0, 0, 1330, 1329, 1, 0, 0, 0, 1330, 1331, 1, 0, 0, 0, 1331, - 1332, 1, 0, 0, 0, 1332, 1333, 7, 22, 0, 0, 1333, 1335, 5, 34, 0, 0, 1334, 1336, 7, 35, 0, 0, 1335, 1334, 1, 0, 0, 0, - 1336, 1337, 1, 0, 0, 0, 1337, 1335, 1, 0, 0, 0, 1337, 1338, 1, 0, 0, 0, 1338, 1339, 1, 0, 0, 0, 1339, 1340, 5, 34, - 0, 0, 1340, 344, 1, 0, 0, 0, 1341, 1346, 3, 337, 168, 0, 1342, 1346, 3, 339, 169, 0, 1343, 1346, 3, 341, 170, 0, - 1344, 1346, 3, 343, 171, 0, 1345, 1341, 1, 0, 0, 0, 1345, 1342, 1, 0, 0, 0, 1345, 1343, 1, 0, 0, 0, 1345, 1344, 1, - 0, 0, 0, 1346, 346, 1, 0, 0, 0, 1347, 1348, 5, 39, 0, 0, 1348, 1349, 9, 0, 0, 0, 1349, 1350, 5, 39, 0, 0, 1350, 348, - 1, 0, 0, 0, 1351, 1357, 5, 34, 0, 0, 1352, 1356, 8, 36, 0, 0, 1353, 1354, 5, 34, 0, 0, 1354, 1356, 5, 34, 0, 0, - 1355, 1352, 1, 0, 0, 0, 1355, 1353, 1, 0, 0, 0, 1356, 1359, 1, 0, 0, 0, 1357, 1355, 1, 0, 0, 0, 1357, 1358, 1, 0, 0, - 0, 1358, 1360, 1, 0, 0, 0, 1359, 1357, 1, 0, 0, 0, 1360, 1361, 5, 34, 0, 0, 1361, 350, 1, 0, 0, 0, 1362, 1369, 7, - 27, 0, 0, 1363, 1365, 5, 95, 0, 0, 1364, 1363, 1, 0, 0, 0, 1364, 1365, 1, 0, 0, 0, 1365, 1366, 1, 0, 0, 0, 1366, - 1368, 7, 29, 0, 0, 1367, 1364, 1, 0, 0, 0, 1368, 1371, 1, 0, 0, 0, 1369, 1367, 1, 0, 0, 0, 1369, 1370, 1, 0, 0, 0, - 1370, 352, 1, 0, 0, 0, 1371, 1369, 1, 0, 0, 0, 1372, 1374, 5, 92, 0, 0, 1373, 1375, 7, 37, 0, 0, 1374, 1373, 1, 0, - 0, 0, 1375, 1376, 1, 0, 0, 0, 1376, 1374, 1, 0, 0, 0, 1376, 1377, 1, 0, 0, 0, 1377, 1378, 1, 0, 0, 0, 1378, 1379, 5, - 92, 0, 0, 1379, 354, 1, 0, 0, 0, 1380, 1383, 3, 351, 175, 0, 1381, 1383, 3, 353, 176, 0, 1382, 1380, 1, 0, 0, 0, - 1382, 1381, 1, 0, 0, 0, 1383, 356, 1, 0, 0, 0, 37, 0, 360, 367, 377, 388, 400, 1245, 1251, 1253, 1258, 1266, 1273, - 1277, 1282, 1285, 1288, 1293, 1295, 1300, 1303, 1308, 1310, 1315, 1320, 1322, 1327, 1330, 1335, 1337, 1345, 1355, - 1357, 1364, 1369, 1374, 1376, 1382, 3, 0, 2, 0, 0, 3, 0, 0, 4, 0 + 333, 1, 0, 0, 0, 0, 343, 1, 0, 0, 0, 0, 345, 1, 0, 0, 0, 0, 347, 1, 0, 0, 0, 0, 353, 1, 0, 0, 0, 1, 356, 1, 0, 0, 0, + 3, 363, 1, 0, 0, 0, 5, 369, 1, 0, 0, 0, 7, 380, 1, 0, 0, 0, 9, 394, 1, 0, 0, 0, 11, 403, 1, 0, 0, 0, 13, 407, 1, 0, + 0, 0, 15, 414, 1, 0, 0, 0, 17, 420, 1, 0, 0, 0, 19, 426, 1, 0, 0, 0, 21, 430, 1, 0, 0, 0, 23, 434, 1, 0, 0, 0, 25, + 447, 1, 0, 0, 0, 27, 453, 1, 0, 0, 0, 29, 460, 1, 0, 0, 0, 31, 470, 1, 0, 0, 0, 33, 477, 1, 0, 0, 0, 35, 483, 1, 0, + 0, 0, 37, 489, 1, 0, 0, 0, 39, 494, 1, 0, 0, 0, 41, 501, 1, 0, 0, 0, 43, 505, 1, 0, 0, 0, 45, 510, 1, 0, 0, 0, 47, + 520, 1, 0, 0, 0, 49, 534, 1, 0, 0, 0, 51, 543, 1, 0, 0, 0, 53, 551, 1, 0, 0, 0, 55, 557, 1, 0, 0, 0, 57, 565, 1, 0, + 0, 0, 59, 576, 1, 0, 0, 0, 61, 583, 1, 0, 0, 0, 63, 588, 1, 0, 0, 0, 65, 594, 1, 0, 0, 0, 67, 598, 1, 0, 0, 0, 69, + 605, 1, 0, 0, 0, 71, 610, 1, 0, 0, 0, 73, 615, 1, 0, 0, 0, 75, 619, 1, 0, 0, 0, 77, 625, 1, 0, 0, 0, 79, 634, 1, 0, + 0, 0, 81, 643, 1, 0, 0, 0, 83, 652, 1, 0, 0, 0, 85, 660, 1, 0, 0, 0, 87, 668, 1, 0, 0, 0, 89, 674, 1, 0, 0, 0, 91, + 677, 1, 0, 0, 0, 93, 684, 1, 0, 0, 0, 95, 687, 1, 0, 0, 0, 97, 696, 1, 0, 0, 0, 99, 702, 1, 0, 0, 0, 101, 705, 1, 0, + 0, 0, 103, 711, 1, 0, 0, 0, 105, 719, 1, 0, 0, 0, 107, 727, 1, 0, 0, 0, 109, 732, 1, 0, 0, 0, 111, 740, 1, 0, 0, 0, + 113, 744, 1, 0, 0, 0, 115, 748, 1, 0, 0, 0, 117, 753, 1, 0, 0, 0, 119, 757, 1, 0, 0, 0, 121, 762, 1, 0, 0, 0, 123, + 766, 1, 0, 0, 0, 125, 770, 1, 0, 0, 0, 127, 775, 1, 0, 0, 0, 129, 778, 1, 0, 0, 0, 131, 781, 1, 0, 0, 0, 133, 786, + 1, 0, 0, 0, 135, 789, 1, 0, 0, 0, 137, 796, 1, 0, 0, 0, 139, 800, 1, 0, 0, 0, 141, 808, 1, 0, 0, 0, 143, 818, 1, 0, + 0, 0, 145, 823, 1, 0, 0, 0, 147, 833, 1, 0, 0, 0, 149, 841, 1, 0, 0, 0, 151, 851, 1, 0, 0, 0, 153, 859, 1, 0, 0, 0, + 155, 869, 1, 0, 0, 0, 157, 874, 1, 0, 0, 0, 159, 880, 1, 0, 0, 0, 161, 887, 1, 0, 0, 0, 163, 896, 1, 0, 0, 0, 165, + 903, 1, 0, 0, 0, 167, 911, 1, 0, 0, 0, 169, 915, 1, 0, 0, 0, 171, 922, 1, 0, 0, 0, 173, 929, 1, 0, 0, 0, 175, 933, + 1, 0, 0, 0, 177, 937, 1, 0, 0, 0, 179, 946, 1, 0, 0, 0, 181, 953, 1, 0, 0, 0, 183, 962, 1, 0, 0, 0, 185, 969, 1, 0, + 0, 0, 187, 976, 1, 0, 0, 0, 189, 980, 1, 0, 0, 0, 191, 984, 1, 0, 0, 0, 193, 988, 1, 0, 0, 0, 195, 992, 1, 0, 0, 0, + 197, 1000, 1, 0, 0, 0, 199, 1007, 1, 0, 0, 0, 201, 1016, 1, 0, 0, 0, 203, 1021, 1, 0, 0, 0, 205, 1024, 1, 0, 0, 0, + 207, 1034, 1, 0, 0, 0, 209, 1039, 1, 0, 0, 0, 211, 1050, 1, 0, 0, 0, 213, 1056, 1, 0, 0, 0, 215, 1062, 1, 0, 0, 0, + 217, 1066, 1, 0, 0, 0, 219, 1075, 1, 0, 0, 0, 221, 1080, 1, 0, 0, 0, 223, 1085, 1, 0, 0, 0, 225, 1091, 1, 0, 0, 0, + 227, 1097, 1, 0, 0, 0, 229, 1103, 1, 0, 0, 0, 231, 1108, 1, 0, 0, 0, 233, 1113, 1, 0, 0, 0, 235, 1118, 1, 0, 0, 0, + 237, 1124, 1, 0, 0, 0, 239, 1129, 1, 0, 0, 0, 241, 1133, 1, 0, 0, 0, 243, 1135, 1, 0, 0, 0, 245, 1138, 1, 0, 0, 0, + 247, 1140, 1, 0, 0, 0, 249, 1142, 1, 0, 0, 0, 251, 1145, 1, 0, 0, 0, 253, 1148, 1, 0, 0, 0, 255, 1152, 1, 0, 0, 0, + 257, 1155, 1, 0, 0, 0, 259, 1159, 1, 0, 0, 0, 261, 1162, 1, 0, 0, 0, 263, 1166, 1, 0, 0, 0, 265, 1168, 1, 0, 0, 0, + 267, 1170, 1, 0, 0, 0, 269, 1172, 1, 0, 0, 0, 271, 1174, 1, 0, 0, 0, 273, 1177, 1, 0, 0, 0, 275, 1179, 1, 0, 0, 0, + 277, 1182, 1, 0, 0, 0, 279, 1185, 1, 0, 0, 0, 281, 1188, 1, 0, 0, 0, 283, 1191, 1, 0, 0, 0, 285, 1194, 1, 0, 0, 0, + 287, 1196, 1, 0, 0, 0, 289, 1198, 1, 0, 0, 0, 291, 1200, 1, 0, 0, 0, 293, 1202, 1, 0, 0, 0, 295, 1205, 1, 0, 0, 0, + 297, 1208, 1, 0, 0, 0, 299, 1210, 1, 0, 0, 0, 301, 1212, 1, 0, 0, 0, 303, 1214, 1, 0, 0, 0, 305, 1216, 1, 0, 0, 0, + 307, 1218, 1, 0, 0, 0, 309, 1220, 1, 0, 0, 0, 311, 1222, 1, 0, 0, 0, 313, 1224, 1, 0, 0, 0, 315, 1226, 1, 0, 0, 0, + 317, 1228, 1, 0, 0, 0, 319, 1230, 1, 0, 0, 0, 321, 1232, 1, 0, 0, 0, 323, 1234, 1, 0, 0, 0, 325, 1241, 1, 0, 0, 0, + 327, 1249, 1, 0, 0, 0, 329, 1255, 1, 0, 0, 0, 331, 1261, 1, 0, 0, 0, 333, 1275, 1, 0, 0, 0, 335, 1278, 1, 0, 0, 0, + 337, 1293, 1, 0, 0, 0, 339, 1308, 1, 0, 0, 0, 341, 1320, 1, 0, 0, 0, 343, 1338, 1, 0, 0, 0, 345, 1340, 1, 0, 0, 0, + 347, 1344, 1, 0, 0, 0, 349, 1355, 1, 0, 0, 0, 351, 1365, 1, 0, 0, 0, 353, 1375, 1, 0, 0, 0, 355, 357, 7, 0, 0, 0, + 356, 355, 1, 0, 0, 0, 357, 358, 1, 0, 0, 0, 358, 356, 1, 0, 0, 0, 358, 359, 1, 0, 0, 0, 359, 360, 1, 0, 0, 0, 360, + 361, 6, 0, 0, 0, 361, 2, 1, 0, 0, 0, 362, 364, 7, 1, 0, 0, 363, 362, 1, 0, 0, 0, 364, 365, 1, 0, 0, 0, 365, 363, 1, + 0, 0, 0, 365, 366, 1, 0, 0, 0, 366, 367, 1, 0, 0, 0, 367, 368, 6, 1, 0, 0, 368, 4, 1, 0, 0, 0, 369, 370, 5, 45, 0, + 0, 370, 371, 5, 45, 0, 0, 371, 375, 1, 0, 0, 0, 372, 374, 8, 0, 0, 0, 373, 372, 1, 0, 0, 0, 374, 377, 1, 0, 0, 0, + 375, 373, 1, 0, 0, 0, 375, 376, 1, 0, 0, 0, 376, 378, 1, 0, 0, 0, 377, 375, 1, 0, 0, 0, 378, 379, 6, 2, 1, 0, 379, + 6, 1, 0, 0, 0, 380, 381, 5, 47, 0, 0, 381, 382, 5, 42, 0, 0, 382, 386, 1, 0, 0, 0, 383, 385, 9, 0, 0, 0, 384, 383, + 1, 0, 0, 0, 385, 388, 1, 0, 0, 0, 386, 387, 1, 0, 0, 0, 386, 384, 1, 0, 0, 0, 387, 389, 1, 0, 0, 0, 388, 386, 1, 0, + 0, 0, 389, 390, 5, 42, 0, 0, 390, 391, 5, 47, 0, 0, 391, 392, 1, 0, 0, 0, 392, 393, 6, 3, 1, 0, 393, 8, 1, 0, 0, 0, + 394, 398, 5, 96, 0, 0, 395, 397, 8, 0, 0, 0, 396, 395, 1, 0, 0, 0, 397, 400, 1, 0, 0, 0, 398, 396, 1, 0, 0, 0, 398, + 399, 1, 0, 0, 0, 399, 401, 1, 0, 0, 0, 400, 398, 1, 0, 0, 0, 401, 402, 6, 4, 2, 0, 402, 10, 1, 0, 0, 0, 403, 404, 7, + 2, 0, 0, 404, 405, 7, 3, 0, 0, 405, 406, 7, 4, 0, 0, 406, 12, 1, 0, 0, 0, 407, 408, 7, 2, 0, 0, 408, 409, 7, 5, 0, + 0, 409, 410, 7, 5, 0, 0, 410, 411, 7, 6, 0, 0, 411, 412, 7, 4, 0, 0, 412, 413, 7, 4, 0, 0, 413, 14, 1, 0, 0, 0, 414, + 415, 7, 2, 0, 0, 415, 416, 7, 7, 0, 0, 416, 417, 7, 8, 0, 0, 417, 418, 7, 6, 0, 0, 418, 419, 7, 9, 0, 0, 419, 16, 1, + 0, 0, 0, 420, 421, 7, 2, 0, 0, 421, 422, 7, 10, 0, 0, 422, 423, 7, 11, 0, 0, 423, 424, 7, 2, 0, 0, 424, 425, 7, 4, + 0, 0, 425, 18, 1, 0, 0, 0, 426, 427, 7, 2, 0, 0, 427, 428, 7, 10, 0, 0, 428, 429, 7, 10, 0, 0, 429, 20, 1, 0, 0, 0, + 430, 431, 7, 2, 0, 0, 431, 432, 7, 12, 0, 0, 432, 433, 7, 13, 0, 0, 433, 22, 1, 0, 0, 0, 434, 435, 7, 2, 0, 0, 435, + 436, 7, 9, 0, 0, 436, 437, 7, 5, 0, 0, 437, 438, 7, 14, 0, 0, 438, 439, 7, 11, 0, 0, 439, 440, 7, 8, 0, 0, 440, 441, + 7, 6, 0, 0, 441, 442, 7, 5, 0, 0, 442, 443, 7, 8, 0, 0, 443, 444, 7, 15, 0, 0, 444, 445, 7, 9, 0, 0, 445, 446, 7, 6, + 0, 0, 446, 24, 1, 0, 0, 0, 447, 448, 7, 2, 0, 0, 448, 449, 7, 9, 0, 0, 449, 450, 7, 9, 0, 0, 450, 451, 7, 2, 0, 0, + 451, 452, 7, 16, 0, 0, 452, 26, 1, 0, 0, 0, 453, 454, 7, 2, 0, 0, 454, 455, 7, 4, 0, 0, 455, 456, 7, 4, 0, 0, 456, + 457, 7, 6, 0, 0, 457, 458, 7, 9, 0, 0, 458, 459, 7, 8, 0, 0, 459, 28, 1, 0, 0, 0, 460, 461, 7, 2, 0, 0, 461, 462, 7, + 8, 0, 0, 462, 463, 7, 8, 0, 0, 463, 464, 7, 9, 0, 0, 464, 465, 7, 11, 0, 0, 465, 466, 7, 3, 0, 0, 466, 467, 7, 15, + 0, 0, 467, 468, 7, 8, 0, 0, 468, 469, 7, 6, 0, 0, 469, 30, 1, 0, 0, 0, 470, 471, 7, 2, 0, 0, 471, 472, 7, 4, 0, 0, + 472, 473, 7, 4, 0, 0, 473, 474, 7, 15, 0, 0, 474, 475, 7, 17, 0, 0, 475, 476, 7, 6, 0, 0, 476, 32, 1, 0, 0, 0, 477, + 478, 7, 3, 0, 0, 478, 479, 7, 6, 0, 0, 479, 480, 7, 18, 0, 0, 480, 481, 7, 11, 0, 0, 481, 482, 7, 12, 0, 0, 482, 34, + 1, 0, 0, 0, 483, 484, 7, 3, 0, 0, 484, 485, 7, 10, 0, 0, 485, 486, 7, 19, 0, 0, 486, 487, 7, 5, 0, 0, 487, 488, 7, + 20, 0, 0, 488, 36, 1, 0, 0, 0, 489, 490, 7, 3, 0, 0, 490, 491, 7, 19, 0, 0, 491, 492, 7, 13, 0, 0, 492, 493, 7, 16, + 0, 0, 493, 38, 1, 0, 0, 0, 494, 495, 7, 3, 0, 0, 495, 496, 7, 15, 0, 0, 496, 497, 7, 7, 0, 0, 497, 498, 7, 7, 0, 0, + 498, 499, 7, 6, 0, 0, 499, 500, 7, 9, 0, 0, 500, 40, 1, 0, 0, 0, 501, 502, 7, 3, 0, 0, 502, 503, 7, 15, 0, 0, 503, + 504, 7, 4, 0, 0, 504, 42, 1, 0, 0, 0, 505, 506, 7, 5, 0, 0, 506, 507, 7, 2, 0, 0, 507, 508, 7, 4, 0, 0, 508, 509, 7, + 6, 0, 0, 509, 44, 1, 0, 0, 0, 510, 511, 7, 5, 0, 0, 511, 512, 7, 19, 0, 0, 512, 513, 7, 17, 0, 0, 513, 514, 7, 21, + 0, 0, 514, 515, 7, 19, 0, 0, 515, 516, 7, 12, 0, 0, 516, 517, 7, 6, 0, 0, 517, 518, 7, 12, 0, 0, 518, 519, 7, 8, 0, + 0, 519, 46, 1, 0, 0, 0, 520, 521, 7, 5, 0, 0, 521, 522, 7, 19, 0, 0, 522, 523, 7, 12, 0, 0, 523, 524, 7, 7, 0, 0, + 524, 525, 7, 11, 0, 0, 525, 526, 7, 18, 0, 0, 526, 527, 7, 15, 0, 0, 527, 528, 7, 9, 0, 0, 528, 529, 7, 2, 0, 0, + 529, 530, 7, 8, 0, 0, 530, 531, 7, 11, 0, 0, 531, 532, 7, 19, 0, 0, 532, 533, 7, 12, 0, 0, 533, 48, 1, 0, 0, 0, 534, + 535, 7, 5, 0, 0, 535, 536, 7, 19, 0, 0, 536, 537, 7, 12, 0, 0, 537, 538, 7, 4, 0, 0, 538, 539, 7, 8, 0, 0, 539, 540, + 7, 2, 0, 0, 540, 541, 7, 12, 0, 0, 541, 542, 7, 8, 0, 0, 542, 50, 1, 0, 0, 0, 543, 544, 7, 5, 0, 0, 544, 545, 7, 19, + 0, 0, 545, 546, 7, 12, 0, 0, 546, 547, 7, 8, 0, 0, 547, 548, 7, 6, 0, 0, 548, 549, 7, 22, 0, 0, 549, 550, 7, 8, 0, + 0, 550, 52, 1, 0, 0, 0, 551, 552, 7, 5, 0, 0, 552, 553, 7, 19, 0, 0, 553, 554, 7, 23, 0, 0, 554, 555, 7, 6, 0, 0, + 555, 556, 7, 9, 0, 0, 556, 54, 1, 0, 0, 0, 557, 558, 7, 13, 0, 0, 558, 559, 7, 6, 0, 0, 559, 560, 7, 7, 0, 0, 560, + 561, 7, 2, 0, 0, 561, 562, 7, 15, 0, 0, 562, 563, 7, 10, 0, 0, 563, 564, 7, 8, 0, 0, 564, 56, 1, 0, 0, 0, 565, 566, + 7, 13, 0, 0, 566, 567, 7, 11, 0, 0, 567, 568, 7, 4, 0, 0, 568, 569, 7, 5, 0, 0, 569, 570, 7, 19, 0, 0, 570, 571, 7, + 12, 0, 0, 571, 572, 7, 12, 0, 0, 572, 573, 7, 6, 0, 0, 573, 574, 7, 5, 0, 0, 574, 575, 7, 8, 0, 0, 575, 58, 1, 0, 0, + 0, 576, 577, 7, 13, 0, 0, 577, 578, 7, 19, 0, 0, 578, 579, 7, 24, 0, 0, 579, 580, 7, 12, 0, 0, 580, 581, 7, 8, 0, 0, + 581, 582, 7, 19, 0, 0, 582, 60, 1, 0, 0, 0, 583, 584, 7, 6, 0, 0, 584, 585, 7, 10, 0, 0, 585, 586, 7, 4, 0, 0, 586, + 587, 7, 6, 0, 0, 587, 62, 1, 0, 0, 0, 588, 589, 7, 6, 0, 0, 589, 590, 7, 10, 0, 0, 590, 591, 7, 4, 0, 0, 591, 592, + 7, 11, 0, 0, 592, 593, 7, 7, 0, 0, 593, 64, 1, 0, 0, 0, 594, 595, 7, 6, 0, 0, 595, 596, 7, 12, 0, 0, 596, 597, 7, + 13, 0, 0, 597, 66, 1, 0, 0, 0, 598, 599, 7, 6, 0, 0, 599, 600, 7, 12, 0, 0, 600, 601, 7, 8, 0, 0, 601, 602, 7, 11, + 0, 0, 602, 603, 7, 8, 0, 0, 603, 604, 7, 16, 0, 0, 604, 68, 1, 0, 0, 0, 605, 606, 7, 6, 0, 0, 606, 607, 7, 22, 0, 0, + 607, 608, 7, 11, 0, 0, 608, 609, 7, 8, 0, 0, 609, 70, 1, 0, 0, 0, 610, 611, 7, 7, 0, 0, 611, 612, 7, 11, 0, 0, 612, + 613, 7, 10, 0, 0, 613, 614, 7, 6, 0, 0, 614, 72, 1, 0, 0, 0, 615, 616, 7, 7, 0, 0, 616, 617, 7, 19, 0, 0, 617, 618, + 7, 9, 0, 0, 618, 74, 1, 0, 0, 0, 619, 620, 7, 7, 0, 0, 620, 621, 7, 19, 0, 0, 621, 622, 7, 9, 0, 0, 622, 623, 7, 5, + 0, 0, 623, 624, 7, 6, 0, 0, 624, 76, 1, 0, 0, 0, 625, 626, 7, 7, 0, 0, 626, 627, 7, 15, 0, 0, 627, 628, 7, 12, 0, 0, + 628, 629, 7, 5, 0, 0, 629, 630, 7, 8, 0, 0, 630, 631, 7, 11, 0, 0, 631, 632, 7, 19, 0, 0, 632, 633, 7, 12, 0, 0, + 633, 78, 1, 0, 0, 0, 634, 635, 7, 7, 0, 0, 635, 636, 7, 2, 0, 0, 636, 637, 7, 11, 0, 0, 637, 638, 7, 9, 0, 0, 638, + 639, 7, 12, 0, 0, 639, 640, 7, 6, 0, 0, 640, 641, 7, 4, 0, 0, 641, 642, 7, 4, 0, 0, 642, 80, 1, 0, 0, 0, 643, 644, + 7, 18, 0, 0, 644, 645, 7, 6, 0, 0, 645, 646, 7, 12, 0, 0, 646, 647, 7, 6, 0, 0, 647, 648, 7, 9, 0, 0, 648, 649, 7, + 2, 0, 0, 649, 650, 7, 8, 0, 0, 650, 651, 7, 6, 0, 0, 651, 82, 1, 0, 0, 0, 652, 653, 7, 18, 0, 0, 653, 654, 7, 6, 0, + 0, 654, 655, 7, 12, 0, 0, 655, 656, 7, 6, 0, 0, 656, 657, 7, 9, 0, 0, 657, 658, 7, 11, 0, 0, 658, 659, 7, 5, 0, 0, + 659, 84, 1, 0, 0, 0, 660, 661, 7, 18, 0, 0, 661, 662, 7, 15, 0, 0, 662, 663, 7, 2, 0, 0, 663, 664, 7, 9, 0, 0, 664, + 665, 7, 13, 0, 0, 665, 666, 7, 6, 0, 0, 666, 667, 7, 13, 0, 0, 667, 86, 1, 0, 0, 0, 668, 669, 7, 18, 0, 0, 669, 670, + 7, 9, 0, 0, 670, 671, 7, 19, 0, 0, 671, 672, 7, 15, 0, 0, 672, 673, 7, 21, 0, 0, 673, 88, 1, 0, 0, 0, 674, 675, 7, + 11, 0, 0, 675, 676, 7, 7, 0, 0, 676, 90, 1, 0, 0, 0, 677, 678, 7, 11, 0, 0, 678, 679, 7, 17, 0, 0, 679, 680, 7, 21, + 0, 0, 680, 681, 7, 15, 0, 0, 681, 682, 7, 9, 0, 0, 682, 683, 7, 6, 0, 0, 683, 92, 1, 0, 0, 0, 684, 685, 7, 11, 0, 0, + 685, 686, 7, 12, 0, 0, 686, 94, 1, 0, 0, 0, 687, 688, 7, 11, 0, 0, 688, 689, 7, 12, 0, 0, 689, 690, 7, 6, 0, 0, 690, + 691, 7, 9, 0, 0, 691, 692, 7, 8, 0, 0, 692, 693, 7, 11, 0, 0, 693, 694, 7, 2, 0, 0, 694, 695, 7, 10, 0, 0, 695, 96, + 1, 0, 0, 0, 696, 697, 7, 11, 0, 0, 697, 698, 7, 12, 0, 0, 698, 699, 7, 19, 0, 0, 699, 700, 7, 15, 0, 0, 700, 701, 7, + 8, 0, 0, 701, 98, 1, 0, 0, 0, 702, 703, 7, 11, 0, 0, 703, 704, 7, 4, 0, 0, 704, 100, 1, 0, 0, 0, 705, 706, 7, 10, 0, + 0, 706, 707, 7, 2, 0, 0, 707, 708, 7, 3, 0, 0, 708, 709, 7, 6, 0, 0, 709, 710, 7, 10, 0, 0, 710, 102, 1, 0, 0, 0, + 711, 712, 7, 10, 0, 0, 712, 713, 7, 11, 0, 0, 713, 714, 7, 3, 0, 0, 714, 715, 7, 9, 0, 0, 715, 716, 7, 2, 0, 0, 716, + 717, 7, 9, 0, 0, 717, 718, 7, 16, 0, 0, 718, 104, 1, 0, 0, 0, 719, 720, 7, 10, 0, 0, 720, 721, 7, 11, 0, 0, 721, + 722, 7, 12, 0, 0, 722, 723, 7, 20, 0, 0, 723, 724, 7, 2, 0, 0, 724, 725, 7, 18, 0, 0, 725, 726, 7, 6, 0, 0, 726, + 106, 1, 0, 0, 0, 727, 728, 7, 10, 0, 0, 728, 729, 7, 19, 0, 0, 729, 730, 7, 19, 0, 0, 730, 731, 7, 21, 0, 0, 731, + 108, 1, 0, 0, 0, 732, 733, 7, 10, 0, 0, 733, 734, 7, 11, 0, 0, 734, 735, 7, 8, 0, 0, 735, 736, 7, 6, 0, 0, 736, 737, + 7, 9, 0, 0, 737, 738, 7, 2, 0, 0, 738, 739, 7, 10, 0, 0, 739, 110, 1, 0, 0, 0, 740, 741, 7, 17, 0, 0, 741, 742, 7, + 2, 0, 0, 742, 743, 7, 21, 0, 0, 743, 112, 1, 0, 0, 0, 744, 745, 7, 17, 0, 0, 745, 746, 7, 19, 0, 0, 746, 747, 7, 13, + 0, 0, 747, 114, 1, 0, 0, 0, 748, 749, 7, 12, 0, 0, 749, 750, 7, 2, 0, 0, 750, 751, 7, 12, 0, 0, 751, 752, 7, 13, 0, + 0, 752, 116, 1, 0, 0, 0, 753, 754, 7, 12, 0, 0, 754, 755, 7, 6, 0, 0, 755, 756, 7, 24, 0, 0, 756, 118, 1, 0, 0, 0, + 757, 758, 7, 12, 0, 0, 758, 759, 7, 6, 0, 0, 759, 760, 7, 22, 0, 0, 760, 761, 7, 8, 0, 0, 761, 120, 1, 0, 0, 0, 762, + 763, 7, 12, 0, 0, 763, 764, 7, 19, 0, 0, 764, 765, 7, 9, 0, 0, 765, 122, 1, 0, 0, 0, 766, 767, 7, 12, 0, 0, 767, + 768, 7, 19, 0, 0, 768, 769, 7, 8, 0, 0, 769, 124, 1, 0, 0, 0, 770, 771, 7, 12, 0, 0, 771, 772, 7, 15, 0, 0, 772, + 773, 7, 10, 0, 0, 773, 774, 7, 10, 0, 0, 774, 126, 1, 0, 0, 0, 775, 776, 7, 19, 0, 0, 776, 777, 7, 7, 0, 0, 777, + 128, 1, 0, 0, 0, 778, 779, 7, 19, 0, 0, 779, 780, 7, 12, 0, 0, 780, 130, 1, 0, 0, 0, 781, 782, 7, 19, 0, 0, 782, + 783, 7, 21, 0, 0, 783, 784, 7, 6, 0, 0, 784, 785, 7, 12, 0, 0, 785, 132, 1, 0, 0, 0, 786, 787, 7, 19, 0, 0, 787, + 788, 7, 9, 0, 0, 788, 134, 1, 0, 0, 0, 789, 790, 7, 19, 0, 0, 790, 791, 7, 8, 0, 0, 791, 792, 7, 14, 0, 0, 792, 793, + 7, 6, 0, 0, 793, 794, 7, 9, 0, 0, 794, 795, 7, 4, 0, 0, 795, 136, 1, 0, 0, 0, 796, 797, 7, 19, 0, 0, 797, 798, 7, + 15, 0, 0, 798, 799, 7, 8, 0, 0, 799, 138, 1, 0, 0, 0, 800, 801, 7, 21, 0, 0, 801, 802, 7, 2, 0, 0, 802, 803, 7, 5, + 0, 0, 803, 804, 7, 20, 0, 0, 804, 805, 7, 2, 0, 0, 805, 806, 7, 18, 0, 0, 806, 807, 7, 6, 0, 0, 807, 140, 1, 0, 0, + 0, 808, 809, 7, 21, 0, 0, 809, 810, 7, 2, 0, 0, 810, 811, 7, 9, 0, 0, 811, 812, 7, 2, 0, 0, 812, 813, 7, 17, 0, 0, + 813, 814, 7, 6, 0, 0, 814, 815, 7, 8, 0, 0, 815, 816, 7, 6, 0, 0, 816, 817, 7, 9, 0, 0, 817, 142, 1, 0, 0, 0, 818, + 819, 7, 21, 0, 0, 819, 820, 7, 19, 0, 0, 820, 821, 7, 9, 0, 0, 821, 822, 7, 8, 0, 0, 822, 144, 1, 0, 0, 0, 823, 824, + 7, 21, 0, 0, 824, 825, 7, 19, 0, 0, 825, 826, 7, 4, 0, 0, 826, 827, 7, 8, 0, 0, 827, 828, 7, 21, 0, 0, 828, 829, 7, + 19, 0, 0, 829, 830, 7, 12, 0, 0, 830, 831, 7, 6, 0, 0, 831, 832, 7, 13, 0, 0, 832, 146, 1, 0, 0, 0, 833, 834, 7, 21, + 0, 0, 834, 835, 7, 9, 0, 0, 835, 836, 7, 11, 0, 0, 836, 837, 7, 23, 0, 0, 837, 838, 7, 2, 0, 0, 838, 839, 7, 8, 0, + 0, 839, 840, 7, 6, 0, 0, 840, 148, 1, 0, 0, 0, 841, 842, 7, 21, 0, 0, 842, 843, 7, 9, 0, 0, 843, 844, 7, 19, 0, 0, + 844, 845, 7, 5, 0, 0, 845, 846, 7, 6, 0, 0, 846, 847, 7, 13, 0, 0, 847, 848, 7, 15, 0, 0, 848, 849, 7, 9, 0, 0, 849, + 850, 7, 6, 0, 0, 850, 150, 1, 0, 0, 0, 851, 852, 7, 21, 0, 0, 852, 853, 7, 9, 0, 0, 853, 854, 7, 19, 0, 0, 854, 855, + 7, 5, 0, 0, 855, 856, 7, 6, 0, 0, 856, 857, 7, 4, 0, 0, 857, 858, 7, 4, 0, 0, 858, 152, 1, 0, 0, 0, 859, 860, 7, 21, + 0, 0, 860, 861, 7, 9, 0, 0, 861, 862, 7, 19, 0, 0, 862, 863, 7, 8, 0, 0, 863, 864, 7, 6, 0, 0, 864, 865, 7, 5, 0, 0, + 865, 866, 7, 8, 0, 0, 866, 867, 7, 6, 0, 0, 867, 868, 7, 13, 0, 0, 868, 154, 1, 0, 0, 0, 869, 870, 7, 21, 0, 0, 870, + 871, 7, 15, 0, 0, 871, 872, 7, 9, 0, 0, 872, 873, 7, 6, 0, 0, 873, 156, 1, 0, 0, 0, 874, 875, 7, 9, 0, 0, 875, 876, + 7, 2, 0, 0, 876, 877, 7, 12, 0, 0, 877, 878, 7, 18, 0, 0, 878, 879, 7, 6, 0, 0, 879, 158, 1, 0, 0, 0, 880, 881, 7, + 9, 0, 0, 881, 882, 7, 6, 0, 0, 882, 883, 7, 5, 0, 0, 883, 884, 7, 19, 0, 0, 884, 885, 7, 9, 0, 0, 885, 886, 7, 13, + 0, 0, 886, 160, 1, 0, 0, 0, 887, 888, 7, 9, 0, 0, 888, 889, 7, 6, 0, 0, 889, 890, 7, 18, 0, 0, 890, 891, 7, 11, 0, + 0, 891, 892, 7, 4, 0, 0, 892, 893, 7, 8, 0, 0, 893, 894, 7, 6, 0, 0, 894, 895, 7, 9, 0, 0, 895, 162, 1, 0, 0, 0, + 896, 897, 7, 9, 0, 0, 897, 898, 7, 6, 0, 0, 898, 899, 7, 25, 0, 0, 899, 900, 7, 6, 0, 0, 900, 901, 7, 5, 0, 0, 901, + 902, 7, 8, 0, 0, 902, 164, 1, 0, 0, 0, 903, 904, 7, 9, 0, 0, 904, 905, 7, 6, 0, 0, 905, 906, 7, 10, 0, 0, 906, 907, + 7, 6, 0, 0, 907, 908, 7, 2, 0, 0, 908, 909, 7, 4, 0, 0, 909, 910, 7, 6, 0, 0, 910, 166, 1, 0, 0, 0, 911, 912, 7, 9, + 0, 0, 912, 913, 7, 6, 0, 0, 913, 914, 7, 17, 0, 0, 914, 168, 1, 0, 0, 0, 915, 916, 7, 9, 0, 0, 916, 917, 7, 6, 0, 0, + 917, 918, 7, 21, 0, 0, 918, 919, 7, 19, 0, 0, 919, 920, 7, 9, 0, 0, 920, 921, 7, 8, 0, 0, 921, 170, 1, 0, 0, 0, 922, + 923, 7, 9, 0, 0, 923, 924, 7, 6, 0, 0, 924, 925, 7, 8, 0, 0, 925, 926, 7, 15, 0, 0, 926, 927, 7, 9, 0, 0, 927, 928, + 7, 12, 0, 0, 928, 172, 1, 0, 0, 0, 929, 930, 7, 9, 0, 0, 930, 931, 7, 19, 0, 0, 931, 932, 7, 10, 0, 0, 932, 174, 1, + 0, 0, 0, 933, 934, 7, 9, 0, 0, 934, 935, 7, 19, 0, 0, 935, 936, 7, 9, 0, 0, 936, 176, 1, 0, 0, 0, 937, 938, 7, 9, 0, + 0, 938, 939, 7, 6, 0, 0, 939, 940, 7, 4, 0, 0, 940, 941, 7, 8, 0, 0, 941, 942, 7, 9, 0, 0, 942, 943, 7, 11, 0, 0, + 943, 944, 7, 5, 0, 0, 944, 945, 7, 8, 0, 0, 945, 178, 1, 0, 0, 0, 946, 947, 7, 4, 0, 0, 947, 948, 7, 6, 0, 0, 948, + 949, 7, 10, 0, 0, 949, 950, 7, 6, 0, 0, 950, 951, 7, 5, 0, 0, 951, 952, 7, 8, 0, 0, 952, 180, 1, 0, 0, 0, 953, 954, + 7, 4, 0, 0, 954, 955, 7, 6, 0, 0, 955, 956, 7, 23, 0, 0, 956, 957, 7, 6, 0, 0, 957, 958, 7, 9, 0, 0, 958, 959, 7, + 11, 0, 0, 959, 960, 7, 8, 0, 0, 960, 961, 7, 16, 0, 0, 961, 182, 1, 0, 0, 0, 962, 963, 7, 4, 0, 0, 963, 964, 7, 14, + 0, 0, 964, 965, 7, 2, 0, 0, 965, 966, 7, 9, 0, 0, 966, 967, 7, 6, 0, 0, 967, 968, 7, 13, 0, 0, 968, 184, 1, 0, 0, 0, + 969, 970, 7, 4, 0, 0, 970, 971, 7, 11, 0, 0, 971, 972, 7, 18, 0, 0, 972, 973, 7, 12, 0, 0, 973, 974, 7, 2, 0, 0, + 974, 975, 7, 10, 0, 0, 975, 186, 1, 0, 0, 0, 976, 977, 7, 4, 0, 0, 977, 978, 7, 10, 0, 0, 978, 979, 7, 2, 0, 0, 979, + 188, 1, 0, 0, 0, 980, 981, 7, 4, 0, 0, 981, 982, 7, 10, 0, 0, 982, 983, 7, 10, 0, 0, 983, 190, 1, 0, 0, 0, 984, 985, + 7, 4, 0, 0, 985, 986, 7, 9, 0, 0, 986, 987, 7, 2, 0, 0, 987, 192, 1, 0, 0, 0, 988, 989, 7, 4, 0, 0, 989, 990, 7, 9, + 0, 0, 990, 991, 7, 10, 0, 0, 991, 194, 1, 0, 0, 0, 992, 993, 7, 4, 0, 0, 993, 994, 7, 15, 0, 0, 994, 995, 7, 3, 0, + 0, 995, 996, 7, 8, 0, 0, 996, 997, 7, 16, 0, 0, 997, 998, 7, 21, 0, 0, 998, 999, 7, 6, 0, 0, 999, 196, 1, 0, 0, 0, + 1000, 1001, 7, 4, 0, 0, 1001, 1002, 7, 8, 0, 0, 1002, 1003, 7, 9, 0, 0, 1003, 1004, 7, 19, 0, 0, 1004, 1005, 7, 12, + 0, 0, 1005, 1006, 7, 18, 0, 0, 1006, 198, 1, 0, 0, 0, 1007, 1008, 7, 4, 0, 0, 1008, 1009, 7, 6, 0, 0, 1009, 1010, 7, + 26, 0, 0, 1010, 1011, 7, 15, 0, 0, 1011, 1012, 7, 6, 0, 0, 1012, 1013, 7, 12, 0, 0, 1013, 1014, 7, 5, 0, 0, 1014, + 1015, 7, 6, 0, 0, 1015, 200, 1, 0, 0, 0, 1016, 1017, 7, 8, 0, 0, 1017, 1018, 7, 14, 0, 0, 1018, 1019, 7, 6, 0, 0, + 1019, 1020, 7, 12, 0, 0, 1020, 202, 1, 0, 0, 0, 1021, 1022, 7, 8, 0, 0, 1022, 1023, 7, 19, 0, 0, 1023, 204, 1, 0, 0, + 0, 1024, 1025, 7, 8, 0, 0, 1025, 1026, 7, 9, 0, 0, 1026, 1027, 7, 2, 0, 0, 1027, 1028, 7, 12, 0, 0, 1028, 1029, 7, + 4, 0, 0, 1029, 1030, 7, 21, 0, 0, 1030, 1031, 7, 19, 0, 0, 1031, 1032, 7, 9, 0, 0, 1032, 1033, 7, 8, 0, 0, 1033, + 206, 1, 0, 0, 0, 1034, 1035, 7, 8, 0, 0, 1035, 1036, 7, 16, 0, 0, 1036, 1037, 7, 21, 0, 0, 1037, 1038, 7, 6, 0, 0, + 1038, 208, 1, 0, 0, 0, 1039, 1040, 7, 15, 0, 0, 1040, 1041, 7, 12, 0, 0, 1041, 1042, 7, 2, 0, 0, 1042, 1043, 7, 7, + 0, 0, 1043, 1044, 7, 7, 0, 0, 1044, 1045, 7, 6, 0, 0, 1045, 1046, 7, 5, 0, 0, 1046, 1047, 7, 8, 0, 0, 1047, 1048, 7, + 6, 0, 0, 1048, 1049, 7, 13, 0, 0, 1049, 210, 1, 0, 0, 0, 1050, 1051, 7, 15, 0, 0, 1051, 1052, 7, 12, 0, 0, 1052, + 1053, 7, 11, 0, 0, 1053, 1054, 7, 8, 0, 0, 1054, 1055, 7, 4, 0, 0, 1055, 212, 1, 0, 0, 0, 1056, 1057, 7, 15, 0, 0, + 1057, 1058, 7, 12, 0, 0, 1058, 1059, 7, 8, 0, 0, 1059, 1060, 7, 11, 0, 0, 1060, 1061, 7, 10, 0, 0, 1061, 214, 1, 0, + 0, 0, 1062, 1063, 7, 15, 0, 0, 1063, 1064, 7, 4, 0, 0, 1064, 1065, 7, 6, 0, 0, 1065, 216, 1, 0, 0, 0, 1066, 1067, 7, + 23, 0, 0, 1067, 1068, 7, 2, 0, 0, 1068, 1069, 7, 9, 0, 0, 1069, 1070, 7, 11, 0, 0, 1070, 1071, 7, 2, 0, 0, 1071, + 1072, 7, 3, 0, 0, 1072, 1073, 7, 10, 0, 0, 1073, 1074, 7, 6, 0, 0, 1074, 218, 1, 0, 0, 0, 1075, 1076, 7, 23, 0, 0, + 1076, 1077, 7, 11, 0, 0, 1077, 1078, 7, 6, 0, 0, 1078, 1079, 7, 24, 0, 0, 1079, 220, 1, 0, 0, 0, 1080, 1081, 7, 23, + 0, 0, 1081, 1082, 7, 21, 0, 0, 1082, 1083, 7, 20, 0, 0, 1083, 1084, 7, 18, 0, 0, 1084, 222, 1, 0, 0, 0, 1085, 1086, + 7, 23, 0, 0, 1086, 1087, 7, 17, 0, 0, 1087, 1088, 7, 19, 0, 0, 1088, 1089, 7, 13, 0, 0, 1089, 1090, 7, 6, 0, 0, + 1090, 224, 1, 0, 0, 0, 1091, 1092, 7, 23, 0, 0, 1092, 1093, 7, 21, 0, 0, 1093, 1094, 7, 9, 0, 0, 1094, 1095, 7, 19, + 0, 0, 1095, 1096, 7, 21, 0, 0, 1096, 226, 1, 0, 0, 0, 1097, 1098, 7, 23, 0, 0, 1098, 1099, 7, 15, 0, 0, 1099, 1100, + 7, 12, 0, 0, 1100, 1101, 7, 11, 0, 0, 1101, 1102, 7, 8, 0, 0, 1102, 228, 1, 0, 0, 0, 1103, 1104, 7, 24, 0, 0, 1104, + 1105, 7, 2, 0, 0, 1105, 1106, 7, 11, 0, 0, 1106, 1107, 7, 8, 0, 0, 1107, 230, 1, 0, 0, 0, 1108, 1109, 7, 24, 0, 0, + 1109, 1110, 7, 11, 0, 0, 1110, 1111, 7, 8, 0, 0, 1111, 1112, 7, 14, 0, 0, 1112, 232, 1, 0, 0, 0, 1113, 1114, 7, 24, + 0, 0, 1114, 1115, 7, 14, 0, 0, 1115, 1116, 7, 6, 0, 0, 1116, 1117, 7, 12, 0, 0, 1117, 234, 1, 0, 0, 0, 1118, 1119, + 7, 24, 0, 0, 1119, 1120, 7, 14, 0, 0, 1120, 1121, 7, 11, 0, 0, 1121, 1122, 7, 10, 0, 0, 1122, 1123, 7, 6, 0, 0, + 1123, 236, 1, 0, 0, 0, 1124, 1125, 7, 22, 0, 0, 1125, 1126, 7, 12, 0, 0, 1126, 1127, 7, 19, 0, 0, 1127, 1128, 7, 9, + 0, 0, 1128, 238, 1, 0, 0, 0, 1129, 1130, 7, 22, 0, 0, 1130, 1131, 7, 19, 0, 0, 1131, 1132, 7, 9, 0, 0, 1132, 240, 1, + 0, 0, 0, 1133, 1134, 5, 61, 0, 0, 1134, 242, 1, 0, 0, 0, 1135, 1136, 5, 47, 0, 0, 1136, 1137, 5, 61, 0, 0, 1137, + 244, 1, 0, 0, 0, 1138, 1139, 5, 60, 0, 0, 1139, 246, 1, 0, 0, 0, 1140, 1141, 5, 62, 0, 0, 1141, 248, 1, 0, 0, 0, + 1142, 1143, 5, 62, 0, 0, 1143, 1144, 5, 61, 0, 0, 1144, 250, 1, 0, 0, 0, 1145, 1146, 5, 63, 0, 0, 1146, 1147, 5, 61, + 0, 0, 1147, 252, 1, 0, 0, 0, 1148, 1149, 5, 63, 0, 0, 1149, 1150, 5, 47, 0, 0, 1150, 1151, 5, 61, 0, 0, 1151, 254, + 1, 0, 0, 0, 1152, 1153, 5, 63, 0, 0, 1153, 1154, 5, 60, 0, 0, 1154, 256, 1, 0, 0, 0, 1155, 1156, 5, 63, 0, 0, 1156, + 1157, 5, 60, 0, 0, 1157, 1158, 5, 61, 0, 0, 1158, 258, 1, 0, 0, 0, 1159, 1160, 5, 63, 0, 0, 1160, 1161, 5, 62, 0, 0, + 1161, 260, 1, 0, 0, 0, 1162, 1163, 5, 63, 0, 0, 1163, 1164, 5, 62, 0, 0, 1164, 1165, 5, 61, 0, 0, 1165, 262, 1, 0, + 0, 0, 1166, 1167, 5, 43, 0, 0, 1167, 264, 1, 0, 0, 0, 1168, 1169, 5, 45, 0, 0, 1169, 266, 1, 0, 0, 0, 1170, 1171, 5, + 42, 0, 0, 1171, 268, 1, 0, 0, 0, 1172, 1173, 5, 47, 0, 0, 1173, 270, 1, 0, 0, 0, 1174, 1175, 5, 42, 0, 0, 1175, + 1176, 5, 42, 0, 0, 1176, 272, 1, 0, 0, 0, 1177, 1178, 5, 38, 0, 0, 1178, 274, 1, 0, 0, 0, 1179, 1180, 5, 63, 0, 0, + 1180, 1181, 5, 63, 0, 0, 1181, 276, 1, 0, 0, 0, 1182, 1183, 5, 61, 0, 0, 1183, 1184, 5, 62, 0, 0, 1184, 278, 1, 0, + 0, 0, 1185, 1186, 5, 60, 0, 0, 1186, 1187, 5, 61, 0, 0, 1187, 280, 1, 0, 0, 0, 1188, 1189, 5, 58, 0, 0, 1189, 1190, + 5, 61, 0, 0, 1190, 282, 1, 0, 0, 0, 1191, 1192, 5, 60, 0, 0, 1192, 1193, 5, 62, 0, 0, 1193, 284, 1, 0, 0, 0, 1194, + 1195, 5, 40, 0, 0, 1195, 286, 1, 0, 0, 0, 1196, 1197, 5, 41, 0, 0, 1197, 288, 1, 0, 0, 0, 1198, 1199, 5, 91, 0, 0, + 1199, 290, 1, 0, 0, 0, 1200, 1201, 5, 93, 0, 0, 1201, 292, 1, 0, 0, 0, 1202, 1203, 5, 60, 0, 0, 1203, 1204, 5, 60, + 0, 0, 1204, 294, 1, 0, 0, 0, 1205, 1206, 5, 62, 0, 0, 1206, 1207, 5, 62, 0, 0, 1207, 296, 1, 0, 0, 0, 1208, 1209, 5, + 58, 0, 0, 1209, 298, 1, 0, 0, 0, 1210, 1211, 5, 59, 0, 0, 1211, 300, 1, 0, 0, 0, 1212, 1213, 5, 44, 0, 0, 1213, 302, + 1, 0, 0, 0, 1214, 1215, 5, 124, 0, 0, 1215, 304, 1, 0, 0, 0, 1216, 1217, 5, 46, 0, 0, 1217, 306, 1, 0, 0, 0, 1218, + 1219, 5, 63, 0, 0, 1219, 308, 1, 0, 0, 0, 1220, 1221, 5, 64, 0, 0, 1221, 310, 1, 0, 0, 0, 1222, 1223, 5, 94, 0, 0, + 1223, 312, 1, 0, 0, 0, 1224, 1225, 5, 39, 0, 0, 1225, 314, 1, 0, 0, 0, 1226, 1227, 5, 34, 0, 0, 1227, 316, 1, 0, 0, + 0, 1228, 1229, 7, 27, 0, 0, 1229, 318, 1, 0, 0, 0, 1230, 1231, 7, 28, 0, 0, 1231, 320, 1, 0, 0, 0, 1232, 1233, 7, + 29, 0, 0, 1233, 322, 1, 0, 0, 0, 1234, 1238, 7, 28, 0, 0, 1235, 1237, 7, 30, 0, 0, 1236, 1235, 1, 0, 0, 0, 1237, + 1240, 1, 0, 0, 0, 1238, 1236, 1, 0, 0, 0, 1238, 1239, 1, 0, 0, 0, 1239, 324, 1, 0, 0, 0, 1240, 1238, 1, 0, 0, 0, + 1241, 1246, 3, 321, 160, 0, 1242, 1245, 5, 95, 0, 0, 1243, 1245, 3, 321, 160, 0, 1244, 1242, 1, 0, 0, 0, 1244, 1243, + 1, 0, 0, 0, 1245, 1248, 1, 0, 0, 0, 1246, 1244, 1, 0, 0, 0, 1246, 1247, 1, 0, 0, 0, 1247, 326, 1, 0, 0, 0, 1248, + 1246, 1, 0, 0, 0, 1249, 1251, 7, 6, 0, 0, 1250, 1252, 7, 31, 0, 0, 1251, 1250, 1, 0, 0, 0, 1251, 1252, 1, 0, 0, 0, + 1252, 1253, 1, 0, 0, 0, 1253, 1254, 3, 323, 161, 0, 1254, 328, 1, 0, 0, 0, 1255, 1256, 3, 323, 161, 0, 1256, 1257, + 5, 46, 0, 0, 1257, 1259, 3, 323, 161, 0, 1258, 1260, 3, 327, 163, 0, 1259, 1258, 1, 0, 0, 0, 1259, 1260, 1, 0, 0, 0, + 1260, 330, 1, 0, 0, 0, 1261, 1262, 3, 323, 161, 0, 1262, 1263, 5, 35, 0, 0, 1263, 1266, 3, 325, 162, 0, 1264, 1265, + 5, 46, 0, 0, 1265, 1267, 3, 325, 162, 0, 1266, 1264, 1, 0, 0, 0, 1266, 1267, 1, 0, 0, 0, 1267, 1268, 1, 0, 0, 0, + 1268, 1270, 5, 35, 0, 0, 1269, 1271, 3, 327, 163, 0, 1270, 1269, 1, 0, 0, 0, 1270, 1271, 1, 0, 0, 0, 1271, 332, 1, + 0, 0, 0, 1272, 1276, 3, 323, 161, 0, 1273, 1276, 3, 329, 164, 0, 1274, 1276, 3, 331, 165, 0, 1275, 1272, 1, 0, 0, 0, + 1275, 1273, 1, 0, 0, 0, 1275, 1274, 1, 0, 0, 0, 1276, 334, 1, 0, 0, 0, 1277, 1279, 3, 323, 161, 0, 1278, 1277, 1, 0, + 0, 0, 1278, 1279, 1, 0, 0, 0, 1279, 1281, 1, 0, 0, 0, 1280, 1282, 7, 32, 0, 0, 1281, 1280, 1, 0, 0, 0, 1281, 1282, + 1, 0, 0, 0, 1282, 1283, 1, 0, 0, 0, 1283, 1284, 7, 3, 0, 0, 1284, 1286, 5, 34, 0, 0, 1285, 1287, 7, 33, 0, 0, 1286, + 1285, 1, 0, 0, 0, 1287, 1288, 1, 0, 0, 0, 1288, 1286, 1, 0, 0, 0, 1288, 1289, 1, 0, 0, 0, 1289, 1290, 1, 0, 0, 0, + 1290, 1291, 5, 34, 0, 0, 1291, 336, 1, 0, 0, 0, 1292, 1294, 3, 323, 161, 0, 1293, 1292, 1, 0, 0, 0, 1293, 1294, 1, + 0, 0, 0, 1294, 1296, 1, 0, 0, 0, 1295, 1297, 7, 32, 0, 0, 1296, 1295, 1, 0, 0, 0, 1296, 1297, 1, 0, 0, 0, 1297, + 1298, 1, 0, 0, 0, 1298, 1299, 7, 19, 0, 0, 1299, 1301, 5, 34, 0, 0, 1300, 1302, 7, 34, 0, 0, 1301, 1300, 1, 0, 0, 0, + 1302, 1303, 1, 0, 0, 0, 1303, 1301, 1, 0, 0, 0, 1303, 1304, 1, 0, 0, 0, 1304, 1305, 1, 0, 0, 0, 1305, 1306, 5, 34, + 0, 0, 1306, 338, 1, 0, 0, 0, 1307, 1309, 3, 323, 161, 0, 1308, 1307, 1, 0, 0, 0, 1308, 1309, 1, 0, 0, 0, 1309, 1310, + 1, 0, 0, 0, 1310, 1311, 7, 13, 0, 0, 1311, 1313, 5, 34, 0, 0, 1312, 1314, 7, 30, 0, 0, 1313, 1312, 1, 0, 0, 0, 1314, + 1315, 1, 0, 0, 0, 1315, 1313, 1, 0, 0, 0, 1315, 1316, 1, 0, 0, 0, 1316, 1317, 1, 0, 0, 0, 1317, 1318, 5, 34, 0, 0, + 1318, 340, 1, 0, 0, 0, 1319, 1321, 3, 323, 161, 0, 1320, 1319, 1, 0, 0, 0, 1320, 1321, 1, 0, 0, 0, 1321, 1323, 1, 0, + 0, 0, 1322, 1324, 7, 32, 0, 0, 1323, 1322, 1, 0, 0, 0, 1323, 1324, 1, 0, 0, 0, 1324, 1325, 1, 0, 0, 0, 1325, 1326, + 7, 22, 0, 0, 1326, 1328, 5, 34, 0, 0, 1327, 1329, 7, 35, 0, 0, 1328, 1327, 1, 0, 0, 0, 1329, 1330, 1, 0, 0, 0, 1330, + 1328, 1, 0, 0, 0, 1330, 1331, 1, 0, 0, 0, 1331, 1332, 1, 0, 0, 0, 1332, 1333, 5, 34, 0, 0, 1333, 342, 1, 0, 0, 0, + 1334, 1339, 3, 335, 167, 0, 1335, 1339, 3, 337, 168, 0, 1336, 1339, 3, 339, 169, 0, 1337, 1339, 3, 341, 170, 0, + 1338, 1334, 1, 0, 0, 0, 1338, 1335, 1, 0, 0, 0, 1338, 1336, 1, 0, 0, 0, 1338, 1337, 1, 0, 0, 0, 1339, 344, 1, 0, 0, + 0, 1340, 1341, 5, 39, 0, 0, 1341, 1342, 9, 0, 0, 0, 1342, 1343, 5, 39, 0, 0, 1343, 346, 1, 0, 0, 0, 1344, 1350, 5, + 34, 0, 0, 1345, 1349, 8, 36, 0, 0, 1346, 1347, 5, 34, 0, 0, 1347, 1349, 5, 34, 0, 0, 1348, 1345, 1, 0, 0, 0, 1348, + 1346, 1, 0, 0, 0, 1349, 1352, 1, 0, 0, 0, 1350, 1348, 1, 0, 0, 0, 1350, 1351, 1, 0, 0, 0, 1351, 1353, 1, 0, 0, 0, + 1352, 1350, 1, 0, 0, 0, 1353, 1354, 5, 34, 0, 0, 1354, 348, 1, 0, 0, 0, 1355, 1362, 7, 27, 0, 0, 1356, 1358, 5, 95, + 0, 0, 1357, 1356, 1, 0, 0, 0, 1357, 1358, 1, 0, 0, 0, 1358, 1359, 1, 0, 0, 0, 1359, 1361, 7, 29, 0, 0, 1360, 1357, + 1, 0, 0, 0, 1361, 1364, 1, 0, 0, 0, 1362, 1360, 1, 0, 0, 0, 1362, 1363, 1, 0, 0, 0, 1363, 350, 1, 0, 0, 0, 1364, + 1362, 1, 0, 0, 0, 1365, 1367, 5, 92, 0, 0, 1366, 1368, 9, 0, 0, 0, 1367, 1366, 1, 0, 0, 0, 1368, 1369, 1, 0, 0, 0, + 1369, 1370, 1, 0, 0, 0, 1369, 1367, 1, 0, 0, 0, 1370, 1371, 1, 0, 0, 0, 1371, 1372, 5, 92, 0, 0, 1372, 352, 1, 0, 0, + 0, 1373, 1376, 3, 349, 174, 0, 1374, 1376, 3, 351, 175, 0, 1375, 1373, 1, 0, 0, 0, 1375, 1374, 1, 0, 0, 0, 1376, + 354, 1, 0, 0, 0, 36, 0, 358, 365, 375, 386, 398, 1238, 1244, 1246, 1251, 1259, 1266, 1270, 1275, 1278, 1281, 1286, + 1288, 1293, 1296, 1301, 1303, 1308, 1313, 1315, 1320, 1323, 1328, 1330, 1338, 1348, 1350, 1357, 1362, 1369, 1375, 3, + 0, 2, 0, 0, 3, 0, 0, 4, 0 ) @@ -450,7 +449,7 @@ class VHDLLexer(Lexer): KW_GENERATE = 41 KW_GENERIC = 42 KW_GUARDED = 43 - KW_PSL_GROUP = 44 + KW_GROUP = 44 KW_IF = 45 KW_IMPURE = 46 KW_IN = 47 @@ -530,51 +529,48 @@ class VHDLLexer(Lexer): OP_EQ = 121 OP_NE = 122 OP_LT = 123 - OP_LE = 124 - OP_GT = 125 - OP_GE = 126 - OP_IEQ = 127 - OP_INE = 128 - OP_ILT = 129 - OP_ILE = 130 - OP_IGT = 131 - OP_IGE = 132 - OP_PLUS = 133 - OP_MINUS = 134 - OP_MUL = 135 - OP_DIV = 136 - OP_POW = 137 - OP_CONCAT = 138 - OP_CONDITION = 139 - TOK_RARROW = 140 - TOK_SIG_ASSIGN = 141 - TOK_VAR_ASSIGN = 142 - TOK_BOX = 143 - TOK_LP = 144 - TOK_RP = 145 - TOK_LB = 146 - TOK_RB = 147 - TOK_DLA = 148 - TOK_DRA = 149 - TOK_COLON = 150 - TOK_SEMICOL = 151 - TOK_COMMA = 152 - TOK_BAR = 153 - TOK_DOT = 154 - TOK_QUESTION = 155 - TOK_AT = 156 - TOK_CIRCUMFLEX = 157 - TOK_TICK = 158 - TOK_DQUOTE = 159 - LIT_ABSTRACT = 160 - LIT_BIT_STRING = 161 - LIT_CHARACTER = 162 - LIT_STRING = 163 - LIT_IDENTIFIER = 164 + OP_GT = 124 + OP_GE = 125 + OP_IEQ = 126 + OP_INE = 127 + OP_ILT = 128 + OP_ILE = 129 + OP_IGT = 130 + OP_IGE = 131 + OP_PLUS = 132 + OP_MINUS = 133 + OP_MUL = 134 + OP_DIV = 135 + OP_POW = 136 + OP_CONCAT = 137 + OP_CONDITION = 138 + TOK_RARROW = 139 + TOK_SIG_ASSIGN = 140 + TOK_VAR_ASSIGN = 141 + TOK_BOX = 142 + TOK_LP = 143 + TOK_RP = 144 + TOK_LB = 145 + TOK_RB = 146 + TOK_DLA = 147 + TOK_DRA = 148 + TOK_COLON = 149 + TOK_SEMICOL = 150 + TOK_COMMA = 151 + TOK_BAR = 152 + TOK_DOT = 153 + TOK_QUESTION = 154 + TOK_AT = 155 + TOK_CIRCUMFLEX = 156 + TOK_TICK = 157 + TOK_DQUOTE = 158 + LIT_ABSTRACT = 159 + LIT_BIT_STRING = 160 + LIT_CHARACTER = 161 + LIT_STRING = 162 + LIT_IDENTIFIER = 163 - channelNames = ( - "DEFAULT_TOKEN_CHANNEL", "HIDDEN", "WHITESPACE_CHANNEL", "COMMENT_CHANNEL", "TOOLDIRECTIVE_CHANNEL" - ) + channelNames = ("DEFAULT_TOKEN_CHANNEL", "HIDDEN", "WHITESPACE_CHANNEL", "COMMENT_CHANNEL", "TOOLDIRECTIVE_CHANNEL") modeNames = ("DEFAULT_MODE",) @@ -591,9 +587,9 @@ class VHDLLexer(Lexer): "'severity'", "'shared'", "'signal'", "'sla'", "'sll'", "'sra'", "'srl'", "'subtype'", "'strong'", "'sequence'", "'then'", "'to'", "'transport'", "'type'", "'unaffected'", "'units'", "'until'", "'use'", "'variable'", "'view'", "'vpkg'", "'vmode'", "'vprop'", "'vunit'", "'wait'", "'with'", "'when'", "'while'", "'xnor'", "'xor'", "'='", - "'/='", "'<'", "'<=)'", "'>'", "'>='", "'?='", "'?/='", "'?<'", "'?<=)'", "'?>'", "'?>='", "'+'", "'-'", "'*'", - "'/'", "'**'", "'&'", "'??'", "'=>'", "'<='", "':='", "'<>'", "'('", "')'", "'['", "']'", "'<<'", "'>>'", "':'", - "';'", "','", "'|'", "'.'", "'?'", "'@'", "'^'", "'''", "'\"'" + "'/='", "'<'", "'>'", "'>='", "'?='", "'?/='", "'?<'", "'?<='", "'?>'", "'?>='", "'+'", "'-'", "'*'", "'/'", "'**'", + "'&'", "'??'", "'=>'", "'<='", "':='", "'<>'", "'('", "')'", "'['", "']'", "'<<'", "'>>'", "':'", "';'", "','", + "'|'", "'.'", "'?'", "'@'", "'^'", "'''", "'\"'" ) symbolicNames = ( @@ -602,7 +598,7 @@ class VHDLLexer(Lexer): "KW_PSL_ASSUME", "KW_BEGIN", "KW_BLOCK", "KW_BODY", "KW_BUFFER", "KW_BUS", "KW_CASE", "KW_COMPONENT", "KW_CONFIGURATION", "KW_CONSTANT", "KW_CONTEXT", "KW_PSL_COVER", "KW_DEFAULT", "KW_DISCONNECT", "KW_DOWNTO", "KW_ELSE", "KW_ELSIF", "KW_END", "KW_ENTITY", "KW_EXIT", "KW_FILE", "KW_FOR", "KW_FORCE", "KW_FUNCTION", - "KW_PSL_FAIRNESS", "KW_GENERATE", "KW_GENERIC", "KW_GUARDED", "KW_PSL_GROUP", "KW_IF", "KW_IMPURE", "KW_IN", + "KW_PSL_FAIRNESS", "KW_GENERATE", "KW_GENERIC", "KW_GUARDED", "KW_GROUP", "KW_IF", "KW_IMPURE", "KW_IN", "KW_INERTIAL", "KW_INOUT", "KW_IS", "KW_LABEL", "KW_LIBRARY", "KW_LINKAGE", "KW_LOOP", "KW_PSL_LITERAL", "KW_MAP", "OP_MOD", "OP_NAND", "KW_NEW", "KW_NEXT", "OP_NOR", "OP_NOT", "KW_NULL", "KW_OF", "KW_ON", "KW_OPEN", "OP_OR", "KW_OTHERS", "KW_OUT", "KW_PACKAGE", "KW_PARAMETER", "KW_PORT", "KW_POSTPONED", "KW_PRIVATE", "KW_PROCEDURE", @@ -611,8 +607,8 @@ class VHDLLexer(Lexer): "KW_SIGNAL", "OP_SLA", "OP_SLL", "OP_SRA", "OP_SRL", "KW_SUBTYPE", "KW_PSL_STRONG", "KW_PSL_SEQUENCE", "KW_THEN", "KW_TO", "KW_TRANSPORT", "KW_TYPE", "KW_UNAFFECTED", "KW_UNITS", "KW_UNTIL", "KW_USE", "KW_VARIABLE", "KW_VIEW", "KW_PSL_VPKG", "KW_PSL_VMODE", "KW_PSL_VPROP", "KW_PSL_VUNIT", "KW_WAIT", "KW_WITH", "KW_WHEN", "KW_WHILE", - "OP_XNOR", "OP_XOR", "OP_EQ", "OP_NE", "OP_LT", "OP_LE", "OP_GT", "OP_GE", "OP_IEQ", "OP_INE", "OP_ILT", "OP_ILE", - "OP_IGT", "OP_IGE", "OP_PLUS", "OP_MINUS", "OP_MUL", "OP_DIV", "OP_POW", "OP_CONCAT", "OP_CONDITION", "TOK_RARROW", + "OP_XNOR", "OP_XOR", "OP_EQ", "OP_NE", "OP_LT", "OP_GT", "OP_GE", "OP_IEQ", "OP_INE", "OP_ILT", "OP_ILE", "OP_IGT", + "OP_IGE", "OP_PLUS", "OP_MINUS", "OP_MUL", "OP_DIV", "OP_POW", "OP_CONCAT", "OP_CONDITION", "TOK_RARROW", "TOK_SIG_ASSIGN", "TOK_VAR_ASSIGN", "TOK_BOX", "TOK_LP", "TOK_RP", "TOK_LB", "TOK_RB", "TOK_DLA", "TOK_DRA", "TOK_COLON", "TOK_SEMICOL", "TOK_COMMA", "TOK_BAR", "TOK_DOT", "TOK_QUESTION", "TOK_AT", "TOK_CIRCUMFLEX", "TOK_TICK", "TOK_DQUOTE", "LIT_ABSTRACT", "LIT_BIT_STRING", "LIT_CHARACTER", "LIT_STRING", "LIT_IDENTIFIER" @@ -624,7 +620,7 @@ class VHDLLexer(Lexer): "KW_BEGIN", "KW_BLOCK", "KW_BODY", "KW_BUFFER", "KW_BUS", "KW_CASE", "KW_COMPONENT", "KW_CONFIGURATION", "KW_CONSTANT", "KW_CONTEXT", "KW_PSL_COVER", "KW_DEFAULT", "KW_DISCONNECT", "KW_DOWNTO", "KW_ELSE", "KW_ELSIF", "KW_END", "KW_ENTITY", "KW_EXIT", "KW_FILE", "KW_FOR", "KW_FORCE", "KW_FUNCTION", "KW_PSL_FAIRNESS", "KW_GENERATE", - "KW_GENERIC", "KW_GUARDED", "KW_PSL_GROUP", "KW_IF", "KW_IMPURE", "KW_IN", "KW_INERTIAL", "KW_INOUT", "KW_IS", + "KW_GENERIC", "KW_GUARDED", "KW_GROUP", "KW_IF", "KW_IMPURE", "KW_IN", "KW_INERTIAL", "KW_INOUT", "KW_IS", "KW_LABEL", "KW_LIBRARY", "KW_LINKAGE", "KW_LOOP", "KW_PSL_LITERAL", "KW_MAP", "OP_MOD", "OP_NAND", "KW_NEW", "KW_NEXT", "OP_NOR", "OP_NOT", "KW_NULL", "KW_OF", "KW_ON", "KW_OPEN", "OP_OR", "KW_OTHERS", "KW_OUT", "KW_PACKAGE", "KW_PARAMETER", "KW_PORT", "KW_POSTPONED", "KW_PRIVATE", "KW_PROCEDURE", "KW_PROCESS", "KW_PROTECTED", "KW_PURE", @@ -633,20 +629,20 @@ class VHDLLexer(Lexer): "OP_SRL", "KW_SUBTYPE", "KW_PSL_STRONG", "KW_PSL_SEQUENCE", "KW_THEN", "KW_TO", "KW_TRANSPORT", "KW_TYPE", "KW_UNAFFECTED", "KW_UNITS", "KW_UNTIL", "KW_USE", "KW_VARIABLE", "KW_VIEW", "KW_PSL_VPKG", "KW_PSL_VMODE", "KW_PSL_VPROP", "KW_PSL_VUNIT", "KW_WAIT", "KW_WITH", "KW_WHEN", "KW_WHILE", "OP_XNOR", "OP_XOR", "OP_EQ", "OP_NE", - "OP_LT", "OP_LE", "OP_GT", "OP_GE", "OP_IEQ", "OP_INE", "OP_ILT", "OP_ILE", "OP_IGT", "OP_IGE", "OP_PLUS", - "OP_MINUS", "OP_MUL", "OP_DIV", "OP_POW", "OP_CONCAT", "OP_CONDITION", "TOK_RARROW", "TOK_SIG_ASSIGN", - "TOK_VAR_ASSIGN", "TOK_BOX", "TOK_LP", "TOK_RP", "TOK_LB", "TOK_RB", "TOK_DLA", "TOK_DRA", "TOK_COLON", - "TOK_SEMICOL", "TOK_COMMA", "TOK_BAR", "TOK_DOT", "TOK_QUESTION", "TOK_AT", "TOK_CIRCUMFLEX", "TOK_TICK", - "TOK_DQUOTE", "Letter", "Digit", "ExtendedDigit", "Integer", "BasedInteger", "Exponent", "Real", "BaseLiteral", - "LIT_ABSTRACT", "BinaryBitString", "OctalBitString", "DecimalBitString", "HexBitString", "LIT_BIT_STRING", - "LIT_CHARACTER", "LIT_STRING", "BasicIdentifier", "ExtendedIdentifier", "LIT_IDENTIFIER" + "OP_LT", "OP_GT", "OP_GE", "OP_IEQ", "OP_INE", "OP_ILT", "OP_ILE", "OP_IGT", "OP_IGE", "OP_PLUS", "OP_MINUS", + "OP_MUL", "OP_DIV", "OP_POW", "OP_CONCAT", "OP_CONDITION", "TOK_RARROW", "TOK_SIG_ASSIGN", "TOK_VAR_ASSIGN", + "TOK_BOX", "TOK_LP", "TOK_RP", "TOK_LB", "TOK_RB", "TOK_DLA", "TOK_DRA", "TOK_COLON", "TOK_SEMICOL", "TOK_COMMA", + "TOK_BAR", "TOK_DOT", "TOK_QUESTION", "TOK_AT", "TOK_CIRCUMFLEX", "TOK_TICK", "TOK_DQUOTE", "Letter", "Digit", + "ExtendedDigit", "Integer", "BasedInteger", "Exponent", "Real", "BaseLiteral", "LIT_ABSTRACT", "BinaryBitString", + "OctalBitString", "DecimalBitString", "HexBitString", "LIT_BIT_STRING", "LIT_CHARACTER", "LIT_STRING", + "BasicIdentifier", "ExtendedIdentifier", "LIT_IDENTIFIER" ) grammarFileName = "VHDLLexer.g4" def __init__(self, input=None, output: TextIO = stdout): super().__init__(input, output) - self.checkVersion("4.10.1") + self.checkVersion("4.12.0") self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache()) self._actions = None self._predicates = None diff --git a/pyVHDLParser/ANTLR4/VHDLParser.py b/pyVHDLParser/ANTLR4/VHDLParser.py index 460f949ad..42c70783c 100644 --- a/pyVHDLParser/ANTLR4/VHDLParser.py +++ b/pyVHDLParser/ANTLR4/VHDLParser.py @@ -1,13 +1,14 @@ +# Generated from .\VHDLParser.g4 by ANTLR 4.12.0 from sys import stdout from typing import TextIO -from antlr4 import ATNDeserializer, Parser, PredictionContextCache, DFA, TokenStream, ParserATNSimulator, \ - ParserRuleContext, ParseTreeVisitor, Token, RecognitionException, NoViableAltException, ATN +from antlr4 import Parser, ATNDeserializer, DFA, PredictionContextCache, TokenStream, ParserATNSimulator, \ + ParserRuleContext, ParseTreeVisitor, RecognitionException, Token, NoViableAltException, ATN, RuleContext def serializedATN(): return ( - 4, 1, 164, 2948, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, + 4, 1, 163, 3044, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, @@ -40,905 +41,943 @@ def serializedATN(): 229, 2, 230, 7, 230, 2, 231, 7, 231, 2, 232, 7, 232, 2, 233, 7, 233, 2, 234, 7, 234, 2, 235, 7, 235, 2, 236, 7, 236, 2, 237, 7, 237, 2, 238, 7, 238, 2, 239, 7, 239, 2, 240, 7, 240, 2, 241, 7, 241, 2, 242, 7, 242, 2, 243, 7, 243, 2, 244, 7, 244, 2, 245, 7, 245, 2, 246, 7, 246, 2, 247, 7, 247, 2, 248, 7, 248, 2, 249, 7, 249, 2, 250, 7, 250, 2, 251, - 7, 251, 2, 252, 7, 252, 2, 253, 7, 253, 2, 254, 7, 254, 2, 255, 7, 255, 2, 256, 7, 256, 1, 0, 1, 0, 1, 0, 1, 1, 1, - 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 3, 3, 3, 525, 8, 3, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 531, 8, 3, 1, 4, 1, 4, 1, 4, 1, 4, - 1, 4, 1, 4, 3, 4, 539, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 5, 5, 545, 8, 5, 10, 5, 12, 5, 548, 9, 5, 1, 5, 1, 5, 1, 6, 1, - 6, 1, 6, 1, 6, 3, 6, 556, 8, 6, 1, 6, 1, 6, 1, 6, 3, 6, 561, 8, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, - 1, 9, 3, 9, 572, 8, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 5, 10, 580, 8, 10, 10, 10, 12, 10, 583, 9, 10, 1, - 10, 1, 10, 5, 10, 587, 8, 10, 10, 10, 12, 10, 590, 9, 10, 1, 10, 1, 10, 3, 10, 594, 8, 10, 1, 10, 3, 10, 597, 8, 10, - 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 606, 8, 11, 1, 11, 1, 11, 1, 11, 3, 11, 611, 8, 11, 1, 11, - 1, 11, 1, 11, 3, 11, 616, 8, 11, 1, 11, 3, 11, 619, 8, 11, 1, 11, 1, 11, 1, 11, 3, 11, 624, 8, 11, 1, 12, 1, 12, 3, - 12, 628, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 634, 8, 12, 3, 12, 636, 8, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 15, - 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 3, 16, 652, 8, 16, 1, 17, 1, 17, 1, 17, 5, 17, 657, - 8, 17, 10, 17, 12, 17, 660, 9, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 3, 18, 668, 8, 18, 1, 19, 1, 19, 1, 19, - 1, 19, 3, 19, 674, 8, 19, 1, 19, 1, 19, 3, 19, 678, 8, 19, 1, 20, 1, 20, 3, 20, 682, 8, 20, 1, 20, 1, 20, 1, 20, 1, - 21, 1, 21, 1, 21, 3, 21, 690, 8, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 5, 22, 697, 8, 22, 10, 22, 12, 22, 700, 9, - 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, - 1, 26, 1, 26, 3, 26, 720, 8, 26, 1, 26, 3, 26, 723, 8, 26, 1, 26, 3, 26, 726, 8, 26, 1, 27, 1, 27, 1, 27, 5, 27, - 731, 8, 27, 10, 27, 12, 27, 734, 9, 27, 1, 27, 5, 27, 737, 8, 27, 10, 27, 12, 27, 740, 9, 27, 1, 27, 1, 27, 1, 27, - 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, - 28, 1, 28, 1, 28, 1, 28, 1, 28, 3, 28, 766, 8, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 3, 29, 774, 8, 29, 3, - 29, 776, 8, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 3, 30, 785, 8, 30, 1, 30, 3, 30, 788, 8, 30, 1, 30, - 1, 30, 1, 30, 1, 30, 3, 30, 794, 8, 30, 3, 30, 796, 8, 30, 1, 30, 1, 30, 1, 30, 1, 30, 3, 30, 802, 8, 30, 3, 30, - 804, 8, 30, 1, 30, 5, 30, 807, 8, 30, 10, 30, 12, 30, 810, 9, 30, 1, 30, 1, 30, 5, 30, 814, 8, 30, 10, 30, 12, 30, - 817, 9, 30, 1, 30, 1, 30, 1, 30, 3, 30, 822, 8, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 3, 31, 829, 8, 31, 1, 31, 1, - 31, 1, 31, 5, 31, 834, 8, 31, 10, 31, 12, 31, 837, 9, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 4, 32, 845, 8, - 32, 11, 32, 12, 32, 846, 1, 32, 1, 32, 1, 32, 3, 32, 852, 8, 32, 1, 32, 1, 32, 1, 33, 1, 33, 3, 33, 858, 8, 33, 1, - 33, 1, 33, 1, 33, 1, 33, 4, 33, 864, 8, 33, 11, 33, 12, 33, 865, 1, 33, 1, 33, 1, 33, 3, 33, 871, 8, 33, 1, 33, 1, - 33, 1, 34, 1, 34, 1, 34, 1, 34, 5, 34, 879, 8, 34, 10, 34, 12, 34, 882, 9, 34, 1, 35, 1, 35, 1, 35, 1, 35, 3, 35, - 888, 8, 35, 1, 36, 1, 36, 1, 36, 5, 36, 893, 8, 36, 10, 36, 12, 36, 896, 9, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, - 3, 37, 903, 8, 37, 1, 37, 3, 37, 906, 8, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 3, 38, 915, 8, 38, 1, - 38, 3, 38, 918, 8, 38, 1, 38, 3, 38, 921, 8, 38, 1, 38, 1, 38, 3, 38, 925, 8, 38, 1, 38, 3, 38, 928, 8, 38, 1, 38, - 1, 38, 1, 39, 1, 39, 1, 39, 1, 39, 3, 39, 936, 8, 39, 1, 39, 3, 39, 939, 8, 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, - 1, 40, 1, 41, 1, 41, 1, 41, 3, 41, 950, 8, 41, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, - 3, 43, 962, 8, 43, 1, 43, 3, 43, 965, 8, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 3, 44, 973, 8, 44, 1, 44, 3, - 44, 976, 8, 44, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 3, 45, 983, 8, 45, 1, 45, 3, 45, 986, 8, 45, 1, 45, 1, 45, 1, 45, - 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 3, 46, 997, 8, 46, 1, 46, 3, 46, 1000, 8, 46, 1, 46, 1, 46, 1, 46, 1, 47, - 1, 47, 3, 47, 1007, 8, 47, 1, 47, 3, 47, 1010, 8, 47, 1, 47, 1, 47, 1, 47, 3, 47, 1015, 8, 47, 1, 48, 1, 48, 1, 48, - 3, 48, 1020, 8, 48, 1, 48, 3, 48, 1023, 8, 48, 1, 48, 1, 48, 1, 48, 1, 49, 1, 49, 1, 49, 1, 50, 1, 50, 1, 50, 1, 50, - 1, 50, 1, 50, 3, 50, 1037, 8, 50, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 3, 51, 1045, 8, 51, 1, 51, 1, 51, 3, 51, - 1049, 8, 51, 1, 52, 1, 52, 1, 52, 3, 52, 1054, 8, 52, 1, 52, 1, 52, 1, 52, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, - 1, 53, 1, 53, 5, 53, 1067, 8, 53, 10, 53, 12, 53, 1070, 9, 53, 1, 53, 1, 53, 3, 53, 1074, 8, 53, 1, 54, 1, 54, 1, - 54, 1, 54, 1, 54, 1, 54, 5, 54, 1082, 8, 54, 10, 54, 12, 54, 1085, 9, 54, 1, 54, 1, 54, 1, 54, 3, 54, 1090, 8, 54, - 1, 54, 3, 54, 1093, 8, 54, 1, 54, 1, 54, 1, 55, 1, 55, 3, 55, 1099, 8, 55, 1, 56, 1, 56, 3, 56, 1103, 8, 56, 1, 57, - 1, 57, 3, 57, 1107, 8, 57, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 3, 58, 1115, 8, 58, 1, 58, 1, 58, 1, 59, 1, 59, - 1, 59, 1, 59, 1, 59, 1, 60, 1, 60, 1, 60, 1, 60, 3, 60, 1128, 8, 60, 1, 61, 1, 61, 1, 61, 1, 61, 5, 61, 1134, 8, 61, - 10, 61, 12, 61, 1137, 9, 61, 1, 61, 1, 61, 3, 61, 1141, 8, 61, 1, 61, 1, 61, 1, 61, 1, 62, 1, 62, 1, 62, 3, 62, - 1149, 8, 62, 1, 63, 1, 63, 1, 63, 1, 63, 5, 63, 1155, 8, 63, 10, 63, 12, 63, 1158, 9, 63, 1, 63, 1, 63, 1, 64, 1, - 64, 1, 64, 3, 64, 1165, 8, 64, 1, 64, 3, 64, 1168, 8, 64, 1, 65, 4, 65, 1171, 8, 65, 11, 65, 12, 65, 1172, 1, 65, 1, - 65, 1, 66, 5, 66, 1178, 8, 66, 10, 66, 12, 66, 1181, 9, 66, 1, 66, 1, 66, 1, 67, 1, 67, 1, 68, 1, 68, 1, 69, 1, 69, - 1, 69, 1, 69, 1, 69, 1, 69, 1, 70, 1, 70, 3, 70, 1197, 8, 70, 1, 71, 1, 71, 1, 71, 1, 71, 1, 72, 1, 72, 1, 72, 1, - 72, 1, 72, 1, 73, 1, 73, 1, 73, 3, 73, 1211, 8, 73, 1, 73, 1, 73, 1, 74, 1, 74, 3, 74, 1217, 8, 74, 1, 75, 1, 75, 1, - 75, 1, 75, 1, 75, 1, 76, 1, 76, 3, 76, 1226, 8, 76, 1, 77, 1, 77, 3, 77, 1230, 8, 77, 1, 78, 1, 78, 1, 78, 1, 79, 1, - 79, 3, 79, 1237, 8, 79, 1, 80, 1, 80, 1, 80, 1, 80, 1, 80, 3, 80, 1244, 8, 80, 1, 80, 1, 80, 1, 80, 3, 80, 1249, 8, - 80, 1, 81, 1, 81, 1, 82, 1, 82, 1, 82, 1, 82, 3, 82, 1257, 8, 82, 1, 82, 3, 82, 1260, 8, 82, 1, 82, 5, 82, 1263, 8, - 82, 10, 82, 12, 82, 1266, 9, 82, 1, 82, 1, 82, 5, 82, 1270, 8, 82, 10, 82, 12, 82, 1273, 9, 82, 3, 82, 1275, 8, 82, - 1, 82, 1, 82, 3, 82, 1279, 8, 82, 1, 82, 3, 82, 1282, 8, 82, 1, 82, 1, 82, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, - 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 3, 83, 1304, 8, 83, 1, 84, 1, - 84, 3, 84, 1308, 8, 84, 1, 85, 1, 85, 1, 85, 5, 85, 1313, 8, 85, 10, 85, 12, 85, 1316, 9, 85, 1, 85, 1, 85, 3, 85, - 1320, 8, 85, 1, 86, 1, 86, 1, 86, 1, 86, 1, 87, 1, 87, 1, 87, 1, 87, 3, 87, 1330, 8, 87, 1, 88, 1, 88, 1, 89, 1, 89, - 1, 90, 1, 90, 1, 90, 1, 90, 5, 90, 1340, 8, 90, 10, 90, 12, 90, 1343, 9, 90, 1, 90, 1, 90, 1, 91, 1, 91, 3, 91, - 1349, 8, 91, 1, 91, 1, 91, 3, 91, 1353, 8, 91, 1, 91, 1, 91, 3, 91, 1357, 8, 91, 1, 91, 1, 91, 1, 92, 1, 92, 1, 92, - 1, 92, 1, 92, 1, 92, 3, 92, 1367, 8, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, - 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 5, 92, 1387, 8, 92, 10, 92, 12, 92, 1390, 9, 92, 1, 93, 1, 93, - 3, 93, 1394, 8, 93, 1, 94, 1, 94, 1, 94, 3, 94, 1399, 8, 94, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 96, - 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 98, 1, 98, 1, 98, 3, - 98, 1425, 8, 98, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 3, 99, 1432, 8, 99, 1, 99, 1, 99, 1, 100, 1, 100, 1, 100, 1, - 100, 1, 101, 1, 101, 3, 101, 1442, 8, 101, 1, 101, 1, 101, 1, 101, 1, 102, 1, 102, 1, 102, 1, 102, 1, 103, 1, 103, - 1, 103, 1, 103, 1, 103, 1, 104, 1, 104, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 3, - 105, 1467, 8, 105, 1, 105, 1, 105, 1, 106, 1, 106, 1, 107, 1, 107, 3, 107, 1475, 8, 107, 1, 108, 1, 108, 1, 109, 1, - 109, 1, 109, 3, 109, 1482, 8, 109, 1, 109, 1, 109, 1, 109, 1, 109, 3, 109, 1488, 8, 109, 1, 110, 1, 110, 1, 110, 1, - 110, 1, 110, 1, 110, 1, 111, 1, 111, 1, 111, 1, 111, 1, 112, 3, 112, 1501, 8, 112, 1, 112, 1, 112, 1, 112, 3, 112, - 1506, 8, 112, 1, 112, 1, 112, 1, 112, 1, 112, 3, 112, 1512, 8, 112, 1, 112, 1, 112, 3, 112, 1516, 8, 112, 1, 112, 1, - 112, 1, 113, 1, 113, 1, 113, 3, 113, 1523, 8, 113, 1, 114, 1, 114, 1, 114, 3, 114, 1528, 8, 114, 1, 115, 5, 115, - 1531, 8, 115, 10, 115, 12, 115, 1534, 9, 115, 1, 115, 3, 115, 1537, 8, 115, 1, 115, 5, 115, 1540, 8, 115, 10, 115, - 12, 115, 1543, 9, 115, 1, 115, 1, 115, 1, 115, 3, 115, 1548, 8, 115, 1, 115, 1, 115, 1, 116, 1, 116, 1, 116, 1, 116, - 1, 116, 5, 116, 1557, 8, 116, 10, 116, 12, 116, 1560, 9, 116, 1, 116, 1, 116, 1, 116, 1, 117, 1, 117, 1, 117, 1, - 117, 1, 117, 1, 117, 1, 118, 1, 118, 1, 118, 1, 118, 1, 119, 1, 119, 1, 119, 5, 119, 1578, 8, 119, 10, 119, 12, 119, - 1581, 9, 119, 1, 120, 1, 120, 1, 120, 1, 120, 1, 120, 3, 120, 1588, 8, 120, 1, 120, 1, 120, 1, 120, 1, 120, 1, 120, - 1, 120, 3, 120, 1596, 8, 120, 1, 120, 1, 120, 1, 120, 1, 120, 5, 120, 1602, 8, 120, 10, 120, 12, 120, 1605, 9, 120, - 1, 120, 1, 120, 1, 120, 3, 120, 1610, 8, 120, 1, 120, 1, 120, 3, 120, 1614, 8, 120, 1, 120, 1, 120, 1, 120, 3, 120, - 1619, 8, 120, 1, 120, 1, 120, 1, 121, 1, 121, 3, 121, 1625, 8, 121, 1, 121, 1, 121, 1, 121, 1, 121, 5, 121, 1631, 8, - 121, 10, 121, 12, 121, 1634, 9, 121, 1, 121, 1, 121, 1, 121, 1, 121, 5, 121, 1640, 8, 121, 10, 121, 12, 121, 1643, - 9, 121, 5, 121, 1645, 8, 121, 10, 121, 12, 121, 1648, 9, 121, 1, 121, 1, 121, 5, 121, 1652, 8, 121, 10, 121, 12, - 121, 1655, 9, 121, 3, 121, 1657, 8, 121, 1, 121, 1, 121, 1, 121, 3, 121, 1662, 8, 121, 1, 121, 1, 121, 1, 122, 1, - 122, 3, 122, 1668, 8, 122, 1, 123, 1, 123, 1, 123, 1, 123, 1, 124, 1, 124, 1, 124, 1, 124, 1, 124, 1, 124, 1, 124, - 1, 124, 1, 124, 3, 124, 1683, 8, 124, 1, 125, 1, 125, 3, 125, 1687, 8, 125, 1, 126, 1, 126, 1, 126, 1, 126, 5, 126, - 1693, 8, 126, 10, 126, 12, 126, 1696, 9, 126, 1, 126, 1, 126, 1, 127, 1, 127, 1, 127, 1, 127, 1, 128, 3, 128, 1705, - 8, 128, 1, 128, 1, 128, 1, 128, 1, 128, 1, 128, 1, 128, 3, 128, 1713, 8, 128, 1, 128, 1, 128, 3, 128, 1717, 8, 128, - 1, 129, 1, 129, 1, 129, 5, 129, 1722, 8, 129, 10, 129, 12, 129, 1725, 9, 129, 1, 129, 1, 129, 3, 129, 1729, 8, 129, - 1, 130, 1, 130, 1, 130, 1, 131, 1, 131, 1, 132, 3, 132, 1737, 8, 132, 1, 132, 1, 132, 1, 132, 3, 132, 1742, 8, 132, - 1, 132, 1, 132, 1, 132, 3, 132, 1747, 8, 132, 1, 133, 1, 133, 1, 133, 1, 133, 1, 133, 1, 133, 3, 133, 1755, 8, 133, - 1, 134, 1, 134, 1, 135, 1, 135, 1, 135, 1, 135, 1, 135, 1, 136, 3, 136, 1765, 8, 136, 1, 136, 1, 136, 1, 136, 3, - 136, 1770, 8, 136, 1, 136, 1, 136, 1, 136, 1, 136, 3, 136, 1776, 8, 136, 1, 136, 1, 136, 1, 136, 1, 137, 1, 137, 1, - 137, 5, 137, 1784, 8, 137, 10, 137, 12, 137, 1787, 9, 137, 1, 137, 3, 137, 1790, 8, 137, 1, 138, 1, 138, 1, 138, 1, - 138, 1, 138, 1, 138, 1, 138, 1, 139, 1, 139, 1, 139, 1, 139, 1, 139, 1, 139, 3, 139, 1805, 8, 139, 1, 140, 1, 140, - 1, 140, 3, 140, 1810, 8, 140, 1, 140, 1, 140, 1, 140, 1, 140, 3, 140, 1816, 8, 140, 1, 141, 3, 141, 1819, 8, 141, 1, - 141, 1, 141, 1, 141, 1, 141, 1, 142, 1, 142, 1, 142, 3, 142, 1828, 8, 142, 1, 143, 1, 143, 3, 143, 1832, 8, 143, 1, - 144, 1, 144, 3, 144, 1836, 8, 144, 1, 145, 1, 145, 1, 145, 1, 145, 3, 145, 1842, 8, 145, 1, 146, 1, 146, 3, 146, - 1846, 8, 146, 1, 147, 3, 147, 1849, 8, 147, 1, 147, 1, 147, 1, 147, 3, 147, 1854, 8, 147, 1, 147, 1, 147, 1, 147, 3, - 147, 1859, 8, 147, 1, 148, 1, 148, 1, 148, 1, 148, 3, 148, 1865, 8, 148, 1, 149, 1, 149, 1, 149, 1, 149, 5, 149, - 1871, 8, 149, 10, 149, 12, 149, 1874, 9, 149, 1, 149, 1, 149, 1, 150, 1, 150, 1, 150, 1, 150, 1, 150, 1, 150, 1, - 150, 3, 150, 1885, 8, 150, 1, 151, 1, 151, 1, 151, 1, 151, 1, 151, 3, 151, 1892, 8, 151, 1, 152, 1, 152, 3, 152, - 1896, 8, 152, 1, 152, 3, 152, 1899, 8, 152, 1, 152, 1, 152, 5, 152, 1903, 8, 152, 10, 152, 12, 152, 1906, 9, 152, 1, - 152, 1, 152, 1, 152, 3, 152, 1911, 8, 152, 1, 152, 1, 152, 1, 153, 1, 153, 1, 154, 1, 154, 1, 154, 3, 154, 1920, 8, - 154, 1, 155, 1, 155, 1, 155, 1, 155, 1, 155, 1, 155, 5, 155, 1928, 8, 155, 10, 155, 12, 155, 1931, 9, 155, 1, 155, - 1, 155, 1, 155, 1, 155, 1, 155, 1, 156, 1, 156, 1, 156, 1, 156, 1, 156, 1, 157, 1, 157, 1, 157, 1, 157, 1, 157, 3, - 157, 1948, 8, 157, 1, 157, 1, 157, 1, 157, 1, 157, 1, 157, 1, 157, 1, 157, 1, 157, 5, 157, 1958, 8, 157, 10, 157, - 12, 157, 1961, 9, 157, 1, 157, 1, 157, 1, 157, 1, 157, 1, 157, 1, 157, 1, 157, 1, 157, 1, 157, 3, 157, 1972, 8, 157, - 1, 157, 1, 157, 1, 157, 1, 157, 1, 157, 1, 157, 3, 157, 1980, 8, 157, 5, 157, 1982, 8, 157, 10, 157, 12, 157, 1985, - 9, 157, 1, 158, 1, 158, 3, 158, 1989, 8, 158, 1, 158, 1, 158, 3, 158, 1993, 8, 158, 1, 158, 1, 158, 3, 158, 1997, 8, - 158, 1, 158, 1, 158, 1, 159, 1, 159, 3, 159, 2003, 8, 159, 1, 159, 1, 159, 1, 159, 1, 160, 1, 160, 3, 160, 2010, 8, - 160, 1, 161, 1, 161, 1, 161, 1, 161, 1, 161, 5, 161, 2017, 8, 161, 10, 161, 12, 161, 2020, 9, 161, 1, 161, 1, 161, - 1, 161, 3, 161, 2025, 8, 161, 1, 161, 3, 161, 2028, 8, 161, 1, 161, 1, 161, 1, 162, 1, 162, 1, 162, 1, 162, 1, 162, - 1, 162, 1, 162, 1, 162, 1, 162, 1, 162, 1, 162, 1, 162, 1, 162, 1, 162, 1, 162, 3, 162, 2047, 8, 162, 1, 163, 1, - 163, 1, 163, 1, 163, 3, 163, 2053, 8, 163, 1, 163, 5, 163, 2056, 8, 163, 10, 163, 12, 163, 2059, 9, 163, 1, 163, 1, - 163, 3, 163, 2063, 8, 163, 1, 163, 3, 163, 2066, 8, 163, 1, 163, 1, 163, 1, 164, 1, 164, 1, 164, 1, 164, 1, 164, 1, - 164, 1, 164, 1, 164, 1, 164, 1, 164, 1, 164, 1, 164, 1, 164, 1, 164, 1, 164, 1, 164, 3, 164, 2086, 8, 164, 1, 165, - 1, 165, 1, 165, 1, 165, 1, 165, 1, 165, 3, 165, 2094, 8, 165, 1, 165, 1, 165, 1, 166, 1, 166, 1, 166, 1, 166, 1, - 166, 5, 166, 2103, 8, 166, 10, 166, 12, 166, 2106, 9, 166, 1, 166, 1, 166, 1, 167, 1, 167, 3, 167, 2112, 8, 167, 1, - 167, 1, 167, 1, 167, 1, 167, 1, 168, 1, 168, 1, 168, 1, 168, 1, 169, 1, 169, 1, 169, 5, 169, 2125, 8, 169, 10, 169, - 12, 169, 2128, 9, 169, 1, 169, 1, 169, 1, 170, 1, 170, 1, 171, 1, 171, 1, 171, 1, 172, 3, 172, 2138, 8, 172, 1, 172, - 1, 172, 1, 173, 1, 173, 1, 173, 1, 173, 1, 173, 5, 173, 2147, 8, 173, 10, 173, 12, 173, 2150, 9, 173, 1, 173, 1, - 173, 1, 173, 3, 173, 2155, 8, 173, 1, 174, 1, 174, 3, 174, 2159, 8, 174, 1, 174, 1, 174, 1, 174, 3, 174, 2164, 8, - 174, 1, 174, 1, 174, 1, 175, 1, 175, 1, 175, 1, 175, 1, 175, 5, 175, 2173, 8, 175, 10, 175, 12, 175, 2176, 9, 175, - 1, 175, 1, 175, 1, 175, 1, 176, 1, 176, 1, 176, 1, 176, 1, 176, 1, 176, 1, 177, 1, 177, 1, 177, 1, 177, 1, 177, 1, - 177, 1, 177, 1, 177, 1, 177, 1, 177, 1, 177, 3, 177, 2198, 8, 177, 1, 178, 1, 178, 1, 178, 1, 179, 1, 179, 1, 180, - 1, 180, 3, 180, 2207, 8, 180, 1, 180, 3, 180, 2210, 8, 180, 1, 181, 1, 181, 3, 181, 2214, 8, 181, 1, 181, 1, 181, 1, - 181, 1, 182, 1, 182, 1, 182, 3, 182, 2222, 8, 182, 1, 182, 1, 182, 1, 182, 1, 182, 3, 182, 2228, 8, 182, 1, 183, 1, - 183, 1, 183, 1, 183, 1, 183, 1, 183, 1, 183, 1, 183, 1, 183, 1, 183, 1, 183, 1, 183, 1, 183, 1, 183, 1, 183, 3, 183, - 2245, 8, 183, 1, 184, 1, 184, 3, 184, 2249, 8, 184, 1, 185, 1, 185, 3, 185, 2253, 8, 185, 1, 185, 1, 185, 1, 185, 1, - 185, 1, 185, 3, 185, 2260, 8, 185, 1, 185, 3, 185, 2263, 8, 185, 1, 185, 5, 185, 2266, 8, 185, 10, 185, 12, 185, - 2269, 9, 185, 1, 185, 1, 185, 5, 185, 2273, 8, 185, 10, 185, 12, 185, 2276, 9, 185, 1, 185, 1, 185, 1, 185, 3, 185, - 2281, 8, 185, 1, 185, 1, 185, 1, 186, 1, 186, 3, 186, 2287, 8, 186, 1, 186, 1, 186, 1, 186, 1, 186, 1, 186, 1, 186, - 3, 186, 2295, 8, 186, 1, 186, 3, 186, 2298, 8, 186, 1, 186, 5, 186, 2301, 8, 186, 10, 186, 12, 186, 2304, 9, 186, 1, - 186, 1, 186, 5, 186, 2308, 8, 186, 10, 186, 12, 186, 2311, 9, 186, 1, 186, 1, 186, 3, 186, 2315, 8, 186, 1, 186, 1, - 186, 3, 186, 2319, 8, 186, 1, 186, 1, 186, 1, 187, 1, 187, 1, 187, 5, 187, 2326, 8, 187, 10, 187, 12, 187, 2329, 9, - 187, 1, 187, 1, 187, 1, 187, 1, 187, 3, 187, 2335, 8, 187, 1, 188, 1, 188, 1, 188, 1, 188, 1, 188, 1, 188, 1, 188, - 1, 188, 1, 188, 1, 188, 1, 188, 1, 188, 1, 188, 1, 188, 1, 188, 3, 188, 2352, 8, 188, 1, 189, 1, 189, 5, 189, 2356, - 8, 189, 10, 189, 12, 189, 2359, 9, 189, 1, 189, 1, 189, 1, 189, 3, 189, 2364, 8, 189, 1, 190, 1, 190, 1, 190, 1, - 190, 1, 190, 1, 190, 3, 190, 2372, 8, 190, 1, 191, 1, 191, 3, 191, 2376, 8, 191, 1, 192, 1, 192, 1, 192, 3, 192, - 2381, 8, 192, 1, 193, 1, 193, 1, 193, 1, 193, 1, 193, 1, 193, 1, 193, 1, 193, 3, 193, 2391, 8, 193, 1, 194, 1, 194, - 1, 194, 3, 194, 2396, 8, 194, 1, 195, 1, 195, 1, 195, 1, 196, 1, 196, 1, 196, 1, 196, 5, 196, 2405, 8, 196, 10, 196, - 12, 196, 2408, 9, 196, 1, 196, 1, 196, 1, 197, 1, 197, 1, 197, 1, 198, 1, 198, 1, 198, 5, 198, 2418, 8, 198, 10, - 198, 12, 198, 2421, 9, 198, 1, 199, 1, 199, 1, 199, 1, 200, 1, 200, 1, 200, 5, 200, 2429, 8, 200, 10, 200, 12, 200, - 2432, 9, 200, 1, 201, 1, 201, 5, 201, 2436, 8, 201, 10, 201, 12, 201, 2439, 9, 201, 1, 201, 1, 201, 1, 201, 3, 201, - 2444, 8, 201, 1, 202, 1, 202, 1, 202, 1, 202, 3, 202, 2450, 8, 202, 1, 203, 1, 203, 5, 203, 2454, 8, 203, 10, 203, - 12, 203, 2457, 9, 203, 1, 203, 1, 203, 1, 204, 1, 204, 3, 204, 2463, 8, 204, 1, 204, 1, 204, 1, 204, 1, 204, 3, 204, - 2469, 8, 204, 1, 204, 1, 204, 1, 205, 1, 205, 1, 205, 1, 205, 1, 205, 3, 205, 2478, 8, 205, 1, 206, 1, 206, 3, 206, - 2482, 8, 206, 1, 207, 1, 207, 1, 208, 1, 208, 1, 208, 1, 208, 3, 208, 2490, 8, 208, 1, 209, 1, 209, 1, 209, 1, 209, - 1, 209, 1, 210, 1, 210, 1, 210, 1, 210, 1, 210, 5, 210, 2502, 8, 210, 10, 210, 12, 210, 2505, 9, 210, 1, 210, 1, - 210, 1, 210, 1, 210, 1, 211, 1, 211, 1, 211, 1, 211, 3, 211, 2515, 8, 211, 1, 211, 1, 211, 1, 211, 1, 211, 1, 211, - 1, 211, 1, 211, 1, 212, 1, 212, 1, 212, 4, 212, 2527, 8, 212, 11, 212, 12, 212, 2528, 1, 212, 1, 212, 1, 212, 5, - 212, 2534, 8, 212, 10, 212, 12, 212, 2537, 9, 212, 1, 212, 1, 212, 3, 212, 2541, 8, 212, 1, 213, 1, 213, 3, 213, - 2545, 8, 213, 1, 214, 1, 214, 1, 214, 1, 214, 3, 214, 2551, 8, 214, 1, 214, 1, 214, 1, 214, 1, 214, 1, 214, 1, 215, - 1, 215, 1, 215, 1, 215, 3, 215, 2562, 8, 215, 1, 215, 1, 215, 1, 215, 1, 215, 1, 215, 1, 215, 1, 216, 1, 216, 1, - 216, 1, 216, 1, 216, 5, 216, 2575, 8, 216, 10, 216, 12, 216, 2578, 9, 216, 1, 216, 1, 216, 1, 216, 1, 216, 1, 217, - 1, 217, 1, 217, 1, 218, 1, 218, 1, 218, 5, 218, 2590, 8, 218, 10, 218, 12, 218, 2593, 9, 218, 1, 219, 1, 219, 3, - 219, 2597, 8, 219, 1, 219, 1, 219, 3, 219, 2601, 8, 219, 1, 219, 5, 219, 2604, 8, 219, 10, 219, 12, 219, 2607, 9, - 219, 1, 219, 1, 219, 5, 219, 2611, 8, 219, 10, 219, 12, 219, 2614, 9, 219, 1, 219, 1, 219, 3, 219, 2618, 8, 219, 1, - 219, 1, 219, 1, 219, 1, 220, 1, 220, 1, 220, 1, 220, 1, 220, 1, 220, 1, 220, 1, 220, 1, 220, 1, 220, 1, 220, 1, 220, - 1, 220, 1, 220, 3, 220, 2637, 8, 220, 1, 221, 1, 221, 3, 221, 2641, 8, 221, 1, 221, 1, 221, 1, 221, 3, 221, 2646, 8, - 221, 1, 222, 1, 222, 1, 222, 1, 222, 1, 222, 3, 222, 2653, 8, 222, 1, 222, 1, 222, 3, 222, 2657, 8, 222, 1, 222, 1, - 222, 1, 223, 1, 223, 1, 223, 5, 223, 2664, 8, 223, 10, 223, 12, 223, 2667, 9, 223, 1, 223, 1, 223, 3, 223, 2671, 8, - 223, 1, 224, 1, 224, 1, 224, 1, 224, 5, 224, 2677, 8, 224, 10, 224, 12, 224, 2680, 9, 224, 3, 224, 2682, 8, 224, 1, - 224, 1, 224, 3, 224, 2686, 8, 224, 1, 224, 1, 224, 1, 225, 1, 225, 1, 225, 1, 225, 1, 225, 1, 225, 1, 225, 3, 225, - 2697, 8, 225, 1, 226, 1, 226, 1, 226, 1, 226, 1, 226, 1, 226, 1, 226, 1, 227, 3, 227, 2707, 8, 227, 1, 227, 1, 227, - 3, 227, 2711, 8, 227, 1, 227, 1, 227, 3, 227, 2715, 8, 227, 1, 228, 1, 228, 1, 228, 1, 228, 1, 229, 1, 229, 1, 229, - 1, 229, 1, 229, 1, 230, 1, 230, 1, 230, 3, 230, 2729, 8, 230, 1, 231, 1, 231, 1, 231, 3, 231, 2734, 8, 231, 1, 231, - 1, 231, 1, 231, 1, 232, 1, 232, 1, 232, 1, 232, 1, 232, 1, 233, 1, 233, 1, 233, 5, 233, 2747, 8, 233, 10, 233, 12, - 233, 2750, 9, 233, 1, 233, 1, 233, 5, 233, 2754, 8, 233, 10, 233, 12, 233, 2757, 9, 233, 1, 233, 1, 233, 3, 233, - 2761, 8, 233, 1, 233, 3, 233, 2764, 8, 233, 1, 233, 1, 233, 1, 234, 1, 234, 1, 234, 1, 235, 1, 235, 1, 235, 1, 235, - 1, 235, 1, 235, 1, 235, 1, 235, 1, 235, 1, 235, 1, 235, 1, 235, 1, 235, 1, 235, 1, 235, 3, 235, 2786, 8, 235, 1, - 236, 1, 236, 1, 236, 1, 236, 1, 236, 1, 236, 3, 236, 2794, 8, 236, 1, 236, 3, 236, 2797, 8, 236, 1, 236, 1, 236, 1, - 237, 1, 237, 1, 238, 1, 238, 3, 238, 2805, 8, 238, 1, 239, 1, 239, 1, 239, 1, 239, 1, 239, 1, 239, 1, 240, 3, 240, - 2814, 8, 240, 1, 240, 1, 240, 3, 240, 2818, 8, 240, 1, 241, 1, 241, 1, 242, 1, 242, 3, 242, 2824, 8, 242, 1, 243, 1, - 243, 1, 243, 1, 244, 1, 244, 1, 244, 1, 244, 1, 244, 1, 245, 1, 245, 3, 245, 2836, 8, 245, 1, 246, 1, 246, 1, 246, - 1, 246, 1, 246, 1, 246, 3, 246, 2844, 8, 246, 1, 247, 1, 247, 1, 248, 1, 248, 1, 248, 1, 248, 1, 248, 5, 248, 2853, - 8, 248, 10, 248, 12, 248, 2856, 9, 248, 1, 248, 1, 248, 1, 248, 1, 248, 1, 249, 1, 249, 1, 249, 1, 249, 1, 250, 1, - 250, 1, 250, 1, 250, 5, 250, 2870, 8, 250, 10, 250, 12, 250, 2873, 9, 250, 1, 250, 1, 250, 1, 251, 1, 251, 3, 251, - 2879, 8, 251, 1, 251, 1, 251, 1, 251, 1, 251, 1, 252, 1, 252, 3, 252, 2887, 8, 252, 1, 252, 1, 252, 3, 252, 2891, 8, - 252, 1, 253, 3, 253, 2894, 8, 253, 1, 253, 1, 253, 1, 253, 1, 253, 1, 253, 3, 253, 2901, 8, 253, 1, 253, 1, 253, 3, - 253, 2905, 8, 253, 1, 253, 1, 253, 1, 254, 1, 254, 3, 254, 2911, 8, 254, 1, 254, 1, 254, 3, 254, 2915, 8, 254, 1, - 254, 3, 254, 2918, 8, 254, 1, 254, 3, 254, 2921, 8, 254, 1, 254, 1, 254, 1, 255, 1, 255, 1, 255, 5, 255, 2928, 8, - 255, 10, 255, 12, 255, 2931, 9, 255, 1, 255, 3, 255, 2934, 8, 255, 1, 256, 1, 256, 1, 256, 3, 256, 2939, 8, 256, 1, - 256, 1, 256, 1, 256, 3, 256, 2944, 8, 256, 3, 256, 2946, 8, 256, 1, 256, 0, 2, 184, 314, 257, 0, 2, 4, 6, 8, 10, 12, - 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, - 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, - 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, - 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, - 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 236, 238, 240, 242, 244, 246, 248, 250, 252, 254, 256, 258, 260, - 262, 264, 266, 268, 270, 272, 274, 276, 278, 280, 282, 284, 286, 288, 290, 292, 294, 296, 298, 300, 302, 304, 306, - 308, 310, 312, 314, 316, 318, 320, 322, 324, 326, 328, 330, 332, 334, 336, 338, 340, 342, 344, 346, 348, 350, 352, - 354, 356, 358, 360, 362, 364, 366, 368, 370, 372, 374, 376, 378, 380, 382, 384, 386, 388, 390, 392, 394, 396, 398, - 400, 402, 404, 406, 408, 410, 412, 414, 416, 418, 420, 422, 424, 426, 428, 430, 432, 434, 436, 438, 440, 442, 444, - 446, 448, 450, 452, 454, 456, 458, 460, 462, 464, 466, 468, 470, 472, 474, 476, 478, 480, 482, 484, 486, 488, 490, - 492, 494, 496, 498, 500, 502, 504, 506, 508, 510, 512, 0, 19, 1, 0, 162, 164, 4, 0, 79, 80, 93, 93, 98, 98, 164, - 164, 1, 0, 163, 164, 2, 0, 30, 30, 102, 102, 13, 0, 12, 12, 23, 25, 34, 34, 36, 36, 39, 39, 51, 51, 70, 70, 75, 75, - 93, 93, 98, 98, 104, 104, 106, 106, 109, 110, 2, 0, 162, 162, 164, 164, 7, 0, 6, 6, 11, 11, 58, 58, 61, 62, 67, 67, - 119, 120, 133, 134, 3, 0, 57, 57, 84, 84, 135, 136, 2, 0, 133, 134, 138, 138, 2, 0, 87, 88, 94, 97, 1, 0, 121, 132, - 5, 0, 11, 11, 58, 58, 61, 61, 67, 67, 119, 120, 2, 0, 47, 47, 69, 69, 2, 0, 46, 46, 78, 78, 2, 0, 28, 28, 143, 143, - 5, 0, 20, 20, 47, 47, 49, 49, 53, 53, 69, 69, 2, 0, 21, 21, 81, 81, 2, 0, 39, 39, 75, 75, 2, 0, 10, 10, 162, 164, - 3212, 0, 514, 1, 0, 0, 0, 2, 517, 1, 0, 0, 0, 4, 520, 1, 0, 0, 0, 6, 530, 1, 0, 0, 0, 8, 538, 1, 0, 0, 0, 10, 540, - 1, 0, 0, 0, 12, 551, 1, 0, 0, 0, 14, 564, 1, 0, 0, 0, 16, 566, 1, 0, 0, 0, 18, 568, 1, 0, 0, 0, 20, 573, 1, 0, 0, 0, - 22, 623, 1, 0, 0, 0, 24, 635, 1, 0, 0, 0, 26, 637, 1, 0, 0, 0, 28, 639, 1, 0, 0, 0, 30, 641, 1, 0, 0, 0, 32, 651, 1, - 0, 0, 0, 34, 653, 1, 0, 0, 0, 36, 661, 1, 0, 0, 0, 38, 669, 1, 0, 0, 0, 40, 681, 1, 0, 0, 0, 42, 689, 1, 0, 0, 0, - 44, 693, 1, 0, 0, 0, 46, 701, 1, 0, 0, 0, 48, 707, 1, 0, 0, 0, 50, 709, 1, 0, 0, 0, 52, 719, 1, 0, 0, 0, 54, 727, 1, - 0, 0, 0, 56, 765, 1, 0, 0, 0, 58, 775, 1, 0, 0, 0, 60, 777, 1, 0, 0, 0, 62, 825, 1, 0, 0, 0, 64, 838, 1, 0, 0, 0, - 66, 857, 1, 0, 0, 0, 68, 874, 1, 0, 0, 0, 70, 887, 1, 0, 0, 0, 72, 889, 1, 0, 0, 0, 74, 897, 1, 0, 0, 0, 76, 911, 1, - 0, 0, 0, 78, 931, 1, 0, 0, 0, 80, 942, 1, 0, 0, 0, 82, 949, 1, 0, 0, 0, 84, 951, 1, 0, 0, 0, 86, 961, 1, 0, 0, 0, - 88, 969, 1, 0, 0, 0, 90, 982, 1, 0, 0, 0, 92, 990, 1, 0, 0, 0, 94, 1006, 1, 0, 0, 0, 96, 1016, 1, 0, 0, 0, 98, 1027, - 1, 0, 0, 0, 100, 1030, 1, 0, 0, 0, 102, 1038, 1, 0, 0, 0, 104, 1050, 1, 0, 0, 0, 106, 1058, 1, 0, 0, 0, 108, 1075, - 1, 0, 0, 0, 110, 1098, 1, 0, 0, 0, 112, 1102, 1, 0, 0, 0, 114, 1106, 1, 0, 0, 0, 116, 1108, 1, 0, 0, 0, 118, 1118, - 1, 0, 0, 0, 120, 1127, 1, 0, 0, 0, 122, 1129, 1, 0, 0, 0, 124, 1148, 1, 0, 0, 0, 126, 1150, 1, 0, 0, 0, 128, 1167, - 1, 0, 0, 0, 130, 1170, 1, 0, 0, 0, 132, 1179, 1, 0, 0, 0, 134, 1184, 1, 0, 0, 0, 136, 1186, 1, 0, 0, 0, 138, 1188, - 1, 0, 0, 0, 140, 1196, 1, 0, 0, 0, 142, 1198, 1, 0, 0, 0, 144, 1202, 1, 0, 0, 0, 146, 1210, 1, 0, 0, 0, 148, 1216, - 1, 0, 0, 0, 150, 1218, 1, 0, 0, 0, 152, 1225, 1, 0, 0, 0, 154, 1229, 1, 0, 0, 0, 156, 1231, 1, 0, 0, 0, 158, 1236, - 1, 0, 0, 0, 160, 1248, 1, 0, 0, 0, 162, 1250, 1, 0, 0, 0, 164, 1252, 1, 0, 0, 0, 166, 1303, 1, 0, 0, 0, 168, 1305, - 1, 0, 0, 0, 170, 1319, 1, 0, 0, 0, 172, 1321, 1, 0, 0, 0, 174, 1329, 1, 0, 0, 0, 176, 1331, 1, 0, 0, 0, 178, 1333, - 1, 0, 0, 0, 180, 1335, 1, 0, 0, 0, 182, 1348, 1, 0, 0, 0, 184, 1366, 1, 0, 0, 0, 186, 1393, 1, 0, 0, 0, 188, 1398, - 1, 0, 0, 0, 190, 1400, 1, 0, 0, 0, 192, 1407, 1, 0, 0, 0, 194, 1414, 1, 0, 0, 0, 196, 1424, 1, 0, 0, 0, 198, 1426, - 1, 0, 0, 0, 200, 1435, 1, 0, 0, 0, 202, 1441, 1, 0, 0, 0, 204, 1446, 1, 0, 0, 0, 206, 1450, 1, 0, 0, 0, 208, 1455, - 1, 0, 0, 0, 210, 1457, 1, 0, 0, 0, 212, 1470, 1, 0, 0, 0, 214, 1472, 1, 0, 0, 0, 216, 1476, 1, 0, 0, 0, 218, 1487, - 1, 0, 0, 0, 220, 1489, 1, 0, 0, 0, 222, 1495, 1, 0, 0, 0, 224, 1500, 1, 0, 0, 0, 226, 1522, 1, 0, 0, 0, 228, 1527, - 1, 0, 0, 0, 230, 1536, 1, 0, 0, 0, 232, 1551, 1, 0, 0, 0, 234, 1564, 1, 0, 0, 0, 236, 1570, 1, 0, 0, 0, 238, 1574, - 1, 0, 0, 0, 240, 1582, 1, 0, 0, 0, 242, 1624, 1, 0, 0, 0, 244, 1667, 1, 0, 0, 0, 246, 1669, 1, 0, 0, 0, 248, 1682, - 1, 0, 0, 0, 250, 1686, 1, 0, 0, 0, 252, 1688, 1, 0, 0, 0, 254, 1699, 1, 0, 0, 0, 256, 1716, 1, 0, 0, 0, 258, 1728, - 1, 0, 0, 0, 260, 1730, 1, 0, 0, 0, 262, 1733, 1, 0, 0, 0, 264, 1736, 1, 0, 0, 0, 266, 1754, 1, 0, 0, 0, 268, 1756, - 1, 0, 0, 0, 270, 1758, 1, 0, 0, 0, 272, 1764, 1, 0, 0, 0, 274, 1780, 1, 0, 0, 0, 276, 1791, 1, 0, 0, 0, 278, 1804, - 1, 0, 0, 0, 280, 1806, 1, 0, 0, 0, 282, 1818, 1, 0, 0, 0, 284, 1824, 1, 0, 0, 0, 286, 1831, 1, 0, 0, 0, 288, 1835, - 1, 0, 0, 0, 290, 1837, 1, 0, 0, 0, 292, 1845, 1, 0, 0, 0, 294, 1848, 1, 0, 0, 0, 296, 1864, 1, 0, 0, 0, 298, 1866, - 1, 0, 0, 0, 300, 1884, 1, 0, 0, 0, 302, 1891, 1, 0, 0, 0, 304, 1895, 1, 0, 0, 0, 306, 1914, 1, 0, 0, 0, 308, 1919, - 1, 0, 0, 0, 310, 1921, 1, 0, 0, 0, 312, 1937, 1, 0, 0, 0, 314, 1947, 1, 0, 0, 0, 316, 1988, 1, 0, 0, 0, 318, 2002, - 1, 0, 0, 0, 320, 2009, 1, 0, 0, 0, 322, 2011, 1, 0, 0, 0, 324, 2046, 1, 0, 0, 0, 326, 2048, 1, 0, 0, 0, 328, 2085, - 1, 0, 0, 0, 330, 2087, 1, 0, 0, 0, 332, 2097, 1, 0, 0, 0, 334, 2111, 1, 0, 0, 0, 336, 2117, 1, 0, 0, 0, 338, 2126, - 1, 0, 0, 0, 340, 2131, 1, 0, 0, 0, 342, 2133, 1, 0, 0, 0, 344, 2137, 1, 0, 0, 0, 346, 2141, 1, 0, 0, 0, 348, 2158, - 1, 0, 0, 0, 350, 2167, 1, 0, 0, 0, 352, 2180, 1, 0, 0, 0, 354, 2197, 1, 0, 0, 0, 356, 2199, 1, 0, 0, 0, 358, 2202, - 1, 0, 0, 0, 360, 2204, 1, 0, 0, 0, 362, 2213, 1, 0, 0, 0, 364, 2218, 1, 0, 0, 0, 366, 2244, 1, 0, 0, 0, 368, 2248, - 1, 0, 0, 0, 370, 2252, 1, 0, 0, 0, 372, 2286, 1, 0, 0, 0, 374, 2322, 1, 0, 0, 0, 376, 2351, 1, 0, 0, 0, 378, 2353, - 1, 0, 0, 0, 380, 2371, 1, 0, 0, 0, 382, 2375, 1, 0, 0, 0, 384, 2377, 1, 0, 0, 0, 386, 2382, 1, 0, 0, 0, 388, 2395, - 1, 0, 0, 0, 390, 2397, 1, 0, 0, 0, 392, 2400, 1, 0, 0, 0, 394, 2411, 1, 0, 0, 0, 396, 2414, 1, 0, 0, 0, 398, 2422, - 1, 0, 0, 0, 400, 2425, 1, 0, 0, 0, 402, 2433, 1, 0, 0, 0, 404, 2445, 1, 0, 0, 0, 406, 2455, 1, 0, 0, 0, 408, 2462, - 1, 0, 0, 0, 410, 2477, 1, 0, 0, 0, 412, 2481, 1, 0, 0, 0, 414, 2483, 1, 0, 0, 0, 416, 2489, 1, 0, 0, 0, 418, 2491, - 1, 0, 0, 0, 420, 2503, 1, 0, 0, 0, 422, 2510, 1, 0, 0, 0, 424, 2540, 1, 0, 0, 0, 426, 2544, 1, 0, 0, 0, 428, 2546, - 1, 0, 0, 0, 430, 2557, 1, 0, 0, 0, 432, 2576, 1, 0, 0, 0, 434, 2583, 1, 0, 0, 0, 436, 2586, 1, 0, 0, 0, 438, 2596, - 1, 0, 0, 0, 440, 2636, 1, 0, 0, 0, 442, 2640, 1, 0, 0, 0, 444, 2647, 1, 0, 0, 0, 446, 2670, 1, 0, 0, 0, 448, 2672, - 1, 0, 0, 0, 450, 2689, 1, 0, 0, 0, 452, 2698, 1, 0, 0, 0, 454, 2706, 1, 0, 0, 0, 456, 2716, 1, 0, 0, 0, 458, 2720, - 1, 0, 0, 0, 460, 2728, 1, 0, 0, 0, 462, 2730, 1, 0, 0, 0, 464, 2738, 1, 0, 0, 0, 466, 2743, 1, 0, 0, 0, 468, 2767, - 1, 0, 0, 0, 470, 2785, 1, 0, 0, 0, 472, 2787, 1, 0, 0, 0, 474, 2800, 1, 0, 0, 0, 476, 2804, 1, 0, 0, 0, 478, 2806, - 1, 0, 0, 0, 480, 2813, 1, 0, 0, 0, 482, 2819, 1, 0, 0, 0, 484, 2823, 1, 0, 0, 0, 486, 2825, 1, 0, 0, 0, 488, 2828, - 1, 0, 0, 0, 490, 2835, 1, 0, 0, 0, 492, 2843, 1, 0, 0, 0, 494, 2845, 1, 0, 0, 0, 496, 2847, 1, 0, 0, 0, 498, 2861, - 1, 0, 0, 0, 500, 2865, 1, 0, 0, 0, 502, 2878, 1, 0, 0, 0, 504, 2886, 1, 0, 0, 0, 506, 2893, 1, 0, 0, 0, 508, 2910, - 1, 0, 0, 0, 510, 2933, 1, 0, 0, 0, 512, 2945, 1, 0, 0, 0, 514, 515, 5, 154, 0, 0, 515, 516, 3, 338, 169, 0, 516, 1, - 1, 0, 0, 0, 517, 518, 5, 7, 0, 0, 518, 519, 3, 244, 122, 0, 519, 3, 1, 0, 0, 0, 520, 521, 5, 7, 0, 0, 521, 522, 3, - 480, 240, 0, 522, 5, 1, 0, 0, 0, 523, 525, 5, 48, 0, 0, 524, 523, 1, 0, 0, 0, 524, 525, 1, 0, 0, 0, 525, 526, 1, 0, - 0, 0, 526, 531, 3, 184, 92, 0, 527, 531, 3, 314, 157, 0, 528, 531, 3, 480, 240, 0, 529, 531, 5, 66, 0, 0, 530, 524, - 1, 0, 0, 0, 530, 527, 1, 0, 0, 0, 530, 528, 1, 0, 0, 0, 530, 529, 1, 0, 0, 0, 531, 7, 1, 0, 0, 0, 532, 539, 3, 6, 3, - 0, 533, 534, 3, 314, 157, 0, 534, 535, 5, 144, 0, 0, 535, 536, 3, 6, 3, 0, 536, 537, 5, 145, 0, 0, 537, 539, 1, 0, - 0, 0, 538, 532, 1, 0, 0, 0, 538, 533, 1, 0, 0, 0, 539, 9, 1, 0, 0, 0, 540, 541, 5, 144, 0, 0, 541, 546, 3, 146, 73, - 0, 542, 543, 5, 152, 0, 0, 543, 545, 3, 146, 73, 0, 544, 542, 1, 0, 0, 0, 545, 548, 1, 0, 0, 0, 546, 544, 1, 0, 0, - 0, 546, 547, 1, 0, 0, 0, 547, 549, 1, 0, 0, 0, 548, 546, 1, 0, 0, 0, 549, 550, 5, 145, 0, 0, 550, 11, 1, 0, 0, 0, - 551, 552, 5, 9, 0, 0, 552, 555, 3, 14, 7, 0, 553, 554, 5, 150, 0, 0, 554, 556, 3, 16, 8, 0, 555, 553, 1, 0, 0, 0, - 555, 556, 1, 0, 0, 0, 556, 557, 1, 0, 0, 0, 557, 558, 5, 50, 0, 0, 558, 560, 3, 314, 157, 0, 559, 561, 3, 448, 224, - 0, 560, 559, 1, 0, 0, 0, 560, 561, 1, 0, 0, 0, 561, 562, 1, 0, 0, 0, 562, 563, 5, 151, 0, 0, 563, 13, 1, 0, 0, 0, - 564, 565, 7, 0, 0, 0, 565, 15, 1, 0, 0, 0, 566, 567, 3, 480, 240, 0, 567, 17, 1, 0, 0, 0, 568, 571, 5, 59, 0, 0, - 569, 572, 3, 480, 240, 0, 570, 572, 3, 386, 193, 0, 571, 569, 1, 0, 0, 0, 571, 570, 1, 0, 0, 0, 572, 19, 1, 0, 0, 0, - 573, 574, 5, 12, 0, 0, 574, 575, 5, 164, 0, 0, 575, 576, 5, 64, 0, 0, 576, 577, 5, 164, 0, 0, 577, 581, 5, 50, 0, 0, - 578, 580, 3, 56, 28, 0, 579, 578, 1, 0, 0, 0, 580, 583, 1, 0, 0, 0, 581, 579, 1, 0, 0, 0, 581, 582, 1, 0, 0, 0, 582, - 584, 1, 0, 0, 0, 583, 581, 1, 0, 0, 0, 584, 588, 5, 17, 0, 0, 585, 587, 3, 22, 11, 0, 586, 585, 1, 0, 0, 0, 587, - 590, 1, 0, 0, 0, 588, 586, 1, 0, 0, 0, 588, 589, 1, 0, 0, 0, 589, 591, 1, 0, 0, 0, 590, 588, 1, 0, 0, 0, 591, 593, - 5, 33, 0, 0, 592, 594, 5, 12, 0, 0, 593, 592, 1, 0, 0, 0, 593, 594, 1, 0, 0, 0, 594, 596, 1, 0, 0, 0, 595, 597, 5, - 164, 0, 0, 596, 595, 1, 0, 0, 0, 596, 597, 1, 0, 0, 0, 597, 598, 1, 0, 0, 0, 598, 599, 5, 151, 0, 0, 599, 21, 1, 0, - 0, 0, 600, 624, 3, 60, 30, 0, 601, 624, 3, 370, 185, 0, 602, 624, 3, 372, 186, 0, 603, 604, 5, 164, 0, 0, 604, 606, - 5, 150, 0, 0, 605, 603, 1, 0, 0, 0, 605, 606, 1, 0, 0, 0, 606, 607, 1, 0, 0, 0, 607, 624, 3, 90, 45, 0, 608, 609, 5, - 164, 0, 0, 609, 611, 5, 150, 0, 0, 610, 608, 1, 0, 0, 0, 610, 611, 1, 0, 0, 0, 611, 612, 1, 0, 0, 0, 612, 624, 3, - 86, 43, 0, 613, 614, 5, 164, 0, 0, 614, 616, 5, 150, 0, 0, 615, 613, 1, 0, 0, 0, 615, 616, 1, 0, 0, 0, 616, 618, 1, - 0, 0, 0, 617, 619, 5, 73, 0, 0, 618, 617, 1, 0, 0, 0, 618, 619, 1, 0, 0, 0, 619, 620, 1, 0, 0, 0, 620, 624, 3, 94, - 47, 0, 621, 624, 3, 78, 39, 0, 622, 624, 3, 228, 114, 0, 623, 600, 1, 0, 0, 0, 623, 601, 1, 0, 0, 0, 623, 602, 1, 0, - 0, 0, 623, 605, 1, 0, 0, 0, 623, 610, 1, 0, 0, 0, 623, 615, 1, 0, 0, 0, 623, 621, 1, 0, 0, 0, 623, 622, 1, 0, 0, 0, - 624, 23, 1, 0, 0, 0, 625, 627, 3, 252, 126, 0, 626, 628, 3, 26, 13, 0, 627, 626, 1, 0, 0, 0, 627, 628, 1, 0, 0, 0, - 628, 636, 1, 0, 0, 0, 629, 630, 5, 144, 0, 0, 630, 631, 5, 66, 0, 0, 631, 633, 5, 145, 0, 0, 632, 634, 3, 26, 13, 0, - 633, 632, 1, 0, 0, 0, 633, 634, 1, 0, 0, 0, 634, 636, 1, 0, 0, 0, 635, 625, 1, 0, 0, 0, 635, 629, 1, 0, 0, 0, 636, - 25, 1, 0, 0, 0, 637, 638, 3, 148, 74, 0, 638, 27, 1, 0, 0, 0, 639, 640, 3, 410, 205, 0, 640, 29, 1, 0, 0, 0, 641, - 642, 5, 13, 0, 0, 642, 643, 5, 144, 0, 0, 643, 644, 3, 34, 17, 0, 644, 645, 5, 145, 0, 0, 645, 646, 5, 64, 0, 0, - 646, 647, 3, 244, 122, 0, 647, 31, 1, 0, 0, 0, 648, 652, 3, 254, 127, 0, 649, 652, 3, 252, 126, 0, 650, 652, 3, 498, - 249, 0, 651, 648, 1, 0, 0, 0, 651, 649, 1, 0, 0, 0, 651, 650, 1, 0, 0, 0, 652, 33, 1, 0, 0, 0, 653, 658, 3, 32, 16, - 0, 654, 655, 5, 152, 0, 0, 655, 657, 3, 32, 16, 0, 656, 654, 1, 0, 0, 0, 657, 660, 1, 0, 0, 0, 658, 656, 1, 0, 0, 0, - 658, 659, 1, 0, 0, 0, 659, 35, 1, 0, 0, 0, 660, 658, 1, 0, 0, 0, 661, 662, 5, 110, 0, 0, 662, 663, 5, 144, 0, 0, - 663, 664, 3, 314, 157, 0, 664, 667, 5, 145, 0, 0, 665, 666, 5, 64, 0, 0, 666, 668, 3, 480, 240, 0, 667, 665, 1, 0, - 0, 0, 667, 668, 1, 0, 0, 0, 668, 37, 1, 0, 0, 0, 669, 670, 5, 14, 0, 0, 670, 673, 3, 184, 92, 0, 671, 672, 5, 85, 0, - 0, 672, 674, 3, 184, 92, 0, 673, 671, 1, 0, 0, 0, 673, 674, 1, 0, 0, 0, 674, 677, 1, 0, 0, 0, 675, 676, 5, 91, 0, 0, - 676, 678, 3, 184, 92, 0, 677, 675, 1, 0, 0, 0, 677, 678, 1, 0, 0, 0, 678, 39, 1, 0, 0, 0, 679, 680, 5, 164, 0, 0, - 680, 682, 5, 150, 0, 0, 681, 679, 1, 0, 0, 0, 681, 682, 1, 0, 0, 0, 682, 683, 1, 0, 0, 0, 683, 684, 3, 38, 19, 0, - 684, 685, 5, 151, 0, 0, 685, 41, 1, 0, 0, 0, 686, 687, 3, 218, 109, 0, 687, 688, 5, 140, 0, 0, 688, 690, 1, 0, 0, 0, - 689, 686, 1, 0, 0, 0, 689, 690, 1, 0, 0, 0, 690, 691, 1, 0, 0, 0, 691, 692, 3, 8, 4, 0, 692, 43, 1, 0, 0, 0, 693, - 698, 3, 42, 21, 0, 694, 695, 5, 152, 0, 0, 695, 697, 3, 42, 21, 0, 696, 694, 1, 0, 0, 0, 697, 700, 1, 0, 0, 0, 698, - 696, 1, 0, 0, 0, 698, 699, 1, 0, 0, 0, 699, 45, 1, 0, 0, 0, 700, 698, 1, 0, 0, 0, 701, 702, 5, 15, 0, 0, 702, 703, - 5, 164, 0, 0, 703, 704, 5, 150, 0, 0, 704, 705, 3, 314, 157, 0, 705, 706, 5, 151, 0, 0, 706, 47, 1, 0, 0, 0, 707, - 708, 7, 1, 0, 0, 708, 49, 1, 0, 0, 0, 709, 710, 5, 15, 0, 0, 710, 711, 5, 164, 0, 0, 711, 712, 5, 64, 0, 0, 712, - 713, 3, 172, 86, 0, 713, 714, 5, 50, 0, 0, 714, 715, 3, 100, 50, 0, 715, 716, 5, 151, 0, 0, 716, 51, 1, 0, 0, 0, - 717, 718, 5, 108, 0, 0, 718, 720, 3, 160, 80, 0, 719, 717, 1, 0, 0, 0, 719, 720, 1, 0, 0, 0, 720, 722, 1, 0, 0, 0, - 721, 723, 3, 234, 117, 0, 722, 721, 1, 0, 0, 0, 722, 723, 1, 0, 0, 0, 723, 725, 1, 0, 0, 0, 724, 726, 3, 352, 176, - 0, 725, 724, 1, 0, 0, 0, 725, 726, 1, 0, 0, 0, 726, 53, 1, 0, 0, 0, 727, 728, 5, 37, 0, 0, 728, 732, 3, 58, 29, 0, - 729, 731, 3, 500, 250, 0, 730, 729, 1, 0, 0, 0, 731, 734, 1, 0, 0, 0, 732, 730, 1, 0, 0, 0, 732, 733, 1, 0, 0, 0, - 733, 738, 1, 0, 0, 0, 734, 732, 1, 0, 0, 0, 735, 737, 3, 112, 56, 0, 736, 735, 1, 0, 0, 0, 737, 740, 1, 0, 0, 0, - 738, 736, 1, 0, 0, 0, 738, 739, 1, 0, 0, 0, 739, 741, 1, 0, 0, 0, 740, 738, 1, 0, 0, 0, 741, 742, 5, 33, 0, 0, 742, - 743, 5, 37, 0, 0, 743, 744, 5, 151, 0, 0, 744, 55, 1, 0, 0, 0, 745, 766, 3, 468, 234, 0, 746, 766, 3, 466, 233, 0, - 747, 766, 3, 472, 236, 0, 748, 766, 3, 326, 163, 0, 749, 766, 3, 322, 161, 0, 750, 766, 3, 330, 165, 0, 751, 766, 3, - 490, 245, 0, 752, 766, 3, 478, 239, 0, 753, 766, 3, 310, 155, 0, 754, 766, 3, 116, 58, 0, 755, 766, 3, 444, 222, 0, - 756, 766, 3, 506, 253, 0, 757, 766, 3, 198, 99, 0, 758, 766, 3, 12, 6, 0, 759, 766, 3, 76, 38, 0, 760, 766, 3, 46, - 23, 0, 761, 766, 3, 50, 25, 0, 762, 766, 3, 114, 57, 0, 763, 766, 3, 138, 69, 0, 764, 766, 3, 500, 250, 0, 765, 745, - 1, 0, 0, 0, 765, 746, 1, 0, 0, 0, 765, 747, 1, 0, 0, 0, 765, 748, 1, 0, 0, 0, 765, 749, 1, 0, 0, 0, 765, 750, 1, 0, - 0, 0, 765, 751, 1, 0, 0, 0, 765, 752, 1, 0, 0, 0, 765, 753, 1, 0, 0, 0, 765, 754, 1, 0, 0, 0, 765, 755, 1, 0, 0, 0, - 765, 756, 1, 0, 0, 0, 765, 757, 1, 0, 0, 0, 765, 758, 1, 0, 0, 0, 765, 759, 1, 0, 0, 0, 765, 760, 1, 0, 0, 0, 765, - 761, 1, 0, 0, 0, 765, 762, 1, 0, 0, 0, 765, 763, 1, 0, 0, 0, 765, 764, 1, 0, 0, 0, 766, 57, 1, 0, 0, 0, 767, 776, 3, - 314, 157, 0, 768, 773, 5, 164, 0, 0, 769, 770, 5, 144, 0, 0, 770, 771, 3, 226, 113, 0, 771, 772, 5, 145, 0, 0, 772, - 774, 1, 0, 0, 0, 773, 769, 1, 0, 0, 0, 773, 774, 1, 0, 0, 0, 774, 776, 1, 0, 0, 0, 775, 767, 1, 0, 0, 0, 775, 768, - 1, 0, 0, 0, 776, 59, 1, 0, 0, 0, 777, 778, 5, 164, 0, 0, 778, 779, 5, 150, 0, 0, 779, 784, 5, 18, 0, 0, 780, 781, 5, - 144, 0, 0, 781, 782, 3, 184, 92, 0, 782, 783, 5, 145, 0, 0, 783, 785, 1, 0, 0, 0, 784, 780, 1, 0, 0, 0, 784, 785, 1, - 0, 0, 0, 785, 787, 1, 0, 0, 0, 786, 788, 5, 50, 0, 0, 787, 786, 1, 0, 0, 0, 787, 788, 1, 0, 0, 0, 788, 795, 1, 0, 0, - 0, 789, 793, 3, 232, 116, 0, 790, 791, 3, 234, 117, 0, 791, 792, 5, 151, 0, 0, 792, 794, 1, 0, 0, 0, 793, 790, 1, 0, - 0, 0, 793, 794, 1, 0, 0, 0, 794, 796, 1, 0, 0, 0, 795, 789, 1, 0, 0, 0, 795, 796, 1, 0, 0, 0, 796, 803, 1, 0, 0, 0, - 797, 801, 3, 350, 175, 0, 798, 799, 3, 352, 176, 0, 799, 800, 5, 151, 0, 0, 800, 802, 1, 0, 0, 0, 801, 798, 1, 0, 0, - 0, 801, 802, 1, 0, 0, 0, 802, 804, 1, 0, 0, 0, 803, 797, 1, 0, 0, 0, 803, 804, 1, 0, 0, 0, 804, 808, 1, 0, 0, 0, - 805, 807, 3, 56, 28, 0, 806, 805, 1, 0, 0, 0, 807, 810, 1, 0, 0, 0, 808, 806, 1, 0, 0, 0, 808, 809, 1, 0, 0, 0, 809, - 811, 1, 0, 0, 0, 810, 808, 1, 0, 0, 0, 811, 815, 5, 17, 0, 0, 812, 814, 3, 22, 11, 0, 813, 812, 1, 0, 0, 0, 814, - 817, 1, 0, 0, 0, 815, 813, 1, 0, 0, 0, 815, 816, 1, 0, 0, 0, 816, 818, 1, 0, 0, 0, 817, 815, 1, 0, 0, 0, 818, 819, - 5, 33, 0, 0, 819, 821, 5, 18, 0, 0, 820, 822, 5, 164, 0, 0, 821, 820, 1, 0, 0, 0, 821, 822, 1, 0, 0, 0, 822, 823, 1, - 0, 0, 0, 823, 824, 5, 151, 0, 0, 824, 61, 1, 0, 0, 0, 825, 828, 5, 117, 0, 0, 826, 827, 5, 164, 0, 0, 827, 829, 5, - 150, 0, 0, 828, 826, 1, 0, 0, 0, 828, 829, 1, 0, 0, 0, 829, 830, 1, 0, 0, 0, 830, 831, 3, 72, 36, 0, 831, 835, 5, - 140, 0, 0, 832, 834, 3, 22, 11, 0, 833, 832, 1, 0, 0, 0, 834, 837, 1, 0, 0, 0, 835, 833, 1, 0, 0, 0, 835, 836, 1, 0, - 0, 0, 836, 63, 1, 0, 0, 0, 837, 835, 1, 0, 0, 0, 838, 839, 5, 164, 0, 0, 839, 840, 5, 150, 0, 0, 840, 841, 5, 22, 0, - 0, 841, 842, 3, 184, 92, 0, 842, 844, 5, 41, 0, 0, 843, 845, 3, 62, 31, 0, 844, 843, 1, 0, 0, 0, 845, 846, 1, 0, 0, - 0, 846, 844, 1, 0, 0, 0, 846, 847, 1, 0, 0, 0, 847, 848, 1, 0, 0, 0, 848, 849, 5, 33, 0, 0, 849, 851, 5, 41, 0, 0, - 850, 852, 5, 164, 0, 0, 851, 850, 1, 0, 0, 0, 851, 852, 1, 0, 0, 0, 852, 853, 1, 0, 0, 0, 853, 854, 5, 151, 0, 0, - 854, 65, 1, 0, 0, 0, 855, 856, 5, 164, 0, 0, 856, 858, 5, 150, 0, 0, 857, 855, 1, 0, 0, 0, 857, 858, 1, 0, 0, 0, - 858, 859, 1, 0, 0, 0, 859, 860, 5, 22, 0, 0, 860, 861, 3, 184, 92, 0, 861, 863, 5, 50, 0, 0, 862, 864, 3, 68, 34, 0, - 863, 862, 1, 0, 0, 0, 864, 865, 1, 0, 0, 0, 865, 863, 1, 0, 0, 0, 865, 866, 1, 0, 0, 0, 866, 867, 1, 0, 0, 0, 867, - 868, 5, 33, 0, 0, 868, 870, 5, 22, 0, 0, 869, 871, 5, 164, 0, 0, 870, 869, 1, 0, 0, 0, 870, 871, 1, 0, 0, 0, 871, - 872, 1, 0, 0, 0, 872, 873, 5, 151, 0, 0, 873, 67, 1, 0, 0, 0, 874, 875, 5, 117, 0, 0, 875, 876, 3, 72, 36, 0, 876, - 880, 5, 140, 0, 0, 877, 879, 3, 440, 220, 0, 878, 877, 1, 0, 0, 0, 879, 882, 1, 0, 0, 0, 880, 878, 1, 0, 0, 0, 880, - 881, 1, 0, 0, 0, 881, 69, 1, 0, 0, 0, 882, 880, 1, 0, 0, 0, 883, 888, 3, 184, 92, 0, 884, 888, 3, 140, 70, 0, 885, - 888, 5, 164, 0, 0, 886, 888, 5, 68, 0, 0, 887, 883, 1, 0, 0, 0, 887, 884, 1, 0, 0, 0, 887, 885, 1, 0, 0, 0, 887, - 886, 1, 0, 0, 0, 888, 71, 1, 0, 0, 0, 889, 894, 3, 70, 35, 0, 890, 891, 5, 153, 0, 0, 891, 893, 3, 70, 35, 0, 892, - 890, 1, 0, 0, 0, 893, 896, 1, 0, 0, 0, 894, 892, 1, 0, 0, 0, 894, 895, 1, 0, 0, 0, 895, 73, 1, 0, 0, 0, 896, 894, 1, - 0, 0, 0, 897, 898, 5, 37, 0, 0, 898, 902, 3, 80, 40, 0, 899, 900, 3, 52, 26, 0, 900, 901, 5, 151, 0, 0, 901, 903, 1, - 0, 0, 0, 902, 899, 1, 0, 0, 0, 902, 903, 1, 0, 0, 0, 903, 905, 1, 0, 0, 0, 904, 906, 3, 54, 27, 0, 905, 904, 1, 0, - 0, 0, 905, 906, 1, 0, 0, 0, 906, 907, 1, 0, 0, 0, 907, 908, 5, 33, 0, 0, 908, 909, 5, 37, 0, 0, 909, 910, 5, 151, 0, - 0, 910, 75, 1, 0, 0, 0, 911, 912, 5, 23, 0, 0, 912, 914, 5, 164, 0, 0, 913, 915, 5, 50, 0, 0, 914, 913, 1, 0, 0, 0, - 914, 915, 1, 0, 0, 0, 915, 917, 1, 0, 0, 0, 916, 918, 3, 232, 116, 0, 917, 916, 1, 0, 0, 0, 917, 918, 1, 0, 0, 0, - 918, 920, 1, 0, 0, 0, 919, 921, 3, 350, 175, 0, 920, 919, 1, 0, 0, 0, 920, 921, 1, 0, 0, 0, 921, 922, 1, 0, 0, 0, - 922, 924, 5, 33, 0, 0, 923, 925, 5, 23, 0, 0, 924, 923, 1, 0, 0, 0, 924, 925, 1, 0, 0, 0, 925, 927, 1, 0, 0, 0, 926, - 928, 5, 164, 0, 0, 927, 926, 1, 0, 0, 0, 927, 928, 1, 0, 0, 0, 928, 929, 1, 0, 0, 0, 929, 930, 5, 151, 0, 0, 930, - 77, 1, 0, 0, 0, 931, 932, 5, 164, 0, 0, 932, 933, 5, 150, 0, 0, 933, 935, 3, 256, 128, 0, 934, 936, 3, 234, 117, 0, - 935, 934, 1, 0, 0, 0, 935, 936, 1, 0, 0, 0, 936, 938, 1, 0, 0, 0, 937, 939, 3, 352, 176, 0, 938, 937, 1, 0, 0, 0, - 938, 939, 1, 0, 0, 0, 939, 940, 1, 0, 0, 0, 940, 941, 5, 151, 0, 0, 941, 79, 1, 0, 0, 0, 942, 943, 3, 258, 129, 0, - 943, 944, 5, 150, 0, 0, 944, 945, 3, 314, 157, 0, 945, 81, 1, 0, 0, 0, 946, 950, 3, 118, 59, 0, 947, 950, 3, 496, - 248, 0, 948, 950, 3, 402, 201, 0, 949, 946, 1, 0, 0, 0, 949, 947, 1, 0, 0, 0, 949, 948, 1, 0, 0, 0, 950, 83, 1, 0, - 0, 0, 951, 952, 5, 37, 0, 0, 952, 953, 3, 80, 40, 0, 953, 954, 3, 52, 26, 0, 954, 955, 5, 151, 0, 0, 955, 956, 5, - 33, 0, 0, 956, 957, 5, 37, 0, 0, 957, 958, 5, 151, 0, 0, 958, 85, 1, 0, 0, 0, 959, 960, 5, 164, 0, 0, 960, 962, 5, - 150, 0, 0, 961, 959, 1, 0, 0, 0, 961, 962, 1, 0, 0, 0, 962, 964, 1, 0, 0, 0, 963, 965, 5, 73, 0, 0, 964, 963, 1, 0, - 0, 0, 964, 965, 1, 0, 0, 0, 965, 966, 1, 0, 0, 0, 966, 967, 3, 38, 19, 0, 967, 968, 5, 151, 0, 0, 968, 87, 1, 0, 0, - 0, 969, 970, 3, 484, 242, 0, 970, 972, 5, 141, 0, 0, 971, 973, 5, 43, 0, 0, 972, 971, 1, 0, 0, 0, 972, 973, 1, 0, 0, - 0, 973, 975, 1, 0, 0, 0, 974, 976, 3, 128, 64, 0, 975, 974, 1, 0, 0, 0, 975, 976, 1, 0, 0, 0, 976, 977, 1, 0, 0, 0, - 977, 978, 3, 106, 53, 0, 978, 979, 5, 151, 0, 0, 979, 89, 1, 0, 0, 0, 980, 981, 5, 164, 0, 0, 981, 983, 5, 150, 0, - 0, 982, 980, 1, 0, 0, 0, 982, 983, 1, 0, 0, 0, 983, 985, 1, 0, 0, 0, 984, 986, 5, 73, 0, 0, 985, 984, 1, 0, 0, 0, - 985, 986, 1, 0, 0, 0, 986, 987, 1, 0, 0, 0, 987, 988, 3, 360, 180, 0, 988, 989, 5, 151, 0, 0, 989, 91, 1, 0, 0, 0, - 990, 991, 5, 116, 0, 0, 991, 992, 3, 184, 92, 0, 992, 993, 5, 90, 0, 0, 993, 994, 3, 484, 242, 0, 994, 996, 5, 141, - 0, 0, 995, 997, 5, 43, 0, 0, 996, 995, 1, 0, 0, 0, 996, 997, 1, 0, 0, 0, 997, 999, 1, 0, 0, 0, 998, 1000, 3, 128, - 64, 0, 999, 998, 1, 0, 0, 0, 999, 1000, 1, 0, 0, 0, 1000, 1001, 1, 0, 0, 0, 1001, 1002, 3, 106, 53, 0, 1002, 1003, - 5, 151, 0, 0, 1003, 93, 1, 0, 0, 0, 1004, 1005, 5, 164, 0, 0, 1005, 1007, 5, 150, 0, 0, 1006, 1004, 1, 0, 0, 0, - 1006, 1007, 1, 0, 0, 0, 1007, 1009, 1, 0, 0, 0, 1008, 1010, 5, 73, 0, 0, 1009, 1008, 1, 0, 0, 0, 1009, 1010, 1, 0, - 0, 0, 1010, 1014, 1, 0, 0, 0, 1011, 1015, 3, 96, 48, 0, 1012, 1015, 3, 88, 44, 0, 1013, 1015, 3, 92, 46, 0, 1014, - 1011, 1, 0, 0, 0, 1014, 1012, 1, 0, 0, 0, 1014, 1013, 1, 0, 0, 0, 1015, 95, 1, 0, 0, 0, 1016, 1017, 3, 484, 242, 0, - 1017, 1019, 5, 141, 0, 0, 1018, 1020, 5, 43, 0, 0, 1019, 1018, 1, 0, 0, 0, 1019, 1020, 1, 0, 0, 0, 1020, 1022, 1, 0, - 0, 0, 1021, 1023, 3, 128, 64, 0, 1022, 1021, 1, 0, 0, 0, 1022, 1023, 1, 0, 0, 0, 1023, 1024, 1, 0, 0, 0, 1024, 1025, - 3, 510, 255, 0, 1025, 1026, 5, 151, 0, 0, 1026, 97, 1, 0, 0, 0, 1027, 1028, 5, 107, 0, 0, 1028, 1029, 3, 184, 92, 0, - 1029, 99, 1, 0, 0, 0, 1030, 1036, 3, 184, 92, 0, 1031, 1032, 5, 117, 0, 0, 1032, 1033, 3, 184, 92, 0, 1033, 1034, 5, - 31, 0, 0, 1034, 1035, 3, 184, 92, 0, 1035, 1037, 1, 0, 0, 0, 1036, 1031, 1, 0, 0, 0, 1036, 1037, 1, 0, 0, 0, 1037, - 101, 1, 0, 0, 0, 1038, 1044, 3, 186, 93, 0, 1039, 1040, 5, 117, 0, 0, 1040, 1041, 3, 184, 92, 0, 1041, 1042, 5, 31, - 0, 0, 1042, 1043, 3, 186, 93, 0, 1043, 1045, 1, 0, 0, 0, 1044, 1039, 1, 0, 0, 0, 1044, 1045, 1, 0, 0, 0, 1045, 1048, - 1, 0, 0, 0, 1046, 1047, 5, 117, 0, 0, 1047, 1049, 3, 184, 92, 0, 1048, 1046, 1, 0, 0, 0, 1048, 1049, 1, 0, 0, 0, - 1049, 103, 1, 0, 0, 0, 1050, 1051, 3, 484, 242, 0, 1051, 1053, 5, 141, 0, 0, 1052, 1054, 3, 128, 64, 0, 1053, 1052, - 1, 0, 0, 0, 1053, 1054, 1, 0, 0, 0, 1054, 1055, 1, 0, 0, 0, 1055, 1056, 3, 106, 53, 0, 1056, 1057, 5, 151, 0, 0, - 1057, 105, 1, 0, 0, 0, 1058, 1059, 3, 510, 255, 0, 1059, 1060, 5, 117, 0, 0, 1060, 1068, 3, 184, 92, 0, 1061, 1062, - 5, 31, 0, 0, 1062, 1063, 3, 510, 255, 0, 1063, 1064, 5, 117, 0, 0, 1064, 1065, 3, 184, 92, 0, 1065, 1067, 1, 0, 0, - 0, 1066, 1061, 1, 0, 0, 0, 1067, 1070, 1, 0, 0, 0, 1068, 1066, 1, 0, 0, 0, 1068, 1069, 1, 0, 0, 0, 1069, 1073, 1, 0, - 0, 0, 1070, 1068, 1, 0, 0, 0, 1071, 1072, 5, 31, 0, 0, 1072, 1074, 3, 184, 92, 0, 1073, 1071, 1, 0, 0, 0, 1073, - 1074, 1, 0, 0, 0, 1074, 107, 1, 0, 0, 0, 1075, 1076, 5, 24, 0, 0, 1076, 1077, 5, 164, 0, 0, 1077, 1078, 5, 64, 0, 0, - 1078, 1079, 3, 314, 157, 0, 1079, 1083, 5, 50, 0, 0, 1080, 1082, 3, 110, 55, 0, 1081, 1080, 1, 0, 0, 0, 1082, 1085, - 1, 0, 0, 0, 1083, 1081, 1, 0, 0, 0, 1083, 1084, 1, 0, 0, 0, 1084, 1086, 1, 0, 0, 0, 1085, 1083, 1, 0, 0, 0, 1086, - 1087, 3, 54, 27, 0, 1087, 1089, 5, 33, 0, 0, 1088, 1090, 5, 24, 0, 0, 1089, 1088, 1, 0, 0, 0, 1089, 1090, 1, 0, 0, - 0, 1090, 1092, 1, 0, 0, 0, 1091, 1093, 5, 164, 0, 0, 1092, 1091, 1, 0, 0, 0, 1092, 1093, 1, 0, 0, 0, 1093, 1094, 1, - 0, 0, 0, 1094, 1095, 5, 151, 0, 0, 1095, 109, 1, 0, 0, 0, 1096, 1099, 3, 500, 250, 0, 1097, 1099, 3, 50, 25, 0, - 1098, 1096, 1, 0, 0, 0, 1098, 1097, 1, 0, 0, 0, 1099, 111, 1, 0, 0, 0, 1100, 1103, 3, 54, 27, 0, 1101, 1103, 3, 74, - 37, 0, 1102, 1100, 1, 0, 0, 0, 1102, 1101, 1, 0, 0, 0, 1103, 113, 1, 0, 0, 0, 1104, 1107, 3, 450, 225, 0, 1105, - 1107, 3, 84, 42, 0, 1106, 1104, 1, 0, 0, 0, 1106, 1105, 1, 0, 0, 0, 1107, 115, 1, 0, 0, 0, 1108, 1109, 5, 25, 0, 0, - 1109, 1110, 3, 238, 119, 0, 1110, 1111, 5, 150, 0, 0, 1111, 1114, 3, 480, 240, 0, 1112, 1113, 5, 142, 0, 0, 1113, - 1115, 3, 100, 50, 0, 1114, 1112, 1, 0, 0, 0, 1114, 1115, 1, 0, 0, 0, 1115, 1116, 1, 0, 0, 0, 1116, 1117, 5, 151, 0, - 0, 1117, 117, 1, 0, 0, 0, 1118, 1119, 5, 13, 0, 0, 1119, 1120, 3, 252, 126, 0, 1120, 1121, 5, 64, 0, 0, 1121, 1122, - 3, 480, 240, 0, 1122, 119, 1, 0, 0, 0, 1123, 1128, 3, 456, 228, 0, 1124, 1128, 3, 390, 195, 0, 1125, 1128, 3, 24, - 12, 0, 1126, 1128, 3, 392, 196, 0, 1127, 1123, 1, 0, 0, 0, 1127, 1124, 1, 0, 0, 0, 1127, 1125, 1, 0, 0, 0, 1127, - 1126, 1, 0, 0, 0, 1128, 121, 1, 0, 0, 0, 1129, 1130, 5, 26, 0, 0, 1130, 1131, 5, 164, 0, 0, 1131, 1135, 5, 50, 0, 0, - 1132, 1134, 3, 124, 62, 0, 1133, 1132, 1, 0, 0, 0, 1134, 1137, 1, 0, 0, 0, 1135, 1133, 1, 0, 0, 0, 1135, 1136, 1, 0, - 0, 0, 1136, 1138, 1, 0, 0, 0, 1137, 1135, 1, 0, 0, 0, 1138, 1140, 5, 33, 0, 0, 1139, 1141, 5, 26, 0, 0, 1140, 1139, - 1, 0, 0, 0, 1140, 1141, 1, 0, 0, 0, 1141, 1142, 1, 0, 0, 0, 1142, 1143, 5, 164, 0, 0, 1143, 1144, 5, 151, 0, 0, - 1144, 123, 1, 0, 0, 0, 1145, 1149, 3, 298, 149, 0, 1146, 1149, 3, 500, 250, 0, 1147, 1149, 3, 126, 63, 0, 1148, - 1145, 1, 0, 0, 0, 1148, 1146, 1, 0, 0, 0, 1148, 1147, 1, 0, 0, 0, 1149, 125, 1, 0, 0, 0, 1150, 1151, 5, 26, 0, 0, - 1151, 1156, 3, 424, 212, 0, 1152, 1153, 5, 150, 0, 0, 1153, 1155, 3, 424, 212, 0, 1154, 1152, 1, 0, 0, 0, 1155, - 1158, 1, 0, 0, 0, 1156, 1154, 1, 0, 0, 0, 1156, 1157, 1, 0, 0, 0, 1157, 1159, 1, 0, 0, 0, 1158, 1156, 1, 0, 0, 0, - 1159, 1160, 5, 151, 0, 0, 1160, 127, 1, 0, 0, 0, 1161, 1168, 5, 103, 0, 0, 1162, 1163, 5, 82, 0, 0, 1163, 1165, 3, - 184, 92, 0, 1164, 1162, 1, 0, 0, 0, 1164, 1165, 1, 0, 0, 0, 1165, 1166, 1, 0, 0, 0, 1166, 1168, 5, 48, 0, 0, 1167, - 1161, 1, 0, 0, 0, 1167, 1164, 1, 0, 0, 0, 1168, 129, 1, 0, 0, 0, 1169, 1171, 3, 132, 66, 0, 1170, 1169, 1, 0, 0, 0, - 1171, 1172, 1, 0, 0, 0, 1172, 1170, 1, 0, 0, 0, 1172, 1173, 1, 0, 0, 0, 1173, 1174, 1, 0, 0, 0, 1174, 1175, 5, 0, 0, - 1, 1175, 131, 1, 0, 0, 0, 1176, 1178, 3, 124, 62, 0, 1177, 1176, 1, 0, 0, 0, 1178, 1181, 1, 0, 0, 0, 1179, 1177, 1, - 0, 0, 0, 1179, 1180, 1, 0, 0, 0, 1180, 1182, 1, 0, 0, 0, 1181, 1179, 1, 0, 0, 0, 1182, 1183, 3, 300, 150, 0, 1183, - 133, 1, 0, 0, 0, 1184, 1185, 7, 2, 0, 0, 1185, 135, 1, 0, 0, 0, 1186, 1187, 7, 3, 0, 0, 1187, 137, 1, 0, 0, 0, 1188, - 1189, 5, 29, 0, 0, 1189, 1190, 3, 236, 118, 0, 1190, 1191, 5, 8, 0, 0, 1191, 1192, 3, 184, 92, 0, 1192, 1193, 5, - 151, 0, 0, 1193, 139, 1, 0, 0, 0, 1194, 1197, 3, 480, 240, 0, 1195, 1197, 3, 388, 194, 0, 1196, 1194, 1, 0, 0, 0, - 1196, 1195, 1, 0, 0, 0, 1197, 141, 1, 0, 0, 0, 1198, 1199, 5, 144, 0, 0, 1199, 1200, 5, 143, 0, 0, 1200, 1201, 5, - 145, 0, 0, 1201, 143, 1, 0, 0, 0, 1202, 1203, 5, 110, 0, 0, 1203, 1204, 5, 144, 0, 0, 1204, 1205, 3, 314, 157, 0, - 1205, 1206, 5, 145, 0, 0, 1206, 145, 1, 0, 0, 0, 1207, 1208, 3, 72, 36, 0, 1208, 1209, 5, 140, 0, 0, 1209, 1211, 1, - 0, 0, 0, 1210, 1207, 1, 0, 0, 0, 1210, 1211, 1, 0, 0, 0, 1211, 1212, 1, 0, 0, 0, 1212, 1213, 3, 184, 92, 0, 1213, - 147, 1, 0, 0, 0, 1214, 1217, 3, 24, 12, 0, 1215, 1217, 3, 392, 196, 0, 1216, 1214, 1, 0, 0, 0, 1216, 1215, 1, 0, 0, - 0, 1217, 149, 1, 0, 0, 0, 1218, 1219, 3, 238, 119, 0, 1219, 1220, 5, 150, 0, 0, 1220, 1221, 3, 480, 240, 0, 1221, - 1222, 5, 151, 0, 0, 1222, 151, 1, 0, 0, 0, 1223, 1226, 3, 306, 153, 0, 1224, 1226, 3, 154, 77, 0, 1225, 1223, 1, 0, - 0, 0, 1225, 1224, 1, 0, 0, 0, 1226, 153, 1, 0, 0, 0, 1227, 1230, 3, 144, 72, 0, 1228, 1230, 3, 156, 78, 0, 1229, - 1227, 1, 0, 0, 0, 1229, 1228, 1, 0, 0, 0, 1230, 155, 1, 0, 0, 0, 1231, 1232, 5, 110, 0, 0, 1232, 1233, 3, 314, 157, - 0, 1233, 157, 1, 0, 0, 0, 1234, 1237, 3, 28, 14, 0, 1235, 1237, 3, 400, 200, 0, 1236, 1234, 1, 0, 0, 0, 1236, 1235, - 1, 0, 0, 0, 1237, 159, 1, 0, 0, 0, 1238, 1239, 5, 34, 0, 0, 1239, 1243, 3, 314, 157, 0, 1240, 1241, 5, 144, 0, 0, - 1241, 1242, 5, 164, 0, 0, 1242, 1244, 5, 145, 0, 0, 1243, 1240, 1, 0, 0, 0, 1243, 1244, 1, 0, 0, 0, 1244, 1249, 1, - 0, 0, 0, 1245, 1246, 5, 24, 0, 0, 1246, 1249, 3, 314, 157, 0, 1247, 1249, 5, 66, 0, 0, 1248, 1238, 1, 0, 0, 0, 1248, - 1245, 1, 0, 0, 0, 1248, 1247, 1, 0, 0, 0, 1249, 161, 1, 0, 0, 0, 1250, 1251, 7, 4, 0, 0, 1251, 163, 1, 0, 0, 0, - 1252, 1253, 5, 34, 0, 0, 1253, 1254, 5, 164, 0, 0, 1254, 1256, 5, 50, 0, 0, 1255, 1257, 3, 232, 116, 0, 1256, 1255, - 1, 0, 0, 0, 1256, 1257, 1, 0, 0, 0, 1257, 1259, 1, 0, 0, 0, 1258, 1260, 3, 350, 175, 0, 1259, 1258, 1, 0, 0, 0, - 1259, 1260, 1, 0, 0, 0, 1260, 1264, 1, 0, 0, 0, 1261, 1263, 3, 166, 83, 0, 1262, 1261, 1, 0, 0, 0, 1263, 1266, 1, 0, - 0, 0, 1264, 1262, 1, 0, 0, 0, 1264, 1265, 1, 0, 0, 0, 1265, 1274, 1, 0, 0, 0, 1266, 1264, 1, 0, 0, 0, 1267, 1271, 5, - 17, 0, 0, 1268, 1270, 3, 174, 87, 0, 1269, 1268, 1, 0, 0, 0, 1270, 1273, 1, 0, 0, 0, 1271, 1269, 1, 0, 0, 0, 1271, - 1272, 1, 0, 0, 0, 1272, 1275, 1, 0, 0, 0, 1273, 1271, 1, 0, 0, 0, 1274, 1267, 1, 0, 0, 0, 1274, 1275, 1, 0, 0, 0, - 1275, 1276, 1, 0, 0, 0, 1276, 1278, 5, 33, 0, 0, 1277, 1279, 5, 34, 0, 0, 1278, 1277, 1, 0, 0, 0, 1278, 1279, 1, 0, - 0, 0, 1279, 1281, 1, 0, 0, 0, 1280, 1282, 5, 164, 0, 0, 1281, 1280, 1, 0, 0, 0, 1281, 1282, 1, 0, 0, 0, 1282, 1283, - 1, 0, 0, 0, 1283, 1284, 5, 151, 0, 0, 1284, 165, 1, 0, 0, 0, 1285, 1304, 3, 468, 234, 0, 1286, 1304, 3, 466, 233, 0, - 1287, 1304, 3, 472, 236, 0, 1288, 1304, 3, 326, 163, 0, 1289, 1304, 3, 322, 161, 0, 1290, 1304, 3, 330, 165, 0, - 1291, 1304, 3, 490, 245, 0, 1292, 1304, 3, 478, 239, 0, 1293, 1304, 3, 310, 155, 0, 1294, 1304, 3, 116, 58, 0, 1295, - 1304, 3, 444, 222, 0, 1296, 1304, 3, 506, 253, 0, 1297, 1304, 3, 198, 99, 0, 1298, 1304, 3, 12, 6, 0, 1299, 1304, 3, - 46, 23, 0, 1300, 1304, 3, 50, 25, 0, 1301, 1304, 3, 138, 69, 0, 1302, 1304, 3, 500, 250, 0, 1303, 1285, 1, 0, 0, 0, - 1303, 1286, 1, 0, 0, 0, 1303, 1287, 1, 0, 0, 0, 1303, 1288, 1, 0, 0, 0, 1303, 1289, 1, 0, 0, 0, 1303, 1290, 1, 0, 0, - 0, 1303, 1291, 1, 0, 0, 0, 1303, 1292, 1, 0, 0, 0, 1303, 1293, 1, 0, 0, 0, 1303, 1294, 1, 0, 0, 0, 1303, 1295, 1, 0, - 0, 0, 1303, 1296, 1, 0, 0, 0, 1303, 1297, 1, 0, 0, 0, 1303, 1298, 1, 0, 0, 0, 1303, 1299, 1, 0, 0, 0, 1303, 1300, 1, - 0, 0, 0, 1303, 1301, 1, 0, 0, 0, 1303, 1302, 1, 0, 0, 0, 1304, 167, 1, 0, 0, 0, 1305, 1307, 3, 176, 88, 0, 1306, - 1308, 3, 448, 224, 0, 1307, 1306, 1, 0, 0, 0, 1307, 1308, 1, 0, 0, 0, 1308, 169, 1, 0, 0, 0, 1309, 1314, 3, 168, 84, - 0, 1310, 1311, 5, 152, 0, 0, 1311, 1313, 3, 168, 84, 0, 1312, 1310, 1, 0, 0, 0, 1313, 1316, 1, 0, 0, 0, 1314, 1312, - 1, 0, 0, 0, 1314, 1315, 1, 0, 0, 0, 1315, 1320, 1, 0, 0, 0, 1316, 1314, 1, 0, 0, 0, 1317, 1320, 5, 68, 0, 0, 1318, - 1320, 5, 10, 0, 0, 1319, 1309, 1, 0, 0, 0, 1319, 1317, 1, 0, 0, 0, 1319, 1318, 1, 0, 0, 0, 1320, 171, 1, 0, 0, 0, - 1321, 1322, 3, 170, 85, 0, 1322, 1323, 5, 150, 0, 0, 1323, 1324, 3, 162, 81, 0, 1324, 173, 1, 0, 0, 0, 1325, 1330, - 3, 86, 43, 0, 1326, 1330, 3, 90, 45, 0, 1327, 1330, 3, 370, 185, 0, 1328, 1330, 3, 372, 186, 0, 1329, 1325, 1, 0, 0, - 0, 1329, 1326, 1, 0, 0, 0, 1329, 1327, 1, 0, 0, 0, 1329, 1328, 1, 0, 0, 0, 1330, 175, 1, 0, 0, 0, 1331, 1332, 7, 0, - 0, 0, 1332, 177, 1, 0, 0, 0, 1333, 1334, 7, 5, 0, 0, 1334, 179, 1, 0, 0, 0, 1335, 1336, 5, 144, 0, 0, 1336, 1341, 3, - 178, 89, 0, 1337, 1338, 5, 152, 0, 0, 1338, 1340, 3, 178, 89, 0, 1339, 1337, 1, 0, 0, 0, 1340, 1343, 1, 0, 0, 0, - 1341, 1339, 1, 0, 0, 0, 1341, 1342, 1, 0, 0, 0, 1342, 1344, 1, 0, 0, 0, 1343, 1341, 1, 0, 0, 0, 1344, 1345, 5, 145, - 0, 0, 1345, 181, 1, 0, 0, 0, 1346, 1347, 5, 164, 0, 0, 1347, 1349, 5, 150, 0, 0, 1348, 1346, 1, 0, 0, 0, 1348, 1349, - 1, 0, 0, 0, 1349, 1350, 1, 0, 0, 0, 1350, 1352, 5, 35, 0, 0, 1351, 1353, 5, 164, 0, 0, 1352, 1351, 1, 0, 0, 0, 1352, - 1353, 1, 0, 0, 0, 1353, 1356, 1, 0, 0, 0, 1354, 1355, 5, 117, 0, 0, 1355, 1357, 3, 184, 92, 0, 1356, 1354, 1, 0, 0, - 0, 1356, 1357, 1, 0, 0, 0, 1357, 1358, 1, 0, 0, 0, 1358, 1359, 5, 151, 0, 0, 1359, 183, 1, 0, 0, 0, 1360, 1361, 6, - 92, -1, 0, 1361, 1367, 3, 354, 177, 0, 1362, 1363, 5, 139, 0, 0, 1363, 1367, 3, 184, 92, 8, 1364, 1365, 7, 6, 0, 0, - 1365, 1367, 3, 184, 92, 7, 1366, 1360, 1, 0, 0, 0, 1366, 1362, 1, 0, 0, 0, 1366, 1364, 1, 0, 0, 0, 1367, 1388, 1, 0, - 0, 0, 1368, 1369, 10, 6, 0, 0, 1369, 1370, 5, 137, 0, 0, 1370, 1387, 3, 184, 92, 6, 1371, 1372, 10, 5, 0, 0, 1372, - 1373, 7, 7, 0, 0, 1373, 1387, 3, 184, 92, 6, 1374, 1375, 10, 4, 0, 0, 1375, 1376, 7, 8, 0, 0, 1376, 1387, 3, 184, - 92, 5, 1377, 1378, 10, 3, 0, 0, 1378, 1379, 7, 9, 0, 0, 1379, 1387, 3, 184, 92, 4, 1380, 1381, 10, 2, 0, 0, 1381, - 1382, 7, 10, 0, 0, 1382, 1387, 3, 184, 92, 3, 1383, 1384, 10, 1, 0, 0, 1384, 1385, 7, 11, 0, 0, 1385, 1387, 3, 184, - 92, 2, 1386, 1368, 1, 0, 0, 0, 1386, 1371, 1, 0, 0, 0, 1386, 1374, 1, 0, 0, 0, 1386, 1377, 1, 0, 0, 0, 1386, 1380, - 1, 0, 0, 0, 1386, 1383, 1, 0, 0, 0, 1387, 1390, 1, 0, 0, 0, 1388, 1386, 1, 0, 0, 0, 1388, 1389, 1, 0, 0, 0, 1389, - 185, 1, 0, 0, 0, 1390, 1388, 1, 0, 0, 0, 1391, 1394, 3, 184, 92, 0, 1392, 1394, 5, 105, 0, 0, 1393, 1391, 1, 0, 0, - 0, 1393, 1392, 1, 0, 0, 0, 1394, 187, 1, 0, 0, 0, 1395, 1399, 3, 190, 95, 0, 1396, 1399, 3, 192, 96, 0, 1397, 1399, - 3, 194, 97, 0, 1398, 1395, 1, 0, 0, 0, 1398, 1396, 1, 0, 0, 0, 1398, 1397, 1, 0, 0, 0, 1399, 189, 1, 0, 0, 0, 1400, - 1401, 5, 148, 0, 0, 1401, 1402, 5, 25, 0, 0, 1402, 1403, 3, 196, 98, 0, 1403, 1404, 5, 150, 0, 0, 1404, 1405, 3, - 292, 146, 0, 1405, 1406, 5, 149, 0, 0, 1406, 191, 1, 0, 0, 0, 1407, 1408, 5, 148, 0, 0, 1408, 1409, 5, 93, 0, 0, - 1409, 1410, 3, 196, 98, 0, 1410, 1411, 5, 150, 0, 0, 1411, 1412, 3, 292, 146, 0, 1412, 1413, 5, 149, 0, 0, 1413, - 193, 1, 0, 0, 0, 1414, 1415, 5, 148, 0, 0, 1415, 1416, 5, 109, 0, 0, 1416, 1417, 3, 196, 98, 0, 1417, 1418, 5, 150, - 0, 0, 1418, 1419, 3, 292, 146, 0, 1419, 1420, 5, 149, 0, 0, 1420, 195, 1, 0, 0, 0, 1421, 1425, 3, 332, 166, 0, 1422, - 1425, 3, 0, 0, 0, 1423, 1425, 3, 406, 203, 0, 1424, 1421, 1, 0, 0, 0, 1424, 1422, 1, 0, 0, 0, 1424, 1423, 1, 0, 0, - 0, 1425, 197, 1, 0, 0, 0, 1426, 1427, 5, 36, 0, 0, 1427, 1428, 3, 238, 119, 0, 1428, 1429, 5, 150, 0, 0, 1429, 1431, - 3, 480, 240, 0, 1430, 1432, 3, 202, 101, 0, 1431, 1430, 1, 0, 0, 0, 1431, 1432, 1, 0, 0, 0, 1432, 1433, 1, 0, 0, 0, - 1433, 1434, 5, 151, 0, 0, 1434, 199, 1, 0, 0, 0, 1435, 1436, 5, 36, 0, 0, 1436, 1437, 5, 64, 0, 0, 1437, 1438, 3, - 250, 125, 0, 1438, 201, 1, 0, 0, 0, 1439, 1440, 5, 66, 0, 0, 1440, 1442, 3, 184, 92, 0, 1441, 1439, 1, 0, 0, 0, - 1441, 1442, 1, 0, 0, 0, 1442, 1443, 1, 0, 0, 0, 1443, 1444, 5, 50, 0, 0, 1444, 1445, 3, 184, 92, 0, 1445, 203, 1, 0, - 0, 0, 1446, 1447, 5, 36, 0, 0, 1447, 1448, 5, 64, 0, 0, 1448, 1449, 3, 494, 247, 0, 1449, 205, 1, 0, 0, 0, 1450, - 1451, 5, 79, 0, 0, 1451, 1452, 5, 143, 0, 0, 1452, 1453, 5, 154, 0, 0, 1453, 1454, 5, 143, 0, 0, 1454, 207, 1, 0, 0, - 0, 1455, 1456, 3, 390, 195, 0, 1456, 209, 1, 0, 0, 0, 1457, 1458, 5, 164, 0, 0, 1458, 1459, 5, 150, 0, 0, 1459, - 1460, 5, 37, 0, 0, 1460, 1461, 3, 336, 168, 0, 1461, 1462, 5, 41, 0, 0, 1462, 1463, 3, 230, 115, 0, 1463, 1464, 5, - 33, 0, 0, 1464, 1466, 5, 41, 0, 0, 1465, 1467, 5, 164, 0, 0, 1466, 1465, 1, 0, 0, 0, 1466, 1467, 1, 0, 0, 0, 1467, - 1468, 1, 0, 0, 0, 1468, 1469, 5, 151, 0, 0, 1469, 211, 1, 0, 0, 0, 1470, 1471, 7, 12, 0, 0, 1471, 213, 1, 0, 0, 0, - 1472, 1474, 3, 314, 157, 0, 1473, 1475, 3, 448, 224, 0, 1474, 1473, 1, 0, 0, 0, 1474, 1475, 1, 0, 0, 0, 1475, 215, - 1, 0, 0, 0, 1476, 1477, 3, 274, 137, 0, 1477, 217, 1, 0, 0, 0, 1478, 1488, 3, 214, 107, 0, 1479, 1482, 3, 314, 157, - 0, 1480, 1482, 3, 494, 247, 0, 1481, 1479, 1, 0, 0, 0, 1481, 1480, 1, 0, 0, 0, 1482, 1483, 1, 0, 0, 0, 1483, 1484, - 5, 144, 0, 0, 1484, 1485, 3, 214, 107, 0, 1485, 1486, 5, 145, 0, 0, 1486, 1488, 1, 0, 0, 0, 1487, 1478, 1, 0, 0, 0, - 1487, 1481, 1, 0, 0, 0, 1488, 219, 1, 0, 0, 0, 1489, 1490, 5, 104, 0, 0, 1490, 1491, 5, 164, 0, 0, 1491, 1492, 5, - 50, 0, 0, 1492, 1493, 3, 492, 246, 0, 1493, 1494, 5, 151, 0, 0, 1494, 221, 1, 0, 0, 0, 1495, 1496, 3, 314, 157, 0, - 1496, 1497, 3, 234, 117, 0, 1497, 1498, 3, 334, 167, 0, 1498, 223, 1, 0, 0, 0, 1499, 1501, 7, 13, 0, 0, 1500, 1499, - 1, 0, 0, 0, 1500, 1501, 1, 0, 0, 0, 1501, 1502, 1, 0, 0, 0, 1502, 1503, 5, 39, 0, 0, 1503, 1511, 3, 134, 67, 0, - 1504, 1506, 5, 71, 0, 0, 1505, 1504, 1, 0, 0, 0, 1505, 1506, 1, 0, 0, 0, 1506, 1507, 1, 0, 0, 0, 1507, 1508, 5, 144, - 0, 0, 1508, 1509, 3, 216, 108, 0, 1509, 1510, 5, 145, 0, 0, 1510, 1512, 1, 0, 0, 0, 1511, 1505, 1, 0, 0, 0, 1511, - 1512, 1, 0, 0, 0, 1512, 1513, 1, 0, 0, 0, 1513, 1515, 5, 86, 0, 0, 1514, 1516, 5, 164, 0, 0, 1515, 1514, 1, 0, 0, 0, - 1515, 1516, 1, 0, 0, 0, 1516, 1517, 1, 0, 0, 0, 1517, 1518, 3, 494, 247, 0, 1518, 225, 1, 0, 0, 0, 1519, 1523, 3, - 140, 70, 0, 1520, 1523, 3, 184, 92, 0, 1521, 1523, 5, 164, 0, 0, 1522, 1519, 1, 0, 0, 0, 1522, 1520, 1, 0, 0, 0, - 1522, 1521, 1, 0, 0, 0, 1523, 227, 1, 0, 0, 0, 1524, 1528, 3, 210, 105, 0, 1525, 1528, 3, 240, 120, 0, 1526, 1528, - 3, 64, 32, 0, 1527, 1524, 1, 0, 0, 0, 1527, 1525, 1, 0, 0, 0, 1527, 1526, 1, 0, 0, 0, 1528, 229, 1, 0, 0, 0, 1529, - 1531, 3, 56, 28, 0, 1530, 1529, 1, 0, 0, 0, 1531, 1534, 1, 0, 0, 0, 1532, 1530, 1, 0, 0, 0, 1532, 1533, 1, 0, 0, 0, - 1533, 1535, 1, 0, 0, 0, 1534, 1532, 1, 0, 0, 0, 1535, 1537, 5, 17, 0, 0, 1536, 1532, 1, 0, 0, 0, 1536, 1537, 1, 0, - 0, 0, 1537, 1541, 1, 0, 0, 0, 1538, 1540, 3, 22, 11, 0, 1539, 1538, 1, 0, 0, 0, 1540, 1543, 1, 0, 0, 0, 1541, 1539, - 1, 0, 0, 0, 1541, 1542, 1, 0, 0, 0, 1542, 1544, 1, 0, 0, 0, 1543, 1541, 1, 0, 0, 0, 1544, 1545, 5, 33, 0, 0, 1545, - 1547, 5, 41, 0, 0, 1546, 1548, 5, 164, 0, 0, 1547, 1546, 1, 0, 0, 0, 1547, 1548, 1, 0, 0, 0, 1548, 1549, 1, 0, 0, 0, - 1549, 1550, 5, 151, 0, 0, 1550, 231, 1, 0, 0, 0, 1551, 1552, 5, 42, 0, 0, 1552, 1553, 5, 144, 0, 0, 1553, 1558, 3, - 268, 134, 0, 1554, 1555, 5, 151, 0, 0, 1555, 1557, 3, 268, 134, 0, 1556, 1554, 1, 0, 0, 0, 1557, 1560, 1, 0, 0, 0, - 1558, 1556, 1, 0, 0, 0, 1558, 1559, 1, 0, 0, 0, 1559, 1561, 1, 0, 0, 0, 1560, 1558, 1, 0, 0, 0, 1561, 1562, 5, 145, - 0, 0, 1562, 1563, 5, 151, 0, 0, 1563, 233, 1, 0, 0, 0, 1564, 1565, 5, 42, 0, 0, 1565, 1566, 5, 56, 0, 0, 1566, 1567, - 5, 144, 0, 0, 1567, 1568, 3, 44, 22, 0, 1568, 1569, 5, 145, 0, 0, 1569, 235, 1, 0, 0, 0, 1570, 1571, 3, 446, 223, 0, - 1571, 1572, 5, 150, 0, 0, 1572, 1573, 3, 494, 247, 0, 1573, 237, 1, 0, 0, 0, 1574, 1579, 5, 164, 0, 0, 1575, 1576, - 5, 152, 0, 0, 1576, 1578, 5, 164, 0, 0, 1577, 1575, 1, 0, 0, 0, 1578, 1581, 1, 0, 0, 0, 1579, 1577, 1, 0, 0, 0, - 1579, 1580, 1, 0, 0, 0, 1580, 239, 1, 0, 0, 0, 1581, 1579, 1, 0, 0, 0, 1582, 1583, 5, 164, 0, 0, 1583, 1584, 5, 150, - 0, 0, 1584, 1587, 5, 45, 0, 0, 1585, 1586, 5, 164, 0, 0, 1586, 1588, 5, 150, 0, 0, 1587, 1585, 1, 0, 0, 0, 1587, - 1588, 1, 0, 0, 0, 1588, 1589, 1, 0, 0, 0, 1589, 1590, 3, 184, 92, 0, 1590, 1591, 5, 41, 0, 0, 1591, 1603, 3, 230, - 115, 0, 1592, 1595, 5, 32, 0, 0, 1593, 1594, 5, 164, 0, 0, 1594, 1596, 5, 150, 0, 0, 1595, 1593, 1, 0, 0, 0, 1595, - 1596, 1, 0, 0, 0, 1596, 1597, 1, 0, 0, 0, 1597, 1598, 3, 184, 92, 0, 1598, 1599, 5, 41, 0, 0, 1599, 1600, 3, 230, - 115, 0, 1600, 1602, 1, 0, 0, 0, 1601, 1592, 1, 0, 0, 0, 1602, 1605, 1, 0, 0, 0, 1603, 1601, 1, 0, 0, 0, 1603, 1604, - 1, 0, 0, 0, 1604, 1613, 1, 0, 0, 0, 1605, 1603, 1, 0, 0, 0, 1606, 1609, 5, 31, 0, 0, 1607, 1608, 5, 164, 0, 0, 1608, - 1610, 5, 150, 0, 0, 1609, 1607, 1, 0, 0, 0, 1609, 1610, 1, 0, 0, 0, 1610, 1611, 1, 0, 0, 0, 1611, 1612, 5, 41, 0, 0, - 1612, 1614, 3, 230, 115, 0, 1613, 1606, 1, 0, 0, 0, 1613, 1614, 1, 0, 0, 0, 1614, 1615, 1, 0, 0, 0, 1615, 1616, 5, - 33, 0, 0, 1616, 1618, 5, 41, 0, 0, 1617, 1619, 5, 164, 0, 0, 1618, 1617, 1, 0, 0, 0, 1618, 1619, 1, 0, 0, 0, 1619, - 1620, 1, 0, 0, 0, 1620, 1621, 5, 151, 0, 0, 1621, 241, 1, 0, 0, 0, 1622, 1623, 5, 164, 0, 0, 1623, 1625, 5, 150, 0, - 0, 1624, 1622, 1, 0, 0, 0, 1624, 1625, 1, 0, 0, 0, 1625, 1626, 1, 0, 0, 0, 1626, 1627, 5, 45, 0, 0, 1627, 1628, 3, - 184, 92, 0, 1628, 1632, 5, 101, 0, 0, 1629, 1631, 3, 440, 220, 0, 1630, 1629, 1, 0, 0, 0, 1631, 1634, 1, 0, 0, 0, - 1632, 1630, 1, 0, 0, 0, 1632, 1633, 1, 0, 0, 0, 1633, 1646, 1, 0, 0, 0, 1634, 1632, 1, 0, 0, 0, 1635, 1636, 5, 32, - 0, 0, 1636, 1637, 3, 184, 92, 0, 1637, 1641, 5, 101, 0, 0, 1638, 1640, 3, 440, 220, 0, 1639, 1638, 1, 0, 0, 0, 1640, - 1643, 1, 0, 0, 0, 1641, 1639, 1, 0, 0, 0, 1641, 1642, 1, 0, 0, 0, 1642, 1645, 1, 0, 0, 0, 1643, 1641, 1, 0, 0, 0, - 1644, 1635, 1, 0, 0, 0, 1645, 1648, 1, 0, 0, 0, 1646, 1644, 1, 0, 0, 0, 1646, 1647, 1, 0, 0, 0, 1647, 1656, 1, 0, 0, - 0, 1648, 1646, 1, 0, 0, 0, 1649, 1653, 5, 31, 0, 0, 1650, 1652, 3, 440, 220, 0, 1651, 1650, 1, 0, 0, 0, 1652, 1655, - 1, 0, 0, 0, 1653, 1651, 1, 0, 0, 0, 1653, 1654, 1, 0, 0, 0, 1654, 1657, 1, 0, 0, 0, 1655, 1653, 1, 0, 0, 0, 1656, - 1649, 1, 0, 0, 0, 1656, 1657, 1, 0, 0, 0, 1657, 1658, 1, 0, 0, 0, 1658, 1659, 5, 33, 0, 0, 1659, 1661, 5, 45, 0, 0, - 1660, 1662, 5, 164, 0, 0, 1661, 1660, 1, 0, 0, 0, 1661, 1662, 1, 0, 0, 0, 1662, 1663, 1, 0, 0, 0, 1663, 1664, 5, - 151, 0, 0, 1664, 243, 1, 0, 0, 0, 1665, 1668, 3, 480, 240, 0, 1666, 1668, 3, 498, 249, 0, 1667, 1665, 1, 0, 0, 0, - 1667, 1666, 1, 0, 0, 0, 1668, 245, 1, 0, 0, 0, 1669, 1670, 5, 104, 0, 0, 1670, 1671, 5, 164, 0, 0, 1671, 1672, 5, - 151, 0, 0, 1672, 247, 1, 0, 0, 0, 1673, 1683, 3, 358, 179, 0, 1674, 1683, 3, 414, 207, 0, 1675, 1683, 3, 142, 71, 0, - 1676, 1683, 3, 260, 130, 0, 1677, 1683, 3, 342, 171, 0, 1678, 1683, 3, 206, 103, 0, 1679, 1683, 3, 30, 15, 0, 1680, - 1683, 3, 2, 1, 0, 1681, 1683, 3, 200, 100, 0, 1682, 1673, 1, 0, 0, 0, 1682, 1674, 1, 0, 0, 0, 1682, 1675, 1, 0, 0, - 0, 1682, 1676, 1, 0, 0, 0, 1682, 1677, 1, 0, 0, 0, 1682, 1678, 1, 0, 0, 0, 1682, 1679, 1, 0, 0, 0, 1682, 1680, 1, 0, - 0, 0, 1682, 1681, 1, 0, 0, 0, 1683, 249, 1, 0, 0, 0, 1684, 1687, 3, 494, 247, 0, 1685, 1687, 3, 498, 249, 0, 1686, - 1684, 1, 0, 0, 0, 1686, 1685, 1, 0, 0, 0, 1687, 251, 1, 0, 0, 0, 1688, 1689, 5, 144, 0, 0, 1689, 1694, 3, 140, 70, - 0, 1690, 1691, 5, 152, 0, 0, 1691, 1693, 3, 140, 70, 0, 1692, 1690, 1, 0, 0, 0, 1693, 1696, 1, 0, 0, 0, 1694, 1692, - 1, 0, 0, 0, 1694, 1695, 1, 0, 0, 0, 1695, 1697, 1, 0, 0, 0, 1696, 1694, 1, 0, 0, 0, 1697, 1698, 5, 145, 0, 0, 1698, - 253, 1, 0, 0, 0, 1699, 1700, 3, 494, 247, 0, 1700, 1701, 5, 79, 0, 0, 1701, 1702, 5, 143, 0, 0, 1702, 255, 1, 0, 0, - 0, 1703, 1705, 5, 23, 0, 0, 1704, 1703, 1, 0, 0, 0, 1704, 1705, 1, 0, 0, 0, 1705, 1706, 1, 0, 0, 0, 1706, 1717, 3, - 314, 157, 0, 1707, 1708, 5, 34, 0, 0, 1708, 1712, 3, 314, 157, 0, 1709, 1710, 5, 144, 0, 0, 1710, 1711, 5, 164, 0, - 0, 1711, 1713, 5, 145, 0, 0, 1712, 1709, 1, 0, 0, 0, 1712, 1713, 1, 0, 0, 0, 1713, 1717, 1, 0, 0, 0, 1714, 1715, 5, - 24, 0, 0, 1715, 1717, 3, 314, 157, 0, 1716, 1704, 1, 0, 0, 0, 1716, 1707, 1, 0, 0, 0, 1716, 1714, 1, 0, 0, 0, 1717, - 257, 1, 0, 0, 0, 1718, 1723, 5, 164, 0, 0, 1719, 1720, 5, 152, 0, 0, 1720, 1722, 5, 164, 0, 0, 1721, 1719, 1, 0, 0, - 0, 1722, 1725, 1, 0, 0, 0, 1723, 1721, 1, 0, 0, 0, 1723, 1724, 1, 0, 0, 0, 1724, 1729, 1, 0, 0, 0, 1725, 1723, 1, 0, - 0, 0, 1726, 1729, 5, 68, 0, 0, 1727, 1729, 5, 10, 0, 0, 1728, 1718, 1, 0, 0, 0, 1728, 1726, 1, 0, 0, 0, 1728, 1727, - 1, 0, 0, 0, 1729, 259, 1, 0, 0, 0, 1730, 1731, 5, 79, 0, 0, 1731, 1732, 5, 143, 0, 0, 1732, 261, 1, 0, 0, 0, 1733, - 1734, 3, 390, 195, 0, 1734, 263, 1, 0, 0, 0, 1735, 1737, 5, 25, 0, 0, 1736, 1735, 1, 0, 0, 0, 1736, 1737, 1, 0, 0, - 0, 1737, 1738, 1, 0, 0, 0, 1738, 1739, 3, 238, 119, 0, 1739, 1741, 5, 150, 0, 0, 1740, 1742, 5, 47, 0, 0, 1741, - 1740, 1, 0, 0, 0, 1741, 1742, 1, 0, 0, 0, 1742, 1743, 1, 0, 0, 0, 1743, 1746, 3, 480, 240, 0, 1744, 1745, 5, 142, 0, - 0, 1745, 1747, 3, 184, 92, 0, 1746, 1744, 1, 0, 0, 0, 1746, 1747, 1, 0, 0, 0, 1747, 265, 1, 0, 0, 0, 1748, 1755, 3, - 264, 132, 0, 1749, 1755, 3, 294, 147, 0, 1750, 1755, 3, 270, 135, 0, 1751, 1755, 3, 290, 145, 0, 1752, 1755, 3, 284, - 142, 0, 1753, 1755, 3, 276, 138, 0, 1754, 1748, 1, 0, 0, 0, 1754, 1749, 1, 0, 0, 0, 1754, 1750, 1, 0, 0, 0, 1754, - 1751, 1, 0, 0, 0, 1754, 1752, 1, 0, 0, 0, 1754, 1753, 1, 0, 0, 0, 1755, 267, 1, 0, 0, 0, 1756, 1757, 3, 266, 133, 0, - 1757, 269, 1, 0, 0, 0, 1758, 1759, 5, 36, 0, 0, 1759, 1760, 3, 238, 119, 0, 1760, 1761, 5, 150, 0, 0, 1761, 1762, 3, - 480, 240, 0, 1762, 271, 1, 0, 0, 0, 1763, 1765, 7, 13, 0, 0, 1764, 1763, 1, 0, 0, 0, 1764, 1765, 1, 0, 0, 0, 1765, - 1766, 1, 0, 0, 0, 1766, 1767, 5, 39, 0, 0, 1767, 1775, 3, 134, 67, 0, 1768, 1770, 5, 71, 0, 0, 1769, 1768, 1, 0, 0, - 0, 1769, 1770, 1, 0, 0, 0, 1770, 1771, 1, 0, 0, 0, 1771, 1772, 5, 144, 0, 0, 1772, 1773, 3, 216, 108, 0, 1773, 1774, - 5, 145, 0, 0, 1774, 1776, 1, 0, 0, 0, 1775, 1769, 1, 0, 0, 0, 1775, 1776, 1, 0, 0, 0, 1776, 1777, 1, 0, 0, 0, 1777, - 1778, 5, 86, 0, 0, 1778, 1779, 3, 494, 247, 0, 1779, 273, 1, 0, 0, 0, 1780, 1785, 3, 268, 134, 0, 1781, 1782, 5, - 151, 0, 0, 1782, 1784, 3, 268, 134, 0, 1783, 1781, 1, 0, 0, 0, 1784, 1787, 1, 0, 0, 0, 1785, 1783, 1, 0, 0, 0, 1785, - 1786, 1, 0, 0, 0, 1786, 1789, 1, 0, 0, 0, 1787, 1785, 1, 0, 0, 0, 1788, 1790, 5, 151, 0, 0, 1789, 1788, 1, 0, 0, 0, - 1789, 1790, 1, 0, 0, 0, 1790, 275, 1, 0, 0, 0, 1791, 1792, 5, 70, 0, 0, 1792, 1793, 5, 164, 0, 0, 1793, 1794, 5, 50, - 0, 0, 1794, 1795, 5, 59, 0, 0, 1795, 1796, 3, 314, 157, 0, 1796, 1797, 3, 278, 139, 0, 1797, 277, 1, 0, 0, 0, 1798, - 1805, 3, 234, 117, 0, 1799, 1800, 5, 42, 0, 0, 1800, 1801, 5, 56, 0, 0, 1801, 1802, 5, 144, 0, 0, 1802, 1803, 7, 14, - 0, 0, 1803, 1805, 5, 145, 0, 0, 1804, 1798, 1, 0, 0, 0, 1804, 1799, 1, 0, 0, 0, 1805, 279, 1, 0, 0, 0, 1806, 1807, - 5, 75, 0, 0, 1807, 1815, 5, 164, 0, 0, 1808, 1810, 5, 71, 0, 0, 1809, 1808, 1, 0, 0, 0, 1809, 1810, 1, 0, 0, 0, - 1810, 1811, 1, 0, 0, 0, 1811, 1812, 5, 144, 0, 0, 1812, 1813, 3, 216, 108, 0, 1813, 1814, 5, 145, 0, 0, 1814, 1816, - 1, 0, 0, 0, 1815, 1809, 1, 0, 0, 0, 1815, 1816, 1, 0, 0, 0, 1816, 281, 1, 0, 0, 0, 1817, 1819, 5, 93, 0, 0, 1818, - 1817, 1, 0, 0, 0, 1818, 1819, 1, 0, 0, 0, 1819, 1820, 1, 0, 0, 0, 1820, 1821, 3, 238, 119, 0, 1821, 1822, 5, 150, 0, - 0, 1822, 1823, 3, 308, 154, 0, 1823, 283, 1, 0, 0, 0, 1824, 1827, 3, 288, 144, 0, 1825, 1826, 5, 50, 0, 0, 1826, - 1828, 3, 286, 143, 0, 1827, 1825, 1, 0, 0, 0, 1827, 1828, 1, 0, 0, 0, 1828, 285, 1, 0, 0, 0, 1829, 1832, 3, 314, - 157, 0, 1830, 1832, 5, 143, 0, 0, 1831, 1829, 1, 0, 0, 0, 1831, 1830, 1, 0, 0, 0, 1832, 287, 1, 0, 0, 0, 1833, 1836, - 3, 272, 136, 0, 1834, 1836, 3, 280, 140, 0, 1835, 1833, 1, 0, 0, 0, 1835, 1834, 1, 0, 0, 0, 1836, 289, 1, 0, 0, 0, - 1837, 1838, 5, 104, 0, 0, 1838, 1841, 5, 164, 0, 0, 1839, 1840, 5, 50, 0, 0, 1840, 1842, 3, 248, 124, 0, 1841, 1839, - 1, 0, 0, 0, 1841, 1842, 1, 0, 0, 0, 1842, 291, 1, 0, 0, 0, 1843, 1846, 3, 480, 240, 0, 1844, 1846, 3, 498, 249, 0, - 1845, 1843, 1, 0, 0, 0, 1845, 1844, 1, 0, 0, 0, 1846, 293, 1, 0, 0, 0, 1847, 1849, 5, 109, 0, 0, 1848, 1847, 1, 0, - 0, 0, 1848, 1849, 1, 0, 0, 0, 1849, 1850, 1, 0, 0, 0, 1850, 1851, 3, 238, 119, 0, 1851, 1853, 5, 150, 0, 0, 1852, - 1854, 3, 306, 153, 0, 1853, 1852, 1, 0, 0, 0, 1853, 1854, 1, 0, 0, 0, 1854, 1855, 1, 0, 0, 0, 1855, 1858, 3, 292, - 146, 0, 1856, 1857, 5, 142, 0, 0, 1857, 1859, 3, 100, 50, 0, 1858, 1856, 1, 0, 0, 0, 1858, 1859, 1, 0, 0, 0, 1859, - 295, 1, 0, 0, 0, 1860, 1861, 5, 118, 0, 0, 1861, 1865, 3, 184, 92, 0, 1862, 1863, 5, 37, 0, 0, 1863, 1865, 3, 336, - 168, 0, 1864, 1860, 1, 0, 0, 0, 1864, 1862, 1, 0, 0, 0, 1865, 297, 1, 0, 0, 0, 1866, 1867, 5, 52, 0, 0, 1867, 1872, - 5, 164, 0, 0, 1868, 1869, 5, 152, 0, 0, 1869, 1871, 5, 164, 0, 0, 1870, 1868, 1, 0, 0, 0, 1871, 1874, 1, 0, 0, 0, - 1872, 1870, 1, 0, 0, 0, 1872, 1873, 1, 0, 0, 0, 1873, 1875, 1, 0, 0, 0, 1874, 1872, 1, 0, 0, 0, 1875, 1876, 5, 151, - 0, 0, 1876, 299, 1, 0, 0, 0, 1877, 1885, 3, 164, 82, 0, 1878, 1885, 3, 108, 54, 0, 1879, 1885, 3, 326, 163, 0, 1880, - 1885, 3, 330, 165, 0, 1881, 1885, 3, 122, 61, 0, 1882, 1885, 3, 20, 10, 0, 1883, 1885, 3, 322, 161, 0, 1884, 1877, - 1, 0, 0, 0, 1884, 1878, 1, 0, 0, 0, 1884, 1879, 1, 0, 0, 0, 1884, 1880, 1, 0, 0, 0, 1884, 1881, 1, 0, 0, 0, 1884, - 1882, 1, 0, 0, 0, 1884, 1883, 1, 0, 0, 0, 1885, 301, 1, 0, 0, 0, 1886, 1892, 3, 320, 160, 0, 1887, 1892, 3, 178, 89, - 0, 1888, 1892, 5, 163, 0, 0, 1889, 1892, 5, 161, 0, 0, 1890, 1892, 5, 63, 0, 0, 1891, 1886, 1, 0, 0, 0, 1891, 1887, - 1, 0, 0, 0, 1891, 1888, 1, 0, 0, 0, 1891, 1889, 1, 0, 0, 0, 1891, 1890, 1, 0, 0, 0, 1892, 303, 1, 0, 0, 0, 1893, - 1894, 5, 164, 0, 0, 1894, 1896, 5, 150, 0, 0, 1895, 1893, 1, 0, 0, 0, 1895, 1896, 1, 0, 0, 0, 1896, 1898, 1, 0, 0, - 0, 1897, 1899, 3, 296, 148, 0, 1898, 1897, 1, 0, 0, 0, 1898, 1899, 1, 0, 0, 0, 1899, 1900, 1, 0, 0, 0, 1900, 1904, - 5, 54, 0, 0, 1901, 1903, 3, 440, 220, 0, 1902, 1901, 1, 0, 0, 0, 1903, 1906, 1, 0, 0, 0, 1904, 1902, 1, 0, 0, 0, - 1904, 1905, 1, 0, 0, 0, 1905, 1907, 1, 0, 0, 0, 1906, 1904, 1, 0, 0, 0, 1907, 1908, 5, 33, 0, 0, 1908, 1910, 5, 54, - 0, 0, 1909, 1911, 5, 164, 0, 0, 1910, 1909, 1, 0, 0, 0, 1910, 1911, 1, 0, 0, 0, 1911, 1912, 1, 0, 0, 0, 1912, 1913, - 5, 151, 0, 0, 1913, 305, 1, 0, 0, 0, 1914, 1915, 7, 15, 0, 0, 1915, 307, 1, 0, 0, 0, 1916, 1920, 3, 454, 227, 0, - 1917, 1920, 3, 36, 18, 0, 1918, 1920, 3, 404, 202, 0, 1919, 1916, 1, 0, 0, 0, 1919, 1917, 1, 0, 0, 0, 1919, 1918, 1, - 0, 0, 0, 1920, 309, 1, 0, 0, 0, 1921, 1922, 5, 110, 0, 0, 1922, 1923, 5, 164, 0, 0, 1923, 1924, 5, 64, 0, 0, 1924, - 1925, 3, 480, 240, 0, 1925, 1929, 5, 50, 0, 0, 1926, 1928, 3, 312, 156, 0, 1927, 1926, 1, 0, 0, 0, 1928, 1931, 1, 0, - 0, 0, 1929, 1927, 1, 0, 0, 0, 1929, 1930, 1, 0, 0, 0, 1930, 1932, 1, 0, 0, 0, 1931, 1929, 1, 0, 0, 0, 1932, 1933, 5, - 33, 0, 0, 1933, 1934, 5, 110, 0, 0, 1934, 1935, 5, 164, 0, 0, 1935, 1936, 5, 151, 0, 0, 1936, 311, 1, 0, 0, 0, 1937, - 1938, 3, 396, 198, 0, 1938, 1939, 5, 150, 0, 0, 1939, 1940, 3, 152, 76, 0, 1940, 1941, 5, 151, 0, 0, 1941, 313, 1, - 0, 0, 0, 1942, 1943, 6, 157, -1, 0, 1943, 1948, 5, 164, 0, 0, 1944, 1948, 5, 163, 0, 0, 1945, 1948, 5, 162, 0, 0, - 1946, 1948, 3, 188, 94, 0, 1947, 1942, 1, 0, 0, 0, 1947, 1944, 1, 0, 0, 0, 1947, 1945, 1, 0, 0, 0, 1947, 1946, 1, 0, - 0, 0, 1948, 1983, 1, 0, 0, 0, 1949, 1950, 10, 5, 0, 0, 1950, 1951, 5, 154, 0, 0, 1951, 1982, 3, 482, 241, 0, 1952, - 1953, 10, 4, 0, 0, 1953, 1954, 5, 144, 0, 0, 1954, 1959, 3, 184, 92, 0, 1955, 1956, 5, 152, 0, 0, 1956, 1958, 3, - 184, 92, 0, 1957, 1955, 1, 0, 0, 0, 1958, 1961, 1, 0, 0, 0, 1959, 1957, 1, 0, 0, 0, 1959, 1960, 1, 0, 0, 0, 1960, - 1962, 1, 0, 0, 0, 1961, 1959, 1, 0, 0, 0, 1962, 1963, 5, 145, 0, 0, 1963, 1982, 1, 0, 0, 0, 1964, 1965, 10, 3, 0, 0, - 1965, 1966, 5, 144, 0, 0, 1966, 1967, 3, 140, 70, 0, 1967, 1968, 5, 145, 0, 0, 1968, 1982, 1, 0, 0, 0, 1969, 1971, - 10, 2, 0, 0, 1970, 1972, 3, 448, 224, 0, 1971, 1970, 1, 0, 0, 0, 1971, 1972, 1, 0, 0, 0, 1972, 1973, 1, 0, 0, 0, - 1973, 1974, 5, 158, 0, 0, 1974, 1979, 3, 48, 24, 0, 1975, 1976, 5, 144, 0, 0, 1976, 1977, 3, 184, 92, 0, 1977, 1978, - 5, 145, 0, 0, 1978, 1980, 1, 0, 0, 0, 1979, 1975, 1, 0, 0, 0, 1979, 1980, 1, 0, 0, 0, 1980, 1982, 1, 0, 0, 0, 1981, - 1949, 1, 0, 0, 0, 1981, 1952, 1, 0, 0, 0, 1981, 1964, 1, 0, 0, 0, 1981, 1969, 1, 0, 0, 0, 1982, 1985, 1, 0, 0, 0, - 1983, 1981, 1, 0, 0, 0, 1983, 1984, 1, 0, 0, 0, 1984, 315, 1, 0, 0, 0, 1985, 1983, 1, 0, 0, 0, 1986, 1987, 5, 164, - 0, 0, 1987, 1989, 5, 150, 0, 0, 1988, 1986, 1, 0, 0, 0, 1988, 1989, 1, 0, 0, 0, 1989, 1990, 1, 0, 0, 0, 1990, 1992, - 5, 60, 0, 0, 1991, 1993, 5, 164, 0, 0, 1992, 1991, 1, 0, 0, 0, 1992, 1993, 1, 0, 0, 0, 1993, 1996, 1, 0, 0, 0, 1994, - 1995, 5, 117, 0, 0, 1995, 1997, 3, 184, 92, 0, 1996, 1994, 1, 0, 0, 0, 1996, 1997, 1, 0, 0, 0, 1997, 1998, 1, 0, 0, - 0, 1998, 1999, 5, 151, 0, 0, 1999, 317, 1, 0, 0, 0, 2000, 2001, 5, 164, 0, 0, 2001, 2003, 5, 150, 0, 0, 2002, 2000, - 1, 0, 0, 0, 2002, 2003, 1, 0, 0, 0, 2003, 2004, 1, 0, 0, 0, 2004, 2005, 5, 63, 0, 0, 2005, 2006, 5, 151, 0, 0, 2006, - 319, 1, 0, 0, 0, 2007, 2010, 5, 160, 0, 0, 2008, 2010, 3, 344, 172, 0, 2009, 2007, 1, 0, 0, 0, 2009, 2008, 1, 0, 0, - 0, 2010, 321, 1, 0, 0, 0, 2011, 2012, 5, 70, 0, 0, 2012, 2013, 5, 19, 0, 0, 2013, 2014, 5, 164, 0, 0, 2014, 2018, 5, - 50, 0, 0, 2015, 2017, 3, 324, 162, 0, 2016, 2015, 1, 0, 0, 0, 2017, 2020, 1, 0, 0, 0, 2018, 2016, 1, 0, 0, 0, 2018, - 2019, 1, 0, 0, 0, 2019, 2021, 1, 0, 0, 0, 2020, 2018, 1, 0, 0, 0, 2021, 2024, 5, 33, 0, 0, 2022, 2023, 5, 70, 0, 0, - 2023, 2025, 5, 19, 0, 0, 2024, 2022, 1, 0, 0, 0, 2024, 2025, 1, 0, 0, 0, 2025, 2027, 1, 0, 0, 0, 2026, 2028, 5, 164, - 0, 0, 2027, 2026, 1, 0, 0, 0, 2027, 2028, 1, 0, 0, 0, 2028, 2029, 1, 0, 0, 0, 2029, 2030, 5, 151, 0, 0, 2030, 323, - 1, 0, 0, 0, 2031, 2047, 3, 468, 234, 0, 2032, 2047, 3, 466, 233, 0, 2033, 2047, 3, 472, 236, 0, 2034, 2047, 3, 326, - 163, 0, 2035, 2047, 3, 322, 161, 0, 2036, 2047, 3, 330, 165, 0, 2037, 2047, 3, 490, 245, 0, 2038, 2047, 3, 478, 239, - 0, 2039, 2047, 3, 116, 58, 0, 2040, 2047, 3, 506, 253, 0, 2041, 2047, 3, 198, 99, 0, 2042, 2047, 3, 12, 6, 0, 2043, - 2047, 3, 46, 23, 0, 2044, 2047, 3, 50, 25, 0, 2045, 2047, 3, 500, 250, 0, 2046, 2031, 1, 0, 0, 0, 2046, 2032, 1, 0, - 0, 0, 2046, 2033, 1, 0, 0, 0, 2046, 2034, 1, 0, 0, 0, 2046, 2035, 1, 0, 0, 0, 2046, 2036, 1, 0, 0, 0, 2046, 2037, 1, - 0, 0, 0, 2046, 2038, 1, 0, 0, 0, 2046, 2039, 1, 0, 0, 0, 2046, 2040, 1, 0, 0, 0, 2046, 2041, 1, 0, 0, 0, 2046, 2042, - 1, 0, 0, 0, 2046, 2043, 1, 0, 0, 0, 2046, 2044, 1, 0, 0, 0, 2046, 2045, 1, 0, 0, 0, 2047, 325, 1, 0, 0, 0, 2048, - 2049, 5, 70, 0, 0, 2049, 2050, 5, 164, 0, 0, 2050, 2052, 5, 50, 0, 0, 2051, 2053, 3, 232, 116, 0, 2052, 2051, 1, 0, - 0, 0, 2052, 2053, 1, 0, 0, 0, 2053, 2057, 1, 0, 0, 0, 2054, 2056, 3, 328, 164, 0, 2055, 2054, 1, 0, 0, 0, 2056, - 2059, 1, 0, 0, 0, 2057, 2055, 1, 0, 0, 0, 2057, 2058, 1, 0, 0, 0, 2058, 2060, 1, 0, 0, 0, 2059, 2057, 1, 0, 0, 0, - 2060, 2062, 5, 33, 0, 0, 2061, 2063, 5, 70, 0, 0, 2062, 2061, 1, 0, 0, 0, 2062, 2063, 1, 0, 0, 0, 2063, 2065, 1, 0, - 0, 0, 2064, 2066, 5, 164, 0, 0, 2065, 2064, 1, 0, 0, 0, 2065, 2066, 1, 0, 0, 0, 2066, 2067, 1, 0, 0, 0, 2067, 2068, - 5, 151, 0, 0, 2068, 327, 1, 0, 0, 0, 2069, 2086, 3, 468, 234, 0, 2070, 2086, 3, 472, 236, 0, 2071, 2086, 3, 326, - 163, 0, 2072, 2086, 3, 330, 165, 0, 2073, 2086, 3, 490, 245, 0, 2074, 2086, 3, 478, 239, 0, 2075, 2086, 3, 116, 58, - 0, 2076, 2086, 3, 444, 222, 0, 2077, 2086, 3, 506, 253, 0, 2078, 2086, 3, 198, 99, 0, 2079, 2086, 3, 12, 6, 0, 2080, - 2086, 3, 76, 38, 0, 2081, 2086, 3, 46, 23, 0, 2082, 2086, 3, 50, 25, 0, 2083, 2086, 3, 138, 69, 0, 2084, 2086, 3, - 500, 250, 0, 2085, 2069, 1, 0, 0, 0, 2085, 2070, 1, 0, 0, 0, 2085, 2071, 1, 0, 0, 0, 2085, 2072, 1, 0, 0, 0, 2085, - 2073, 1, 0, 0, 0, 2085, 2074, 1, 0, 0, 0, 2085, 2075, 1, 0, 0, 0, 2085, 2076, 1, 0, 0, 0, 2085, 2077, 1, 0, 0, 0, - 2085, 2078, 1, 0, 0, 0, 2085, 2079, 1, 0, 0, 0, 2085, 2080, 1, 0, 0, 0, 2085, 2081, 1, 0, 0, 0, 2085, 2082, 1, 0, 0, - 0, 2085, 2083, 1, 0, 0, 0, 2085, 2084, 1, 0, 0, 0, 2086, 329, 1, 0, 0, 0, 2087, 2088, 5, 70, 0, 0, 2088, 2089, 5, - 164, 0, 0, 2089, 2090, 5, 50, 0, 0, 2090, 2091, 5, 59, 0, 0, 2091, 2093, 3, 314, 157, 0, 2092, 2094, 3, 234, 117, 0, - 2093, 2092, 1, 0, 0, 0, 2093, 2094, 1, 0, 0, 0, 2094, 2095, 1, 0, 0, 0, 2095, 2096, 5, 151, 0, 0, 2096, 331, 1, 0, - 0, 0, 2097, 2098, 5, 156, 0, 0, 2098, 2099, 5, 164, 0, 0, 2099, 2104, 5, 154, 0, 0, 2100, 2101, 5, 164, 0, 0, 2101, - 2103, 5, 154, 0, 0, 2102, 2100, 1, 0, 0, 0, 2103, 2106, 1, 0, 0, 0, 2104, 2102, 1, 0, 0, 0, 2104, 2105, 1, 0, 0, 0, - 2105, 2107, 1, 0, 0, 0, 2106, 2104, 1, 0, 0, 0, 2107, 2108, 5, 164, 0, 0, 2108, 333, 1, 0, 0, 0, 2109, 2110, 5, 71, - 0, 0, 2110, 2112, 5, 56, 0, 0, 2111, 2109, 1, 0, 0, 0, 2111, 2112, 1, 0, 0, 0, 2112, 2113, 1, 0, 0, 0, 2113, 2114, - 5, 144, 0, 0, 2114, 2115, 3, 44, 22, 0, 2115, 2116, 5, 145, 0, 0, 2116, 335, 1, 0, 0, 0, 2117, 2118, 5, 164, 0, 0, - 2118, 2119, 5, 47, 0, 0, 2119, 2120, 3, 140, 70, 0, 2120, 337, 1, 0, 0, 0, 2121, 2122, 3, 340, 170, 0, 2122, 2123, - 5, 154, 0, 0, 2123, 2125, 1, 0, 0, 0, 2124, 2121, 1, 0, 0, 0, 2125, 2128, 1, 0, 0, 0, 2126, 2124, 1, 0, 0, 0, 2126, - 2127, 1, 0, 0, 0, 2127, 2129, 1, 0, 0, 0, 2128, 2126, 1, 0, 0, 0, 2129, 2130, 5, 164, 0, 0, 2130, 339, 1, 0, 0, 0, - 2131, 2132, 5, 164, 0, 0, 2132, 341, 1, 0, 0, 0, 2133, 2134, 5, 106, 0, 0, 2134, 2135, 5, 143, 0, 0, 2135, 343, 1, - 0, 0, 0, 2136, 2138, 5, 160, 0, 0, 2137, 2136, 1, 0, 0, 0, 2137, 2138, 1, 0, 0, 0, 2138, 2139, 1, 0, 0, 0, 2139, - 2140, 3, 314, 157, 0, 2140, 345, 1, 0, 0, 0, 2141, 2142, 3, 390, 195, 0, 2142, 2143, 5, 106, 0, 0, 2143, 2144, 5, - 164, 0, 0, 2144, 2148, 5, 151, 0, 0, 2145, 2147, 3, 418, 209, 0, 2146, 2145, 1, 0, 0, 0, 2147, 2150, 1, 0, 0, 0, - 2148, 2146, 1, 0, 0, 0, 2148, 2149, 1, 0, 0, 0, 2149, 2151, 1, 0, 0, 0, 2150, 2148, 1, 0, 0, 0, 2151, 2152, 5, 33, - 0, 0, 2152, 2154, 5, 106, 0, 0, 2153, 2155, 5, 164, 0, 0, 2154, 2153, 1, 0, 0, 0, 2154, 2155, 1, 0, 0, 0, 2155, 347, - 1, 0, 0, 0, 2156, 2157, 5, 164, 0, 0, 2157, 2159, 5, 150, 0, 0, 2158, 2156, 1, 0, 0, 0, 2158, 2159, 1, 0, 0, 0, - 2159, 2160, 1, 0, 0, 0, 2160, 2163, 5, 86, 0, 0, 2161, 2162, 5, 117, 0, 0, 2162, 2164, 3, 184, 92, 0, 2163, 2161, 1, - 0, 0, 0, 2163, 2164, 1, 0, 0, 0, 2164, 2165, 1, 0, 0, 0, 2165, 2166, 5, 151, 0, 0, 2166, 349, 1, 0, 0, 0, 2167, - 2168, 5, 72, 0, 0, 2168, 2169, 5, 144, 0, 0, 2169, 2174, 3, 282, 141, 0, 2170, 2171, 5, 151, 0, 0, 2171, 2173, 3, - 282, 141, 0, 2172, 2170, 1, 0, 0, 0, 2173, 2176, 1, 0, 0, 0, 2174, 2172, 1, 0, 0, 0, 2174, 2175, 1, 0, 0, 0, 2175, - 2177, 1, 0, 0, 0, 2176, 2174, 1, 0, 0, 0, 2177, 2178, 5, 145, 0, 0, 2178, 2179, 5, 151, 0, 0, 2179, 351, 1, 0, 0, 0, - 2180, 2181, 5, 72, 0, 0, 2181, 2182, 5, 56, 0, 0, 2182, 2183, 5, 144, 0, 0, 2183, 2184, 3, 44, 22, 0, 2184, 2185, 5, - 145, 0, 0, 2185, 353, 1, 0, 0, 0, 2186, 2198, 3, 314, 157, 0, 2187, 2198, 3, 302, 151, 0, 2188, 2198, 3, 10, 5, 0, - 2189, 2198, 3, 222, 111, 0, 2190, 2198, 3, 386, 193, 0, 2191, 2198, 3, 488, 244, 0, 2192, 2198, 3, 18, 9, 0, 2193, - 2194, 5, 144, 0, 0, 2194, 2195, 3, 184, 92, 0, 2195, 2196, 5, 145, 0, 0, 2196, 2198, 1, 0, 0, 0, 2197, 2186, 1, 0, - 0, 0, 2197, 2187, 1, 0, 0, 0, 2197, 2188, 1, 0, 0, 0, 2197, 2189, 1, 0, 0, 0, 2197, 2190, 1, 0, 0, 0, 2197, 2191, 1, - 0, 0, 0, 2197, 2192, 1, 0, 0, 0, 2197, 2193, 1, 0, 0, 0, 2198, 355, 1, 0, 0, 0, 2199, 2200, 5, 74, 0, 0, 2200, 2201, - 3, 506, 253, 0, 2201, 357, 1, 0, 0, 0, 2202, 2203, 5, 74, 0, 0, 2203, 359, 1, 0, 0, 0, 2204, 2206, 3, 314, 157, 0, - 2205, 2207, 3, 234, 117, 0, 2206, 2205, 1, 0, 0, 0, 2206, 2207, 1, 0, 0, 0, 2207, 2209, 1, 0, 0, 0, 2208, 2210, 3, - 334, 167, 0, 2209, 2208, 1, 0, 0, 0, 2209, 2210, 1, 0, 0, 0, 2210, 361, 1, 0, 0, 0, 2211, 2212, 5, 164, 0, 0, 2212, - 2214, 5, 150, 0, 0, 2213, 2211, 1, 0, 0, 0, 2213, 2214, 1, 0, 0, 0, 2214, 2215, 1, 0, 0, 0, 2215, 2216, 3, 360, 180, - 0, 2216, 2217, 5, 151, 0, 0, 2217, 363, 1, 0, 0, 0, 2218, 2219, 5, 75, 0, 0, 2219, 2227, 5, 164, 0, 0, 2220, 2222, - 5, 71, 0, 0, 2221, 2220, 1, 0, 0, 0, 2221, 2222, 1, 0, 0, 0, 2222, 2223, 1, 0, 0, 0, 2223, 2224, 5, 144, 0, 0, 2224, - 2225, 3, 216, 108, 0, 2225, 2226, 5, 145, 0, 0, 2226, 2228, 1, 0, 0, 0, 2227, 2221, 1, 0, 0, 0, 2227, 2228, 1, 0, 0, - 0, 2228, 365, 1, 0, 0, 0, 2229, 2245, 3, 468, 234, 0, 2230, 2245, 3, 466, 233, 0, 2231, 2245, 3, 472, 236, 0, 2232, - 2245, 3, 326, 163, 0, 2233, 2245, 3, 322, 161, 0, 2234, 2245, 3, 330, 165, 0, 2235, 2245, 3, 490, 245, 0, 2236, - 2245, 3, 478, 239, 0, 2237, 2245, 3, 116, 58, 0, 2238, 2245, 3, 506, 253, 0, 2239, 2245, 3, 198, 99, 0, 2240, 2245, - 3, 12, 6, 0, 2241, 2245, 3, 46, 23, 0, 2242, 2245, 3, 50, 25, 0, 2243, 2245, 3, 500, 250, 0, 2244, 2229, 1, 0, 0, 0, - 2244, 2230, 1, 0, 0, 0, 2244, 2231, 1, 0, 0, 0, 2244, 2232, 1, 0, 0, 0, 2244, 2233, 1, 0, 0, 0, 2244, 2234, 1, 0, 0, - 0, 2244, 2235, 1, 0, 0, 0, 2244, 2236, 1, 0, 0, 0, 2244, 2237, 1, 0, 0, 0, 2244, 2238, 1, 0, 0, 0, 2244, 2239, 1, 0, - 0, 0, 2244, 2240, 1, 0, 0, 0, 2244, 2241, 1, 0, 0, 0, 2244, 2242, 1, 0, 0, 0, 2244, 2243, 1, 0, 0, 0, 2245, 367, 1, - 0, 0, 0, 2246, 2249, 3, 436, 218, 0, 2247, 2249, 5, 10, 0, 0, 2248, 2246, 1, 0, 0, 0, 2248, 2247, 1, 0, 0, 0, 2249, - 369, 1, 0, 0, 0, 2250, 2251, 5, 164, 0, 0, 2251, 2253, 5, 150, 0, 0, 2252, 2250, 1, 0, 0, 0, 2252, 2253, 1, 0, 0, 0, - 2253, 2254, 1, 0, 0, 0, 2254, 2259, 5, 76, 0, 0, 2255, 2256, 5, 144, 0, 0, 2256, 2257, 3, 368, 184, 0, 2257, 2258, - 5, 145, 0, 0, 2258, 2260, 1, 0, 0, 0, 2259, 2255, 1, 0, 0, 0, 2259, 2260, 1, 0, 0, 0, 2260, 2262, 1, 0, 0, 0, 2261, - 2263, 5, 50, 0, 0, 2262, 2261, 1, 0, 0, 0, 2262, 2263, 1, 0, 0, 0, 2263, 2267, 1, 0, 0, 0, 2264, 2266, 3, 366, 183, - 0, 2265, 2264, 1, 0, 0, 0, 2266, 2269, 1, 0, 0, 0, 2267, 2265, 1, 0, 0, 0, 2267, 2268, 1, 0, 0, 0, 2268, 2270, 1, 0, - 0, 0, 2269, 2267, 1, 0, 0, 0, 2270, 2274, 5, 17, 0, 0, 2271, 2273, 3, 440, 220, 0, 2272, 2271, 1, 0, 0, 0, 2273, - 2276, 1, 0, 0, 0, 2274, 2272, 1, 0, 0, 0, 2274, 2275, 1, 0, 0, 0, 2275, 2277, 1, 0, 0, 0, 2276, 2274, 1, 0, 0, 0, - 2277, 2278, 5, 33, 0, 0, 2278, 2280, 5, 76, 0, 0, 2279, 2281, 5, 164, 0, 0, 2280, 2279, 1, 0, 0, 0, 2280, 2281, 1, - 0, 0, 0, 2281, 2282, 1, 0, 0, 0, 2282, 2283, 5, 151, 0, 0, 2283, 371, 1, 0, 0, 0, 2284, 2285, 5, 164, 0, 0, 2285, - 2287, 5, 150, 0, 0, 2286, 2284, 1, 0, 0, 0, 2286, 2287, 1, 0, 0, 0, 2287, 2288, 1, 0, 0, 0, 2288, 2289, 5, 73, 0, 0, - 2289, 2294, 5, 76, 0, 0, 2290, 2291, 5, 144, 0, 0, 2291, 2292, 3, 436, 218, 0, 2292, 2293, 5, 145, 0, 0, 2293, 2295, - 1, 0, 0, 0, 2294, 2290, 1, 0, 0, 0, 2294, 2295, 1, 0, 0, 0, 2295, 2297, 1, 0, 0, 0, 2296, 2298, 5, 50, 0, 0, 2297, - 2296, 1, 0, 0, 0, 2297, 2298, 1, 0, 0, 0, 2298, 2302, 1, 0, 0, 0, 2299, 2301, 3, 366, 183, 0, 2300, 2299, 1, 0, 0, - 0, 2301, 2304, 1, 0, 0, 0, 2302, 2300, 1, 0, 0, 0, 2302, 2303, 1, 0, 0, 0, 2303, 2305, 1, 0, 0, 0, 2304, 2302, 1, 0, - 0, 0, 2305, 2309, 5, 17, 0, 0, 2306, 2308, 3, 440, 220, 0, 2307, 2306, 1, 0, 0, 0, 2308, 2311, 1, 0, 0, 0, 2309, - 2307, 1, 0, 0, 0, 2309, 2310, 1, 0, 0, 0, 2310, 2312, 1, 0, 0, 0, 2311, 2309, 1, 0, 0, 0, 2312, 2314, 5, 33, 0, 0, - 2313, 2315, 5, 73, 0, 0, 2314, 2313, 1, 0, 0, 0, 2314, 2315, 1, 0, 0, 0, 2315, 2316, 1, 0, 0, 0, 2316, 2318, 5, 76, - 0, 0, 2317, 2319, 5, 164, 0, 0, 2318, 2317, 1, 0, 0, 0, 2318, 2319, 1, 0, 0, 0, 2319, 2320, 1, 0, 0, 0, 2320, 2321, - 5, 151, 0, 0, 2321, 373, 1, 0, 0, 0, 2322, 2323, 5, 77, 0, 0, 2323, 2327, 5, 19, 0, 0, 2324, 2326, 3, 376, 188, 0, - 2325, 2324, 1, 0, 0, 0, 2326, 2329, 1, 0, 0, 0, 2327, 2325, 1, 0, 0, 0, 2327, 2328, 1, 0, 0, 0, 2328, 2330, 1, 0, 0, - 0, 2329, 2327, 1, 0, 0, 0, 2330, 2331, 5, 33, 0, 0, 2331, 2332, 5, 77, 0, 0, 2332, 2334, 5, 19, 0, 0, 2333, 2335, 5, - 164, 0, 0, 2334, 2333, 1, 0, 0, 0, 2334, 2335, 1, 0, 0, 0, 2335, 375, 1, 0, 0, 0, 2336, 2352, 3, 468, 234, 0, 2337, - 2352, 3, 466, 233, 0, 2338, 2352, 3, 472, 236, 0, 2339, 2352, 3, 326, 163, 0, 2340, 2352, 3, 322, 161, 0, 2341, - 2352, 3, 330, 165, 0, 2342, 2352, 3, 490, 245, 0, 2343, 2352, 3, 478, 239, 0, 2344, 2352, 3, 116, 58, 0, 2345, 2352, - 3, 506, 253, 0, 2346, 2352, 3, 198, 99, 0, 2347, 2352, 3, 12, 6, 0, 2348, 2352, 3, 46, 23, 0, 2349, 2352, 3, 50, 25, - 0, 2350, 2352, 3, 500, 250, 0, 2351, 2336, 1, 0, 0, 0, 2351, 2337, 1, 0, 0, 0, 2351, 2338, 1, 0, 0, 0, 2351, 2339, - 1, 0, 0, 0, 2351, 2340, 1, 0, 0, 0, 2351, 2341, 1, 0, 0, 0, 2351, 2342, 1, 0, 0, 0, 2351, 2343, 1, 0, 0, 0, 2351, - 2344, 1, 0, 0, 0, 2351, 2345, 1, 0, 0, 0, 2351, 2346, 1, 0, 0, 0, 2351, 2347, 1, 0, 0, 0, 2351, 2348, 1, 0, 0, 0, - 2351, 2349, 1, 0, 0, 0, 2351, 2350, 1, 0, 0, 0, 2352, 377, 1, 0, 0, 0, 2353, 2357, 5, 77, 0, 0, 2354, 2356, 3, 380, - 190, 0, 2355, 2354, 1, 0, 0, 0, 2356, 2359, 1, 0, 0, 0, 2357, 2355, 1, 0, 0, 0, 2357, 2358, 1, 0, 0, 0, 2358, 2360, - 1, 0, 0, 0, 2359, 2357, 1, 0, 0, 0, 2360, 2361, 5, 33, 0, 0, 2361, 2363, 5, 77, 0, 0, 2362, 2364, 5, 164, 0, 0, - 2363, 2362, 1, 0, 0, 0, 2363, 2364, 1, 0, 0, 0, 2364, 379, 1, 0, 0, 0, 2365, 2372, 3, 468, 234, 0, 2366, 2372, 3, - 472, 236, 0, 2367, 2372, 3, 356, 178, 0, 2368, 2372, 3, 12, 6, 0, 2369, 2372, 3, 50, 25, 0, 2370, 2372, 3, 500, 250, - 0, 2371, 2365, 1, 0, 0, 0, 2371, 2366, 1, 0, 0, 0, 2371, 2367, 1, 0, 0, 0, 2371, 2368, 1, 0, 0, 0, 2371, 2369, 1, 0, - 0, 0, 2371, 2370, 1, 0, 0, 0, 2372, 381, 1, 0, 0, 0, 2373, 2376, 3, 378, 189, 0, 2374, 2376, 3, 374, 187, 0, 2375, - 2373, 1, 0, 0, 0, 2375, 2374, 1, 0, 0, 0, 2376, 383, 1, 0, 0, 0, 2377, 2378, 5, 59, 0, 0, 2378, 2380, 3, 314, 157, - 0, 2379, 2381, 3, 234, 117, 0, 2380, 2379, 1, 0, 0, 0, 2380, 2381, 1, 0, 0, 0, 2381, 385, 1, 0, 0, 0, 2382, 2383, 3, - 494, 247, 0, 2383, 2390, 5, 158, 0, 0, 2384, 2391, 1, 0, 0, 0, 2385, 2386, 5, 144, 0, 0, 2386, 2387, 3, 184, 92, 0, - 2387, 2388, 5, 145, 0, 0, 2388, 2391, 1, 0, 0, 0, 2389, 2391, 3, 10, 5, 0, 2390, 2384, 1, 0, 0, 0, 2390, 2385, 1, 0, - 0, 0, 2390, 2389, 1, 0, 0, 0, 2391, 387, 1, 0, 0, 0, 2392, 2396, 3, 314, 157, 0, 2393, 2396, 3, 456, 228, 0, 2394, - 2396, 3, 184, 92, 0, 2395, 2392, 1, 0, 0, 0, 2395, 2393, 1, 0, 0, 0, 2395, 2394, 1, 0, 0, 0, 2396, 389, 1, 0, 0, 0, - 2397, 2398, 5, 79, 0, 0, 2398, 2399, 3, 388, 194, 0, 2399, 391, 1, 0, 0, 0, 2400, 2401, 5, 144, 0, 0, 2401, 2406, 3, - 394, 197, 0, 2402, 2403, 5, 152, 0, 0, 2403, 2405, 3, 394, 197, 0, 2404, 2402, 1, 0, 0, 0, 2405, 2408, 1, 0, 0, 0, - 2406, 2404, 1, 0, 0, 0, 2406, 2407, 1, 0, 0, 0, 2407, 2409, 1, 0, 0, 0, 2408, 2406, 1, 0, 0, 0, 2409, 2410, 5, 145, - 0, 0, 2410, 393, 1, 0, 0, 0, 2411, 2412, 5, 164, 0, 0, 2412, 2413, 3, 148, 74, 0, 2413, 395, 1, 0, 0, 0, 2414, 2419, - 5, 164, 0, 0, 2415, 2416, 5, 152, 0, 0, 2416, 2418, 5, 164, 0, 0, 2417, 2415, 1, 0, 0, 0, 2418, 2421, 1, 0, 0, 0, - 2419, 2417, 1, 0, 0, 0, 2419, 2420, 1, 0, 0, 0, 2420, 397, 1, 0, 0, 0, 2421, 2419, 1, 0, 0, 0, 2422, 2423, 5, 164, - 0, 0, 2423, 2424, 3, 410, 205, 0, 2424, 399, 1, 0, 0, 0, 2425, 2430, 3, 398, 199, 0, 2426, 2427, 5, 152, 0, 0, 2427, - 2429, 3, 398, 199, 0, 2428, 2426, 1, 0, 0, 0, 2429, 2432, 1, 0, 0, 0, 2430, 2428, 1, 0, 0, 0, 2430, 2431, 1, 0, 0, - 0, 2431, 401, 1, 0, 0, 0, 2432, 2430, 1, 0, 0, 0, 2433, 2437, 5, 80, 0, 0, 2434, 2436, 3, 150, 75, 0, 2435, 2434, 1, - 0, 0, 0, 2436, 2439, 1, 0, 0, 0, 2437, 2435, 1, 0, 0, 0, 2437, 2438, 1, 0, 0, 0, 2438, 2440, 1, 0, 0, 0, 2439, 2437, - 1, 0, 0, 0, 2440, 2441, 5, 33, 0, 0, 2441, 2443, 5, 80, 0, 0, 2442, 2444, 5, 164, 0, 0, 2443, 2442, 1, 0, 0, 0, - 2443, 2444, 1, 0, 0, 0, 2444, 403, 1, 0, 0, 0, 2445, 2446, 5, 110, 0, 0, 2446, 2449, 3, 314, 157, 0, 2447, 2448, 5, - 64, 0, 0, 2448, 2450, 3, 480, 240, 0, 2449, 2447, 1, 0, 0, 0, 2449, 2450, 1, 0, 0, 0, 2450, 405, 1, 0, 0, 0, 2451, - 2452, 5, 157, 0, 0, 2452, 2454, 5, 154, 0, 0, 2453, 2451, 1, 0, 0, 0, 2454, 2457, 1, 0, 0, 0, 2455, 2453, 1, 0, 0, - 0, 2455, 2456, 1, 0, 0, 0, 2456, 2458, 1, 0, 0, 0, 2457, 2455, 1, 0, 0, 0, 2458, 2459, 3, 338, 169, 0, 2459, 407, 1, - 0, 0, 0, 2460, 2461, 5, 164, 0, 0, 2461, 2463, 5, 150, 0, 0, 2462, 2460, 1, 0, 0, 0, 2462, 2463, 1, 0, 0, 0, 2463, - 2464, 1, 0, 0, 0, 2464, 2465, 5, 85, 0, 0, 2465, 2468, 3, 184, 92, 0, 2466, 2467, 5, 91, 0, 0, 2467, 2469, 3, 184, - 92, 0, 2468, 2466, 1, 0, 0, 0, 2468, 2469, 1, 0, 0, 0, 2469, 2470, 1, 0, 0, 0, 2470, 2471, 5, 151, 0, 0, 2471, 409, - 1, 0, 0, 0, 2472, 2478, 3, 314, 157, 0, 2473, 2474, 5, 144, 0, 0, 2474, 2475, 3, 158, 79, 0, 2475, 2476, 5, 145, 0, - 0, 2476, 2478, 1, 0, 0, 0, 2477, 2472, 1, 0, 0, 0, 2477, 2473, 1, 0, 0, 0, 2478, 411, 1, 0, 0, 0, 2479, 2482, 3, - 348, 174, 0, 2480, 2482, 3, 502, 251, 0, 2481, 2479, 1, 0, 0, 0, 2481, 2480, 1, 0, 0, 0, 2482, 413, 1, 0, 0, 0, - 2483, 2484, 5, 143, 0, 0, 2484, 415, 1, 0, 0, 0, 2485, 2490, 3, 180, 90, 0, 2486, 2490, 3, 262, 131, 0, 2487, 2490, - 3, 208, 104, 0, 2488, 2490, 3, 346, 173, 0, 2489, 2485, 1, 0, 0, 0, 2489, 2486, 1, 0, 0, 0, 2489, 2487, 1, 0, 0, 0, - 2489, 2488, 1, 0, 0, 0, 2490, 417, 1, 0, 0, 0, 2491, 2492, 5, 164, 0, 0, 2492, 2493, 5, 121, 0, 0, 2493, 2494, 3, - 344, 172, 0, 2494, 2495, 5, 151, 0, 0, 2495, 419, 1, 0, 0, 0, 2496, 2497, 3, 184, 92, 0, 2497, 2498, 5, 117, 0, 0, - 2498, 2499, 3, 72, 36, 0, 2499, 2500, 5, 152, 0, 0, 2500, 2502, 1, 0, 0, 0, 2501, 2496, 1, 0, 0, 0, 2502, 2505, 1, - 0, 0, 0, 2503, 2501, 1, 0, 0, 0, 2503, 2504, 1, 0, 0, 0, 2504, 2506, 1, 0, 0, 0, 2505, 2503, 1, 0, 0, 0, 2506, 2507, - 3, 184, 92, 0, 2507, 2508, 5, 117, 0, 0, 2508, 2509, 3, 72, 36, 0, 2509, 421, 1, 0, 0, 0, 2510, 2511, 5, 116, 0, 0, - 2511, 2512, 3, 184, 92, 0, 2512, 2514, 5, 90, 0, 0, 2513, 2515, 5, 155, 0, 0, 2514, 2513, 1, 0, 0, 0, 2514, 2515, 1, - 0, 0, 0, 2515, 2516, 1, 0, 0, 0, 2516, 2517, 3, 484, 242, 0, 2517, 2518, 5, 141, 0, 0, 2518, 2519, 5, 38, 0, 0, - 2519, 2520, 3, 212, 106, 0, 2520, 2521, 3, 420, 210, 0, 2521, 2522, 5, 151, 0, 0, 2522, 423, 1, 0, 0, 0, 2523, 2526, - 5, 164, 0, 0, 2524, 2525, 5, 154, 0, 0, 2525, 2527, 5, 164, 0, 0, 2526, 2524, 1, 0, 0, 0, 2527, 2528, 1, 0, 0, 0, - 2528, 2526, 1, 0, 0, 0, 2528, 2529, 1, 0, 0, 0, 2529, 2541, 1, 0, 0, 0, 2530, 2535, 5, 164, 0, 0, 2531, 2532, 5, - 154, 0, 0, 2532, 2534, 5, 164, 0, 0, 2533, 2531, 1, 0, 0, 0, 2534, 2537, 1, 0, 0, 0, 2535, 2533, 1, 0, 0, 0, 2535, - 2536, 1, 0, 0, 0, 2536, 2538, 1, 0, 0, 0, 2537, 2535, 1, 0, 0, 0, 2538, 2539, 5, 154, 0, 0, 2539, 2541, 5, 10, 0, 0, - 2540, 2523, 1, 0, 0, 0, 2540, 2530, 1, 0, 0, 0, 2541, 425, 1, 0, 0, 0, 2542, 2545, 3, 430, 215, 0, 2543, 2545, 3, - 422, 211, 0, 2544, 2542, 1, 0, 0, 0, 2544, 2543, 1, 0, 0, 0, 2545, 427, 1, 0, 0, 0, 2546, 2547, 5, 116, 0, 0, 2547, - 2548, 3, 184, 92, 0, 2548, 2550, 5, 90, 0, 0, 2549, 2551, 5, 155, 0, 0, 2550, 2549, 1, 0, 0, 0, 2550, 2551, 1, 0, 0, - 0, 2551, 2552, 1, 0, 0, 0, 2552, 2553, 3, 484, 242, 0, 2553, 2554, 5, 142, 0, 0, 2554, 2555, 3, 420, 210, 0, 2555, - 2556, 5, 151, 0, 0, 2556, 429, 1, 0, 0, 0, 2557, 2558, 5, 116, 0, 0, 2558, 2559, 3, 184, 92, 0, 2559, 2561, 5, 90, - 0, 0, 2560, 2562, 5, 155, 0, 0, 2561, 2560, 1, 0, 0, 0, 2561, 2562, 1, 0, 0, 0, 2562, 2563, 1, 0, 0, 0, 2563, 2564, - 3, 484, 242, 0, 2564, 2565, 5, 141, 0, 0, 2565, 2566, 3, 128, 64, 0, 2566, 2567, 3, 432, 216, 0, 2567, 2568, 5, 151, - 0, 0, 2568, 431, 1, 0, 0, 0, 2569, 2570, 3, 510, 255, 0, 2570, 2571, 5, 117, 0, 0, 2571, 2572, 3, 72, 36, 0, 2572, - 2573, 5, 152, 0, 0, 2573, 2575, 1, 0, 0, 0, 2574, 2569, 1, 0, 0, 0, 2575, 2578, 1, 0, 0, 0, 2576, 2574, 1, 0, 0, 0, - 2576, 2577, 1, 0, 0, 0, 2577, 2579, 1, 0, 0, 0, 2578, 2576, 1, 0, 0, 0, 2579, 2580, 3, 510, 255, 0, 2580, 2581, 5, - 117, 0, 0, 2581, 2582, 3, 72, 36, 0, 2582, 433, 1, 0, 0, 0, 2583, 2584, 5, 65, 0, 0, 2584, 2585, 3, 436, 218, 0, - 2585, 435, 1, 0, 0, 0, 2586, 2591, 3, 314, 157, 0, 2587, 2588, 5, 152, 0, 0, 2588, 2590, 3, 314, 157, 0, 2589, 2587, - 1, 0, 0, 0, 2590, 2593, 1, 0, 0, 0, 2591, 2589, 1, 0, 0, 0, 2591, 2592, 1, 0, 0, 0, 2592, 437, 1, 0, 0, 0, 2593, - 2591, 1, 0, 0, 0, 2594, 2595, 5, 164, 0, 0, 2595, 2597, 5, 150, 0, 0, 2596, 2594, 1, 0, 0, 0, 2596, 2597, 1, 0, 0, - 0, 2597, 2598, 1, 0, 0, 0, 2598, 2600, 5, 18, 0, 0, 2599, 2601, 5, 50, 0, 0, 2600, 2599, 1, 0, 0, 0, 2600, 2601, 1, - 0, 0, 0, 2601, 2605, 1, 0, 0, 0, 2602, 2604, 3, 366, 183, 0, 2603, 2602, 1, 0, 0, 0, 2604, 2607, 1, 0, 0, 0, 2605, - 2603, 1, 0, 0, 0, 2605, 2606, 1, 0, 0, 0, 2606, 2608, 1, 0, 0, 0, 2607, 2605, 1, 0, 0, 0, 2608, 2612, 5, 17, 0, 0, - 2609, 2611, 3, 440, 220, 0, 2610, 2609, 1, 0, 0, 0, 2611, 2614, 1, 0, 0, 0, 2612, 2610, 1, 0, 0, 0, 2612, 2613, 1, - 0, 0, 0, 2613, 2615, 1, 0, 0, 0, 2614, 2612, 1, 0, 0, 0, 2615, 2617, 5, 33, 0, 0, 2616, 2618, 5, 18, 0, 0, 2617, - 2616, 1, 0, 0, 0, 2617, 2618, 1, 0, 0, 0, 2618, 2619, 1, 0, 0, 0, 2619, 2620, 5, 164, 0, 0, 2620, 2621, 5, 151, 0, - 0, 2621, 439, 1, 0, 0, 0, 2622, 2637, 3, 508, 254, 0, 2623, 2637, 3, 40, 20, 0, 2624, 2637, 3, 408, 204, 0, 2625, - 2637, 3, 442, 221, 0, 2626, 2637, 3, 504, 252, 0, 2627, 2637, 3, 362, 181, 0, 2628, 2637, 3, 242, 121, 0, 2629, - 2637, 3, 66, 33, 0, 2630, 2637, 3, 304, 152, 0, 2631, 2637, 3, 316, 158, 0, 2632, 2637, 3, 182, 91, 0, 2633, 2637, - 3, 412, 206, 0, 2634, 2637, 3, 318, 159, 0, 2635, 2637, 3, 438, 219, 0, 2636, 2622, 1, 0, 0, 0, 2636, 2623, 1, 0, 0, - 0, 2636, 2624, 1, 0, 0, 0, 2636, 2625, 1, 0, 0, 0, 2636, 2626, 1, 0, 0, 0, 2636, 2627, 1, 0, 0, 0, 2636, 2628, 1, 0, - 0, 0, 2636, 2629, 1, 0, 0, 0, 2636, 2630, 1, 0, 0, 0, 2636, 2631, 1, 0, 0, 0, 2636, 2632, 1, 0, 0, 0, 2636, 2633, 1, - 0, 0, 0, 2636, 2634, 1, 0, 0, 0, 2636, 2635, 1, 0, 0, 0, 2637, 441, 1, 0, 0, 0, 2638, 2639, 5, 164, 0, 0, 2639, - 2641, 5, 150, 0, 0, 2640, 2638, 1, 0, 0, 0, 2640, 2641, 1, 0, 0, 0, 2641, 2645, 1, 0, 0, 0, 2642, 2646, 3, 460, 230, - 0, 2643, 2646, 3, 104, 52, 0, 2644, 2646, 3, 426, 213, 0, 2645, 2642, 1, 0, 0, 0, 2645, 2643, 1, 0, 0, 0, 2645, - 2644, 1, 0, 0, 0, 2646, 443, 1, 0, 0, 0, 2647, 2648, 5, 93, 0, 0, 2648, 2649, 3, 238, 119, 0, 2649, 2650, 5, 150, 0, - 0, 2650, 2652, 3, 480, 240, 0, 2651, 2653, 7, 16, 0, 0, 2652, 2651, 1, 0, 0, 0, 2652, 2653, 1, 0, 0, 0, 2653, 2656, - 1, 0, 0, 0, 2654, 2655, 5, 142, 0, 0, 2655, 2657, 3, 184, 92, 0, 2656, 2654, 1, 0, 0, 0, 2656, 2657, 1, 0, 0, 0, - 2657, 2658, 1, 0, 0, 0, 2658, 2659, 5, 151, 0, 0, 2659, 445, 1, 0, 0, 0, 2660, 2665, 3, 314, 157, 0, 2661, 2662, 5, - 152, 0, 0, 2662, 2664, 3, 314, 157, 0, 2663, 2661, 1, 0, 0, 0, 2664, 2667, 1, 0, 0, 0, 2665, 2663, 1, 0, 0, 0, 2665, - 2666, 1, 0, 0, 0, 2666, 2671, 1, 0, 0, 0, 2667, 2665, 1, 0, 0, 0, 2668, 2671, 5, 68, 0, 0, 2669, 2671, 5, 10, 0, 0, - 2670, 2660, 1, 0, 0, 0, 2670, 2668, 1, 0, 0, 0, 2670, 2669, 1, 0, 0, 0, 2671, 447, 1, 0, 0, 0, 2672, 2681, 5, 146, - 0, 0, 2673, 2678, 3, 494, 247, 0, 2674, 2675, 5, 152, 0, 0, 2675, 2677, 3, 494, 247, 0, 2676, 2674, 1, 0, 0, 0, - 2677, 2680, 1, 0, 0, 0, 2678, 2676, 1, 0, 0, 0, 2678, 2679, 1, 0, 0, 0, 2679, 2682, 1, 0, 0, 0, 2680, 2678, 1, 0, 0, - 0, 2681, 2673, 1, 0, 0, 0, 2681, 2682, 1, 0, 0, 0, 2682, 2685, 1, 0, 0, 0, 2683, 2684, 5, 86, 0, 0, 2684, 2686, 3, - 494, 247, 0, 2685, 2683, 1, 0, 0, 0, 2685, 2686, 1, 0, 0, 0, 2686, 2687, 1, 0, 0, 0, 2687, 2688, 5, 147, 0, 0, 2688, - 449, 1, 0, 0, 0, 2689, 2690, 5, 37, 0, 0, 2690, 2691, 3, 80, 40, 0, 2691, 2692, 3, 52, 26, 0, 2692, 2696, 5, 151, 0, - 0, 2693, 2694, 5, 33, 0, 0, 2694, 2695, 5, 37, 0, 0, 2695, 2697, 5, 151, 0, 0, 2696, 2693, 1, 0, 0, 0, 2696, 2697, - 1, 0, 0, 0, 2697, 451, 1, 0, 0, 0, 2698, 2699, 3, 484, 242, 0, 2699, 2700, 5, 141, 0, 0, 2700, 2701, 5, 38, 0, 0, - 2701, 2702, 3, 212, 106, 0, 2702, 2703, 3, 102, 51, 0, 2703, 2704, 5, 151, 0, 0, 2704, 453, 1, 0, 0, 0, 2705, 2707, - 3, 306, 153, 0, 2706, 2705, 1, 0, 0, 0, 2706, 2707, 1, 0, 0, 0, 2707, 2708, 1, 0, 0, 0, 2708, 2710, 3, 292, 146, 0, - 2709, 2711, 5, 21, 0, 0, 2710, 2709, 1, 0, 0, 0, 2710, 2711, 1, 0, 0, 0, 2711, 2714, 1, 0, 0, 0, 2712, 2713, 5, 142, - 0, 0, 2713, 2715, 3, 100, 50, 0, 2714, 2712, 1, 0, 0, 0, 2714, 2715, 1, 0, 0, 0, 2715, 455, 1, 0, 0, 0, 2716, 2717, - 3, 184, 92, 0, 2717, 2718, 3, 136, 68, 0, 2718, 2719, 3, 184, 92, 0, 2719, 457, 1, 0, 0, 0, 2720, 2721, 3, 484, 242, - 0, 2721, 2722, 5, 141, 0, 0, 2722, 2723, 3, 212, 106, 0, 2723, 2724, 5, 151, 0, 0, 2724, 459, 1, 0, 0, 0, 2725, - 2729, 3, 462, 231, 0, 2726, 2729, 3, 452, 226, 0, 2727, 2729, 3, 458, 229, 0, 2728, 2725, 1, 0, 0, 0, 2728, 2726, 1, - 0, 0, 0, 2728, 2727, 1, 0, 0, 0, 2729, 461, 1, 0, 0, 0, 2730, 2731, 3, 484, 242, 0, 2731, 2733, 5, 141, 0, 0, 2732, - 2734, 3, 128, 64, 0, 2733, 2732, 1, 0, 0, 0, 2733, 2734, 1, 0, 0, 0, 2734, 2735, 1, 0, 0, 0, 2735, 2736, 3, 510, - 255, 0, 2736, 2737, 5, 151, 0, 0, 2737, 463, 1, 0, 0, 0, 2738, 2739, 3, 484, 242, 0, 2739, 2740, 5, 142, 0, 0, 2740, - 2741, 3, 102, 51, 0, 2741, 2742, 5, 151, 0, 0, 2742, 465, 1, 0, 0, 0, 2743, 2744, 3, 476, 238, 0, 2744, 2748, 5, 50, - 0, 0, 2745, 2747, 3, 470, 235, 0, 2746, 2745, 1, 0, 0, 0, 2747, 2750, 1, 0, 0, 0, 2748, 2746, 1, 0, 0, 0, 2748, - 2749, 1, 0, 0, 0, 2749, 2751, 1, 0, 0, 0, 2750, 2748, 1, 0, 0, 0, 2751, 2755, 5, 17, 0, 0, 2752, 2754, 3, 440, 220, - 0, 2753, 2752, 1, 0, 0, 0, 2754, 2757, 1, 0, 0, 0, 2755, 2753, 1, 0, 0, 0, 2755, 2756, 1, 0, 0, 0, 2756, 2758, 1, 0, - 0, 0, 2757, 2755, 1, 0, 0, 0, 2758, 2760, 5, 33, 0, 0, 2759, 2761, 3, 474, 237, 0, 2760, 2759, 1, 0, 0, 0, 2760, - 2761, 1, 0, 0, 0, 2761, 2763, 1, 0, 0, 0, 2762, 2764, 3, 134, 67, 0, 2763, 2762, 1, 0, 0, 0, 2763, 2764, 1, 0, 0, 0, - 2764, 2765, 1, 0, 0, 0, 2765, 2766, 5, 151, 0, 0, 2766, 467, 1, 0, 0, 0, 2767, 2768, 3, 476, 238, 0, 2768, 2769, 5, - 151, 0, 0, 2769, 469, 1, 0, 0, 0, 2770, 2786, 3, 468, 234, 0, 2771, 2786, 3, 466, 233, 0, 2772, 2786, 3, 472, 236, - 0, 2773, 2786, 3, 326, 163, 0, 2774, 2786, 3, 322, 161, 0, 2775, 2786, 3, 330, 165, 0, 2776, 2786, 3, 490, 245, 0, - 2777, 2786, 3, 478, 239, 0, 2778, 2786, 3, 116, 58, 0, 2779, 2786, 3, 506, 253, 0, 2780, 2786, 3, 198, 99, 0, 2781, - 2786, 3, 12, 6, 0, 2782, 2786, 3, 46, 23, 0, 2783, 2786, 3, 50, 25, 0, 2784, 2786, 3, 500, 250, 0, 2785, 2770, 1, 0, - 0, 0, 2785, 2771, 1, 0, 0, 0, 2785, 2772, 1, 0, 0, 0, 2785, 2773, 1, 0, 0, 0, 2785, 2774, 1, 0, 0, 0, 2785, 2775, 1, - 0, 0, 0, 2785, 2776, 1, 0, 0, 0, 2785, 2777, 1, 0, 0, 0, 2785, 2778, 1, 0, 0, 0, 2785, 2779, 1, 0, 0, 0, 2785, 2780, - 1, 0, 0, 0, 2785, 2781, 1, 0, 0, 0, 2785, 2782, 1, 0, 0, 0, 2785, 2783, 1, 0, 0, 0, 2785, 2784, 1, 0, 0, 0, 2786, - 471, 1, 0, 0, 0, 2787, 2788, 3, 474, 237, 0, 2788, 2789, 5, 164, 0, 0, 2789, 2790, 5, 50, 0, 0, 2790, 2791, 5, 59, - 0, 0, 2791, 2793, 3, 314, 157, 0, 2792, 2794, 3, 448, 224, 0, 2793, 2792, 1, 0, 0, 0, 2793, 2794, 1, 0, 0, 0, 2794, - 2796, 1, 0, 0, 0, 2795, 2797, 3, 234, 117, 0, 2796, 2795, 1, 0, 0, 0, 2796, 2797, 1, 0, 0, 0, 2797, 2798, 1, 0, 0, - 0, 2798, 2799, 5, 151, 0, 0, 2799, 473, 1, 0, 0, 0, 2800, 2801, 7, 17, 0, 0, 2801, 475, 1, 0, 0, 0, 2802, 2805, 3, - 364, 182, 0, 2803, 2805, 3, 224, 112, 0, 2804, 2802, 1, 0, 0, 0, 2804, 2803, 1, 0, 0, 0, 2805, 477, 1, 0, 0, 0, - 2806, 2807, 5, 98, 0, 0, 2807, 2808, 5, 164, 0, 0, 2808, 2809, 5, 50, 0, 0, 2809, 2810, 3, 480, 240, 0, 2810, 2811, - 5, 151, 0, 0, 2811, 479, 1, 0, 0, 0, 2812, 2814, 3, 410, 205, 0, 2813, 2812, 1, 0, 0, 0, 2813, 2814, 1, 0, 0, 0, - 2814, 2815, 1, 0, 0, 0, 2815, 2817, 3, 494, 247, 0, 2816, 2818, 3, 120, 60, 0, 2817, 2816, 1, 0, 0, 0, 2817, 2818, - 1, 0, 0, 0, 2818, 481, 1, 0, 0, 0, 2819, 2820, 7, 18, 0, 0, 2820, 483, 1, 0, 0, 0, 2821, 2824, 3, 314, 157, 0, 2822, - 2824, 3, 10, 5, 0, 2823, 2821, 1, 0, 0, 0, 2823, 2822, 1, 0, 0, 0, 2824, 485, 1, 0, 0, 0, 2825, 2826, 5, 37, 0, 0, - 2826, 2827, 3, 184, 92, 0, 2827, 487, 1, 0, 0, 0, 2828, 2829, 3, 494, 247, 0, 2829, 2830, 5, 144, 0, 0, 2830, 2831, - 3, 184, 92, 0, 2831, 2832, 5, 145, 0, 0, 2832, 489, 1, 0, 0, 0, 2833, 2836, 3, 220, 110, 0, 2834, 2836, 3, 246, 123, - 0, 2835, 2833, 1, 0, 0, 0, 2835, 2834, 1, 0, 0, 0, 2836, 491, 1, 0, 0, 0, 2837, 2844, 3, 416, 208, 0, 2838, 2844, 3, - 82, 41, 0, 2839, 2844, 3, 4, 2, 0, 2840, 2844, 3, 204, 102, 0, 2841, 2844, 3, 382, 191, 0, 2842, 2844, 3, 384, 192, - 0, 2843, 2837, 1, 0, 0, 0, 2843, 2838, 1, 0, 0, 0, 2843, 2839, 1, 0, 0, 0, 2843, 2840, 1, 0, 0, 0, 2843, 2841, 1, 0, - 0, 0, 2843, 2842, 1, 0, 0, 0, 2844, 493, 1, 0, 0, 0, 2845, 2846, 3, 314, 157, 0, 2846, 495, 1, 0, 0, 0, 2847, 2848, - 5, 13, 0, 0, 2848, 2849, 5, 144, 0, 0, 2849, 2854, 3, 254, 127, 0, 2850, 2851, 5, 152, 0, 0, 2851, 2853, 3, 254, - 127, 0, 2852, 2850, 1, 0, 0, 0, 2853, 2856, 1, 0, 0, 0, 2854, 2852, 1, 0, 0, 0, 2854, 2855, 1, 0, 0, 0, 2855, 2857, - 1, 0, 0, 0, 2856, 2854, 1, 0, 0, 0, 2857, 2858, 5, 145, 0, 0, 2858, 2859, 5, 64, 0, 0, 2859, 2860, 3, 480, 240, 0, - 2860, 497, 1, 0, 0, 0, 2861, 2862, 5, 104, 0, 0, 2862, 2863, 5, 50, 0, 0, 2863, 2864, 3, 248, 124, 0, 2864, 499, 1, - 0, 0, 0, 2865, 2866, 5, 108, 0, 0, 2866, 2871, 3, 424, 212, 0, 2867, 2868, 5, 152, 0, 0, 2868, 2870, 3, 424, 212, 0, - 2869, 2867, 1, 0, 0, 0, 2870, 2873, 1, 0, 0, 0, 2871, 2869, 1, 0, 0, 0, 2871, 2872, 1, 0, 0, 0, 2872, 2874, 1, 0, 0, - 0, 2873, 2871, 1, 0, 0, 0, 2874, 2875, 5, 151, 0, 0, 2875, 501, 1, 0, 0, 0, 2876, 2877, 5, 164, 0, 0, 2877, 2879, 5, - 150, 0, 0, 2878, 2876, 1, 0, 0, 0, 2878, 2879, 1, 0, 0, 0, 2879, 2880, 1, 0, 0, 0, 2880, 2881, 5, 86, 0, 0, 2881, - 2882, 3, 102, 51, 0, 2882, 2883, 5, 151, 0, 0, 2883, 503, 1, 0, 0, 0, 2884, 2885, 5, 164, 0, 0, 2885, 2887, 5, 150, - 0, 0, 2886, 2884, 1, 0, 0, 0, 2886, 2887, 1, 0, 0, 0, 2887, 2890, 1, 0, 0, 0, 2888, 2891, 3, 464, 232, 0, 2889, - 2891, 3, 428, 214, 0, 2890, 2888, 1, 0, 0, 0, 2890, 2889, 1, 0, 0, 0, 2891, 505, 1, 0, 0, 0, 2892, 2894, 5, 92, 0, - 0, 2893, 2892, 1, 0, 0, 0, 2893, 2894, 1, 0, 0, 0, 2894, 2895, 1, 0, 0, 0, 2895, 2896, 5, 109, 0, 0, 2896, 2897, 3, - 238, 119, 0, 2897, 2898, 5, 150, 0, 0, 2898, 2900, 3, 480, 240, 0, 2899, 2901, 3, 234, 117, 0, 2900, 2899, 1, 0, 0, - 0, 2900, 2901, 1, 0, 0, 0, 2901, 2904, 1, 0, 0, 0, 2902, 2903, 5, 142, 0, 0, 2903, 2905, 3, 184, 92, 0, 2904, 2902, - 1, 0, 0, 0, 2904, 2905, 1, 0, 0, 0, 2905, 2906, 1, 0, 0, 0, 2906, 2907, 5, 151, 0, 0, 2907, 507, 1, 0, 0, 0, 2908, - 2909, 5, 164, 0, 0, 2909, 2911, 5, 150, 0, 0, 2910, 2908, 1, 0, 0, 0, 2910, 2911, 1, 0, 0, 0, 2911, 2912, 1, 0, 0, - 0, 2912, 2914, 5, 115, 0, 0, 2913, 2915, 3, 434, 217, 0, 2914, 2913, 1, 0, 0, 0, 2914, 2915, 1, 0, 0, 0, 2915, 2917, - 1, 0, 0, 0, 2916, 2918, 3, 98, 49, 0, 2917, 2916, 1, 0, 0, 0, 2917, 2918, 1, 0, 0, 0, 2918, 2920, 1, 0, 0, 0, 2919, - 2921, 3, 486, 243, 0, 2920, 2919, 1, 0, 0, 0, 2920, 2921, 1, 0, 0, 0, 2921, 2922, 1, 0, 0, 0, 2922, 2923, 5, 151, 0, - 0, 2923, 509, 1, 0, 0, 0, 2924, 2929, 3, 512, 256, 0, 2925, 2926, 5, 152, 0, 0, 2926, 2928, 3, 512, 256, 0, 2927, - 2925, 1, 0, 0, 0, 2928, 2931, 1, 0, 0, 0, 2929, 2927, 1, 0, 0, 0, 2929, 2930, 1, 0, 0, 0, 2930, 2934, 1, 0, 0, 0, - 2931, 2929, 1, 0, 0, 0, 2932, 2934, 5, 105, 0, 0, 2933, 2924, 1, 0, 0, 0, 2933, 2932, 1, 0, 0, 0, 2934, 511, 1, 0, - 0, 0, 2935, 2938, 3, 184, 92, 0, 2936, 2937, 5, 8, 0, 0, 2937, 2939, 3, 184, 92, 0, 2938, 2936, 1, 0, 0, 0, 2938, - 2939, 1, 0, 0, 0, 2939, 2946, 1, 0, 0, 0, 2940, 2943, 5, 63, 0, 0, 2941, 2942, 5, 8, 0, 0, 2942, 2944, 3, 184, 92, - 0, 2943, 2941, 1, 0, 0, 0, 2943, 2944, 1, 0, 0, 0, 2944, 2946, 1, 0, 0, 0, 2945, 2935, 1, 0, 0, 0, 2945, 2940, 1, 0, - 0, 0, 2946, 513, 1, 0, 0, 0, 334, 524, 530, 538, 546, 555, 560, 571, 581, 588, 593, 596, 605, 610, 615, 618, 623, - 627, 633, 635, 651, 658, 667, 673, 677, 681, 689, 698, 719, 722, 725, 732, 738, 765, 773, 775, 784, 787, 793, 795, - 801, 803, 808, 815, 821, 828, 835, 846, 851, 857, 865, 870, 880, 887, 894, 902, 905, 914, 917, 920, 924, 927, 935, - 938, 949, 961, 964, 972, 975, 982, 985, 996, 999, 1006, 1009, 1014, 1019, 1022, 1036, 1044, 1048, 1053, 1068, 1073, - 1083, 1089, 1092, 1098, 1102, 1106, 1114, 1127, 1135, 1140, 1148, 1156, 1164, 1167, 1172, 1179, 1196, 1210, 1216, - 1225, 1229, 1236, 1243, 1248, 1256, 1259, 1264, 1271, 1274, 1278, 1281, 1303, 1307, 1314, 1319, 1329, 1341, 1348, - 1352, 1356, 1366, 1386, 1388, 1393, 1398, 1424, 1431, 1441, 1466, 1474, 1481, 1487, 1500, 1505, 1511, 1515, 1522, - 1527, 1532, 1536, 1541, 1547, 1558, 1579, 1587, 1595, 1603, 1609, 1613, 1618, 1624, 1632, 1641, 1646, 1653, 1656, - 1661, 1667, 1682, 1686, 1694, 1704, 1712, 1716, 1723, 1728, 1736, 1741, 1746, 1754, 1764, 1769, 1775, 1785, 1789, - 1804, 1809, 1815, 1818, 1827, 1831, 1835, 1841, 1845, 1848, 1853, 1858, 1864, 1872, 1884, 1891, 1895, 1898, 1904, - 1910, 1919, 1929, 1947, 1959, 1971, 1979, 1981, 1983, 1988, 1992, 1996, 2002, 2009, 2018, 2024, 2027, 2046, 2052, - 2057, 2062, 2065, 2085, 2093, 2104, 2111, 2126, 2137, 2148, 2154, 2158, 2163, 2174, 2197, 2206, 2209, 2213, 2221, - 2227, 2244, 2248, 2252, 2259, 2262, 2267, 2274, 2280, 2286, 2294, 2297, 2302, 2309, 2314, 2318, 2327, 2334, 2351, - 2357, 2363, 2371, 2375, 2380, 2390, 2395, 2406, 2419, 2430, 2437, 2443, 2449, 2455, 2462, 2468, 2477, 2481, 2489, - 2503, 2514, 2528, 2535, 2540, 2544, 2550, 2561, 2576, 2591, 2596, 2600, 2605, 2612, 2617, 2636, 2640, 2645, 2652, - 2656, 2665, 2670, 2678, 2681, 2685, 2696, 2706, 2710, 2714, 2728, 2733, 2748, 2755, 2760, 2763, 2785, 2793, 2796, - 2804, 2813, 2817, 2823, 2835, 2843, 2854, 2871, 2878, 2886, 2890, 2893, 2900, 2904, 2910, 2914, 2917, 2920, 2929, - 2933, 2938, 2943, 2945 + 7, 251, 2, 252, 7, 252, 2, 253, 7, 253, 2, 254, 7, 254, 2, 255, 7, 255, 2, 256, 7, 256, 2, 257, 7, 257, 1, 0, 1, 0, + 1, 0, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 3, 3, 3, 527, 8, 3, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 533, 8, 3, 1, 4, 1, + 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 541, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 5, 5, 547, 8, 5, 10, 5, 12, 5, 550, 9, 5, 1, 5, + 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 558, 8, 6, 1, 6, 1, 6, 1, 6, 3, 6, 563, 8, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, + 8, 1, 9, 1, 9, 1, 9, 3, 9, 574, 8, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 5, 10, 582, 8, 10, 10, 10, 12, 10, + 585, 9, 10, 1, 10, 1, 10, 5, 10, 589, 8, 10, 10, 10, 12, 10, 592, 9, 10, 1, 10, 1, 10, 3, 10, 596, 8, 10, 1, 10, 3, + 10, 599, 8, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 608, 8, 11, 1, 11, 1, 11, 1, 11, 3, 11, 613, + 8, 11, 1, 11, 1, 11, 1, 11, 3, 11, 618, 8, 11, 1, 11, 3, 11, 621, 8, 11, 1, 11, 1, 11, 1, 11, 3, 11, 626, 8, 11, 1, + 12, 1, 12, 3, 12, 630, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 636, 8, 12, 3, 12, 638, 8, 12, 1, 13, 1, 13, 1, 13, + 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 3, 14, 650, 8, 14, 1, 15, 1, 15, 1, 15, 5, 15, 655, 8, 15, 10, 15, + 12, 15, 658, 9, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 666, 8, 16, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, + 672, 8, 17, 1, 17, 1, 17, 3, 17, 676, 8, 17, 1, 18, 1, 18, 3, 18, 680, 8, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, + 19, 3, 19, 688, 8, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 5, 20, 695, 8, 20, 10, 20, 12, 20, 698, 9, 20, 1, 21, 1, + 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, + 3, 24, 718, 8, 24, 1, 24, 3, 24, 721, 8, 24, 1, 24, 3, 24, 724, 8, 24, 1, 25, 1, 25, 1, 25, 5, 25, 729, 8, 25, 10, + 25, 12, 25, 732, 9, 25, 1, 25, 5, 25, 735, 8, 25, 10, 25, 12, 25, 738, 9, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, + 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, + 1, 26, 1, 26, 1, 26, 1, 26, 3, 26, 766, 8, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 3, 27, 774, 8, 27, 3, 27, + 776, 8, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 3, 28, 785, 8, 28, 1, 28, 3, 28, 788, 8, 28, 1, 28, 1, + 28, 1, 28, 1, 28, 3, 28, 794, 8, 28, 3, 28, 796, 8, 28, 1, 28, 1, 28, 1, 28, 1, 28, 3, 28, 802, 8, 28, 3, 28, 804, + 8, 28, 1, 28, 5, 28, 807, 8, 28, 10, 28, 12, 28, 810, 9, 28, 1, 28, 1, 28, 5, 28, 814, 8, 28, 10, 28, 12, 28, 817, + 9, 28, 1, 28, 1, 28, 1, 28, 3, 28, 822, 8, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 3, 29, 829, 8, 29, 1, 29, 1, 29, + 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 4, 30, 841, 8, 30, 11, 30, 12, 30, 842, 1, 30, 1, 30, 1, 30, + 3, 30, 848, 8, 30, 1, 30, 1, 30, 1, 31, 1, 31, 3, 31, 854, 8, 31, 1, 31, 1, 31, 1, 31, 1, 31, 4, 31, 860, 8, 31, 11, + 31, 12, 31, 861, 1, 31, 1, 31, 1, 31, 3, 31, 867, 8, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 5, 32, 875, 8, + 32, 10, 32, 12, 32, 878, 9, 32, 1, 33, 1, 33, 1, 33, 3, 33, 883, 8, 33, 1, 34, 1, 34, 1, 34, 5, 34, 888, 8, 34, 10, + 34, 12, 34, 891, 9, 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 3, 35, 898, 8, 35, 1, 35, 3, 35, 901, 8, 35, 1, 35, 1, + 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 3, 36, 910, 8, 36, 1, 36, 3, 36, 913, 8, 36, 1, 36, 3, 36, 916, 8, 36, 1, 36, + 1, 36, 3, 36, 920, 8, 36, 1, 36, 3, 36, 923, 8, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 3, 37, 931, 8, 37, 1, + 37, 3, 37, 934, 8, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 3, 39, 945, 8, 39, 1, 40, 1, + 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 3, 41, 957, 8, 41, 1, 41, 3, 41, 960, 8, 41, 1, 41, 1, + 41, 1, 41, 1, 42, 1, 42, 1, 42, 3, 42, 968, 8, 42, 1, 42, 3, 42, 971, 8, 42, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 3, + 43, 978, 8, 43, 1, 43, 3, 43, 981, 8, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 3, 44, 992, + 8, 44, 1, 44, 3, 44, 995, 8, 44, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 3, 45, 1002, 8, 45, 1, 45, 3, 45, 1005, 8, 45, + 1, 45, 1, 45, 1, 45, 3, 45, 1010, 8, 45, 1, 46, 1, 46, 1, 46, 3, 46, 1015, 8, 46, 1, 46, 3, 46, 1018, 8, 46, 1, 46, + 1, 46, 1, 46, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 3, 47, 1028, 8, 47, 1, 47, 1, 47, 1, 47, 3, 47, 1033, 8, 47, 1, 47, + 1, 47, 1, 47, 3, 47, 1038, 8, 47, 1, 47, 3, 47, 1041, 8, 47, 1, 47, 1, 47, 1, 47, 3, 47, 1046, 8, 47, 1, 48, 1, 48, + 1, 48, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 3, 49, 1057, 8, 49, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 3, + 50, 1065, 8, 50, 1, 50, 1, 50, 3, 50, 1069, 8, 50, 1, 51, 1, 51, 1, 51, 3, 51, 1074, 8, 51, 1, 51, 1, 51, 1, 51, 1, + 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 5, 52, 1087, 8, 52, 10, 52, 12, 52, 1090, 9, 52, 1, 52, 1, 52, + 3, 52, 1094, 8, 52, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 5, 53, 1102, 8, 53, 10, 53, 12, 53, 1105, 9, 53, 1, + 53, 1, 53, 1, 53, 3, 53, 1110, 8, 53, 1, 53, 3, 53, 1113, 8, 53, 1, 53, 1, 53, 1, 54, 1, 54, 1, 54, 3, 54, 1120, 8, + 54, 1, 55, 1, 55, 3, 55, 1124, 8, 55, 1, 56, 1, 56, 3, 56, 1128, 8, 56, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 3, + 57, 1136, 8, 57, 1, 57, 1, 57, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 59, 1, 59, 1, 59, 1, 59, 3, 59, 1149, 8, 59, 1, + 60, 1, 60, 1, 60, 1, 60, 5, 60, 1155, 8, 60, 10, 60, 12, 60, 1158, 9, 60, 1, 60, 1, 60, 3, 60, 1162, 8, 60, 1, 60, + 1, 60, 1, 60, 1, 61, 1, 61, 1, 61, 3, 61, 1170, 8, 61, 1, 62, 1, 62, 1, 62, 1, 62, 5, 62, 1176, 8, 62, 10, 62, 12, + 62, 1179, 9, 62, 1, 62, 1, 62, 1, 63, 1, 63, 1, 63, 3, 63, 1186, 8, 63, 1, 63, 3, 63, 1189, 8, 63, 1, 64, 4, 64, + 1192, 8, 64, 11, 64, 12, 64, 1193, 1, 64, 1, 64, 1, 65, 5, 65, 1199, 8, 65, 10, 65, 12, 65, 1202, 9, 65, 1, 65, 1, + 65, 1, 66, 1, 66, 1, 67, 1, 67, 1, 68, 1, 68, 1, 68, 1, 68, 1, 68, 1, 68, 1, 69, 1, 69, 3, 69, 1218, 8, 69, 1, 70, + 1, 70, 1, 70, 1, 70, 1, 71, 1, 71, 1, 71, 1, 71, 1, 71, 1, 72, 1, 72, 1, 72, 3, 72, 1232, 8, 72, 1, 72, 1, 72, 1, + 73, 1, 73, 3, 73, 1238, 8, 73, 1, 74, 1, 74, 1, 74, 1, 74, 1, 74, 1, 75, 1, 75, 3, 75, 1247, 8, 75, 1, 76, 1, 76, 3, + 76, 1251, 8, 76, 1, 77, 1, 77, 1, 77, 1, 78, 1, 78, 3, 78, 1258, 8, 78, 1, 79, 1, 79, 1, 79, 1, 79, 1, 79, 3, 79, + 1265, 8, 79, 1, 79, 1, 79, 1, 79, 3, 79, 1270, 8, 79, 1, 80, 1, 80, 1, 81, 1, 81, 3, 81, 1276, 8, 81, 1, 82, 1, 82, + 1, 82, 1, 82, 3, 82, 1282, 8, 82, 1, 82, 3, 82, 1285, 8, 82, 1, 82, 5, 82, 1288, 8, 82, 10, 82, 12, 82, 1291, 9, 82, + 1, 82, 1, 82, 5, 82, 1295, 8, 82, 10, 82, 12, 82, 1298, 9, 82, 3, 82, 1300, 8, 82, 1, 82, 1, 82, 3, 82, 1304, 8, 82, + 1, 82, 3, 82, 1307, 8, 82, 1, 82, 1, 82, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, + 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 3, 83, 1331, 8, 83, 1, 84, 1, 84, 3, 84, 1335, 8, + 84, 1, 85, 1, 85, 1, 85, 5, 85, 1340, 8, 85, 10, 85, 12, 85, 1343, 9, 85, 1, 85, 1, 85, 3, 85, 1347, 8, 85, 1, 86, + 1, 86, 1, 86, 1, 86, 1, 87, 1, 87, 1, 87, 1, 87, 3, 87, 1357, 8, 87, 1, 88, 1, 88, 1, 89, 1, 89, 1, 90, 1, 90, 1, + 90, 1, 90, 5, 90, 1367, 8, 90, 10, 90, 12, 90, 1370, 9, 90, 1, 90, 1, 90, 1, 91, 1, 91, 3, 91, 1376, 8, 91, 1, 91, + 1, 91, 3, 91, 1380, 8, 91, 1, 91, 1, 91, 3, 91, 1384, 8, 91, 1, 91, 1, 91, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, + 3, 92, 1394, 8, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, + 92, 1, 92, 1, 92, 1, 92, 1, 92, 5, 92, 1414, 8, 92, 10, 92, 12, 92, 1417, 9, 92, 1, 93, 1, 93, 3, 93, 1421, 8, 93, + 1, 94, 1, 94, 1, 94, 3, 94, 1426, 8, 94, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 96, 1, 96, 1, 96, 1, + 96, 1, 96, 1, 96, 1, 96, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 98, 1, 98, 1, 98, 3, 98, 1452, 8, 98, + 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 3, 99, 1459, 8, 99, 1, 99, 1, 99, 1, 100, 1, 100, 1, 100, 1, 100, 1, 101, 1, 101, + 3, 101, 1469, 8, 101, 1, 101, 1, 101, 1, 101, 1, 102, 1, 102, 1, 102, 1, 102, 1, 103, 1, 103, 1, 103, 1, 103, 1, + 103, 1, 104, 1, 104, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 5, 105, 1491, 8, 105, 10, 105, 12, 105, 1494, + 9, 105, 1, 105, 3, 105, 1497, 8, 105, 1, 105, 5, 105, 1500, 8, 105, 10, 105, 12, 105, 1503, 9, 105, 1, 105, 1, 105, + 1, 105, 3, 105, 1508, 8, 105, 1, 105, 1, 105, 1, 106, 1, 106, 3, 106, 1514, 8, 106, 1, 107, 1, 107, 1, 108, 1, 108, + 1, 108, 3, 108, 1521, 8, 108, 1, 108, 1, 108, 1, 108, 1, 108, 3, 108, 1527, 8, 108, 1, 109, 1, 109, 1, 109, 1, 109, + 1, 109, 1, 109, 1, 110, 1, 110, 1, 110, 1, 110, 1, 111, 3, 111, 1540, 8, 111, 1, 111, 1, 111, 1, 111, 3, 111, 1545, + 8, 111, 1, 111, 1, 111, 1, 111, 1, 111, 3, 111, 1551, 8, 111, 1, 111, 1, 111, 1, 111, 3, 111, 1556, 8, 111, 1, 111, + 1, 111, 1, 112, 1, 112, 1, 112, 3, 112, 1563, 8, 112, 1, 113, 1, 113, 1, 113, 3, 113, 1568, 8, 113, 1, 114, 5, 114, + 1571, 8, 114, 10, 114, 12, 114, 1574, 9, 114, 1, 114, 3, 114, 1577, 8, 114, 1, 114, 5, 114, 1580, 8, 114, 10, 114, + 12, 114, 1583, 9, 114, 1, 114, 1, 114, 3, 114, 1587, 8, 114, 1, 114, 3, 114, 1590, 8, 114, 1, 115, 1, 115, 1, 115, + 1, 115, 1, 115, 5, 115, 1597, 8, 115, 10, 115, 12, 115, 1600, 9, 115, 1, 115, 3, 115, 1603, 8, 115, 1, 115, 1, 115, + 1, 115, 1, 116, 1, 116, 1, 116, 1, 116, 1, 116, 1, 116, 1, 117, 1, 117, 3, 117, 1616, 8, 117, 1, 118, 1, 118, 1, + 118, 1, 118, 1, 118, 1, 118, 1, 118, 1, 118, 5, 118, 1626, 8, 118, 10, 118, 12, 118, 1629, 9, 118, 1, 118, 1, 118, + 1, 118, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 5, 119, 1641, 8, 119, 10, 119, 12, 119, 1644, 9, + 119, 1, 119, 1, 119, 1, 119, 1, 120, 1, 120, 1, 120, 1, 120, 1, 121, 1, 121, 1, 121, 5, 121, 1656, 8, 121, 10, 121, + 12, 121, 1659, 9, 121, 1, 122, 1, 122, 1, 122, 1, 122, 1, 122, 3, 122, 1666, 8, 122, 1, 122, 1, 122, 1, 122, 1, 122, + 1, 122, 1, 122, 3, 122, 1674, 8, 122, 1, 122, 1, 122, 1, 122, 1, 122, 5, 122, 1680, 8, 122, 10, 122, 12, 122, 1683, + 9, 122, 1, 122, 1, 122, 1, 122, 3, 122, 1688, 8, 122, 1, 122, 1, 122, 3, 122, 1692, 8, 122, 1, 122, 1, 122, 1, 122, + 3, 122, 1697, 8, 122, 1, 122, 1, 122, 1, 123, 1, 123, 3, 123, 1703, 8, 123, 1, 123, 1, 123, 1, 123, 1, 123, 5, 123, + 1709, 8, 123, 10, 123, 12, 123, 1712, 9, 123, 1, 123, 1, 123, 1, 123, 1, 123, 5, 123, 1718, 8, 123, 10, 123, 12, + 123, 1721, 9, 123, 5, 123, 1723, 8, 123, 10, 123, 12, 123, 1726, 9, 123, 1, 123, 1, 123, 5, 123, 1730, 8, 123, 10, + 123, 12, 123, 1733, 9, 123, 3, 123, 1735, 8, 123, 1, 123, 1, 123, 1, 123, 3, 123, 1740, 8, 123, 1, 123, 1, 123, 1, + 124, 1, 124, 3, 124, 1746, 8, 124, 1, 125, 1, 125, 1, 125, 1, 125, 1, 126, 1, 126, 1, 126, 1, 126, 1, 126, 1, 126, + 1, 126, 1, 126, 1, 126, 3, 126, 1761, 8, 126, 1, 127, 1, 127, 3, 127, 1765, 8, 127, 1, 128, 1, 128, 1, 128, 1, 128, + 5, 128, 1771, 8, 128, 10, 128, 12, 128, 1774, 9, 128, 1, 128, 1, 128, 1, 129, 1, 129, 1, 129, 1, 129, 1, 130, 3, + 130, 1783, 8, 130, 1, 130, 1, 130, 1, 130, 1, 130, 1, 130, 1, 130, 3, 130, 1791, 8, 130, 1, 130, 1, 130, 3, 130, + 1795, 8, 130, 1, 131, 1, 131, 1, 131, 5, 131, 1800, 8, 131, 10, 131, 12, 131, 1803, 9, 131, 1, 131, 1, 131, 3, 131, + 1807, 8, 131, 1, 132, 1, 132, 1, 132, 1, 133, 1, 133, 1, 134, 3, 134, 1815, 8, 134, 1, 134, 1, 134, 1, 134, 3, 134, + 1820, 8, 134, 1, 134, 1, 134, 1, 134, 3, 134, 1825, 8, 134, 1, 135, 1, 135, 1, 135, 1, 135, 1, 135, 1, 135, 3, 135, + 1833, 8, 135, 1, 136, 1, 136, 1, 137, 1, 137, 1, 137, 1, 137, 1, 137, 1, 138, 3, 138, 1843, 8, 138, 1, 138, 1, 138, + 1, 138, 3, 138, 1848, 8, 138, 1, 138, 1, 138, 1, 138, 1, 138, 3, 138, 1854, 8, 138, 1, 138, 1, 138, 1, 138, 1, 139, + 1, 139, 1, 139, 5, 139, 1862, 8, 139, 10, 139, 12, 139, 1865, 9, 139, 1, 139, 3, 139, 1868, 8, 139, 1, 140, 1, 140, + 1, 140, 1, 140, 1, 140, 1, 140, 1, 140, 1, 141, 1, 141, 1, 141, 1, 141, 1, 141, 1, 141, 3, 141, 1883, 8, 141, 1, + 142, 1, 142, 1, 142, 3, 142, 1888, 8, 142, 1, 142, 1, 142, 1, 142, 1, 142, 3, 142, 1894, 8, 142, 1, 143, 3, 143, + 1897, 8, 143, 1, 143, 1, 143, 1, 143, 1, 143, 1, 144, 1, 144, 1, 144, 3, 144, 1906, 8, 144, 1, 145, 1, 145, 3, 145, + 1910, 8, 145, 1, 146, 1, 146, 3, 146, 1914, 8, 146, 1, 147, 1, 147, 1, 147, 1, 147, 3, 147, 1920, 8, 147, 1, 148, 1, + 148, 3, 148, 1924, 8, 148, 1, 149, 3, 149, 1927, 8, 149, 1, 149, 1, 149, 1, 149, 3, 149, 1932, 8, 149, 1, 149, 1, + 149, 1, 149, 3, 149, 1937, 8, 149, 1, 150, 1, 150, 1, 150, 1, 150, 3, 150, 1943, 8, 150, 1, 151, 1, 151, 1, 151, 1, + 151, 5, 151, 1949, 8, 151, 10, 151, 12, 151, 1952, 9, 151, 1, 151, 1, 151, 1, 152, 1, 152, 1, 152, 1, 152, 1, 152, + 1, 152, 1, 152, 3, 152, 1963, 8, 152, 1, 153, 1, 153, 1, 153, 1, 153, 1, 153, 3, 153, 1970, 8, 153, 1, 154, 1, 154, + 3, 154, 1974, 8, 154, 1, 154, 3, 154, 1977, 8, 154, 1, 154, 1, 154, 5, 154, 1981, 8, 154, 10, 154, 12, 154, 1984, 9, + 154, 1, 154, 1, 154, 1, 154, 3, 154, 1989, 8, 154, 1, 154, 1, 154, 1, 155, 1, 155, 1, 156, 1, 156, 1, 156, 3, 156, + 1998, 8, 156, 1, 157, 1, 157, 1, 157, 1, 157, 1, 157, 1, 157, 5, 157, 2006, 8, 157, 10, 157, 12, 157, 2009, 9, 157, + 1, 157, 1, 157, 1, 157, 3, 157, 2014, 8, 157, 1, 157, 1, 157, 1, 158, 1, 158, 1, 158, 1, 158, 1, 158, 1, 159, 1, + 159, 1, 159, 1, 159, 1, 159, 3, 159, 2028, 8, 159, 1, 159, 1, 159, 1, 159, 1, 159, 1, 159, 1, 159, 1, 159, 1, 159, + 5, 159, 2038, 8, 159, 10, 159, 12, 159, 2041, 9, 159, 1, 159, 1, 159, 1, 159, 1, 159, 1, 159, 1, 159, 1, 159, 1, + 159, 1, 159, 3, 159, 2052, 8, 159, 1, 159, 1, 159, 1, 159, 1, 159, 1, 159, 1, 159, 3, 159, 2060, 8, 159, 5, 159, + 2062, 8, 159, 10, 159, 12, 159, 2065, 9, 159, 1, 160, 1, 160, 3, 160, 2069, 8, 160, 1, 160, 1, 160, 3, 160, 2073, 8, + 160, 1, 160, 1, 160, 3, 160, 2077, 8, 160, 1, 160, 1, 160, 1, 161, 1, 161, 3, 161, 2083, 8, 161, 1, 161, 1, 161, 1, + 161, 1, 162, 1, 162, 3, 162, 2090, 8, 162, 1, 163, 1, 163, 1, 163, 1, 163, 1, 163, 5, 163, 2097, 8, 163, 10, 163, + 12, 163, 2100, 9, 163, 1, 163, 1, 163, 1, 163, 3, 163, 2105, 8, 163, 1, 163, 3, 163, 2108, 8, 163, 1, 163, 1, 163, + 1, 164, 1, 164, 1, 164, 1, 164, 1, 164, 1, 164, 1, 164, 1, 164, 1, 164, 1, 164, 1, 164, 1, 164, 1, 164, 1, 164, 1, + 164, 1, 164, 1, 164, 3, 164, 2129, 8, 164, 1, 165, 1, 165, 1, 165, 1, 165, 3, 165, 2135, 8, 165, 1, 165, 5, 165, + 2138, 8, 165, 10, 165, 12, 165, 2141, 9, 165, 1, 165, 1, 165, 3, 165, 2145, 8, 165, 1, 165, 3, 165, 2148, 8, 165, 1, + 165, 1, 165, 1, 166, 1, 166, 1, 166, 1, 166, 1, 166, 1, 166, 1, 166, 1, 166, 1, 166, 1, 166, 1, 166, 1, 166, 1, 166, + 1, 166, 1, 166, 1, 166, 1, 166, 1, 166, 3, 166, 2170, 8, 166, 1, 167, 1, 167, 1, 167, 1, 167, 1, 167, 1, 167, 3, + 167, 2178, 8, 167, 1, 167, 1, 167, 1, 168, 1, 168, 1, 168, 1, 168, 1, 168, 5, 168, 2187, 8, 168, 10, 168, 12, 168, + 2190, 9, 168, 1, 168, 1, 168, 1, 169, 1, 169, 3, 169, 2196, 8, 169, 1, 169, 1, 169, 1, 169, 1, 169, 1, 170, 1, 170, + 1, 170, 1, 170, 1, 171, 1, 171, 1, 171, 5, 171, 2209, 8, 171, 10, 171, 12, 171, 2212, 9, 171, 1, 171, 1, 171, 1, + 172, 1, 172, 1, 173, 1, 173, 1, 173, 1, 174, 3, 174, 2222, 8, 174, 1, 174, 1, 174, 1, 175, 1, 175, 1, 175, 1, 175, + 1, 175, 5, 175, 2231, 8, 175, 10, 175, 12, 175, 2234, 9, 175, 1, 175, 1, 175, 1, 175, 3, 175, 2239, 8, 175, 1, 176, + 1, 176, 3, 176, 2243, 8, 176, 1, 176, 1, 176, 1, 176, 3, 176, 2248, 8, 176, 1, 176, 1, 176, 1, 177, 1, 177, 1, 177, + 1, 177, 1, 177, 5, 177, 2257, 8, 177, 10, 177, 12, 177, 2260, 9, 177, 1, 177, 3, 177, 2263, 8, 177, 1, 177, 1, 177, + 1, 177, 1, 178, 1, 178, 1, 178, 1, 178, 1, 178, 1, 178, 1, 179, 1, 179, 1, 179, 1, 179, 1, 179, 1, 179, 1, 179, 1, + 179, 1, 179, 1, 179, 1, 179, 3, 179, 2285, 8, 179, 1, 180, 1, 180, 1, 180, 1, 181, 1, 181, 1, 182, 1, 182, 3, 182, + 2294, 8, 182, 1, 182, 3, 182, 2297, 8, 182, 1, 183, 1, 183, 3, 183, 2301, 8, 183, 1, 183, 1, 183, 1, 183, 1, 184, 1, + 184, 1, 184, 3, 184, 2309, 8, 184, 1, 184, 1, 184, 1, 184, 1, 184, 3, 184, 2315, 8, 184, 1, 185, 1, 185, 1, 185, 1, + 185, 1, 185, 1, 185, 1, 185, 1, 185, 1, 185, 1, 185, 1, 185, 1, 185, 1, 185, 1, 185, 1, 185, 1, 185, 1, 185, 3, 185, + 2334, 8, 185, 1, 186, 1, 186, 3, 186, 2338, 8, 186, 1, 187, 1, 187, 3, 187, 2342, 8, 187, 1, 187, 1, 187, 1, 187, 1, + 187, 1, 187, 3, 187, 2349, 8, 187, 1, 187, 3, 187, 2352, 8, 187, 1, 187, 5, 187, 2355, 8, 187, 10, 187, 12, 187, + 2358, 9, 187, 1, 187, 1, 187, 5, 187, 2362, 8, 187, 10, 187, 12, 187, 2365, 9, 187, 1, 187, 1, 187, 1, 187, 3, 187, + 2370, 8, 187, 1, 187, 1, 187, 1, 188, 1, 188, 3, 188, 2376, 8, 188, 1, 188, 1, 188, 1, 188, 1, 188, 1, 188, 1, 188, + 3, 188, 2384, 8, 188, 1, 188, 3, 188, 2387, 8, 188, 1, 188, 5, 188, 2390, 8, 188, 10, 188, 12, 188, 2393, 9, 188, 1, + 188, 1, 188, 5, 188, 2397, 8, 188, 10, 188, 12, 188, 2400, 9, 188, 1, 188, 1, 188, 3, 188, 2404, 8, 188, 1, 188, 1, + 188, 3, 188, 2408, 8, 188, 1, 188, 1, 188, 1, 189, 1, 189, 1, 189, 5, 189, 2415, 8, 189, 10, 189, 12, 189, 2418, 9, + 189, 1, 189, 1, 189, 1, 189, 1, 189, 3, 189, 2424, 8, 189, 1, 190, 1, 190, 1, 190, 1, 190, 1, 190, 1, 190, 1, 190, + 1, 190, 1, 190, 1, 190, 1, 190, 1, 190, 1, 190, 1, 190, 1, 190, 1, 190, 1, 190, 3, 190, 2443, 8, 190, 1, 191, 1, + 191, 5, 191, 2447, 8, 191, 10, 191, 12, 191, 2450, 9, 191, 1, 191, 1, 191, 1, 191, 3, 191, 2455, 8, 191, 1, 192, 1, + 192, 1, 192, 1, 192, 1, 192, 1, 192, 3, 192, 2463, 8, 192, 1, 193, 1, 193, 3, 193, 2467, 8, 193, 1, 194, 1, 194, 1, + 194, 3, 194, 2472, 8, 194, 1, 195, 1, 195, 1, 195, 1, 195, 1, 195, 1, 195, 1, 195, 1, 195, 3, 195, 2482, 8, 195, 1, + 196, 1, 196, 1, 196, 3, 196, 2487, 8, 196, 1, 197, 1, 197, 1, 197, 1, 198, 1, 198, 1, 198, 1, 198, 5, 198, 2496, 8, + 198, 10, 198, 12, 198, 2499, 9, 198, 1, 198, 1, 198, 1, 199, 1, 199, 1, 199, 1, 200, 1, 200, 1, 200, 5, 200, 2509, + 8, 200, 10, 200, 12, 200, 2512, 9, 200, 1, 201, 1, 201, 1, 201, 1, 202, 1, 202, 1, 202, 5, 202, 2520, 8, 202, 10, + 202, 12, 202, 2523, 9, 202, 1, 203, 1, 203, 5, 203, 2527, 8, 203, 10, 203, 12, 203, 2530, 9, 203, 1, 203, 1, 203, 1, + 203, 3, 203, 2535, 8, 203, 1, 204, 1, 204, 1, 204, 1, 204, 3, 204, 2541, 8, 204, 1, 205, 1, 205, 5, 205, 2545, 8, + 205, 10, 205, 12, 205, 2548, 9, 205, 1, 205, 1, 205, 1, 206, 1, 206, 3, 206, 2554, 8, 206, 1, 206, 1, 206, 1, 206, + 1, 206, 3, 206, 2560, 8, 206, 1, 206, 1, 206, 1, 207, 1, 207, 1, 207, 1, 207, 1, 207, 3, 207, 2569, 8, 207, 1, 208, + 1, 208, 3, 208, 2573, 8, 208, 1, 209, 1, 209, 1, 210, 1, 210, 1, 210, 1, 210, 3, 210, 2581, 8, 210, 1, 211, 1, 211, + 1, 211, 3, 211, 2586, 8, 211, 1, 211, 1, 211, 1, 211, 1, 212, 1, 212, 1, 212, 1, 212, 1, 212, 5, 212, 2596, 8, 212, + 10, 212, 12, 212, 2599, 9, 212, 1, 212, 1, 212, 1, 212, 1, 212, 1, 213, 1, 213, 1, 213, 1, 213, 3, 213, 2609, 8, + 213, 1, 213, 1, 213, 1, 213, 1, 213, 1, 213, 1, 213, 1, 213, 1, 214, 1, 214, 1, 214, 4, 214, 2621, 8, 214, 11, 214, + 12, 214, 2622, 1, 214, 1, 214, 1, 214, 5, 214, 2628, 8, 214, 10, 214, 12, 214, 2631, 9, 214, 1, 214, 1, 214, 3, 214, + 2635, 8, 214, 1, 215, 1, 215, 3, 215, 2639, 8, 215, 1, 216, 1, 216, 1, 216, 1, 216, 3, 216, 2645, 8, 216, 1, 216, 1, + 216, 1, 216, 1, 216, 1, 216, 1, 217, 1, 217, 1, 217, 1, 217, 3, 217, 2656, 8, 217, 1, 217, 1, 217, 1, 217, 1, 217, + 1, 217, 1, 217, 1, 218, 1, 218, 1, 218, 1, 218, 1, 218, 5, 218, 2669, 8, 218, 10, 218, 12, 218, 2672, 9, 218, 1, + 218, 1, 218, 1, 218, 1, 218, 1, 219, 1, 219, 1, 219, 1, 220, 1, 220, 1, 220, 5, 220, 2684, 8, 220, 10, 220, 12, 220, + 2687, 9, 220, 1, 221, 1, 221, 3, 221, 2691, 8, 221, 1, 221, 1, 221, 3, 221, 2695, 8, 221, 1, 221, 5, 221, 2698, 8, + 221, 10, 221, 12, 221, 2701, 9, 221, 1, 221, 1, 221, 5, 221, 2705, 8, 221, 10, 221, 12, 221, 2708, 9, 221, 1, 221, + 1, 221, 3, 221, 2712, 8, 221, 1, 221, 3, 221, 2715, 8, 221, 1, 221, 1, 221, 1, 222, 1, 222, 1, 222, 1, 222, 1, 222, + 1, 222, 1, 222, 1, 222, 1, 222, 1, 222, 1, 222, 1, 222, 1, 222, 1, 222, 3, 222, 2733, 8, 222, 1, 223, 1, 223, 3, + 223, 2737, 8, 223, 1, 223, 1, 223, 1, 223, 3, 223, 2742, 8, 223, 1, 224, 1, 224, 1, 224, 1, 224, 1, 224, 3, 224, + 2749, 8, 224, 1, 224, 1, 224, 3, 224, 2753, 8, 224, 1, 224, 1, 224, 1, 225, 1, 225, 1, 225, 5, 225, 2760, 8, 225, + 10, 225, 12, 225, 2763, 9, 225, 1, 225, 1, 225, 3, 225, 2767, 8, 225, 1, 226, 1, 226, 1, 226, 1, 226, 5, 226, 2773, + 8, 226, 10, 226, 12, 226, 2776, 9, 226, 3, 226, 2778, 8, 226, 1, 226, 1, 226, 3, 226, 2782, 8, 226, 1, 226, 1, 226, + 1, 227, 1, 227, 1, 227, 1, 227, 1, 227, 1, 227, 1, 227, 3, 227, 2793, 8, 227, 1, 228, 1, 228, 1, 228, 1, 228, 1, + 228, 1, 228, 1, 228, 1, 229, 3, 229, 2803, 8, 229, 1, 229, 1, 229, 3, 229, 2807, 8, 229, 1, 229, 1, 229, 3, 229, + 2811, 8, 229, 1, 230, 1, 230, 1, 230, 1, 230, 1, 231, 1, 231, 1, 231, 1, 231, 1, 231, 1, 232, 1, 232, 1, 232, 3, + 232, 2825, 8, 232, 1, 233, 1, 233, 1, 233, 3, 233, 2830, 8, 233, 1, 233, 1, 233, 1, 233, 1, 234, 1, 234, 1, 234, 1, + 234, 1, 234, 1, 235, 1, 235, 1, 235, 5, 235, 2843, 8, 235, 10, 235, 12, 235, 2846, 9, 235, 1, 235, 1, 235, 5, 235, + 2850, 8, 235, 10, 235, 12, 235, 2853, 9, 235, 1, 235, 1, 235, 3, 235, 2857, 8, 235, 1, 235, 3, 235, 2860, 8, 235, 1, + 235, 1, 235, 1, 236, 1, 236, 1, 236, 1, 237, 1, 237, 1, 237, 1, 237, 1, 237, 1, 237, 1, 237, 1, 237, 1, 237, 1, 237, + 1, 237, 1, 237, 1, 237, 1, 237, 1, 237, 1, 237, 1, 237, 3, 237, 2884, 8, 237, 1, 238, 1, 238, 1, 238, 1, 238, 1, + 238, 1, 238, 3, 238, 2892, 8, 238, 1, 238, 3, 238, 2895, 8, 238, 1, 238, 1, 238, 1, 239, 1, 239, 1, 240, 1, 240, 3, + 240, 2903, 8, 240, 1, 241, 1, 241, 1, 241, 1, 241, 1, 241, 1, 241, 1, 242, 3, 242, 2912, 8, 242, 1, 242, 1, 242, 3, + 242, 2916, 8, 242, 1, 243, 1, 243, 1, 244, 1, 244, 3, 244, 2922, 8, 244, 1, 245, 1, 245, 1, 245, 1, 246, 1, 246, 1, + 246, 1, 246, 1, 246, 1, 247, 1, 247, 3, 247, 2934, 8, 247, 1, 248, 1, 248, 1, 248, 1, 248, 1, 248, 1, 248, 3, 248, + 2942, 8, 248, 1, 249, 1, 249, 1, 249, 1, 249, 1, 249, 5, 249, 2949, 8, 249, 10, 249, 12, 249, 2952, 9, 249, 1, 249, + 1, 249, 1, 249, 1, 249, 1, 250, 1, 250, 1, 250, 1, 250, 1, 251, 1, 251, 1, 251, 1, 251, 5, 251, 2966, 8, 251, 10, + 251, 12, 251, 2969, 9, 251, 1, 251, 1, 251, 1, 252, 1, 252, 3, 252, 2975, 8, 252, 1, 252, 1, 252, 1, 252, 1, 252, 1, + 253, 1, 253, 3, 253, 2983, 8, 253, 1, 253, 1, 253, 3, 253, 2987, 8, 253, 1, 254, 3, 254, 2990, 8, 254, 1, 254, 1, + 254, 1, 254, 1, 254, 1, 254, 3, 254, 2997, 8, 254, 1, 254, 1, 254, 3, 254, 3001, 8, 254, 1, 254, 1, 254, 1, 255, 1, + 255, 3, 255, 3007, 8, 255, 1, 255, 1, 255, 3, 255, 3011, 8, 255, 1, 255, 3, 255, 3014, 8, 255, 1, 255, 3, 255, 3017, + 8, 255, 1, 255, 1, 255, 1, 256, 1, 256, 1, 256, 5, 256, 3024, 8, 256, 10, 256, 12, 256, 3027, 9, 256, 1, 256, 3, + 256, 3030, 8, 256, 1, 257, 1, 257, 1, 257, 3, 257, 3035, 8, 257, 1, 257, 1, 257, 1, 257, 3, 257, 3040, 8, 257, 3, + 257, 3042, 8, 257, 1, 257, 0, 2, 184, 318, 258, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, + 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, + 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, + 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, + 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, + 234, 236, 238, 240, 242, 244, 246, 248, 250, 252, 254, 256, 258, 260, 262, 264, 266, 268, 270, 272, 274, 276, 278, + 280, 282, 284, 286, 288, 290, 292, 294, 296, 298, 300, 302, 304, 306, 308, 310, 312, 314, 316, 318, 320, 322, 324, + 326, 328, 330, 332, 334, 336, 338, 340, 342, 344, 346, 348, 350, 352, 354, 356, 358, 360, 362, 364, 366, 368, 370, + 372, 374, 376, 378, 380, 382, 384, 386, 388, 390, 392, 394, 396, 398, 400, 402, 404, 406, 408, 410, 412, 414, 416, + 418, 420, 422, 424, 426, 428, 430, 432, 434, 436, 438, 440, 442, 444, 446, 448, 450, 452, 454, 456, 458, 460, 462, + 464, 466, 468, 470, 472, 474, 476, 478, 480, 482, 484, 486, 488, 490, 492, 494, 496, 498, 500, 502, 504, 506, 508, + 510, 512, 514, 0, 19, 1, 0, 161, 163, 4, 0, 79, 80, 93, 93, 98, 98, 163, 163, 1, 0, 162, 163, 2, 0, 30, 30, 102, + 102, 14, 0, 12, 12, 23, 25, 34, 34, 36, 36, 39, 39, 44, 44, 51, 51, 70, 70, 75, 75, 93, 93, 98, 98, 104, 104, 106, + 106, 109, 110, 2, 0, 161, 161, 163, 163, 7, 0, 6, 6, 11, 11, 58, 58, 61, 62, 67, 67, 119, 120, 132, 133, 3, 0, 57, + 57, 84, 84, 134, 135, 2, 0, 132, 133, 137, 137, 2, 0, 87, 88, 94, 97, 2, 0, 121, 131, 140, 140, 5, 0, 11, 11, 58, + 58, 61, 61, 67, 67, 119, 120, 2, 0, 46, 46, 78, 78, 2, 0, 28, 28, 142, 142, 5, 0, 20, 20, 47, 47, 49, 49, 53, 53, + 69, 69, 2, 0, 47, 47, 69, 69, 2, 0, 21, 21, 81, 81, 2, 0, 39, 39, 75, 75, 2, 0, 10, 10, 161, 163, 3344, 0, 516, 1, + 0, 0, 0, 2, 519, 1, 0, 0, 0, 4, 522, 1, 0, 0, 0, 6, 532, 1, 0, 0, 0, 8, 540, 1, 0, 0, 0, 10, 542, 1, 0, 0, 0, 12, + 553, 1, 0, 0, 0, 14, 566, 1, 0, 0, 0, 16, 568, 1, 0, 0, 0, 18, 570, 1, 0, 0, 0, 20, 575, 1, 0, 0, 0, 22, 625, 1, 0, + 0, 0, 24, 637, 1, 0, 0, 0, 26, 639, 1, 0, 0, 0, 28, 649, 1, 0, 0, 0, 30, 651, 1, 0, 0, 0, 32, 659, 1, 0, 0, 0, 34, + 667, 1, 0, 0, 0, 36, 679, 1, 0, 0, 0, 38, 687, 1, 0, 0, 0, 40, 691, 1, 0, 0, 0, 42, 699, 1, 0, 0, 0, 44, 705, 1, 0, + 0, 0, 46, 707, 1, 0, 0, 0, 48, 717, 1, 0, 0, 0, 50, 725, 1, 0, 0, 0, 52, 765, 1, 0, 0, 0, 54, 775, 1, 0, 0, 0, 56, + 777, 1, 0, 0, 0, 58, 825, 1, 0, 0, 0, 60, 834, 1, 0, 0, 0, 62, 853, 1, 0, 0, 0, 64, 870, 1, 0, 0, 0, 66, 882, 1, 0, + 0, 0, 68, 884, 1, 0, 0, 0, 70, 892, 1, 0, 0, 0, 72, 906, 1, 0, 0, 0, 74, 926, 1, 0, 0, 0, 76, 937, 1, 0, 0, 0, 78, + 944, 1, 0, 0, 0, 80, 946, 1, 0, 0, 0, 82, 956, 1, 0, 0, 0, 84, 964, 1, 0, 0, 0, 86, 977, 1, 0, 0, 0, 88, 985, 1, 0, + 0, 0, 90, 1001, 1, 0, 0, 0, 92, 1011, 1, 0, 0, 0, 94, 1045, 1, 0, 0, 0, 96, 1047, 1, 0, 0, 0, 98, 1050, 1, 0, 0, 0, + 100, 1058, 1, 0, 0, 0, 102, 1070, 1, 0, 0, 0, 104, 1078, 1, 0, 0, 0, 106, 1095, 1, 0, 0, 0, 108, 1119, 1, 0, 0, 0, + 110, 1123, 1, 0, 0, 0, 112, 1127, 1, 0, 0, 0, 114, 1129, 1, 0, 0, 0, 116, 1139, 1, 0, 0, 0, 118, 1148, 1, 0, 0, 0, + 120, 1150, 1, 0, 0, 0, 122, 1169, 1, 0, 0, 0, 124, 1171, 1, 0, 0, 0, 126, 1188, 1, 0, 0, 0, 128, 1191, 1, 0, 0, 0, + 130, 1200, 1, 0, 0, 0, 132, 1205, 1, 0, 0, 0, 134, 1207, 1, 0, 0, 0, 136, 1209, 1, 0, 0, 0, 138, 1217, 1, 0, 0, 0, + 140, 1219, 1, 0, 0, 0, 142, 1223, 1, 0, 0, 0, 144, 1231, 1, 0, 0, 0, 146, 1237, 1, 0, 0, 0, 148, 1239, 1, 0, 0, 0, + 150, 1246, 1, 0, 0, 0, 152, 1250, 1, 0, 0, 0, 154, 1252, 1, 0, 0, 0, 156, 1257, 1, 0, 0, 0, 158, 1269, 1, 0, 0, 0, + 160, 1271, 1, 0, 0, 0, 162, 1273, 1, 0, 0, 0, 164, 1277, 1, 0, 0, 0, 166, 1330, 1, 0, 0, 0, 168, 1332, 1, 0, 0, 0, + 170, 1346, 1, 0, 0, 0, 172, 1348, 1, 0, 0, 0, 174, 1356, 1, 0, 0, 0, 176, 1358, 1, 0, 0, 0, 178, 1360, 1, 0, 0, 0, + 180, 1362, 1, 0, 0, 0, 182, 1375, 1, 0, 0, 0, 184, 1393, 1, 0, 0, 0, 186, 1420, 1, 0, 0, 0, 188, 1425, 1, 0, 0, 0, + 190, 1427, 1, 0, 0, 0, 192, 1434, 1, 0, 0, 0, 194, 1441, 1, 0, 0, 0, 196, 1451, 1, 0, 0, 0, 198, 1453, 1, 0, 0, 0, + 200, 1462, 1, 0, 0, 0, 202, 1468, 1, 0, 0, 0, 204, 1473, 1, 0, 0, 0, 206, 1477, 1, 0, 0, 0, 208, 1482, 1, 0, 0, 0, + 210, 1484, 1, 0, 0, 0, 212, 1511, 1, 0, 0, 0, 214, 1515, 1, 0, 0, 0, 216, 1526, 1, 0, 0, 0, 218, 1528, 1, 0, 0, 0, + 220, 1534, 1, 0, 0, 0, 222, 1539, 1, 0, 0, 0, 224, 1562, 1, 0, 0, 0, 226, 1567, 1, 0, 0, 0, 228, 1576, 1, 0, 0, 0, + 230, 1591, 1, 0, 0, 0, 232, 1607, 1, 0, 0, 0, 234, 1615, 1, 0, 0, 0, 236, 1617, 1, 0, 0, 0, 238, 1633, 1, 0, 0, 0, + 240, 1648, 1, 0, 0, 0, 242, 1652, 1, 0, 0, 0, 244, 1660, 1, 0, 0, 0, 246, 1702, 1, 0, 0, 0, 248, 1745, 1, 0, 0, 0, + 250, 1747, 1, 0, 0, 0, 252, 1760, 1, 0, 0, 0, 254, 1764, 1, 0, 0, 0, 256, 1766, 1, 0, 0, 0, 258, 1777, 1, 0, 0, 0, + 260, 1794, 1, 0, 0, 0, 262, 1806, 1, 0, 0, 0, 264, 1808, 1, 0, 0, 0, 266, 1811, 1, 0, 0, 0, 268, 1814, 1, 0, 0, 0, + 270, 1832, 1, 0, 0, 0, 272, 1834, 1, 0, 0, 0, 274, 1836, 1, 0, 0, 0, 276, 1842, 1, 0, 0, 0, 278, 1858, 1, 0, 0, 0, + 280, 1869, 1, 0, 0, 0, 282, 1882, 1, 0, 0, 0, 284, 1884, 1, 0, 0, 0, 286, 1896, 1, 0, 0, 0, 288, 1902, 1, 0, 0, 0, + 290, 1909, 1, 0, 0, 0, 292, 1913, 1, 0, 0, 0, 294, 1915, 1, 0, 0, 0, 296, 1923, 1, 0, 0, 0, 298, 1926, 1, 0, 0, 0, + 300, 1942, 1, 0, 0, 0, 302, 1944, 1, 0, 0, 0, 304, 1962, 1, 0, 0, 0, 306, 1969, 1, 0, 0, 0, 308, 1973, 1, 0, 0, 0, + 310, 1992, 1, 0, 0, 0, 312, 1997, 1, 0, 0, 0, 314, 1999, 1, 0, 0, 0, 316, 2017, 1, 0, 0, 0, 318, 2027, 1, 0, 0, 0, + 320, 2068, 1, 0, 0, 0, 322, 2082, 1, 0, 0, 0, 324, 2089, 1, 0, 0, 0, 326, 2091, 1, 0, 0, 0, 328, 2128, 1, 0, 0, 0, + 330, 2130, 1, 0, 0, 0, 332, 2169, 1, 0, 0, 0, 334, 2171, 1, 0, 0, 0, 336, 2181, 1, 0, 0, 0, 338, 2195, 1, 0, 0, 0, + 340, 2201, 1, 0, 0, 0, 342, 2210, 1, 0, 0, 0, 344, 2215, 1, 0, 0, 0, 346, 2217, 1, 0, 0, 0, 348, 2221, 1, 0, 0, 0, + 350, 2225, 1, 0, 0, 0, 352, 2242, 1, 0, 0, 0, 354, 2251, 1, 0, 0, 0, 356, 2267, 1, 0, 0, 0, 358, 2284, 1, 0, 0, 0, + 360, 2286, 1, 0, 0, 0, 362, 2289, 1, 0, 0, 0, 364, 2291, 1, 0, 0, 0, 366, 2300, 1, 0, 0, 0, 368, 2305, 1, 0, 0, 0, + 370, 2333, 1, 0, 0, 0, 372, 2337, 1, 0, 0, 0, 374, 2341, 1, 0, 0, 0, 376, 2375, 1, 0, 0, 0, 378, 2411, 1, 0, 0, 0, + 380, 2442, 1, 0, 0, 0, 382, 2444, 1, 0, 0, 0, 384, 2462, 1, 0, 0, 0, 386, 2466, 1, 0, 0, 0, 388, 2468, 1, 0, 0, 0, + 390, 2473, 1, 0, 0, 0, 392, 2486, 1, 0, 0, 0, 394, 2488, 1, 0, 0, 0, 396, 2491, 1, 0, 0, 0, 398, 2502, 1, 0, 0, 0, + 400, 2505, 1, 0, 0, 0, 402, 2513, 1, 0, 0, 0, 404, 2516, 1, 0, 0, 0, 406, 2524, 1, 0, 0, 0, 408, 2536, 1, 0, 0, 0, + 410, 2546, 1, 0, 0, 0, 412, 2553, 1, 0, 0, 0, 414, 2568, 1, 0, 0, 0, 416, 2572, 1, 0, 0, 0, 418, 2574, 1, 0, 0, 0, + 420, 2580, 1, 0, 0, 0, 422, 2582, 1, 0, 0, 0, 424, 2597, 1, 0, 0, 0, 426, 2604, 1, 0, 0, 0, 428, 2634, 1, 0, 0, 0, + 430, 2638, 1, 0, 0, 0, 432, 2640, 1, 0, 0, 0, 434, 2651, 1, 0, 0, 0, 436, 2670, 1, 0, 0, 0, 438, 2677, 1, 0, 0, 0, + 440, 2680, 1, 0, 0, 0, 442, 2690, 1, 0, 0, 0, 444, 2732, 1, 0, 0, 0, 446, 2736, 1, 0, 0, 0, 448, 2743, 1, 0, 0, 0, + 450, 2766, 1, 0, 0, 0, 452, 2768, 1, 0, 0, 0, 454, 2785, 1, 0, 0, 0, 456, 2794, 1, 0, 0, 0, 458, 2802, 1, 0, 0, 0, + 460, 2812, 1, 0, 0, 0, 462, 2816, 1, 0, 0, 0, 464, 2824, 1, 0, 0, 0, 466, 2826, 1, 0, 0, 0, 468, 2834, 1, 0, 0, 0, + 470, 2839, 1, 0, 0, 0, 472, 2863, 1, 0, 0, 0, 474, 2883, 1, 0, 0, 0, 476, 2885, 1, 0, 0, 0, 478, 2898, 1, 0, 0, 0, + 480, 2902, 1, 0, 0, 0, 482, 2904, 1, 0, 0, 0, 484, 2911, 1, 0, 0, 0, 486, 2917, 1, 0, 0, 0, 488, 2921, 1, 0, 0, 0, + 490, 2923, 1, 0, 0, 0, 492, 2926, 1, 0, 0, 0, 494, 2933, 1, 0, 0, 0, 496, 2941, 1, 0, 0, 0, 498, 2943, 1, 0, 0, 0, + 500, 2957, 1, 0, 0, 0, 502, 2961, 1, 0, 0, 0, 504, 2974, 1, 0, 0, 0, 506, 2982, 1, 0, 0, 0, 508, 2989, 1, 0, 0, 0, + 510, 3006, 1, 0, 0, 0, 512, 3029, 1, 0, 0, 0, 514, 3041, 1, 0, 0, 0, 516, 517, 5, 153, 0, 0, 517, 518, 3, 342, 171, + 0, 518, 1, 1, 0, 0, 0, 519, 520, 5, 7, 0, 0, 520, 521, 3, 248, 124, 0, 521, 3, 1, 0, 0, 0, 522, 523, 5, 7, 0, 0, + 523, 524, 3, 484, 242, 0, 524, 5, 1, 0, 0, 0, 525, 527, 5, 48, 0, 0, 526, 525, 1, 0, 0, 0, 526, 527, 1, 0, 0, 0, + 527, 528, 1, 0, 0, 0, 528, 533, 3, 184, 92, 0, 529, 533, 3, 318, 159, 0, 530, 533, 3, 484, 242, 0, 531, 533, 5, 66, + 0, 0, 532, 526, 1, 0, 0, 0, 532, 529, 1, 0, 0, 0, 532, 530, 1, 0, 0, 0, 532, 531, 1, 0, 0, 0, 533, 7, 1, 0, 0, 0, + 534, 541, 3, 6, 3, 0, 535, 536, 3, 318, 159, 0, 536, 537, 5, 143, 0, 0, 537, 538, 3, 6, 3, 0, 538, 539, 5, 144, 0, + 0, 539, 541, 1, 0, 0, 0, 540, 534, 1, 0, 0, 0, 540, 535, 1, 0, 0, 0, 541, 9, 1, 0, 0, 0, 542, 543, 5, 143, 0, 0, + 543, 548, 3, 144, 72, 0, 544, 545, 5, 151, 0, 0, 545, 547, 3, 144, 72, 0, 546, 544, 1, 0, 0, 0, 547, 550, 1, 0, 0, + 0, 548, 546, 1, 0, 0, 0, 548, 549, 1, 0, 0, 0, 549, 551, 1, 0, 0, 0, 550, 548, 1, 0, 0, 0, 551, 552, 5, 144, 0, 0, + 552, 11, 1, 0, 0, 0, 553, 554, 5, 9, 0, 0, 554, 557, 3, 14, 7, 0, 555, 556, 5, 149, 0, 0, 556, 558, 3, 16, 8, 0, + 557, 555, 1, 0, 0, 0, 557, 558, 1, 0, 0, 0, 558, 559, 1, 0, 0, 0, 559, 560, 5, 50, 0, 0, 560, 562, 3, 318, 159, 0, + 561, 563, 3, 452, 226, 0, 562, 561, 1, 0, 0, 0, 562, 563, 1, 0, 0, 0, 563, 564, 1, 0, 0, 0, 564, 565, 5, 150, 0, 0, + 565, 13, 1, 0, 0, 0, 566, 567, 7, 0, 0, 0, 567, 15, 1, 0, 0, 0, 568, 569, 3, 484, 242, 0, 569, 17, 1, 0, 0, 0, 570, + 573, 5, 59, 0, 0, 571, 574, 3, 484, 242, 0, 572, 574, 3, 390, 195, 0, 573, 571, 1, 0, 0, 0, 573, 572, 1, 0, 0, 0, + 574, 19, 1, 0, 0, 0, 575, 576, 5, 12, 0, 0, 576, 577, 5, 163, 0, 0, 577, 578, 5, 64, 0, 0, 578, 579, 5, 163, 0, 0, + 579, 583, 5, 50, 0, 0, 580, 582, 3, 52, 26, 0, 581, 580, 1, 0, 0, 0, 582, 585, 1, 0, 0, 0, 583, 581, 1, 0, 0, 0, + 583, 584, 1, 0, 0, 0, 584, 586, 1, 0, 0, 0, 585, 583, 1, 0, 0, 0, 586, 590, 5, 17, 0, 0, 587, 589, 3, 94, 47, 0, + 588, 587, 1, 0, 0, 0, 589, 592, 1, 0, 0, 0, 590, 588, 1, 0, 0, 0, 590, 591, 1, 0, 0, 0, 591, 593, 1, 0, 0, 0, 592, + 590, 1, 0, 0, 0, 593, 595, 5, 33, 0, 0, 594, 596, 5, 12, 0, 0, 595, 594, 1, 0, 0, 0, 595, 596, 1, 0, 0, 0, 596, 598, + 1, 0, 0, 0, 597, 599, 5, 163, 0, 0, 598, 597, 1, 0, 0, 0, 598, 599, 1, 0, 0, 0, 599, 600, 1, 0, 0, 0, 600, 601, 5, + 150, 0, 0, 601, 21, 1, 0, 0, 0, 602, 626, 3, 56, 28, 0, 603, 626, 3, 374, 187, 0, 604, 626, 3, 376, 188, 0, 605, + 606, 5, 163, 0, 0, 606, 608, 5, 149, 0, 0, 607, 605, 1, 0, 0, 0, 607, 608, 1, 0, 0, 0, 608, 609, 1, 0, 0, 0, 609, + 626, 3, 86, 43, 0, 610, 611, 5, 163, 0, 0, 611, 613, 5, 149, 0, 0, 612, 610, 1, 0, 0, 0, 612, 613, 1, 0, 0, 0, 613, + 614, 1, 0, 0, 0, 614, 626, 3, 82, 41, 0, 615, 616, 5, 163, 0, 0, 616, 618, 5, 149, 0, 0, 617, 615, 1, 0, 0, 0, 617, + 618, 1, 0, 0, 0, 618, 620, 1, 0, 0, 0, 619, 621, 5, 73, 0, 0, 620, 619, 1, 0, 0, 0, 620, 621, 1, 0, 0, 0, 621, 622, + 1, 0, 0, 0, 622, 626, 3, 90, 45, 0, 623, 626, 3, 74, 37, 0, 624, 626, 3, 226, 113, 0, 625, 602, 1, 0, 0, 0, 625, + 603, 1, 0, 0, 0, 625, 604, 1, 0, 0, 0, 625, 607, 1, 0, 0, 0, 625, 612, 1, 0, 0, 0, 625, 617, 1, 0, 0, 0, 625, 623, + 1, 0, 0, 0, 625, 624, 1, 0, 0, 0, 626, 23, 1, 0, 0, 0, 627, 629, 3, 256, 128, 0, 628, 630, 3, 146, 73, 0, 629, 628, + 1, 0, 0, 0, 629, 630, 1, 0, 0, 0, 630, 638, 1, 0, 0, 0, 631, 632, 5, 143, 0, 0, 632, 633, 5, 66, 0, 0, 633, 635, 5, + 144, 0, 0, 634, 636, 3, 146, 73, 0, 635, 634, 1, 0, 0, 0, 635, 636, 1, 0, 0, 0, 636, 638, 1, 0, 0, 0, 637, 627, 1, + 0, 0, 0, 637, 631, 1, 0, 0, 0, 638, 25, 1, 0, 0, 0, 639, 640, 5, 13, 0, 0, 640, 641, 5, 143, 0, 0, 641, 642, 3, 30, + 15, 0, 642, 643, 5, 144, 0, 0, 643, 644, 5, 64, 0, 0, 644, 645, 3, 248, 124, 0, 645, 27, 1, 0, 0, 0, 646, 650, 3, + 258, 129, 0, 647, 650, 3, 256, 128, 0, 648, 650, 3, 500, 250, 0, 649, 646, 1, 0, 0, 0, 649, 647, 1, 0, 0, 0, 649, + 648, 1, 0, 0, 0, 650, 29, 1, 0, 0, 0, 651, 656, 3, 28, 14, 0, 652, 653, 5, 151, 0, 0, 653, 655, 3, 28, 14, 0, 654, + 652, 1, 0, 0, 0, 655, 658, 1, 0, 0, 0, 656, 654, 1, 0, 0, 0, 656, 657, 1, 0, 0, 0, 657, 31, 1, 0, 0, 0, 658, 656, 1, + 0, 0, 0, 659, 660, 5, 110, 0, 0, 660, 661, 5, 143, 0, 0, 661, 662, 3, 318, 159, 0, 662, 665, 5, 144, 0, 0, 663, 664, + 5, 64, 0, 0, 664, 666, 3, 484, 242, 0, 665, 663, 1, 0, 0, 0, 665, 666, 1, 0, 0, 0, 666, 33, 1, 0, 0, 0, 667, 668, 5, + 14, 0, 0, 668, 671, 3, 184, 92, 0, 669, 670, 5, 85, 0, 0, 670, 672, 3, 184, 92, 0, 671, 669, 1, 0, 0, 0, 671, 672, + 1, 0, 0, 0, 672, 675, 1, 0, 0, 0, 673, 674, 5, 91, 0, 0, 674, 676, 3, 184, 92, 0, 675, 673, 1, 0, 0, 0, 675, 676, 1, + 0, 0, 0, 676, 35, 1, 0, 0, 0, 677, 678, 5, 163, 0, 0, 678, 680, 5, 149, 0, 0, 679, 677, 1, 0, 0, 0, 679, 680, 1, 0, + 0, 0, 680, 681, 1, 0, 0, 0, 681, 682, 3, 34, 17, 0, 682, 683, 5, 150, 0, 0, 683, 37, 1, 0, 0, 0, 684, 685, 3, 216, + 108, 0, 685, 686, 5, 139, 0, 0, 686, 688, 1, 0, 0, 0, 687, 684, 1, 0, 0, 0, 687, 688, 1, 0, 0, 0, 688, 689, 1, 0, 0, + 0, 689, 690, 3, 8, 4, 0, 690, 39, 1, 0, 0, 0, 691, 696, 3, 38, 19, 0, 692, 693, 5, 151, 0, 0, 693, 695, 3, 38, 19, + 0, 694, 692, 1, 0, 0, 0, 695, 698, 1, 0, 0, 0, 696, 694, 1, 0, 0, 0, 696, 697, 1, 0, 0, 0, 697, 41, 1, 0, 0, 0, 698, + 696, 1, 0, 0, 0, 699, 700, 5, 15, 0, 0, 700, 701, 5, 163, 0, 0, 701, 702, 5, 149, 0, 0, 702, 703, 3, 318, 159, 0, + 703, 704, 5, 150, 0, 0, 704, 43, 1, 0, 0, 0, 705, 706, 7, 1, 0, 0, 706, 45, 1, 0, 0, 0, 707, 708, 5, 15, 0, 0, 708, + 709, 5, 163, 0, 0, 709, 710, 5, 64, 0, 0, 710, 711, 3, 172, 86, 0, 711, 712, 5, 50, 0, 0, 712, 713, 3, 98, 49, 0, + 713, 714, 5, 150, 0, 0, 714, 47, 1, 0, 0, 0, 715, 716, 5, 108, 0, 0, 716, 718, 3, 158, 79, 0, 717, 715, 1, 0, 0, 0, + 717, 718, 1, 0, 0, 0, 718, 720, 1, 0, 0, 0, 719, 721, 3, 232, 116, 0, 720, 719, 1, 0, 0, 0, 720, 721, 1, 0, 0, 0, + 721, 723, 1, 0, 0, 0, 722, 724, 3, 356, 178, 0, 723, 722, 1, 0, 0, 0, 723, 724, 1, 0, 0, 0, 724, 49, 1, 0, 0, 0, + 725, 726, 5, 37, 0, 0, 726, 730, 3, 54, 27, 0, 727, 729, 3, 502, 251, 0, 728, 727, 1, 0, 0, 0, 729, 732, 1, 0, 0, 0, + 730, 728, 1, 0, 0, 0, 730, 731, 1, 0, 0, 0, 731, 736, 1, 0, 0, 0, 732, 730, 1, 0, 0, 0, 733, 735, 3, 110, 55, 0, + 734, 733, 1, 0, 0, 0, 735, 738, 1, 0, 0, 0, 736, 734, 1, 0, 0, 0, 736, 737, 1, 0, 0, 0, 737, 739, 1, 0, 0, 0, 738, + 736, 1, 0, 0, 0, 739, 740, 5, 33, 0, 0, 740, 741, 5, 37, 0, 0, 741, 742, 5, 150, 0, 0, 742, 51, 1, 0, 0, 0, 743, + 766, 3, 472, 236, 0, 744, 766, 3, 470, 235, 0, 745, 766, 3, 476, 238, 0, 746, 766, 3, 330, 165, 0, 747, 766, 3, 326, + 163, 0, 748, 766, 3, 334, 167, 0, 749, 766, 3, 494, 247, 0, 750, 766, 3, 482, 241, 0, 751, 766, 3, 314, 157, 0, 752, + 766, 3, 114, 57, 0, 753, 766, 3, 448, 224, 0, 754, 766, 3, 508, 254, 0, 755, 766, 3, 198, 99, 0, 756, 766, 3, 12, 6, + 0, 757, 766, 3, 72, 36, 0, 758, 766, 3, 42, 21, 0, 759, 766, 3, 46, 23, 0, 760, 766, 3, 112, 56, 0, 761, 766, 3, + 136, 68, 0, 762, 766, 3, 502, 251, 0, 763, 766, 3, 238, 119, 0, 764, 766, 3, 236, 118, 0, 765, 743, 1, 0, 0, 0, 765, + 744, 1, 0, 0, 0, 765, 745, 1, 0, 0, 0, 765, 746, 1, 0, 0, 0, 765, 747, 1, 0, 0, 0, 765, 748, 1, 0, 0, 0, 765, 749, + 1, 0, 0, 0, 765, 750, 1, 0, 0, 0, 765, 751, 1, 0, 0, 0, 765, 752, 1, 0, 0, 0, 765, 753, 1, 0, 0, 0, 765, 754, 1, 0, + 0, 0, 765, 755, 1, 0, 0, 0, 765, 756, 1, 0, 0, 0, 765, 757, 1, 0, 0, 0, 765, 758, 1, 0, 0, 0, 765, 759, 1, 0, 0, 0, + 765, 760, 1, 0, 0, 0, 765, 761, 1, 0, 0, 0, 765, 762, 1, 0, 0, 0, 765, 763, 1, 0, 0, 0, 765, 764, 1, 0, 0, 0, 766, + 53, 1, 0, 0, 0, 767, 776, 3, 318, 159, 0, 768, 773, 5, 163, 0, 0, 769, 770, 5, 143, 0, 0, 770, 771, 3, 224, 112, 0, + 771, 772, 5, 144, 0, 0, 772, 774, 1, 0, 0, 0, 773, 769, 1, 0, 0, 0, 773, 774, 1, 0, 0, 0, 774, 776, 1, 0, 0, 0, 775, + 767, 1, 0, 0, 0, 775, 768, 1, 0, 0, 0, 776, 55, 1, 0, 0, 0, 777, 778, 5, 163, 0, 0, 778, 779, 5, 149, 0, 0, 779, + 784, 5, 18, 0, 0, 780, 781, 5, 143, 0, 0, 781, 782, 3, 184, 92, 0, 782, 783, 5, 144, 0, 0, 783, 785, 1, 0, 0, 0, + 784, 780, 1, 0, 0, 0, 784, 785, 1, 0, 0, 0, 785, 787, 1, 0, 0, 0, 786, 788, 5, 50, 0, 0, 787, 786, 1, 0, 0, 0, 787, + 788, 1, 0, 0, 0, 788, 795, 1, 0, 0, 0, 789, 793, 3, 230, 115, 0, 790, 791, 3, 232, 116, 0, 791, 792, 5, 150, 0, 0, + 792, 794, 1, 0, 0, 0, 793, 790, 1, 0, 0, 0, 793, 794, 1, 0, 0, 0, 794, 796, 1, 0, 0, 0, 795, 789, 1, 0, 0, 0, 795, + 796, 1, 0, 0, 0, 796, 803, 1, 0, 0, 0, 797, 801, 3, 354, 177, 0, 798, 799, 3, 356, 178, 0, 799, 800, 5, 150, 0, 0, + 800, 802, 1, 0, 0, 0, 801, 798, 1, 0, 0, 0, 801, 802, 1, 0, 0, 0, 802, 804, 1, 0, 0, 0, 803, 797, 1, 0, 0, 0, 803, + 804, 1, 0, 0, 0, 804, 808, 1, 0, 0, 0, 805, 807, 3, 52, 26, 0, 806, 805, 1, 0, 0, 0, 807, 810, 1, 0, 0, 0, 808, 806, + 1, 0, 0, 0, 808, 809, 1, 0, 0, 0, 809, 811, 1, 0, 0, 0, 810, 808, 1, 0, 0, 0, 811, 815, 5, 17, 0, 0, 812, 814, 3, + 94, 47, 0, 813, 812, 1, 0, 0, 0, 814, 817, 1, 0, 0, 0, 815, 813, 1, 0, 0, 0, 815, 816, 1, 0, 0, 0, 816, 818, 1, 0, + 0, 0, 817, 815, 1, 0, 0, 0, 818, 819, 5, 33, 0, 0, 819, 821, 5, 18, 0, 0, 820, 822, 5, 163, 0, 0, 821, 820, 1, 0, 0, + 0, 821, 822, 1, 0, 0, 0, 822, 823, 1, 0, 0, 0, 823, 824, 5, 150, 0, 0, 824, 57, 1, 0, 0, 0, 825, 828, 5, 117, 0, 0, + 826, 827, 5, 163, 0, 0, 827, 829, 5, 149, 0, 0, 828, 826, 1, 0, 0, 0, 828, 829, 1, 0, 0, 0, 829, 830, 1, 0, 0, 0, + 830, 831, 3, 68, 34, 0, 831, 832, 5, 139, 0, 0, 832, 833, 3, 228, 114, 0, 833, 59, 1, 0, 0, 0, 834, 835, 5, 163, 0, + 0, 835, 836, 5, 149, 0, 0, 836, 837, 5, 22, 0, 0, 837, 838, 3, 184, 92, 0, 838, 840, 5, 41, 0, 0, 839, 841, 3, 58, + 29, 0, 840, 839, 1, 0, 0, 0, 841, 842, 1, 0, 0, 0, 842, 840, 1, 0, 0, 0, 842, 843, 1, 0, 0, 0, 843, 844, 1, 0, 0, 0, + 844, 845, 5, 33, 0, 0, 845, 847, 5, 41, 0, 0, 846, 848, 5, 163, 0, 0, 847, 846, 1, 0, 0, 0, 847, 848, 1, 0, 0, 0, + 848, 849, 1, 0, 0, 0, 849, 850, 5, 150, 0, 0, 850, 61, 1, 0, 0, 0, 851, 852, 5, 163, 0, 0, 852, 854, 5, 149, 0, 0, + 853, 851, 1, 0, 0, 0, 853, 854, 1, 0, 0, 0, 854, 855, 1, 0, 0, 0, 855, 856, 5, 22, 0, 0, 856, 857, 3, 184, 92, 0, + 857, 859, 5, 50, 0, 0, 858, 860, 3, 64, 32, 0, 859, 858, 1, 0, 0, 0, 860, 861, 1, 0, 0, 0, 861, 859, 1, 0, 0, 0, + 861, 862, 1, 0, 0, 0, 862, 863, 1, 0, 0, 0, 863, 864, 5, 33, 0, 0, 864, 866, 5, 22, 0, 0, 865, 867, 5, 163, 0, 0, + 866, 865, 1, 0, 0, 0, 866, 867, 1, 0, 0, 0, 867, 868, 1, 0, 0, 0, 868, 869, 5, 150, 0, 0, 869, 63, 1, 0, 0, 0, 870, + 871, 5, 117, 0, 0, 871, 872, 3, 68, 34, 0, 872, 876, 5, 139, 0, 0, 873, 875, 3, 444, 222, 0, 874, 873, 1, 0, 0, 0, + 875, 878, 1, 0, 0, 0, 876, 874, 1, 0, 0, 0, 876, 877, 1, 0, 0, 0, 877, 65, 1, 0, 0, 0, 878, 876, 1, 0, 0, 0, 879, + 883, 3, 184, 92, 0, 880, 883, 3, 138, 69, 0, 881, 883, 5, 68, 0, 0, 882, 879, 1, 0, 0, 0, 882, 880, 1, 0, 0, 0, 882, + 881, 1, 0, 0, 0, 883, 67, 1, 0, 0, 0, 884, 889, 3, 66, 33, 0, 885, 886, 5, 152, 0, 0, 886, 888, 3, 66, 33, 0, 887, + 885, 1, 0, 0, 0, 888, 891, 1, 0, 0, 0, 889, 887, 1, 0, 0, 0, 889, 890, 1, 0, 0, 0, 890, 69, 1, 0, 0, 0, 891, 889, 1, + 0, 0, 0, 892, 893, 5, 37, 0, 0, 893, 897, 3, 76, 38, 0, 894, 895, 3, 48, 24, 0, 895, 896, 5, 150, 0, 0, 896, 898, 1, + 0, 0, 0, 897, 894, 1, 0, 0, 0, 897, 898, 1, 0, 0, 0, 898, 900, 1, 0, 0, 0, 899, 901, 3, 50, 25, 0, 900, 899, 1, 0, + 0, 0, 900, 901, 1, 0, 0, 0, 901, 902, 1, 0, 0, 0, 902, 903, 5, 33, 0, 0, 903, 904, 5, 37, 0, 0, 904, 905, 5, 150, 0, + 0, 905, 71, 1, 0, 0, 0, 906, 907, 5, 23, 0, 0, 907, 909, 5, 163, 0, 0, 908, 910, 5, 50, 0, 0, 909, 908, 1, 0, 0, 0, + 909, 910, 1, 0, 0, 0, 910, 912, 1, 0, 0, 0, 911, 913, 3, 230, 115, 0, 912, 911, 1, 0, 0, 0, 912, 913, 1, 0, 0, 0, + 913, 915, 1, 0, 0, 0, 914, 916, 3, 354, 177, 0, 915, 914, 1, 0, 0, 0, 915, 916, 1, 0, 0, 0, 916, 917, 1, 0, 0, 0, + 917, 919, 5, 33, 0, 0, 918, 920, 5, 23, 0, 0, 919, 918, 1, 0, 0, 0, 919, 920, 1, 0, 0, 0, 920, 922, 1, 0, 0, 0, 921, + 923, 5, 163, 0, 0, 922, 921, 1, 0, 0, 0, 922, 923, 1, 0, 0, 0, 923, 924, 1, 0, 0, 0, 924, 925, 5, 150, 0, 0, 925, + 73, 1, 0, 0, 0, 926, 927, 5, 163, 0, 0, 927, 928, 5, 149, 0, 0, 928, 930, 3, 260, 130, 0, 929, 931, 3, 232, 116, 0, + 930, 929, 1, 0, 0, 0, 930, 931, 1, 0, 0, 0, 931, 933, 1, 0, 0, 0, 932, 934, 3, 356, 178, 0, 933, 932, 1, 0, 0, 0, + 933, 934, 1, 0, 0, 0, 934, 935, 1, 0, 0, 0, 935, 936, 5, 150, 0, 0, 936, 75, 1, 0, 0, 0, 937, 938, 3, 262, 131, 0, + 938, 939, 5, 149, 0, 0, 939, 940, 3, 318, 159, 0, 940, 77, 1, 0, 0, 0, 941, 945, 3, 116, 58, 0, 942, 945, 3, 498, + 249, 0, 943, 945, 3, 406, 203, 0, 944, 941, 1, 0, 0, 0, 944, 942, 1, 0, 0, 0, 944, 943, 1, 0, 0, 0, 945, 79, 1, 0, + 0, 0, 946, 947, 5, 37, 0, 0, 947, 948, 3, 76, 38, 0, 948, 949, 3, 48, 24, 0, 949, 950, 5, 150, 0, 0, 950, 951, 5, + 33, 0, 0, 951, 952, 5, 37, 0, 0, 952, 953, 5, 150, 0, 0, 953, 81, 1, 0, 0, 0, 954, 955, 5, 163, 0, 0, 955, 957, 5, + 149, 0, 0, 956, 954, 1, 0, 0, 0, 956, 957, 1, 0, 0, 0, 957, 959, 1, 0, 0, 0, 958, 960, 5, 73, 0, 0, 959, 958, 1, 0, + 0, 0, 959, 960, 1, 0, 0, 0, 960, 961, 1, 0, 0, 0, 961, 962, 3, 34, 17, 0, 962, 963, 5, 150, 0, 0, 963, 83, 1, 0, 0, + 0, 964, 965, 3, 488, 244, 0, 965, 967, 5, 140, 0, 0, 966, 968, 5, 43, 0, 0, 967, 966, 1, 0, 0, 0, 967, 968, 1, 0, 0, + 0, 968, 970, 1, 0, 0, 0, 969, 971, 3, 126, 63, 0, 970, 969, 1, 0, 0, 0, 970, 971, 1, 0, 0, 0, 971, 972, 1, 0, 0, 0, + 972, 973, 3, 104, 52, 0, 973, 974, 5, 150, 0, 0, 974, 85, 1, 0, 0, 0, 975, 976, 5, 163, 0, 0, 976, 978, 5, 149, 0, + 0, 977, 975, 1, 0, 0, 0, 977, 978, 1, 0, 0, 0, 978, 980, 1, 0, 0, 0, 979, 981, 5, 73, 0, 0, 980, 979, 1, 0, 0, 0, + 980, 981, 1, 0, 0, 0, 981, 982, 1, 0, 0, 0, 982, 983, 3, 364, 182, 0, 983, 984, 5, 150, 0, 0, 984, 87, 1, 0, 0, 0, + 985, 986, 5, 116, 0, 0, 986, 987, 3, 184, 92, 0, 987, 988, 5, 90, 0, 0, 988, 989, 3, 488, 244, 0, 989, 991, 5, 140, + 0, 0, 990, 992, 5, 43, 0, 0, 991, 990, 1, 0, 0, 0, 991, 992, 1, 0, 0, 0, 992, 994, 1, 0, 0, 0, 993, 995, 3, 126, 63, + 0, 994, 993, 1, 0, 0, 0, 994, 995, 1, 0, 0, 0, 995, 996, 1, 0, 0, 0, 996, 997, 3, 436, 218, 0, 997, 998, 5, 150, 0, + 0, 998, 89, 1, 0, 0, 0, 999, 1000, 5, 163, 0, 0, 1000, 1002, 5, 149, 0, 0, 1001, 999, 1, 0, 0, 0, 1001, 1002, 1, 0, + 0, 0, 1002, 1004, 1, 0, 0, 0, 1003, 1005, 5, 73, 0, 0, 1004, 1003, 1, 0, 0, 0, 1004, 1005, 1, 0, 0, 0, 1005, 1009, + 1, 0, 0, 0, 1006, 1010, 3, 92, 46, 0, 1007, 1010, 3, 84, 42, 0, 1008, 1010, 3, 88, 44, 0, 1009, 1006, 1, 0, 0, 0, + 1009, 1007, 1, 0, 0, 0, 1009, 1008, 1, 0, 0, 0, 1010, 91, 1, 0, 0, 0, 1011, 1012, 3, 488, 244, 0, 1012, 1014, 5, + 140, 0, 0, 1013, 1015, 5, 43, 0, 0, 1014, 1013, 1, 0, 0, 0, 1014, 1015, 1, 0, 0, 0, 1015, 1017, 1, 0, 0, 0, 1016, + 1018, 3, 126, 63, 0, 1017, 1016, 1, 0, 0, 0, 1017, 1018, 1, 0, 0, 0, 1018, 1019, 1, 0, 0, 0, 1019, 1020, 3, 512, + 256, 0, 1020, 1021, 5, 150, 0, 0, 1021, 93, 1, 0, 0, 0, 1022, 1046, 3, 56, 28, 0, 1023, 1046, 3, 374, 187, 0, 1024, + 1046, 3, 376, 188, 0, 1025, 1026, 5, 163, 0, 0, 1026, 1028, 5, 149, 0, 0, 1027, 1025, 1, 0, 0, 0, 1027, 1028, 1, 0, + 0, 0, 1028, 1029, 1, 0, 0, 0, 1029, 1046, 3, 86, 43, 0, 1030, 1031, 5, 163, 0, 0, 1031, 1033, 5, 149, 0, 0, 1032, + 1030, 1, 0, 0, 0, 1032, 1033, 1, 0, 0, 0, 1033, 1034, 1, 0, 0, 0, 1034, 1046, 3, 82, 41, 0, 1035, 1036, 5, 163, 0, + 0, 1036, 1038, 5, 149, 0, 0, 1037, 1035, 1, 0, 0, 0, 1037, 1038, 1, 0, 0, 0, 1038, 1040, 1, 0, 0, 0, 1039, 1041, 5, + 73, 0, 0, 1040, 1039, 1, 0, 0, 0, 1040, 1041, 1, 0, 0, 0, 1041, 1042, 1, 0, 0, 0, 1042, 1046, 3, 90, 45, 0, 1043, + 1046, 3, 74, 37, 0, 1044, 1046, 3, 226, 113, 0, 1045, 1022, 1, 0, 0, 0, 1045, 1023, 1, 0, 0, 0, 1045, 1024, 1, 0, 0, + 0, 1045, 1027, 1, 0, 0, 0, 1045, 1032, 1, 0, 0, 0, 1045, 1037, 1, 0, 0, 0, 1045, 1043, 1, 0, 0, 0, 1045, 1044, 1, 0, + 0, 0, 1046, 95, 1, 0, 0, 0, 1047, 1048, 5, 107, 0, 0, 1048, 1049, 3, 184, 92, 0, 1049, 97, 1, 0, 0, 0, 1050, 1056, + 3, 184, 92, 0, 1051, 1052, 5, 117, 0, 0, 1052, 1053, 3, 184, 92, 0, 1053, 1054, 5, 31, 0, 0, 1054, 1055, 3, 184, 92, + 0, 1055, 1057, 1, 0, 0, 0, 1056, 1051, 1, 0, 0, 0, 1056, 1057, 1, 0, 0, 0, 1057, 99, 1, 0, 0, 0, 1058, 1064, 3, 186, + 93, 0, 1059, 1060, 5, 117, 0, 0, 1060, 1061, 3, 184, 92, 0, 1061, 1062, 5, 31, 0, 0, 1062, 1063, 3, 186, 93, 0, + 1063, 1065, 1, 0, 0, 0, 1064, 1059, 1, 0, 0, 0, 1064, 1065, 1, 0, 0, 0, 1065, 1068, 1, 0, 0, 0, 1066, 1067, 5, 117, + 0, 0, 1067, 1069, 3, 184, 92, 0, 1068, 1066, 1, 0, 0, 0, 1068, 1069, 1, 0, 0, 0, 1069, 101, 1, 0, 0, 0, 1070, 1071, + 3, 488, 244, 0, 1071, 1073, 5, 140, 0, 0, 1072, 1074, 3, 126, 63, 0, 1073, 1072, 1, 0, 0, 0, 1073, 1074, 1, 0, 0, 0, + 1074, 1075, 1, 0, 0, 0, 1075, 1076, 3, 104, 52, 0, 1076, 1077, 5, 150, 0, 0, 1077, 103, 1, 0, 0, 0, 1078, 1079, 3, + 512, 256, 0, 1079, 1080, 5, 117, 0, 0, 1080, 1088, 3, 184, 92, 0, 1081, 1082, 5, 31, 0, 0, 1082, 1083, 3, 512, 256, + 0, 1083, 1084, 5, 117, 0, 0, 1084, 1085, 3, 184, 92, 0, 1085, 1087, 1, 0, 0, 0, 1086, 1081, 1, 0, 0, 0, 1087, 1090, + 1, 0, 0, 0, 1088, 1086, 1, 0, 0, 0, 1088, 1089, 1, 0, 0, 0, 1089, 1093, 1, 0, 0, 0, 1090, 1088, 1, 0, 0, 0, 1091, + 1092, 5, 31, 0, 0, 1092, 1094, 3, 184, 92, 0, 1093, 1091, 1, 0, 0, 0, 1093, 1094, 1, 0, 0, 0, 1094, 105, 1, 0, 0, 0, + 1095, 1096, 5, 24, 0, 0, 1096, 1097, 5, 163, 0, 0, 1097, 1098, 5, 64, 0, 0, 1098, 1099, 3, 318, 159, 0, 1099, 1103, + 5, 50, 0, 0, 1100, 1102, 3, 108, 54, 0, 1101, 1100, 1, 0, 0, 0, 1102, 1105, 1, 0, 0, 0, 1103, 1101, 1, 0, 0, 0, + 1103, 1104, 1, 0, 0, 0, 1104, 1106, 1, 0, 0, 0, 1105, 1103, 1, 0, 0, 0, 1106, 1107, 3, 50, 25, 0, 1107, 1109, 5, 33, + 0, 0, 1108, 1110, 5, 24, 0, 0, 1109, 1108, 1, 0, 0, 0, 1109, 1110, 1, 0, 0, 0, 1110, 1112, 1, 0, 0, 0, 1111, 1113, + 5, 163, 0, 0, 1112, 1111, 1, 0, 0, 0, 1112, 1113, 1, 0, 0, 0, 1113, 1114, 1, 0, 0, 0, 1114, 1115, 5, 150, 0, 0, + 1115, 107, 1, 0, 0, 0, 1116, 1120, 3, 502, 251, 0, 1117, 1120, 3, 46, 23, 0, 1118, 1120, 3, 236, 118, 0, 1119, 1116, + 1, 0, 0, 0, 1119, 1117, 1, 0, 0, 0, 1119, 1118, 1, 0, 0, 0, 1120, 109, 1, 0, 0, 0, 1121, 1124, 3, 50, 25, 0, 1122, + 1124, 3, 70, 35, 0, 1123, 1121, 1, 0, 0, 0, 1123, 1122, 1, 0, 0, 0, 1124, 111, 1, 0, 0, 0, 1125, 1128, 3, 454, 227, + 0, 1126, 1128, 3, 80, 40, 0, 1127, 1125, 1, 0, 0, 0, 1127, 1126, 1, 0, 0, 0, 1128, 113, 1, 0, 0, 0, 1129, 1130, 5, + 25, 0, 0, 1130, 1131, 3, 242, 121, 0, 1131, 1132, 5, 149, 0, 0, 1132, 1135, 3, 484, 242, 0, 1133, 1134, 5, 141, 0, + 0, 1134, 1136, 3, 98, 49, 0, 1135, 1133, 1, 0, 0, 0, 1135, 1136, 1, 0, 0, 0, 1136, 1137, 1, 0, 0, 0, 1137, 1138, 5, + 150, 0, 0, 1138, 115, 1, 0, 0, 0, 1139, 1140, 5, 13, 0, 0, 1140, 1141, 3, 256, 128, 0, 1141, 1142, 5, 64, 0, 0, + 1142, 1143, 3, 484, 242, 0, 1143, 117, 1, 0, 0, 0, 1144, 1149, 3, 460, 230, 0, 1145, 1149, 3, 394, 197, 0, 1146, + 1149, 3, 24, 12, 0, 1147, 1149, 3, 396, 198, 0, 1148, 1144, 1, 0, 0, 0, 1148, 1145, 1, 0, 0, 0, 1148, 1146, 1, 0, 0, + 0, 1148, 1147, 1, 0, 0, 0, 1149, 119, 1, 0, 0, 0, 1150, 1151, 5, 26, 0, 0, 1151, 1152, 5, 163, 0, 0, 1152, 1156, 5, + 50, 0, 0, 1153, 1155, 3, 122, 61, 0, 1154, 1153, 1, 0, 0, 0, 1155, 1158, 1, 0, 0, 0, 1156, 1154, 1, 0, 0, 0, 1156, + 1157, 1, 0, 0, 0, 1157, 1159, 1, 0, 0, 0, 1158, 1156, 1, 0, 0, 0, 1159, 1161, 5, 33, 0, 0, 1160, 1162, 5, 26, 0, 0, + 1161, 1160, 1, 0, 0, 0, 1161, 1162, 1, 0, 0, 0, 1162, 1163, 1, 0, 0, 0, 1163, 1164, 5, 163, 0, 0, 1164, 1165, 5, + 150, 0, 0, 1165, 121, 1, 0, 0, 0, 1166, 1170, 3, 302, 151, 0, 1167, 1170, 3, 502, 251, 0, 1168, 1170, 3, 124, 62, 0, + 1169, 1166, 1, 0, 0, 0, 1169, 1167, 1, 0, 0, 0, 1169, 1168, 1, 0, 0, 0, 1170, 123, 1, 0, 0, 0, 1171, 1172, 5, 26, 0, + 0, 1172, 1177, 3, 428, 214, 0, 1173, 1174, 5, 149, 0, 0, 1174, 1176, 3, 428, 214, 0, 1175, 1173, 1, 0, 0, 0, 1176, + 1179, 1, 0, 0, 0, 1177, 1175, 1, 0, 0, 0, 1177, 1178, 1, 0, 0, 0, 1178, 1180, 1, 0, 0, 0, 1179, 1177, 1, 0, 0, 0, + 1180, 1181, 5, 150, 0, 0, 1181, 125, 1, 0, 0, 0, 1182, 1189, 5, 103, 0, 0, 1183, 1184, 5, 82, 0, 0, 1184, 1186, 3, + 184, 92, 0, 1185, 1183, 1, 0, 0, 0, 1185, 1186, 1, 0, 0, 0, 1186, 1187, 1, 0, 0, 0, 1187, 1189, 5, 48, 0, 0, 1188, + 1182, 1, 0, 0, 0, 1188, 1185, 1, 0, 0, 0, 1189, 127, 1, 0, 0, 0, 1190, 1192, 3, 130, 65, 0, 1191, 1190, 1, 0, 0, 0, + 1192, 1193, 1, 0, 0, 0, 1193, 1191, 1, 0, 0, 0, 1193, 1194, 1, 0, 0, 0, 1194, 1195, 1, 0, 0, 0, 1195, 1196, 5, 0, 0, + 1, 1196, 129, 1, 0, 0, 0, 1197, 1199, 3, 122, 61, 0, 1198, 1197, 1, 0, 0, 0, 1199, 1202, 1, 0, 0, 0, 1200, 1198, 1, + 0, 0, 0, 1200, 1201, 1, 0, 0, 0, 1201, 1203, 1, 0, 0, 0, 1202, 1200, 1, 0, 0, 0, 1203, 1204, 3, 304, 152, 0, 1204, + 131, 1, 0, 0, 0, 1205, 1206, 7, 2, 0, 0, 1206, 133, 1, 0, 0, 0, 1207, 1208, 7, 3, 0, 0, 1208, 135, 1, 0, 0, 0, 1209, + 1210, 5, 29, 0, 0, 1210, 1211, 3, 240, 120, 0, 1211, 1212, 5, 8, 0, 0, 1212, 1213, 3, 184, 92, 0, 1213, 1214, 5, + 150, 0, 0, 1214, 137, 1, 0, 0, 0, 1215, 1218, 3, 484, 242, 0, 1216, 1218, 3, 392, 196, 0, 1217, 1215, 1, 0, 0, 0, + 1217, 1216, 1, 0, 0, 0, 1218, 139, 1, 0, 0, 0, 1219, 1220, 5, 143, 0, 0, 1220, 1221, 5, 142, 0, 0, 1221, 1222, 5, + 144, 0, 0, 1222, 141, 1, 0, 0, 0, 1223, 1224, 5, 110, 0, 0, 1224, 1225, 5, 143, 0, 0, 1225, 1226, 3, 318, 159, 0, + 1226, 1227, 5, 144, 0, 0, 1227, 143, 1, 0, 0, 0, 1228, 1229, 3, 68, 34, 0, 1229, 1230, 5, 139, 0, 0, 1230, 1232, 1, + 0, 0, 0, 1231, 1228, 1, 0, 0, 0, 1231, 1232, 1, 0, 0, 0, 1232, 1233, 1, 0, 0, 0, 1233, 1234, 3, 184, 92, 0, 1234, + 145, 1, 0, 0, 0, 1235, 1238, 3, 24, 12, 0, 1236, 1238, 3, 396, 198, 0, 1237, 1235, 1, 0, 0, 0, 1237, 1236, 1, 0, 0, + 0, 1238, 147, 1, 0, 0, 0, 1239, 1240, 3, 242, 121, 0, 1240, 1241, 5, 149, 0, 0, 1241, 1242, 3, 484, 242, 0, 1242, + 1243, 5, 150, 0, 0, 1243, 149, 1, 0, 0, 0, 1244, 1247, 3, 310, 155, 0, 1245, 1247, 3, 152, 76, 0, 1246, 1244, 1, 0, + 0, 0, 1246, 1245, 1, 0, 0, 0, 1247, 151, 1, 0, 0, 0, 1248, 1251, 3, 142, 71, 0, 1249, 1251, 3, 154, 77, 0, 1250, + 1248, 1, 0, 0, 0, 1250, 1249, 1, 0, 0, 0, 1251, 153, 1, 0, 0, 0, 1252, 1253, 5, 110, 0, 0, 1253, 1254, 3, 318, 159, + 0, 1254, 155, 1, 0, 0, 0, 1255, 1258, 3, 414, 207, 0, 1256, 1258, 3, 404, 202, 0, 1257, 1255, 1, 0, 0, 0, 1257, + 1256, 1, 0, 0, 0, 1258, 157, 1, 0, 0, 0, 1259, 1260, 5, 34, 0, 0, 1260, 1264, 3, 318, 159, 0, 1261, 1262, 5, 143, 0, + 0, 1262, 1263, 5, 163, 0, 0, 1263, 1265, 5, 144, 0, 0, 1264, 1261, 1, 0, 0, 0, 1264, 1265, 1, 0, 0, 0, 1265, 1270, + 1, 0, 0, 0, 1266, 1267, 5, 24, 0, 0, 1267, 1270, 3, 318, 159, 0, 1268, 1270, 5, 66, 0, 0, 1269, 1259, 1, 0, 0, 0, + 1269, 1266, 1, 0, 0, 0, 1269, 1268, 1, 0, 0, 0, 1270, 159, 1, 0, 0, 0, 1271, 1272, 7, 4, 0, 0, 1272, 161, 1, 0, 0, + 0, 1273, 1275, 3, 160, 80, 0, 1274, 1276, 5, 142, 0, 0, 1275, 1274, 1, 0, 0, 0, 1275, 1276, 1, 0, 0, 0, 1276, 163, + 1, 0, 0, 0, 1277, 1278, 5, 34, 0, 0, 1278, 1279, 5, 163, 0, 0, 1279, 1281, 5, 50, 0, 0, 1280, 1282, 3, 230, 115, 0, + 1281, 1280, 1, 0, 0, 0, 1281, 1282, 1, 0, 0, 0, 1282, 1284, 1, 0, 0, 0, 1283, 1285, 3, 354, 177, 0, 1284, 1283, 1, + 0, 0, 0, 1284, 1285, 1, 0, 0, 0, 1285, 1289, 1, 0, 0, 0, 1286, 1288, 3, 166, 83, 0, 1287, 1286, 1, 0, 0, 0, 1288, + 1291, 1, 0, 0, 0, 1289, 1287, 1, 0, 0, 0, 1289, 1290, 1, 0, 0, 0, 1290, 1299, 1, 0, 0, 0, 1291, 1289, 1, 0, 0, 0, + 1292, 1296, 5, 17, 0, 0, 1293, 1295, 3, 174, 87, 0, 1294, 1293, 1, 0, 0, 0, 1295, 1298, 1, 0, 0, 0, 1296, 1294, 1, + 0, 0, 0, 1296, 1297, 1, 0, 0, 0, 1297, 1300, 1, 0, 0, 0, 1298, 1296, 1, 0, 0, 0, 1299, 1292, 1, 0, 0, 0, 1299, 1300, + 1, 0, 0, 0, 1300, 1301, 1, 0, 0, 0, 1301, 1303, 5, 33, 0, 0, 1302, 1304, 5, 34, 0, 0, 1303, 1302, 1, 0, 0, 0, 1303, + 1304, 1, 0, 0, 0, 1304, 1306, 1, 0, 0, 0, 1305, 1307, 5, 163, 0, 0, 1306, 1305, 1, 0, 0, 0, 1306, 1307, 1, 0, 0, 0, + 1307, 1308, 1, 0, 0, 0, 1308, 1309, 5, 150, 0, 0, 1309, 165, 1, 0, 0, 0, 1310, 1331, 3, 472, 236, 0, 1311, 1331, 3, + 470, 235, 0, 1312, 1331, 3, 476, 238, 0, 1313, 1331, 3, 330, 165, 0, 1314, 1331, 3, 326, 163, 0, 1315, 1331, 3, 334, + 167, 0, 1316, 1331, 3, 494, 247, 0, 1317, 1331, 3, 482, 241, 0, 1318, 1331, 3, 314, 157, 0, 1319, 1331, 3, 114, 57, + 0, 1320, 1331, 3, 448, 224, 0, 1321, 1331, 3, 508, 254, 0, 1322, 1331, 3, 198, 99, 0, 1323, 1331, 3, 12, 6, 0, 1324, + 1331, 3, 42, 21, 0, 1325, 1331, 3, 46, 23, 0, 1326, 1331, 3, 136, 68, 0, 1327, 1331, 3, 502, 251, 0, 1328, 1331, 3, + 238, 119, 0, 1329, 1331, 3, 236, 118, 0, 1330, 1310, 1, 0, 0, 0, 1330, 1311, 1, 0, 0, 0, 1330, 1312, 1, 0, 0, 0, + 1330, 1313, 1, 0, 0, 0, 1330, 1314, 1, 0, 0, 0, 1330, 1315, 1, 0, 0, 0, 1330, 1316, 1, 0, 0, 0, 1330, 1317, 1, 0, 0, + 0, 1330, 1318, 1, 0, 0, 0, 1330, 1319, 1, 0, 0, 0, 1330, 1320, 1, 0, 0, 0, 1330, 1321, 1, 0, 0, 0, 1330, 1322, 1, 0, + 0, 0, 1330, 1323, 1, 0, 0, 0, 1330, 1324, 1, 0, 0, 0, 1330, 1325, 1, 0, 0, 0, 1330, 1326, 1, 0, 0, 0, 1330, 1327, 1, + 0, 0, 0, 1330, 1328, 1, 0, 0, 0, 1330, 1329, 1, 0, 0, 0, 1331, 167, 1, 0, 0, 0, 1332, 1334, 3, 176, 88, 0, 1333, + 1335, 3, 452, 226, 0, 1334, 1333, 1, 0, 0, 0, 1334, 1335, 1, 0, 0, 0, 1335, 169, 1, 0, 0, 0, 1336, 1341, 3, 168, 84, + 0, 1337, 1338, 5, 151, 0, 0, 1338, 1340, 3, 168, 84, 0, 1339, 1337, 1, 0, 0, 0, 1340, 1343, 1, 0, 0, 0, 1341, 1339, + 1, 0, 0, 0, 1341, 1342, 1, 0, 0, 0, 1342, 1347, 1, 0, 0, 0, 1343, 1341, 1, 0, 0, 0, 1344, 1347, 5, 68, 0, 0, 1345, + 1347, 5, 10, 0, 0, 1346, 1336, 1, 0, 0, 0, 1346, 1344, 1, 0, 0, 0, 1346, 1345, 1, 0, 0, 0, 1347, 171, 1, 0, 0, 0, + 1348, 1349, 3, 170, 85, 0, 1349, 1350, 5, 149, 0, 0, 1350, 1351, 3, 160, 80, 0, 1351, 173, 1, 0, 0, 0, 1352, 1357, + 3, 82, 41, 0, 1353, 1357, 3, 86, 43, 0, 1354, 1357, 3, 374, 187, 0, 1355, 1357, 3, 376, 188, 0, 1356, 1352, 1, 0, 0, + 0, 1356, 1353, 1, 0, 0, 0, 1356, 1354, 1, 0, 0, 0, 1356, 1355, 1, 0, 0, 0, 1357, 175, 1, 0, 0, 0, 1358, 1359, 7, 0, + 0, 0, 1359, 177, 1, 0, 0, 0, 1360, 1361, 7, 5, 0, 0, 1361, 179, 1, 0, 0, 0, 1362, 1363, 5, 143, 0, 0, 1363, 1368, 3, + 178, 89, 0, 1364, 1365, 5, 151, 0, 0, 1365, 1367, 3, 178, 89, 0, 1366, 1364, 1, 0, 0, 0, 1367, 1370, 1, 0, 0, 0, + 1368, 1366, 1, 0, 0, 0, 1368, 1369, 1, 0, 0, 0, 1369, 1371, 1, 0, 0, 0, 1370, 1368, 1, 0, 0, 0, 1371, 1372, 5, 144, + 0, 0, 1372, 181, 1, 0, 0, 0, 1373, 1374, 5, 163, 0, 0, 1374, 1376, 5, 149, 0, 0, 1375, 1373, 1, 0, 0, 0, 1375, 1376, + 1, 0, 0, 0, 1376, 1377, 1, 0, 0, 0, 1377, 1379, 5, 35, 0, 0, 1378, 1380, 5, 163, 0, 0, 1379, 1378, 1, 0, 0, 0, 1379, + 1380, 1, 0, 0, 0, 1380, 1383, 1, 0, 0, 0, 1381, 1382, 5, 117, 0, 0, 1382, 1384, 3, 184, 92, 0, 1383, 1381, 1, 0, 0, + 0, 1383, 1384, 1, 0, 0, 0, 1384, 1385, 1, 0, 0, 0, 1385, 1386, 5, 150, 0, 0, 1386, 183, 1, 0, 0, 0, 1387, 1388, 6, + 92, -1, 0, 1388, 1394, 3, 358, 179, 0, 1389, 1390, 5, 138, 0, 0, 1390, 1394, 3, 184, 92, 8, 1391, 1392, 7, 6, 0, 0, + 1392, 1394, 3, 184, 92, 7, 1393, 1387, 1, 0, 0, 0, 1393, 1389, 1, 0, 0, 0, 1393, 1391, 1, 0, 0, 0, 1394, 1415, 1, 0, + 0, 0, 1395, 1396, 10, 6, 0, 0, 1396, 1397, 5, 136, 0, 0, 1397, 1414, 3, 184, 92, 6, 1398, 1399, 10, 5, 0, 0, 1399, + 1400, 7, 7, 0, 0, 1400, 1414, 3, 184, 92, 6, 1401, 1402, 10, 4, 0, 0, 1402, 1403, 7, 8, 0, 0, 1403, 1414, 3, 184, + 92, 5, 1404, 1405, 10, 3, 0, 0, 1405, 1406, 7, 9, 0, 0, 1406, 1414, 3, 184, 92, 4, 1407, 1408, 10, 2, 0, 0, 1408, + 1409, 7, 10, 0, 0, 1409, 1414, 3, 184, 92, 3, 1410, 1411, 10, 1, 0, 0, 1411, 1412, 7, 11, 0, 0, 1412, 1414, 3, 184, + 92, 2, 1413, 1395, 1, 0, 0, 0, 1413, 1398, 1, 0, 0, 0, 1413, 1401, 1, 0, 0, 0, 1413, 1404, 1, 0, 0, 0, 1413, 1407, + 1, 0, 0, 0, 1413, 1410, 1, 0, 0, 0, 1414, 1417, 1, 0, 0, 0, 1415, 1413, 1, 0, 0, 0, 1415, 1416, 1, 0, 0, 0, 1416, + 185, 1, 0, 0, 0, 1417, 1415, 1, 0, 0, 0, 1418, 1421, 3, 184, 92, 0, 1419, 1421, 5, 105, 0, 0, 1420, 1418, 1, 0, 0, + 0, 1420, 1419, 1, 0, 0, 0, 1421, 187, 1, 0, 0, 0, 1422, 1426, 3, 190, 95, 0, 1423, 1426, 3, 192, 96, 0, 1424, 1426, + 3, 194, 97, 0, 1425, 1422, 1, 0, 0, 0, 1425, 1423, 1, 0, 0, 0, 1425, 1424, 1, 0, 0, 0, 1426, 189, 1, 0, 0, 0, 1427, + 1428, 5, 147, 0, 0, 1428, 1429, 5, 25, 0, 0, 1429, 1430, 3, 196, 98, 0, 1430, 1431, 5, 149, 0, 0, 1431, 1432, 3, + 296, 148, 0, 1432, 1433, 5, 148, 0, 0, 1433, 191, 1, 0, 0, 0, 1434, 1435, 5, 147, 0, 0, 1435, 1436, 5, 93, 0, 0, + 1436, 1437, 3, 196, 98, 0, 1437, 1438, 5, 149, 0, 0, 1438, 1439, 3, 296, 148, 0, 1439, 1440, 5, 148, 0, 0, 1440, + 193, 1, 0, 0, 0, 1441, 1442, 5, 147, 0, 0, 1442, 1443, 5, 109, 0, 0, 1443, 1444, 3, 196, 98, 0, 1444, 1445, 5, 149, + 0, 0, 1445, 1446, 3, 296, 148, 0, 1446, 1447, 5, 148, 0, 0, 1447, 195, 1, 0, 0, 0, 1448, 1452, 3, 336, 168, 0, 1449, + 1452, 3, 0, 0, 0, 1450, 1452, 3, 410, 205, 0, 1451, 1448, 1, 0, 0, 0, 1451, 1449, 1, 0, 0, 0, 1451, 1450, 1, 0, 0, + 0, 1452, 197, 1, 0, 0, 0, 1453, 1454, 5, 36, 0, 0, 1454, 1455, 3, 242, 121, 0, 1455, 1456, 5, 149, 0, 0, 1456, 1458, + 3, 484, 242, 0, 1457, 1459, 3, 202, 101, 0, 1458, 1457, 1, 0, 0, 0, 1458, 1459, 1, 0, 0, 0, 1459, 1460, 1, 0, 0, 0, + 1460, 1461, 5, 150, 0, 0, 1461, 199, 1, 0, 0, 0, 1462, 1463, 5, 36, 0, 0, 1463, 1464, 5, 64, 0, 0, 1464, 1465, 3, + 254, 127, 0, 1465, 201, 1, 0, 0, 0, 1466, 1467, 5, 66, 0, 0, 1467, 1469, 3, 184, 92, 0, 1468, 1466, 1, 0, 0, 0, + 1468, 1469, 1, 0, 0, 0, 1469, 1470, 1, 0, 0, 0, 1470, 1471, 5, 50, 0, 0, 1471, 1472, 3, 184, 92, 0, 1472, 203, 1, 0, + 0, 0, 1473, 1474, 5, 36, 0, 0, 1474, 1475, 5, 64, 0, 0, 1475, 1476, 3, 318, 159, 0, 1476, 205, 1, 0, 0, 0, 1477, + 1478, 5, 79, 0, 0, 1478, 1479, 5, 142, 0, 0, 1479, 1480, 5, 153, 0, 0, 1480, 1481, 5, 142, 0, 0, 1481, 207, 1, 0, 0, + 0, 1482, 1483, 3, 394, 197, 0, 1483, 209, 1, 0, 0, 0, 1484, 1485, 5, 163, 0, 0, 1485, 1486, 5, 149, 0, 0, 1486, + 1487, 5, 37, 0, 0, 1487, 1488, 3, 340, 170, 0, 1488, 1496, 5, 41, 0, 0, 1489, 1491, 3, 52, 26, 0, 1490, 1489, 1, 0, + 0, 0, 1491, 1494, 1, 0, 0, 0, 1492, 1490, 1, 0, 0, 0, 1492, 1493, 1, 0, 0, 0, 1493, 1495, 1, 0, 0, 0, 1494, 1492, 1, + 0, 0, 0, 1495, 1497, 5, 17, 0, 0, 1496, 1492, 1, 0, 0, 0, 1496, 1497, 1, 0, 0, 0, 1497, 1501, 1, 0, 0, 0, 1498, + 1500, 3, 94, 47, 0, 1499, 1498, 1, 0, 0, 0, 1500, 1503, 1, 0, 0, 0, 1501, 1499, 1, 0, 0, 0, 1501, 1502, 1, 0, 0, 0, + 1502, 1504, 1, 0, 0, 0, 1503, 1501, 1, 0, 0, 0, 1504, 1505, 5, 33, 0, 0, 1505, 1507, 5, 41, 0, 0, 1506, 1508, 5, + 163, 0, 0, 1507, 1506, 1, 0, 0, 0, 1507, 1508, 1, 0, 0, 0, 1508, 1509, 1, 0, 0, 0, 1509, 1510, 5, 150, 0, 0, 1510, + 211, 1, 0, 0, 0, 1511, 1513, 3, 318, 159, 0, 1512, 1514, 3, 452, 226, 0, 1513, 1512, 1, 0, 0, 0, 1513, 1514, 1, 0, + 0, 0, 1514, 213, 1, 0, 0, 0, 1515, 1516, 3, 278, 139, 0, 1516, 215, 1, 0, 0, 0, 1517, 1527, 3, 212, 106, 0, 1518, + 1521, 3, 318, 159, 0, 1519, 1521, 3, 318, 159, 0, 1520, 1518, 1, 0, 0, 0, 1520, 1519, 1, 0, 0, 0, 1521, 1522, 1, 0, + 0, 0, 1522, 1523, 5, 143, 0, 0, 1523, 1524, 3, 212, 106, 0, 1524, 1525, 5, 144, 0, 0, 1525, 1527, 1, 0, 0, 0, 1526, + 1517, 1, 0, 0, 0, 1526, 1520, 1, 0, 0, 0, 1527, 217, 1, 0, 0, 0, 1528, 1529, 5, 104, 0, 0, 1529, 1530, 5, 163, 0, 0, + 1530, 1531, 5, 50, 0, 0, 1531, 1532, 3, 496, 248, 0, 1532, 1533, 5, 150, 0, 0, 1533, 219, 1, 0, 0, 0, 1534, 1535, 3, + 318, 159, 0, 1535, 1536, 3, 232, 116, 0, 1536, 1537, 3, 338, 169, 0, 1537, 221, 1, 0, 0, 0, 1538, 1540, 7, 12, 0, 0, + 1539, 1538, 1, 0, 0, 0, 1539, 1540, 1, 0, 0, 0, 1540, 1541, 1, 0, 0, 0, 1541, 1542, 5, 39, 0, 0, 1542, 1550, 3, 132, + 66, 0, 1543, 1545, 5, 71, 0, 0, 1544, 1543, 1, 0, 0, 0, 1544, 1545, 1, 0, 0, 0, 1545, 1546, 1, 0, 0, 0, 1546, 1547, + 5, 143, 0, 0, 1547, 1548, 3, 214, 107, 0, 1548, 1549, 5, 144, 0, 0, 1549, 1551, 1, 0, 0, 0, 1550, 1544, 1, 0, 0, 0, + 1550, 1551, 1, 0, 0, 0, 1551, 1552, 1, 0, 0, 0, 1552, 1555, 5, 86, 0, 0, 1553, 1554, 5, 163, 0, 0, 1554, 1556, 5, + 64, 0, 0, 1555, 1553, 1, 0, 0, 0, 1555, 1556, 1, 0, 0, 0, 1556, 1557, 1, 0, 0, 0, 1557, 1558, 3, 318, 159, 0, 1558, + 223, 1, 0, 0, 0, 1559, 1563, 3, 138, 69, 0, 1560, 1563, 3, 184, 92, 0, 1561, 1563, 5, 163, 0, 0, 1562, 1559, 1, 0, + 0, 0, 1562, 1560, 1, 0, 0, 0, 1562, 1561, 1, 0, 0, 0, 1563, 225, 1, 0, 0, 0, 1564, 1568, 3, 210, 105, 0, 1565, 1568, + 3, 244, 122, 0, 1566, 1568, 3, 60, 30, 0, 1567, 1564, 1, 0, 0, 0, 1567, 1565, 1, 0, 0, 0, 1567, 1566, 1, 0, 0, 0, + 1568, 227, 1, 0, 0, 0, 1569, 1571, 3, 52, 26, 0, 1570, 1569, 1, 0, 0, 0, 1571, 1574, 1, 0, 0, 0, 1572, 1570, 1, 0, + 0, 0, 1572, 1573, 1, 0, 0, 0, 1573, 1575, 1, 0, 0, 0, 1574, 1572, 1, 0, 0, 0, 1575, 1577, 5, 17, 0, 0, 1576, 1572, + 1, 0, 0, 0, 1576, 1577, 1, 0, 0, 0, 1577, 1581, 1, 0, 0, 0, 1578, 1580, 3, 94, 47, 0, 1579, 1578, 1, 0, 0, 0, 1580, + 1583, 1, 0, 0, 0, 1581, 1579, 1, 0, 0, 0, 1581, 1582, 1, 0, 0, 0, 1582, 1589, 1, 0, 0, 0, 1583, 1581, 1, 0, 0, 0, + 1584, 1586, 5, 33, 0, 0, 1585, 1587, 5, 163, 0, 0, 1586, 1585, 1, 0, 0, 0, 1586, 1587, 1, 0, 0, 0, 1587, 1588, 1, 0, + 0, 0, 1588, 1590, 5, 150, 0, 0, 1589, 1584, 1, 0, 0, 0, 1589, 1590, 1, 0, 0, 0, 1590, 229, 1, 0, 0, 0, 1591, 1592, + 5, 42, 0, 0, 1592, 1593, 5, 143, 0, 0, 1593, 1598, 3, 272, 136, 0, 1594, 1595, 5, 150, 0, 0, 1595, 1597, 3, 272, + 136, 0, 1596, 1594, 1, 0, 0, 0, 1597, 1600, 1, 0, 0, 0, 1598, 1596, 1, 0, 0, 0, 1598, 1599, 1, 0, 0, 0, 1599, 1602, + 1, 0, 0, 0, 1600, 1598, 1, 0, 0, 0, 1601, 1603, 5, 150, 0, 0, 1602, 1601, 1, 0, 0, 0, 1602, 1603, 1, 0, 0, 0, 1603, + 1604, 1, 0, 0, 0, 1604, 1605, 5, 144, 0, 0, 1605, 1606, 5, 150, 0, 0, 1606, 231, 1, 0, 0, 0, 1607, 1608, 5, 42, 0, + 0, 1608, 1609, 5, 56, 0, 0, 1609, 1610, 5, 143, 0, 0, 1610, 1611, 3, 40, 20, 0, 1611, 1612, 5, 144, 0, 0, 1612, 233, + 1, 0, 0, 0, 1613, 1616, 3, 318, 159, 0, 1614, 1616, 5, 161, 0, 0, 1615, 1613, 1, 0, 0, 0, 1615, 1614, 1, 0, 0, 0, + 1616, 235, 1, 0, 0, 0, 1617, 1618, 5, 44, 0, 0, 1618, 1619, 5, 163, 0, 0, 1619, 1620, 5, 149, 0, 0, 1620, 1621, 3, + 318, 159, 0, 1621, 1622, 5, 143, 0, 0, 1622, 1627, 3, 234, 117, 0, 1623, 1624, 5, 151, 0, 0, 1624, 1626, 3, 234, + 117, 0, 1625, 1623, 1, 0, 0, 0, 1626, 1629, 1, 0, 0, 0, 1627, 1625, 1, 0, 0, 0, 1627, 1628, 1, 0, 0, 0, 1628, 1630, + 1, 0, 0, 0, 1629, 1627, 1, 0, 0, 0, 1630, 1631, 5, 144, 0, 0, 1631, 1632, 5, 150, 0, 0, 1632, 237, 1, 0, 0, 0, 1633, + 1634, 5, 44, 0, 0, 1634, 1635, 5, 163, 0, 0, 1635, 1636, 5, 50, 0, 0, 1636, 1637, 5, 143, 0, 0, 1637, 1642, 3, 162, + 81, 0, 1638, 1639, 5, 151, 0, 0, 1639, 1641, 3, 162, 81, 0, 1640, 1638, 1, 0, 0, 0, 1641, 1644, 1, 0, 0, 0, 1642, + 1640, 1, 0, 0, 0, 1642, 1643, 1, 0, 0, 0, 1643, 1645, 1, 0, 0, 0, 1644, 1642, 1, 0, 0, 0, 1645, 1646, 5, 144, 0, 0, + 1646, 1647, 5, 150, 0, 0, 1647, 239, 1, 0, 0, 0, 1648, 1649, 3, 450, 225, 0, 1649, 1650, 5, 149, 0, 0, 1650, 1651, + 3, 318, 159, 0, 1651, 241, 1, 0, 0, 0, 1652, 1657, 5, 163, 0, 0, 1653, 1654, 5, 151, 0, 0, 1654, 1656, 5, 163, 0, 0, + 1655, 1653, 1, 0, 0, 0, 1656, 1659, 1, 0, 0, 0, 1657, 1655, 1, 0, 0, 0, 1657, 1658, 1, 0, 0, 0, 1658, 243, 1, 0, 0, + 0, 1659, 1657, 1, 0, 0, 0, 1660, 1661, 5, 163, 0, 0, 1661, 1662, 5, 149, 0, 0, 1662, 1665, 5, 45, 0, 0, 1663, 1664, + 5, 163, 0, 0, 1664, 1666, 5, 149, 0, 0, 1665, 1663, 1, 0, 0, 0, 1665, 1666, 1, 0, 0, 0, 1666, 1667, 1, 0, 0, 0, + 1667, 1668, 3, 184, 92, 0, 1668, 1669, 5, 41, 0, 0, 1669, 1681, 3, 228, 114, 0, 1670, 1673, 5, 32, 0, 0, 1671, 1672, + 5, 163, 0, 0, 1672, 1674, 5, 149, 0, 0, 1673, 1671, 1, 0, 0, 0, 1673, 1674, 1, 0, 0, 0, 1674, 1675, 1, 0, 0, 0, + 1675, 1676, 3, 184, 92, 0, 1676, 1677, 5, 41, 0, 0, 1677, 1678, 3, 228, 114, 0, 1678, 1680, 1, 0, 0, 0, 1679, 1670, + 1, 0, 0, 0, 1680, 1683, 1, 0, 0, 0, 1681, 1679, 1, 0, 0, 0, 1681, 1682, 1, 0, 0, 0, 1682, 1691, 1, 0, 0, 0, 1683, + 1681, 1, 0, 0, 0, 1684, 1687, 5, 31, 0, 0, 1685, 1686, 5, 163, 0, 0, 1686, 1688, 5, 149, 0, 0, 1687, 1685, 1, 0, 0, + 0, 1687, 1688, 1, 0, 0, 0, 1688, 1689, 1, 0, 0, 0, 1689, 1690, 5, 41, 0, 0, 1690, 1692, 3, 228, 114, 0, 1691, 1684, + 1, 0, 0, 0, 1691, 1692, 1, 0, 0, 0, 1692, 1693, 1, 0, 0, 0, 1693, 1694, 5, 33, 0, 0, 1694, 1696, 5, 41, 0, 0, 1695, + 1697, 5, 163, 0, 0, 1696, 1695, 1, 0, 0, 0, 1696, 1697, 1, 0, 0, 0, 1697, 1698, 1, 0, 0, 0, 1698, 1699, 5, 150, 0, + 0, 1699, 245, 1, 0, 0, 0, 1700, 1701, 5, 163, 0, 0, 1701, 1703, 5, 149, 0, 0, 1702, 1700, 1, 0, 0, 0, 1702, 1703, 1, + 0, 0, 0, 1703, 1704, 1, 0, 0, 0, 1704, 1705, 5, 45, 0, 0, 1705, 1706, 3, 184, 92, 0, 1706, 1710, 5, 101, 0, 0, 1707, + 1709, 3, 444, 222, 0, 1708, 1707, 1, 0, 0, 0, 1709, 1712, 1, 0, 0, 0, 1710, 1708, 1, 0, 0, 0, 1710, 1711, 1, 0, 0, + 0, 1711, 1724, 1, 0, 0, 0, 1712, 1710, 1, 0, 0, 0, 1713, 1714, 5, 32, 0, 0, 1714, 1715, 3, 184, 92, 0, 1715, 1719, + 5, 101, 0, 0, 1716, 1718, 3, 444, 222, 0, 1717, 1716, 1, 0, 0, 0, 1718, 1721, 1, 0, 0, 0, 1719, 1717, 1, 0, 0, 0, + 1719, 1720, 1, 0, 0, 0, 1720, 1723, 1, 0, 0, 0, 1721, 1719, 1, 0, 0, 0, 1722, 1713, 1, 0, 0, 0, 1723, 1726, 1, 0, 0, + 0, 1724, 1722, 1, 0, 0, 0, 1724, 1725, 1, 0, 0, 0, 1725, 1734, 1, 0, 0, 0, 1726, 1724, 1, 0, 0, 0, 1727, 1731, 5, + 31, 0, 0, 1728, 1730, 3, 444, 222, 0, 1729, 1728, 1, 0, 0, 0, 1730, 1733, 1, 0, 0, 0, 1731, 1729, 1, 0, 0, 0, 1731, + 1732, 1, 0, 0, 0, 1732, 1735, 1, 0, 0, 0, 1733, 1731, 1, 0, 0, 0, 1734, 1727, 1, 0, 0, 0, 1734, 1735, 1, 0, 0, 0, + 1735, 1736, 1, 0, 0, 0, 1736, 1737, 5, 33, 0, 0, 1737, 1739, 5, 45, 0, 0, 1738, 1740, 5, 163, 0, 0, 1739, 1738, 1, + 0, 0, 0, 1739, 1740, 1, 0, 0, 0, 1740, 1741, 1, 0, 0, 0, 1741, 1742, 5, 150, 0, 0, 1742, 247, 1, 0, 0, 0, 1743, + 1746, 3, 484, 242, 0, 1744, 1746, 3, 500, 250, 0, 1745, 1743, 1, 0, 0, 0, 1745, 1744, 1, 0, 0, 0, 1746, 249, 1, 0, + 0, 0, 1747, 1748, 5, 104, 0, 0, 1748, 1749, 5, 163, 0, 0, 1749, 1750, 5, 150, 0, 0, 1750, 251, 1, 0, 0, 0, 1751, + 1761, 3, 362, 181, 0, 1752, 1761, 3, 418, 209, 0, 1753, 1761, 3, 140, 70, 0, 1754, 1761, 3, 264, 132, 0, 1755, 1761, + 3, 346, 173, 0, 1756, 1761, 3, 206, 103, 0, 1757, 1761, 3, 26, 13, 0, 1758, 1761, 3, 2, 1, 0, 1759, 1761, 3, 200, + 100, 0, 1760, 1751, 1, 0, 0, 0, 1760, 1752, 1, 0, 0, 0, 1760, 1753, 1, 0, 0, 0, 1760, 1754, 1, 0, 0, 0, 1760, 1755, + 1, 0, 0, 0, 1760, 1756, 1, 0, 0, 0, 1760, 1757, 1, 0, 0, 0, 1760, 1758, 1, 0, 0, 0, 1760, 1759, 1, 0, 0, 0, 1761, + 253, 1, 0, 0, 0, 1762, 1765, 3, 318, 159, 0, 1763, 1765, 3, 500, 250, 0, 1764, 1762, 1, 0, 0, 0, 1764, 1763, 1, 0, + 0, 0, 1765, 255, 1, 0, 0, 0, 1766, 1767, 5, 143, 0, 0, 1767, 1772, 3, 138, 69, 0, 1768, 1769, 5, 151, 0, 0, 1769, + 1771, 3, 138, 69, 0, 1770, 1768, 1, 0, 0, 0, 1771, 1774, 1, 0, 0, 0, 1772, 1770, 1, 0, 0, 0, 1772, 1773, 1, 0, 0, 0, + 1773, 1775, 1, 0, 0, 0, 1774, 1772, 1, 0, 0, 0, 1775, 1776, 5, 144, 0, 0, 1776, 257, 1, 0, 0, 0, 1777, 1778, 3, 318, + 159, 0, 1778, 1779, 5, 79, 0, 0, 1779, 1780, 5, 142, 0, 0, 1780, 259, 1, 0, 0, 0, 1781, 1783, 5, 23, 0, 0, 1782, + 1781, 1, 0, 0, 0, 1782, 1783, 1, 0, 0, 0, 1783, 1784, 1, 0, 0, 0, 1784, 1795, 3, 318, 159, 0, 1785, 1786, 5, 34, 0, + 0, 1786, 1790, 3, 318, 159, 0, 1787, 1788, 5, 143, 0, 0, 1788, 1789, 5, 163, 0, 0, 1789, 1791, 5, 144, 0, 0, 1790, + 1787, 1, 0, 0, 0, 1790, 1791, 1, 0, 0, 0, 1791, 1795, 1, 0, 0, 0, 1792, 1793, 5, 24, 0, 0, 1793, 1795, 3, 318, 159, + 0, 1794, 1782, 1, 0, 0, 0, 1794, 1785, 1, 0, 0, 0, 1794, 1792, 1, 0, 0, 0, 1795, 261, 1, 0, 0, 0, 1796, 1801, 5, + 163, 0, 0, 1797, 1798, 5, 151, 0, 0, 1798, 1800, 5, 163, 0, 0, 1799, 1797, 1, 0, 0, 0, 1800, 1803, 1, 0, 0, 0, 1801, + 1799, 1, 0, 0, 0, 1801, 1802, 1, 0, 0, 0, 1802, 1807, 1, 0, 0, 0, 1803, 1801, 1, 0, 0, 0, 1804, 1807, 5, 68, 0, 0, + 1805, 1807, 5, 10, 0, 0, 1806, 1796, 1, 0, 0, 0, 1806, 1804, 1, 0, 0, 0, 1806, 1805, 1, 0, 0, 0, 1807, 263, 1, 0, 0, + 0, 1808, 1809, 5, 79, 0, 0, 1809, 1810, 5, 142, 0, 0, 1810, 265, 1, 0, 0, 0, 1811, 1812, 3, 394, 197, 0, 1812, 267, + 1, 0, 0, 0, 1813, 1815, 5, 25, 0, 0, 1814, 1813, 1, 0, 0, 0, 1814, 1815, 1, 0, 0, 0, 1815, 1816, 1, 0, 0, 0, 1816, + 1817, 3, 242, 121, 0, 1817, 1819, 5, 149, 0, 0, 1818, 1820, 5, 47, 0, 0, 1819, 1818, 1, 0, 0, 0, 1819, 1820, 1, 0, + 0, 0, 1820, 1821, 1, 0, 0, 0, 1821, 1824, 3, 484, 242, 0, 1822, 1823, 5, 141, 0, 0, 1823, 1825, 3, 184, 92, 0, 1824, + 1822, 1, 0, 0, 0, 1824, 1825, 1, 0, 0, 0, 1825, 269, 1, 0, 0, 0, 1826, 1833, 3, 268, 134, 0, 1827, 1833, 3, 298, + 149, 0, 1828, 1833, 3, 274, 137, 0, 1829, 1833, 3, 294, 147, 0, 1830, 1833, 3, 288, 144, 0, 1831, 1833, 3, 280, 140, + 0, 1832, 1826, 1, 0, 0, 0, 1832, 1827, 1, 0, 0, 0, 1832, 1828, 1, 0, 0, 0, 1832, 1829, 1, 0, 0, 0, 1832, 1830, 1, 0, + 0, 0, 1832, 1831, 1, 0, 0, 0, 1833, 271, 1, 0, 0, 0, 1834, 1835, 3, 270, 135, 0, 1835, 273, 1, 0, 0, 0, 1836, 1837, + 5, 36, 0, 0, 1837, 1838, 3, 242, 121, 0, 1838, 1839, 5, 149, 0, 0, 1839, 1840, 3, 484, 242, 0, 1840, 275, 1, 0, 0, + 0, 1841, 1843, 7, 12, 0, 0, 1842, 1841, 1, 0, 0, 0, 1842, 1843, 1, 0, 0, 0, 1843, 1844, 1, 0, 0, 0, 1844, 1845, 5, + 39, 0, 0, 1845, 1853, 3, 132, 66, 0, 1846, 1848, 5, 71, 0, 0, 1847, 1846, 1, 0, 0, 0, 1847, 1848, 1, 0, 0, 0, 1848, + 1849, 1, 0, 0, 0, 1849, 1850, 5, 143, 0, 0, 1850, 1851, 3, 214, 107, 0, 1851, 1852, 5, 144, 0, 0, 1852, 1854, 1, 0, + 0, 0, 1853, 1847, 1, 0, 0, 0, 1853, 1854, 1, 0, 0, 0, 1854, 1855, 1, 0, 0, 0, 1855, 1856, 5, 86, 0, 0, 1856, 1857, + 3, 318, 159, 0, 1857, 277, 1, 0, 0, 0, 1858, 1863, 3, 272, 136, 0, 1859, 1860, 5, 150, 0, 0, 1860, 1862, 3, 272, + 136, 0, 1861, 1859, 1, 0, 0, 0, 1862, 1865, 1, 0, 0, 0, 1863, 1861, 1, 0, 0, 0, 1863, 1864, 1, 0, 0, 0, 1864, 1867, + 1, 0, 0, 0, 1865, 1863, 1, 0, 0, 0, 1866, 1868, 5, 150, 0, 0, 1867, 1866, 1, 0, 0, 0, 1867, 1868, 1, 0, 0, 0, 1868, + 279, 1, 0, 0, 0, 1869, 1870, 5, 70, 0, 0, 1870, 1871, 5, 163, 0, 0, 1871, 1872, 5, 50, 0, 0, 1872, 1873, 5, 59, 0, + 0, 1873, 1874, 3, 318, 159, 0, 1874, 1875, 3, 282, 141, 0, 1875, 281, 1, 0, 0, 0, 1876, 1883, 3, 232, 116, 0, 1877, + 1878, 5, 42, 0, 0, 1878, 1879, 5, 56, 0, 0, 1879, 1880, 5, 143, 0, 0, 1880, 1881, 7, 13, 0, 0, 1881, 1883, 5, 144, + 0, 0, 1882, 1876, 1, 0, 0, 0, 1882, 1877, 1, 0, 0, 0, 1883, 283, 1, 0, 0, 0, 1884, 1885, 5, 75, 0, 0, 1885, 1893, 5, + 163, 0, 0, 1886, 1888, 5, 71, 0, 0, 1887, 1886, 1, 0, 0, 0, 1887, 1888, 1, 0, 0, 0, 1888, 1889, 1, 0, 0, 0, 1889, + 1890, 5, 143, 0, 0, 1890, 1891, 3, 214, 107, 0, 1891, 1892, 5, 144, 0, 0, 1892, 1894, 1, 0, 0, 0, 1893, 1887, 1, 0, + 0, 0, 1893, 1894, 1, 0, 0, 0, 1894, 285, 1, 0, 0, 0, 1895, 1897, 5, 93, 0, 0, 1896, 1895, 1, 0, 0, 0, 1896, 1897, 1, + 0, 0, 0, 1897, 1898, 1, 0, 0, 0, 1898, 1899, 3, 242, 121, 0, 1899, 1900, 5, 149, 0, 0, 1900, 1901, 3, 312, 156, 0, + 1901, 287, 1, 0, 0, 0, 1902, 1905, 3, 292, 146, 0, 1903, 1904, 5, 50, 0, 0, 1904, 1906, 3, 290, 145, 0, 1905, 1903, + 1, 0, 0, 0, 1905, 1906, 1, 0, 0, 0, 1906, 289, 1, 0, 0, 0, 1907, 1910, 3, 318, 159, 0, 1908, 1910, 5, 142, 0, 0, + 1909, 1907, 1, 0, 0, 0, 1909, 1908, 1, 0, 0, 0, 1910, 291, 1, 0, 0, 0, 1911, 1914, 3, 276, 138, 0, 1912, 1914, 3, + 284, 142, 0, 1913, 1911, 1, 0, 0, 0, 1913, 1912, 1, 0, 0, 0, 1914, 293, 1, 0, 0, 0, 1915, 1916, 5, 104, 0, 0, 1916, + 1919, 5, 163, 0, 0, 1917, 1918, 5, 50, 0, 0, 1918, 1920, 3, 252, 126, 0, 1919, 1917, 1, 0, 0, 0, 1919, 1920, 1, 0, + 0, 0, 1920, 295, 1, 0, 0, 0, 1921, 1924, 3, 484, 242, 0, 1922, 1924, 3, 500, 250, 0, 1923, 1921, 1, 0, 0, 0, 1923, + 1922, 1, 0, 0, 0, 1924, 297, 1, 0, 0, 0, 1925, 1927, 5, 109, 0, 0, 1926, 1925, 1, 0, 0, 0, 1926, 1927, 1, 0, 0, 0, + 1927, 1928, 1, 0, 0, 0, 1928, 1929, 3, 242, 121, 0, 1929, 1931, 5, 149, 0, 0, 1930, 1932, 3, 310, 155, 0, 1931, + 1930, 1, 0, 0, 0, 1931, 1932, 1, 0, 0, 0, 1932, 1933, 1, 0, 0, 0, 1933, 1936, 3, 296, 148, 0, 1934, 1935, 5, 141, 0, + 0, 1935, 1937, 3, 98, 49, 0, 1936, 1934, 1, 0, 0, 0, 1936, 1937, 1, 0, 0, 0, 1937, 299, 1, 0, 0, 0, 1938, 1939, 5, + 118, 0, 0, 1939, 1943, 3, 184, 92, 0, 1940, 1941, 5, 37, 0, 0, 1941, 1943, 3, 340, 170, 0, 1942, 1938, 1, 0, 0, 0, + 1942, 1940, 1, 0, 0, 0, 1943, 301, 1, 0, 0, 0, 1944, 1945, 5, 52, 0, 0, 1945, 1950, 5, 163, 0, 0, 1946, 1947, 5, + 151, 0, 0, 1947, 1949, 5, 163, 0, 0, 1948, 1946, 1, 0, 0, 0, 1949, 1952, 1, 0, 0, 0, 1950, 1948, 1, 0, 0, 0, 1950, + 1951, 1, 0, 0, 0, 1951, 1953, 1, 0, 0, 0, 1952, 1950, 1, 0, 0, 0, 1953, 1954, 5, 150, 0, 0, 1954, 303, 1, 0, 0, 0, + 1955, 1963, 3, 164, 82, 0, 1956, 1963, 3, 106, 53, 0, 1957, 1963, 3, 330, 165, 0, 1958, 1963, 3, 334, 167, 0, 1959, + 1963, 3, 120, 60, 0, 1960, 1963, 3, 20, 10, 0, 1961, 1963, 3, 326, 163, 0, 1962, 1955, 1, 0, 0, 0, 1962, 1956, 1, 0, + 0, 0, 1962, 1957, 1, 0, 0, 0, 1962, 1958, 1, 0, 0, 0, 1962, 1959, 1, 0, 0, 0, 1962, 1960, 1, 0, 0, 0, 1962, 1961, 1, + 0, 0, 0, 1963, 305, 1, 0, 0, 0, 1964, 1970, 3, 324, 162, 0, 1965, 1970, 3, 178, 89, 0, 1966, 1970, 5, 162, 0, 0, + 1967, 1970, 5, 160, 0, 0, 1968, 1970, 5, 63, 0, 0, 1969, 1964, 1, 0, 0, 0, 1969, 1965, 1, 0, 0, 0, 1969, 1966, 1, 0, + 0, 0, 1969, 1967, 1, 0, 0, 0, 1969, 1968, 1, 0, 0, 0, 1970, 307, 1, 0, 0, 0, 1971, 1972, 5, 163, 0, 0, 1972, 1974, + 5, 149, 0, 0, 1973, 1971, 1, 0, 0, 0, 1973, 1974, 1, 0, 0, 0, 1974, 1976, 1, 0, 0, 0, 1975, 1977, 3, 300, 150, 0, + 1976, 1975, 1, 0, 0, 0, 1976, 1977, 1, 0, 0, 0, 1977, 1978, 1, 0, 0, 0, 1978, 1982, 5, 54, 0, 0, 1979, 1981, 3, 444, + 222, 0, 1980, 1979, 1, 0, 0, 0, 1981, 1984, 1, 0, 0, 0, 1982, 1980, 1, 0, 0, 0, 1982, 1983, 1, 0, 0, 0, 1983, 1985, + 1, 0, 0, 0, 1984, 1982, 1, 0, 0, 0, 1985, 1986, 5, 33, 0, 0, 1986, 1988, 5, 54, 0, 0, 1987, 1989, 5, 163, 0, 0, + 1988, 1987, 1, 0, 0, 0, 1988, 1989, 1, 0, 0, 0, 1989, 1990, 1, 0, 0, 0, 1990, 1991, 5, 150, 0, 0, 1991, 309, 1, 0, + 0, 0, 1992, 1993, 7, 14, 0, 0, 1993, 311, 1, 0, 0, 0, 1994, 1998, 3, 458, 229, 0, 1995, 1998, 3, 32, 16, 0, 1996, + 1998, 3, 408, 204, 0, 1997, 1994, 1, 0, 0, 0, 1997, 1995, 1, 0, 0, 0, 1997, 1996, 1, 0, 0, 0, 1998, 313, 1, 0, 0, 0, + 1999, 2000, 5, 110, 0, 0, 2000, 2001, 5, 163, 0, 0, 2001, 2002, 5, 64, 0, 0, 2002, 2003, 3, 484, 242, 0, 2003, 2007, + 5, 50, 0, 0, 2004, 2006, 3, 316, 158, 0, 2005, 2004, 1, 0, 0, 0, 2006, 2009, 1, 0, 0, 0, 2007, 2005, 1, 0, 0, 0, + 2007, 2008, 1, 0, 0, 0, 2008, 2010, 1, 0, 0, 0, 2009, 2007, 1, 0, 0, 0, 2010, 2011, 5, 33, 0, 0, 2011, 2013, 5, 110, + 0, 0, 2012, 2014, 5, 163, 0, 0, 2013, 2012, 1, 0, 0, 0, 2013, 2014, 1, 0, 0, 0, 2014, 2015, 1, 0, 0, 0, 2015, 2016, + 5, 150, 0, 0, 2016, 315, 1, 0, 0, 0, 2017, 2018, 3, 400, 200, 0, 2018, 2019, 5, 149, 0, 0, 2019, 2020, 3, 150, 75, + 0, 2020, 2021, 5, 150, 0, 0, 2021, 317, 1, 0, 0, 0, 2022, 2023, 6, 159, -1, 0, 2023, 2028, 5, 163, 0, 0, 2024, 2028, + 5, 162, 0, 0, 2025, 2028, 5, 161, 0, 0, 2026, 2028, 3, 188, 94, 0, 2027, 2022, 1, 0, 0, 0, 2027, 2024, 1, 0, 0, 0, + 2027, 2025, 1, 0, 0, 0, 2027, 2026, 1, 0, 0, 0, 2028, 2063, 1, 0, 0, 0, 2029, 2030, 10, 5, 0, 0, 2030, 2031, 5, 153, + 0, 0, 2031, 2062, 3, 486, 243, 0, 2032, 2033, 10, 4, 0, 0, 2033, 2034, 5, 143, 0, 0, 2034, 2039, 3, 184, 92, 0, + 2035, 2036, 5, 151, 0, 0, 2036, 2038, 3, 184, 92, 0, 2037, 2035, 1, 0, 0, 0, 2038, 2041, 1, 0, 0, 0, 2039, 2037, 1, + 0, 0, 0, 2039, 2040, 1, 0, 0, 0, 2040, 2042, 1, 0, 0, 0, 2041, 2039, 1, 0, 0, 0, 2042, 2043, 5, 144, 0, 0, 2043, + 2062, 1, 0, 0, 0, 2044, 2045, 10, 3, 0, 0, 2045, 2046, 5, 143, 0, 0, 2046, 2047, 3, 138, 69, 0, 2047, 2048, 5, 144, + 0, 0, 2048, 2062, 1, 0, 0, 0, 2049, 2051, 10, 2, 0, 0, 2050, 2052, 3, 452, 226, 0, 2051, 2050, 1, 0, 0, 0, 2051, + 2052, 1, 0, 0, 0, 2052, 2053, 1, 0, 0, 0, 2053, 2054, 5, 157, 0, 0, 2054, 2059, 3, 44, 22, 0, 2055, 2056, 5, 143, 0, + 0, 2056, 2057, 3, 184, 92, 0, 2057, 2058, 5, 144, 0, 0, 2058, 2060, 1, 0, 0, 0, 2059, 2055, 1, 0, 0, 0, 2059, 2060, + 1, 0, 0, 0, 2060, 2062, 1, 0, 0, 0, 2061, 2029, 1, 0, 0, 0, 2061, 2032, 1, 0, 0, 0, 2061, 2044, 1, 0, 0, 0, 2061, + 2049, 1, 0, 0, 0, 2062, 2065, 1, 0, 0, 0, 2063, 2061, 1, 0, 0, 0, 2063, 2064, 1, 0, 0, 0, 2064, 319, 1, 0, 0, 0, + 2065, 2063, 1, 0, 0, 0, 2066, 2067, 5, 163, 0, 0, 2067, 2069, 5, 149, 0, 0, 2068, 2066, 1, 0, 0, 0, 2068, 2069, 1, + 0, 0, 0, 2069, 2070, 1, 0, 0, 0, 2070, 2072, 5, 60, 0, 0, 2071, 2073, 5, 163, 0, 0, 2072, 2071, 1, 0, 0, 0, 2072, + 2073, 1, 0, 0, 0, 2073, 2076, 1, 0, 0, 0, 2074, 2075, 5, 117, 0, 0, 2075, 2077, 3, 184, 92, 0, 2076, 2074, 1, 0, 0, + 0, 2076, 2077, 1, 0, 0, 0, 2077, 2078, 1, 0, 0, 0, 2078, 2079, 5, 150, 0, 0, 2079, 321, 1, 0, 0, 0, 2080, 2081, 5, + 163, 0, 0, 2081, 2083, 5, 149, 0, 0, 2082, 2080, 1, 0, 0, 0, 2082, 2083, 1, 0, 0, 0, 2083, 2084, 1, 0, 0, 0, 2084, + 2085, 5, 63, 0, 0, 2085, 2086, 5, 150, 0, 0, 2086, 323, 1, 0, 0, 0, 2087, 2090, 5, 159, 0, 0, 2088, 2090, 3, 348, + 174, 0, 2089, 2087, 1, 0, 0, 0, 2089, 2088, 1, 0, 0, 0, 2090, 325, 1, 0, 0, 0, 2091, 2092, 5, 70, 0, 0, 2092, 2093, + 5, 19, 0, 0, 2093, 2094, 5, 163, 0, 0, 2094, 2098, 5, 50, 0, 0, 2095, 2097, 3, 328, 164, 0, 2096, 2095, 1, 0, 0, 0, + 2097, 2100, 1, 0, 0, 0, 2098, 2096, 1, 0, 0, 0, 2098, 2099, 1, 0, 0, 0, 2099, 2101, 1, 0, 0, 0, 2100, 2098, 1, 0, 0, + 0, 2101, 2104, 5, 33, 0, 0, 2102, 2103, 5, 70, 0, 0, 2103, 2105, 5, 19, 0, 0, 2104, 2102, 1, 0, 0, 0, 2104, 2105, 1, + 0, 0, 0, 2105, 2107, 1, 0, 0, 0, 2106, 2108, 5, 163, 0, 0, 2107, 2106, 1, 0, 0, 0, 2107, 2108, 1, 0, 0, 0, 2108, + 2109, 1, 0, 0, 0, 2109, 2110, 5, 150, 0, 0, 2110, 327, 1, 0, 0, 0, 2111, 2129, 3, 472, 236, 0, 2112, 2129, 3, 470, + 235, 0, 2113, 2129, 3, 476, 238, 0, 2114, 2129, 3, 330, 165, 0, 2115, 2129, 3, 326, 163, 0, 2116, 2129, 3, 334, 167, + 0, 2117, 2129, 3, 494, 247, 0, 2118, 2129, 3, 482, 241, 0, 2119, 2129, 3, 114, 57, 0, 2120, 2129, 3, 508, 254, 0, + 2121, 2129, 3, 198, 99, 0, 2122, 2129, 3, 12, 6, 0, 2123, 2129, 3, 42, 21, 0, 2124, 2129, 3, 46, 23, 0, 2125, 2129, + 3, 502, 251, 0, 2126, 2129, 3, 238, 119, 0, 2127, 2129, 3, 236, 118, 0, 2128, 2111, 1, 0, 0, 0, 2128, 2112, 1, 0, 0, + 0, 2128, 2113, 1, 0, 0, 0, 2128, 2114, 1, 0, 0, 0, 2128, 2115, 1, 0, 0, 0, 2128, 2116, 1, 0, 0, 0, 2128, 2117, 1, 0, + 0, 0, 2128, 2118, 1, 0, 0, 0, 2128, 2119, 1, 0, 0, 0, 2128, 2120, 1, 0, 0, 0, 2128, 2121, 1, 0, 0, 0, 2128, 2122, 1, + 0, 0, 0, 2128, 2123, 1, 0, 0, 0, 2128, 2124, 1, 0, 0, 0, 2128, 2125, 1, 0, 0, 0, 2128, 2126, 1, 0, 0, 0, 2128, 2127, + 1, 0, 0, 0, 2129, 329, 1, 0, 0, 0, 2130, 2131, 5, 70, 0, 0, 2131, 2132, 5, 163, 0, 0, 2132, 2134, 5, 50, 0, 0, 2133, + 2135, 3, 230, 115, 0, 2134, 2133, 1, 0, 0, 0, 2134, 2135, 1, 0, 0, 0, 2135, 2139, 1, 0, 0, 0, 2136, 2138, 3, 332, + 166, 0, 2137, 2136, 1, 0, 0, 0, 2138, 2141, 1, 0, 0, 0, 2139, 2137, 1, 0, 0, 0, 2139, 2140, 1, 0, 0, 0, 2140, 2142, + 1, 0, 0, 0, 2141, 2139, 1, 0, 0, 0, 2142, 2144, 5, 33, 0, 0, 2143, 2145, 5, 70, 0, 0, 2144, 2143, 1, 0, 0, 0, 2144, + 2145, 1, 0, 0, 0, 2145, 2147, 1, 0, 0, 0, 2146, 2148, 5, 163, 0, 0, 2147, 2146, 1, 0, 0, 0, 2147, 2148, 1, 0, 0, 0, + 2148, 2149, 1, 0, 0, 0, 2149, 2150, 5, 150, 0, 0, 2150, 331, 1, 0, 0, 0, 2151, 2170, 3, 472, 236, 0, 2152, 2170, 3, + 476, 238, 0, 2153, 2170, 3, 330, 165, 0, 2154, 2170, 3, 334, 167, 0, 2155, 2170, 3, 494, 247, 0, 2156, 2170, 3, 482, + 241, 0, 2157, 2170, 3, 114, 57, 0, 2158, 2170, 3, 448, 224, 0, 2159, 2170, 3, 508, 254, 0, 2160, 2170, 3, 198, 99, + 0, 2161, 2170, 3, 12, 6, 0, 2162, 2170, 3, 72, 36, 0, 2163, 2170, 3, 42, 21, 0, 2164, 2170, 3, 46, 23, 0, 2165, + 2170, 3, 136, 68, 0, 2166, 2170, 3, 502, 251, 0, 2167, 2170, 3, 238, 119, 0, 2168, 2170, 3, 236, 118, 0, 2169, 2151, + 1, 0, 0, 0, 2169, 2152, 1, 0, 0, 0, 2169, 2153, 1, 0, 0, 0, 2169, 2154, 1, 0, 0, 0, 2169, 2155, 1, 0, 0, 0, 2169, + 2156, 1, 0, 0, 0, 2169, 2157, 1, 0, 0, 0, 2169, 2158, 1, 0, 0, 0, 2169, 2159, 1, 0, 0, 0, 2169, 2160, 1, 0, 0, 0, + 2169, 2161, 1, 0, 0, 0, 2169, 2162, 1, 0, 0, 0, 2169, 2163, 1, 0, 0, 0, 2169, 2164, 1, 0, 0, 0, 2169, 2165, 1, 0, 0, + 0, 2169, 2166, 1, 0, 0, 0, 2169, 2167, 1, 0, 0, 0, 2169, 2168, 1, 0, 0, 0, 2170, 333, 1, 0, 0, 0, 2171, 2172, 5, 70, + 0, 0, 2172, 2173, 5, 163, 0, 0, 2173, 2174, 5, 50, 0, 0, 2174, 2175, 5, 59, 0, 0, 2175, 2177, 3, 318, 159, 0, 2176, + 2178, 3, 232, 116, 0, 2177, 2176, 1, 0, 0, 0, 2177, 2178, 1, 0, 0, 0, 2178, 2179, 1, 0, 0, 0, 2179, 2180, 5, 150, 0, + 0, 2180, 335, 1, 0, 0, 0, 2181, 2182, 5, 155, 0, 0, 2182, 2183, 5, 163, 0, 0, 2183, 2188, 5, 153, 0, 0, 2184, 2185, + 5, 163, 0, 0, 2185, 2187, 5, 153, 0, 0, 2186, 2184, 1, 0, 0, 0, 2187, 2190, 1, 0, 0, 0, 2188, 2186, 1, 0, 0, 0, + 2188, 2189, 1, 0, 0, 0, 2189, 2191, 1, 0, 0, 0, 2190, 2188, 1, 0, 0, 0, 2191, 2192, 5, 163, 0, 0, 2192, 337, 1, 0, + 0, 0, 2193, 2194, 5, 71, 0, 0, 2194, 2196, 5, 56, 0, 0, 2195, 2193, 1, 0, 0, 0, 2195, 2196, 1, 0, 0, 0, 2196, 2197, + 1, 0, 0, 0, 2197, 2198, 5, 143, 0, 0, 2198, 2199, 3, 40, 20, 0, 2199, 2200, 5, 144, 0, 0, 2200, 339, 1, 0, 0, 0, + 2201, 2202, 5, 163, 0, 0, 2202, 2203, 5, 47, 0, 0, 2203, 2204, 3, 138, 69, 0, 2204, 341, 1, 0, 0, 0, 2205, 2206, 3, + 344, 172, 0, 2206, 2207, 5, 153, 0, 0, 2207, 2209, 1, 0, 0, 0, 2208, 2205, 1, 0, 0, 0, 2209, 2212, 1, 0, 0, 0, 2210, + 2208, 1, 0, 0, 0, 2210, 2211, 1, 0, 0, 0, 2211, 2213, 1, 0, 0, 0, 2212, 2210, 1, 0, 0, 0, 2213, 2214, 5, 163, 0, 0, + 2214, 343, 1, 0, 0, 0, 2215, 2216, 5, 163, 0, 0, 2216, 345, 1, 0, 0, 0, 2217, 2218, 5, 106, 0, 0, 2218, 2219, 5, + 142, 0, 0, 2219, 347, 1, 0, 0, 0, 2220, 2222, 5, 159, 0, 0, 2221, 2220, 1, 0, 0, 0, 2221, 2222, 1, 0, 0, 0, 2222, + 2223, 1, 0, 0, 0, 2223, 2224, 3, 318, 159, 0, 2224, 349, 1, 0, 0, 0, 2225, 2226, 3, 394, 197, 0, 2226, 2227, 5, 106, + 0, 0, 2227, 2228, 5, 163, 0, 0, 2228, 2232, 5, 150, 0, 0, 2229, 2231, 3, 422, 211, 0, 2230, 2229, 1, 0, 0, 0, 2231, + 2234, 1, 0, 0, 0, 2232, 2230, 1, 0, 0, 0, 2232, 2233, 1, 0, 0, 0, 2233, 2235, 1, 0, 0, 0, 2234, 2232, 1, 0, 0, 0, + 2235, 2236, 5, 33, 0, 0, 2236, 2238, 5, 106, 0, 0, 2237, 2239, 5, 163, 0, 0, 2238, 2237, 1, 0, 0, 0, 2238, 2239, 1, + 0, 0, 0, 2239, 351, 1, 0, 0, 0, 2240, 2241, 5, 163, 0, 0, 2241, 2243, 5, 149, 0, 0, 2242, 2240, 1, 0, 0, 0, 2242, + 2243, 1, 0, 0, 0, 2243, 2244, 1, 0, 0, 0, 2244, 2247, 5, 86, 0, 0, 2245, 2246, 5, 117, 0, 0, 2246, 2248, 3, 184, 92, + 0, 2247, 2245, 1, 0, 0, 0, 2247, 2248, 1, 0, 0, 0, 2248, 2249, 1, 0, 0, 0, 2249, 2250, 5, 150, 0, 0, 2250, 353, 1, + 0, 0, 0, 2251, 2252, 5, 72, 0, 0, 2252, 2253, 5, 143, 0, 0, 2253, 2258, 3, 286, 143, 0, 2254, 2255, 5, 150, 0, 0, + 2255, 2257, 3, 286, 143, 0, 2256, 2254, 1, 0, 0, 0, 2257, 2260, 1, 0, 0, 0, 2258, 2256, 1, 0, 0, 0, 2258, 2259, 1, + 0, 0, 0, 2259, 2262, 1, 0, 0, 0, 2260, 2258, 1, 0, 0, 0, 2261, 2263, 5, 150, 0, 0, 2262, 2261, 1, 0, 0, 0, 2262, + 2263, 1, 0, 0, 0, 2263, 2264, 1, 0, 0, 0, 2264, 2265, 5, 144, 0, 0, 2265, 2266, 5, 150, 0, 0, 2266, 355, 1, 0, 0, 0, + 2267, 2268, 5, 72, 0, 0, 2268, 2269, 5, 56, 0, 0, 2269, 2270, 5, 143, 0, 0, 2270, 2271, 3, 40, 20, 0, 2271, 2272, 5, + 144, 0, 0, 2272, 357, 1, 0, 0, 0, 2273, 2285, 3, 318, 159, 0, 2274, 2285, 3, 306, 153, 0, 2275, 2285, 3, 10, 5, 0, + 2276, 2285, 3, 220, 110, 0, 2277, 2285, 3, 390, 195, 0, 2278, 2285, 3, 492, 246, 0, 2279, 2285, 3, 18, 9, 0, 2280, + 2281, 5, 143, 0, 0, 2281, 2282, 3, 184, 92, 0, 2282, 2283, 5, 144, 0, 0, 2283, 2285, 1, 0, 0, 0, 2284, 2273, 1, 0, + 0, 0, 2284, 2274, 1, 0, 0, 0, 2284, 2275, 1, 0, 0, 0, 2284, 2276, 1, 0, 0, 0, 2284, 2277, 1, 0, 0, 0, 2284, 2278, 1, + 0, 0, 0, 2284, 2279, 1, 0, 0, 0, 2284, 2280, 1, 0, 0, 0, 2285, 359, 1, 0, 0, 0, 2286, 2287, 5, 74, 0, 0, 2287, 2288, + 3, 508, 254, 0, 2288, 361, 1, 0, 0, 0, 2289, 2290, 5, 74, 0, 0, 2290, 363, 1, 0, 0, 0, 2291, 2293, 3, 318, 159, 0, + 2292, 2294, 3, 232, 116, 0, 2293, 2292, 1, 0, 0, 0, 2293, 2294, 1, 0, 0, 0, 2294, 2296, 1, 0, 0, 0, 2295, 2297, 3, + 338, 169, 0, 2296, 2295, 1, 0, 0, 0, 2296, 2297, 1, 0, 0, 0, 2297, 365, 1, 0, 0, 0, 2298, 2299, 5, 163, 0, 0, 2299, + 2301, 5, 149, 0, 0, 2300, 2298, 1, 0, 0, 0, 2300, 2301, 1, 0, 0, 0, 2301, 2302, 1, 0, 0, 0, 2302, 2303, 3, 364, 182, + 0, 2303, 2304, 5, 150, 0, 0, 2304, 367, 1, 0, 0, 0, 2305, 2306, 5, 75, 0, 0, 2306, 2314, 5, 163, 0, 0, 2307, 2309, + 5, 71, 0, 0, 2308, 2307, 1, 0, 0, 0, 2308, 2309, 1, 0, 0, 0, 2309, 2310, 1, 0, 0, 0, 2310, 2311, 5, 143, 0, 0, 2311, + 2312, 3, 214, 107, 0, 2312, 2313, 5, 144, 0, 0, 2313, 2315, 1, 0, 0, 0, 2314, 2308, 1, 0, 0, 0, 2314, 2315, 1, 0, 0, + 0, 2315, 369, 1, 0, 0, 0, 2316, 2334, 3, 472, 236, 0, 2317, 2334, 3, 470, 235, 0, 2318, 2334, 3, 476, 238, 0, 2319, + 2334, 3, 330, 165, 0, 2320, 2334, 3, 326, 163, 0, 2321, 2334, 3, 334, 167, 0, 2322, 2334, 3, 494, 247, 0, 2323, + 2334, 3, 482, 241, 0, 2324, 2334, 3, 114, 57, 0, 2325, 2334, 3, 508, 254, 0, 2326, 2334, 3, 198, 99, 0, 2327, 2334, + 3, 12, 6, 0, 2328, 2334, 3, 42, 21, 0, 2329, 2334, 3, 46, 23, 0, 2330, 2334, 3, 502, 251, 0, 2331, 2334, 3, 238, + 119, 0, 2332, 2334, 3, 236, 118, 0, 2333, 2316, 1, 0, 0, 0, 2333, 2317, 1, 0, 0, 0, 2333, 2318, 1, 0, 0, 0, 2333, + 2319, 1, 0, 0, 0, 2333, 2320, 1, 0, 0, 0, 2333, 2321, 1, 0, 0, 0, 2333, 2322, 1, 0, 0, 0, 2333, 2323, 1, 0, 0, 0, + 2333, 2324, 1, 0, 0, 0, 2333, 2325, 1, 0, 0, 0, 2333, 2326, 1, 0, 0, 0, 2333, 2327, 1, 0, 0, 0, 2333, 2328, 1, 0, 0, + 0, 2333, 2329, 1, 0, 0, 0, 2333, 2330, 1, 0, 0, 0, 2333, 2331, 1, 0, 0, 0, 2333, 2332, 1, 0, 0, 0, 2334, 371, 1, 0, + 0, 0, 2335, 2338, 3, 440, 220, 0, 2336, 2338, 5, 10, 0, 0, 2337, 2335, 1, 0, 0, 0, 2337, 2336, 1, 0, 0, 0, 2338, + 373, 1, 0, 0, 0, 2339, 2340, 5, 163, 0, 0, 2340, 2342, 5, 149, 0, 0, 2341, 2339, 1, 0, 0, 0, 2341, 2342, 1, 0, 0, 0, + 2342, 2343, 1, 0, 0, 0, 2343, 2348, 5, 76, 0, 0, 2344, 2345, 5, 143, 0, 0, 2345, 2346, 3, 372, 186, 0, 2346, 2347, + 5, 144, 0, 0, 2347, 2349, 1, 0, 0, 0, 2348, 2344, 1, 0, 0, 0, 2348, 2349, 1, 0, 0, 0, 2349, 2351, 1, 0, 0, 0, 2350, + 2352, 5, 50, 0, 0, 2351, 2350, 1, 0, 0, 0, 2351, 2352, 1, 0, 0, 0, 2352, 2356, 1, 0, 0, 0, 2353, 2355, 3, 370, 185, + 0, 2354, 2353, 1, 0, 0, 0, 2355, 2358, 1, 0, 0, 0, 2356, 2354, 1, 0, 0, 0, 2356, 2357, 1, 0, 0, 0, 2357, 2359, 1, 0, + 0, 0, 2358, 2356, 1, 0, 0, 0, 2359, 2363, 5, 17, 0, 0, 2360, 2362, 3, 444, 222, 0, 2361, 2360, 1, 0, 0, 0, 2362, + 2365, 1, 0, 0, 0, 2363, 2361, 1, 0, 0, 0, 2363, 2364, 1, 0, 0, 0, 2364, 2366, 1, 0, 0, 0, 2365, 2363, 1, 0, 0, 0, + 2366, 2367, 5, 33, 0, 0, 2367, 2369, 5, 76, 0, 0, 2368, 2370, 5, 163, 0, 0, 2369, 2368, 1, 0, 0, 0, 2369, 2370, 1, + 0, 0, 0, 2370, 2371, 1, 0, 0, 0, 2371, 2372, 5, 150, 0, 0, 2372, 375, 1, 0, 0, 0, 2373, 2374, 5, 163, 0, 0, 2374, + 2376, 5, 149, 0, 0, 2375, 2373, 1, 0, 0, 0, 2375, 2376, 1, 0, 0, 0, 2376, 2377, 1, 0, 0, 0, 2377, 2378, 5, 73, 0, 0, + 2378, 2383, 5, 76, 0, 0, 2379, 2380, 5, 143, 0, 0, 2380, 2381, 3, 440, 220, 0, 2381, 2382, 5, 144, 0, 0, 2382, 2384, + 1, 0, 0, 0, 2383, 2379, 1, 0, 0, 0, 2383, 2384, 1, 0, 0, 0, 2384, 2386, 1, 0, 0, 0, 2385, 2387, 5, 50, 0, 0, 2386, + 2385, 1, 0, 0, 0, 2386, 2387, 1, 0, 0, 0, 2387, 2391, 1, 0, 0, 0, 2388, 2390, 3, 370, 185, 0, 2389, 2388, 1, 0, 0, + 0, 2390, 2393, 1, 0, 0, 0, 2391, 2389, 1, 0, 0, 0, 2391, 2392, 1, 0, 0, 0, 2392, 2394, 1, 0, 0, 0, 2393, 2391, 1, 0, + 0, 0, 2394, 2398, 5, 17, 0, 0, 2395, 2397, 3, 444, 222, 0, 2396, 2395, 1, 0, 0, 0, 2397, 2400, 1, 0, 0, 0, 2398, + 2396, 1, 0, 0, 0, 2398, 2399, 1, 0, 0, 0, 2399, 2401, 1, 0, 0, 0, 2400, 2398, 1, 0, 0, 0, 2401, 2403, 5, 33, 0, 0, + 2402, 2404, 5, 73, 0, 0, 2403, 2402, 1, 0, 0, 0, 2403, 2404, 1, 0, 0, 0, 2404, 2405, 1, 0, 0, 0, 2405, 2407, 5, 76, + 0, 0, 2406, 2408, 5, 163, 0, 0, 2407, 2406, 1, 0, 0, 0, 2407, 2408, 1, 0, 0, 0, 2408, 2409, 1, 0, 0, 0, 2409, 2410, + 5, 150, 0, 0, 2410, 377, 1, 0, 0, 0, 2411, 2412, 5, 77, 0, 0, 2412, 2416, 5, 19, 0, 0, 2413, 2415, 3, 380, 190, 0, + 2414, 2413, 1, 0, 0, 0, 2415, 2418, 1, 0, 0, 0, 2416, 2414, 1, 0, 0, 0, 2416, 2417, 1, 0, 0, 0, 2417, 2419, 1, 0, 0, + 0, 2418, 2416, 1, 0, 0, 0, 2419, 2420, 5, 33, 0, 0, 2420, 2421, 5, 77, 0, 0, 2421, 2423, 5, 19, 0, 0, 2422, 2424, 5, + 163, 0, 0, 2423, 2422, 1, 0, 0, 0, 2423, 2424, 1, 0, 0, 0, 2424, 379, 1, 0, 0, 0, 2425, 2443, 3, 472, 236, 0, 2426, + 2443, 3, 470, 235, 0, 2427, 2443, 3, 476, 238, 0, 2428, 2443, 3, 330, 165, 0, 2429, 2443, 3, 326, 163, 0, 2430, + 2443, 3, 334, 167, 0, 2431, 2443, 3, 494, 247, 0, 2432, 2443, 3, 482, 241, 0, 2433, 2443, 3, 114, 57, 0, 2434, 2443, + 3, 508, 254, 0, 2435, 2443, 3, 198, 99, 0, 2436, 2443, 3, 12, 6, 0, 2437, 2443, 3, 42, 21, 0, 2438, 2443, 3, 46, 23, + 0, 2439, 2443, 3, 502, 251, 0, 2440, 2443, 3, 238, 119, 0, 2441, 2443, 3, 236, 118, 0, 2442, 2425, 1, 0, 0, 0, 2442, + 2426, 1, 0, 0, 0, 2442, 2427, 1, 0, 0, 0, 2442, 2428, 1, 0, 0, 0, 2442, 2429, 1, 0, 0, 0, 2442, 2430, 1, 0, 0, 0, + 2442, 2431, 1, 0, 0, 0, 2442, 2432, 1, 0, 0, 0, 2442, 2433, 1, 0, 0, 0, 2442, 2434, 1, 0, 0, 0, 2442, 2435, 1, 0, 0, + 0, 2442, 2436, 1, 0, 0, 0, 2442, 2437, 1, 0, 0, 0, 2442, 2438, 1, 0, 0, 0, 2442, 2439, 1, 0, 0, 0, 2442, 2440, 1, 0, + 0, 0, 2442, 2441, 1, 0, 0, 0, 2443, 381, 1, 0, 0, 0, 2444, 2448, 5, 77, 0, 0, 2445, 2447, 3, 384, 192, 0, 2446, + 2445, 1, 0, 0, 0, 2447, 2450, 1, 0, 0, 0, 2448, 2446, 1, 0, 0, 0, 2448, 2449, 1, 0, 0, 0, 2449, 2451, 1, 0, 0, 0, + 2450, 2448, 1, 0, 0, 0, 2451, 2452, 5, 33, 0, 0, 2452, 2454, 5, 77, 0, 0, 2453, 2455, 5, 163, 0, 0, 2454, 2453, 1, + 0, 0, 0, 2454, 2455, 1, 0, 0, 0, 2455, 383, 1, 0, 0, 0, 2456, 2463, 3, 472, 236, 0, 2457, 2463, 3, 476, 238, 0, + 2458, 2463, 3, 360, 180, 0, 2459, 2463, 3, 12, 6, 0, 2460, 2463, 3, 46, 23, 0, 2461, 2463, 3, 502, 251, 0, 2462, + 2456, 1, 0, 0, 0, 2462, 2457, 1, 0, 0, 0, 2462, 2458, 1, 0, 0, 0, 2462, 2459, 1, 0, 0, 0, 2462, 2460, 1, 0, 0, 0, + 2462, 2461, 1, 0, 0, 0, 2463, 385, 1, 0, 0, 0, 2464, 2467, 3, 382, 191, 0, 2465, 2467, 3, 378, 189, 0, 2466, 2464, + 1, 0, 0, 0, 2466, 2465, 1, 0, 0, 0, 2467, 387, 1, 0, 0, 0, 2468, 2469, 5, 59, 0, 0, 2469, 2471, 3, 318, 159, 0, + 2470, 2472, 3, 232, 116, 0, 2471, 2470, 1, 0, 0, 0, 2471, 2472, 1, 0, 0, 0, 2472, 389, 1, 0, 0, 0, 2473, 2474, 3, + 318, 159, 0, 2474, 2481, 5, 157, 0, 0, 2475, 2482, 1, 0, 0, 0, 2476, 2477, 5, 143, 0, 0, 2477, 2478, 3, 184, 92, 0, + 2478, 2479, 5, 144, 0, 0, 2479, 2482, 1, 0, 0, 0, 2480, 2482, 3, 10, 5, 0, 2481, 2475, 1, 0, 0, 0, 2481, 2476, 1, 0, + 0, 0, 2481, 2480, 1, 0, 0, 0, 2482, 391, 1, 0, 0, 0, 2483, 2487, 3, 318, 159, 0, 2484, 2487, 3, 460, 230, 0, 2485, + 2487, 3, 184, 92, 0, 2486, 2483, 1, 0, 0, 0, 2486, 2484, 1, 0, 0, 0, 2486, 2485, 1, 0, 0, 0, 2487, 393, 1, 0, 0, 0, + 2488, 2489, 5, 79, 0, 0, 2489, 2490, 3, 392, 196, 0, 2490, 395, 1, 0, 0, 0, 2491, 2492, 5, 143, 0, 0, 2492, 2497, 3, + 398, 199, 0, 2493, 2494, 5, 151, 0, 0, 2494, 2496, 3, 398, 199, 0, 2495, 2493, 1, 0, 0, 0, 2496, 2499, 1, 0, 0, 0, + 2497, 2495, 1, 0, 0, 0, 2497, 2498, 1, 0, 0, 0, 2498, 2500, 1, 0, 0, 0, 2499, 2497, 1, 0, 0, 0, 2500, 2501, 5, 144, + 0, 0, 2501, 397, 1, 0, 0, 0, 2502, 2503, 5, 163, 0, 0, 2503, 2504, 3, 146, 73, 0, 2504, 399, 1, 0, 0, 0, 2505, 2510, + 5, 163, 0, 0, 2506, 2507, 5, 151, 0, 0, 2507, 2509, 5, 163, 0, 0, 2508, 2506, 1, 0, 0, 0, 2509, 2512, 1, 0, 0, 0, + 2510, 2508, 1, 0, 0, 0, 2510, 2511, 1, 0, 0, 0, 2511, 401, 1, 0, 0, 0, 2512, 2510, 1, 0, 0, 0, 2513, 2514, 5, 163, + 0, 0, 2514, 2515, 3, 414, 207, 0, 2515, 403, 1, 0, 0, 0, 2516, 2521, 3, 402, 201, 0, 2517, 2518, 5, 151, 0, 0, 2518, + 2520, 3, 402, 201, 0, 2519, 2517, 1, 0, 0, 0, 2520, 2523, 1, 0, 0, 0, 2521, 2519, 1, 0, 0, 0, 2521, 2522, 1, 0, 0, + 0, 2522, 405, 1, 0, 0, 0, 2523, 2521, 1, 0, 0, 0, 2524, 2528, 5, 80, 0, 0, 2525, 2527, 3, 148, 74, 0, 2526, 2525, 1, + 0, 0, 0, 2527, 2530, 1, 0, 0, 0, 2528, 2526, 1, 0, 0, 0, 2528, 2529, 1, 0, 0, 0, 2529, 2531, 1, 0, 0, 0, 2530, 2528, + 1, 0, 0, 0, 2531, 2532, 5, 33, 0, 0, 2532, 2534, 5, 80, 0, 0, 2533, 2535, 5, 163, 0, 0, 2534, 2533, 1, 0, 0, 0, + 2534, 2535, 1, 0, 0, 0, 2535, 407, 1, 0, 0, 0, 2536, 2537, 5, 110, 0, 0, 2537, 2540, 3, 318, 159, 0, 2538, 2539, 5, + 64, 0, 0, 2539, 2541, 3, 484, 242, 0, 2540, 2538, 1, 0, 0, 0, 2540, 2541, 1, 0, 0, 0, 2541, 409, 1, 0, 0, 0, 2542, + 2543, 5, 156, 0, 0, 2543, 2545, 5, 153, 0, 0, 2544, 2542, 1, 0, 0, 0, 2545, 2548, 1, 0, 0, 0, 2546, 2544, 1, 0, 0, + 0, 2546, 2547, 1, 0, 0, 0, 2547, 2549, 1, 0, 0, 0, 2548, 2546, 1, 0, 0, 0, 2549, 2550, 3, 342, 171, 0, 2550, 411, 1, + 0, 0, 0, 2551, 2552, 5, 163, 0, 0, 2552, 2554, 5, 149, 0, 0, 2553, 2551, 1, 0, 0, 0, 2553, 2554, 1, 0, 0, 0, 2554, + 2555, 1, 0, 0, 0, 2555, 2556, 5, 85, 0, 0, 2556, 2559, 3, 184, 92, 0, 2557, 2558, 5, 91, 0, 0, 2558, 2560, 3, 184, + 92, 0, 2559, 2557, 1, 0, 0, 0, 2559, 2560, 1, 0, 0, 0, 2560, 2561, 1, 0, 0, 0, 2561, 2562, 5, 150, 0, 0, 2562, 413, + 1, 0, 0, 0, 2563, 2569, 3, 318, 159, 0, 2564, 2565, 5, 143, 0, 0, 2565, 2566, 3, 156, 78, 0, 2566, 2567, 5, 144, 0, + 0, 2567, 2569, 1, 0, 0, 0, 2568, 2563, 1, 0, 0, 0, 2568, 2564, 1, 0, 0, 0, 2569, 415, 1, 0, 0, 0, 2570, 2573, 3, + 352, 176, 0, 2571, 2573, 3, 504, 252, 0, 2572, 2570, 1, 0, 0, 0, 2572, 2571, 1, 0, 0, 0, 2573, 417, 1, 0, 0, 0, + 2574, 2575, 5, 142, 0, 0, 2575, 419, 1, 0, 0, 0, 2576, 2581, 3, 180, 90, 0, 2577, 2581, 3, 266, 133, 0, 2578, 2581, + 3, 208, 104, 0, 2579, 2581, 3, 350, 175, 0, 2580, 2576, 1, 0, 0, 0, 2580, 2577, 1, 0, 0, 0, 2580, 2578, 1, 0, 0, 0, + 2580, 2579, 1, 0, 0, 0, 2581, 421, 1, 0, 0, 0, 2582, 2583, 5, 163, 0, 0, 2583, 2585, 5, 121, 0, 0, 2584, 2586, 5, + 159, 0, 0, 2585, 2584, 1, 0, 0, 0, 2585, 2586, 1, 0, 0, 0, 2586, 2587, 1, 0, 0, 0, 2587, 2588, 5, 163, 0, 0, 2588, + 2589, 5, 150, 0, 0, 2589, 423, 1, 0, 0, 0, 2590, 2591, 3, 184, 92, 0, 2591, 2592, 5, 117, 0, 0, 2592, 2593, 3, 68, + 34, 0, 2593, 2594, 5, 151, 0, 0, 2594, 2596, 1, 0, 0, 0, 2595, 2590, 1, 0, 0, 0, 2596, 2599, 1, 0, 0, 0, 2597, 2595, + 1, 0, 0, 0, 2597, 2598, 1, 0, 0, 0, 2598, 2600, 1, 0, 0, 0, 2599, 2597, 1, 0, 0, 0, 2600, 2601, 3, 184, 92, 0, 2601, + 2602, 5, 117, 0, 0, 2602, 2603, 3, 68, 34, 0, 2603, 425, 1, 0, 0, 0, 2604, 2605, 5, 116, 0, 0, 2605, 2606, 3, 184, + 92, 0, 2606, 2608, 5, 90, 0, 0, 2607, 2609, 5, 154, 0, 0, 2608, 2607, 1, 0, 0, 0, 2608, 2609, 1, 0, 0, 0, 2609, + 2610, 1, 0, 0, 0, 2610, 2611, 3, 488, 244, 0, 2611, 2612, 5, 140, 0, 0, 2612, 2613, 5, 38, 0, 0, 2613, 2614, 7, 15, + 0, 0, 2614, 2615, 3, 424, 212, 0, 2615, 2616, 5, 150, 0, 0, 2616, 427, 1, 0, 0, 0, 2617, 2620, 5, 163, 0, 0, 2618, + 2619, 5, 153, 0, 0, 2619, 2621, 5, 163, 0, 0, 2620, 2618, 1, 0, 0, 0, 2621, 2622, 1, 0, 0, 0, 2622, 2620, 1, 0, 0, + 0, 2622, 2623, 1, 0, 0, 0, 2623, 2635, 1, 0, 0, 0, 2624, 2629, 5, 163, 0, 0, 2625, 2626, 5, 153, 0, 0, 2626, 2628, + 5, 163, 0, 0, 2627, 2625, 1, 0, 0, 0, 2628, 2631, 1, 0, 0, 0, 2629, 2627, 1, 0, 0, 0, 2629, 2630, 1, 0, 0, 0, 2630, + 2632, 1, 0, 0, 0, 2631, 2629, 1, 0, 0, 0, 2632, 2633, 5, 153, 0, 0, 2633, 2635, 5, 10, 0, 0, 2634, 2617, 1, 0, 0, 0, + 2634, 2624, 1, 0, 0, 0, 2635, 429, 1, 0, 0, 0, 2636, 2639, 3, 434, 217, 0, 2637, 2639, 3, 426, 213, 0, 2638, 2636, + 1, 0, 0, 0, 2638, 2637, 1, 0, 0, 0, 2639, 431, 1, 0, 0, 0, 2640, 2641, 5, 116, 0, 0, 2641, 2642, 3, 184, 92, 0, + 2642, 2644, 5, 90, 0, 0, 2643, 2645, 5, 154, 0, 0, 2644, 2643, 1, 0, 0, 0, 2644, 2645, 1, 0, 0, 0, 2645, 2646, 1, 0, + 0, 0, 2646, 2647, 3, 488, 244, 0, 2647, 2648, 5, 141, 0, 0, 2648, 2649, 3, 424, 212, 0, 2649, 2650, 5, 150, 0, 0, + 2650, 433, 1, 0, 0, 0, 2651, 2652, 5, 116, 0, 0, 2652, 2653, 3, 184, 92, 0, 2653, 2655, 5, 90, 0, 0, 2654, 2656, 5, + 154, 0, 0, 2655, 2654, 1, 0, 0, 0, 2655, 2656, 1, 0, 0, 0, 2656, 2657, 1, 0, 0, 0, 2657, 2658, 3, 488, 244, 0, 2658, + 2659, 5, 140, 0, 0, 2659, 2660, 3, 126, 63, 0, 2660, 2661, 3, 436, 218, 0, 2661, 2662, 5, 150, 0, 0, 2662, 435, 1, + 0, 0, 0, 2663, 2664, 3, 512, 256, 0, 2664, 2665, 5, 117, 0, 0, 2665, 2666, 3, 68, 34, 0, 2666, 2667, 5, 151, 0, 0, + 2667, 2669, 1, 0, 0, 0, 2668, 2663, 1, 0, 0, 0, 2669, 2672, 1, 0, 0, 0, 2670, 2668, 1, 0, 0, 0, 2670, 2671, 1, 0, 0, + 0, 2671, 2673, 1, 0, 0, 0, 2672, 2670, 1, 0, 0, 0, 2673, 2674, 3, 512, 256, 0, 2674, 2675, 5, 117, 0, 0, 2675, 2676, + 3, 68, 34, 0, 2676, 437, 1, 0, 0, 0, 2677, 2678, 5, 65, 0, 0, 2678, 2679, 3, 440, 220, 0, 2679, 439, 1, 0, 0, 0, + 2680, 2685, 3, 318, 159, 0, 2681, 2682, 5, 151, 0, 0, 2682, 2684, 3, 318, 159, 0, 2683, 2681, 1, 0, 0, 0, 2684, + 2687, 1, 0, 0, 0, 2685, 2683, 1, 0, 0, 0, 2685, 2686, 1, 0, 0, 0, 2686, 441, 1, 0, 0, 0, 2687, 2685, 1, 0, 0, 0, + 2688, 2689, 5, 163, 0, 0, 2689, 2691, 5, 149, 0, 0, 2690, 2688, 1, 0, 0, 0, 2690, 2691, 1, 0, 0, 0, 2691, 2692, 1, + 0, 0, 0, 2692, 2694, 5, 18, 0, 0, 2693, 2695, 5, 50, 0, 0, 2694, 2693, 1, 0, 0, 0, 2694, 2695, 1, 0, 0, 0, 2695, + 2699, 1, 0, 0, 0, 2696, 2698, 3, 370, 185, 0, 2697, 2696, 1, 0, 0, 0, 2698, 2701, 1, 0, 0, 0, 2699, 2697, 1, 0, 0, + 0, 2699, 2700, 1, 0, 0, 0, 2700, 2702, 1, 0, 0, 0, 2701, 2699, 1, 0, 0, 0, 2702, 2706, 5, 17, 0, 0, 2703, 2705, 3, + 444, 222, 0, 2704, 2703, 1, 0, 0, 0, 2705, 2708, 1, 0, 0, 0, 2706, 2704, 1, 0, 0, 0, 2706, 2707, 1, 0, 0, 0, 2707, + 2709, 1, 0, 0, 0, 2708, 2706, 1, 0, 0, 0, 2709, 2711, 5, 33, 0, 0, 2710, 2712, 5, 18, 0, 0, 2711, 2710, 1, 0, 0, 0, + 2711, 2712, 1, 0, 0, 0, 2712, 2714, 1, 0, 0, 0, 2713, 2715, 5, 163, 0, 0, 2714, 2713, 1, 0, 0, 0, 2714, 2715, 1, 0, + 0, 0, 2715, 2716, 1, 0, 0, 0, 2716, 2717, 5, 150, 0, 0, 2717, 443, 1, 0, 0, 0, 2718, 2733, 3, 510, 255, 0, 2719, + 2733, 3, 36, 18, 0, 2720, 2733, 3, 412, 206, 0, 2721, 2733, 3, 446, 223, 0, 2722, 2733, 3, 506, 253, 0, 2723, 2733, + 3, 366, 183, 0, 2724, 2733, 3, 246, 123, 0, 2725, 2733, 3, 62, 31, 0, 2726, 2733, 3, 308, 154, 0, 2727, 2733, 3, + 320, 160, 0, 2728, 2733, 3, 182, 91, 0, 2729, 2733, 3, 416, 208, 0, 2730, 2733, 3, 322, 161, 0, 2731, 2733, 3, 442, + 221, 0, 2732, 2718, 1, 0, 0, 0, 2732, 2719, 1, 0, 0, 0, 2732, 2720, 1, 0, 0, 0, 2732, 2721, 1, 0, 0, 0, 2732, 2722, + 1, 0, 0, 0, 2732, 2723, 1, 0, 0, 0, 2732, 2724, 1, 0, 0, 0, 2732, 2725, 1, 0, 0, 0, 2732, 2726, 1, 0, 0, 0, 2732, + 2727, 1, 0, 0, 0, 2732, 2728, 1, 0, 0, 0, 2732, 2729, 1, 0, 0, 0, 2732, 2730, 1, 0, 0, 0, 2732, 2731, 1, 0, 0, 0, + 2733, 445, 1, 0, 0, 0, 2734, 2735, 5, 163, 0, 0, 2735, 2737, 5, 149, 0, 0, 2736, 2734, 1, 0, 0, 0, 2736, 2737, 1, 0, + 0, 0, 2737, 2741, 1, 0, 0, 0, 2738, 2742, 3, 464, 232, 0, 2739, 2742, 3, 102, 51, 0, 2740, 2742, 3, 430, 215, 0, + 2741, 2738, 1, 0, 0, 0, 2741, 2739, 1, 0, 0, 0, 2741, 2740, 1, 0, 0, 0, 2742, 447, 1, 0, 0, 0, 2743, 2744, 5, 93, 0, + 0, 2744, 2745, 3, 242, 121, 0, 2745, 2746, 5, 149, 0, 0, 2746, 2748, 3, 484, 242, 0, 2747, 2749, 7, 16, 0, 0, 2748, + 2747, 1, 0, 0, 0, 2748, 2749, 1, 0, 0, 0, 2749, 2752, 1, 0, 0, 0, 2750, 2751, 5, 141, 0, 0, 2751, 2753, 3, 184, 92, + 0, 2752, 2750, 1, 0, 0, 0, 2752, 2753, 1, 0, 0, 0, 2753, 2754, 1, 0, 0, 0, 2754, 2755, 5, 150, 0, 0, 2755, 449, 1, + 0, 0, 0, 2756, 2761, 3, 318, 159, 0, 2757, 2758, 5, 151, 0, 0, 2758, 2760, 3, 318, 159, 0, 2759, 2757, 1, 0, 0, 0, + 2760, 2763, 1, 0, 0, 0, 2761, 2759, 1, 0, 0, 0, 2761, 2762, 1, 0, 0, 0, 2762, 2767, 1, 0, 0, 0, 2763, 2761, 1, 0, 0, + 0, 2764, 2767, 5, 68, 0, 0, 2765, 2767, 5, 10, 0, 0, 2766, 2756, 1, 0, 0, 0, 2766, 2764, 1, 0, 0, 0, 2766, 2765, 1, + 0, 0, 0, 2767, 451, 1, 0, 0, 0, 2768, 2777, 5, 145, 0, 0, 2769, 2774, 3, 318, 159, 0, 2770, 2771, 5, 151, 0, 0, + 2771, 2773, 3, 318, 159, 0, 2772, 2770, 1, 0, 0, 0, 2773, 2776, 1, 0, 0, 0, 2774, 2772, 1, 0, 0, 0, 2774, 2775, 1, + 0, 0, 0, 2775, 2778, 1, 0, 0, 0, 2776, 2774, 1, 0, 0, 0, 2777, 2769, 1, 0, 0, 0, 2777, 2778, 1, 0, 0, 0, 2778, 2781, + 1, 0, 0, 0, 2779, 2780, 5, 86, 0, 0, 2780, 2782, 3, 318, 159, 0, 2781, 2779, 1, 0, 0, 0, 2781, 2782, 1, 0, 0, 0, + 2782, 2783, 1, 0, 0, 0, 2783, 2784, 5, 146, 0, 0, 2784, 453, 1, 0, 0, 0, 2785, 2786, 5, 37, 0, 0, 2786, 2787, 3, 76, + 38, 0, 2787, 2788, 3, 48, 24, 0, 2788, 2792, 5, 150, 0, 0, 2789, 2790, 5, 33, 0, 0, 2790, 2791, 5, 37, 0, 0, 2791, + 2793, 5, 150, 0, 0, 2792, 2789, 1, 0, 0, 0, 2792, 2793, 1, 0, 0, 0, 2793, 455, 1, 0, 0, 0, 2794, 2795, 3, 488, 244, + 0, 2795, 2796, 5, 140, 0, 0, 2796, 2797, 5, 38, 0, 0, 2797, 2798, 7, 15, 0, 0, 2798, 2799, 3, 100, 50, 0, 2799, + 2800, 5, 150, 0, 0, 2800, 457, 1, 0, 0, 0, 2801, 2803, 3, 310, 155, 0, 2802, 2801, 1, 0, 0, 0, 2802, 2803, 1, 0, 0, + 0, 2803, 2804, 1, 0, 0, 0, 2804, 2806, 3, 296, 148, 0, 2805, 2807, 5, 21, 0, 0, 2806, 2805, 1, 0, 0, 0, 2806, 2807, + 1, 0, 0, 0, 2807, 2810, 1, 0, 0, 0, 2808, 2809, 5, 141, 0, 0, 2809, 2811, 3, 98, 49, 0, 2810, 2808, 1, 0, 0, 0, + 2810, 2811, 1, 0, 0, 0, 2811, 459, 1, 0, 0, 0, 2812, 2813, 3, 184, 92, 0, 2813, 2814, 3, 134, 67, 0, 2814, 2815, 3, + 184, 92, 0, 2815, 461, 1, 0, 0, 0, 2816, 2817, 3, 488, 244, 0, 2817, 2818, 5, 140, 0, 0, 2818, 2819, 7, 15, 0, 0, + 2819, 2820, 5, 150, 0, 0, 2820, 463, 1, 0, 0, 0, 2821, 2825, 3, 466, 233, 0, 2822, 2825, 3, 456, 228, 0, 2823, 2825, + 3, 462, 231, 0, 2824, 2821, 1, 0, 0, 0, 2824, 2822, 1, 0, 0, 0, 2824, 2823, 1, 0, 0, 0, 2825, 465, 1, 0, 0, 0, 2826, + 2827, 3, 488, 244, 0, 2827, 2829, 5, 140, 0, 0, 2828, 2830, 3, 126, 63, 0, 2829, 2828, 1, 0, 0, 0, 2829, 2830, 1, 0, + 0, 0, 2830, 2831, 1, 0, 0, 0, 2831, 2832, 3, 512, 256, 0, 2832, 2833, 5, 150, 0, 0, 2833, 467, 1, 0, 0, 0, 2834, + 2835, 3, 488, 244, 0, 2835, 2836, 5, 141, 0, 0, 2836, 2837, 3, 100, 50, 0, 2837, 2838, 5, 150, 0, 0, 2838, 469, 1, + 0, 0, 0, 2839, 2840, 3, 480, 240, 0, 2840, 2844, 5, 50, 0, 0, 2841, 2843, 3, 474, 237, 0, 2842, 2841, 1, 0, 0, 0, + 2843, 2846, 1, 0, 0, 0, 2844, 2842, 1, 0, 0, 0, 2844, 2845, 1, 0, 0, 0, 2845, 2847, 1, 0, 0, 0, 2846, 2844, 1, 0, 0, + 0, 2847, 2851, 5, 17, 0, 0, 2848, 2850, 3, 444, 222, 0, 2849, 2848, 1, 0, 0, 0, 2850, 2853, 1, 0, 0, 0, 2851, 2849, + 1, 0, 0, 0, 2851, 2852, 1, 0, 0, 0, 2852, 2854, 1, 0, 0, 0, 2853, 2851, 1, 0, 0, 0, 2854, 2856, 5, 33, 0, 0, 2855, + 2857, 3, 478, 239, 0, 2856, 2855, 1, 0, 0, 0, 2856, 2857, 1, 0, 0, 0, 2857, 2859, 1, 0, 0, 0, 2858, 2860, 3, 132, + 66, 0, 2859, 2858, 1, 0, 0, 0, 2859, 2860, 1, 0, 0, 0, 2860, 2861, 1, 0, 0, 0, 2861, 2862, 5, 150, 0, 0, 2862, 471, + 1, 0, 0, 0, 2863, 2864, 3, 480, 240, 0, 2864, 2865, 5, 150, 0, 0, 2865, 473, 1, 0, 0, 0, 2866, 2884, 3, 472, 236, 0, + 2867, 2884, 3, 470, 235, 0, 2868, 2884, 3, 476, 238, 0, 2869, 2884, 3, 330, 165, 0, 2870, 2884, 3, 326, 163, 0, + 2871, 2884, 3, 334, 167, 0, 2872, 2884, 3, 494, 247, 0, 2873, 2884, 3, 482, 241, 0, 2874, 2884, 3, 114, 57, 0, 2875, + 2884, 3, 508, 254, 0, 2876, 2884, 3, 198, 99, 0, 2877, 2884, 3, 12, 6, 0, 2878, 2884, 3, 42, 21, 0, 2879, 2884, 3, + 46, 23, 0, 2880, 2884, 3, 502, 251, 0, 2881, 2884, 3, 238, 119, 0, 2882, 2884, 3, 236, 118, 0, 2883, 2866, 1, 0, 0, + 0, 2883, 2867, 1, 0, 0, 0, 2883, 2868, 1, 0, 0, 0, 2883, 2869, 1, 0, 0, 0, 2883, 2870, 1, 0, 0, 0, 2883, 2871, 1, 0, + 0, 0, 2883, 2872, 1, 0, 0, 0, 2883, 2873, 1, 0, 0, 0, 2883, 2874, 1, 0, 0, 0, 2883, 2875, 1, 0, 0, 0, 2883, 2876, 1, + 0, 0, 0, 2883, 2877, 1, 0, 0, 0, 2883, 2878, 1, 0, 0, 0, 2883, 2879, 1, 0, 0, 0, 2883, 2880, 1, 0, 0, 0, 2883, 2881, + 1, 0, 0, 0, 2883, 2882, 1, 0, 0, 0, 2884, 475, 1, 0, 0, 0, 2885, 2886, 3, 478, 239, 0, 2886, 2887, 5, 163, 0, 0, + 2887, 2888, 5, 50, 0, 0, 2888, 2889, 5, 59, 0, 0, 2889, 2891, 3, 318, 159, 0, 2890, 2892, 3, 452, 226, 0, 2891, + 2890, 1, 0, 0, 0, 2891, 2892, 1, 0, 0, 0, 2892, 2894, 1, 0, 0, 0, 2893, 2895, 3, 232, 116, 0, 2894, 2893, 1, 0, 0, + 0, 2894, 2895, 1, 0, 0, 0, 2895, 2896, 1, 0, 0, 0, 2896, 2897, 5, 150, 0, 0, 2897, 477, 1, 0, 0, 0, 2898, 2899, 7, + 17, 0, 0, 2899, 479, 1, 0, 0, 0, 2900, 2903, 3, 368, 184, 0, 2901, 2903, 3, 222, 111, 0, 2902, 2900, 1, 0, 0, 0, + 2902, 2901, 1, 0, 0, 0, 2903, 481, 1, 0, 0, 0, 2904, 2905, 5, 98, 0, 0, 2905, 2906, 5, 163, 0, 0, 2906, 2907, 5, 50, + 0, 0, 2907, 2908, 3, 484, 242, 0, 2908, 2909, 5, 150, 0, 0, 2909, 483, 1, 0, 0, 0, 2910, 2912, 3, 414, 207, 0, 2911, + 2910, 1, 0, 0, 0, 2911, 2912, 1, 0, 0, 0, 2912, 2913, 1, 0, 0, 0, 2913, 2915, 3, 318, 159, 0, 2914, 2916, 3, 118, + 59, 0, 2915, 2914, 1, 0, 0, 0, 2915, 2916, 1, 0, 0, 0, 2916, 485, 1, 0, 0, 0, 2917, 2918, 7, 18, 0, 0, 2918, 487, 1, + 0, 0, 0, 2919, 2922, 3, 318, 159, 0, 2920, 2922, 3, 10, 5, 0, 2921, 2919, 1, 0, 0, 0, 2921, 2920, 1, 0, 0, 0, 2922, + 489, 1, 0, 0, 0, 2923, 2924, 5, 37, 0, 0, 2924, 2925, 3, 184, 92, 0, 2925, 491, 1, 0, 0, 0, 2926, 2927, 3, 318, 159, + 0, 2927, 2928, 5, 143, 0, 0, 2928, 2929, 3, 184, 92, 0, 2929, 2930, 5, 144, 0, 0, 2930, 493, 1, 0, 0, 0, 2931, 2934, + 3, 218, 109, 0, 2932, 2934, 3, 250, 125, 0, 2933, 2931, 1, 0, 0, 0, 2933, 2932, 1, 0, 0, 0, 2934, 495, 1, 0, 0, 0, + 2935, 2942, 3, 420, 210, 0, 2936, 2942, 3, 78, 39, 0, 2937, 2942, 3, 4, 2, 0, 2938, 2942, 3, 204, 102, 0, 2939, + 2942, 3, 386, 193, 0, 2940, 2942, 3, 388, 194, 0, 2941, 2935, 1, 0, 0, 0, 2941, 2936, 1, 0, 0, 0, 2941, 2937, 1, 0, + 0, 0, 2941, 2938, 1, 0, 0, 0, 2941, 2939, 1, 0, 0, 0, 2941, 2940, 1, 0, 0, 0, 2942, 497, 1, 0, 0, 0, 2943, 2944, 5, + 13, 0, 0, 2944, 2945, 5, 143, 0, 0, 2945, 2950, 3, 258, 129, 0, 2946, 2947, 5, 151, 0, 0, 2947, 2949, 3, 258, 129, + 0, 2948, 2946, 1, 0, 0, 0, 2949, 2952, 1, 0, 0, 0, 2950, 2948, 1, 0, 0, 0, 2950, 2951, 1, 0, 0, 0, 2951, 2953, 1, 0, + 0, 0, 2952, 2950, 1, 0, 0, 0, 2953, 2954, 5, 144, 0, 0, 2954, 2955, 5, 64, 0, 0, 2955, 2956, 3, 484, 242, 0, 2956, + 499, 1, 0, 0, 0, 2957, 2958, 5, 104, 0, 0, 2958, 2959, 5, 50, 0, 0, 2959, 2960, 3, 252, 126, 0, 2960, 501, 1, 0, 0, + 0, 2961, 2962, 5, 108, 0, 0, 2962, 2967, 3, 428, 214, 0, 2963, 2964, 5, 151, 0, 0, 2964, 2966, 3, 428, 214, 0, 2965, + 2963, 1, 0, 0, 0, 2966, 2969, 1, 0, 0, 0, 2967, 2965, 1, 0, 0, 0, 2967, 2968, 1, 0, 0, 0, 2968, 2970, 1, 0, 0, 0, + 2969, 2967, 1, 0, 0, 0, 2970, 2971, 5, 150, 0, 0, 2971, 503, 1, 0, 0, 0, 2972, 2973, 5, 163, 0, 0, 2973, 2975, 5, + 149, 0, 0, 2974, 2972, 1, 0, 0, 0, 2974, 2975, 1, 0, 0, 0, 2975, 2976, 1, 0, 0, 0, 2976, 2977, 5, 86, 0, 0, 2977, + 2978, 3, 100, 50, 0, 2978, 2979, 5, 150, 0, 0, 2979, 505, 1, 0, 0, 0, 2980, 2981, 5, 163, 0, 0, 2981, 2983, 5, 149, + 0, 0, 2982, 2980, 1, 0, 0, 0, 2982, 2983, 1, 0, 0, 0, 2983, 2986, 1, 0, 0, 0, 2984, 2987, 3, 468, 234, 0, 2985, + 2987, 3, 432, 216, 0, 2986, 2984, 1, 0, 0, 0, 2986, 2985, 1, 0, 0, 0, 2987, 507, 1, 0, 0, 0, 2988, 2990, 5, 92, 0, + 0, 2989, 2988, 1, 0, 0, 0, 2989, 2990, 1, 0, 0, 0, 2990, 2991, 1, 0, 0, 0, 2991, 2992, 5, 109, 0, 0, 2992, 2993, 3, + 242, 121, 0, 2993, 2994, 5, 149, 0, 0, 2994, 2996, 3, 484, 242, 0, 2995, 2997, 3, 232, 116, 0, 2996, 2995, 1, 0, 0, + 0, 2996, 2997, 1, 0, 0, 0, 2997, 3000, 1, 0, 0, 0, 2998, 2999, 5, 141, 0, 0, 2999, 3001, 3, 184, 92, 0, 3000, 2998, + 1, 0, 0, 0, 3000, 3001, 1, 0, 0, 0, 3001, 3002, 1, 0, 0, 0, 3002, 3003, 5, 150, 0, 0, 3003, 509, 1, 0, 0, 0, 3004, + 3005, 5, 163, 0, 0, 3005, 3007, 5, 149, 0, 0, 3006, 3004, 1, 0, 0, 0, 3006, 3007, 1, 0, 0, 0, 3007, 3008, 1, 0, 0, + 0, 3008, 3010, 5, 115, 0, 0, 3009, 3011, 3, 438, 219, 0, 3010, 3009, 1, 0, 0, 0, 3010, 3011, 1, 0, 0, 0, 3011, 3013, + 1, 0, 0, 0, 3012, 3014, 3, 96, 48, 0, 3013, 3012, 1, 0, 0, 0, 3013, 3014, 1, 0, 0, 0, 3014, 3016, 1, 0, 0, 0, 3015, + 3017, 3, 490, 245, 0, 3016, 3015, 1, 0, 0, 0, 3016, 3017, 1, 0, 0, 0, 3017, 3018, 1, 0, 0, 0, 3018, 3019, 5, 150, 0, + 0, 3019, 511, 1, 0, 0, 0, 3020, 3025, 3, 514, 257, 0, 3021, 3022, 5, 151, 0, 0, 3022, 3024, 3, 514, 257, 0, 3023, + 3021, 1, 0, 0, 0, 3024, 3027, 1, 0, 0, 0, 3025, 3023, 1, 0, 0, 0, 3025, 3026, 1, 0, 0, 0, 3026, 3030, 1, 0, 0, 0, + 3027, 3025, 1, 0, 0, 0, 3028, 3030, 5, 105, 0, 0, 3029, 3020, 1, 0, 0, 0, 3029, 3028, 1, 0, 0, 0, 3030, 513, 1, 0, + 0, 0, 3031, 3034, 3, 184, 92, 0, 3032, 3033, 5, 8, 0, 0, 3033, 3035, 3, 184, 92, 0, 3034, 3032, 1, 0, 0, 0, 3034, + 3035, 1, 0, 0, 0, 3035, 3042, 1, 0, 0, 0, 3036, 3039, 5, 63, 0, 0, 3037, 3038, 5, 8, 0, 0, 3038, 3040, 3, 184, 92, + 0, 3039, 3037, 1, 0, 0, 0, 3039, 3040, 1, 0, 0, 0, 3040, 3042, 1, 0, 0, 0, 3041, 3031, 1, 0, 0, 0, 3041, 3036, 1, 0, + 0, 0, 3042, 515, 1, 0, 0, 0, 351, 526, 532, 540, 548, 557, 562, 573, 583, 590, 595, 598, 607, 612, 617, 620, 625, + 629, 635, 637, 649, 656, 665, 671, 675, 679, 687, 696, 717, 720, 723, 730, 736, 765, 773, 775, 784, 787, 793, 795, + 801, 803, 808, 815, 821, 828, 842, 847, 853, 861, 866, 876, 882, 889, 897, 900, 909, 912, 915, 919, 922, 930, 933, + 944, 956, 959, 967, 970, 977, 980, 991, 994, 1001, 1004, 1009, 1014, 1017, 1027, 1032, 1037, 1040, 1045, 1056, 1064, + 1068, 1073, 1088, 1093, 1103, 1109, 1112, 1119, 1123, 1127, 1135, 1148, 1156, 1161, 1169, 1177, 1185, 1188, 1193, + 1200, 1217, 1231, 1237, 1246, 1250, 1257, 1264, 1269, 1275, 1281, 1284, 1289, 1296, 1299, 1303, 1306, 1330, 1334, + 1341, 1346, 1356, 1368, 1375, 1379, 1383, 1393, 1413, 1415, 1420, 1425, 1451, 1458, 1468, 1492, 1496, 1501, 1507, + 1513, 1520, 1526, 1539, 1544, 1550, 1555, 1562, 1567, 1572, 1576, 1581, 1586, 1589, 1598, 1602, 1615, 1627, 1642, + 1657, 1665, 1673, 1681, 1687, 1691, 1696, 1702, 1710, 1719, 1724, 1731, 1734, 1739, 1745, 1760, 1764, 1772, 1782, + 1790, 1794, 1801, 1806, 1814, 1819, 1824, 1832, 1842, 1847, 1853, 1863, 1867, 1882, 1887, 1893, 1896, 1905, 1909, + 1913, 1919, 1923, 1926, 1931, 1936, 1942, 1950, 1962, 1969, 1973, 1976, 1982, 1988, 1997, 2007, 2013, 2027, 2039, + 2051, 2059, 2061, 2063, 2068, 2072, 2076, 2082, 2089, 2098, 2104, 2107, 2128, 2134, 2139, 2144, 2147, 2169, 2177, + 2188, 2195, 2210, 2221, 2232, 2238, 2242, 2247, 2258, 2262, 2284, 2293, 2296, 2300, 2308, 2314, 2333, 2337, 2341, + 2348, 2351, 2356, 2363, 2369, 2375, 2383, 2386, 2391, 2398, 2403, 2407, 2416, 2423, 2442, 2448, 2454, 2462, 2466, + 2471, 2481, 2486, 2497, 2510, 2521, 2528, 2534, 2540, 2546, 2553, 2559, 2568, 2572, 2580, 2585, 2597, 2608, 2622, + 2629, 2634, 2638, 2644, 2655, 2670, 2685, 2690, 2694, 2699, 2706, 2711, 2714, 2732, 2736, 2741, 2748, 2752, 2761, + 2766, 2774, 2777, 2781, 2792, 2802, 2806, 2810, 2824, 2829, 2844, 2851, 2856, 2859, 2883, 2891, 2894, 2902, 2911, + 2915, 2921, 2933, 2941, 2950, 2967, 2974, 2982, 2986, 2989, 2996, 3000, 3006, 3010, 3013, 3016, 3025, 3029, 3034, + 3039, 3041 ) @@ -964,10 +1003,9 @@ class VHDLParser(Parser): "'return'", "'rol'", "'ror'", "'restrict'", "'select'", "'severity'", "'shared'", "'signal'", "'sla'", "'sll'", "'sra'", "'srl'", "'subtype'", "'strong'", "'sequence'", "'then'", "'to'", "'transport'", "'type'", "'unaffected'", "'units'", "'until'", "'use'", "'variable'", "'view'", "'vpkg'", "'vmode'", "'vprop'", "'vunit'", "'wait'", - "'with'", "'when'", "'while'", "'xnor'", "'xor'", "'='", "'/='", "'<'", "'<=)'", "'>'", "'>='", "'?='", "'?/='", - "'?<'", "'?<=)'", "'?>'", "'?>='", "'+'", "'-'", "'*'", "'/'", "'**'", "'&'", "'??'", "'=>'", "'<='", "':='", - "'<>'", "'('", "')'", "'['", "']'", "'<<'", "'>>'", "':'", "';'", "','", "'|'", "'.'", "'?'", "'@'", "'^'", "'''", - "'\"'" + "'with'", "'when'", "'while'", "'xnor'", "'xor'", "'='", "'/='", "'<'", "'>'", "'>='", "'?='", "'?/='", "'?<'", + "'?<='", "'?>'", "'?>='", "'+'", "'-'", "'*'", "'/'", "'**'", "'&'", "'??'", "'=>'", "'<='", "':='", "'<>'", "'('", + "')'", "'['", "']'", "'<<'", "'>>'", "':'", "';'", "','", "'|'", "'.'", "'?'", "'@'", "'^'", "'''", "'\"'" ) symbolicNames = ( @@ -976,7 +1014,7 @@ class VHDLParser(Parser): "KW_PSL_ASSUME", "KW_BEGIN", "KW_BLOCK", "KW_BODY", "KW_BUFFER", "KW_BUS", "KW_CASE", "KW_COMPONENT", "KW_CONFIGURATION", "KW_CONSTANT", "KW_CONTEXT", "KW_PSL_COVER", "KW_DEFAULT", "KW_DISCONNECT", "KW_DOWNTO", "KW_ELSE", "KW_ELSIF", "KW_END", "KW_ENTITY", "KW_EXIT", "KW_FILE", "KW_FOR", "KW_FORCE", "KW_FUNCTION", - "KW_PSL_FAIRNESS", "KW_GENERATE", "KW_GENERIC", "KW_GUARDED", "KW_PSL_GROUP", "KW_IF", "KW_IMPURE", "KW_IN", + "KW_PSL_FAIRNESS", "KW_GENERATE", "KW_GENERIC", "KW_GUARDED", "KW_GROUP", "KW_IF", "KW_IMPURE", "KW_IN", "KW_INERTIAL", "KW_INOUT", "KW_IS", "KW_LABEL", "KW_LIBRARY", "KW_LINKAGE", "KW_LOOP", "KW_PSL_LITERAL", "KW_MAP", "OP_MOD", "OP_NAND", "KW_NEW", "KW_NEXT", "OP_NOR", "OP_NOT", "KW_NULL", "KW_OF", "KW_ON", "KW_OPEN", "OP_OR", "KW_OTHERS", "KW_OUT", "KW_PACKAGE", "KW_PARAMETER", "KW_PORT", "KW_POSTPONED", "KW_PRIVATE", "KW_PROCEDURE", @@ -985,8 +1023,8 @@ class VHDLParser(Parser): "KW_SIGNAL", "OP_SLA", "OP_SLL", "OP_SRA", "OP_SRL", "KW_SUBTYPE", "KW_PSL_STRONG", "KW_PSL_SEQUENCE", "KW_THEN", "KW_TO", "KW_TRANSPORT", "KW_TYPE", "KW_UNAFFECTED", "KW_UNITS", "KW_UNTIL", "KW_USE", "KW_VARIABLE", "KW_VIEW", "KW_PSL_VPKG", "KW_PSL_VMODE", "KW_PSL_VPROP", "KW_PSL_VUNIT", "KW_WAIT", "KW_WITH", "KW_WHEN", "KW_WHILE", - "OP_XNOR", "OP_XOR", "OP_EQ", "OP_NE", "OP_LT", "OP_LE", "OP_GT", "OP_GE", "OP_IEQ", "OP_INE", "OP_ILT", "OP_ILE", - "OP_IGT", "OP_IGE", "OP_PLUS", "OP_MINUS", "OP_MUL", "OP_DIV", "OP_POW", "OP_CONCAT", "OP_CONDITION", "TOK_RARROW", + "OP_XNOR", "OP_XOR", "OP_EQ", "OP_NE", "OP_LT", "OP_GT", "OP_GE", "OP_IEQ", "OP_INE", "OP_ILT", "OP_ILE", "OP_IGT", + "OP_IGE", "OP_PLUS", "OP_MINUS", "OP_MUL", "OP_DIV", "OP_POW", "OP_CONCAT", "OP_CONDITION", "TOK_RARROW", "TOK_SIG_ASSIGN", "TOK_VAR_ASSIGN", "TOK_BOX", "TOK_LP", "TOK_RP", "TOK_LB", "TOK_RB", "TOK_DLA", "TOK_DRA", "TOK_COLON", "TOK_SEMICOL", "TOK_COMMA", "TOK_BAR", "TOK_DOT", "TOK_QUESTION", "TOK_AT", "TOK_CIRCUMFLEX", "TOK_TICK", "TOK_DQUOTE", "LIT_ABSTRACT", "LIT_BIT_STRING", "LIT_CHARACTER", "LIT_STRING", "LIT_IDENTIFIER" @@ -1005,75 +1043,75 @@ class VHDLParser(Parser): RULE_rule_Architecture = 10 RULE_rule_ArchitectureStatement = 11 RULE_rule_ArrayConstraint = 12 - RULE_rule_ArrayElementConstraint = 13 - RULE_rule_ArrayElementResolution = 14 - RULE_rule_ArrayIncompleteTypeDefinition = 15 - RULE_rule_ArrayIndexIncompleteType = 16 - RULE_rule_ArrayIndexIncompleteTypeList = 17 - RULE_rule_ArrayModeViewIndication = 18 - RULE_rule_Assertion = 19 - RULE_rule_AssertionStatement = 20 - RULE_rule_AssociationElement = 21 - RULE_rule_AssociationList = 22 - RULE_rule_AttributeDeclaration = 23 - RULE_rule_AttributeDesignator = 24 - RULE_rule_AttributeSpecification = 25 - RULE_rule_BindingIndication = 26 - RULE_rule_BlockConfiguration = 27 - RULE_rule_BlockDeclarativeItem = 28 - RULE_rule_BlockSpecification = 29 - RULE_rule_BlockStatement = 30 - RULE_rule_CaseGenerateAlternative = 31 - RULE_rule_CaseGenerateStatement = 32 - RULE_rule_CaseStatement = 33 - RULE_rule_CaseStatementAlternative = 34 - RULE_rule_Choice = 35 - RULE_rule_Choices = 36 - RULE_rule_ComponentConfiguration = 37 - RULE_rule_ComponentDeclaration = 38 - RULE_rule_ComponentInstantiationStatement = 39 - RULE_rule_ComponentSpecification = 40 - RULE_rule_CompositeTypeDefinition = 41 - RULE_rule_CompoundConfigurationSpecification = 42 - RULE_rule_ConcurrentAssertionStatement = 43 - RULE_rule_ConcurrentConditionalSignalAssignment = 44 - RULE_rule_ConcurrentProcedureCallStatement = 45 - RULE_rule_ConcurrentSelectedSignalAssignment = 46 - RULE_rule_ConcurrentSignalAssignmentStatement = 47 - RULE_rule_ConcurrentSimpleSignalAssignment = 48 - RULE_rule_ConditionClause = 49 - RULE_rule_ConditionalExpression = 50 - RULE_rule_ConditionalOrUnaffectedExpression = 51 - RULE_rule_ConditionalSignalAssignment = 52 - RULE_rule_ConditionalWaveforms = 53 - RULE_rule_ConfigurationDeclaration = 54 - RULE_rule_ConfigurationDeclarativeItem = 55 - RULE_rule_ConfigurationItem = 56 - RULE_rule_ConfigurationSpecification = 57 - RULE_rule_ConstantDeclaration = 58 - RULE_rule_ConstrainedArrayDefinition = 59 - RULE_rule_Constraint = 60 - RULE_rule_ContextDeclaration = 61 - RULE_rule_ContextItem = 62 - RULE_rule_ContextReference = 63 - RULE_rule_DelayMechanism = 64 - RULE_rule_DesignFile = 65 - RULE_rule_DesignUnit = 66 - RULE_rule_Designator = 67 - RULE_rule_Direction = 68 - RULE_rule_DisconnectionSpecification = 69 - RULE_rule_DiscreteRange = 70 - RULE_rule_DiscreteIncompleteTypeDefinition = 71 - RULE_rule_ElementArrayModeViewIndication = 72 - RULE_rule_ElementAssociation = 73 - RULE_rule_ElementConstraint = 74 - RULE_rule_ElementDeclaration = 75 - RULE_rule_ElementModeIndication = 76 - RULE_rule_ElementModeViewIndication = 77 - RULE_rule_ElementRecordModeViewIndication = 78 - RULE_rule_ElementResolution = 79 - RULE_rule_EntityAspect = 80 - RULE_rule_EntityClass = 81 + RULE_rule_ArrayIncompleteTypeDefinition = 13 + RULE_rule_ArrayIndexIncompleteType = 14 + RULE_rule_ArrayIndexIncompleteTypeList = 15 + RULE_rule_ArrayModeViewIndication = 16 + RULE_rule_Assertion = 17 + RULE_rule_AssertionStatement = 18 + RULE_rule_AssociationElement = 19 + RULE_rule_AssociationList = 20 + RULE_rule_AttributeDeclaration = 21 + RULE_rule_AttributeDesignator = 22 + RULE_rule_AttributeSpecification = 23 + RULE_rule_BindingIndication = 24 + RULE_rule_BlockConfiguration = 25 + RULE_rule_BlockDeclarativeItem = 26 + RULE_rule_BlockSpecification = 27 + RULE_rule_BlockStatement = 28 + RULE_rule_CaseGenerateAlternative = 29 + RULE_rule_CaseGenerateStatement = 30 + RULE_rule_CaseStatement = 31 + RULE_rule_CaseStatementAlternative = 32 + RULE_rule_Choice = 33 + RULE_rule_Choices = 34 + RULE_rule_ComponentConfiguration = 35 + RULE_rule_ComponentDeclaration = 36 + RULE_rule_ComponentInstantiationStatement = 37 + RULE_rule_ComponentSpecification = 38 + RULE_rule_CompositeTypeDefinition = 39 + RULE_rule_CompoundConfigurationSpecification = 40 + RULE_rule_ConcurrentAssertionStatement = 41 + RULE_rule_ConcurrentConditionalSignalAssignment = 42 + RULE_rule_ConcurrentProcedureCallStatement = 43 + RULE_rule_ConcurrentSelectedSignalAssignment = 44 + RULE_rule_ConcurrentSignalAssignmentStatement = 45 + RULE_rule_ConcurrentSimpleSignalAssignment = 46 + RULE_rule_ConcurrentStatement = 47 + RULE_rule_ConditionClause = 48 + RULE_rule_ConditionalExpression = 49 + RULE_rule_ConditionalOrUnaffectedExpression = 50 + RULE_rule_ConditionalSignalAssignment = 51 + RULE_rule_ConditionalWaveforms = 52 + RULE_rule_ConfigurationDeclaration = 53 + RULE_rule_ConfigurationDeclarativeItem = 54 + RULE_rule_ConfigurationItem = 55 + RULE_rule_ConfigurationSpecification = 56 + RULE_rule_ConstantDeclaration = 57 + RULE_rule_ConstrainedArrayDefinition = 58 + RULE_rule_Constraint = 59 + RULE_rule_ContextDeclaration = 60 + RULE_rule_ContextItem = 61 + RULE_rule_ContextReference = 62 + RULE_rule_DelayMechanism = 63 + RULE_rule_DesignFile = 64 + RULE_rule_DesignUnit = 65 + RULE_rule_Designator = 66 + RULE_rule_Direction = 67 + RULE_rule_DisconnectionSpecification = 68 + RULE_rule_DiscreteRange = 69 + RULE_rule_DiscreteIncompleteTypeDefinition = 70 + RULE_rule_ElementArrayModeViewIndication = 71 + RULE_rule_ElementAssociation = 72 + RULE_rule_ElementConstraint = 73 + RULE_rule_ElementDeclaration = 74 + RULE_rule_ElementModeIndication = 75 + RULE_rule_ElementModeViewIndication = 76 + RULE_rule_ElementRecordModeViewIndication = 77 + RULE_rule_ElementResolution = 78 + RULE_rule_EntityAspect = 79 + RULE_rule_EntityClass = 80 + RULE_rule_EntityClassEntry = 81 RULE_rule_EntityDeclaration = 82 RULE_rule_EntityDeclarativeItem = 83 RULE_rule_EntityDesignator = 84 @@ -1098,208 +1136,210 @@ class VHDLParser(Parser): RULE_rule_FloatingIncompleteTypeDefinition = 103 RULE_rule_FloatingTypeDefinition = 104 RULE_rule_ForGenerateStatement = 105 - RULE_rule_ForceMode = 106 - RULE_rule_FormalDesignator = 107 - RULE_rule_FormalParameterList = 108 - RULE_rule_FormalPart = 109 - RULE_rule_FullTypeDeclaration = 110 - RULE_rule_FunctionCall = 111 - RULE_rule_FunctionSpecification = 112 - RULE_rule_GenerateSpecification = 113 - RULE_rule_GenerateStatement = 114 - RULE_rule_GenerateStatementBody = 115 - RULE_rule_GenericClause = 116 - RULE_rule_GenericMapAspect = 117 - RULE_rule_GuardedSignalSpecification = 118 - RULE_rule_IdentifierList = 119 - RULE_rule_IfGenerateStatement = 120 - RULE_rule_IfStatement = 121 - RULE_rule_IncompleteSubtypeIndication = 122 - RULE_rule_IncompleteTypeDeclaration = 123 - RULE_rule_IncompleteTypeDefinition = 124 - RULE_rule_IncompleteTypeMark = 125 - RULE_rule_IndexConstraint = 126 - RULE_rule_IndexSubtypeDefinition = 127 - RULE_rule_InstantiatedUnit = 128 - RULE_rule_InstantiationList = 129 - RULE_rule_IntegerIncompleteTypeDefinition = 130 - RULE_rule_IntegerTypeDefinition = 131 - RULE_rule_InterfaceConstantDeclaration = 132 - RULE_rule_InterfaceDeclaration = 133 - RULE_rule_InterfaceElement = 134 - RULE_rule_InterfaceFileDeclaration = 135 - RULE_rule_InterfaceFunctionSpecification = 136 - RULE_rule_InterfaceList = 137 - RULE_rule_InterfacePackageDeclaration = 138 - RULE_rule_InterfacePackageGenericMapAspect = 139 - RULE_rule_InterfaceProcedureSpecification = 140 - RULE_rule_InterfaceSignalDeclaration = 141 - RULE_rule_InterfaceSubprogramDeclaration = 142 - RULE_rule_InterfaceSubprogramDefault = 143 - RULE_rule_InterfaceSubprogramSpecification = 144 - RULE_rule_InterfaceTypeDeclaration = 145 - RULE_rule_InterfaceTypeIndication = 146 - RULE_rule_InterfaceVariableDeclaration = 147 - RULE_rule_IterationScheme = 148 - RULE_rule_LibraryClause = 149 - RULE_rule_LibraryUnit = 150 - RULE_rule_Literal = 151 - RULE_rule_LoopStatement = 152 - RULE_rule_Mode = 153 - RULE_rule_ModeIndication = 154 - RULE_rule_ModeViewDeclaration = 155 - RULE_rule_ModeViewElementDefinition = 156 - RULE_rule_Name = 157 - RULE_rule_NextStatement = 158 - RULE_rule_NullStatement = 159 - RULE_rule_NumericLiteral = 160 - RULE_rule_PackageBody = 161 - RULE_rule_PackageBodyDeclarativeItem = 162 - RULE_rule_PackageDeclaration = 163 - RULE_rule_PackageDeclarativeItem = 164 - RULE_rule_PackageInstantiationDeclaration = 165 - RULE_rule_PackagePathname = 166 - RULE_rule_ParameterMapAspect = 167 - RULE_rule_ParameterSpecification = 168 - RULE_rule_PartialPathname = 169 - RULE_rule_PathnameElement = 170 - RULE_rule_PhysicalIncompleteTypeDefinition = 171 - RULE_rule_PhysicalLiteral = 172 - RULE_rule_PhysicalTypeDefinition = 173 - RULE_rule_PlainReturnStatement = 174 - RULE_rule_PortClause = 175 - RULE_rule_PortMapAspect = 176 - RULE_rule_Primary = 177 - RULE_rule_PrivateVariableDeclaration = 178 - RULE_rule_PrivateIncompleteTypeDefinition = 179 - RULE_rule_ProcedureCall = 180 - RULE_rule_ProcedureCallStatement = 181 - RULE_rule_ProcedureSpecification = 182 - RULE_rule_ProcessDeclarativeItem = 183 - RULE_rule_ProcessSensitivityList = 184 - RULE_rule_ProcessStatement = 185 - RULE_rule_PostponedProcessStatement = 186 - RULE_rule_ProtectedTypeBody = 187 - RULE_rule_ProtectedTypeBodyDeclarativeItem = 188 - RULE_rule_ProtectedTypeDeclaration = 189 - RULE_rule_ProtectedTypeDeclarativeItem = 190 - RULE_rule_ProtectedTypeDefinition = 191 - RULE_rule_ProtectedTypeInstantiationDefinition = 192 - RULE_rule_QualifiedExpression = 193 - RULE_rule_Range = 194 - RULE_rule_RangeConstraint = 195 - RULE_rule_RecordConstraint = 196 - RULE_rule_RecordElementConstraint = 197 - RULE_rule_RecordElementList = 198 - RULE_rule_RecordElementResolution = 199 - RULE_rule_RecordResolution = 200 - RULE_rule_RecordTypeDefinition = 201 - RULE_rule_RecordModeViewIndication = 202 - RULE_rule_RelativePathname = 203 - RULE_rule_ReportStatement = 204 - RULE_rule_ResolutionIndication = 205 - RULE_rule_ReturnStatement = 206 - RULE_rule_ScalarIncompleteTypeDefinition = 207 - RULE_rule_ScalarTypeDefinition = 208 - RULE_rule_SecondaryUnitDeclaration = 209 - RULE_rule_SelectedExpressions = 210 - RULE_rule_SelectedForceAssignment = 211 - RULE_rule_SelectedName2 = 212 - RULE_rule_SelectedSignalAssignment = 213 - RULE_rule_SelectedVariableAssignment = 214 - RULE_rule_SelectedWaveformAssignment = 215 - RULE_rule_SelectedWaveforms = 216 - RULE_rule_SensitivityClause = 217 - RULE_rule_SensitivityList = 218 - RULE_rule_SequentialBlockStatement = 219 - RULE_rule_SequentialStatement = 220 - RULE_rule_SignalAssignmentStatement = 221 - RULE_rule_SignalDeclaration = 222 - RULE_rule_SignalList = 223 - RULE_rule_Signature = 224 - RULE_rule_SimpleConfigurationSpecification = 225 - RULE_rule_SimpleForceAssignment = 226 - RULE_rule_SimpleModeIndication = 227 - RULE_rule_SimpleRange = 228 - RULE_rule_SimpleReleaseAssignment = 229 - RULE_rule_SimpleSignalAssignment = 230 - RULE_rule_SimpleWaveformAssignment = 231 - RULE_rule_SimpleVariableAssignment = 232 - RULE_rule_SubprogramBody = 233 - RULE_rule_SubprogramDeclaration = 234 - RULE_rule_SubprogramDeclarativeItem = 235 - RULE_rule_SubprogramInstantiationDeclaration = 236 - RULE_rule_SubprogramKind = 237 - RULE_rule_SubprogramSpecification = 238 - RULE_rule_SubtypeDeclaration = 239 - RULE_rule_SubtypeIndication = 240 - RULE_rule_Suffix = 241 - RULE_rule_Target = 242 - RULE_rule_TimeoutClause = 243 - RULE_rule_TypeConversion = 244 - RULE_rule_TypeDeclaration = 245 - RULE_rule_TypeDefinition = 246 - RULE_rule_TypeMark = 247 - RULE_rule_UnboundArrayDefinition = 248 - RULE_rule_UnspecifiedTypeIndication = 249 - RULE_rule_UseClause = 250 - RULE_rule_ValueReturnStatement = 251 - RULE_rule_VariableAssignmentStatement = 252 - RULE_rule_VariableDeclaration = 253 - RULE_rule_WaitStatement = 254 - RULE_rule_Waveform = 255 - RULE_rule_WaveformElement = 256 + RULE_rule_FormalDesignator = 106 + RULE_rule_FormalParameterList = 107 + RULE_rule_FormalPart = 108 + RULE_rule_FullTypeDeclaration = 109 + RULE_rule_FunctionCall = 110 + RULE_rule_FunctionSpecification = 111 + RULE_rule_GenerateSpecification = 112 + RULE_rule_GenerateStatement = 113 + RULE_rule_GenerateStatementBody = 114 + RULE_rule_GenericClause = 115 + RULE_rule_GenericMapAspect = 116 + RULE_rule_GroupConstituent = 117 + RULE_rule_GroupDeclaration = 118 + RULE_rule_GroupTemplateDeclaration = 119 + RULE_rule_GuardedSignalSpecification = 120 + RULE_rule_IdentifierList = 121 + RULE_rule_IfGenerateStatement = 122 + RULE_rule_IfStatement = 123 + RULE_rule_IncompleteSubtypeIndication = 124 + RULE_rule_IncompleteTypeDeclaration = 125 + RULE_rule_IncompleteTypeDefinition = 126 + RULE_rule_IncompleteTypeMark = 127 + RULE_rule_IndexConstraint = 128 + RULE_rule_IndexSubtypeDefinition = 129 + RULE_rule_InstantiatedUnit = 130 + RULE_rule_InstantiationList = 131 + RULE_rule_IntegerIncompleteTypeDefinition = 132 + RULE_rule_IntegerTypeDefinition = 133 + RULE_rule_InterfaceConstantDeclaration = 134 + RULE_rule_InterfaceDeclaration = 135 + RULE_rule_InterfaceElement = 136 + RULE_rule_InterfaceFileDeclaration = 137 + RULE_rule_InterfaceFunctionSpecification = 138 + RULE_rule_InterfaceList = 139 + RULE_rule_InterfacePackageDeclaration = 140 + RULE_rule_InterfacePackageGenericMapAspect = 141 + RULE_rule_InterfaceProcedureSpecification = 142 + RULE_rule_InterfaceSignalDeclaration = 143 + RULE_rule_InterfaceSubprogramDeclaration = 144 + RULE_rule_InterfaceSubprogramDefault = 145 + RULE_rule_InterfaceSubprogramSpecification = 146 + RULE_rule_InterfaceTypeDeclaration = 147 + RULE_rule_InterfaceTypeIndication = 148 + RULE_rule_InterfaceVariableDeclaration = 149 + RULE_rule_IterationScheme = 150 + RULE_rule_LibraryClause = 151 + RULE_rule_LibraryUnit = 152 + RULE_rule_Literal = 153 + RULE_rule_LoopStatement = 154 + RULE_rule_Mode = 155 + RULE_rule_ModeIndication = 156 + RULE_rule_ModeViewDeclaration = 157 + RULE_rule_ModeViewElementDefinition = 158 + RULE_rule_Name = 159 + RULE_rule_NextStatement = 160 + RULE_rule_NullStatement = 161 + RULE_rule_NumericLiteral = 162 + RULE_rule_PackageBody = 163 + RULE_rule_PackageBodyDeclarativeItem = 164 + RULE_rule_PackageDeclaration = 165 + RULE_rule_PackageDeclarativeItem = 166 + RULE_rule_PackageInstantiationDeclaration = 167 + RULE_rule_PackagePathname = 168 + RULE_rule_ParameterMapAspect = 169 + RULE_rule_ParameterSpecification = 170 + RULE_rule_PartialPathname = 171 + RULE_rule_PathnameElement = 172 + RULE_rule_PhysicalIncompleteTypeDefinition = 173 + RULE_rule_PhysicalLiteral = 174 + RULE_rule_PhysicalTypeDefinition = 175 + RULE_rule_PlainReturnStatement = 176 + RULE_rule_PortClause = 177 + RULE_rule_PortMapAspect = 178 + RULE_rule_Primary = 179 + RULE_rule_PrivateVariableDeclaration = 180 + RULE_rule_PrivateIncompleteTypeDefinition = 181 + RULE_rule_ProcedureCall = 182 + RULE_rule_ProcedureCallStatement = 183 + RULE_rule_ProcedureSpecification = 184 + RULE_rule_ProcessDeclarativeItem = 185 + RULE_rule_ProcessSensitivityList = 186 + RULE_rule_ProcessStatement = 187 + RULE_rule_PostponedProcessStatement = 188 + RULE_rule_ProtectedTypeBody = 189 + RULE_rule_ProtectedTypeBodyDeclarativeItem = 190 + RULE_rule_ProtectedTypeDeclaration = 191 + RULE_rule_ProtectedTypeDeclarativeItem = 192 + RULE_rule_ProtectedTypeDefinition = 193 + RULE_rule_ProtectedTypeInstantiationDefinition = 194 + RULE_rule_QualifiedExpression = 195 + RULE_rule_Range = 196 + RULE_rule_RangeConstraint = 197 + RULE_rule_RecordConstraint = 198 + RULE_rule_RecordElementConstraint = 199 + RULE_rule_RecordElementList = 200 + RULE_rule_RecordElementResolution = 201 + RULE_rule_RecordResolution = 202 + RULE_rule_RecordTypeDefinition = 203 + RULE_rule_RecordModeViewIndication = 204 + RULE_rule_RelativePathname = 205 + RULE_rule_ReportStatement = 206 + RULE_rule_ResolutionIndication = 207 + RULE_rule_ReturnStatement = 208 + RULE_rule_ScalarIncompleteTypeDefinition = 209 + RULE_rule_ScalarTypeDefinition = 210 + RULE_rule_SecondaryUnitDeclaration = 211 + RULE_rule_SelectedExpressions = 212 + RULE_rule_SelectedForceAssignment = 213 + RULE_rule_SelectedName2 = 214 + RULE_rule_SelectedSignalAssignment = 215 + RULE_rule_SelectedVariableAssignment = 216 + RULE_rule_SelectedWaveformAssignment = 217 + RULE_rule_SelectedWaveforms = 218 + RULE_rule_SensitivityClause = 219 + RULE_rule_SensitivityList = 220 + RULE_rule_SequentialBlockStatement = 221 + RULE_rule_SequentialStatement = 222 + RULE_rule_SignalAssignmentStatement = 223 + RULE_rule_SignalDeclaration = 224 + RULE_rule_SignalList = 225 + RULE_rule_Signature = 226 + RULE_rule_SimpleConfigurationSpecification = 227 + RULE_rule_SimpleForceAssignment = 228 + RULE_rule_SimpleModeIndication = 229 + RULE_rule_SimpleRange = 230 + RULE_rule_SimpleReleaseAssignment = 231 + RULE_rule_SimpleSignalAssignment = 232 + RULE_rule_SimpleWaveformAssignment = 233 + RULE_rule_SimpleVariableAssignment = 234 + RULE_rule_SubprogramBody = 235 + RULE_rule_SubprogramDeclaration = 236 + RULE_rule_SubprogramDeclarativeItem = 237 + RULE_rule_SubprogramInstantiationDeclaration = 238 + RULE_rule_SubprogramKind = 239 + RULE_rule_SubprogramSpecification = 240 + RULE_rule_SubtypeDeclaration = 241 + RULE_rule_SubtypeIndication = 242 + RULE_rule_Suffix = 243 + RULE_rule_Target = 244 + RULE_rule_TimeoutClause = 245 + RULE_rule_TypeConversion = 246 + RULE_rule_TypeDeclaration = 247 + RULE_rule_TypeDefinition = 248 + RULE_rule_UnboundArrayDefinition = 249 + RULE_rule_UnspecifiedTypeIndication = 250 + RULE_rule_UseClause = 251 + RULE_rule_ValueReturnStatement = 252 + RULE_rule_VariableAssignmentStatement = 253 + RULE_rule_VariableDeclaration = 254 + RULE_rule_WaitStatement = 255 + RULE_rule_Waveform = 256 + RULE_rule_WaveformElement = 257 ruleNames = ( "rule_AbsolutePathname", "rule_AccessIncompleteTypeDefinition", "rule_AccessTypeDefinition", "rule_ActualDesignator", "rule_ActualPart", "rule_Aggregate", "rule_AliasDeclaration", "rule_AliasDesignator", "rule_AliasIndication", "rule_Allocator", "rule_Architecture", "rule_ArchitectureStatement", "rule_ArrayConstraint", - "rule_ArrayElementConstraint", "rule_ArrayElementResolution", "rule_ArrayIncompleteTypeDefinition", - "rule_ArrayIndexIncompleteType", "rule_ArrayIndexIncompleteTypeList", "rule_ArrayModeViewIndication", - "rule_Assertion", "rule_AssertionStatement", "rule_AssociationElement", "rule_AssociationList", - "rule_AttributeDeclaration", "rule_AttributeDesignator", "rule_AttributeSpecification", "rule_BindingIndication", - "rule_BlockConfiguration", "rule_BlockDeclarativeItem", "rule_BlockSpecification", "rule_BlockStatement", - "rule_CaseGenerateAlternative", "rule_CaseGenerateStatement", "rule_CaseStatement", "rule_CaseStatementAlternative", - "rule_Choice", "rule_Choices", "rule_ComponentConfiguration", "rule_ComponentDeclaration", - "rule_ComponentInstantiationStatement", "rule_ComponentSpecification", "rule_CompositeTypeDefinition", - "rule_CompoundConfigurationSpecification", "rule_ConcurrentAssertionStatement", + "rule_ArrayIncompleteTypeDefinition", "rule_ArrayIndexIncompleteType", "rule_ArrayIndexIncompleteTypeList", + "rule_ArrayModeViewIndication", "rule_Assertion", "rule_AssertionStatement", "rule_AssociationElement", + "rule_AssociationList", "rule_AttributeDeclaration", "rule_AttributeDesignator", "rule_AttributeSpecification", + "rule_BindingIndication", "rule_BlockConfiguration", "rule_BlockDeclarativeItem", "rule_BlockSpecification", + "rule_BlockStatement", "rule_CaseGenerateAlternative", "rule_CaseGenerateStatement", "rule_CaseStatement", + "rule_CaseStatementAlternative", "rule_Choice", "rule_Choices", "rule_ComponentConfiguration", + "rule_ComponentDeclaration", "rule_ComponentInstantiationStatement", "rule_ComponentSpecification", + "rule_CompositeTypeDefinition", "rule_CompoundConfigurationSpecification", "rule_ConcurrentAssertionStatement", "rule_ConcurrentConditionalSignalAssignment", "rule_ConcurrentProcedureCallStatement", "rule_ConcurrentSelectedSignalAssignment", "rule_ConcurrentSignalAssignmentStatement", - "rule_ConcurrentSimpleSignalAssignment", "rule_ConditionClause", "rule_ConditionalExpression", - "rule_ConditionalOrUnaffectedExpression", "rule_ConditionalSignalAssignment", "rule_ConditionalWaveforms", - "rule_ConfigurationDeclaration", "rule_ConfigurationDeclarativeItem", "rule_ConfigurationItem", - "rule_ConfigurationSpecification", "rule_ConstantDeclaration", "rule_ConstrainedArrayDefinition", "rule_Constraint", - "rule_ContextDeclaration", "rule_ContextItem", "rule_ContextReference", "rule_DelayMechanism", "rule_DesignFile", - "rule_DesignUnit", "rule_Designator", "rule_Direction", "rule_DisconnectionSpecification", "rule_DiscreteRange", - "rule_DiscreteIncompleteTypeDefinition", "rule_ElementArrayModeViewIndication", "rule_ElementAssociation", - "rule_ElementConstraint", "rule_ElementDeclaration", "rule_ElementModeIndication", "rule_ElementModeViewIndication", + "rule_ConcurrentSimpleSignalAssignment", "rule_ConcurrentStatement", "rule_ConditionClause", + "rule_ConditionalExpression", "rule_ConditionalOrUnaffectedExpression", "rule_ConditionalSignalAssignment", + "rule_ConditionalWaveforms", "rule_ConfigurationDeclaration", "rule_ConfigurationDeclarativeItem", + "rule_ConfigurationItem", "rule_ConfigurationSpecification", "rule_ConstantDeclaration", + "rule_ConstrainedArrayDefinition", "rule_Constraint", "rule_ContextDeclaration", "rule_ContextItem", + "rule_ContextReference", "rule_DelayMechanism", "rule_DesignFile", "rule_DesignUnit", "rule_Designator", + "rule_Direction", "rule_DisconnectionSpecification", "rule_DiscreteRange", "rule_DiscreteIncompleteTypeDefinition", + "rule_ElementArrayModeViewIndication", "rule_ElementAssociation", "rule_ElementConstraint", + "rule_ElementDeclaration", "rule_ElementModeIndication", "rule_ElementModeViewIndication", "rule_ElementRecordModeViewIndication", "rule_ElementResolution", "rule_EntityAspect", "rule_EntityClass", - "rule_EntityDeclaration", "rule_EntityDeclarativeItem", "rule_EntityDesignator", "rule_EntityNameList", - "rule_EntitySpecification", "rule_EntityStatement", "rule_EntityTag", "rule_EnumerationLiteral", - "rule_EnumerationTypeDefinition", "rule_ExitStatement", "rule_Expression", "rule_ExpressionOrUnaffected", - "rule_ExternalName", "rule_ExternalConstantName", "rule_ExternalSignalName", "rule_ExternalVariableName", - "rule_ExternalPathname", "rule_FileDeclaration", "rule_FileIncompleteTypeDefinition", "rule_FileOpenInformation", - "rule_FileTypeDefinition", "rule_FloatingIncompleteTypeDefinition", "rule_FloatingTypeDefinition", - "rule_ForGenerateStatement", "rule_ForceMode", "rule_FormalDesignator", "rule_FormalParameterList", + "rule_EntityClassEntry", "rule_EntityDeclaration", "rule_EntityDeclarativeItem", "rule_EntityDesignator", + "rule_EntityNameList", "rule_EntitySpecification", "rule_EntityStatement", "rule_EntityTag", + "rule_EnumerationLiteral", "rule_EnumerationTypeDefinition", "rule_ExitStatement", "rule_Expression", + "rule_ExpressionOrUnaffected", "rule_ExternalName", "rule_ExternalConstantName", "rule_ExternalSignalName", + "rule_ExternalVariableName", "rule_ExternalPathname", "rule_FileDeclaration", "rule_FileIncompleteTypeDefinition", + "rule_FileOpenInformation", "rule_FileTypeDefinition", "rule_FloatingIncompleteTypeDefinition", + "rule_FloatingTypeDefinition", "rule_ForGenerateStatement", "rule_FormalDesignator", "rule_FormalParameterList", "rule_FormalPart", "rule_FullTypeDeclaration", "rule_FunctionCall", "rule_FunctionSpecification", "rule_GenerateSpecification", "rule_GenerateStatement", "rule_GenerateStatementBody", "rule_GenericClause", - "rule_GenericMapAspect", "rule_GuardedSignalSpecification", "rule_IdentifierList", "rule_IfGenerateStatement", - "rule_IfStatement", "rule_IncompleteSubtypeIndication", "rule_IncompleteTypeDeclaration", - "rule_IncompleteTypeDefinition", "rule_IncompleteTypeMark", "rule_IndexConstraint", "rule_IndexSubtypeDefinition", - "rule_InstantiatedUnit", "rule_InstantiationList", "rule_IntegerIncompleteTypeDefinition", - "rule_IntegerTypeDefinition", "rule_InterfaceConstantDeclaration", "rule_InterfaceDeclaration", - "rule_InterfaceElement", "rule_InterfaceFileDeclaration", "rule_InterfaceFunctionSpecification", - "rule_InterfaceList", "rule_InterfacePackageDeclaration", "rule_InterfacePackageGenericMapAspect", - "rule_InterfaceProcedureSpecification", "rule_InterfaceSignalDeclaration", "rule_InterfaceSubprogramDeclaration", - "rule_InterfaceSubprogramDefault", "rule_InterfaceSubprogramSpecification", "rule_InterfaceTypeDeclaration", - "rule_InterfaceTypeIndication", "rule_InterfaceVariableDeclaration", "rule_IterationScheme", "rule_LibraryClause", - "rule_LibraryUnit", "rule_Literal", "rule_LoopStatement", "rule_Mode", "rule_ModeIndication", - "rule_ModeViewDeclaration", "rule_ModeViewElementDefinition", "rule_Name", "rule_NextStatement", - "rule_NullStatement", "rule_NumericLiteral", "rule_PackageBody", "rule_PackageBodyDeclarativeItem", - "rule_PackageDeclaration", "rule_PackageDeclarativeItem", "rule_PackageInstantiationDeclaration", - "rule_PackagePathname", "rule_ParameterMapAspect", "rule_ParameterSpecification", "rule_PartialPathname", - "rule_PathnameElement", "rule_PhysicalIncompleteTypeDefinition", "rule_PhysicalLiteral", - "rule_PhysicalTypeDefinition", "rule_PlainReturnStatement", "rule_PortClause", "rule_PortMapAspect", "rule_Primary", + "rule_GenericMapAspect", "rule_GroupConstituent", "rule_GroupDeclaration", "rule_GroupTemplateDeclaration", + "rule_GuardedSignalSpecification", "rule_IdentifierList", "rule_IfGenerateStatement", "rule_IfStatement", + "rule_IncompleteSubtypeIndication", "rule_IncompleteTypeDeclaration", "rule_IncompleteTypeDefinition", + "rule_IncompleteTypeMark", "rule_IndexConstraint", "rule_IndexSubtypeDefinition", "rule_InstantiatedUnit", + "rule_InstantiationList", "rule_IntegerIncompleteTypeDefinition", "rule_IntegerTypeDefinition", + "rule_InterfaceConstantDeclaration", "rule_InterfaceDeclaration", "rule_InterfaceElement", + "rule_InterfaceFileDeclaration", "rule_InterfaceFunctionSpecification", "rule_InterfaceList", + "rule_InterfacePackageDeclaration", "rule_InterfacePackageGenericMapAspect", "rule_InterfaceProcedureSpecification", + "rule_InterfaceSignalDeclaration", "rule_InterfaceSubprogramDeclaration", "rule_InterfaceSubprogramDefault", + "rule_InterfaceSubprogramSpecification", "rule_InterfaceTypeDeclaration", "rule_InterfaceTypeIndication", + "rule_InterfaceVariableDeclaration", "rule_IterationScheme", "rule_LibraryClause", "rule_LibraryUnit", + "rule_Literal", "rule_LoopStatement", "rule_Mode", "rule_ModeIndication", "rule_ModeViewDeclaration", + "rule_ModeViewElementDefinition", "rule_Name", "rule_NextStatement", "rule_NullStatement", "rule_NumericLiteral", + "rule_PackageBody", "rule_PackageBodyDeclarativeItem", "rule_PackageDeclaration", "rule_PackageDeclarativeItem", + "rule_PackageInstantiationDeclaration", "rule_PackagePathname", "rule_ParameterMapAspect", + "rule_ParameterSpecification", "rule_PartialPathname", "rule_PathnameElement", + "rule_PhysicalIncompleteTypeDefinition", "rule_PhysicalLiteral", "rule_PhysicalTypeDefinition", + "rule_PlainReturnStatement", "rule_PortClause", "rule_PortMapAspect", "rule_Primary", "rule_PrivateVariableDeclaration", "rule_PrivateIncompleteTypeDefinition", "rule_ProcedureCall", "rule_ProcedureCallStatement", "rule_ProcedureSpecification", "rule_ProcessDeclarativeItem", "rule_ProcessSensitivityList", "rule_ProcessStatement", "rule_PostponedProcessStatement", "rule_ProtectedTypeBody", @@ -1319,9 +1359,9 @@ class VHDLParser(Parser): "rule_SubprogramDeclaration", "rule_SubprogramDeclarativeItem", "rule_SubprogramInstantiationDeclaration", "rule_SubprogramKind", "rule_SubprogramSpecification", "rule_SubtypeDeclaration", "rule_SubtypeIndication", "rule_Suffix", "rule_Target", "rule_TimeoutClause", "rule_TypeConversion", "rule_TypeDeclaration", - "rule_TypeDefinition", "rule_TypeMark", "rule_UnboundArrayDefinition", "rule_UnspecifiedTypeIndication", - "rule_UseClause", "rule_ValueReturnStatement", "rule_VariableAssignmentStatement", "rule_VariableDeclaration", - "rule_WaitStatement", "rule_Waveform", "rule_WaveformElement" + "rule_TypeDefinition", "rule_UnboundArrayDefinition", "rule_UnspecifiedTypeIndication", "rule_UseClause", + "rule_ValueReturnStatement", "rule_VariableAssignmentStatement", "rule_VariableDeclaration", "rule_WaitStatement", + "rule_Waveform", "rule_WaveformElement" ) EOF = Token.EOF @@ -1368,7 +1408,7 @@ class VHDLParser(Parser): KW_GENERATE = 41 KW_GENERIC = 42 KW_GUARDED = 43 - KW_PSL_GROUP = 44 + KW_GROUP = 44 KW_IF = 45 KW_IMPURE = 46 KW_IN = 47 @@ -1448,51 +1488,50 @@ class VHDLParser(Parser): OP_EQ = 121 OP_NE = 122 OP_LT = 123 - OP_LE = 124 - OP_GT = 125 - OP_GE = 126 - OP_IEQ = 127 - OP_INE = 128 - OP_ILT = 129 - OP_ILE = 130 - OP_IGT = 131 - OP_IGE = 132 - OP_PLUS = 133 - OP_MINUS = 134 - OP_MUL = 135 - OP_DIV = 136 - OP_POW = 137 - OP_CONCAT = 138 - OP_CONDITION = 139 - TOK_RARROW = 140 - TOK_SIG_ASSIGN = 141 - TOK_VAR_ASSIGN = 142 - TOK_BOX = 143 - TOK_LP = 144 - TOK_RP = 145 - TOK_LB = 146 - TOK_RB = 147 - TOK_DLA = 148 - TOK_DRA = 149 - TOK_COLON = 150 - TOK_SEMICOL = 151 - TOK_COMMA = 152 - TOK_BAR = 153 - TOK_DOT = 154 - TOK_QUESTION = 155 - TOK_AT = 156 - TOK_CIRCUMFLEX = 157 - TOK_TICK = 158 - TOK_DQUOTE = 159 - LIT_ABSTRACT = 160 - LIT_BIT_STRING = 161 - LIT_CHARACTER = 162 - LIT_STRING = 163 - LIT_IDENTIFIER = 164 + OP_GT = 124 + OP_GE = 125 + OP_IEQ = 126 + OP_INE = 127 + OP_ILT = 128 + OP_ILE = 129 + OP_IGT = 130 + OP_IGE = 131 + OP_PLUS = 132 + OP_MINUS = 133 + OP_MUL = 134 + OP_DIV = 135 + OP_POW = 136 + OP_CONCAT = 137 + OP_CONDITION = 138 + TOK_RARROW = 139 + TOK_SIG_ASSIGN = 140 + TOK_VAR_ASSIGN = 141 + TOK_BOX = 142 + TOK_LP = 143 + TOK_RP = 144 + TOK_LB = 145 + TOK_RB = 146 + TOK_DLA = 147 + TOK_DRA = 148 + TOK_COLON = 149 + TOK_SEMICOL = 150 + TOK_COMMA = 151 + TOK_BAR = 152 + TOK_DOT = 153 + TOK_QUESTION = 154 + TOK_AT = 155 + TOK_CIRCUMFLEX = 156 + TOK_TICK = 157 + TOK_DQUOTE = 158 + LIT_ABSTRACT = 159 + LIT_BIT_STRING = 160 + LIT_CHARACTER = 161 + LIT_STRING = 162 + LIT_IDENTIFIER = 163 def __init__(self, input: TokenStream, output: TextIO = stdout): super().__init__(input, output) - self.checkVersion("4.10.1") + self.checkVersion("4.12.0") self._interp = ParserATNSimulator(self, self.atn, self.decisionsToDFA, self.sharedContextCache) self._predicates = None @@ -1524,9 +1563,9 @@ def rule_AbsolutePathname(self): self.enterRule(localctx, 0, self.RULE_rule_AbsolutePathname) try: self.enterOuterAlt(localctx, 1) - self.state = 514 + self.state = 516 self.match(VHDLParser.TOK_DOT) - self.state = 515 + self.state = 517 self.rule_PartialPathname() except RecognitionException as re: localctx.exception = re @@ -1564,9 +1603,9 @@ def rule_AccessIncompleteTypeDefinition(self): self.enterRule(localctx, 2, self.RULE_rule_AccessIncompleteTypeDefinition) try: self.enterOuterAlt(localctx, 1) - self.state = 517 + self.state = 519 self.match(VHDLParser.KW_ACCESS) - self.state = 518 + self.state = 520 self.rule_IncompleteSubtypeIndication() except RecognitionException as re: localctx.exception = re @@ -1605,9 +1644,9 @@ def rule_AccessTypeDefinition(self): self.enterRule(localctx, 4, self.RULE_rule_AccessTypeDefinition) try: self.enterOuterAlt(localctx, 1) - self.state = 520 + self.state = 522 self.match(VHDLParser.KW_ACCESS) - self.state = 521 + self.state = 523 localctx.subtypeIndication = self.rule_SubtypeIndication() except RecognitionException as re: localctx.exception = re @@ -1659,37 +1698,37 @@ def rule_ActualDesignator(self): self.enterRule(localctx, 6, self.RULE_rule_ActualDesignator) self._la = 0 # Token type try: - self.state = 530 + self.state = 532 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input, 1, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 524 + self.state = 526 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_INERTIAL: - self.state = 523 + if _la == 48: + self.state = 525 localctx.inertial = self.match(VHDLParser.KW_INERTIAL) - self.state = 526 + self.state = 528 localctx.expression = self.rule_Expression(0) pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 527 + self.state = 529 localctx.name = self.rule_Name(0) pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 528 + self.state = 530 localctx.subtypeIndication = self.rule_SubtypeIndication() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 529 + self.state = 531 localctx.open_ = self.match(VHDLParser.KW_OPEN) pass @@ -1737,24 +1776,24 @@ def rule_ActualPart(self): localctx = VHDLParser.Rule_ActualPartContext(self, self._ctx, self.state) self.enterRule(localctx, 8, self.RULE_rule_ActualPart) try: - self.state = 538 + self.state = 540 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input, 2, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 532 + self.state = 534 localctx.actualDesignator = self.rule_ActualDesignator() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 533 + self.state = 535 localctx.conversion = self.rule_Name(0) - self.state = 534 + self.state = 536 self.match(VHDLParser.TOK_LP) - self.state = 535 + self.state = 537 localctx.actualDesignator = self.rule_ActualDesignator() - self.state = 536 + self.state = 538 self.match(VHDLParser.TOK_RP) pass @@ -1810,25 +1849,25 @@ def rule_Aggregate(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 540 + self.state = 542 self.match(VHDLParser.TOK_LP) - self.state = 541 + self.state = 543 localctx._rule_ElementAssociation = self.rule_ElementAssociation() localctx.element.append(localctx._rule_ElementAssociation) - self.state = 546 + self.state = 548 self._errHandler.sync(self) _la = self._input.LA(1) - while _la == VHDLParser.TOK_COMMA: - self.state = 542 + while _la == 151: + self.state = 544 self.match(VHDLParser.TOK_COMMA) - self.state = 543 + self.state = 545 localctx._rule_ElementAssociation = self.rule_ElementAssociation() localctx.element.append(localctx._rule_ElementAssociation) - self.state = 548 + self.state = 550 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 549 + self.state = 551 self.match(VHDLParser.TOK_RP) except RecognitionException as re: localctx.exception = re @@ -1889,31 +1928,31 @@ def rule_AliasDeclaration(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 551 + self.state = 553 self.match(VHDLParser.KW_ALIAS) - self.state = 552 + self.state = 554 localctx.aliasDesignator = self.rule_AliasDesignator() - self.state = 555 + self.state = 557 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.TOK_COLON: - self.state = 553 + if _la == 149: + self.state = 555 self.match(VHDLParser.TOK_COLON) - self.state = 554 + self.state = 556 localctx.aliasIndication = self.rule_AliasIndication() - self.state = 557 + self.state = 559 self.match(VHDLParser.KW_IS) - self.state = 558 - localctx.aliasTarget = self.rule_Name(0) self.state = 560 + localctx.aliasTarget = self.rule_Name(0) + self.state = 562 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.TOK_LB: - self.state = 559 + if _la == 145: + self.state = 561 localctx.signature = self.rule_Signature() - self.state = 562 + self.state = 564 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -1955,11 +1994,9 @@ def rule_AliasDesignator(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 564 + self.state = 566 _la = self._input.LA(1) - if not (((((_la - 162)) & ~0x3f) == 0 and ((1 << (_la - 162)) & ( - (1 << (VHDLParser.LIT_CHARACTER - 162)) | (1 << (VHDLParser.LIT_STRING - 162)) | ( - 1 << (VHDLParser.LIT_IDENTIFIER - 162)))) != 0)): + if not (((((_la - 161)) & ~0x3f) == 0 and ((1 << (_la - 161)) & 7) != 0)): self._errHandler.recoverInline(self) else: self._errHandler.reportMatch(self) @@ -1998,7 +2035,7 @@ def rule_AliasIndication(self): self.enterRule(localctx, 16, self.RULE_rule_AliasIndication) try: self.enterOuterAlt(localctx, 1) - self.state = 566 + self.state = 568 localctx.subtypeIndication = self.rule_SubtypeIndication() except RecognitionException as re: localctx.exception = re @@ -2041,18 +2078,18 @@ def rule_Allocator(self): self.enterRule(localctx, 18, self.RULE_rule_Allocator) try: self.enterOuterAlt(localctx, 1) - self.state = 568 + self.state = 570 self.match(VHDLParser.KW_NEW) - self.state = 571 + self.state = 573 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input, 6, self._ctx) if la_ == 1: - self.state = 569 + self.state = 571 localctx.subtypeIndication = self.rule_SubtypeIndication() pass elif la_ == 2: - self.state = 570 + self.state = 572 localctx.qualifiedExpression = self.rule_QualifiedExpression() pass @@ -2075,8 +2112,8 @@ def __init__(self, parser, parent: ParserRuleContext = None, invokingState: int self.entityName = None # Token self._rule_BlockDeclarativeItem = None # Rule_BlockDeclarativeItemContext self.declarativeItems = list() # of Rule_BlockDeclarativeItemContexts - self._rule_ArchitectureStatement = None # Rule_ArchitectureStatementContext - self.statements = list() # of Rule_ArchitectureStatementContexts + self._rule_ConcurrentStatement = None # Rule_ConcurrentStatementContext + self.statements = list() # of Rule_ConcurrentStatementContexts self.name2 = None # Token def KW_ARCHITECTURE(self, i: int = None): @@ -2112,11 +2149,11 @@ def rule_BlockDeclarativeItem(self, i: int = None): else: return self.getTypedRuleContext(VHDLParser.Rule_BlockDeclarativeItemContext, i) - def rule_ArchitectureStatement(self, i: int = None): + def rule_ConcurrentStatement(self, i: int = None): if i is None: - return self.getTypedRuleContexts(VHDLParser.Rule_ArchitectureStatementContext) + return self.getTypedRuleContexts(VHDLParser.Rule_ConcurrentStatementContext) else: - return self.getTypedRuleContext(VHDLParser.Rule_ArchitectureStatementContext, i) + return self.getTypedRuleContext(VHDLParser.Rule_ConcurrentStatementContext, i) def getRuleIndex(self): return VHDLParser.RULE_rule_Architecture @@ -2134,70 +2171,59 @@ def rule_Architecture(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 573 + self.state = 575 self.match(VHDLParser.KW_ARCHITECTURE) - self.state = 574 + self.state = 576 localctx.name = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 575 + self.state = 577 self.match(VHDLParser.KW_OF) - self.state = 576 + self.state = 578 localctx.entityName = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 577 + self.state = 579 self.match(VHDLParser.KW_IS) - self.state = 581 + self.state = 583 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ( - (1 << VHDLParser.KW_ALIAS) | (1 << VHDLParser.KW_ATTRIBUTE) | (1 << VHDLParser.KW_COMPONENT) | ( - 1 << VHDLParser.KW_CONSTANT) | (1 << VHDLParser.KW_DISCONNECT) | (1 << VHDLParser.KW_FILE) | ( - 1 << VHDLParser.KW_FOR) | (1 << VHDLParser.KW_FUNCTION) | (1 << VHDLParser.KW_IMPURE))) != 0) or ( - (((_la - 70)) & ~0x3f) == 0 and ((1 << (_la - 70)) & ( - (1 << (VHDLParser.KW_PACKAGE - 70)) | (1 << (VHDLParser.KW_PROCEDURE - 70)) | ( - 1 << (VHDLParser.KW_PURE - 70)) | (1 << (VHDLParser.KW_SHARED - 70)) | (1 << (VHDLParser.KW_SIGNAL - 70)) | ( - 1 << (VHDLParser.KW_SUBTYPE - 70)) | (1 << (VHDLParser.KW_TYPE - 70)) | (1 << (VHDLParser.KW_USE - 70)) | ( - 1 << (VHDLParser.KW_VARIABLE - 70)) | (1 << (VHDLParser.KW_VIEW - 70)))) != 0): - self.state = 578 + while (((_la) & ~0x3f) == 0 and ((1 << _la) & 88717423313408) != 0) or ( + (((_la - 70)) & ~0x3f) == 0 and ((1 << (_la - 70)) & 1941606236449) != 0): + self.state = 580 localctx._rule_BlockDeclarativeItem = self.rule_BlockDeclarativeItem() localctx.declarativeItems.append(localctx._rule_BlockDeclarativeItem) - self.state = 583 + self.state = 585 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 584 + self.state = 586 self.match(VHDLParser.KW_BEGIN) - self.state = 588 + self.state = 590 self._errHandler.sync(self) _la = self._input.LA(1) - while ((((_la - 14)) & ~0x3f) == 0 and ((1 << (_la - 14)) & ( - (1 << (VHDLParser.KW_ASSERT - 14)) | (1 << (VHDLParser.KW_POSTPONED - 14)) | ( - 1 << (VHDLParser.KW_PROCESS - 14)))) != 0) or ((((_la - 116)) & ~0x3f) == 0 and ((1 << (_la - 116)) & ( - (1 << (VHDLParser.KW_WITH - 116)) | (1 << (VHDLParser.TOK_LP - 116)) | (1 << (VHDLParser.TOK_DLA - 116)) | ( - 1 << (VHDLParser.LIT_CHARACTER - 116)) | (1 << (VHDLParser.LIT_STRING - 116)) | ( - 1 << (VHDLParser.LIT_IDENTIFIER - 116)))) != 0): - self.state = 585 - localctx._rule_ArchitectureStatement = self.rule_ArchitectureStatement() - localctx.statements.append(localctx._rule_ArchitectureStatement) - self.state = 590 + while ((((_la - 14)) & ~0x3f) == 0 and ((1 << (_la - 14)) & 5188146770730811393) != 0) or ( + (((_la - 116)) & ~0x3f) == 0 and ((1 << (_la - 116)) & 246292886323201) != 0): + self.state = 587 + localctx._rule_ConcurrentStatement = self.rule_ConcurrentStatement() + localctx.statements.append(localctx._rule_ConcurrentStatement) + self.state = 592 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 591 - self.match(VHDLParser.KW_END) self.state = 593 + self.match(VHDLParser.KW_END) + self.state = 595 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_ARCHITECTURE: - self.state = 592 + if _la == 12: + self.state = 594 self.match(VHDLParser.KW_ARCHITECTURE) - self.state = 596 + self.state = 598 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: - self.state = 595 + if _la == 163: + self.state = 597 localctx.name2 = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 598 + self.state = 600 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -2271,88 +2297,88 @@ def rule_ArchitectureStatement(self): localctx = VHDLParser.Rule_ArchitectureStatementContext(self, self._ctx, self.state) self.enterRule(localctx, 22, self.RULE_rule_ArchitectureStatement) try: - self.state = 623 + self.state = 625 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input, 15, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 600 + self.state = 602 localctx.blockStatement = self.rule_BlockStatement() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 601 + self.state = 603 localctx.processStatement = self.rule_ProcessStatement() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 602 + self.state = 604 localctx.postponedProcessStatement = self.rule_PostponedProcessStatement() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 605 + self.state = 607 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input, 11, self._ctx) if la_ == 1: - self.state = 603 + self.state = 605 localctx.label = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 604 + self.state = 606 self.match(VHDLParser.TOK_COLON) - self.state = 607 + self.state = 609 localctx.procedureCallStatement = self.rule_ConcurrentProcedureCallStatement() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) - self.state = 610 + self.state = 612 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input, 12, self._ctx) if la_ == 1: - self.state = 608 + self.state = 610 localctx.label = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 609 + self.state = 611 self.match(VHDLParser.TOK_COLON) - self.state = 612 + self.state = 614 localctx.assertionStatement = self.rule_ConcurrentAssertionStatement() pass elif la_ == 6: self.enterOuterAlt(localctx, 6) - self.state = 615 + self.state = 617 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input, 13, self._ctx) if la_ == 1: - self.state = 613 + self.state = 615 localctx.label = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 614 + self.state = 616 self.match(VHDLParser.TOK_COLON) - self.state = 618 + self.state = 620 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input, 14, self._ctx) if la_ == 1: - self.state = 617 + self.state = 619 localctx.postponed = self.match(VHDLParser.KW_POSTPONED) - self.state = 620 + self.state = 622 localctx.signalAssignmentStatement = self.rule_ConcurrentSignalAssignmentStatement() pass elif la_ == 7: self.enterOuterAlt(localctx, 7) - self.state = 621 + self.state = 623 localctx.instantiationStatement = self.rule_ComponentInstantiationStatement() pass elif la_ == 8: self.enterOuterAlt(localctx, 8) - self.state = 622 + self.state = 624 localctx.generateStatement = self.rule_GenerateStatement() pass @@ -2375,8 +2401,8 @@ def __init__(self, parser, parent: ParserRuleContext = None, invokingState: int def rule_IndexConstraint(self): return self.getTypedRuleContext(VHDLParser.Rule_IndexConstraintContext, 0) - def rule_ArrayElementConstraint(self): - return self.getTypedRuleContext(VHDLParser.Rule_ArrayElementConstraintContext, 0) + def rule_ElementConstraint(self): + return self.getTypedRuleContext(VHDLParser.Rule_ElementConstraintContext, 0) def TOK_LP(self): return self.getToken(VHDLParser.TOK_LP, 0) @@ -2401,36 +2427,36 @@ def rule_ArrayConstraint(self): localctx = VHDLParser.Rule_ArrayConstraintContext(self, self._ctx, self.state) self.enterRule(localctx, 24, self.RULE_rule_ArrayConstraint) try: - self.state = 635 + self.state = 637 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input, 18, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 625 - self.rule_IndexConstraint() self.state = 627 + self.rule_IndexConstraint() + self.state = 629 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input, 16, self._ctx) if la_ == 1: - self.state = 626 - self.rule_ArrayElementConstraint() + self.state = 628 + self.rule_ElementConstraint() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 629 + self.state = 631 self.match(VHDLParser.TOK_LP) - self.state = 630 + self.state = 632 self.match(VHDLParser.KW_OPEN) - self.state = 631 - self.match(VHDLParser.TOK_RP) self.state = 633 + self.match(VHDLParser.TOK_RP) + self.state = 635 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input, 17, self._ctx) if la_ == 1: - self.state = 632 - self.rule_ArrayElementConstraint() + self.state = 634 + self.rule_ElementConstraint() pass @@ -2443,76 +2469,6 @@ def rule_ArrayConstraint(self): self.exitRule() return localctx - class Rule_ArrayElementConstraintContext(ParserRuleContext): - __slots__ = 'parser' - - def __init__(self, parser, parent: ParserRuleContext = None, invokingState: int = -1): - super().__init__(parent, invokingState) - self.parser = parser - - def rule_ElementConstraint(self): - return self.getTypedRuleContext(VHDLParser.Rule_ElementConstraintContext, 0) - - def getRuleIndex(self): - return VHDLParser.RULE_rule_ArrayElementConstraint - - def accept(self, visitor: ParseTreeVisitor): - if hasattr(visitor, "visitRule_ArrayElementConstraint"): - return visitor.visitRule_ArrayElementConstraint(self) - else: - return visitor.visitChildren(self) - - def rule_ArrayElementConstraint(self): - - localctx = VHDLParser.Rule_ArrayElementConstraintContext(self, self._ctx, self.state) - self.enterRule(localctx, 26, self.RULE_rule_ArrayElementConstraint) - try: - self.enterOuterAlt(localctx, 1) - self.state = 637 - self.rule_ElementConstraint() - except RecognitionException as re: - localctx.exception = re - self._errHandler.reportError(self, re) - self._errHandler.recover(self, re) - finally: - self.exitRule() - return localctx - - class Rule_ArrayElementResolutionContext(ParserRuleContext): - __slots__ = 'parser' - - def __init__(self, parser, parent: ParserRuleContext = None, invokingState: int = -1): - super().__init__(parent, invokingState) - self.parser = parser - - def rule_ResolutionIndication(self): - return self.getTypedRuleContext(VHDLParser.Rule_ResolutionIndicationContext, 0) - - def getRuleIndex(self): - return VHDLParser.RULE_rule_ArrayElementResolution - - def accept(self, visitor: ParseTreeVisitor): - if hasattr(visitor, "visitRule_ArrayElementResolution"): - return visitor.visitRule_ArrayElementResolution(self) - else: - return visitor.visitChildren(self) - - def rule_ArrayElementResolution(self): - - localctx = VHDLParser.Rule_ArrayElementResolutionContext(self, self._ctx, self.state) - self.enterRule(localctx, 28, self.RULE_rule_ArrayElementResolution) - try: - self.enterOuterAlt(localctx, 1) - self.state = 639 - self.rule_ResolutionIndication() - except RecognitionException as re: - localctx.exception = re - self._errHandler.reportError(self, re) - self._errHandler.recover(self, re) - finally: - self.exitRule() - return localctx - class Rule_ArrayIncompleteTypeDefinitionContext(ParserRuleContext): __slots__ = 'parser' @@ -2550,20 +2506,20 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ArrayIncompleteTypeDefinition(self): localctx = VHDLParser.Rule_ArrayIncompleteTypeDefinitionContext(self, self._ctx, self.state) - self.enterRule(localctx, 30, self.RULE_rule_ArrayIncompleteTypeDefinition) + self.enterRule(localctx, 26, self.RULE_rule_ArrayIncompleteTypeDefinition) try: self.enterOuterAlt(localctx, 1) - self.state = 641 + self.state = 639 self.match(VHDLParser.KW_ARRAY) - self.state = 642 + self.state = 640 self.match(VHDLParser.TOK_LP) - self.state = 643 + self.state = 641 self.rule_ArrayIndexIncompleteTypeList() - self.state = 644 + self.state = 642 self.match(VHDLParser.TOK_RP) - self.state = 645 + self.state = 643 self.match(VHDLParser.KW_OF) - self.state = 646 + self.state = 644 self.rule_IncompleteSubtypeIndication() except RecognitionException as re: localctx.exception = re @@ -2601,24 +2557,24 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ArrayIndexIncompleteType(self): localctx = VHDLParser.Rule_ArrayIndexIncompleteTypeContext(self, self._ctx, self.state) - self.enterRule(localctx, 32, self.RULE_rule_ArrayIndexIncompleteType) + self.enterRule(localctx, 28, self.RULE_rule_ArrayIndexIncompleteType) try: - self.state = 651 + self.state = 649 self._errHandler.sync(self) token = self._input.LA(1) - if token in [VHDLParser.TOK_DLA, VHDLParser.LIT_CHARACTER, VHDLParser.LIT_STRING, VHDLParser.LIT_IDENTIFIER]: + if token in [147, 161, 162, 163]: self.enterOuterAlt(localctx, 1) - self.state = 648 + self.state = 646 self.rule_IndexSubtypeDefinition() pass - elif token in [VHDLParser.TOK_LP]: + elif token in [143]: self.enterOuterAlt(localctx, 2) - self.state = 649 + self.state = 647 self.rule_IndexConstraint() pass - elif token in [VHDLParser.KW_TYPE]: + elif token in [104]: self.enterOuterAlt(localctx, 3) - self.state = 650 + self.state = 648 self.rule_UnspecifiedTypeIndication() pass else: @@ -2663,21 +2619,21 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ArrayIndexIncompleteTypeList(self): localctx = VHDLParser.Rule_ArrayIndexIncompleteTypeListContext(self, self._ctx, self.state) - self.enterRule(localctx, 34, self.RULE_rule_ArrayIndexIncompleteTypeList) + self.enterRule(localctx, 30, self.RULE_rule_ArrayIndexIncompleteTypeList) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 653 + self.state = 651 self.rule_ArrayIndexIncompleteType() - self.state = 658 + self.state = 656 self._errHandler.sync(self) _la = self._input.LA(1) - while _la == VHDLParser.TOK_COMMA: - self.state = 654 + while _la == 151: + self.state = 652 self.match(VHDLParser.TOK_COMMA) - self.state = 655 + self.state = 653 self.rule_ArrayIndexIncompleteType() - self.state = 660 + self.state = 658 self._errHandler.sync(self) _la = self._input.LA(1) @@ -2726,25 +2682,25 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ArrayModeViewIndication(self): localctx = VHDLParser.Rule_ArrayModeViewIndicationContext(self, self._ctx, self.state) - self.enterRule(localctx, 36, self.RULE_rule_ArrayModeViewIndication) + self.enterRule(localctx, 32, self.RULE_rule_ArrayModeViewIndication) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 661 + self.state = 659 self.match(VHDLParser.KW_VIEW) - self.state = 662 + self.state = 660 self.match(VHDLParser.TOK_LP) - self.state = 663 + self.state = 661 self.rule_Name(0) - self.state = 664 + self.state = 662 self.match(VHDLParser.TOK_RP) - self.state = 667 + self.state = 665 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_OF: - self.state = 665 + if _la == 64: + self.state = 663 self.match(VHDLParser.KW_OF) - self.state = 666 + self.state = 664 self.rule_SubtypeIndication() @@ -2793,30 +2749,30 @@ def accept(self, visitor: ParseTreeVisitor): def rule_Assertion(self): localctx = VHDLParser.Rule_AssertionContext(self, self._ctx, self.state) - self.enterRule(localctx, 38, self.RULE_rule_Assertion) + self.enterRule(localctx, 34, self.RULE_rule_Assertion) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 669 + self.state = 667 self.match(VHDLParser.KW_ASSERT) - self.state = 670 + self.state = 668 localctx.assertCondition = self.rule_Expression(0) - self.state = 673 + self.state = 671 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_REPORT: - self.state = 671 + if _la == 85: + self.state = 669 self.match(VHDLParser.KW_REPORT) - self.state = 672 + self.state = 670 localctx.reportExpression = self.rule_Expression(0) - self.state = 677 + self.state = 675 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_SEVERITY: - self.state = 675 + if _la == 91: + self.state = 673 self.match(VHDLParser.KW_SEVERITY) - self.state = 676 + self.state = 674 localctx.severityExpression = self.rule_Expression(0) @@ -2861,22 +2817,22 @@ def accept(self, visitor: ParseTreeVisitor): def rule_AssertionStatement(self): localctx = VHDLParser.Rule_AssertionStatementContext(self, self._ctx, self.state) - self.enterRule(localctx, 40, self.RULE_rule_AssertionStatement) + self.enterRule(localctx, 36, self.RULE_rule_AssertionStatement) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 681 + self.state = 679 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: - self.state = 679 + if _la == 163: + self.state = 677 localctx.label = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 680 + self.state = 678 self.match(VHDLParser.TOK_COLON) - self.state = 683 + self.state = 681 localctx.assertion = self.rule_Assertion() - self.state = 684 + self.state = 682 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -2916,19 +2872,19 @@ def accept(self, visitor: ParseTreeVisitor): def rule_AssociationElement(self): localctx = VHDLParser.Rule_AssociationElementContext(self, self._ctx, self.state) - self.enterRule(localctx, 42, self.RULE_rule_AssociationElement) + self.enterRule(localctx, 38, self.RULE_rule_AssociationElement) try: self.enterOuterAlt(localctx, 1) - self.state = 689 + self.state = 687 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input, 25, self._ctx) if la_ == 1: - self.state = 686 + self.state = 684 localctx.formal = self.rule_FormalPart() - self.state = 687 + self.state = 685 self.match(VHDLParser.TOK_RARROW) - self.state = 691 + self.state = 689 localctx.actual = self.rule_ActualPart() except RecognitionException as re: localctx.exception = re @@ -2971,23 +2927,23 @@ def accept(self, visitor: ParseTreeVisitor): def rule_AssociationList(self): localctx = VHDLParser.Rule_AssociationListContext(self, self._ctx, self.state) - self.enterRule(localctx, 44, self.RULE_rule_AssociationList) + self.enterRule(localctx, 40, self.RULE_rule_AssociationList) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 693 + self.state = 691 localctx._rule_AssociationElement = self.rule_AssociationElement() localctx.element.append(localctx._rule_AssociationElement) - self.state = 698 + self.state = 696 self._errHandler.sync(self) _la = self._input.LA(1) - while _la == VHDLParser.TOK_COMMA: - self.state = 694 + while _la == 151: + self.state = 692 self.match(VHDLParser.TOK_COMMA) - self.state = 695 + self.state = 693 localctx._rule_AssociationElement = self.rule_AssociationElement() localctx.element.append(localctx._rule_AssociationElement) - self.state = 700 + self.state = 698 self._errHandler.sync(self) _la = self._input.LA(1) @@ -3035,18 +2991,18 @@ def accept(self, visitor: ParseTreeVisitor): def rule_AttributeDeclaration(self): localctx = VHDLParser.Rule_AttributeDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 46, self.RULE_rule_AttributeDeclaration) + self.enterRule(localctx, 42, self.RULE_rule_AttributeDeclaration) try: self.enterOuterAlt(localctx, 1) - self.state = 701 + self.state = 699 self.match(VHDLParser.KW_ATTRIBUTE) - self.state = 702 + self.state = 700 localctx.label = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 703 + self.state = 701 self.match(VHDLParser.TOK_COLON) - self.state = 704 + self.state = 702 localctx.name = self.rule_Name(0) - self.state = 705 + self.state = 703 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -3090,15 +3046,13 @@ def accept(self, visitor: ParseTreeVisitor): def rule_AttributeDesignator(self): localctx = VHDLParser.Rule_AttributeDesignatorContext(self, self._ctx, self.state) - self.enterRule(localctx, 48, self.RULE_rule_AttributeDesignator) + self.enterRule(localctx, 44, self.RULE_rule_AttributeDesignator) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 707 + self.state = 705 _la = self._input.LA(1) - if not (((((_la - 79)) & ~0x3f) == 0 and ((1 << (_la - 79)) & ( - (1 << (VHDLParser.KW_RANGE - 79)) | (1 << (VHDLParser.KW_RECORD - 79)) | (1 << (VHDLParser.KW_SIGNAL - 79)) | ( - 1 << (VHDLParser.KW_SUBTYPE - 79)))) != 0) or _la == VHDLParser.LIT_IDENTIFIER): + if not (((((_la - 79)) & ~0x3f) == 0 and ((1 << (_la - 79)) & 540675) != 0) or _la == 163): self._errHandler.recoverInline(self) else: self._errHandler.reportMatch(self) @@ -3154,22 +3108,22 @@ def accept(self, visitor: ParseTreeVisitor): def rule_AttributeSpecification(self): localctx = VHDLParser.Rule_AttributeSpecificationContext(self, self._ctx, self.state) - self.enterRule(localctx, 50, self.RULE_rule_AttributeSpecification) + self.enterRule(localctx, 46, self.RULE_rule_AttributeSpecification) try: self.enterOuterAlt(localctx, 1) - self.state = 709 + self.state = 707 self.match(VHDLParser.KW_ATTRIBUTE) - self.state = 710 + self.state = 708 localctx.designator = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 711 + self.state = 709 self.match(VHDLParser.KW_OF) - self.state = 712 + self.state = 710 localctx.entitySpecification = self.rule_EntitySpecification() - self.state = 713 + self.state = 711 self.match(VHDLParser.KW_IS) - self.state = 714 + self.state = 712 localctx.expression = self.rule_ConditionalExpression() - self.state = 715 + self.state = 713 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -3213,31 +3167,31 @@ def accept(self, visitor: ParseTreeVisitor): def rule_BindingIndication(self): localctx = VHDLParser.Rule_BindingIndicationContext(self, self._ctx, self.state) - self.enterRule(localctx, 52, self.RULE_rule_BindingIndication) + self.enterRule(localctx, 48, self.RULE_rule_BindingIndication) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 719 + self.state = 717 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_USE: - self.state = 717 + if _la == 108: + self.state = 715 self.match(VHDLParser.KW_USE) - self.state = 718 + self.state = 716 localctx.entityAspect = self.rule_EntityAspect() - self.state = 722 + self.state = 720 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_GENERIC: - self.state = 721 + if _la == 42: + self.state = 719 localctx.genericMapAspect = self.rule_GenericMapAspect() - self.state = 725 + self.state = 723 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_PORT: - self.state = 724 + if _la == 72: + self.state = 722 localctx.portMapAspect = self.rule_PortMapAspect() @@ -3300,41 +3254,41 @@ def accept(self, visitor: ParseTreeVisitor): def rule_BlockConfiguration(self): localctx = VHDLParser.Rule_BlockConfigurationContext(self, self._ctx, self.state) - self.enterRule(localctx, 54, self.RULE_rule_BlockConfiguration) + self.enterRule(localctx, 50, self.RULE_rule_BlockConfiguration) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 727 + self.state = 725 self.match(VHDLParser.KW_FOR) - self.state = 728 + self.state = 726 localctx.blockSpecification = self.rule_BlockSpecification() - self.state = 732 + self.state = 730 self._errHandler.sync(self) _la = self._input.LA(1) - while _la == VHDLParser.KW_USE: - self.state = 729 + while _la == 108: + self.state = 727 localctx._rule_UseClause = self.rule_UseClause() localctx.useClauses.append(localctx._rule_UseClause) - self.state = 734 + self.state = 732 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 738 + self.state = 736 self._errHandler.sync(self) _la = self._input.LA(1) - while _la == VHDLParser.KW_FOR: - self.state = 735 + while _la == 37: + self.state = 733 localctx._rule_ConfigurationItem = self.rule_ConfigurationItem() localctx.configurationItems.append(localctx._rule_ConfigurationItem) - self.state = 740 + self.state = 738 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 741 + self.state = 739 self.match(VHDLParser.KW_END) - self.state = 742 + self.state = 740 self.match(VHDLParser.KW_FOR) - self.state = 743 + self.state = 741 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -3411,6 +3365,12 @@ def rule_DisconnectionSpecification(self): def rule_UseClause(self): return self.getTypedRuleContext(VHDLParser.Rule_UseClauseContext, 0) + def rule_GroupTemplateDeclaration(self): + return self.getTypedRuleContext(VHDLParser.Rule_GroupTemplateDeclarationContext, 0) + + def rule_GroupDeclaration(self): + return self.getTypedRuleContext(VHDLParser.Rule_GroupDeclarationContext, 0) + def getRuleIndex(self): return VHDLParser.RULE_rule_BlockDeclarativeItem @@ -3423,131 +3383,143 @@ def accept(self, visitor: ParseTreeVisitor): def rule_BlockDeclarativeItem(self): localctx = VHDLParser.Rule_BlockDeclarativeItemContext(self, self._ctx, self.state) - self.enterRule(localctx, 56, self.RULE_rule_BlockDeclarativeItem) + self.enterRule(localctx, 52, self.RULE_rule_BlockDeclarativeItem) try: self.state = 765 self._errHandler.sync(self) la_ = self._interp.adaptivePredict(self._input, 32, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 745 + self.state = 743 self.rule_SubprogramDeclaration() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 746 + self.state = 744 self.rule_SubprogramBody() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 747 + self.state = 745 self.rule_SubprogramInstantiationDeclaration() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 748 + self.state = 746 self.rule_PackageDeclaration() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) - self.state = 749 + self.state = 747 self.rule_PackageBody() pass elif la_ == 6: self.enterOuterAlt(localctx, 6) - self.state = 750 + self.state = 748 self.rule_PackageInstantiationDeclaration() pass elif la_ == 7: self.enterOuterAlt(localctx, 7) - self.state = 751 + self.state = 749 self.rule_TypeDeclaration() pass elif la_ == 8: self.enterOuterAlt(localctx, 8) - self.state = 752 + self.state = 750 self.rule_SubtypeDeclaration() pass elif la_ == 9: self.enterOuterAlt(localctx, 9) - self.state = 753 + self.state = 751 self.rule_ModeViewDeclaration() pass elif la_ == 10: self.enterOuterAlt(localctx, 10) - self.state = 754 + self.state = 752 self.rule_ConstantDeclaration() pass elif la_ == 11: self.enterOuterAlt(localctx, 11) - self.state = 755 + self.state = 753 self.rule_SignalDeclaration() pass elif la_ == 12: self.enterOuterAlt(localctx, 12) - self.state = 756 + self.state = 754 self.rule_VariableDeclaration() pass elif la_ == 13: self.enterOuterAlt(localctx, 13) - self.state = 757 + self.state = 755 self.rule_FileDeclaration() pass elif la_ == 14: self.enterOuterAlt(localctx, 14) - self.state = 758 + self.state = 756 self.rule_AliasDeclaration() pass elif la_ == 15: self.enterOuterAlt(localctx, 15) - self.state = 759 + self.state = 757 self.rule_ComponentDeclaration() pass elif la_ == 16: self.enterOuterAlt(localctx, 16) - self.state = 760 + self.state = 758 self.rule_AttributeDeclaration() pass elif la_ == 17: self.enterOuterAlt(localctx, 17) - self.state = 761 + self.state = 759 self.rule_AttributeSpecification() pass elif la_ == 18: self.enterOuterAlt(localctx, 18) - self.state = 762 + self.state = 760 self.rule_ConfigurationSpecification() pass elif la_ == 19: self.enterOuterAlt(localctx, 19) - self.state = 763 + self.state = 761 self.rule_DisconnectionSpecification() pass elif la_ == 20: self.enterOuterAlt(localctx, 20) - self.state = 764 + self.state = 762 self.rule_UseClause() pass + elif la_ == 21: + self.enterOuterAlt(localctx, 21) + self.state = 763 + self.rule_GroupTemplateDeclaration() + pass + + elif la_ == 22: + self.enterOuterAlt(localctx, 22) + self.state = 764 + self.rule_GroupDeclaration() + pass + except RecognitionException as re: localctx.exception = re @@ -3593,7 +3565,7 @@ def accept(self, visitor: ParseTreeVisitor): def rule_BlockSpecification(self): localctx = VHDLParser.Rule_BlockSpecificationContext(self, self._ctx, self.state) - self.enterRule(localctx, 58, self.RULE_rule_BlockSpecification) + self.enterRule(localctx, 54, self.RULE_rule_BlockSpecification) self._la = 0 # Token type try: self.state = 775 @@ -3612,7 +3584,7 @@ def rule_BlockSpecification(self): self.state = 773 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.TOK_LP: + if _la == 143: self.state = 769 self.match(VHDLParser.TOK_LP) self.state = 770 @@ -3645,8 +3617,8 @@ def __init__(self, parser, parent: ParserRuleContext = None, invokingState: int self.portMapAspect = None # Rule_PortMapAspectContext self._rule_BlockDeclarativeItem = None # Rule_BlockDeclarativeItemContext self.blockDeclarativeItem = list() # of Rule_BlockDeclarativeItemContexts - self._rule_ArchitectureStatement = None # Rule_ArchitectureStatementContext - self.blockStatements = list() # of Rule_ArchitectureStatementContexts + self._rule_ConcurrentStatement = None # Rule_ConcurrentStatementContext + self.blockStatements = list() # of Rule_ConcurrentStatementContexts self.label2 = None # Token def TOK_COLON(self): @@ -3700,11 +3672,11 @@ def rule_BlockDeclarativeItem(self, i: int = None): else: return self.getTypedRuleContext(VHDLParser.Rule_BlockDeclarativeItemContext, i) - def rule_ArchitectureStatement(self, i: int = None): + def rule_ConcurrentStatement(self, i: int = None): if i is None: - return self.getTypedRuleContexts(VHDLParser.Rule_ArchitectureStatementContext) + return self.getTypedRuleContexts(VHDLParser.Rule_ConcurrentStatementContext) else: - return self.getTypedRuleContext(VHDLParser.Rule_ArchitectureStatementContext, i) + return self.getTypedRuleContext(VHDLParser.Rule_ConcurrentStatementContext, i) def rule_GenericMapAspect(self): return self.getTypedRuleContext(VHDLParser.Rule_GenericMapAspectContext, 0) @@ -3724,7 +3696,7 @@ def accept(self, visitor: ParseTreeVisitor): def rule_BlockStatement(self): localctx = VHDLParser.Rule_BlockStatementContext(self, self._ctx, self.state) - self.enterRule(localctx, 60, self.RULE_rule_BlockStatement) + self.enterRule(localctx, 56, self.RULE_rule_BlockStatement) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) @@ -3737,7 +3709,7 @@ def rule_BlockStatement(self): self.state = 784 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.TOK_LP: + if _la == 143: self.state = 780 self.match(VHDLParser.TOK_LP) self.state = 781 @@ -3748,20 +3720,20 @@ def rule_BlockStatement(self): self.state = 787 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_IS: + if _la == 50: self.state = 786 self.match(VHDLParser.KW_IS) self.state = 795 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_GENERIC: + if _la == 42: self.state = 789 localctx.genericClause = self.rule_GenericClause() self.state = 793 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_GENERIC: + if _la == 42: self.state = 790 localctx.genericMapAspect = self.rule_GenericMapAspect() self.state = 791 @@ -3770,13 +3742,13 @@ def rule_BlockStatement(self): self.state = 803 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_PORT: + if _la == 72: self.state = 797 localctx.portClause = self.rule_PortClause() self.state = 801 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_PORT: + if _la == 72: self.state = 798 localctx.portMapAspect = self.rule_PortMapAspect() self.state = 799 @@ -3785,15 +3757,8 @@ def rule_BlockStatement(self): self.state = 808 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ( - (1 << VHDLParser.KW_ALIAS) | (1 << VHDLParser.KW_ATTRIBUTE) | (1 << VHDLParser.KW_COMPONENT) | ( - 1 << VHDLParser.KW_CONSTANT) | (1 << VHDLParser.KW_DISCONNECT) | (1 << VHDLParser.KW_FILE) | ( - 1 << VHDLParser.KW_FOR) | (1 << VHDLParser.KW_FUNCTION) | (1 << VHDLParser.KW_IMPURE))) != 0) or ( - (((_la - 70)) & ~0x3f) == 0 and ((1 << (_la - 70)) & ( - (1 << (VHDLParser.KW_PACKAGE - 70)) | (1 << (VHDLParser.KW_PROCEDURE - 70)) | ( - 1 << (VHDLParser.KW_PURE - 70)) | (1 << (VHDLParser.KW_SHARED - 70)) | (1 << (VHDLParser.KW_SIGNAL - 70)) | ( - 1 << (VHDLParser.KW_SUBTYPE - 70)) | (1 << (VHDLParser.KW_TYPE - 70)) | (1 << (VHDLParser.KW_USE - 70)) | ( - 1 << (VHDLParser.KW_VARIABLE - 70)) | (1 << (VHDLParser.KW_VIEW - 70)))) != 0): + while (((_la) & ~0x3f) == 0 and ((1 << _la) & 88717423313408) != 0) or ( + (((_la - 70)) & ~0x3f) == 0 and ((1 << (_la - 70)) & 1941606236449) != 0): self.state = 805 localctx._rule_BlockDeclarativeItem = self.rule_BlockDeclarativeItem() localctx.blockDeclarativeItem.append(localctx._rule_BlockDeclarativeItem) @@ -3806,15 +3771,11 @@ def rule_BlockStatement(self): self.state = 815 self._errHandler.sync(self) _la = self._input.LA(1) - while ((((_la - 14)) & ~0x3f) == 0 and ((1 << (_la - 14)) & ( - (1 << (VHDLParser.KW_ASSERT - 14)) | (1 << (VHDLParser.KW_POSTPONED - 14)) | ( - 1 << (VHDLParser.KW_PROCESS - 14)))) != 0) or ((((_la - 116)) & ~0x3f) == 0 and ((1 << (_la - 116)) & ( - (1 << (VHDLParser.KW_WITH - 116)) | (1 << (VHDLParser.TOK_LP - 116)) | (1 << (VHDLParser.TOK_DLA - 116)) | ( - 1 << (VHDLParser.LIT_CHARACTER - 116)) | (1 << (VHDLParser.LIT_STRING - 116)) | ( - 1 << (VHDLParser.LIT_IDENTIFIER - 116)))) != 0): + while ((((_la - 14)) & ~0x3f) == 0 and ((1 << (_la - 14)) & 5188146770730811393) != 0) or ( + (((_la - 116)) & ~0x3f) == 0 and ((1 << (_la - 116)) & 246292886323201) != 0): self.state = 812 - localctx._rule_ArchitectureStatement = self.rule_ArchitectureStatement() - localctx.blockStatements.append(localctx._rule_ArchitectureStatement) + localctx._rule_ConcurrentStatement = self.rule_ConcurrentStatement() + localctx.blockStatements.append(localctx._rule_ConcurrentStatement) self.state = 817 self._errHandler.sync(self) _la = self._input.LA(1) @@ -3826,7 +3787,7 @@ def rule_BlockStatement(self): self.state = 821 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: + if _la == 163: self.state = 820 localctx.label2 = self.match(VHDLParser.LIT_IDENTIFIER) @@ -3847,8 +3808,6 @@ def __init__(self, parser, parent: ParserRuleContext = None, invokingState: int super().__init__(parent, invokingState) self.parser = parser self.alternativeLabel = None # Token - self._rule_ArchitectureStatement = None # Rule_ArchitectureStatementContext - self.statements = list() # of Rule_ArchitectureStatementContexts def KW_WHEN(self): return self.getToken(VHDLParser.KW_WHEN, 0) @@ -3859,18 +3818,15 @@ def rule_Choices(self): def TOK_RARROW(self): return self.getToken(VHDLParser.TOK_RARROW, 0) + def rule_GenerateStatementBody(self): + return self.getTypedRuleContext(VHDLParser.Rule_GenerateStatementBodyContext, 0) + def TOK_COLON(self): return self.getToken(VHDLParser.TOK_COLON, 0) def LIT_IDENTIFIER(self): return self.getToken(VHDLParser.LIT_IDENTIFIER, 0) - def rule_ArchitectureStatement(self, i: int = None): - if i is None: - return self.getTypedRuleContexts(VHDLParser.Rule_ArchitectureStatementContext) - else: - return self.getTypedRuleContext(VHDLParser.Rule_ArchitectureStatementContext, i) - def getRuleIndex(self): return VHDLParser.RULE_rule_CaseGenerateAlternative @@ -3883,8 +3839,7 @@ def accept(self, visitor: ParseTreeVisitor): def rule_CaseGenerateAlternative(self): localctx = VHDLParser.Rule_CaseGenerateAlternativeContext(self, self._ctx, self.state) - self.enterRule(localctx, 62, self.RULE_rule_CaseGenerateAlternative) - self._la = 0 # Token type + self.enterRule(localctx, 58, self.RULE_rule_CaseGenerateAlternative) try: self.enterOuterAlt(localctx, 1) self.state = 825 @@ -3902,22 +3857,8 @@ def rule_CaseGenerateAlternative(self): self.rule_Choices() self.state = 831 self.match(VHDLParser.TOK_RARROW) - self.state = 835 - self._errHandler.sync(self) - _la = self._input.LA(1) - while ((((_la - 14)) & ~0x3f) == 0 and ((1 << (_la - 14)) & ( - (1 << (VHDLParser.KW_ASSERT - 14)) | (1 << (VHDLParser.KW_POSTPONED - 14)) | ( - 1 << (VHDLParser.KW_PROCESS - 14)))) != 0) or ((((_la - 116)) & ~0x3f) == 0 and ((1 << (_la - 116)) & ( - (1 << (VHDLParser.KW_WITH - 116)) | (1 << (VHDLParser.TOK_LP - 116)) | (1 << (VHDLParser.TOK_DLA - 116)) | ( - 1 << (VHDLParser.LIT_CHARACTER - 116)) | (1 << (VHDLParser.LIT_STRING - 116)) | ( - 1 << (VHDLParser.LIT_IDENTIFIER - 116)))) != 0): - self.state = 832 - localctx._rule_ArchitectureStatement = self.rule_ArchitectureStatement() - localctx.statements.append(localctx._rule_ArchitectureStatement) - self.state = 837 - self._errHandler.sync(self) - _la = self._input.LA(1) - + self.state = 832 + self.rule_GenerateStatementBody() except RecognitionException as re: localctx.exception = re self._errHandler.reportError(self, re) @@ -3983,45 +3924,45 @@ def accept(self, visitor: ParseTreeVisitor): def rule_CaseGenerateStatement(self): localctx = VHDLParser.Rule_CaseGenerateStatementContext(self, self._ctx, self.state) - self.enterRule(localctx, 64, self.RULE_rule_CaseGenerateStatement) + self.enterRule(localctx, 60, self.RULE_rule_CaseGenerateStatement) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 838 + self.state = 834 localctx.label = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 839 + self.state = 835 self.match(VHDLParser.TOK_COLON) - self.state = 840 + self.state = 836 self.match(VHDLParser.KW_CASE) - self.state = 841 + self.state = 837 localctx.expression = self.rule_Expression(0) - self.state = 842 + self.state = 838 self.match(VHDLParser.KW_GENERATE) - self.state = 844 + self.state = 840 self._errHandler.sync(self) _la = self._input.LA(1) while True: - self.state = 843 + self.state = 839 localctx._rule_CaseGenerateAlternative = self.rule_CaseGenerateAlternative() localctx.alternatives.append(localctx._rule_CaseGenerateAlternative) - self.state = 846 + self.state = 842 self._errHandler.sync(self) _la = self._input.LA(1) - if not (_la == VHDLParser.KW_WHEN): + if not (_la == 117): break - self.state = 848 + self.state = 844 self.match(VHDLParser.KW_END) - self.state = 849 + self.state = 845 self.match(VHDLParser.KW_GENERATE) - self.state = 851 + self.state = 847 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: - self.state = 850 + if _la == 163: + self.state = 846 localctx.label2 = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 853 + self.state = 849 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -4088,50 +4029,50 @@ def accept(self, visitor: ParseTreeVisitor): def rule_CaseStatement(self): localctx = VHDLParser.Rule_CaseStatementContext(self, self._ctx, self.state) - self.enterRule(localctx, 66, self.RULE_rule_CaseStatement) + self.enterRule(localctx, 62, self.RULE_rule_CaseStatement) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 857 + self.state = 853 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: - self.state = 855 + if _la == 163: + self.state = 851 localctx.label = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 856 + self.state = 852 self.match(VHDLParser.TOK_COLON) - self.state = 859 + self.state = 855 self.match(VHDLParser.KW_CASE) - self.state = 860 + self.state = 856 localctx.expression = self.rule_Expression(0) - self.state = 861 + self.state = 857 self.match(VHDLParser.KW_IS) - self.state = 863 + self.state = 859 self._errHandler.sync(self) _la = self._input.LA(1) while True: - self.state = 862 + self.state = 858 localctx._rule_CaseStatementAlternative = self.rule_CaseStatementAlternative() localctx.alternatives.append(localctx._rule_CaseStatementAlternative) - self.state = 865 + self.state = 861 self._errHandler.sync(self) _la = self._input.LA(1) - if not (_la == VHDLParser.KW_WHEN): + if not (_la == 117): break - self.state = 867 + self.state = 863 self.match(VHDLParser.KW_END) - self.state = 868 + self.state = 864 self.match(VHDLParser.KW_CASE) - self.state = 870 + self.state = 866 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: - self.state = 869 + if _la == 163: + self.state = 865 localctx.label2 = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 872 + self.state = 868 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -4177,33 +4118,26 @@ def accept(self, visitor: ParseTreeVisitor): def rule_CaseStatementAlternative(self): localctx = VHDLParser.Rule_CaseStatementAlternativeContext(self, self._ctx, self.state) - self.enterRule(localctx, 68, self.RULE_rule_CaseStatementAlternative) + self.enterRule(localctx, 64, self.RULE_rule_CaseStatementAlternative) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 874 + self.state = 870 self.match(VHDLParser.KW_WHEN) - self.state = 875 + self.state = 871 self.rule_Choices() - self.state = 876 + self.state = 872 self.match(VHDLParser.TOK_RARROW) - self.state = 880 + self.state = 876 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ( - (1 << VHDLParser.KW_ASSERT) | (1 << VHDLParser.KW_BLOCK) | (1 << VHDLParser.KW_CASE) | ( - 1 << VHDLParser.KW_EXIT) | (1 << VHDLParser.KW_FOR) | (1 << VHDLParser.KW_IF) | (1 << VHDLParser.KW_LOOP) | ( - 1 << VHDLParser.KW_NEXT) | (1 << VHDLParser.KW_NULL))) != 0) or ((((_la - 85)) & ~0x3f) == 0 and ( - (1 << (_la - 85)) & ( - (1 << (VHDLParser.KW_REPORT - 85)) | (1 << (VHDLParser.KW_RETURN - 85)) | (1 << (VHDLParser.KW_WAIT - 85)) | ( - 1 << (VHDLParser.KW_WITH - 85)) | (1 << (VHDLParser.KW_WHILE - 85)) | (1 << (VHDLParser.TOK_LP - 85)) | ( - 1 << (VHDLParser.TOK_DLA - 85)))) != 0) or ((((_la - 162)) & ~0x3f) == 0 and ((1 << (_la - 162)) & ( - (1 << (VHDLParser.LIT_CHARACTER - 162)) | (1 << (VHDLParser.LIT_STRING - 162)) | ( - 1 << (VHDLParser.LIT_IDENTIFIER - 162)))) != 0): - self.state = 877 + while (((_la) & ~0x3f) == 0 and ((1 << _la) & -8052400777563193344) != 0) or ( + (((_la - 85)) & ~0x3f) == 0 and ((1 << (_la - 85)) & 4899916406390259715) != 0) or ( + (((_la - 161)) & ~0x3f) == 0 and ((1 << (_la - 161)) & 7) != 0): + self.state = 873 localctx._rule_SequentialStatement = self.rule_SequentialStatement() localctx.statements.append(localctx._rule_SequentialStatement) - self.state = 882 + self.state = 878 self._errHandler.sync(self) _la = self._input.LA(1) @@ -4228,9 +4162,6 @@ def rule_Expression(self): def rule_DiscreteRange(self): return self.getTypedRuleContext(VHDLParser.Rule_DiscreteRangeContext, 0) - def LIT_IDENTIFIER(self): - return self.getToken(VHDLParser.LIT_IDENTIFIER, 0) - def KW_OTHERS(self): return self.getToken(VHDLParser.KW_OTHERS, 0) @@ -4246,32 +4177,26 @@ def accept(self, visitor: ParseTreeVisitor): def rule_Choice(self): localctx = VHDLParser.Rule_ChoiceContext(self, self._ctx, self.state) - self.enterRule(localctx, 70, self.RULE_rule_Choice) + self.enterRule(localctx, 66, self.RULE_rule_Choice) try: - self.state = 887 + self.state = 882 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 52, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 51, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 883 + self.state = 879 self.rule_Expression(0) pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 884 + self.state = 880 self.rule_DiscreteRange() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 885 - self.match(VHDLParser.LIT_IDENTIFIER) - pass - - elif la_ == 4: - self.enterOuterAlt(localctx, 4) - self.state = 886 + self.state = 881 self.match(VHDLParser.KW_OTHERS) pass @@ -4317,23 +4242,23 @@ def accept(self, visitor: ParseTreeVisitor): def rule_Choices(self): localctx = VHDLParser.Rule_ChoicesContext(self, self._ctx, self.state) - self.enterRule(localctx, 72, self.RULE_rule_Choices) + self.enterRule(localctx, 68, self.RULE_rule_Choices) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 889 + self.state = 884 localctx._rule_Choice = self.rule_Choice() localctx.choices.append(localctx._rule_Choice) - self.state = 894 + self.state = 889 self._errHandler.sync(self) _la = self._input.LA(1) - while _la == VHDLParser.TOK_BAR: - self.state = 890 + while _la == 152: + self.state = 885 self.match(VHDLParser.TOK_BAR) - self.state = 891 + self.state = 886 localctx._rule_Choice = self.rule_Choice() localctx.choices.append(localctx._rule_Choice) - self.state = 896 + self.state = 891 self._errHandler.sync(self) _la = self._input.LA(1) @@ -4391,35 +4316,35 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ComponentConfiguration(self): localctx = VHDLParser.Rule_ComponentConfigurationContext(self, self._ctx, self.state) - self.enterRule(localctx, 74, self.RULE_rule_ComponentConfiguration) + self.enterRule(localctx, 70, self.RULE_rule_ComponentConfiguration) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 897 + self.state = 892 self.match(VHDLParser.KW_FOR) - self.state = 898 + self.state = 893 localctx.componentSpecification = self.rule_ComponentSpecification() - self.state = 902 + self.state = 897 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_GENERIC or _la == VHDLParser.KW_PORT or _la == VHDLParser.KW_USE or _la == VHDLParser.TOK_SEMICOL: - self.state = 899 + if _la == 42 or _la == 72 or _la == 108 or _la == 150: + self.state = 894 localctx.bindingIndication = self.rule_BindingIndication() - self.state = 900 + self.state = 895 self.match(VHDLParser.TOK_SEMICOL) - self.state = 905 + self.state = 900 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_FOR: - self.state = 904 + if _la == 37: + self.state = 899 localctx.blockConfiguration = self.rule_BlockConfiguration() - self.state = 907 + self.state = 902 self.match(VHDLParser.KW_END) - self.state = 908 + self.state = 903 self.match(VHDLParser.KW_FOR) - self.state = 909 + self.state = 904 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -4479,52 +4404,52 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ComponentDeclaration(self): localctx = VHDLParser.Rule_ComponentDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 76, self.RULE_rule_ComponentDeclaration) + self.enterRule(localctx, 72, self.RULE_rule_ComponentDeclaration) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 911 + self.state = 906 self.match(VHDLParser.KW_COMPONENT) - self.state = 912 + self.state = 907 localctx.name = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 914 + self.state = 909 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_IS: - self.state = 913 + if _la == 50: + self.state = 908 self.match(VHDLParser.KW_IS) - self.state = 917 + self.state = 912 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_GENERIC: - self.state = 916 + if _la == 42: + self.state = 911 localctx.genericClause = self.rule_GenericClause() - self.state = 920 + self.state = 915 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_PORT: - self.state = 919 + if _la == 72: + self.state = 914 localctx.portClause = self.rule_PortClause() - self.state = 922 + self.state = 917 self.match(VHDLParser.KW_END) - self.state = 924 + self.state = 919 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_COMPONENT: - self.state = 923 + if _la == 23: + self.state = 918 self.match(VHDLParser.KW_COMPONENT) - self.state = 927 + self.state = 922 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: - self.state = 926 + if _la == 163: + self.state = 921 localctx.name2 = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 929 + self.state = 924 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -4575,31 +4500,31 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ComponentInstantiationStatement(self): localctx = VHDLParser.Rule_ComponentInstantiationStatementContext(self, self._ctx, self.state) - self.enterRule(localctx, 78, self.RULE_rule_ComponentInstantiationStatement) + self.enterRule(localctx, 74, self.RULE_rule_ComponentInstantiationStatement) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 931 + self.state = 926 localctx.label = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 932 + self.state = 927 self.match(VHDLParser.TOK_COLON) - self.state = 933 + self.state = 928 localctx.instantiatedUnit = self.rule_InstantiatedUnit() - self.state = 935 + self.state = 930 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_GENERIC: - self.state = 934 + if _la == 42: + self.state = 929 localctx.genericMapAspect = self.rule_GenericMapAspect() - self.state = 938 + self.state = 933 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_PORT: - self.state = 937 + if _la == 72: + self.state = 932 localctx.portMapAspect = self.rule_PortMapAspect() - self.state = 940 + self.state = 935 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -4638,14 +4563,14 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ComponentSpecification(self): localctx = VHDLParser.Rule_ComponentSpecificationContext(self, self._ctx, self.state) - self.enterRule(localctx, 80, self.RULE_rule_ComponentSpecification) + self.enterRule(localctx, 76, self.RULE_rule_ComponentSpecification) try: self.enterOuterAlt(localctx, 1) - self.state = 942 + self.state = 937 localctx.instantiationList = self.rule_InstantiationList() - self.state = 943 + self.state = 938 self.match(VHDLParser.TOK_COLON) - self.state = 944 + self.state = 939 self.rule_Name(0) except RecognitionException as re: localctx.exception = re @@ -4686,26 +4611,26 @@ def accept(self, visitor: ParseTreeVisitor): def rule_CompositeTypeDefinition(self): localctx = VHDLParser.Rule_CompositeTypeDefinitionContext(self, self._ctx, self.state) - self.enterRule(localctx, 82, self.RULE_rule_CompositeTypeDefinition) + self.enterRule(localctx, 78, self.RULE_rule_CompositeTypeDefinition) try: - self.state = 949 + self.state = 944 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 63, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 62, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 946 + self.state = 941 localctx.constrainedArrayDefinition = self.rule_ConstrainedArrayDefinition() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 947 + self.state = 942 localctx.unboundedArrayDefinition = self.rule_UnboundArrayDefinition() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 948 + self.state = 943 localctx.recordTypeDefinition = self.rule_RecordTypeDefinition() pass @@ -4758,22 +4683,22 @@ def accept(self, visitor: ParseTreeVisitor): def rule_CompoundConfigurationSpecification(self): localctx = VHDLParser.Rule_CompoundConfigurationSpecificationContext(self, self._ctx, self.state) - self.enterRule(localctx, 84, self.RULE_rule_CompoundConfigurationSpecification) + self.enterRule(localctx, 80, self.RULE_rule_CompoundConfigurationSpecification) try: self.enterOuterAlt(localctx, 1) - self.state = 951 + self.state = 946 self.match(VHDLParser.KW_FOR) - self.state = 952 + self.state = 947 self.rule_ComponentSpecification() - self.state = 953 + self.state = 948 self.rule_BindingIndication() - self.state = 954 + self.state = 949 self.match(VHDLParser.TOK_SEMICOL) - self.state = 955 + self.state = 950 self.match(VHDLParser.KW_END) - self.state = 956 + self.state = 951 self.match(VHDLParser.KW_FOR) - self.state = 957 + self.state = 952 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -4819,29 +4744,29 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ConcurrentAssertionStatement(self): localctx = VHDLParser.Rule_ConcurrentAssertionStatementContext(self, self._ctx, self.state) - self.enterRule(localctx, 86, self.RULE_rule_ConcurrentAssertionStatement) + self.enterRule(localctx, 82, self.RULE_rule_ConcurrentAssertionStatement) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 961 + self.state = 956 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: - self.state = 959 + if _la == 163: + self.state = 954 localctx.label = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 960 + self.state = 955 self.match(VHDLParser.TOK_COLON) - self.state = 964 + self.state = 959 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_POSTPONED: - self.state = 963 + if _la == 73: + self.state = 958 localctx.postponed = self.match(VHDLParser.KW_POSTPONED) - self.state = 966 + self.state = 961 self.rule_Assertion() - self.state = 967 + self.state = 962 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -4891,33 +4816,31 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ConcurrentConditionalSignalAssignment(self): localctx = VHDLParser.Rule_ConcurrentConditionalSignalAssignmentContext(self, self._ctx, self.state) - self.enterRule(localctx, 88, self.RULE_rule_ConcurrentConditionalSignalAssignment) + self.enterRule(localctx, 84, self.RULE_rule_ConcurrentConditionalSignalAssignment) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 969 + self.state = 964 self.rule_Target() - self.state = 970 + self.state = 965 self.match(VHDLParser.TOK_SIG_ASSIGN) - self.state = 972 + self.state = 967 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_GUARDED: - self.state = 971 + if _la == 43: + self.state = 966 localctx.guarded = self.match(VHDLParser.KW_GUARDED) - self.state = 975 + self.state = 970 self._errHandler.sync(self) _la = self._input.LA(1) - if ((((_la - 48)) & ~0x3f) == 0 and ((1 << (_la - 48)) & ( - (1 << (VHDLParser.KW_INERTIAL - 48)) | (1 << (VHDLParser.KW_REJECT - 48)) | ( - 1 << (VHDLParser.KW_TRANSPORT - 48)))) != 0): - self.state = 974 + if ((((_la - 48)) & ~0x3f) == 0 and ((1 << (_la - 48)) & 36028814198833153) != 0): + self.state = 969 localctx.delayMechanism = self.rule_DelayMechanism() - self.state = 977 + self.state = 972 localctx.conditionalWaveforms = self.rule_ConditionalWaveforms() - self.state = 978 + self.state = 973 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -4964,29 +4887,29 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ConcurrentProcedureCallStatement(self): localctx = VHDLParser.Rule_ConcurrentProcedureCallStatementContext(self, self._ctx, self.state) - self.enterRule(localctx, 90, self.RULE_rule_ConcurrentProcedureCallStatement) + self.enterRule(localctx, 86, self.RULE_rule_ConcurrentProcedureCallStatement) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 982 + self.state = 977 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 68, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 67, self._ctx) if la_ == 1: - self.state = 980 + self.state = 975 localctx.label = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 981 + self.state = 976 self.match(VHDLParser.TOK_COLON) - self.state = 985 + self.state = 980 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_POSTPONED: - self.state = 984 + if _la == 73: + self.state = 979 localctx.postponed = self.match(VHDLParser.KW_POSTPONED) - self.state = 987 + self.state = 982 localctx.procedureCall = self.rule_ProcedureCall() - self.state = 988 + self.state = 983 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -5006,7 +4929,7 @@ def __init__(self, parser, parent: ParserRuleContext = None, invokingState: int self.target = None # Rule_TargetContext self.guarded = None # Token self.delayMechanism = None # Rule_DelayMechanismContext - self.conditionalWaveforms = None # Rule_ConditionalWaveformsContext + self.selectedWaveforms = None # Rule_SelectedWaveformsContext def KW_WITH(self): return self.getToken(VHDLParser.KW_WITH, 0) @@ -5026,8 +4949,8 @@ def rule_Expression(self): def rule_Target(self): return self.getTypedRuleContext(VHDLParser.Rule_TargetContext, 0) - def rule_ConditionalWaveforms(self): - return self.getTypedRuleContext(VHDLParser.Rule_ConditionalWaveformsContext, 0) + def rule_SelectedWaveforms(self): + return self.getTypedRuleContext(VHDLParser.Rule_SelectedWaveformsContext, 0) def KW_GUARDED(self): return self.getToken(VHDLParser.KW_GUARDED, 0) @@ -5047,39 +4970,37 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ConcurrentSelectedSignalAssignment(self): localctx = VHDLParser.Rule_ConcurrentSelectedSignalAssignmentContext(self, self._ctx, self.state) - self.enterRule(localctx, 92, self.RULE_rule_ConcurrentSelectedSignalAssignment) + self.enterRule(localctx, 88, self.RULE_rule_ConcurrentSelectedSignalAssignment) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 990 + self.state = 985 self.match(VHDLParser.KW_WITH) - self.state = 991 + self.state = 986 localctx.expression = self.rule_Expression(0) - self.state = 992 + self.state = 987 self.match(VHDLParser.KW_SELECT) - self.state = 993 + self.state = 988 localctx.target = self.rule_Target() - self.state = 994 + self.state = 989 self.match(VHDLParser.TOK_SIG_ASSIGN) - self.state = 996 + self.state = 991 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_GUARDED: - self.state = 995 + if _la == 43: + self.state = 990 localctx.guarded = self.match(VHDLParser.KW_GUARDED) - self.state = 999 + self.state = 994 self._errHandler.sync(self) _la = self._input.LA(1) - if ((((_la - 48)) & ~0x3f) == 0 and ((1 << (_la - 48)) & ( - (1 << (VHDLParser.KW_INERTIAL - 48)) | (1 << (VHDLParser.KW_REJECT - 48)) | ( - 1 << (VHDLParser.KW_TRANSPORT - 48)))) != 0): - self.state = 998 + if ((((_la - 48)) & ~0x3f) == 0 and ((1 << (_la - 48)) & 36028814198833153) != 0): + self.state = 993 localctx.delayMechanism = self.rule_DelayMechanism() - self.state = 1001 - localctx.conditionalWaveforms = self.rule_ConditionalWaveforms() - self.state = 1002 + self.state = 996 + localctx.selectedWaveforms = self.rule_SelectedWaveforms() + self.state = 997 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -5128,41 +5049,41 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ConcurrentSignalAssignmentStatement(self): localctx = VHDLParser.Rule_ConcurrentSignalAssignmentStatementContext(self, self._ctx, self.state) - self.enterRule(localctx, 94, self.RULE_rule_ConcurrentSignalAssignmentStatement) + self.enterRule(localctx, 90, self.RULE_rule_ConcurrentSignalAssignmentStatement) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1006 + self.state = 1001 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 72, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 71, self._ctx) if la_ == 1: - self.state = 1004 + self.state = 999 localctx.label = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 1005 + self.state = 1000 self.match(VHDLParser.TOK_COLON) - self.state = 1009 + self.state = 1004 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_POSTPONED: - self.state = 1008 + if _la == 73: + self.state = 1003 localctx.postponed = self.match(VHDLParser.KW_POSTPONED) - self.state = 1014 + self.state = 1009 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 74, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 73, self._ctx) if la_ == 1: - self.state = 1011 + self.state = 1006 self.rule_ConcurrentSimpleSignalAssignment() pass elif la_ == 2: - self.state = 1012 + self.state = 1007 self.rule_ConcurrentConditionalSignalAssignment() pass elif la_ == 3: - self.state = 1013 + self.state = 1008 self.rule_ConcurrentSelectedSignalAssignment() pass @@ -5216,33 +5137,31 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ConcurrentSimpleSignalAssignment(self): localctx = VHDLParser.Rule_ConcurrentSimpleSignalAssignmentContext(self, self._ctx, self.state) - self.enterRule(localctx, 96, self.RULE_rule_ConcurrentSimpleSignalAssignment) + self.enterRule(localctx, 92, self.RULE_rule_ConcurrentSimpleSignalAssignment) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1016 + self.state = 1011 localctx.target = self.rule_Target() - self.state = 1017 + self.state = 1012 self.match(VHDLParser.TOK_SIG_ASSIGN) - self.state = 1019 + self.state = 1014 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_GUARDED: - self.state = 1018 + if _la == 43: + self.state = 1013 localctx.guarded = self.match(VHDLParser.KW_GUARDED) - self.state = 1022 + self.state = 1017 self._errHandler.sync(self) _la = self._input.LA(1) - if ((((_la - 48)) & ~0x3f) == 0 and ((1 << (_la - 48)) & ( - (1 << (VHDLParser.KW_INERTIAL - 48)) | (1 << (VHDLParser.KW_REJECT - 48)) | ( - 1 << (VHDLParser.KW_TRANSPORT - 48)))) != 0): - self.state = 1021 + if ((((_la - 48)) & ~0x3f) == 0 and ((1 << (_la - 48)) & 36028814198833153) != 0): + self.state = 1016 localctx.delayMechanism = self.rule_DelayMechanism() - self.state = 1024 + self.state = 1019 localctx.waveform = self.rule_Waveform() - self.state = 1025 + self.state = 1020 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -5252,6 +5171,164 @@ def rule_ConcurrentSimpleSignalAssignment(self): self.exitRule() return localctx + class Rule_ConcurrentStatementContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent: ParserRuleContext = None, invokingState: int = -1): + super().__init__(parent, invokingState) + self.parser = parser + self.blockStatement = None # Rule_BlockStatementContext + self.processStatement = None # Rule_ProcessStatementContext + self.postponedProcessStatement = None # Rule_PostponedProcessStatementContext + self.label = None # Token + self.procedureCallStatement = None # Rule_ConcurrentProcedureCallStatementContext + self.assertionStatement = None # Rule_ConcurrentAssertionStatementContext + self.postponed = None # Token + self.signalAssignmentStatement = None # Rule_ConcurrentSignalAssignmentStatementContext + self.instantiationStatement = None # Rule_ComponentInstantiationStatementContext + self.generateStatement = None # Rule_GenerateStatementContext + + def rule_BlockStatement(self): + return self.getTypedRuleContext(VHDLParser.Rule_BlockStatementContext, 0) + + def rule_ProcessStatement(self): + return self.getTypedRuleContext(VHDLParser.Rule_ProcessStatementContext, 0) + + def rule_PostponedProcessStatement(self): + return self.getTypedRuleContext(VHDLParser.Rule_PostponedProcessStatementContext, 0) + + def rule_ConcurrentProcedureCallStatement(self): + return self.getTypedRuleContext(VHDLParser.Rule_ConcurrentProcedureCallStatementContext, 0) + + def TOK_COLON(self): + return self.getToken(VHDLParser.TOK_COLON, 0) + + def LIT_IDENTIFIER(self): + return self.getToken(VHDLParser.LIT_IDENTIFIER, 0) + + def rule_ConcurrentAssertionStatement(self): + return self.getTypedRuleContext(VHDLParser.Rule_ConcurrentAssertionStatementContext, 0) + + def rule_ConcurrentSignalAssignmentStatement(self): + return self.getTypedRuleContext(VHDLParser.Rule_ConcurrentSignalAssignmentStatementContext, 0) + + def KW_POSTPONED(self): + return self.getToken(VHDLParser.KW_POSTPONED, 0) + + def rule_ComponentInstantiationStatement(self): + return self.getTypedRuleContext(VHDLParser.Rule_ComponentInstantiationStatementContext, 0) + + def rule_GenerateStatement(self): + return self.getTypedRuleContext(VHDLParser.Rule_GenerateStatementContext, 0) + + def getRuleIndex(self): + return VHDLParser.RULE_rule_ConcurrentStatement + + def accept(self, visitor: ParseTreeVisitor): + if hasattr(visitor, "visitRule_ConcurrentStatement"): + return visitor.visitRule_ConcurrentStatement(self) + else: + return visitor.visitChildren(self) + + def rule_ConcurrentStatement(self): + + localctx = VHDLParser.Rule_ConcurrentStatementContext(self, self._ctx, self.state) + self.enterRule(localctx, 94, self.RULE_rule_ConcurrentStatement) + try: + self.state = 1045 + self._errHandler.sync(self) + la_ = self._interp.adaptivePredict(self._input, 80, self._ctx) + if la_ == 1: + self.enterOuterAlt(localctx, 1) + self.state = 1022 + localctx.blockStatement = self.rule_BlockStatement() + pass + + elif la_ == 2: + self.enterOuterAlt(localctx, 2) + self.state = 1023 + localctx.processStatement = self.rule_ProcessStatement() + pass + + elif la_ == 3: + self.enterOuterAlt(localctx, 3) + self.state = 1024 + localctx.postponedProcessStatement = self.rule_PostponedProcessStatement() + pass + + elif la_ == 4: + self.enterOuterAlt(localctx, 4) + self.state = 1027 + self._errHandler.sync(self) + la_ = self._interp.adaptivePredict(self._input, 76, self._ctx) + if la_ == 1: + self.state = 1025 + localctx.label = self.match(VHDLParser.LIT_IDENTIFIER) + self.state = 1026 + self.match(VHDLParser.TOK_COLON) + + self.state = 1029 + localctx.procedureCallStatement = self.rule_ConcurrentProcedureCallStatement() + pass + + elif la_ == 5: + self.enterOuterAlt(localctx, 5) + self.state = 1032 + self._errHandler.sync(self) + la_ = self._interp.adaptivePredict(self._input, 77, self._ctx) + if la_ == 1: + self.state = 1030 + localctx.label = self.match(VHDLParser.LIT_IDENTIFIER) + self.state = 1031 + self.match(VHDLParser.TOK_COLON) + + self.state = 1034 + localctx.assertionStatement = self.rule_ConcurrentAssertionStatement() + pass + + elif la_ == 6: + self.enterOuterAlt(localctx, 6) + self.state = 1037 + self._errHandler.sync(self) + la_ = self._interp.adaptivePredict(self._input, 78, self._ctx) + if la_ == 1: + self.state = 1035 + localctx.label = self.match(VHDLParser.LIT_IDENTIFIER) + self.state = 1036 + self.match(VHDLParser.TOK_COLON) + + self.state = 1040 + self._errHandler.sync(self) + la_ = self._interp.adaptivePredict(self._input, 79, self._ctx) + if la_ == 1: + self.state = 1039 + localctx.postponed = self.match(VHDLParser.KW_POSTPONED) + + self.state = 1042 + localctx.signalAssignmentStatement = self.rule_ConcurrentSignalAssignmentStatement() + pass + + elif la_ == 7: + self.enterOuterAlt(localctx, 7) + self.state = 1043 + localctx.instantiationStatement = self.rule_ComponentInstantiationStatement() + pass + + elif la_ == 8: + self.enterOuterAlt(localctx, 8) + self.state = 1044 + localctx.generateStatement = self.rule_GenerateStatement() + pass + + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + class Rule_ConditionClauseContext(ParserRuleContext): __slots__ = 'parser' @@ -5278,12 +5355,12 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ConditionClause(self): localctx = VHDLParser.Rule_ConditionClauseContext(self, self._ctx, self.state) - self.enterRule(localctx, 98, self.RULE_rule_ConditionClause) + self.enterRule(localctx, 96, self.RULE_rule_ConditionClause) try: self.enterOuterAlt(localctx, 1) - self.state = 1027 + self.state = 1047 self.match(VHDLParser.KW_UNTIL) - self.state = 1028 + self.state = 1048 localctx.condition = self.rule_Expression(0) except RecognitionException as re: localctx.exception = re @@ -5327,23 +5404,23 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ConditionalExpression(self): localctx = VHDLParser.Rule_ConditionalExpressionContext(self, self._ctx, self.state) - self.enterRule(localctx, 100, self.RULE_rule_ConditionalExpression) + self.enterRule(localctx, 98, self.RULE_rule_ConditionalExpression) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1030 + self.state = 1050 localctx.left = self.rule_Expression(0) - self.state = 1036 + self.state = 1056 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_WHEN: - self.state = 1031 + if _la == 117: + self.state = 1051 self.match(VHDLParser.KW_WHEN) - self.state = 1032 + self.state = 1052 localctx.condition = self.rule_Expression(0) - self.state = 1033 + self.state = 1053 self.match(VHDLParser.KW_ELSE) - self.state = 1034 + self.state = 1054 localctx.right = self.rule_Expression(0) @@ -5399,32 +5476,32 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ConditionalOrUnaffectedExpression(self): localctx = VHDLParser.Rule_ConditionalOrUnaffectedExpressionContext(self, self._ctx, self.state) - self.enterRule(localctx, 102, self.RULE_rule_ConditionalOrUnaffectedExpression) + self.enterRule(localctx, 100, self.RULE_rule_ConditionalOrUnaffectedExpression) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1038 + self.state = 1058 localctx.left = self.rule_ExpressionOrUnaffected() - self.state = 1044 + self.state = 1064 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 78, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 82, self._ctx) if la_ == 1: - self.state = 1039 + self.state = 1059 self.match(VHDLParser.KW_WHEN) - self.state = 1040 + self.state = 1060 localctx.condition = self.rule_Expression(0) - self.state = 1041 + self.state = 1061 self.match(VHDLParser.KW_ELSE) - self.state = 1042 + self.state = 1062 localctx.right = self.rule_ExpressionOrUnaffected() - self.state = 1048 + self.state = 1068 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_WHEN: - self.state = 1046 + if _la == 117: + self.state = 1066 self.match(VHDLParser.KW_WHEN) - self.state = 1047 + self.state = 1067 localctx.finalCondition = self.rule_Expression(0) @@ -5473,26 +5550,24 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ConditionalSignalAssignment(self): localctx = VHDLParser.Rule_ConditionalSignalAssignmentContext(self, self._ctx, self.state) - self.enterRule(localctx, 104, self.RULE_rule_ConditionalSignalAssignment) + self.enterRule(localctx, 102, self.RULE_rule_ConditionalSignalAssignment) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1050 + self.state = 1070 localctx.target = self.rule_Target() - self.state = 1051 + self.state = 1071 self.match(VHDLParser.TOK_SIG_ASSIGN) - self.state = 1053 + self.state = 1073 self._errHandler.sync(self) _la = self._input.LA(1) - if ((((_la - 48)) & ~0x3f) == 0 and ((1 << (_la - 48)) & ( - (1 << (VHDLParser.KW_INERTIAL - 48)) | (1 << (VHDLParser.KW_REJECT - 48)) | ( - 1 << (VHDLParser.KW_TRANSPORT - 48)))) != 0): - self.state = 1052 + if ((((_la - 48)) & ~0x3f) == 0 and ((1 << (_la - 48)) & 36028814198833153) != 0): + self.state = 1072 localctx.delayMechanism = self.rule_DelayMechanism() - self.state = 1055 + self.state = 1075 localctx.conditionalWaveforms = self.rule_ConditionalWaveforms() - self.state = 1056 + self.state = 1076 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -5552,42 +5627,42 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ConditionalWaveforms(self): localctx = VHDLParser.Rule_ConditionalWaveformsContext(self, self._ctx, self.state) - self.enterRule(localctx, 106, self.RULE_rule_ConditionalWaveforms) + self.enterRule(localctx, 104, self.RULE_rule_ConditionalWaveforms) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1058 + self.state = 1078 localctx.waveform = self.rule_Waveform() - self.state = 1059 + self.state = 1079 self.match(VHDLParser.KW_WHEN) - self.state = 1060 + self.state = 1080 localctx.condition = self.rule_Expression(0) - self.state = 1068 + self.state = 1088 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input, 81, self._ctx) + _alt = self._interp.adaptivePredict(self._input, 85, self._ctx) while _alt != 2 and _alt != ATN.INVALID_ALT_NUMBER: if _alt == 1: - self.state = 1061 + self.state = 1081 self.match(VHDLParser.KW_ELSE) - self.state = 1062 + self.state = 1082 localctx._rule_Waveform = self.rule_Waveform() localctx.waveforms.append(localctx._rule_Waveform) - self.state = 1063 + self.state = 1083 self.match(VHDLParser.KW_WHEN) - self.state = 1064 + self.state = 1084 localctx._rule_Expression = self.rule_Expression(0) localctx.conditions.append(localctx._rule_Expression) - self.state = 1070 + self.state = 1090 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input, 81, self._ctx) + _alt = self._interp.adaptivePredict(self._input, 85, self._ctx) - self.state = 1073 + self.state = 1093 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_ELSE: - self.state = 1071 + if _la == 31: + self.state = 1091 self.match(VHDLParser.KW_ELSE) - self.state = 1072 + self.state = 1092 localctx.lastCondition = self.rule_Expression(0) @@ -5660,50 +5735,50 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ConfigurationDeclaration(self): localctx = VHDLParser.Rule_ConfigurationDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 108, self.RULE_rule_ConfigurationDeclaration) + self.enterRule(localctx, 106, self.RULE_rule_ConfigurationDeclaration) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1075 + self.state = 1095 self.match(VHDLParser.KW_CONFIGURATION) - self.state = 1076 + self.state = 1096 localctx.name = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 1077 + self.state = 1097 self.match(VHDLParser.KW_OF) - self.state = 1078 + self.state = 1098 localctx.entityName = self.rule_Name(0) - self.state = 1079 + self.state = 1099 self.match(VHDLParser.KW_IS) - self.state = 1083 + self.state = 1103 self._errHandler.sync(self) _la = self._input.LA(1) - while _la == VHDLParser.KW_ATTRIBUTE or _la == VHDLParser.KW_USE: - self.state = 1080 + while _la == 15 or _la == 44 or _la == 108: + self.state = 1100 localctx._rule_ConfigurationDeclarativeItem = self.rule_ConfigurationDeclarativeItem() localctx.configurationDeclarativeItem.append(localctx._rule_ConfigurationDeclarativeItem) - self.state = 1085 + self.state = 1105 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 1086 + self.state = 1106 localctx.blockConfiguration = self.rule_BlockConfiguration() - self.state = 1087 + self.state = 1107 self.match(VHDLParser.KW_END) - self.state = 1089 + self.state = 1109 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_CONFIGURATION: - self.state = 1088 + if _la == 24: + self.state = 1108 self.match(VHDLParser.KW_CONFIGURATION) - self.state = 1092 + self.state = 1112 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: - self.state = 1091 + if _la == 163: + self.state = 1111 localctx.name2 = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 1094 + self.state = 1114 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -5726,6 +5801,9 @@ def rule_UseClause(self): def rule_AttributeSpecification(self): return self.getTypedRuleContext(VHDLParser.Rule_AttributeSpecificationContext, 0) + def rule_GroupDeclaration(self): + return self.getTypedRuleContext(VHDLParser.Rule_GroupDeclarationContext, 0) + def getRuleIndex(self): return VHDLParser.RULE_rule_ConfigurationDeclarativeItem @@ -5738,21 +5816,26 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ConfigurationDeclarativeItem(self): localctx = VHDLParser.Rule_ConfigurationDeclarativeItemContext(self, self._ctx, self.state) - self.enterRule(localctx, 110, self.RULE_rule_ConfigurationDeclarativeItem) + self.enterRule(localctx, 108, self.RULE_rule_ConfigurationDeclarativeItem) try: - self.state = 1098 + self.state = 1119 self._errHandler.sync(self) token = self._input.LA(1) - if token in [VHDLParser.KW_USE]: + if token in [108]: self.enterOuterAlt(localctx, 1) - self.state = 1096 + self.state = 1116 self.rule_UseClause() pass - elif token in [VHDLParser.KW_ATTRIBUTE]: + elif token in [15]: self.enterOuterAlt(localctx, 2) - self.state = 1097 + self.state = 1117 self.rule_AttributeSpecification() pass + elif token in [44]: + self.enterOuterAlt(localctx, 3) + self.state = 1118 + self.rule_GroupDeclaration() + pass else: raise NoViableAltException(self) @@ -5789,20 +5872,20 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ConfigurationItem(self): localctx = VHDLParser.Rule_ConfigurationItemContext(self, self._ctx, self.state) - self.enterRule(localctx, 112, self.RULE_rule_ConfigurationItem) + self.enterRule(localctx, 110, self.RULE_rule_ConfigurationItem) try: - self.state = 1102 + self.state = 1123 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 87, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 91, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 1100 + self.state = 1121 self.rule_BlockConfiguration() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 1101 + self.state = 1122 self.rule_ComponentConfiguration() pass @@ -5840,20 +5923,20 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ConfigurationSpecification(self): localctx = VHDLParser.Rule_ConfigurationSpecificationContext(self, self._ctx, self.state) - self.enterRule(localctx, 114, self.RULE_rule_ConfigurationSpecification) + self.enterRule(localctx, 112, self.RULE_rule_ConfigurationSpecification) try: - self.state = 1106 + self.state = 1127 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 88, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 92, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 1104 + self.state = 1125 self.rule_SimpleConfigurationSpecification() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 1105 + self.state = 1126 self.rule_CompoundConfigurationSpecification() pass @@ -5909,28 +5992,28 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ConstantDeclaration(self): localctx = VHDLParser.Rule_ConstantDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 116, self.RULE_rule_ConstantDeclaration) + self.enterRule(localctx, 114, self.RULE_rule_ConstantDeclaration) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1108 + self.state = 1129 self.match(VHDLParser.KW_CONSTANT) - self.state = 1109 + self.state = 1130 localctx.name = self.rule_IdentifierList() - self.state = 1110 + self.state = 1131 self.match(VHDLParser.TOK_COLON) - self.state = 1111 + self.state = 1132 localctx.subtypeIndication = self.rule_SubtypeIndication() - self.state = 1114 + self.state = 1135 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.TOK_VAR_ASSIGN: - self.state = 1112 + if _la == 141: + self.state = 1133 self.match(VHDLParser.TOK_VAR_ASSIGN) - self.state = 1113 + self.state = 1134 localctx.expression = self.rule_ConditionalExpression() - self.state = 1116 + self.state = 1137 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -5972,16 +6055,16 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ConstrainedArrayDefinition(self): localctx = VHDLParser.Rule_ConstrainedArrayDefinitionContext(self, self._ctx, self.state) - self.enterRule(localctx, 118, self.RULE_rule_ConstrainedArrayDefinition) + self.enterRule(localctx, 116, self.RULE_rule_ConstrainedArrayDefinition) try: self.enterOuterAlt(localctx, 1) - self.state = 1118 + self.state = 1139 self.match(VHDLParser.KW_ARRAY) - self.state = 1119 + self.state = 1140 self.rule_IndexConstraint() - self.state = 1120 + self.state = 1141 self.match(VHDLParser.KW_OF) - self.state = 1121 + self.state = 1142 localctx.subtypeIndication = self.rule_SubtypeIndication() except RecognitionException as re: localctx.exception = re @@ -6022,32 +6105,32 @@ def accept(self, visitor: ParseTreeVisitor): def rule_Constraint(self): localctx = VHDLParser.Rule_ConstraintContext(self, self._ctx, self.state) - self.enterRule(localctx, 120, self.RULE_rule_Constraint) + self.enterRule(localctx, 118, self.RULE_rule_Constraint) try: - self.state = 1127 + self.state = 1148 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 90, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 94, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 1123 + self.state = 1144 self.rule_SimpleRange() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 1124 + self.state = 1145 self.rule_RangeConstraint() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 1125 + self.state = 1146 self.rule_ArrayConstraint() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 1126 + self.state = 1147 self.rule_RecordConstraint() pass @@ -6110,39 +6193,39 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ContextDeclaration(self): localctx = VHDLParser.Rule_ContextDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 122, self.RULE_rule_ContextDeclaration) + self.enterRule(localctx, 120, self.RULE_rule_ContextDeclaration) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1129 + self.state = 1150 self.match(VHDLParser.KW_CONTEXT) - self.state = 1130 + self.state = 1151 localctx.name = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 1131 + self.state = 1152 self.match(VHDLParser.KW_IS) - self.state = 1135 + self.state = 1156 self._errHandler.sync(self) _la = self._input.LA(1) - while _la == VHDLParser.KW_CONTEXT or _la == VHDLParser.KW_LIBRARY or _la == VHDLParser.KW_USE: - self.state = 1132 + while _la == 26 or _la == 52 or _la == 108: + self.state = 1153 localctx._rule_ContextItem = self.rule_ContextItem() localctx.contextItems.append(localctx._rule_ContextItem) - self.state = 1137 + self.state = 1158 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 1138 + self.state = 1159 self.match(VHDLParser.KW_END) - self.state = 1140 + self.state = 1161 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_CONTEXT: - self.state = 1139 + if _la == 26: + self.state = 1160 self.match(VHDLParser.KW_CONTEXT) - self.state = 1142 + self.state = 1163 localctx.name2 = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 1143 + self.state = 1164 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -6183,24 +6266,24 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ContextItem(self): localctx = VHDLParser.Rule_ContextItemContext(self, self._ctx, self.state) - self.enterRule(localctx, 124, self.RULE_rule_ContextItem) + self.enterRule(localctx, 122, self.RULE_rule_ContextItem) try: - self.state = 1148 + self.state = 1169 self._errHandler.sync(self) token = self._input.LA(1) - if token in [VHDLParser.KW_LIBRARY]: + if token in [52]: self.enterOuterAlt(localctx, 1) - self.state = 1145 + self.state = 1166 localctx.libraryClause = self.rule_LibraryClause() pass - elif token in [VHDLParser.KW_USE]: + elif token in [108]: self.enterOuterAlt(localctx, 2) - self.state = 1146 + self.state = 1167 localctx.useClause = self.rule_UseClause() pass - elif token in [VHDLParser.KW_CONTEXT]: + elif token in [26]: self.enterOuterAlt(localctx, 3) - self.state = 1147 + self.state = 1168 localctx.contextReference = self.rule_ContextReference() pass else: @@ -6253,29 +6336,29 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ContextReference(self): localctx = VHDLParser.Rule_ContextReferenceContext(self, self._ctx, self.state) - self.enterRule(localctx, 126, self.RULE_rule_ContextReference) + self.enterRule(localctx, 124, self.RULE_rule_ContextReference) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1150 + self.state = 1171 self.match(VHDLParser.KW_CONTEXT) - self.state = 1151 + self.state = 1172 localctx._rule_SelectedName2 = self.rule_SelectedName2() localctx.names.append(localctx._rule_SelectedName2) - self.state = 1156 + self.state = 1177 self._errHandler.sync(self) _la = self._input.LA(1) - while _la == VHDLParser.TOK_COLON: - self.state = 1152 + while _la == 149: + self.state = 1173 self.match(VHDLParser.TOK_COLON) - self.state = 1153 + self.state = 1174 localctx._rule_SelectedName2 = self.rule_SelectedName2() localctx.names.append(localctx._rule_SelectedName2) - self.state = 1158 + self.state = 1179 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 1159 + self.state = 1180 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -6317,29 +6400,29 @@ def accept(self, visitor: ParseTreeVisitor): def rule_DelayMechanism(self): localctx = VHDLParser.Rule_DelayMechanismContext(self, self._ctx, self.state) - self.enterRule(localctx, 128, self.RULE_rule_DelayMechanism) + self.enterRule(localctx, 126, self.RULE_rule_DelayMechanism) self._la = 0 # Token type try: - self.state = 1167 + self.state = 1188 self._errHandler.sync(self) token = self._input.LA(1) - if token in [VHDLParser.KW_TRANSPORT]: + if token in [103]: self.enterOuterAlt(localctx, 1) - self.state = 1161 + self.state = 1182 self.match(VHDLParser.KW_TRANSPORT) pass - elif token in [VHDLParser.KW_INERTIAL, VHDLParser.KW_REJECT]: + elif token in [48, 82]: self.enterOuterAlt(localctx, 2) - self.state = 1164 + self.state = 1185 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_REJECT: - self.state = 1162 + if _la == 82: + self.state = 1183 self.match(VHDLParser.KW_REJECT) - self.state = 1163 + self.state = 1184 localctx.expression = self.rule_Expression(0) - self.state = 1166 + self.state = 1187 self.match(VHDLParser.KW_INERTIAL) pass else: @@ -6383,27 +6466,24 @@ def accept(self, visitor: ParseTreeVisitor): def rule_DesignFile(self): localctx = VHDLParser.Rule_DesignFileContext(self, self._ctx, self.state) - self.enterRule(localctx, 130, self.RULE_rule_DesignFile) + self.enterRule(localctx, 128, self.RULE_rule_DesignFile) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1170 + self.state = 1191 self._errHandler.sync(self) _la = self._input.LA(1) while True: - self.state = 1169 + self.state = 1190 localctx._rule_DesignUnit = self.rule_DesignUnit() localctx.designUnits.append(localctx._rule_DesignUnit) - self.state = 1172 + self.state = 1193 self._errHandler.sync(self) _la = self._input.LA(1) - if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ( - (1 << VHDLParser.KW_ARCHITECTURE) | (1 << VHDLParser.KW_CONFIGURATION) | (1 << VHDLParser.KW_CONTEXT) | ( - 1 << VHDLParser.KW_ENTITY) | ( - 1 << VHDLParser.KW_LIBRARY))) != 0) or _la == VHDLParser.KW_PACKAGE or _la == VHDLParser.KW_USE): + if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & 4503616891129856) != 0) or _la == 70 or _la == 108): break - self.state = 1174 + self.state = 1195 self.match(VHDLParser.EOF) except RecognitionException as re: localctx.exception = re @@ -6444,22 +6524,22 @@ def accept(self, visitor: ParseTreeVisitor): def rule_DesignUnit(self): localctx = VHDLParser.Rule_DesignUnitContext(self, self._ctx, self.state) - self.enterRule(localctx, 132, self.RULE_rule_DesignUnit) + self.enterRule(localctx, 130, self.RULE_rule_DesignUnit) try: self.enterOuterAlt(localctx, 1) - self.state = 1179 + self.state = 1200 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input, 98, self._ctx) + _alt = self._interp.adaptivePredict(self._input, 102, self._ctx) while _alt != 2 and _alt != ATN.INVALID_ALT_NUMBER: if _alt == 1: - self.state = 1176 + self.state = 1197 localctx._rule_ContextItem = self.rule_ContextItem() localctx.contextItems.append(localctx._rule_ContextItem) - self.state = 1181 + self.state = 1202 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input, 98, self._ctx) + _alt = self._interp.adaptivePredict(self._input, 102, self._ctx) - self.state = 1182 + self.state = 1203 localctx.libraryUnit = self.rule_LibraryUnit() except RecognitionException as re: localctx.exception = re @@ -6494,13 +6574,13 @@ def accept(self, visitor: ParseTreeVisitor): def rule_Designator(self): localctx = VHDLParser.Rule_DesignatorContext(self, self._ctx, self.state) - self.enterRule(localctx, 134, self.RULE_rule_Designator) + self.enterRule(localctx, 132, self.RULE_rule_Designator) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1184 + self.state = 1205 _la = self._input.LA(1) - if not (_la == VHDLParser.LIT_STRING or _la == VHDLParser.LIT_IDENTIFIER): + if not (_la == 162 or _la == 163): self._errHandler.recoverInline(self) else: self._errHandler.reportMatch(self) @@ -6539,14 +6619,14 @@ def accept(self, visitor: ParseTreeVisitor): def rule_Direction(self): localctx = VHDLParser.Rule_DirectionContext(self, self._ctx, self.state) - self.enterRule(localctx, 136, self.RULE_rule_Direction) + self.enterRule(localctx, 134, self.RULE_rule_Direction) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1186 + self.state = 1207 localctx.direction = self._input.LT(1) _la = self._input.LA(1) - if not (_la == VHDLParser.KW_DOWNTO or _la == VHDLParser.KW_TO): + if not (_la == 30 or _la == 102): localctx.direction = self._errHandler.recoverInline(self) else: self._errHandler.reportMatch(self) @@ -6595,18 +6675,18 @@ def accept(self, visitor: ParseTreeVisitor): def rule_DisconnectionSpecification(self): localctx = VHDLParser.Rule_DisconnectionSpecificationContext(self, self._ctx, self.state) - self.enterRule(localctx, 138, self.RULE_rule_DisconnectionSpecification) + self.enterRule(localctx, 136, self.RULE_rule_DisconnectionSpecification) try: self.enterOuterAlt(localctx, 1) - self.state = 1188 + self.state = 1209 self.match(VHDLParser.KW_DISCONNECT) - self.state = 1189 + self.state = 1210 localctx.guardedSignalSpecification = self.rule_GuardedSignalSpecification() - self.state = 1190 + self.state = 1211 self.match(VHDLParser.KW_AFTER) - self.state = 1191 + self.state = 1212 localctx.expression = self.rule_Expression(0) - self.state = 1192 + self.state = 1213 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -6643,20 +6723,20 @@ def accept(self, visitor: ParseTreeVisitor): def rule_DiscreteRange(self): localctx = VHDLParser.Rule_DiscreteRangeContext(self, self._ctx, self.state) - self.enterRule(localctx, 140, self.RULE_rule_DiscreteRange) + self.enterRule(localctx, 138, self.RULE_rule_DiscreteRange) try: - self.state = 1196 + self.state = 1217 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 99, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 103, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 1194 + self.state = 1215 localctx.subtypeIndication = self.rule_SubtypeIndication() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 1195 + self.state = 1216 localctx.range_ = self.rule_Range() pass @@ -6697,14 +6777,14 @@ def accept(self, visitor: ParseTreeVisitor): def rule_DiscreteIncompleteTypeDefinition(self): localctx = VHDLParser.Rule_DiscreteIncompleteTypeDefinitionContext(self, self._ctx, self.state) - self.enterRule(localctx, 142, self.RULE_rule_DiscreteIncompleteTypeDefinition) + self.enterRule(localctx, 140, self.RULE_rule_DiscreteIncompleteTypeDefinition) try: self.enterOuterAlt(localctx, 1) - self.state = 1198 + self.state = 1219 self.match(VHDLParser.TOK_LP) - self.state = 1199 + self.state = 1220 self.match(VHDLParser.TOK_BOX) - self.state = 1200 + self.state = 1221 self.match(VHDLParser.TOK_RP) except RecognitionException as re: localctx.exception = re @@ -6746,16 +6826,16 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ElementArrayModeViewIndication(self): localctx = VHDLParser.Rule_ElementArrayModeViewIndicationContext(self, self._ctx, self.state) - self.enterRule(localctx, 144, self.RULE_rule_ElementArrayModeViewIndication) + self.enterRule(localctx, 142, self.RULE_rule_ElementArrayModeViewIndication) try: self.enterOuterAlt(localctx, 1) - self.state = 1202 + self.state = 1223 self.match(VHDLParser.KW_VIEW) - self.state = 1203 + self.state = 1224 self.match(VHDLParser.TOK_LP) - self.state = 1204 + self.state = 1225 localctx.name = self.rule_Name(0) - self.state = 1205 + self.state = 1226 self.match(VHDLParser.TOK_RP) except RecognitionException as re: localctx.exception = re @@ -6795,19 +6875,19 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ElementAssociation(self): localctx = VHDLParser.Rule_ElementAssociationContext(self, self._ctx, self.state) - self.enterRule(localctx, 146, self.RULE_rule_ElementAssociation) + self.enterRule(localctx, 144, self.RULE_rule_ElementAssociation) try: self.enterOuterAlt(localctx, 1) - self.state = 1210 + self.state = 1231 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 100, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 104, self._ctx) if la_ == 1: - self.state = 1207 + self.state = 1228 localctx.choices = self.rule_Choices() - self.state = 1208 + self.state = 1229 self.match(VHDLParser.TOK_RARROW) - self.state = 1212 + self.state = 1233 localctx.expression = self.rule_Expression(0) except RecognitionException as re: localctx.exception = re @@ -6844,20 +6924,20 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ElementConstraint(self): localctx = VHDLParser.Rule_ElementConstraintContext(self, self._ctx, self.state) - self.enterRule(localctx, 148, self.RULE_rule_ElementConstraint) + self.enterRule(localctx, 146, self.RULE_rule_ElementConstraint) try: - self.state = 1216 + self.state = 1237 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 101, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 105, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 1214 + self.state = 1235 localctx.arrayConstraint = self.rule_ArrayConstraint() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 1215 + self.state = 1236 localctx.recordConstraint = self.rule_RecordConstraint() pass @@ -6903,16 +6983,16 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ElementDeclaration(self): localctx = VHDLParser.Rule_ElementDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 150, self.RULE_rule_ElementDeclaration) + self.enterRule(localctx, 148, self.RULE_rule_ElementDeclaration) try: self.enterOuterAlt(localctx, 1) - self.state = 1218 + self.state = 1239 localctx.identifierList = self.rule_IdentifierList() - self.state = 1219 + self.state = 1240 self.match(VHDLParser.TOK_COLON) - self.state = 1220 + self.state = 1241 localctx.subtypeIndication = self.rule_SubtypeIndication() - self.state = 1221 + self.state = 1242 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -6947,20 +7027,19 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ElementModeIndication(self): localctx = VHDLParser.Rule_ElementModeIndicationContext(self, self._ctx, self.state) - self.enterRule(localctx, 152, self.RULE_rule_ElementModeIndication) + self.enterRule(localctx, 150, self.RULE_rule_ElementModeIndication) try: - self.state = 1225 + self.state = 1246 self._errHandler.sync(self) token = self._input.LA(1) - if token in [VHDLParser.KW_BUFFER, VHDLParser.KW_IN, VHDLParser.KW_INOUT, VHDLParser.KW_LINKAGE, - VHDLParser.KW_OUT]: + if token in [20, 47, 49, 53, 69]: self.enterOuterAlt(localctx, 1) - self.state = 1223 + self.state = 1244 self.rule_Mode() pass - elif token in [VHDLParser.KW_VIEW]: + elif token in [110]: self.enterOuterAlt(localctx, 2) - self.state = 1224 + self.state = 1245 self.rule_ElementModeViewIndication() pass else: @@ -6999,20 +7078,20 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ElementModeViewIndication(self): localctx = VHDLParser.Rule_ElementModeViewIndicationContext(self, self._ctx, self.state) - self.enterRule(localctx, 154, self.RULE_rule_ElementModeViewIndication) + self.enterRule(localctx, 152, self.RULE_rule_ElementModeViewIndication) try: - self.state = 1229 + self.state = 1250 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 103, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 107, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 1227 + self.state = 1248 self.rule_ElementArrayModeViewIndication() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 1228 + self.state = 1249 self.rule_ElementRecordModeViewIndication() pass @@ -7051,12 +7130,12 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ElementRecordModeViewIndication(self): localctx = VHDLParser.Rule_ElementRecordModeViewIndicationContext(self, self._ctx, self.state) - self.enterRule(localctx, 156, self.RULE_rule_ElementRecordModeViewIndication) + self.enterRule(localctx, 154, self.RULE_rule_ElementRecordModeViewIndication) try: self.enterOuterAlt(localctx, 1) - self.state = 1231 + self.state = 1252 self.match(VHDLParser.KW_VIEW) - self.state = 1232 + self.state = 1253 localctx.name = self.rule_Name(0) except RecognitionException as re: localctx.exception = re @@ -7073,8 +7152,8 @@ def __init__(self, parser, parent: ParserRuleContext = None, invokingState: int super().__init__(parent, invokingState) self.parser = parser - def rule_ArrayElementResolution(self): - return self.getTypedRuleContext(VHDLParser.Rule_ArrayElementResolutionContext, 0) + def rule_ResolutionIndication(self): + return self.getTypedRuleContext(VHDLParser.Rule_ResolutionIndicationContext, 0) def rule_RecordResolution(self): return self.getTypedRuleContext(VHDLParser.Rule_RecordResolutionContext, 0) @@ -7091,20 +7170,20 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ElementResolution(self): localctx = VHDLParser.Rule_ElementResolutionContext(self, self._ctx, self.state) - self.enterRule(localctx, 158, self.RULE_rule_ElementResolution) + self.enterRule(localctx, 156, self.RULE_rule_ElementResolution) try: - self.state = 1236 + self.state = 1257 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 104, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 108, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 1234 - self.rule_ArrayElementResolution() + self.state = 1255 + self.rule_ResolutionIndication() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 1235 + self.state = 1256 self.rule_RecordResolution() pass @@ -7160,40 +7239,40 @@ def accept(self, visitor: ParseTreeVisitor): def rule_EntityAspect(self): localctx = VHDLParser.Rule_EntityAspectContext(self, self._ctx, self.state) - self.enterRule(localctx, 160, self.RULE_rule_EntityAspect) + self.enterRule(localctx, 158, self.RULE_rule_EntityAspect) self._la = 0 # Token type try: - self.state = 1248 + self.state = 1269 self._errHandler.sync(self) token = self._input.LA(1) - if token in [VHDLParser.KW_ENTITY]: + if token in [34]: self.enterOuterAlt(localctx, 1) - self.state = 1238 + self.state = 1259 self.match(VHDLParser.KW_ENTITY) - self.state = 1239 + self.state = 1260 localctx.entityName = self.rule_Name(0) - self.state = 1243 + self.state = 1264 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.TOK_LP: - self.state = 1240 + if _la == 143: + self.state = 1261 self.match(VHDLParser.TOK_LP) - self.state = 1241 + self.state = 1262 localctx.architectureName = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 1242 + self.state = 1263 self.match(VHDLParser.TOK_RP) pass - elif token in [VHDLParser.KW_CONFIGURATION]: + elif token in [24]: self.enterOuterAlt(localctx, 2) - self.state = 1245 + self.state = 1266 self.match(VHDLParser.KW_CONFIGURATION) - self.state = 1246 + self.state = 1267 localctx.configurationName = self.rule_Name(0) pass - elif token in [VHDLParser.KW_OPEN]: + elif token in [66]: self.enterOuterAlt(localctx, 3) - self.state = 1247 + self.state = 1268 self.match(VHDLParser.KW_OPEN) pass else: @@ -7256,6 +7335,9 @@ def KW_LABEL(self): def KW_UNITS(self): return self.getToken(VHDLParser.KW_UNITS, 0) + def KW_GROUP(self): + return self.getToken(VHDLParser.KW_GROUP, 0) + def KW_FILE(self): return self.getToken(VHDLParser.KW_FILE, 0) @@ -7274,20 +7356,14 @@ def accept(self, visitor: ParseTreeVisitor): def rule_EntityClass(self): localctx = VHDLParser.Rule_EntityClassContext(self, self._ctx, self.state) - self.enterRule(localctx, 162, self.RULE_rule_EntityClass) + self.enterRule(localctx, 160, self.RULE_rule_EntityClass) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1250 + self.state = 1271 _la = self._input.LA(1) - if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ( - (1 << VHDLParser.KW_ARCHITECTURE) | (1 << VHDLParser.KW_COMPONENT) | (1 << VHDLParser.KW_CONFIGURATION) | ( - 1 << VHDLParser.KW_CONSTANT) | (1 << VHDLParser.KW_ENTITY) | (1 << VHDLParser.KW_FILE) | ( - 1 << VHDLParser.KW_FUNCTION) | (1 << VHDLParser.KW_LABEL))) != 0) or ((((_la - 70)) & ~0x3f) == 0 and ( - (1 << (_la - 70)) & ((1 << (VHDLParser.KW_PACKAGE - 70)) | (1 << (VHDLParser.KW_PROCEDURE - 70)) | ( - 1 << (VHDLParser.KW_SIGNAL - 70)) | (1 << (VHDLParser.KW_SUBTYPE - 70)) | (1 << (VHDLParser.KW_TYPE - 70)) | ( - 1 << (VHDLParser.KW_UNITS - 70)) | (1 << (VHDLParser.KW_VARIABLE - 70)) | ( - 1 << (VHDLParser.KW_VIEW - 70)))) != 0)): + if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & 2270027713613824) != 0) or ( + (((_la - 70)) & ~0x3f) == 0 and ((1 << (_la - 70)) & 1735443611681) != 0)): self._errHandler.recoverInline(self) else: self._errHandler.reportMatch(self) @@ -7300,6 +7376,53 @@ def rule_EntityClass(self): self.exitRule() return localctx + class Rule_EntityClassEntryContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent: ParserRuleContext = None, invokingState: int = -1): + super().__init__(parent, invokingState) + self.parser = parser + + def rule_EntityClass(self): + return self.getTypedRuleContext(VHDLParser.Rule_EntityClassContext, 0) + + def TOK_BOX(self): + return self.getToken(VHDLParser.TOK_BOX, 0) + + def getRuleIndex(self): + return VHDLParser.RULE_rule_EntityClassEntry + + def accept(self, visitor: ParseTreeVisitor): + if hasattr(visitor, "visitRule_EntityClassEntry"): + return visitor.visitRule_EntityClassEntry(self) + else: + return visitor.visitChildren(self) + + def rule_EntityClassEntry(self): + + localctx = VHDLParser.Rule_EntityClassEntryContext(self, self._ctx, self.state) + self.enterRule(localctx, 162, self.RULE_rule_EntityClassEntry) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 1273 + self.rule_EntityClass() + self.state = 1275 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la == 142: + self.state = 1274 + self.match(VHDLParser.TOK_BOX) + + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + class Rule_EntityDeclarationContext(ParserRuleContext): __slots__ = 'parser' @@ -7371,80 +7494,71 @@ def rule_EntityDeclaration(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1252 + self.state = 1277 self.match(VHDLParser.KW_ENTITY) - self.state = 1253 + self.state = 1278 localctx.name = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 1254 + self.state = 1279 self.match(VHDLParser.KW_IS) - self.state = 1256 + self.state = 1281 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_GENERIC: - self.state = 1255 + if _la == 42: + self.state = 1280 localctx.genericClause = self.rule_GenericClause() - self.state = 1259 + self.state = 1284 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_PORT: - self.state = 1258 + if _la == 72: + self.state = 1283 localctx.portClause = self.rule_PortClause() - self.state = 1264 + self.state = 1289 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ( - (1 << VHDLParser.KW_ALIAS) | (1 << VHDLParser.KW_ATTRIBUTE) | (1 << VHDLParser.KW_CONSTANT) | ( - 1 << VHDLParser.KW_DISCONNECT) | (1 << VHDLParser.KW_FILE) | (1 << VHDLParser.KW_FUNCTION) | ( - 1 << VHDLParser.KW_IMPURE))) != 0) or ((((_la - 70)) & ~0x3f) == 0 and ((1 << (_la - 70)) & ( - (1 << (VHDLParser.KW_PACKAGE - 70)) | (1 << (VHDLParser.KW_PROCEDURE - 70)) | ( - 1 << (VHDLParser.KW_PURE - 70)) | (1 << (VHDLParser.KW_SHARED - 70)) | (1 << (VHDLParser.KW_SIGNAL - 70)) | ( - 1 << (VHDLParser.KW_SUBTYPE - 70)) | (1 << (VHDLParser.KW_TYPE - 70)) | (1 << (VHDLParser.KW_USE - 70)) | ( - 1 << (VHDLParser.KW_VARIABLE - 70)) | (1 << (VHDLParser.KW_VIEW - 70)))) != 0): - self.state = 1261 + while (((_la) & ~0x3f) == 0 and ((1 << _la) & 88579975971328) != 0) or ( + (((_la - 70)) & ~0x3f) == 0 and ((1 << (_la - 70)) & 1941606236449) != 0): + self.state = 1286 localctx.declarations = self.rule_EntityDeclarativeItem() - self.state = 1266 + self.state = 1291 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 1274 + self.state = 1299 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_BEGIN: - self.state = 1267 + if _la == 17: + self.state = 1292 self.match(VHDLParser.KW_BEGIN) - self.state = 1271 + self.state = 1296 self._errHandler.sync(self) _la = self._input.LA(1) - while ((((_la - 14)) & ~0x3f) == 0 and ((1 << (_la - 14)) & ( - (1 << (VHDLParser.KW_ASSERT - 14)) | (1 << (VHDLParser.KW_POSTPONED - 14)) | ( - 1 << (VHDLParser.KW_PROCESS - 14)))) != 0) or ((((_la - 148)) & ~0x3f) == 0 and ((1 << (_la - 148)) & ( - (1 << (VHDLParser.TOK_DLA - 148)) | (1 << (VHDLParser.LIT_CHARACTER - 148)) | ( - 1 << (VHDLParser.LIT_STRING - 148)) | (1 << (VHDLParser.LIT_IDENTIFIER - 148)))) != 0): - self.state = 1268 + while ((((_la - 14)) & ~0x3f) == 0 and ((1 << (_la - 14)) & 5188146770730811393) != 0) or ( + (((_la - 147)) & ~0x3f) == 0 and ((1 << (_la - 147)) & 114689) != 0): + self.state = 1293 localctx.statements = self.rule_EntityStatement() - self.state = 1273 + self.state = 1298 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 1276 + self.state = 1301 self.match(VHDLParser.KW_END) - self.state = 1278 + self.state = 1303 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_ENTITY: - self.state = 1277 + if _la == 34: + self.state = 1302 self.match(VHDLParser.KW_ENTITY) - self.state = 1281 + self.state = 1306 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: - self.state = 1280 + if _la == 163: + self.state = 1305 localctx.name2 = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 1283 + self.state = 1308 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -7515,6 +7629,12 @@ def rule_DisconnectionSpecification(self): def rule_UseClause(self): return self.getTypedRuleContext(VHDLParser.Rule_UseClauseContext, 0) + def rule_GroupTemplateDeclaration(self): + return self.getTypedRuleContext(VHDLParser.Rule_GroupTemplateDeclarationContext, 0) + + def rule_GroupDeclaration(self): + return self.getTypedRuleContext(VHDLParser.Rule_GroupDeclarationContext, 0) + def getRuleIndex(self): return VHDLParser.RULE_rule_EntityDeclarativeItem @@ -7529,117 +7649,129 @@ def rule_EntityDeclarativeItem(self): localctx = VHDLParser.Rule_EntityDeclarativeItemContext(self, self._ctx, self.state) self.enterRule(localctx, 166, self.RULE_rule_EntityDeclarativeItem) try: - self.state = 1303 + self.state = 1330 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 114, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 119, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 1285 + self.state = 1310 self.rule_SubprogramDeclaration() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 1286 + self.state = 1311 self.rule_SubprogramBody() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 1287 + self.state = 1312 self.rule_SubprogramInstantiationDeclaration() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 1288 + self.state = 1313 self.rule_PackageDeclaration() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) - self.state = 1289 + self.state = 1314 self.rule_PackageBody() pass elif la_ == 6: self.enterOuterAlt(localctx, 6) - self.state = 1290 + self.state = 1315 self.rule_PackageInstantiationDeclaration() pass elif la_ == 7: self.enterOuterAlt(localctx, 7) - self.state = 1291 + self.state = 1316 self.rule_TypeDeclaration() pass elif la_ == 8: self.enterOuterAlt(localctx, 8) - self.state = 1292 + self.state = 1317 self.rule_SubtypeDeclaration() pass elif la_ == 9: self.enterOuterAlt(localctx, 9) - self.state = 1293 + self.state = 1318 self.rule_ModeViewDeclaration() pass elif la_ == 10: self.enterOuterAlt(localctx, 10) - self.state = 1294 + self.state = 1319 self.rule_ConstantDeclaration() pass elif la_ == 11: self.enterOuterAlt(localctx, 11) - self.state = 1295 + self.state = 1320 self.rule_SignalDeclaration() pass elif la_ == 12: self.enterOuterAlt(localctx, 12) - self.state = 1296 + self.state = 1321 self.rule_VariableDeclaration() pass elif la_ == 13: self.enterOuterAlt(localctx, 13) - self.state = 1297 + self.state = 1322 self.rule_FileDeclaration() pass elif la_ == 14: self.enterOuterAlt(localctx, 14) - self.state = 1298 + self.state = 1323 self.rule_AliasDeclaration() pass elif la_ == 15: self.enterOuterAlt(localctx, 15) - self.state = 1299 + self.state = 1324 self.rule_AttributeDeclaration() pass elif la_ == 16: self.enterOuterAlt(localctx, 16) - self.state = 1300 + self.state = 1325 self.rule_AttributeSpecification() pass elif la_ == 17: self.enterOuterAlt(localctx, 17) - self.state = 1301 + self.state = 1326 self.rule_DisconnectionSpecification() pass elif la_ == 18: self.enterOuterAlt(localctx, 18) - self.state = 1302 + self.state = 1327 self.rule_UseClause() pass + elif la_ == 19: + self.enterOuterAlt(localctx, 19) + self.state = 1328 + self.rule_GroupTemplateDeclaration() + pass + + elif la_ == 20: + self.enterOuterAlt(localctx, 20) + self.state = 1329 + self.rule_GroupDeclaration() + pass + except RecognitionException as re: localctx.exception = re @@ -7680,13 +7812,13 @@ def rule_EntityDesignator(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1305 + self.state = 1332 localctx.entityTag = self.rule_EntityTag() - self.state = 1307 + self.state = 1334 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.TOK_LB: - self.state = 1306 + if _la == 145: + self.state = 1333 localctx.signature = self.rule_Signature() @@ -7740,36 +7872,36 @@ def rule_EntityNameList(self): self.enterRule(localctx, 170, self.RULE_rule_EntityNameList) self._la = 0 # Token type try: - self.state = 1319 + self.state = 1346 self._errHandler.sync(self) token = self._input.LA(1) - if token in [VHDLParser.LIT_CHARACTER, VHDLParser.LIT_STRING, VHDLParser.LIT_IDENTIFIER]: + if token in [161, 162, 163]: self.enterOuterAlt(localctx, 1) - self.state = 1309 + self.state = 1336 localctx._rule_EntityDesignator = self.rule_EntityDesignator() localctx.entityDesignators.append(localctx._rule_EntityDesignator) - self.state = 1314 + self.state = 1341 self._errHandler.sync(self) _la = self._input.LA(1) - while _la == VHDLParser.TOK_COMMA: - self.state = 1310 + while _la == 151: + self.state = 1337 self.match(VHDLParser.TOK_COMMA) - self.state = 1311 + self.state = 1338 localctx._rule_EntityDesignator = self.rule_EntityDesignator() localctx.entityDesignators.append(localctx._rule_EntityDesignator) - self.state = 1316 + self.state = 1343 self._errHandler.sync(self) _la = self._input.LA(1) pass - elif token in [VHDLParser.KW_OTHERS]: + elif token in [68]: self.enterOuterAlt(localctx, 2) - self.state = 1317 + self.state = 1344 self.match(VHDLParser.KW_OTHERS) pass - elif token in [VHDLParser.KW_ALL]: + elif token in [10]: self.enterOuterAlt(localctx, 3) - self.state = 1318 + self.state = 1345 self.match(VHDLParser.KW_ALL) pass else: @@ -7816,11 +7948,11 @@ def rule_EntitySpecification(self): self.enterRule(localctx, 172, self.RULE_rule_EntitySpecification) try: self.enterOuterAlt(localctx, 1) - self.state = 1321 + self.state = 1348 localctx.entityNameList = self.rule_EntityNameList() - self.state = 1322 + self.state = 1349 self.match(VHDLParser.TOK_COLON) - self.state = 1323 + self.state = 1350 localctx.entityClass = self.rule_EntityClass() except RecognitionException as re: localctx.exception = re @@ -7863,30 +7995,30 @@ def rule_EntityStatement(self): localctx = VHDLParser.Rule_EntityStatementContext(self, self._ctx, self.state) self.enterRule(localctx, 174, self.RULE_rule_EntityStatement) try: - self.state = 1329 + self.state = 1356 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 118, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 123, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 1325 + self.state = 1352 self.rule_ConcurrentAssertionStatement() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 1326 + self.state = 1353 self.rule_ConcurrentProcedureCallStatement() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 1327 + self.state = 1354 self.rule_ProcessStatement() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 1328 + self.state = 1355 self.rule_PostponedProcessStatement() pass @@ -7931,11 +8063,9 @@ def rule_EntityTag(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1331 + self.state = 1358 _la = self._input.LA(1) - if not (((((_la - 162)) & ~0x3f) == 0 and ((1 << (_la - 162)) & ( - (1 << (VHDLParser.LIT_CHARACTER - 162)) | (1 << (VHDLParser.LIT_STRING - 162)) | ( - 1 << (VHDLParser.LIT_IDENTIFIER - 162)))) != 0)): + if not (((((_la - 161)) & ~0x3f) == 0 and ((1 << (_la - 161)) & 7) != 0)): self._errHandler.recoverInline(self) else: self._errHandler.reportMatch(self) @@ -7977,9 +8107,9 @@ def rule_EnumerationLiteral(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1333 + self.state = 1360 _la = self._input.LA(1) - if not (_la == VHDLParser.LIT_CHARACTER or _la == VHDLParser.LIT_IDENTIFIER): + if not (_la == 161 or _la == 163): self._errHandler.recoverInline(self) else: self._errHandler.reportMatch(self) @@ -8035,25 +8165,25 @@ def rule_EnumerationTypeDefinition(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1335 + self.state = 1362 self.match(VHDLParser.TOK_LP) - self.state = 1336 + self.state = 1363 localctx._rule_EnumerationLiteral = self.rule_EnumerationLiteral() localctx.enumerationLiterals.append(localctx._rule_EnumerationLiteral) - self.state = 1341 + self.state = 1368 self._errHandler.sync(self) _la = self._input.LA(1) - while _la == VHDLParser.TOK_COMMA: - self.state = 1337 + while _la == 151: + self.state = 1364 self.match(VHDLParser.TOK_COMMA) - self.state = 1338 + self.state = 1365 localctx._rule_EnumerationLiteral = self.rule_EnumerationLiteral() localctx.enumerationLiterals.append(localctx._rule_EnumerationLiteral) - self.state = 1343 + self.state = 1370 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 1344 + self.state = 1371 self.match(VHDLParser.TOK_RP) except RecognitionException as re: localctx.exception = re @@ -8110,34 +8240,34 @@ def rule_ExitStatement(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1348 + self.state = 1375 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: - self.state = 1346 + if _la == 163: + self.state = 1373 localctx.label = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 1347 + self.state = 1374 self.match(VHDLParser.TOK_COLON) - self.state = 1350 + self.state = 1377 self.match(VHDLParser.KW_EXIT) - self.state = 1352 + self.state = 1379 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: - self.state = 1351 + if _la == 163: + self.state = 1378 localctx.referencedLabel = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 1356 + self.state = 1383 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_WHEN: - self.state = 1354 + if _la == 117: + self.state = 1381 self.match(VHDLParser.KW_WHEN) - self.state = 1355 + self.state = 1382 localctx.condition = self.rule_Expression(0) - self.state = 1358 + self.state = 1385 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -8226,8 +8356,8 @@ def OP_NE(self): def OP_LT(self): return self.getToken(VHDLParser.OP_LT, 0) - def OP_LE(self): - return self.getToken(VHDLParser.OP_LE, 0) + def TOK_SIG_ASSIGN(self): + return self.getToken(VHDLParser.TOK_SIG_ASSIGN, 0) def OP_GT(self): return self.getToken(VHDLParser.OP_GT, 0) @@ -8352,76 +8482,69 @@ def rule_Expression(self, _p: int = 0): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1366 + self.state = 1393 self._errHandler.sync(self) token = self._input.LA(1) - if token in [VHDLParser.KW_NEW, VHDLParser.KW_NULL, VHDLParser.TOK_LP, VHDLParser.TOK_DLA, - VHDLParser.LIT_ABSTRACT, VHDLParser.LIT_BIT_STRING, VHDLParser.LIT_CHARACTER, VHDLParser.LIT_STRING, - VHDLParser.LIT_IDENTIFIER]: + if token in [59, 63, 143, 147, 159, 160, 161, 162, 163]: localctx = VHDLParser.PrimaryOpContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 1361 + self.state = 1388 self.rule_Primary() pass - elif token in [VHDLParser.OP_CONDITION]: + elif token in [138]: localctx = VHDLParser.UnaryOpContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 1362 + self.state = 1389 localctx.operator = self.match(VHDLParser.OP_CONDITION) - self.state = 1363 + self.state = 1390 localctx.right = self.rule_Expression(8) pass - elif token in [VHDLParser.OP_ABS, VHDLParser.OP_AND, VHDLParser.OP_NAND, VHDLParser.OP_NOR, VHDLParser.OP_NOT, - VHDLParser.OP_OR, VHDLParser.OP_XNOR, VHDLParser.OP_XOR, VHDLParser.OP_PLUS, VHDLParser.OP_MINUS]: + elif token in [6, 11, 58, 61, 62, 67, 119, 120, 132, 133]: localctx = VHDLParser.UnaryOpContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 1364 + self.state = 1391 localctx.operator = self._input.LT(1) _la = self._input.LA(1) - if not (((((_la - 6)) & ~0x3f) == 0 and ((1 << (_la - 6)) & ( - (1 << (VHDLParser.OP_ABS - 6)) | (1 << (VHDLParser.OP_AND - 6)) | (1 << (VHDLParser.OP_NAND - 6)) | ( - 1 << (VHDLParser.OP_NOR - 6)) | (1 << (VHDLParser.OP_NOT - 6)) | (1 << (VHDLParser.OP_OR - 6)))) != 0) or ( - (((_la - 119)) & ~0x3f) == 0 and ((1 << (_la - 119)) & ( - (1 << (VHDLParser.OP_XNOR - 119)) | (1 << (VHDLParser.OP_XOR - 119)) | ( - 1 << (VHDLParser.OP_PLUS - 119)) | (1 << (VHDLParser.OP_MINUS - 119)))) != 0)): + if not (((((_la - 6)) & ~0x3f) == 0 and ((1 << (_la - 6)) & 2418432999897956385) != 0) or ( + (((_la - 119)) & ~0x3f) == 0 and ((1 << (_la - 119)) & 24579) != 0)): localctx.operator = self._errHandler.recoverInline(self) else: self._errHandler.reportMatch(self) self.consume() - self.state = 1365 + self.state = 1392 localctx.right = self.rule_Expression(7) pass else: raise NoViableAltException(self) self._ctx.stop = self._input.LT(-1) - self.state = 1388 + self.state = 1415 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input, 125, self._ctx) + _alt = self._interp.adaptivePredict(self._input, 130, self._ctx) while _alt != 2 and _alt != ATN.INVALID_ALT_NUMBER: if _alt == 1: if self._parseListeners is not None: self.triggerExitRuleEvent() _prevctx = localctx - self.state = 1386 + self.state = 1413 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 124, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 129, self._ctx) if la_ == 1: localctx = VHDLParser.BinaryOpContext(self, VHDLParser.Rule_ExpressionContext(self, _parentctx, _parentState)) localctx.left = _prevctx self.pushNewRecursionContext(localctx, _startState, self.RULE_rule_Expression) - self.state = 1368 + self.state = 1395 if not self.precpred(self._ctx, 6): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 6)") - self.state = 1369 + self.state = 1396 localctx.operator = self.match(VHDLParser.OP_POW) - self.state = 1370 + self.state = 1397 localctx.right = self.rule_Expression(6) pass @@ -8430,21 +8553,19 @@ def rule_Expression(self, _p: int = 0): VHDLParser.Rule_ExpressionContext(self, _parentctx, _parentState)) localctx.left = _prevctx self.pushNewRecursionContext(localctx, _startState, self.RULE_rule_Expression) - self.state = 1371 + self.state = 1398 if not self.precpred(self._ctx, 5): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 5)") - self.state = 1372 + self.state = 1399 localctx.operator = self._input.LT(1) _la = self._input.LA(1) - if not (_la == VHDLParser.OP_MOD or ((((_la - 84)) & ~0x3f) == 0 and ((1 << (_la - 84)) & ( - (1 << (VHDLParser.OP_REM - 84)) | (1 << (VHDLParser.OP_MUL - 84)) | ( - 1 << (VHDLParser.OP_DIV - 84)))) != 0)): + if not (_la == 57 or ((((_la - 84)) & ~0x3f) == 0 and ((1 << (_la - 84)) & 3377699720527873) != 0)): localctx.operator = self._errHandler.recoverInline(self) else: self._errHandler.reportMatch(self) self.consume() - self.state = 1373 + self.state = 1400 localctx.right = self.rule_Expression(6) pass @@ -8453,21 +8574,19 @@ def rule_Expression(self, _p: int = 0): VHDLParser.Rule_ExpressionContext(self, _parentctx, _parentState)) localctx.left = _prevctx self.pushNewRecursionContext(localctx, _startState, self.RULE_rule_Expression) - self.state = 1374 + self.state = 1401 if not self.precpred(self._ctx, 4): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 4)") - self.state = 1375 + self.state = 1402 localctx.operator = self._input.LT(1) _la = self._input.LA(1) - if not (((((_la - 133)) & ~0x3f) == 0 and ((1 << (_la - 133)) & ( - (1 << (VHDLParser.OP_PLUS - 133)) | (1 << (VHDLParser.OP_MINUS - 133)) | ( - 1 << (VHDLParser.OP_CONCAT - 133)))) != 0)): + if not (((((_la - 132)) & ~0x3f) == 0 and ((1 << (_la - 132)) & 35) != 0)): localctx.operator = self._errHandler.recoverInline(self) else: self._errHandler.reportMatch(self) self.consume() - self.state = 1376 + self.state = 1403 localctx.right = self.rule_Expression(5) pass @@ -8476,22 +8595,19 @@ def rule_Expression(self, _p: int = 0): VHDLParser.Rule_ExpressionContext(self, _parentctx, _parentState)) localctx.left = _prevctx self.pushNewRecursionContext(localctx, _startState, self.RULE_rule_Expression) - self.state = 1377 + self.state = 1404 if not self.precpred(self._ctx, 3): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 3)") - self.state = 1378 + self.state = 1405 localctx.operator = self._input.LT(1) _la = self._input.LA(1) - if not (((((_la - 87)) & ~0x3f) == 0 and ((1 << (_la - 87)) & ( - (1 << (VHDLParser.OP_ROL - 87)) | (1 << (VHDLParser.OP_ROR - 87)) | (1 << (VHDLParser.OP_SLA - 87)) | ( - 1 << (VHDLParser.OP_SLL - 87)) | (1 << (VHDLParser.OP_SRA - 87)) | ( - 1 << (VHDLParser.OP_SRL - 87)))) != 0)): + if not (((((_la - 87)) & ~0x3f) == 0 and ((1 << (_la - 87)) & 1923) != 0)): localctx.operator = self._errHandler.recoverInline(self) else: self._errHandler.reportMatch(self) self.consume() - self.state = 1379 + self.state = 1406 localctx.right = self.rule_Expression(4) pass @@ -8500,24 +8616,19 @@ def rule_Expression(self, _p: int = 0): VHDLParser.Rule_ExpressionContext(self, _parentctx, _parentState)) localctx.left = _prevctx self.pushNewRecursionContext(localctx, _startState, self.RULE_rule_Expression) - self.state = 1380 + self.state = 1407 if not self.precpred(self._ctx, 2): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 2)") - self.state = 1381 + self.state = 1408 localctx.operator = self._input.LT(1) _la = self._input.LA(1) - if not (((((_la - 121)) & ~0x3f) == 0 and ((1 << (_la - 121)) & ( - (1 << (VHDLParser.OP_EQ - 121)) | (1 << (VHDLParser.OP_NE - 121)) | (1 << (VHDLParser.OP_LT - 121)) | ( - 1 << (VHDLParser.OP_LE - 121)) | (1 << (VHDLParser.OP_GT - 121)) | (1 << (VHDLParser.OP_GE - 121)) | ( - 1 << (VHDLParser.OP_IEQ - 121)) | (1 << (VHDLParser.OP_INE - 121)) | ( - 1 << (VHDLParser.OP_ILT - 121)) | (1 << (VHDLParser.OP_ILE - 121)) | ( - 1 << (VHDLParser.OP_IGT - 121)) | (1 << (VHDLParser.OP_IGE - 121)))) != 0)): + if not (((((_la - 121)) & ~0x3f) == 0 and ((1 << (_la - 121)) & 526335) != 0)): localctx.operator = self._errHandler.recoverInline(self) else: self._errHandler.reportMatch(self) self.consume() - self.state = 1382 + self.state = 1409 localctx.right = self.rule_Expression(3) pass @@ -8526,29 +8637,26 @@ def rule_Expression(self, _p: int = 0): VHDLParser.Rule_ExpressionContext(self, _parentctx, _parentState)) localctx.left = _prevctx self.pushNewRecursionContext(localctx, _startState, self.RULE_rule_Expression) - self.state = 1383 + self.state = 1410 if not self.precpred(self._ctx, 1): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 1)") - self.state = 1384 + self.state = 1411 localctx.operator = self._input.LT(1) _la = self._input.LA(1) - if not ((((_la) & ~0x3f) == 0 and ( - (1 << _la) & ((1 << VHDLParser.OP_AND) | (1 << VHDLParser.OP_NAND) | (1 << VHDLParser.OP_NOR))) != 0) or ( - (((_la - 67)) & ~0x3f) == 0 and ((1 << (_la - 67)) & ( - (1 << (VHDLParser.OP_OR - 67)) | (1 << (VHDLParser.OP_XNOR - 67)) | ( - 1 << (VHDLParser.OP_XOR - 67)))) != 0)): + if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & 2594073385365407744) != 0) or ( + (((_la - 67)) & ~0x3f) == 0 and ((1 << (_la - 67)) & 13510798882111489) != 0)): localctx.operator = self._errHandler.recoverInline(self) else: self._errHandler.reportMatch(self) self.consume() - self.state = 1385 + self.state = 1412 localctx.right = self.rule_Expression(2) pass - self.state = 1390 + self.state = 1417 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input, 125, self._ctx) + _alt = self._interp.adaptivePredict(self._input, 130, self._ctx) except RecognitionException as re: localctx.exception = re @@ -8585,21 +8693,17 @@ def rule_ExpressionOrUnaffected(self): localctx = VHDLParser.Rule_ExpressionOrUnaffectedContext(self, self._ctx, self.state) self.enterRule(localctx, 186, self.RULE_rule_ExpressionOrUnaffected) try: - self.state = 1393 + self.state = 1420 self._errHandler.sync(self) token = self._input.LA(1) - if token in [VHDLParser.OP_ABS, VHDLParser.OP_AND, VHDLParser.OP_NAND, VHDLParser.KW_NEW, VHDLParser.OP_NOR, - VHDLParser.OP_NOT, VHDLParser.KW_NULL, VHDLParser.OP_OR, VHDLParser.OP_XNOR, VHDLParser.OP_XOR, - VHDLParser.OP_PLUS, VHDLParser.OP_MINUS, VHDLParser.OP_CONDITION, VHDLParser.TOK_LP, - VHDLParser.TOK_DLA, VHDLParser.LIT_ABSTRACT, VHDLParser.LIT_BIT_STRING, VHDLParser.LIT_CHARACTER, - VHDLParser.LIT_STRING, VHDLParser.LIT_IDENTIFIER]: + if token in [6, 11, 58, 59, 61, 62, 63, 67, 119, 120, 132, 133, 138, 143, 147, 159, 160, 161, 162, 163]: self.enterOuterAlt(localctx, 1) - self.state = 1391 + self.state = 1418 self.rule_Expression(0) pass - elif token in [VHDLParser.KW_UNAFFECTED]: + elif token in [105]: self.enterOuterAlt(localctx, 2) - self.state = 1392 + self.state = 1419 self.match(VHDLParser.KW_UNAFFECTED) pass else: @@ -8643,24 +8747,24 @@ def rule_ExternalName(self): localctx = VHDLParser.Rule_ExternalNameContext(self, self._ctx, self.state) self.enterRule(localctx, 188, self.RULE_rule_ExternalName) try: - self.state = 1398 + self.state = 1425 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 127, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 132, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 1395 + self.state = 1422 self.rule_ExternalConstantName() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 1396 + self.state = 1423 self.rule_ExternalSignalName() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 1397 + self.state = 1424 self.rule_ExternalVariableName() pass @@ -8713,17 +8817,17 @@ def rule_ExternalConstantName(self): self.enterRule(localctx, 190, self.RULE_rule_ExternalConstantName) try: self.enterOuterAlt(localctx, 1) - self.state = 1400 + self.state = 1427 self.match(VHDLParser.TOK_DLA) - self.state = 1401 + self.state = 1428 self.match(VHDLParser.KW_CONSTANT) - self.state = 1402 + self.state = 1429 self.rule_ExternalPathname() - self.state = 1403 + self.state = 1430 self.match(VHDLParser.TOK_COLON) - self.state = 1404 + self.state = 1431 self.rule_InterfaceTypeIndication() - self.state = 1405 + self.state = 1432 self.match(VHDLParser.TOK_DRA) except RecognitionException as re: localctx.exception = re @@ -8773,17 +8877,17 @@ def rule_ExternalSignalName(self): self.enterRule(localctx, 192, self.RULE_rule_ExternalSignalName) try: self.enterOuterAlt(localctx, 1) - self.state = 1407 + self.state = 1434 self.match(VHDLParser.TOK_DLA) - self.state = 1408 + self.state = 1435 self.match(VHDLParser.KW_SIGNAL) - self.state = 1409 + self.state = 1436 self.rule_ExternalPathname() - self.state = 1410 + self.state = 1437 self.match(VHDLParser.TOK_COLON) - self.state = 1411 + self.state = 1438 self.rule_InterfaceTypeIndication() - self.state = 1412 + self.state = 1439 self.match(VHDLParser.TOK_DRA) except RecognitionException as re: localctx.exception = re @@ -8833,17 +8937,17 @@ def rule_ExternalVariableName(self): self.enterRule(localctx, 194, self.RULE_rule_ExternalVariableName) try: self.enterOuterAlt(localctx, 1) - self.state = 1414 + self.state = 1441 self.match(VHDLParser.TOK_DLA) - self.state = 1415 + self.state = 1442 self.match(VHDLParser.KW_VARIABLE) - self.state = 1416 + self.state = 1443 self.rule_ExternalPathname() - self.state = 1417 + self.state = 1444 self.match(VHDLParser.TOK_COLON) - self.state = 1418 + self.state = 1445 self.rule_InterfaceTypeIndication() - self.state = 1419 + self.state = 1446 self.match(VHDLParser.TOK_DRA) except RecognitionException as re: localctx.exception = re @@ -8883,22 +8987,22 @@ def rule_ExternalPathname(self): localctx = VHDLParser.Rule_ExternalPathnameContext(self, self._ctx, self.state) self.enterRule(localctx, 196, self.RULE_rule_ExternalPathname) try: - self.state = 1424 + self.state = 1451 self._errHandler.sync(self) token = self._input.LA(1) - if token in [VHDLParser.TOK_AT]: + if token in [155]: self.enterOuterAlt(localctx, 1) - self.state = 1421 + self.state = 1448 self.rule_PackagePathname() pass - elif token in [VHDLParser.TOK_DOT]: + elif token in [153]: self.enterOuterAlt(localctx, 2) - self.state = 1422 + self.state = 1449 self.rule_AbsolutePathname() pass - elif token in [VHDLParser.TOK_CIRCUMFLEX, VHDLParser.LIT_IDENTIFIER]: + elif token in [156, 163]: self.enterOuterAlt(localctx, 3) - self.state = 1423 + self.state = 1450 self.rule_RelativePathname() pass else: @@ -8955,22 +9059,22 @@ def rule_FileDeclaration(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1426 + self.state = 1453 self.match(VHDLParser.KW_FILE) - self.state = 1427 + self.state = 1454 localctx.identifierList = self.rule_IdentifierList() - self.state = 1428 + self.state = 1455 self.match(VHDLParser.TOK_COLON) - self.state = 1429 + self.state = 1456 localctx.subtypeIndication = self.rule_SubtypeIndication() - self.state = 1431 + self.state = 1458 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_IS or _la == VHDLParser.KW_OPEN: - self.state = 1430 + if _la == 50 or _la == 66: + self.state = 1457 self.rule_FileOpenInformation() - self.state = 1433 + self.state = 1460 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -9011,11 +9115,11 @@ def rule_FileIncompleteTypeDefinition(self): self.enterRule(localctx, 200, self.RULE_rule_FileIncompleteTypeDefinition) try: self.enterOuterAlt(localctx, 1) - self.state = 1435 + self.state = 1462 self.match(VHDLParser.KW_FILE) - self.state = 1436 + self.state = 1463 self.match(VHDLParser.KW_OF) - self.state = 1437 + self.state = 1464 self.rule_IncompleteTypeMark() except RecognitionException as re: localctx.exception = re @@ -9062,18 +9166,18 @@ def rule_FileOpenInformation(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1441 + self.state = 1468 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_OPEN: - self.state = 1439 + if _la == 66: + self.state = 1466 self.match(VHDLParser.KW_OPEN) - self.state = 1440 + self.state = 1467 localctx.openKindExpression = self.rule_Expression(0) - self.state = 1443 + self.state = 1470 self.match(VHDLParser.KW_IS) - self.state = 1444 + self.state = 1471 localctx.fileNameExpression = self.rule_Expression(0) except RecognitionException as re: localctx.exception = re @@ -9096,8 +9200,8 @@ def KW_FILE(self): def KW_OF(self): return self.getToken(VHDLParser.KW_OF, 0) - def rule_TypeMark(self): - return self.getTypedRuleContext(VHDLParser.Rule_TypeMarkContext, 0) + def rule_Name(self): + return self.getTypedRuleContext(VHDLParser.Rule_NameContext, 0) def getRuleIndex(self): return VHDLParser.RULE_rule_FileTypeDefinition @@ -9114,12 +9218,12 @@ def rule_FileTypeDefinition(self): self.enterRule(localctx, 204, self.RULE_rule_FileTypeDefinition) try: self.enterOuterAlt(localctx, 1) - self.state = 1446 + self.state = 1473 self.match(VHDLParser.KW_FILE) - self.state = 1447 + self.state = 1474 self.match(VHDLParser.KW_OF) - self.state = 1448 - self.rule_TypeMark() + self.state = 1475 + self.rule_Name(0) except RecognitionException as re: localctx.exception = re self._errHandler.reportError(self, re) @@ -9162,13 +9266,13 @@ def rule_FloatingIncompleteTypeDefinition(self): self.enterRule(localctx, 206, self.RULE_rule_FloatingIncompleteTypeDefinition) try: self.enterOuterAlt(localctx, 1) - self.state = 1450 + self.state = 1477 self.match(VHDLParser.KW_RANGE) - self.state = 1451 + self.state = 1478 self.match(VHDLParser.TOK_BOX) - self.state = 1452 + self.state = 1479 self.match(VHDLParser.TOK_DOT) - self.state = 1453 + self.state = 1480 self.match(VHDLParser.TOK_BOX) except RecognitionException as re: localctx.exception = re @@ -9203,7 +9307,7 @@ def rule_FloatingTypeDefinition(self): self.enterRule(localctx, 208, self.RULE_rule_FloatingTypeDefinition) try: self.enterOuterAlt(localctx, 1) - self.state = 1455 + self.state = 1482 self.rule_RangeConstraint() except RecognitionException as re: localctx.exception = re @@ -9220,6 +9324,10 @@ def __init__(self, parser, parent: ParserRuleContext = None, invokingState: int super().__init__(parent, invokingState) self.parser = parser self.label = None # Token + self._rule_BlockDeclarativeItem = None # Rule_BlockDeclarativeItemContext + self.declaredItems = list() # of Rule_BlockDeclarativeItemContexts + self._rule_ConcurrentStatement = None # Rule_ConcurrentStatementContext + self.statements = list() # of Rule_ConcurrentStatementContexts self.label2 = None # Token def TOK_COLON(self): @@ -9237,9 +9345,6 @@ def KW_GENERATE(self, i: int = None): else: return self.getToken(VHDLParser.KW_GENERATE, i) - def rule_GenerateStatementBody(self): - return self.getTypedRuleContext(VHDLParser.Rule_GenerateStatementBodyContext, 0) - def KW_END(self): return self.getToken(VHDLParser.KW_END, 0) @@ -9252,6 +9357,21 @@ def LIT_IDENTIFIER(self, i: int = None): else: return self.getToken(VHDLParser.LIT_IDENTIFIER, i) + def KW_BEGIN(self): + return self.getToken(VHDLParser.KW_BEGIN, 0) + + def rule_ConcurrentStatement(self, i: int = None): + if i is None: + return self.getTypedRuleContexts(VHDLParser.Rule_ConcurrentStatementContext) + else: + return self.getTypedRuleContext(VHDLParser.Rule_ConcurrentStatementContext, i) + + def rule_BlockDeclarativeItem(self, i: int = None): + if i is None: + return self.getTypedRuleContexts(VHDLParser.Rule_BlockDeclarativeItemContext) + else: + return self.getTypedRuleContext(VHDLParser.Rule_BlockDeclarativeItemContext, i) + def getRuleIndex(self): return VHDLParser.RULE_rule_ForGenerateStatement @@ -9268,30 +9388,60 @@ def rule_ForGenerateStatement(self): self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1457 + self.state = 1484 localctx.label = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 1458 + self.state = 1485 self.match(VHDLParser.TOK_COLON) - self.state = 1459 + self.state = 1486 self.match(VHDLParser.KW_FOR) - self.state = 1460 + self.state = 1487 self.rule_ParameterSpecification() - self.state = 1461 + self.state = 1488 self.match(VHDLParser.KW_GENERATE) - self.state = 1462 - self.rule_GenerateStatementBody() - self.state = 1463 + self.state = 1496 + self._errHandler.sync(self) + _la = self._input.LA(1) + if (((_la) & ~0x3f) == 0 and ((1 << _la) & 88717423444480) != 0) or ( + (((_la - 70)) & ~0x3f) == 0 and ((1 << (_la - 70)) & 1941606236449) != 0): + self.state = 1492 + self._errHandler.sync(self) + _la = self._input.LA(1) + while (((_la) & ~0x3f) == 0 and ((1 << _la) & 88717423313408) != 0) or ( + (((_la - 70)) & ~0x3f) == 0 and ((1 << (_la - 70)) & 1941606236449) != 0): + self.state = 1489 + localctx._rule_BlockDeclarativeItem = self.rule_BlockDeclarativeItem() + localctx.declaredItems.append(localctx._rule_BlockDeclarativeItem) + self.state = 1494 + self._errHandler.sync(self) + _la = self._input.LA(1) + + self.state = 1495 + self.match(VHDLParser.KW_BEGIN) + + self.state = 1501 + self._errHandler.sync(self) + _la = self._input.LA(1) + while ((((_la - 14)) & ~0x3f) == 0 and ((1 << (_la - 14)) & 5188146770730811393) != 0) or ( + (((_la - 116)) & ~0x3f) == 0 and ((1 << (_la - 116)) & 246292886323201) != 0): + self.state = 1498 + localctx._rule_ConcurrentStatement = self.rule_ConcurrentStatement() + localctx.statements.append(localctx._rule_ConcurrentStatement) + self.state = 1503 + self._errHandler.sync(self) + _la = self._input.LA(1) + + self.state = 1504 self.match(VHDLParser.KW_END) - self.state = 1464 + self.state = 1505 self.match(VHDLParser.KW_GENERATE) - self.state = 1466 + self.state = 1507 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: - self.state = 1465 + if _la == 163: + self.state = 1506 localctx.label2 = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 1468 + self.state = 1509 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -9301,50 +9451,6 @@ def rule_ForGenerateStatement(self): self.exitRule() return localctx - class Rule_ForceModeContext(ParserRuleContext): - __slots__ = 'parser' - - def __init__(self, parser, parent: ParserRuleContext = None, invokingState: int = -1): - super().__init__(parent, invokingState) - self.parser = parser - - def KW_IN(self): - return self.getToken(VHDLParser.KW_IN, 0) - - def KW_OUT(self): - return self.getToken(VHDLParser.KW_OUT, 0) - - def getRuleIndex(self): - return VHDLParser.RULE_rule_ForceMode - - def accept(self, visitor: ParseTreeVisitor): - if hasattr(visitor, "visitRule_ForceMode"): - return visitor.visitRule_ForceMode(self) - else: - return visitor.visitChildren(self) - - def rule_ForceMode(self): - - localctx = VHDLParser.Rule_ForceModeContext(self, self._ctx, self.state) - self.enterRule(localctx, 212, self.RULE_rule_ForceMode) - self._la = 0 # Token type - try: - self.enterOuterAlt(localctx, 1) - self.state = 1470 - _la = self._input.LA(1) - if not (_la == VHDLParser.KW_IN or _la == VHDLParser.KW_OUT): - self._errHandler.recoverInline(self) - else: - self._errHandler.reportMatch(self) - self.consume() - except RecognitionException as re: - localctx.exception = re - self._errHandler.reportError(self, re) - self._errHandler.recover(self, re) - finally: - self.exitRule() - return localctx - class Rule_FormalDesignatorContext(ParserRuleContext): __slots__ = 'parser' @@ -9371,17 +9477,17 @@ def accept(self, visitor: ParseTreeVisitor): def rule_FormalDesignator(self): localctx = VHDLParser.Rule_FormalDesignatorContext(self, self._ctx, self.state) - self.enterRule(localctx, 214, self.RULE_rule_FormalDesignator) + self.enterRule(localctx, 212, self.RULE_rule_FormalDesignator) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1472 + self.state = 1511 self.rule_Name(0) - self.state = 1474 + self.state = 1513 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.TOK_LB: - self.state = 1473 + if _la == 145: + self.state = 1512 localctx.signature = self.rule_Signature() @@ -9415,10 +9521,10 @@ def accept(self, visitor: ParseTreeVisitor): def rule_FormalParameterList(self): localctx = VHDLParser.Rule_FormalParameterListContext(self, self._ctx, self.state) - self.enterRule(localctx, 216, self.RULE_rule_FormalParameterList) + self.enterRule(localctx, 214, self.RULE_rule_FormalParameterList) try: self.enterOuterAlt(localctx, 1) - self.state = 1476 + self.state = 1515 self.rule_InterfaceList() except RecognitionException as re: localctx.exception = re @@ -9447,9 +9553,6 @@ def TOK_RP(self): def rule_Name(self): return self.getTypedRuleContext(VHDLParser.Rule_NameContext, 0) - def rule_TypeMark(self): - return self.getTypedRuleContext(VHDLParser.Rule_TypeMarkContext, 0) - def getRuleIndex(self): return VHDLParser.RULE_rule_FormalPart @@ -9462,37 +9565,37 @@ def accept(self, visitor: ParseTreeVisitor): def rule_FormalPart(self): localctx = VHDLParser.Rule_FormalPartContext(self, self._ctx, self.state) - self.enterRule(localctx, 218, self.RULE_rule_FormalPart) + self.enterRule(localctx, 216, self.RULE_rule_FormalPart) try: - self.state = 1487 + self.state = 1526 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 134, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 142, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 1478 + self.state = 1517 self.rule_FormalDesignator() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 1481 + self.state = 1520 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 133, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 141, self._ctx) if la_ == 1: - self.state = 1479 + self.state = 1518 self.rule_Name(0) pass elif la_ == 2: - self.state = 1480 - self.rule_TypeMark() + self.state = 1519 + self.rule_Name(0) pass - self.state = 1483 + self.state = 1522 self.match(VHDLParser.TOK_LP) - self.state = 1484 + self.state = 1523 self.rule_FormalDesignator() - self.state = 1485 + self.state = 1524 self.match(VHDLParser.TOK_RP) pass @@ -9540,18 +9643,18 @@ def accept(self, visitor: ParseTreeVisitor): def rule_FullTypeDeclaration(self): localctx = VHDLParser.Rule_FullTypeDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 220, self.RULE_rule_FullTypeDeclaration) + self.enterRule(localctx, 218, self.RULE_rule_FullTypeDeclaration) try: self.enterOuterAlt(localctx, 1) - self.state = 1489 + self.state = 1528 self.match(VHDLParser.KW_TYPE) - self.state = 1490 + self.state = 1529 localctx.name = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 1491 + self.state = 1530 self.match(VHDLParser.KW_IS) - self.state = 1492 + self.state = 1531 self.rule_TypeDefinition() - self.state = 1493 + self.state = 1532 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -9592,14 +9695,14 @@ def accept(self, visitor: ParseTreeVisitor): def rule_FunctionCall(self): localctx = VHDLParser.Rule_FunctionCallContext(self, self._ctx, self.state) - self.enterRule(localctx, 222, self.RULE_rule_FunctionCall) + self.enterRule(localctx, 220, self.RULE_rule_FunctionCall) try: self.enterOuterAlt(localctx, 1) - self.state = 1495 + self.state = 1534 localctx.name = self.rule_Name(0) - self.state = 1496 + self.state = 1535 localctx.genericMapAspect = self.rule_GenericMapAspect() - self.state = 1497 + self.state = 1536 localctx.parameterMapAspect = self.rule_ParameterMapAspect() except RecognitionException as re: localctx.exception = re @@ -9626,8 +9729,8 @@ def rule_Designator(self): def KW_RETURN(self): return self.getToken(VHDLParser.KW_RETURN, 0) - def rule_TypeMark(self): - return self.getTypedRuleContext(VHDLParser.Rule_TypeMarkContext, 0) + def rule_Name(self): + return self.getTypedRuleContext(VHDLParser.Rule_NameContext, 0) def TOK_LP(self): return self.getToken(VHDLParser.TOK_LP, 0) @@ -9638,6 +9741,9 @@ def rule_FormalParameterList(self): def TOK_RP(self): return self.getToken(VHDLParser.TOK_RP, 0) + def KW_OF(self): + return self.getToken(VHDLParser.KW_OF, 0) + def KW_PURE(self): return self.getToken(VHDLParser.KW_PURE, 0) @@ -9662,55 +9768,57 @@ def accept(self, visitor: ParseTreeVisitor): def rule_FunctionSpecification(self): localctx = VHDLParser.Rule_FunctionSpecificationContext(self, self._ctx, self.state) - self.enterRule(localctx, 224, self.RULE_rule_FunctionSpecification) + self.enterRule(localctx, 222, self.RULE_rule_FunctionSpecification) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1500 + self.state = 1539 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_IMPURE or _la == VHDLParser.KW_PURE: - self.state = 1499 + if _la == 46 or _la == 78: + self.state = 1538 _la = self._input.LA(1) - if not (_la == VHDLParser.KW_IMPURE or _la == VHDLParser.KW_PURE): + if not (_la == 46 or _la == 78): self._errHandler.recoverInline(self) else: self._errHandler.reportMatch(self) self.consume() - self.state = 1502 + self.state = 1541 self.match(VHDLParser.KW_FUNCTION) - self.state = 1503 + self.state = 1542 self.rule_Designator() - self.state = 1511 + self.state = 1550 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_PARAMETER or _la == VHDLParser.TOK_LP: - self.state = 1505 + if _la == 71 or _la == 143: + self.state = 1544 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_PARAMETER: - self.state = 1504 + if _la == 71: + self.state = 1543 self.match(VHDLParser.KW_PARAMETER) - self.state = 1507 + self.state = 1546 self.match(VHDLParser.TOK_LP) - self.state = 1508 + self.state = 1547 self.rule_FormalParameterList() - self.state = 1509 + self.state = 1548 self.match(VHDLParser.TOK_RP) - self.state = 1513 + self.state = 1552 self.match(VHDLParser.KW_RETURN) - self.state = 1515 + self.state = 1555 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 138, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 146, self._ctx) if la_ == 1: - self.state = 1514 + self.state = 1553 localctx.returnIdentifier = self.match(VHDLParser.LIT_IDENTIFIER) + self.state = 1554 + self.match(VHDLParser.KW_OF) - self.state = 1517 - self.rule_TypeMark() + self.state = 1557 + self.rule_Name(0) except RecognitionException as re: localctx.exception = re self._errHandler.reportError(self, re) @@ -9747,26 +9855,26 @@ def accept(self, visitor: ParseTreeVisitor): def rule_GenerateSpecification(self): localctx = VHDLParser.Rule_GenerateSpecificationContext(self, self._ctx, self.state) - self.enterRule(localctx, 226, self.RULE_rule_GenerateSpecification) + self.enterRule(localctx, 224, self.RULE_rule_GenerateSpecification) try: - self.state = 1522 + self.state = 1562 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 139, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 147, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 1519 + self.state = 1559 self.rule_DiscreteRange() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 1520 + self.state = 1560 self.rule_Expression(0) pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 1521 + self.state = 1561 self.match(VHDLParser.LIT_IDENTIFIER) pass @@ -9807,26 +9915,26 @@ def accept(self, visitor: ParseTreeVisitor): def rule_GenerateStatement(self): localctx = VHDLParser.Rule_GenerateStatementContext(self, self._ctx, self.state) - self.enterRule(localctx, 228, self.RULE_rule_GenerateStatement) + self.enterRule(localctx, 226, self.RULE_rule_GenerateStatement) try: - self.state = 1527 + self.state = 1567 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 140, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 148, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 1524 + self.state = 1564 self.rule_ForGenerateStatement() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 1525 + self.state = 1565 self.rule_IfGenerateStatement() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 1526 + self.state = 1566 self.rule_CaseGenerateStatement() pass @@ -9847,30 +9955,24 @@ def __init__(self, parser, parent: ParserRuleContext = None, invokingState: int self.parser = parser self._rule_BlockDeclarativeItem = None # Rule_BlockDeclarativeItemContext self.declaredItems = list() # of Rule_BlockDeclarativeItemContexts - self._rule_ArchitectureStatement = None # Rule_ArchitectureStatementContext - self.statements = list() # of Rule_ArchitectureStatementContexts + self._rule_ConcurrentStatement = None # Rule_ConcurrentStatementContext + self.statements = list() # of Rule_ConcurrentStatementContexts self.label = None # Token + def KW_BEGIN(self): + return self.getToken(VHDLParser.KW_BEGIN, 0) + def KW_END(self): return self.getToken(VHDLParser.KW_END, 0) - def KW_GENERATE(self): - return self.getToken(VHDLParser.KW_GENERATE, 0) - def TOK_SEMICOL(self): return self.getToken(VHDLParser.TOK_SEMICOL, 0) - def KW_BEGIN(self): - return self.getToken(VHDLParser.KW_BEGIN, 0) - - def rule_ArchitectureStatement(self, i: int = None): + def rule_ConcurrentStatement(self, i: int = None): if i is None: - return self.getTypedRuleContexts(VHDLParser.Rule_ArchitectureStatementContext) + return self.getTypedRuleContexts(VHDLParser.Rule_ConcurrentStatementContext) else: - return self.getTypedRuleContext(VHDLParser.Rule_ArchitectureStatementContext, i) - - def LIT_IDENTIFIER(self): - return self.getToken(VHDLParser.LIT_IDENTIFIER, 0) + return self.getTypedRuleContext(VHDLParser.Rule_ConcurrentStatementContext, i) def rule_BlockDeclarativeItem(self, i: int = None): if i is None: @@ -9878,6 +9980,9 @@ def rule_BlockDeclarativeItem(self, i: int = None): else: return self.getTypedRuleContext(VHDLParser.Rule_BlockDeclarativeItemContext, i) + def LIT_IDENTIFIER(self): + return self.getToken(VHDLParser.LIT_IDENTIFIER, 0) + def getRuleIndex(self): return VHDLParser.RULE_rule_GenerateStatementBody @@ -9890,73 +9995,59 @@ def accept(self, visitor: ParseTreeVisitor): def rule_GenerateStatementBody(self): localctx = VHDLParser.Rule_GenerateStatementBodyContext(self, self._ctx, self.state) - self.enterRule(localctx, 230, self.RULE_rule_GenerateStatementBody) + self.enterRule(localctx, 228, self.RULE_rule_GenerateStatementBody) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1536 + self.state = 1576 self._errHandler.sync(self) _la = self._input.LA(1) - if (((_la) & ~0x3f) == 0 and ((1 << _la) & ( - (1 << VHDLParser.KW_ALIAS) | (1 << VHDLParser.KW_ATTRIBUTE) | (1 << VHDLParser.KW_BEGIN) | ( - 1 << VHDLParser.KW_COMPONENT) | (1 << VHDLParser.KW_CONSTANT) | (1 << VHDLParser.KW_DISCONNECT) | ( - 1 << VHDLParser.KW_FILE) | (1 << VHDLParser.KW_FOR) | (1 << VHDLParser.KW_FUNCTION) | ( - 1 << VHDLParser.KW_IMPURE))) != 0) or ((((_la - 70)) & ~0x3f) == 0 and ((1 << (_la - 70)) & ( - (1 << (VHDLParser.KW_PACKAGE - 70)) | (1 << (VHDLParser.KW_PROCEDURE - 70)) | ( - 1 << (VHDLParser.KW_PURE - 70)) | (1 << (VHDLParser.KW_SHARED - 70)) | (1 << (VHDLParser.KW_SIGNAL - 70)) | ( - 1 << (VHDLParser.KW_SUBTYPE - 70)) | (1 << (VHDLParser.KW_TYPE - 70)) | (1 << (VHDLParser.KW_USE - 70)) | ( - 1 << (VHDLParser.KW_VARIABLE - 70)) | (1 << (VHDLParser.KW_VIEW - 70)))) != 0): - self.state = 1532 + if (((_la) & ~0x3f) == 0 and ((1 << _la) & 88717423444480) != 0) or ( + (((_la - 70)) & ~0x3f) == 0 and ((1 << (_la - 70)) & 1941606236449) != 0): + self.state = 1572 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ( - (1 << VHDLParser.KW_ALIAS) | (1 << VHDLParser.KW_ATTRIBUTE) | (1 << VHDLParser.KW_COMPONENT) | ( - 1 << VHDLParser.KW_CONSTANT) | (1 << VHDLParser.KW_DISCONNECT) | (1 << VHDLParser.KW_FILE) | ( - 1 << VHDLParser.KW_FOR) | (1 << VHDLParser.KW_FUNCTION) | (1 << VHDLParser.KW_IMPURE))) != 0) or ( - (((_la - 70)) & ~0x3f) == 0 and ((1 << (_la - 70)) & ( - (1 << (VHDLParser.KW_PACKAGE - 70)) | (1 << (VHDLParser.KW_PROCEDURE - 70)) | ( - 1 << (VHDLParser.KW_PURE - 70)) | (1 << (VHDLParser.KW_SHARED - 70)) | (1 << (VHDLParser.KW_SIGNAL - 70)) | ( - 1 << (VHDLParser.KW_SUBTYPE - 70)) | (1 << (VHDLParser.KW_TYPE - 70)) | (1 << (VHDLParser.KW_USE - 70)) | ( - 1 << (VHDLParser.KW_VARIABLE - 70)) | (1 << (VHDLParser.KW_VIEW - 70)))) != 0): - self.state = 1529 + while (((_la) & ~0x3f) == 0 and ((1 << _la) & 88717423313408) != 0) or ( + (((_la - 70)) & ~0x3f) == 0 and ((1 << (_la - 70)) & 1941606236449) != 0): + self.state = 1569 localctx._rule_BlockDeclarativeItem = self.rule_BlockDeclarativeItem() localctx.declaredItems.append(localctx._rule_BlockDeclarativeItem) - self.state = 1534 + self.state = 1574 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 1535 + self.state = 1575 self.match(VHDLParser.KW_BEGIN) - self.state = 1541 + self.state = 1581 self._errHandler.sync(self) _la = self._input.LA(1) - while ((((_la - 14)) & ~0x3f) == 0 and ((1 << (_la - 14)) & ( - (1 << (VHDLParser.KW_ASSERT - 14)) | (1 << (VHDLParser.KW_POSTPONED - 14)) | ( - 1 << (VHDLParser.KW_PROCESS - 14)))) != 0) or ((((_la - 116)) & ~0x3f) == 0 and ((1 << (_la - 116)) & ( - (1 << (VHDLParser.KW_WITH - 116)) | (1 << (VHDLParser.TOK_LP - 116)) | (1 << (VHDLParser.TOK_DLA - 116)) | ( - 1 << (VHDLParser.LIT_CHARACTER - 116)) | (1 << (VHDLParser.LIT_STRING - 116)) | ( - 1 << (VHDLParser.LIT_IDENTIFIER - 116)))) != 0): - self.state = 1538 - localctx._rule_ArchitectureStatement = self.rule_ArchitectureStatement() - localctx.statements.append(localctx._rule_ArchitectureStatement) - self.state = 1543 + while ((((_la - 14)) & ~0x3f) == 0 and ((1 << (_la - 14)) & 5188146770730811393) != 0) or ( + (((_la - 116)) & ~0x3f) == 0 and ((1 << (_la - 116)) & 246292886323201) != 0): + self.state = 1578 + localctx._rule_ConcurrentStatement = self.rule_ConcurrentStatement() + localctx.statements.append(localctx._rule_ConcurrentStatement) + self.state = 1583 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 1544 - self.match(VHDLParser.KW_END) - self.state = 1545 - self.match(VHDLParser.KW_GENERATE) - self.state = 1547 + self.state = 1589 self._errHandler.sync(self) - _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: - self.state = 1546 - localctx.label = self.match(VHDLParser.LIT_IDENTIFIER) + la_ = self._interp.adaptivePredict(self._input, 153, self._ctx) + if la_ == 1: + self.state = 1584 + self.match(VHDLParser.KW_END) + self.state = 1586 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la == 163: + self.state = 1585 + localctx.label = self.match(VHDLParser.LIT_IDENTIFIER) + + self.state = 1588 + self.match(VHDLParser.TOK_SEMICOL) + - self.state = 1549 - self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re self._errHandler.reportError(self, re) @@ -10007,33 +10098,41 @@ def accept(self, visitor: ParseTreeVisitor): def rule_GenericClause(self): localctx = VHDLParser.Rule_GenericClauseContext(self, self._ctx, self.state) - self.enterRule(localctx, 232, self.RULE_rule_GenericClause) + self.enterRule(localctx, 230, self.RULE_rule_GenericClause) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1551 + self.state = 1591 self.match(VHDLParser.KW_GENERIC) - self.state = 1552 + self.state = 1592 self.match(VHDLParser.TOK_LP) - self.state = 1553 + self.state = 1593 localctx._rule_InterfaceElement = self.rule_InterfaceElement() localctx.elements.append(localctx._rule_InterfaceElement) - self.state = 1558 + self.state = 1598 + self._errHandler.sync(self) + _alt = self._interp.adaptivePredict(self._input, 154, self._ctx) + while _alt != 2 and _alt != ATN.INVALID_ALT_NUMBER: + if _alt == 1: + self.state = 1594 + self.match(VHDLParser.TOK_SEMICOL) + self.state = 1595 + localctx._rule_InterfaceElement = self.rule_InterfaceElement() + localctx.elements.append(localctx._rule_InterfaceElement) + self.state = 1600 + self._errHandler.sync(self) + _alt = self._interp.adaptivePredict(self._input, 154, self._ctx) + + self.state = 1602 self._errHandler.sync(self) _la = self._input.LA(1) - while _la == VHDLParser.TOK_SEMICOL: - self.state = 1554 + if _la == 150: + self.state = 1601 self.match(VHDLParser.TOK_SEMICOL) - self.state = 1555 - localctx._rule_InterfaceElement = self.rule_InterfaceElement() - localctx.elements.append(localctx._rule_InterfaceElement) - self.state = 1560 - self._errHandler.sync(self) - _la = self._input.LA(1) - self.state = 1561 + self.state = 1604 self.match(VHDLParser.TOK_RP) - self.state = 1562 + self.state = 1605 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -10078,19 +10177,259 @@ def accept(self, visitor: ParseTreeVisitor): def rule_GenericMapAspect(self): localctx = VHDLParser.Rule_GenericMapAspectContext(self, self._ctx, self.state) - self.enterRule(localctx, 234, self.RULE_rule_GenericMapAspect) + self.enterRule(localctx, 232, self.RULE_rule_GenericMapAspect) try: self.enterOuterAlt(localctx, 1) - self.state = 1564 + self.state = 1607 self.match(VHDLParser.KW_GENERIC) - self.state = 1565 + self.state = 1608 self.match(VHDLParser.KW_MAP) - self.state = 1566 + self.state = 1609 self.match(VHDLParser.TOK_LP) - self.state = 1567 + self.state = 1610 localctx.associationList = self.rule_AssociationList() - self.state = 1568 + self.state = 1611 + self.match(VHDLParser.TOK_RP) + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + class Rule_GroupConstituentContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent: ParserRuleContext = None, invokingState: int = -1): + super().__init__(parent, invokingState) + self.parser = parser + + def rule_Name(self): + return self.getTypedRuleContext(VHDLParser.Rule_NameContext, 0) + + def LIT_CHARACTER(self): + return self.getToken(VHDLParser.LIT_CHARACTER, 0) + + def getRuleIndex(self): + return VHDLParser.RULE_rule_GroupConstituent + + def accept(self, visitor: ParseTreeVisitor): + if hasattr(visitor, "visitRule_GroupConstituent"): + return visitor.visitRule_GroupConstituent(self) + else: + return visitor.visitChildren(self) + + def rule_GroupConstituent(self): + + localctx = VHDLParser.Rule_GroupConstituentContext(self, self._ctx, self.state) + self.enterRule(localctx, 234, self.RULE_rule_GroupConstituent) + try: + self.state = 1615 + self._errHandler.sync(self) + la_ = self._interp.adaptivePredict(self._input, 156, self._ctx) + if la_ == 1: + self.enterOuterAlt(localctx, 1) + self.state = 1613 + self.rule_Name(0) + pass + + elif la_ == 2: + self.enterOuterAlt(localctx, 2) + self.state = 1614 + self.match(VHDLParser.LIT_CHARACTER) + pass + + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + class Rule_GroupDeclarationContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent: ParserRuleContext = None, invokingState: int = -1): + super().__init__(parent, invokingState) + self.parser = parser + self.name = None # Token + self._rule_GroupConstituent = None # Rule_GroupConstituentContext + self.constituents = list() # of Rule_GroupConstituentContexts + + def KW_GROUP(self): + return self.getToken(VHDLParser.KW_GROUP, 0) + + def TOK_COLON(self): + return self.getToken(VHDLParser.TOK_COLON, 0) + + def rule_Name(self): + return self.getTypedRuleContext(VHDLParser.Rule_NameContext, 0) + + def TOK_LP(self): + return self.getToken(VHDLParser.TOK_LP, 0) + + def TOK_RP(self): + return self.getToken(VHDLParser.TOK_RP, 0) + + def TOK_SEMICOL(self): + return self.getToken(VHDLParser.TOK_SEMICOL, 0) + + def LIT_IDENTIFIER(self): + return self.getToken(VHDLParser.LIT_IDENTIFIER, 0) + + def rule_GroupConstituent(self, i: int = None): + if i is None: + return self.getTypedRuleContexts(VHDLParser.Rule_GroupConstituentContext) + else: + return self.getTypedRuleContext(VHDLParser.Rule_GroupConstituentContext, i) + + def TOK_COMMA(self, i: int = None): + if i is None: + return self.getTokens(VHDLParser.TOK_COMMA) + else: + return self.getToken(VHDLParser.TOK_COMMA, i) + + def getRuleIndex(self): + return VHDLParser.RULE_rule_GroupDeclaration + + def accept(self, visitor: ParseTreeVisitor): + if hasattr(visitor, "visitRule_GroupDeclaration"): + return visitor.visitRule_GroupDeclaration(self) + else: + return visitor.visitChildren(self) + + def rule_GroupDeclaration(self): + + localctx = VHDLParser.Rule_GroupDeclarationContext(self, self._ctx, self.state) + self.enterRule(localctx, 236, self.RULE_rule_GroupDeclaration) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 1617 + self.match(VHDLParser.KW_GROUP) + self.state = 1618 + localctx.name = self.match(VHDLParser.LIT_IDENTIFIER) + self.state = 1619 + self.match(VHDLParser.TOK_COLON) + self.state = 1620 + self.rule_Name(0) + self.state = 1621 + self.match(VHDLParser.TOK_LP) + self.state = 1622 + localctx._rule_GroupConstituent = self.rule_GroupConstituent() + localctx.constituents.append(localctx._rule_GroupConstituent) + self.state = 1627 + self._errHandler.sync(self) + _la = self._input.LA(1) + while _la == 151: + self.state = 1623 + self.match(VHDLParser.TOK_COMMA) + self.state = 1624 + localctx._rule_GroupConstituent = self.rule_GroupConstituent() + localctx.constituents.append(localctx._rule_GroupConstituent) + self.state = 1629 + self._errHandler.sync(self) + _la = self._input.LA(1) + + self.state = 1630 + self.match(VHDLParser.TOK_RP) + self.state = 1631 + self.match(VHDLParser.TOK_SEMICOL) + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + class Rule_GroupTemplateDeclarationContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent: ParserRuleContext = None, invokingState: int = -1): + super().__init__(parent, invokingState) + self.parser = parser + self.name = None # Token + self._rule_EntityClassEntry = None # Rule_EntityClassEntryContext + self.entityClasses = list() # of Rule_EntityClassEntryContexts + + def KW_GROUP(self): + return self.getToken(VHDLParser.KW_GROUP, 0) + + def KW_IS(self): + return self.getToken(VHDLParser.KW_IS, 0) + + def TOK_LP(self): + return self.getToken(VHDLParser.TOK_LP, 0) + + def TOK_RP(self): + return self.getToken(VHDLParser.TOK_RP, 0) + + def TOK_SEMICOL(self): + return self.getToken(VHDLParser.TOK_SEMICOL, 0) + + def LIT_IDENTIFIER(self): + return self.getToken(VHDLParser.LIT_IDENTIFIER, 0) + + def rule_EntityClassEntry(self, i: int = None): + if i is None: + return self.getTypedRuleContexts(VHDLParser.Rule_EntityClassEntryContext) + else: + return self.getTypedRuleContext(VHDLParser.Rule_EntityClassEntryContext, i) + + def TOK_COMMA(self, i: int = None): + if i is None: + return self.getTokens(VHDLParser.TOK_COMMA) + else: + return self.getToken(VHDLParser.TOK_COMMA, i) + + def getRuleIndex(self): + return VHDLParser.RULE_rule_GroupTemplateDeclaration + + def accept(self, visitor: ParseTreeVisitor): + if hasattr(visitor, "visitRule_GroupTemplateDeclaration"): + return visitor.visitRule_GroupTemplateDeclaration(self) + else: + return visitor.visitChildren(self) + + def rule_GroupTemplateDeclaration(self): + + localctx = VHDLParser.Rule_GroupTemplateDeclarationContext(self, self._ctx, self.state) + self.enterRule(localctx, 238, self.RULE_rule_GroupTemplateDeclaration) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 1633 + self.match(VHDLParser.KW_GROUP) + self.state = 1634 + localctx.name = self.match(VHDLParser.LIT_IDENTIFIER) + self.state = 1635 + self.match(VHDLParser.KW_IS) + self.state = 1636 + self.match(VHDLParser.TOK_LP) + self.state = 1637 + localctx._rule_EntityClassEntry = self.rule_EntityClassEntry() + localctx.entityClasses.append(localctx._rule_EntityClassEntry) + self.state = 1642 + self._errHandler.sync(self) + _la = self._input.LA(1) + while _la == 151: + self.state = 1638 + self.match(VHDLParser.TOK_COMMA) + self.state = 1639 + localctx._rule_EntityClassEntry = self.rule_EntityClassEntry() + localctx.entityClasses.append(localctx._rule_EntityClassEntry) + self.state = 1644 + self._errHandler.sync(self) + _la = self._input.LA(1) + + self.state = 1645 self.match(VHDLParser.TOK_RP) + self.state = 1646 + self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re self._errHandler.reportError(self, re) @@ -10112,8 +10451,8 @@ def rule_SignalList(self): def TOK_COLON(self): return self.getToken(VHDLParser.TOK_COLON, 0) - def rule_TypeMark(self): - return self.getTypedRuleContext(VHDLParser.Rule_TypeMarkContext, 0) + def rule_Name(self): + return self.getTypedRuleContext(VHDLParser.Rule_NameContext, 0) def getRuleIndex(self): return VHDLParser.RULE_rule_GuardedSignalSpecification @@ -10127,15 +10466,15 @@ def accept(self, visitor: ParseTreeVisitor): def rule_GuardedSignalSpecification(self): localctx = VHDLParser.Rule_GuardedSignalSpecificationContext(self, self._ctx, self.state) - self.enterRule(localctx, 236, self.RULE_rule_GuardedSignalSpecification) + self.enterRule(localctx, 240, self.RULE_rule_GuardedSignalSpecification) try: self.enterOuterAlt(localctx, 1) - self.state = 1570 + self.state = 1648 self.rule_SignalList() - self.state = 1571 + self.state = 1649 self.match(VHDLParser.TOK_COLON) - self.state = 1572 - self.rule_TypeMark() + self.state = 1650 + self.rule_Name(0) except RecognitionException as re: localctx.exception = re self._errHandler.reportError(self, re) @@ -10177,23 +10516,23 @@ def accept(self, visitor: ParseTreeVisitor): def rule_IdentifierList(self): localctx = VHDLParser.Rule_IdentifierListContext(self, self._ctx, self.state) - self.enterRule(localctx, 238, self.RULE_rule_IdentifierList) + self.enterRule(localctx, 242, self.RULE_rule_IdentifierList) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1574 + self.state = 1652 localctx._LIT_IDENTIFIER = self.match(VHDLParser.LIT_IDENTIFIER) localctx.identifiers.append(localctx._LIT_IDENTIFIER) - self.state = 1579 + self.state = 1657 self._errHandler.sync(self) _la = self._input.LA(1) - while _la == VHDLParser.TOK_COMMA: - self.state = 1575 + while _la == 151: + self.state = 1653 self.match(VHDLParser.TOK_COMMA) - self.state = 1576 + self.state = 1654 localctx._LIT_IDENTIFIER = self.match(VHDLParser.LIT_IDENTIFIER) localctx.identifiers.append(localctx._LIT_IDENTIFIER) - self.state = 1581 + self.state = 1659 self._errHandler.sync(self) _la = self._input.LA(1) @@ -10214,11 +10553,15 @@ def __init__(self, parser, parent: ParserRuleContext = None, invokingState: int self.label = None # Token self.ifAlternativeLabel = None # Token self.ifCondition = None # Rule_ExpressionContext + self.ifBody = None # Rule_GenerateStatementBodyContext self._LIT_IDENTIFIER = None # Token self.elsifAlternativeLabel = list() # of Tokens self._rule_Expression = None # Rule_ExpressionContext self.elsifCondition = list() # of Rule_ExpressionContexts + self._rule_GenerateStatementBody = None # Rule_GenerateStatementBodyContext + self.elsifBody = list() # of Rule_GenerateStatementBodyContexts self.elseAlternativeLabel = list() # of Tokens + self.elseBody = None # Rule_GenerateStatementBodyContext self.label2 = None # Token def TOK_COLON(self, i: int = None): @@ -10236,12 +10579,6 @@ def KW_GENERATE(self, i: int = None): else: return self.getToken(VHDLParser.KW_GENERATE, i) - def rule_GenerateStatementBody(self, i: int = None): - if i is None: - return self.getTypedRuleContexts(VHDLParser.Rule_GenerateStatementBodyContext) - else: - return self.getTypedRuleContext(VHDLParser.Rule_GenerateStatementBodyContext, i) - def KW_END(self): return self.getToken(VHDLParser.KW_END, 0) @@ -10260,6 +10597,12 @@ def rule_Expression(self, i: int = None): else: return self.getTypedRuleContext(VHDLParser.Rule_ExpressionContext, i) + def rule_GenerateStatementBody(self, i: int = None): + if i is None: + return self.getTypedRuleContexts(VHDLParser.Rule_GenerateStatementBodyContext) + else: + return self.getTypedRuleContext(VHDLParser.Rule_GenerateStatementBodyContext, i) + def KW_ELSIF(self, i: int = None): if i is None: return self.getTokens(VHDLParser.KW_ELSIF) @@ -10281,91 +10624,92 @@ def accept(self, visitor: ParseTreeVisitor): def rule_IfGenerateStatement(self): localctx = VHDLParser.Rule_IfGenerateStatementContext(self, self._ctx, self.state) - self.enterRule(localctx, 240, self.RULE_rule_IfGenerateStatement) + self.enterRule(localctx, 244, self.RULE_rule_IfGenerateStatement) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1582 + self.state = 1660 localctx.label = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 1583 + self.state = 1661 self.match(VHDLParser.TOK_COLON) - self.state = 1584 + self.state = 1662 self.match(VHDLParser.KW_IF) - self.state = 1587 + self.state = 1665 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 147, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 160, self._ctx) if la_ == 1: - self.state = 1585 + self.state = 1663 localctx.ifAlternativeLabel = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 1586 + self.state = 1664 self.match(VHDLParser.TOK_COLON) - self.state = 1589 + self.state = 1667 localctx.ifCondition = self.rule_Expression(0) - self.state = 1590 + self.state = 1668 self.match(VHDLParser.KW_GENERATE) - self.state = 1591 - self.rule_GenerateStatementBody() - self.state = 1603 + self.state = 1669 + localctx.ifBody = self.rule_GenerateStatementBody() + self.state = 1681 self._errHandler.sync(self) _la = self._input.LA(1) - while _la == VHDLParser.KW_ELSIF: - self.state = 1592 + while _la == 32: + self.state = 1670 self.match(VHDLParser.KW_ELSIF) - self.state = 1595 + self.state = 1673 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 148, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 161, self._ctx) if la_ == 1: - self.state = 1593 + self.state = 1671 localctx._LIT_IDENTIFIER = self.match(VHDLParser.LIT_IDENTIFIER) localctx.elsifAlternativeLabel.append(localctx._LIT_IDENTIFIER) - self.state = 1594 + self.state = 1672 self.match(VHDLParser.TOK_COLON) - self.state = 1597 + self.state = 1675 localctx._rule_Expression = self.rule_Expression(0) localctx.elsifCondition.append(localctx._rule_Expression) - self.state = 1598 + self.state = 1676 self.match(VHDLParser.KW_GENERATE) - self.state = 1599 - self.rule_GenerateStatementBody() - self.state = 1605 + self.state = 1677 + localctx._rule_GenerateStatementBody = self.rule_GenerateStatementBody() + localctx.elsifBody.append(localctx._rule_GenerateStatementBody) + self.state = 1683 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 1613 + self.state = 1691 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_ELSE: - self.state = 1606 + if _la == 31: + self.state = 1684 self.match(VHDLParser.KW_ELSE) - self.state = 1609 + self.state = 1687 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: - self.state = 1607 + if _la == 163: + self.state = 1685 localctx._LIT_IDENTIFIER = self.match(VHDLParser.LIT_IDENTIFIER) localctx.elseAlternativeLabel.append(localctx._LIT_IDENTIFIER) - self.state = 1608 + self.state = 1686 self.match(VHDLParser.TOK_COLON) - self.state = 1611 + self.state = 1689 self.match(VHDLParser.KW_GENERATE) - self.state = 1612 - self.rule_GenerateStatementBody() + self.state = 1690 + localctx.elseBody = self.rule_GenerateStatementBody() - self.state = 1615 + self.state = 1693 self.match(VHDLParser.KW_END) - self.state = 1616 + self.state = 1694 self.match(VHDLParser.KW_GENERATE) - self.state = 1618 + self.state = 1696 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: - self.state = 1617 + if _la == 163: + self.state = 1695 localctx.label2 = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 1620 + self.state = 1698 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -10449,117 +10793,96 @@ def accept(self, visitor: ParseTreeVisitor): def rule_IfStatement(self): localctx = VHDLParser.Rule_IfStatementContext(self, self._ctx, self.state) - self.enterRule(localctx, 242, self.RULE_rule_IfStatement) + self.enterRule(localctx, 246, self.RULE_rule_IfStatement) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1624 + self.state = 1702 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: - self.state = 1622 + if _la == 163: + self.state = 1700 localctx.label = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 1623 + self.state = 1701 self.match(VHDLParser.TOK_COLON) - self.state = 1626 + self.state = 1704 self.match(VHDLParser.KW_IF) - self.state = 1627 + self.state = 1705 localctx.condition = self.rule_Expression(0) - self.state = 1628 + self.state = 1706 self.match(VHDLParser.KW_THEN) - self.state = 1632 + self.state = 1710 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ( - (1 << VHDLParser.KW_ASSERT) | (1 << VHDLParser.KW_BLOCK) | (1 << VHDLParser.KW_CASE) | ( - 1 << VHDLParser.KW_EXIT) | (1 << VHDLParser.KW_FOR) | (1 << VHDLParser.KW_IF) | (1 << VHDLParser.KW_LOOP) | ( - 1 << VHDLParser.KW_NEXT) | (1 << VHDLParser.KW_NULL))) != 0) or ((((_la - 85)) & ~0x3f) == 0 and ( - (1 << (_la - 85)) & ( - (1 << (VHDLParser.KW_REPORT - 85)) | (1 << (VHDLParser.KW_RETURN - 85)) | (1 << (VHDLParser.KW_WAIT - 85)) | ( - 1 << (VHDLParser.KW_WITH - 85)) | (1 << (VHDLParser.KW_WHILE - 85)) | (1 << (VHDLParser.TOK_LP - 85)) | ( - 1 << (VHDLParser.TOK_DLA - 85)))) != 0) or ((((_la - 162)) & ~0x3f) == 0 and ((1 << (_la - 162)) & ( - (1 << (VHDLParser.LIT_CHARACTER - 162)) | (1 << (VHDLParser.LIT_STRING - 162)) | ( - 1 << (VHDLParser.LIT_IDENTIFIER - 162)))) != 0): - self.state = 1629 + while (((_la) & ~0x3f) == 0 and ((1 << _la) & -8052400777563193344) != 0) or ( + (((_la - 85)) & ~0x3f) == 0 and ((1 << (_la - 85)) & 4899916406390259715) != 0) or ( + (((_la - 161)) & ~0x3f) == 0 and ((1 << (_la - 161)) & 7) != 0): + self.state = 1707 localctx._rule_SequentialStatement = self.rule_SequentialStatement() localctx.thenStatements.append(localctx._rule_SequentialStatement) - self.state = 1634 + self.state = 1712 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 1646 + self.state = 1724 self._errHandler.sync(self) _la = self._input.LA(1) - while _la == VHDLParser.KW_ELSIF: - self.state = 1635 + while _la == 32: + self.state = 1713 self.match(VHDLParser.KW_ELSIF) - self.state = 1636 + self.state = 1714 localctx.condition = self.rule_Expression(0) - self.state = 1637 + self.state = 1715 self.match(VHDLParser.KW_THEN) - self.state = 1641 + self.state = 1719 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ( - (1 << VHDLParser.KW_ASSERT) | (1 << VHDLParser.KW_BLOCK) | (1 << VHDLParser.KW_CASE) | ( - 1 << VHDLParser.KW_EXIT) | (1 << VHDLParser.KW_FOR) | (1 << VHDLParser.KW_IF) | (1 << VHDLParser.KW_LOOP) | ( - 1 << VHDLParser.KW_NEXT) | (1 << VHDLParser.KW_NULL))) != 0) or ((((_la - 85)) & ~0x3f) == 0 and ( - (1 << (_la - 85)) & ( - (1 << (VHDLParser.KW_REPORT - 85)) | (1 << (VHDLParser.KW_RETURN - 85)) | (1 << (VHDLParser.KW_WAIT - 85)) | ( - 1 << (VHDLParser.KW_WITH - 85)) | (1 << (VHDLParser.KW_WHILE - 85)) | (1 << (VHDLParser.TOK_LP - 85)) | ( - 1 << (VHDLParser.TOK_DLA - 85)))) != 0) or ((((_la - 162)) & ~0x3f) == 0 and ((1 << (_la - 162)) & ( - (1 << (VHDLParser.LIT_CHARACTER - 162)) | (1 << (VHDLParser.LIT_STRING - 162)) | ( - 1 << (VHDLParser.LIT_IDENTIFIER - 162)))) != 0): - self.state = 1638 + while (((_la) & ~0x3f) == 0 and ((1 << _la) & -8052400777563193344) != 0) or ( + (((_la - 85)) & ~0x3f) == 0 and ((1 << (_la - 85)) & 4899916406390259715) != 0) or ( + (((_la - 161)) & ~0x3f) == 0 and ((1 << (_la - 161)) & 7) != 0): + self.state = 1716 localctx._rule_SequentialStatement = self.rule_SequentialStatement() localctx.elseifStatements.append(localctx._rule_SequentialStatement) - self.state = 1643 + self.state = 1721 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 1648 + self.state = 1726 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 1656 + self.state = 1734 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_ELSE: - self.state = 1649 + if _la == 31: + self.state = 1727 self.match(VHDLParser.KW_ELSE) - self.state = 1653 + self.state = 1731 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ( - (1 << VHDLParser.KW_ASSERT) | (1 << VHDLParser.KW_BLOCK) | (1 << VHDLParser.KW_CASE) | ( - 1 << VHDLParser.KW_EXIT) | (1 << VHDLParser.KW_FOR) | (1 << VHDLParser.KW_IF) | (1 << VHDLParser.KW_LOOP) | ( - 1 << VHDLParser.KW_NEXT) | (1 << VHDLParser.KW_NULL))) != 0) or ((((_la - 85)) & ~0x3f) == 0 and ( - (1 << (_la - 85)) & ( - (1 << (VHDLParser.KW_REPORT - 85)) | (1 << (VHDLParser.KW_RETURN - 85)) | (1 << (VHDLParser.KW_WAIT - 85)) | ( - 1 << (VHDLParser.KW_WITH - 85)) | (1 << (VHDLParser.KW_WHILE - 85)) | (1 << (VHDLParser.TOK_LP - 85)) | ( - 1 << (VHDLParser.TOK_DLA - 85)))) != 0) or ((((_la - 162)) & ~0x3f) == 0 and ((1 << (_la - 162)) & ( - (1 << (VHDLParser.LIT_CHARACTER - 162)) | (1 << (VHDLParser.LIT_STRING - 162)) | ( - 1 << (VHDLParser.LIT_IDENTIFIER - 162)))) != 0): - self.state = 1650 + while (((_la) & ~0x3f) == 0 and ((1 << _la) & -8052400777563193344) != 0) or ( + (((_la - 85)) & ~0x3f) == 0 and ((1 << (_la - 85)) & 4899916406390259715) != 0) or ( + (((_la - 161)) & ~0x3f) == 0 and ((1 << (_la - 161)) & 7) != 0): + self.state = 1728 localctx._rule_SequentialStatement = self.rule_SequentialStatement() localctx.elseStatements.append(localctx._rule_SequentialStatement) - self.state = 1655 + self.state = 1733 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 1658 + self.state = 1736 self.match(VHDLParser.KW_END) - self.state = 1659 + self.state = 1737 self.match(VHDLParser.KW_IF) - self.state = 1661 + self.state = 1739 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: - self.state = 1660 + if _la == 163: + self.state = 1738 localctx.label2 = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 1663 + self.state = 1741 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -10594,20 +10917,19 @@ def accept(self, visitor: ParseTreeVisitor): def rule_IncompleteSubtypeIndication(self): localctx = VHDLParser.Rule_IncompleteSubtypeIndicationContext(self, self._ctx, self.state) - self.enterRule(localctx, 244, self.RULE_rule_IncompleteSubtypeIndication) + self.enterRule(localctx, 248, self.RULE_rule_IncompleteSubtypeIndication) try: - self.state = 1667 + self.state = 1745 self._errHandler.sync(self) token = self._input.LA(1) - if token in [VHDLParser.TOK_LP, VHDLParser.TOK_DLA, VHDLParser.LIT_CHARACTER, VHDLParser.LIT_STRING, - VHDLParser.LIT_IDENTIFIER]: + if token in [143, 147, 161, 162, 163]: self.enterOuterAlt(localctx, 1) - self.state = 1665 + self.state = 1743 self.rule_SubtypeIndication() pass - elif token in [VHDLParser.KW_TYPE]: + elif token in [104]: self.enterOuterAlt(localctx, 2) - self.state = 1666 + self.state = 1744 self.rule_UnspecifiedTypeIndication() pass else: @@ -10650,14 +10972,14 @@ def accept(self, visitor: ParseTreeVisitor): def rule_IncompleteTypeDeclaration(self): localctx = VHDLParser.Rule_IncompleteTypeDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 246, self.RULE_rule_IncompleteTypeDeclaration) + self.enterRule(localctx, 250, self.RULE_rule_IncompleteTypeDeclaration) try: self.enterOuterAlt(localctx, 1) - self.state = 1669 + self.state = 1747 self.match(VHDLParser.KW_TYPE) - self.state = 1670 + self.state = 1748 localctx.name = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 1671 + self.state = 1749 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -10713,62 +11035,62 @@ def accept(self, visitor: ParseTreeVisitor): def rule_IncompleteTypeDefinition(self): localctx = VHDLParser.Rule_IncompleteTypeDefinitionContext(self, self._ctx, self.state) - self.enterRule(localctx, 248, self.RULE_rule_IncompleteTypeDefinition) + self.enterRule(localctx, 252, self.RULE_rule_IncompleteTypeDefinition) try: - self.state = 1682 + self.state = 1760 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 161, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 174, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 1673 + self.state = 1751 self.rule_PrivateIncompleteTypeDefinition() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 1674 + self.state = 1752 self.rule_ScalarIncompleteTypeDefinition() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 1675 + self.state = 1753 self.rule_DiscreteIncompleteTypeDefinition() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 1676 + self.state = 1754 self.rule_IntegerIncompleteTypeDefinition() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) - self.state = 1677 + self.state = 1755 self.rule_PhysicalIncompleteTypeDefinition() pass elif la_ == 6: self.enterOuterAlt(localctx, 6) - self.state = 1678 + self.state = 1756 self.rule_FloatingIncompleteTypeDefinition() pass elif la_ == 7: self.enterOuterAlt(localctx, 7) - self.state = 1679 + self.state = 1757 self.rule_ArrayIncompleteTypeDefinition() pass elif la_ == 8: self.enterOuterAlt(localctx, 8) - self.state = 1680 + self.state = 1758 self.rule_AccessIncompleteTypeDefinition() pass elif la_ == 9: self.enterOuterAlt(localctx, 9) - self.state = 1681 + self.state = 1759 self.rule_FileIncompleteTypeDefinition() pass @@ -10788,8 +11110,8 @@ def __init__(self, parser, parent: ParserRuleContext = None, invokingState: int super().__init__(parent, invokingState) self.parser = parser - def rule_TypeMark(self): - return self.getTypedRuleContext(VHDLParser.Rule_TypeMarkContext, 0) + def rule_Name(self): + return self.getTypedRuleContext(VHDLParser.Rule_NameContext, 0) def rule_UnspecifiedTypeIndication(self): return self.getTypedRuleContext(VHDLParser.Rule_UnspecifiedTypeIndicationContext, 0) @@ -10806,19 +11128,19 @@ def accept(self, visitor: ParseTreeVisitor): def rule_IncompleteTypeMark(self): localctx = VHDLParser.Rule_IncompleteTypeMarkContext(self, self._ctx, self.state) - self.enterRule(localctx, 250, self.RULE_rule_IncompleteTypeMark) + self.enterRule(localctx, 254, self.RULE_rule_IncompleteTypeMark) try: - self.state = 1686 + self.state = 1764 self._errHandler.sync(self) token = self._input.LA(1) - if token in [VHDLParser.TOK_DLA, VHDLParser.LIT_CHARACTER, VHDLParser.LIT_STRING, VHDLParser.LIT_IDENTIFIER]: + if token in [147, 161, 162, 163]: self.enterOuterAlt(localctx, 1) - self.state = 1684 - self.rule_TypeMark() + self.state = 1762 + self.rule_Name(0) pass - elif token in [VHDLParser.KW_TYPE]: + elif token in [104]: self.enterOuterAlt(localctx, 2) - self.state = 1685 + self.state = 1763 self.rule_UnspecifiedTypeIndication() pass else: @@ -10871,29 +11193,29 @@ def accept(self, visitor: ParseTreeVisitor): def rule_IndexConstraint(self): localctx = VHDLParser.Rule_IndexConstraintContext(self, self._ctx, self.state) - self.enterRule(localctx, 252, self.RULE_rule_IndexConstraint) + self.enterRule(localctx, 256, self.RULE_rule_IndexConstraint) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1688 + self.state = 1766 self.match(VHDLParser.TOK_LP) - self.state = 1689 + self.state = 1767 localctx._rule_DiscreteRange = self.rule_DiscreteRange() localctx.ranges.append(localctx._rule_DiscreteRange) - self.state = 1694 + self.state = 1772 self._errHandler.sync(self) _la = self._input.LA(1) - while _la == VHDLParser.TOK_COMMA: - self.state = 1690 + while _la == 151: + self.state = 1768 self.match(VHDLParser.TOK_COMMA) - self.state = 1691 + self.state = 1769 localctx._rule_DiscreteRange = self.rule_DiscreteRange() localctx.ranges.append(localctx._rule_DiscreteRange) - self.state = 1696 + self.state = 1774 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 1697 + self.state = 1775 self.match(VHDLParser.TOK_RP) except RecognitionException as re: localctx.exception = re @@ -10909,7 +11231,7 @@ class Rule_IndexSubtypeDefinitionContext(ParserRuleContext): def __init__(self, parser, parent: ParserRuleContext = None, invokingState: int = -1): super().__init__(parent, invokingState) self.parser = parser - self.typeMark = None # Rule_TypeMarkContext + self.typeMark = None # Rule_NameContext def KW_RANGE(self): return self.getToken(VHDLParser.KW_RANGE, 0) @@ -10917,8 +11239,8 @@ def KW_RANGE(self): def TOK_BOX(self): return self.getToken(VHDLParser.TOK_BOX, 0) - def rule_TypeMark(self): - return self.getTypedRuleContext(VHDLParser.Rule_TypeMarkContext, 0) + def rule_Name(self): + return self.getTypedRuleContext(VHDLParser.Rule_NameContext, 0) def getRuleIndex(self): return VHDLParser.RULE_rule_IndexSubtypeDefinition @@ -10932,14 +11254,14 @@ def accept(self, visitor: ParseTreeVisitor): def rule_IndexSubtypeDefinition(self): localctx = VHDLParser.Rule_IndexSubtypeDefinitionContext(self, self._ctx, self.state) - self.enterRule(localctx, 254, self.RULE_rule_IndexSubtypeDefinition) + self.enterRule(localctx, 258, self.RULE_rule_IndexSubtypeDefinition) try: self.enterOuterAlt(localctx, 1) - self.state = 1699 - localctx.typeMark = self.rule_TypeMark() - self.state = 1700 + self.state = 1777 + localctx.typeMark = self.rule_Name(0) + self.state = 1778 self.match(VHDLParser.KW_RANGE) - self.state = 1701 + self.state = 1779 self.match(VHDLParser.TOK_BOX) except RecognitionException as re: localctx.exception = re @@ -10994,48 +11316,47 @@ def accept(self, visitor: ParseTreeVisitor): def rule_InstantiatedUnit(self): localctx = VHDLParser.Rule_InstantiatedUnitContext(self, self._ctx, self.state) - self.enterRule(localctx, 256, self.RULE_rule_InstantiatedUnit) + self.enterRule(localctx, 260, self.RULE_rule_InstantiatedUnit) self._la = 0 # Token type try: - self.state = 1716 + self.state = 1794 self._errHandler.sync(self) token = self._input.LA(1) - if token in [VHDLParser.KW_COMPONENT, VHDLParser.TOK_DLA, VHDLParser.LIT_CHARACTER, VHDLParser.LIT_STRING, - VHDLParser.LIT_IDENTIFIER]: + if token in [23, 147, 161, 162, 163]: self.enterOuterAlt(localctx, 1) - self.state = 1704 + self.state = 1782 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_COMPONENT: - self.state = 1703 + if _la == 23: + self.state = 1781 localctx.component = self.match(VHDLParser.KW_COMPONENT) - self.state = 1706 + self.state = 1784 localctx.componentName = self.rule_Name(0) pass - elif token in [VHDLParser.KW_ENTITY]: + elif token in [34]: self.enterOuterAlt(localctx, 2) - self.state = 1707 + self.state = 1785 self.match(VHDLParser.KW_ENTITY) - self.state = 1708 + self.state = 1786 localctx.entityName = self.rule_Name(0) - self.state = 1712 + self.state = 1790 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.TOK_LP: - self.state = 1709 + if _la == 143: + self.state = 1787 self.match(VHDLParser.TOK_LP) - self.state = 1710 + self.state = 1788 localctx.architectureName = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 1711 + self.state = 1789 self.match(VHDLParser.TOK_RP) pass - elif token in [VHDLParser.KW_CONFIGURATION]: + elif token in [24]: self.enterOuterAlt(localctx, 3) - self.state = 1714 + self.state = 1792 self.match(VHDLParser.KW_CONFIGURATION) - self.state = 1715 + self.state = 1793 localctx.configurationName = self.rule_Name(0) pass else: @@ -11090,39 +11411,39 @@ def accept(self, visitor: ParseTreeVisitor): def rule_InstantiationList(self): localctx = VHDLParser.Rule_InstantiationListContext(self, self._ctx, self.state) - self.enterRule(localctx, 258, self.RULE_rule_InstantiationList) + self.enterRule(localctx, 262, self.RULE_rule_InstantiationList) self._la = 0 # Token type try: - self.state = 1728 + self.state = 1806 self._errHandler.sync(self) token = self._input.LA(1) - if token in [VHDLParser.LIT_IDENTIFIER]: + if token in [163]: self.enterOuterAlt(localctx, 1) - self.state = 1718 + self.state = 1796 localctx._LIT_IDENTIFIER = self.match(VHDLParser.LIT_IDENTIFIER) localctx.componentNames.append(localctx._LIT_IDENTIFIER) - self.state = 1723 + self.state = 1801 self._errHandler.sync(self) _la = self._input.LA(1) - while _la == VHDLParser.TOK_COMMA: - self.state = 1719 + while _la == 151: + self.state = 1797 self.match(VHDLParser.TOK_COMMA) - self.state = 1720 + self.state = 1798 localctx._LIT_IDENTIFIER = self.match(VHDLParser.LIT_IDENTIFIER) localctx.componentNames.append(localctx._LIT_IDENTIFIER) - self.state = 1725 + self.state = 1803 self._errHandler.sync(self) _la = self._input.LA(1) pass - elif token in [VHDLParser.KW_OTHERS]: + elif token in [68]: self.enterOuterAlt(localctx, 2) - self.state = 1726 + self.state = 1804 localctx.others = self.match(VHDLParser.KW_OTHERS) pass - elif token in [VHDLParser.KW_ALL]: + elif token in [10]: self.enterOuterAlt(localctx, 3) - self.state = 1727 + self.state = 1805 localctx.all_ = self.match(VHDLParser.KW_ALL) pass else: @@ -11161,12 +11482,12 @@ def accept(self, visitor: ParseTreeVisitor): def rule_IntegerIncompleteTypeDefinition(self): localctx = VHDLParser.Rule_IntegerIncompleteTypeDefinitionContext(self, self._ctx, self.state) - self.enterRule(localctx, 260, self.RULE_rule_IntegerIncompleteTypeDefinition) + self.enterRule(localctx, 264, self.RULE_rule_IntegerIncompleteTypeDefinition) try: self.enterOuterAlt(localctx, 1) - self.state = 1730 + self.state = 1808 self.match(VHDLParser.KW_RANGE) - self.state = 1731 + self.state = 1809 self.match(VHDLParser.TOK_BOX) except RecognitionException as re: localctx.exception = re @@ -11198,10 +11519,10 @@ def accept(self, visitor: ParseTreeVisitor): def rule_IntegerTypeDefinition(self): localctx = VHDLParser.Rule_IntegerTypeDefinitionContext(self, self._ctx, self.state) - self.enterRule(localctx, 262, self.RULE_rule_IntegerTypeDefinition) + self.enterRule(localctx, 266, self.RULE_rule_IntegerTypeDefinition) try: self.enterOuterAlt(localctx, 1) - self.state = 1733 + self.state = 1811 self.rule_RangeConstraint() except RecognitionException as re: localctx.exception = re @@ -11255,37 +11576,37 @@ def accept(self, visitor: ParseTreeVisitor): def rule_InterfaceConstantDeclaration(self): localctx = VHDLParser.Rule_InterfaceConstantDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 264, self.RULE_rule_InterfaceConstantDeclaration) + self.enterRule(localctx, 268, self.RULE_rule_InterfaceConstantDeclaration) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1736 + self.state = 1814 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_CONSTANT: - self.state = 1735 + if _la == 25: + self.state = 1813 self.match(VHDLParser.KW_CONSTANT) - self.state = 1738 + self.state = 1816 localctx.constantNames = self.rule_IdentifierList() - self.state = 1739 + self.state = 1817 self.match(VHDLParser.TOK_COLON) - self.state = 1741 + self.state = 1819 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_IN: - self.state = 1740 + if _la == 47: + self.state = 1818 localctx.modeName = self.match(VHDLParser.KW_IN) - self.state = 1743 + self.state = 1821 localctx.subtypeIndication = self.rule_SubtypeIndication() - self.state = 1746 + self.state = 1824 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.TOK_VAR_ASSIGN: - self.state = 1744 + if _la == 141: + self.state = 1822 self.match(VHDLParser.TOK_VAR_ASSIGN) - self.state = 1745 + self.state = 1823 localctx.defaultValue = self.rule_Expression(0) @@ -11334,44 +11655,44 @@ def accept(self, visitor: ParseTreeVisitor): def rule_InterfaceDeclaration(self): localctx = VHDLParser.Rule_InterfaceDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 266, self.RULE_rule_InterfaceDeclaration) + self.enterRule(localctx, 270, self.RULE_rule_InterfaceDeclaration) try: - self.state = 1754 + self.state = 1832 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 172, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 185, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 1748 + self.state = 1826 self.rule_InterfaceConstantDeclaration() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 1749 + self.state = 1827 self.rule_InterfaceVariableDeclaration() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 1750 + self.state = 1828 self.rule_InterfaceFileDeclaration() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 1751 + self.state = 1829 self.rule_InterfaceTypeDeclaration() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) - self.state = 1752 + self.state = 1830 self.rule_InterfaceSubprogramDeclaration() pass elif la_ == 6: self.enterOuterAlt(localctx, 6) - self.state = 1753 + self.state = 1831 self.rule_InterfacePackageDeclaration() pass @@ -11406,10 +11727,10 @@ def accept(self, visitor: ParseTreeVisitor): def rule_InterfaceElement(self): localctx = VHDLParser.Rule_InterfaceElementContext(self, self._ctx, self.state) - self.enterRule(localctx, 268, self.RULE_rule_InterfaceElement) + self.enterRule(localctx, 272, self.RULE_rule_InterfaceElement) try: self.enterOuterAlt(localctx, 1) - self.state = 1756 + self.state = 1834 self.rule_InterfaceDeclaration() except RecognitionException as re: localctx.exception = re @@ -11452,16 +11773,16 @@ def accept(self, visitor: ParseTreeVisitor): def rule_InterfaceFileDeclaration(self): localctx = VHDLParser.Rule_InterfaceFileDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 270, self.RULE_rule_InterfaceFileDeclaration) + self.enterRule(localctx, 274, self.RULE_rule_InterfaceFileDeclaration) try: self.enterOuterAlt(localctx, 1) - self.state = 1758 + self.state = 1836 self.match(VHDLParser.KW_FILE) - self.state = 1759 + self.state = 1837 localctx.names = self.rule_IdentifierList() - self.state = 1760 + self.state = 1838 self.match(VHDLParser.TOK_COLON) - self.state = 1761 + self.state = 1839 localctx.subtypeIndication = self.rule_SubtypeIndication() except RecognitionException as re: localctx.exception = re @@ -11487,8 +11808,8 @@ def rule_Designator(self): def KW_RETURN(self): return self.getToken(VHDLParser.KW_RETURN, 0) - def rule_TypeMark(self): - return self.getTypedRuleContext(VHDLParser.Rule_TypeMarkContext, 0) + def rule_Name(self): + return self.getTypedRuleContext(VHDLParser.Rule_NameContext, 0) def TOK_LP(self): return self.getToken(VHDLParser.TOK_LP, 0) @@ -11520,48 +11841,48 @@ def accept(self, visitor: ParseTreeVisitor): def rule_InterfaceFunctionSpecification(self): localctx = VHDLParser.Rule_InterfaceFunctionSpecificationContext(self, self._ctx, self.state) - self.enterRule(localctx, 272, self.RULE_rule_InterfaceFunctionSpecification) + self.enterRule(localctx, 276, self.RULE_rule_InterfaceFunctionSpecification) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1764 + self.state = 1842 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_IMPURE or _la == VHDLParser.KW_PURE: - self.state = 1763 + if _la == 46 or _la == 78: + self.state = 1841 _la = self._input.LA(1) - if not (_la == VHDLParser.KW_IMPURE or _la == VHDLParser.KW_PURE): + if not (_la == 46 or _la == 78): self._errHandler.recoverInline(self) else: self._errHandler.reportMatch(self) self.consume() - self.state = 1766 + self.state = 1844 self.match(VHDLParser.KW_FUNCTION) - self.state = 1767 + self.state = 1845 self.rule_Designator() - self.state = 1775 + self.state = 1853 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_PARAMETER or _la == VHDLParser.TOK_LP: - self.state = 1769 + if _la == 71 or _la == 143: + self.state = 1847 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_PARAMETER: - self.state = 1768 + if _la == 71: + self.state = 1846 self.match(VHDLParser.KW_PARAMETER) - self.state = 1771 + self.state = 1849 self.match(VHDLParser.TOK_LP) - self.state = 1772 + self.state = 1850 self.rule_FormalParameterList() - self.state = 1773 + self.state = 1851 self.match(VHDLParser.TOK_RP) - self.state = 1777 + self.state = 1855 self.match(VHDLParser.KW_RETURN) - self.state = 1778 - self.rule_TypeMark() + self.state = 1856 + self.rule_Name(0) except RecognitionException as re: localctx.exception = re self._errHandler.reportError(self, re) @@ -11603,32 +11924,32 @@ def accept(self, visitor: ParseTreeVisitor): def rule_InterfaceList(self): localctx = VHDLParser.Rule_InterfaceListContext(self, self._ctx, self.state) - self.enterRule(localctx, 274, self.RULE_rule_InterfaceList) + self.enterRule(localctx, 278, self.RULE_rule_InterfaceList) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1780 + self.state = 1858 localctx._rule_InterfaceElement = self.rule_InterfaceElement() localctx.interfaceElements.append(localctx._rule_InterfaceElement) - self.state = 1785 + self.state = 1863 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input, 176, self._ctx) + _alt = self._interp.adaptivePredict(self._input, 189, self._ctx) while _alt != 2 and _alt != ATN.INVALID_ALT_NUMBER: if _alt == 1: - self.state = 1781 + self.state = 1859 self.match(VHDLParser.TOK_SEMICOL) - self.state = 1782 + self.state = 1860 localctx._rule_InterfaceElement = self.rule_InterfaceElement() localctx.interfaceElements.append(localctx._rule_InterfaceElement) - self.state = 1787 + self.state = 1865 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input, 176, self._ctx) + _alt = self._interp.adaptivePredict(self._input, 189, self._ctx) - self.state = 1789 + self.state = 1867 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.TOK_SEMICOL: - self.state = 1788 + if _la == 150: + self.state = 1866 self.match(VHDLParser.TOK_SEMICOL) @@ -11678,20 +11999,20 @@ def accept(self, visitor: ParseTreeVisitor): def rule_InterfacePackageDeclaration(self): localctx = VHDLParser.Rule_InterfacePackageDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 276, self.RULE_rule_InterfacePackageDeclaration) + self.enterRule(localctx, 280, self.RULE_rule_InterfacePackageDeclaration) try: self.enterOuterAlt(localctx, 1) - self.state = 1791 + self.state = 1869 self.match(VHDLParser.KW_PACKAGE) - self.state = 1792 + self.state = 1870 localctx.name = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 1793 + self.state = 1871 self.match(VHDLParser.KW_IS) - self.state = 1794 + self.state = 1872 self.match(VHDLParser.KW_NEW) - self.state = 1795 + self.state = 1873 self.rule_Name(0) - self.state = 1796 + self.state = 1874 self.rule_InterfacePackageGenericMapAspect() except RecognitionException as re: localctx.exception = re @@ -11741,34 +12062,34 @@ def accept(self, visitor: ParseTreeVisitor): def rule_InterfacePackageGenericMapAspect(self): localctx = VHDLParser.Rule_InterfacePackageGenericMapAspectContext(self, self._ctx, self.state) - self.enterRule(localctx, 278, self.RULE_rule_InterfacePackageGenericMapAspect) + self.enterRule(localctx, 282, self.RULE_rule_InterfacePackageGenericMapAspect) self._la = 0 # Token type try: - self.state = 1804 + self.state = 1882 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 178, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 191, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 1798 + self.state = 1876 self.rule_GenericMapAspect() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 1799 + self.state = 1877 self.match(VHDLParser.KW_GENERIC) - self.state = 1800 + self.state = 1878 self.match(VHDLParser.KW_MAP) - self.state = 1801 + self.state = 1879 self.match(VHDLParser.TOK_LP) - self.state = 1802 + self.state = 1880 _la = self._input.LA(1) - if not (_la == VHDLParser.KW_DEFAULT or _la == VHDLParser.TOK_BOX): + if not (_la == 28 or _la == 142): self._errHandler.recoverInline(self) else: self._errHandler.reportMatch(self) self.consume() - self.state = 1803 + self.state = 1881 self.match(VHDLParser.TOK_RP) pass @@ -11819,30 +12140,30 @@ def accept(self, visitor: ParseTreeVisitor): def rule_InterfaceProcedureSpecification(self): localctx = VHDLParser.Rule_InterfaceProcedureSpecificationContext(self, self._ctx, self.state) - self.enterRule(localctx, 280, self.RULE_rule_InterfaceProcedureSpecification) + self.enterRule(localctx, 284, self.RULE_rule_InterfaceProcedureSpecification) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1806 + self.state = 1884 self.match(VHDLParser.KW_PROCEDURE) - self.state = 1807 + self.state = 1885 localctx.name = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 1815 + self.state = 1893 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_PARAMETER or _la == VHDLParser.TOK_LP: - self.state = 1809 + if _la == 71 or _la == 143: + self.state = 1887 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_PARAMETER: - self.state = 1808 + if _la == 71: + self.state = 1886 self.match(VHDLParser.KW_PARAMETER) - self.state = 1811 + self.state = 1889 self.match(VHDLParser.TOK_LP) - self.state = 1812 + self.state = 1890 self.rule_FormalParameterList() - self.state = 1813 + self.state = 1891 self.match(VHDLParser.TOK_RP) @@ -11886,22 +12207,22 @@ def accept(self, visitor: ParseTreeVisitor): def rule_InterfaceSignalDeclaration(self): localctx = VHDLParser.Rule_InterfaceSignalDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 282, self.RULE_rule_InterfaceSignalDeclaration) + self.enterRule(localctx, 286, self.RULE_rule_InterfaceSignalDeclaration) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1818 + self.state = 1896 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_SIGNAL: - self.state = 1817 + if _la == 93: + self.state = 1895 self.match(VHDLParser.KW_SIGNAL) - self.state = 1820 + self.state = 1898 self.rule_IdentifierList() - self.state = 1821 + self.state = 1899 self.match(VHDLParser.TOK_COLON) - self.state = 1822 + self.state = 1900 localctx.modeName = self.rule_ModeIndication() except RecognitionException as re: localctx.exception = re @@ -11939,19 +12260,19 @@ def accept(self, visitor: ParseTreeVisitor): def rule_InterfaceSubprogramDeclaration(self): localctx = VHDLParser.Rule_InterfaceSubprogramDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 284, self.RULE_rule_InterfaceSubprogramDeclaration) + self.enterRule(localctx, 288, self.RULE_rule_InterfaceSubprogramDeclaration) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1824 + self.state = 1902 self.rule_InterfaceSubprogramSpecification() - self.state = 1827 + self.state = 1905 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_IS: - self.state = 1825 + if _la == 50: + self.state = 1903 self.match(VHDLParser.KW_IS) - self.state = 1826 + self.state = 1904 self.rule_InterfaceSubprogramDefault() @@ -11988,19 +12309,19 @@ def accept(self, visitor: ParseTreeVisitor): def rule_InterfaceSubprogramDefault(self): localctx = VHDLParser.Rule_InterfaceSubprogramDefaultContext(self, self._ctx, self.state) - self.enterRule(localctx, 286, self.RULE_rule_InterfaceSubprogramDefault) + self.enterRule(localctx, 290, self.RULE_rule_InterfaceSubprogramDefault) try: - self.state = 1831 + self.state = 1909 self._errHandler.sync(self) token = self._input.LA(1) - if token in [VHDLParser.TOK_DLA, VHDLParser.LIT_CHARACTER, VHDLParser.LIT_STRING, VHDLParser.LIT_IDENTIFIER]: + if token in [147, 161, 162, 163]: self.enterOuterAlt(localctx, 1) - self.state = 1829 + self.state = 1907 self.rule_Name(0) pass - elif token in [VHDLParser.TOK_BOX]: + elif token in [142]: self.enterOuterAlt(localctx, 2) - self.state = 1830 + self.state = 1908 self.match(VHDLParser.TOK_BOX) pass else: @@ -12039,19 +12360,19 @@ def accept(self, visitor: ParseTreeVisitor): def rule_InterfaceSubprogramSpecification(self): localctx = VHDLParser.Rule_InterfaceSubprogramSpecificationContext(self, self._ctx, self.state) - self.enterRule(localctx, 288, self.RULE_rule_InterfaceSubprogramSpecification) + self.enterRule(localctx, 292, self.RULE_rule_InterfaceSubprogramSpecification) try: - self.state = 1835 + self.state = 1913 self._errHandler.sync(self) token = self._input.LA(1) - if token in [VHDLParser.KW_FUNCTION, VHDLParser.KW_IMPURE, VHDLParser.KW_PURE]: + if token in [39, 46, 78]: self.enterOuterAlt(localctx, 1) - self.state = 1833 + self.state = 1911 self.rule_InterfaceFunctionSpecification() pass - elif token in [VHDLParser.KW_PROCEDURE]: + elif token in [75]: self.enterOuterAlt(localctx, 2) - self.state = 1834 + self.state = 1912 self.rule_InterfaceProcedureSpecification() pass else: @@ -12097,21 +12418,21 @@ def accept(self, visitor: ParseTreeVisitor): def rule_InterfaceTypeDeclaration(self): localctx = VHDLParser.Rule_InterfaceTypeDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 290, self.RULE_rule_InterfaceTypeDeclaration) + self.enterRule(localctx, 294, self.RULE_rule_InterfaceTypeDeclaration) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1837 + self.state = 1915 self.match(VHDLParser.KW_TYPE) - self.state = 1838 + self.state = 1916 localctx.name = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 1841 + self.state = 1919 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_IS: - self.state = 1839 + if _la == 50: + self.state = 1917 self.match(VHDLParser.KW_IS) - self.state = 1840 + self.state = 1918 self.rule_IncompleteTypeDefinition() @@ -12148,20 +12469,19 @@ def accept(self, visitor: ParseTreeVisitor): def rule_InterfaceTypeIndication(self): localctx = VHDLParser.Rule_InterfaceTypeIndicationContext(self, self._ctx, self.state) - self.enterRule(localctx, 292, self.RULE_rule_InterfaceTypeIndication) + self.enterRule(localctx, 296, self.RULE_rule_InterfaceTypeIndication) try: - self.state = 1845 + self.state = 1923 self._errHandler.sync(self) token = self._input.LA(1) - if token in [VHDLParser.TOK_LP, VHDLParser.TOK_DLA, VHDLParser.LIT_CHARACTER, VHDLParser.LIT_STRING, - VHDLParser.LIT_IDENTIFIER]: + if token in [143, 147, 161, 162, 163]: self.enterOuterAlt(localctx, 1) - self.state = 1843 + self.state = 1921 self.rule_SubtypeIndication() pass - elif token in [VHDLParser.KW_TYPE]: + elif token in [104]: self.enterOuterAlt(localctx, 2) - self.state = 1844 + self.state = 1922 self.rule_UnspecifiedTypeIndication() pass else: @@ -12219,39 +12539,37 @@ def accept(self, visitor: ParseTreeVisitor): def rule_InterfaceVariableDeclaration(self): localctx = VHDLParser.Rule_InterfaceVariableDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 294, self.RULE_rule_InterfaceVariableDeclaration) + self.enterRule(localctx, 298, self.RULE_rule_InterfaceVariableDeclaration) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1848 + self.state = 1926 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_VARIABLE: - self.state = 1847 + if _la == 109: + self.state = 1925 self.match(VHDLParser.KW_VARIABLE) - self.state = 1850 + self.state = 1928 localctx.names = self.rule_IdentifierList() - self.state = 1851 + self.state = 1929 self.match(VHDLParser.TOK_COLON) - self.state = 1853 + self.state = 1931 self._errHandler.sync(self) _la = self._input.LA(1) - if ((((_la - 20)) & ~0x3f) == 0 and ((1 << (_la - 20)) & ( - (1 << (VHDLParser.KW_BUFFER - 20)) | (1 << (VHDLParser.KW_IN - 20)) | (1 << (VHDLParser.KW_INOUT - 20)) | ( - 1 << (VHDLParser.KW_LINKAGE - 20)) | (1 << (VHDLParser.KW_OUT - 20)))) != 0): - self.state = 1852 + if ((((_la - 20)) & ~0x3f) == 0 and ((1 << (_la - 20)) & 562959214444545) != 0): + self.state = 1930 localctx.modeName = self.rule_Mode() - self.state = 1855 + self.state = 1933 localctx.interfaceTypeIndication = self.rule_InterfaceTypeIndication() - self.state = 1858 + self.state = 1936 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.TOK_VAR_ASSIGN: - self.state = 1856 + if _la == 141: + self.state = 1934 self.match(VHDLParser.TOK_VAR_ASSIGN) - self.state = 1857 + self.state = 1935 localctx.expression = self.rule_ConditionalExpression() @@ -12296,23 +12614,23 @@ def accept(self, visitor: ParseTreeVisitor): def rule_IterationScheme(self): localctx = VHDLParser.Rule_IterationSchemeContext(self, self._ctx, self.state) - self.enterRule(localctx, 296, self.RULE_rule_IterationScheme) + self.enterRule(localctx, 300, self.RULE_rule_IterationScheme) try: - self.state = 1864 + self.state = 1942 self._errHandler.sync(self) token = self._input.LA(1) - if token in [VHDLParser.KW_WHILE]: + if token in [118]: self.enterOuterAlt(localctx, 1) - self.state = 1860 + self.state = 1938 self.match(VHDLParser.KW_WHILE) - self.state = 1861 + self.state = 1939 localctx.condition = self.rule_Expression(0) pass - elif token in [VHDLParser.KW_FOR]: + elif token in [37]: self.enterOuterAlt(localctx, 2) - self.state = 1862 + self.state = 1940 self.match(VHDLParser.KW_FOR) - self.state = 1863 + self.state = 1941 localctx.parameterSpecification = self.rule_ParameterSpecification() pass else: @@ -12365,29 +12683,29 @@ def accept(self, visitor: ParseTreeVisitor): def rule_LibraryClause(self): localctx = VHDLParser.Rule_LibraryClauseContext(self, self._ctx, self.state) - self.enterRule(localctx, 298, self.RULE_rule_LibraryClause) + self.enterRule(localctx, 302, self.RULE_rule_LibraryClause) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1866 + self.state = 1944 self.match(VHDLParser.KW_LIBRARY) - self.state = 1867 + self.state = 1945 localctx._LIT_IDENTIFIER = self.match(VHDLParser.LIT_IDENTIFIER) localctx.names.append(localctx._LIT_IDENTIFIER) - self.state = 1872 + self.state = 1950 self._errHandler.sync(self) _la = self._input.LA(1) - while _la == VHDLParser.TOK_COMMA: - self.state = 1868 + while _la == 151: + self.state = 1946 self.match(VHDLParser.TOK_COMMA) - self.state = 1869 + self.state = 1947 localctx._LIT_IDENTIFIER = self.match(VHDLParser.LIT_IDENTIFIER) localctx.names.append(localctx._LIT_IDENTIFIER) - self.state = 1874 + self.state = 1952 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 1875 + self.state = 1953 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -12444,50 +12762,50 @@ def accept(self, visitor: ParseTreeVisitor): def rule_LibraryUnit(self): localctx = VHDLParser.Rule_LibraryUnitContext(self, self._ctx, self.state) - self.enterRule(localctx, 300, self.RULE_rule_LibraryUnit) + self.enterRule(localctx, 304, self.RULE_rule_LibraryUnit) try: - self.state = 1884 + self.state = 1962 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 192, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 205, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 1877 + self.state = 1955 localctx.entity = self.rule_EntityDeclaration() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 1878 + self.state = 1956 localctx.configuration = self.rule_ConfigurationDeclaration() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 1879 + self.state = 1957 localctx.package = self.rule_PackageDeclaration() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 1880 + self.state = 1958 localctx.packageInstance = self.rule_PackageInstantiationDeclaration() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) - self.state = 1881 + self.state = 1959 localctx.context = self.rule_ContextDeclaration() pass elif la_ == 6: self.enterOuterAlt(localctx, 6) - self.state = 1882 + self.state = 1960 localctx.architecture = self.rule_Architecture() pass elif la_ == 7: self.enterOuterAlt(localctx, 7) - self.state = 1883 + self.state = 1961 localctx.packageBody = self.rule_PackageBody() pass @@ -12534,38 +12852,38 @@ def accept(self, visitor: ParseTreeVisitor): def rule_Literal(self): localctx = VHDLParser.Rule_LiteralContext(self, self._ctx, self.state) - self.enterRule(localctx, 302, self.RULE_rule_Literal) + self.enterRule(localctx, 306, self.RULE_rule_Literal) try: - self.state = 1891 + self.state = 1969 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 193, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 206, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 1886 + self.state = 1964 self.rule_NumericLiteral() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 1887 + self.state = 1965 self.rule_EnumerationLiteral() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 1888 + self.state = 1966 self.match(VHDLParser.LIT_STRING) pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 1889 + self.state = 1967 self.match(VHDLParser.LIT_BIT_STRING) pass elif la_ == 5: self.enterOuterAlt(localctx, 5) - self.state = 1890 + self.state = 1968 self.match(VHDLParser.KW_NULL) pass @@ -12632,60 +12950,53 @@ def accept(self, visitor: ParseTreeVisitor): def rule_LoopStatement(self): localctx = VHDLParser.Rule_LoopStatementContext(self, self._ctx, self.state) - self.enterRule(localctx, 304, self.RULE_rule_LoopStatement) + self.enterRule(localctx, 308, self.RULE_rule_LoopStatement) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1895 + self.state = 1973 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: - self.state = 1893 + if _la == 163: + self.state = 1971 localctx.label = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 1894 + self.state = 1972 self.match(VHDLParser.TOK_COLON) - self.state = 1898 + self.state = 1976 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_FOR or _la == VHDLParser.KW_WHILE: - self.state = 1897 + if _la == 37 or _la == 118: + self.state = 1975 localctx.scheme = self.rule_IterationScheme() - self.state = 1900 + self.state = 1978 self.match(VHDLParser.KW_LOOP) - self.state = 1904 + self.state = 1982 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ( - (1 << VHDLParser.KW_ASSERT) | (1 << VHDLParser.KW_BLOCK) | (1 << VHDLParser.KW_CASE) | ( - 1 << VHDLParser.KW_EXIT) | (1 << VHDLParser.KW_FOR) | (1 << VHDLParser.KW_IF) | (1 << VHDLParser.KW_LOOP) | ( - 1 << VHDLParser.KW_NEXT) | (1 << VHDLParser.KW_NULL))) != 0) or ((((_la - 85)) & ~0x3f) == 0 and ( - (1 << (_la - 85)) & ( - (1 << (VHDLParser.KW_REPORT - 85)) | (1 << (VHDLParser.KW_RETURN - 85)) | (1 << (VHDLParser.KW_WAIT - 85)) | ( - 1 << (VHDLParser.KW_WITH - 85)) | (1 << (VHDLParser.KW_WHILE - 85)) | (1 << (VHDLParser.TOK_LP - 85)) | ( - 1 << (VHDLParser.TOK_DLA - 85)))) != 0) or ((((_la - 162)) & ~0x3f) == 0 and ((1 << (_la - 162)) & ( - (1 << (VHDLParser.LIT_CHARACTER - 162)) | (1 << (VHDLParser.LIT_STRING - 162)) | ( - 1 << (VHDLParser.LIT_IDENTIFIER - 162)))) != 0): - self.state = 1901 + while (((_la) & ~0x3f) == 0 and ((1 << _la) & -8052400777563193344) != 0) or ( + (((_la - 85)) & ~0x3f) == 0 and ((1 << (_la - 85)) & 4899916406390259715) != 0) or ( + (((_la - 161)) & ~0x3f) == 0 and ((1 << (_la - 161)) & 7) != 0): + self.state = 1979 localctx._rule_SequentialStatement = self.rule_SequentialStatement() localctx.statements.append(localctx._rule_SequentialStatement) - self.state = 1906 + self.state = 1984 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 1907 + self.state = 1985 self.match(VHDLParser.KW_END) - self.state = 1908 + self.state = 1986 self.match(VHDLParser.KW_LOOP) - self.state = 1910 + self.state = 1988 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: - self.state = 1909 + if _la == 163: + self.state = 1987 localctx.label2 = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 1912 + self.state = 1990 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -12730,16 +13041,14 @@ def accept(self, visitor: ParseTreeVisitor): def rule_Mode(self): localctx = VHDLParser.Rule_ModeContext(self, self._ctx, self.state) - self.enterRule(localctx, 306, self.RULE_rule_Mode) + self.enterRule(localctx, 310, self.RULE_rule_Mode) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1914 + self.state = 1992 localctx.name = self._input.LT(1) _la = self._input.LA(1) - if not (((((_la - 20)) & ~0x3f) == 0 and ((1 << (_la - 20)) & ( - (1 << (VHDLParser.KW_BUFFER - 20)) | (1 << (VHDLParser.KW_IN - 20)) | (1 << (VHDLParser.KW_INOUT - 20)) | ( - 1 << (VHDLParser.KW_LINKAGE - 20)) | (1 << (VHDLParser.KW_OUT - 20)))) != 0)): + if not (((((_la - 20)) & ~0x3f) == 0 and ((1 << (_la - 20)) & 562959214444545) != 0)): localctx.name = self._errHandler.recoverInline(self) else: self._errHandler.reportMatch(self) @@ -12780,26 +13089,26 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ModeIndication(self): localctx = VHDLParser.Rule_ModeIndicationContext(self, self._ctx, self.state) - self.enterRule(localctx, 308, self.RULE_rule_ModeIndication) + self.enterRule(localctx, 312, self.RULE_rule_ModeIndication) try: - self.state = 1919 + self.state = 1997 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 198, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 211, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 1916 + self.state = 1994 self.rule_SimpleModeIndication() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 1917 + self.state = 1995 self.rule_ArrayModeViewIndication() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 1918 + self.state = 1996 self.rule_RecordModeViewIndication() pass @@ -12866,37 +13175,42 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ModeViewDeclaration(self): localctx = VHDLParser.Rule_ModeViewDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 310, self.RULE_rule_ModeViewDeclaration) + self.enterRule(localctx, 314, self.RULE_rule_ModeViewDeclaration) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1921 + self.state = 1999 self.match(VHDLParser.KW_VIEW) - self.state = 1922 + self.state = 2000 localctx.name = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 1923 + self.state = 2001 self.match(VHDLParser.KW_OF) - self.state = 1924 + self.state = 2002 self.rule_SubtypeIndication() - self.state = 1925 + self.state = 2003 self.match(VHDLParser.KW_IS) - self.state = 1929 + self.state = 2007 self._errHandler.sync(self) _la = self._input.LA(1) - while _la == VHDLParser.LIT_IDENTIFIER: - self.state = 1926 + while _la == 163: + self.state = 2004 self.rule_ModeViewElementDefinition() - self.state = 1931 + self.state = 2009 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 1932 + self.state = 2010 self.match(VHDLParser.KW_END) - self.state = 1933 + self.state = 2011 self.match(VHDLParser.KW_VIEW) - self.state = 1934 - localctx.name2 = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 1935 + self.state = 2013 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la == 163: + self.state = 2012 + localctx.name2 = self.match(VHDLParser.LIT_IDENTIFIER) + + self.state = 2015 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -12937,16 +13251,16 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ModeViewElementDefinition(self): localctx = VHDLParser.Rule_ModeViewElementDefinitionContext(self, self._ctx, self.state) - self.enterRule(localctx, 312, self.RULE_rule_ModeViewElementDefinition) + self.enterRule(localctx, 316, self.RULE_rule_ModeViewElementDefinition) try: self.enterOuterAlt(localctx, 1) - self.state = 1937 + self.state = 2017 self.rule_RecordElementList() - self.state = 1938 + self.state = 2018 self.match(VHDLParser.TOK_COLON) - self.state = 1939 + self.state = 2019 self.rule_ElementModeIndication() - self.state = 1940 + self.state = 2020 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -13154,70 +13468,70 @@ def rule_Name(self, _p: int = 0): _parentState = self.state localctx = VHDLParser.Rule_NameContext(self, self._ctx, _parentState) _prevctx = localctx - _startState = 314 - self.enterRecursionRule(localctx, 314, self.RULE_rule_Name, _p) + _startState = 318 + self.enterRecursionRule(localctx, 318, self.RULE_rule_Name, _p) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1947 + self.state = 2027 self._errHandler.sync(self) token = self._input.LA(1) - if token in [VHDLParser.LIT_IDENTIFIER]: + if token in [163]: localctx = VHDLParser.Rule_SimpleNameContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 1943 + self.state = 2023 self.match(VHDLParser.LIT_IDENTIFIER) pass - elif token in [VHDLParser.LIT_STRING]: + elif token in [162]: localctx = VHDLParser.Rule_OperatorContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 1944 + self.state = 2024 self.match(VHDLParser.LIT_STRING) pass - elif token in [VHDLParser.LIT_CHARACTER]: + elif token in [161]: localctx = VHDLParser.Rule_CharContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 1945 + self.state = 2025 self.match(VHDLParser.LIT_CHARACTER) pass - elif token in [VHDLParser.TOK_DLA]: + elif token in [147]: localctx = VHDLParser.Rule_ExternalContext(self, localctx) self._ctx = localctx _prevctx = localctx - self.state = 1946 + self.state = 2026 self.rule_ExternalName() pass else: raise NoViableAltException(self) self._ctx.stop = self._input.LT(-1) - self.state = 1983 + self.state = 2063 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input, 205, self._ctx) + _alt = self._interp.adaptivePredict(self._input, 219, self._ctx) while _alt != 2 and _alt != ATN.INVALID_ALT_NUMBER: if _alt == 1: if self._parseListeners is not None: self.triggerExitRuleEvent() _prevctx = localctx - self.state = 1981 + self.state = 2061 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 204, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 218, self._ctx) if la_ == 1: localctx = VHDLParser.Rule_SelectedNameContext(self, VHDLParser.Rule_NameContext(self, _parentctx, _parentState)) localctx.prefix = _prevctx self.pushNewRecursionContext(localctx, _startState, self.RULE_rule_Name) - self.state = 1949 + self.state = 2029 if not self.precpred(self._ctx, 5): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 5)") - self.state = 1950 + self.state = 2030 self.match(VHDLParser.TOK_DOT) - self.state = 1951 + self.state = 2031 self.rule_Suffix() pass @@ -13226,29 +13540,29 @@ def rule_Name(self, _p: int = 0): VHDLParser.Rule_NameContext(self, _parentctx, _parentState)) localctx.prefix = _prevctx self.pushNewRecursionContext(localctx, _startState, self.RULE_rule_Name) - self.state = 1952 + self.state = 2032 if not self.precpred(self._ctx, 4): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 4)") - self.state = 1953 + self.state = 2033 self.match(VHDLParser.TOK_LP) - self.state = 1954 + self.state = 2034 localctx._rule_Expression = self.rule_Expression(0) localctx.expressions.append(localctx._rule_Expression) - self.state = 1959 + self.state = 2039 self._errHandler.sync(self) _la = self._input.LA(1) - while _la == VHDLParser.TOK_COMMA: - self.state = 1955 + while _la == 151: + self.state = 2035 self.match(VHDLParser.TOK_COMMA) - self.state = 1956 + self.state = 2036 localctx._rule_Expression = self.rule_Expression(0) localctx.expressions.append(localctx._rule_Expression) - self.state = 1961 + self.state = 2041 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 1962 + self.state = 2042 self.match(VHDLParser.TOK_RP) pass @@ -13257,15 +13571,15 @@ def rule_Name(self, _p: int = 0): VHDLParser.Rule_NameContext(self, _parentctx, _parentState)) localctx.prefix = _prevctx self.pushNewRecursionContext(localctx, _startState, self.RULE_rule_Name) - self.state = 1964 + self.state = 2044 if not self.precpred(self._ctx, 3): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 3)") - self.state = 1965 + self.state = 2045 self.match(VHDLParser.TOK_LP) - self.state = 1966 + self.state = 2046 self.rule_DiscreteRange() - self.state = 1967 + self.state = 2047 self.match(VHDLParser.TOK_RP) pass @@ -13274,37 +13588,37 @@ def rule_Name(self, _p: int = 0): VHDLParser.Rule_NameContext(self, _parentctx, _parentState)) localctx.prefix = _prevctx self.pushNewRecursionContext(localctx, _startState, self.RULE_rule_Name) - self.state = 1969 + self.state = 2049 if not self.precpred(self._ctx, 2): from antlr4.error.Errors import FailedPredicateException raise FailedPredicateException(self, "self.precpred(self._ctx, 2)") - self.state = 1971 + self.state = 2051 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.TOK_LB: - self.state = 1970 + if _la == 145: + self.state = 2050 localctx.signature = self.rule_Signature() - self.state = 1973 + self.state = 2053 self.match(VHDLParser.TOK_TICK) - self.state = 1974 + self.state = 2054 localctx.designator = self.rule_AttributeDesignator() - self.state = 1979 + self.state = 2059 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 203, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 217, self._ctx) if la_ == 1: - self.state = 1975 + self.state = 2055 self.match(VHDLParser.TOK_LP) - self.state = 1976 + self.state = 2056 localctx.expression = self.rule_Expression(0) - self.state = 1977 + self.state = 2057 self.match(VHDLParser.TOK_RP) pass - self.state = 1985 + self.state = 2065 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input, 205, self._ctx) + _alt = self._interp.adaptivePredict(self._input, 219, self._ctx) except RecognitionException as re: localctx.exception = re @@ -13357,38 +13671,38 @@ def accept(self, visitor: ParseTreeVisitor): def rule_NextStatement(self): localctx = VHDLParser.Rule_NextStatementContext(self, self._ctx, self.state) - self.enterRule(localctx, 316, self.RULE_rule_NextStatement) + self.enterRule(localctx, 320, self.RULE_rule_NextStatement) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 1988 + self.state = 2068 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: - self.state = 1986 + if _la == 163: + self.state = 2066 localctx.label = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 1987 + self.state = 2067 self.match(VHDLParser.TOK_COLON) - self.state = 1990 + self.state = 2070 self.match(VHDLParser.KW_NEXT) - self.state = 1992 + self.state = 2072 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: - self.state = 1991 + if _la == 163: + self.state = 2071 localctx.referencedLabel = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 1996 + self.state = 2076 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_WHEN: - self.state = 1994 + if _la == 117: + self.state = 2074 self.match(VHDLParser.KW_WHEN) - self.state = 1995 + self.state = 2075 localctx.condition = self.rule_Expression(0) - self.state = 1998 + self.state = 2078 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -13430,22 +13744,22 @@ def accept(self, visitor: ParseTreeVisitor): def rule_NullStatement(self): localctx = VHDLParser.Rule_NullStatementContext(self, self._ctx, self.state) - self.enterRule(localctx, 318, self.RULE_rule_NullStatement) + self.enterRule(localctx, 322, self.RULE_rule_NullStatement) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2002 + self.state = 2082 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: - self.state = 2000 + if _la == 163: + self.state = 2080 localctx.label = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 2001 + self.state = 2081 self.match(VHDLParser.TOK_COLON) - self.state = 2004 + self.state = 2084 self.match(VHDLParser.KW_NULL) - self.state = 2005 + self.state = 2085 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -13480,20 +13794,20 @@ def accept(self, visitor: ParseTreeVisitor): def rule_NumericLiteral(self): localctx = VHDLParser.Rule_NumericLiteralContext(self, self._ctx, self.state) - self.enterRule(localctx, 320, self.RULE_rule_NumericLiteral) + self.enterRule(localctx, 324, self.RULE_rule_NumericLiteral) try: - self.state = 2009 + self.state = 2089 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 210, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 224, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 2007 + self.state = 2087 self.match(VHDLParser.LIT_ABSTRACT) pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 2008 + self.state = 2088 self.rule_PhysicalLiteral() pass @@ -13562,55 +13876,49 @@ def accept(self, visitor: ParseTreeVisitor): def rule_PackageBody(self): localctx = VHDLParser.Rule_PackageBodyContext(self, self._ctx, self.state) - self.enterRule(localctx, 322, self.RULE_rule_PackageBody) + self.enterRule(localctx, 326, self.RULE_rule_PackageBody) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2011 + self.state = 2091 self.match(VHDLParser.KW_PACKAGE) - self.state = 2012 + self.state = 2092 self.match(VHDLParser.KW_BODY) - self.state = 2013 + self.state = 2093 localctx.name = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 2014 + self.state = 2094 self.match(VHDLParser.KW_IS) - self.state = 2018 + self.state = 2098 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ( - (1 << VHDLParser.KW_ALIAS) | (1 << VHDLParser.KW_ATTRIBUTE) | (1 << VHDLParser.KW_CONSTANT) | ( - 1 << VHDLParser.KW_FILE) | (1 << VHDLParser.KW_FUNCTION) | (1 << VHDLParser.KW_IMPURE))) != 0) or ( - (((_la - 70)) & ~0x3f) == 0 and ((1 << (_la - 70)) & ( - (1 << (VHDLParser.KW_PACKAGE - 70)) | (1 << (VHDLParser.KW_PROCEDURE - 70)) | ( - 1 << (VHDLParser.KW_PURE - 70)) | (1 << (VHDLParser.KW_SHARED - 70)) | (1 << (VHDLParser.KW_SUBTYPE - 70)) | ( - 1 << (VHDLParser.KW_TYPE - 70)) | (1 << (VHDLParser.KW_USE - 70)) | ( - 1 << (VHDLParser.KW_VARIABLE - 70)))) != 0): - self.state = 2015 + while (((_la) & ~0x3f) == 0 and ((1 << _la) & 88579439100416) != 0) or ( + (((_la - 70)) & ~0x3f) == 0 and ((1 << (_la - 70)) & 842086220065) != 0): + self.state = 2095 localctx._rule_PackageBodyDeclarativeItem = self.rule_PackageBodyDeclarativeItem() localctx.declarativeItem.append(localctx._rule_PackageBodyDeclarativeItem) - self.state = 2020 + self.state = 2100 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 2021 + self.state = 2101 self.match(VHDLParser.KW_END) - self.state = 2024 + self.state = 2104 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_PACKAGE: - self.state = 2022 + if _la == 70: + self.state = 2102 self.match(VHDLParser.KW_PACKAGE) - self.state = 2023 + self.state = 2103 self.match(VHDLParser.KW_BODY) - self.state = 2027 + self.state = 2107 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: - self.state = 2026 + if _la == 163: + self.state = 2106 localctx.name2 = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 2029 + self.state = 2109 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -13672,6 +13980,12 @@ def rule_AttributeSpecification(self): def rule_UseClause(self): return self.getTypedRuleContext(VHDLParser.Rule_UseClauseContext, 0) + def rule_GroupTemplateDeclaration(self): + return self.getTypedRuleContext(VHDLParser.Rule_GroupTemplateDeclarationContext, 0) + + def rule_GroupDeclaration(self): + return self.getTypedRuleContext(VHDLParser.Rule_GroupDeclarationContext, 0) + def getRuleIndex(self): return VHDLParser.RULE_rule_PackageBodyDeclarativeItem @@ -13684,101 +13998,113 @@ def accept(self, visitor: ParseTreeVisitor): def rule_PackageBodyDeclarativeItem(self): localctx = VHDLParser.Rule_PackageBodyDeclarativeItemContext(self, self._ctx, self.state) - self.enterRule(localctx, 324, self.RULE_rule_PackageBodyDeclarativeItem) + self.enterRule(localctx, 328, self.RULE_rule_PackageBodyDeclarativeItem) try: - self.state = 2046 + self.state = 2128 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 214, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 228, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 2031 + self.state = 2111 self.rule_SubprogramDeclaration() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 2032 + self.state = 2112 self.rule_SubprogramBody() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 2033 + self.state = 2113 self.rule_SubprogramInstantiationDeclaration() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 2034 + self.state = 2114 self.rule_PackageDeclaration() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) - self.state = 2035 + self.state = 2115 self.rule_PackageBody() pass elif la_ == 6: self.enterOuterAlt(localctx, 6) - self.state = 2036 + self.state = 2116 self.rule_PackageInstantiationDeclaration() pass elif la_ == 7: self.enterOuterAlt(localctx, 7) - self.state = 2037 + self.state = 2117 self.rule_TypeDeclaration() pass elif la_ == 8: self.enterOuterAlt(localctx, 8) - self.state = 2038 + self.state = 2118 self.rule_SubtypeDeclaration() pass elif la_ == 9: self.enterOuterAlt(localctx, 9) - self.state = 2039 + self.state = 2119 self.rule_ConstantDeclaration() pass elif la_ == 10: self.enterOuterAlt(localctx, 10) - self.state = 2040 + self.state = 2120 self.rule_VariableDeclaration() pass elif la_ == 11: self.enterOuterAlt(localctx, 11) - self.state = 2041 + self.state = 2121 self.rule_FileDeclaration() pass elif la_ == 12: self.enterOuterAlt(localctx, 12) - self.state = 2042 + self.state = 2122 self.rule_AliasDeclaration() pass elif la_ == 13: self.enterOuterAlt(localctx, 13) - self.state = 2043 + self.state = 2123 self.rule_AttributeDeclaration() pass elif la_ == 14: self.enterOuterAlt(localctx, 14) - self.state = 2044 + self.state = 2124 self.rule_AttributeSpecification() pass elif la_ == 15: self.enterOuterAlt(localctx, 15) - self.state = 2045 + self.state = 2125 self.rule_UseClause() pass + elif la_ == 16: + self.enterOuterAlt(localctx, 16) + self.state = 2126 + self.rule_GroupTemplateDeclaration() + pass + + elif la_ == 17: + self.enterOuterAlt(localctx, 17) + self.state = 2127 + self.rule_GroupDeclaration() + pass + except RecognitionException as re: localctx.exception = re @@ -13842,58 +14168,52 @@ def accept(self, visitor: ParseTreeVisitor): def rule_PackageDeclaration(self): localctx = VHDLParser.Rule_PackageDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 326, self.RULE_rule_PackageDeclaration) + self.enterRule(localctx, 330, self.RULE_rule_PackageDeclaration) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2048 + self.state = 2130 self.match(VHDLParser.KW_PACKAGE) - self.state = 2049 + self.state = 2131 localctx.name = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 2050 + self.state = 2132 self.match(VHDLParser.KW_IS) - self.state = 2052 + self.state = 2134 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_GENERIC: - self.state = 2051 + if _la == 42: + self.state = 2133 localctx.genericClause = self.rule_GenericClause() - self.state = 2057 + self.state = 2139 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ( - (1 << VHDLParser.KW_ALIAS) | (1 << VHDLParser.KW_ATTRIBUTE) | (1 << VHDLParser.KW_COMPONENT) | ( - 1 << VHDLParser.KW_CONSTANT) | (1 << VHDLParser.KW_DISCONNECT) | (1 << VHDLParser.KW_FILE) | ( - 1 << VHDLParser.KW_FUNCTION) | (1 << VHDLParser.KW_IMPURE))) != 0) or ((((_la - 70)) & ~0x3f) == 0 and ( - (1 << (_la - 70)) & ((1 << (VHDLParser.KW_PACKAGE - 70)) | (1 << (VHDLParser.KW_PROCEDURE - 70)) | ( - 1 << (VHDLParser.KW_PURE - 70)) | (1 << (VHDLParser.KW_SHARED - 70)) | (1 << (VHDLParser.KW_SIGNAL - 70)) | ( - 1 << (VHDLParser.KW_SUBTYPE - 70)) | (1 << (VHDLParser.KW_TYPE - 70)) | ( - 1 << (VHDLParser.KW_USE - 70)) | (1 << (VHDLParser.KW_VARIABLE - 70)))) != 0): - self.state = 2054 + while (((_la) & ~0x3f) == 0 and ((1 << _la) & 88579984359936) != 0) or ( + (((_la - 70)) & ~0x3f) == 0 and ((1 << (_la - 70)) & 842094608673) != 0): + self.state = 2136 localctx._rule_PackageDeclarativeItem = self.rule_PackageDeclarativeItem() localctx.declarativeItems.append(localctx._rule_PackageDeclarativeItem) - self.state = 2059 + self.state = 2141 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 2060 + self.state = 2142 self.match(VHDLParser.KW_END) - self.state = 2062 + self.state = 2144 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_PACKAGE: - self.state = 2061 + if _la == 70: + self.state = 2143 self.match(VHDLParser.KW_PACKAGE) - self.state = 2065 + self.state = 2147 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: - self.state = 2064 + if _la == 163: + self.state = 2146 localctx.name2 = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 2067 + self.state = 2149 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -13971,6 +14291,12 @@ def rule_DisconnectionSpecification(self): def rule_UseClause(self): return self.getTypedRuleContext(VHDLParser.Rule_UseClauseContext, 0) + def rule_GroupTemplateDeclaration(self): + return self.getTypedRuleContext(VHDLParser.Rule_GroupTemplateDeclarationContext, 0) + + def rule_GroupDeclaration(self): + return self.getTypedRuleContext(VHDLParser.Rule_GroupDeclarationContext, 0) + def getRuleIndex(self): return VHDLParser.RULE_rule_PackageDeclarativeItem @@ -13983,107 +14309,119 @@ def accept(self, visitor: ParseTreeVisitor): def rule_PackageDeclarativeItem(self): localctx = VHDLParser.Rule_PackageDeclarativeItemContext(self, self._ctx, self.state) - self.enterRule(localctx, 328, self.RULE_rule_PackageDeclarativeItem) + self.enterRule(localctx, 332, self.RULE_rule_PackageDeclarativeItem) try: - self.state = 2085 + self.state = 2169 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 219, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 233, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 2069 + self.state = 2151 localctx.subprogramDeclaration = self.rule_SubprogramDeclaration() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 2070 + self.state = 2152 self.rule_SubprogramInstantiationDeclaration() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 2071 + self.state = 2153 self.rule_PackageDeclaration() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 2072 + self.state = 2154 self.rule_PackageInstantiationDeclaration() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) - self.state = 2073 + self.state = 2155 localctx.typeDeclaration = self.rule_TypeDeclaration() pass elif la_ == 6: self.enterOuterAlt(localctx, 6) - self.state = 2074 + self.state = 2156 localctx.subtypeDeclaration = self.rule_SubtypeDeclaration() pass elif la_ == 7: self.enterOuterAlt(localctx, 7) - self.state = 2075 + self.state = 2157 localctx.constantDeclaration = self.rule_ConstantDeclaration() pass elif la_ == 8: self.enterOuterAlt(localctx, 8) - self.state = 2076 + self.state = 2158 localctx.signalDeclaration = self.rule_SignalDeclaration() pass elif la_ == 9: self.enterOuterAlt(localctx, 9) - self.state = 2077 + self.state = 2159 localctx.variableDeclaration = self.rule_VariableDeclaration() pass elif la_ == 10: self.enterOuterAlt(localctx, 10) - self.state = 2078 + self.state = 2160 localctx.fileDeclaration = self.rule_FileDeclaration() pass elif la_ == 11: self.enterOuterAlt(localctx, 11) - self.state = 2079 + self.state = 2161 localctx.aliasDeclaration = self.rule_AliasDeclaration() pass elif la_ == 12: self.enterOuterAlt(localctx, 12) - self.state = 2080 + self.state = 2162 localctx.componentDeclaration = self.rule_ComponentDeclaration() pass elif la_ == 13: self.enterOuterAlt(localctx, 13) - self.state = 2081 + self.state = 2163 localctx.attributeDeclaration = self.rule_AttributeDeclaration() pass elif la_ == 14: self.enterOuterAlt(localctx, 14) - self.state = 2082 + self.state = 2164 localctx.attributeSpecification = self.rule_AttributeSpecification() pass elif la_ == 15: self.enterOuterAlt(localctx, 15) - self.state = 2083 + self.state = 2165 localctx.disconnectionSpecification = self.rule_DisconnectionSpecification() pass elif la_ == 16: self.enterOuterAlt(localctx, 16) - self.state = 2084 + self.state = 2166 localctx.useClause = self.rule_UseClause() pass + elif la_ == 17: + self.enterOuterAlt(localctx, 17) + self.state = 2167 + self.rule_GroupTemplateDeclaration() + pass + + elif la_ == 18: + self.enterOuterAlt(localctx, 18) + self.state = 2168 + self.rule_GroupDeclaration() + pass + except RecognitionException as re: localctx.exception = re @@ -14135,28 +14473,28 @@ def accept(self, visitor: ParseTreeVisitor): def rule_PackageInstantiationDeclaration(self): localctx = VHDLParser.Rule_PackageInstantiationDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 330, self.RULE_rule_PackageInstantiationDeclaration) + self.enterRule(localctx, 334, self.RULE_rule_PackageInstantiationDeclaration) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2087 + self.state = 2171 self.match(VHDLParser.KW_PACKAGE) - self.state = 2088 + self.state = 2172 localctx.name = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 2089 + self.state = 2173 self.match(VHDLParser.KW_IS) - self.state = 2090 + self.state = 2174 self.match(VHDLParser.KW_NEW) - self.state = 2091 + self.state = 2175 self.rule_Name(0) - self.state = 2093 + self.state = 2177 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_GENERIC: - self.state = 2092 + if _la == 42: + self.state = 2176 localctx.genericMasAspect = self.rule_GenericMapAspect() - self.state = 2095 + self.state = 2179 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -14203,29 +14541,29 @@ def accept(self, visitor: ParseTreeVisitor): def rule_PackagePathname(self): localctx = VHDLParser.Rule_PackagePathnameContext(self, self._ctx, self.state) - self.enterRule(localctx, 332, self.RULE_rule_PackagePathname) + self.enterRule(localctx, 336, self.RULE_rule_PackagePathname) try: self.enterOuterAlt(localctx, 1) - self.state = 2097 + self.state = 2181 self.match(VHDLParser.TOK_AT) - self.state = 2098 + self.state = 2182 localctx.libraryName = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 2099 + self.state = 2183 self.match(VHDLParser.TOK_DOT) - self.state = 2104 + self.state = 2188 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input, 221, self._ctx) + _alt = self._interp.adaptivePredict(self._input, 235, self._ctx) while _alt != 2 and _alt != ATN.INVALID_ALT_NUMBER: if _alt == 1: - self.state = 2100 + self.state = 2184 localctx.packageName = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 2101 + self.state = 2185 self.match(VHDLParser.TOK_DOT) - self.state = 2106 + self.state = 2190 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input, 221, self._ctx) + _alt = self._interp.adaptivePredict(self._input, 235, self._ctx) - self.state = 2107 + self.state = 2191 localctx.objectName = self.match(VHDLParser.LIT_IDENTIFIER) except RecognitionException as re: localctx.exception = re @@ -14269,24 +14607,24 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ParameterMapAspect(self): localctx = VHDLParser.Rule_ParameterMapAspectContext(self, self._ctx, self.state) - self.enterRule(localctx, 334, self.RULE_rule_ParameterMapAspect) + self.enterRule(localctx, 338, self.RULE_rule_ParameterMapAspect) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2111 + self.state = 2195 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_PARAMETER: - self.state = 2109 + if _la == 71: + self.state = 2193 self.match(VHDLParser.KW_PARAMETER) - self.state = 2110 + self.state = 2194 self.match(VHDLParser.KW_MAP) - self.state = 2113 + self.state = 2197 self.match(VHDLParser.TOK_LP) - self.state = 2114 + self.state = 2198 self.rule_AssociationList() - self.state = 2115 + self.state = 2199 self.match(VHDLParser.TOK_RP) except RecognitionException as re: localctx.exception = re @@ -14324,14 +14662,14 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ParameterSpecification(self): localctx = VHDLParser.Rule_ParameterSpecificationContext(self, self._ctx, self.state) - self.enterRule(localctx, 336, self.RULE_rule_ParameterSpecification) + self.enterRule(localctx, 340, self.RULE_rule_ParameterSpecification) try: self.enterOuterAlt(localctx, 1) - self.state = 2117 + self.state = 2201 self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 2118 + self.state = 2202 self.match(VHDLParser.KW_IN) - self.state = 2119 + self.state = 2203 self.rule_DiscreteRange() except RecognitionException as re: localctx.exception = re @@ -14375,23 +14713,23 @@ def accept(self, visitor: ParseTreeVisitor): def rule_PartialPathname(self): localctx = VHDLParser.Rule_PartialPathnameContext(self, self._ctx, self.state) - self.enterRule(localctx, 338, self.RULE_rule_PartialPathname) + self.enterRule(localctx, 342, self.RULE_rule_PartialPathname) try: self.enterOuterAlt(localctx, 1) - self.state = 2126 + self.state = 2210 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input, 223, self._ctx) + _alt = self._interp.adaptivePredict(self._input, 237, self._ctx) while _alt != 2 and _alt != ATN.INVALID_ALT_NUMBER: if _alt == 1: - self.state = 2121 + self.state = 2205 self.rule_PathnameElement() - self.state = 2122 + self.state = 2206 self.match(VHDLParser.TOK_DOT) - self.state = 2128 + self.state = 2212 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input, 223, self._ctx) + _alt = self._interp.adaptivePredict(self._input, 237, self._ctx) - self.state = 2129 + self.state = 2213 self.match(VHDLParser.LIT_IDENTIFIER) except RecognitionException as re: localctx.exception = re @@ -14424,10 +14762,10 @@ def accept(self, visitor: ParseTreeVisitor): def rule_PathnameElement(self): localctx = VHDLParser.Rule_PathnameElementContext(self, self._ctx, self.state) - self.enterRule(localctx, 340, self.RULE_rule_PathnameElement) + self.enterRule(localctx, 344, self.RULE_rule_PathnameElement) try: self.enterOuterAlt(localctx, 1) - self.state = 2131 + self.state = 2215 localctx.nameOrLabel = self.match(VHDLParser.LIT_IDENTIFIER) except RecognitionException as re: localctx.exception = re @@ -14462,12 +14800,12 @@ def accept(self, visitor: ParseTreeVisitor): def rule_PhysicalIncompleteTypeDefinition(self): localctx = VHDLParser.Rule_PhysicalIncompleteTypeDefinitionContext(self, self._ctx, self.state) - self.enterRule(localctx, 342, self.RULE_rule_PhysicalIncompleteTypeDefinition) + self.enterRule(localctx, 346, self.RULE_rule_PhysicalIncompleteTypeDefinition) try: self.enterOuterAlt(localctx, 1) - self.state = 2133 + self.state = 2217 self.match(VHDLParser.KW_UNITS) - self.state = 2134 + self.state = 2218 self.match(VHDLParser.TOK_BOX) except RecognitionException as re: localctx.exception = re @@ -14502,18 +14840,18 @@ def accept(self, visitor: ParseTreeVisitor): def rule_PhysicalLiteral(self): localctx = VHDLParser.Rule_PhysicalLiteralContext(self, self._ctx, self.state) - self.enterRule(localctx, 344, self.RULE_rule_PhysicalLiteral) + self.enterRule(localctx, 348, self.RULE_rule_PhysicalLiteral) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2137 + self.state = 2221 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_ABSTRACT: - self.state = 2136 + if _la == 159: + self.state = 2220 self.match(VHDLParser.LIT_ABSTRACT) - self.state = 2139 + self.state = 2223 self.rule_Name(0) except RecognitionException as re: localctx.exception = re @@ -14574,38 +14912,38 @@ def accept(self, visitor: ParseTreeVisitor): def rule_PhysicalTypeDefinition(self): localctx = VHDLParser.Rule_PhysicalTypeDefinitionContext(self, self._ctx, self.state) - self.enterRule(localctx, 346, self.RULE_rule_PhysicalTypeDefinition) + self.enterRule(localctx, 350, self.RULE_rule_PhysicalTypeDefinition) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2141 + self.state = 2225 localctx.rangeConstraint = self.rule_RangeConstraint() - self.state = 2142 + self.state = 2226 self.match(VHDLParser.KW_UNITS) - self.state = 2143 + self.state = 2227 localctx.primaryUnit = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 2144 + self.state = 2228 self.match(VHDLParser.TOK_SEMICOL) - self.state = 2148 + self.state = 2232 self._errHandler.sync(self) _la = self._input.LA(1) - while _la == VHDLParser.LIT_IDENTIFIER: - self.state = 2145 + while _la == 163: + self.state = 2229 localctx._rule_SecondaryUnitDeclaration = self.rule_SecondaryUnitDeclaration() localctx.secondaryUnits.append(localctx._rule_SecondaryUnitDeclaration) - self.state = 2150 + self.state = 2234 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 2151 + self.state = 2235 self.match(VHDLParser.KW_END) - self.state = 2152 + self.state = 2236 self.match(VHDLParser.KW_UNITS) - self.state = 2154 + self.state = 2238 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: - self.state = 2153 + if _la == 163: + self.state = 2237 localctx.name2 = self.match(VHDLParser.LIT_IDENTIFIER) @@ -14656,31 +14994,31 @@ def accept(self, visitor: ParseTreeVisitor): def rule_PlainReturnStatement(self): localctx = VHDLParser.Rule_PlainReturnStatementContext(self, self._ctx, self.state) - self.enterRule(localctx, 348, self.RULE_rule_PlainReturnStatement) + self.enterRule(localctx, 352, self.RULE_rule_PlainReturnStatement) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2158 + self.state = 2242 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: - self.state = 2156 + if _la == 163: + self.state = 2240 localctx.label = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 2157 + self.state = 2241 self.match(VHDLParser.TOK_COLON) - self.state = 2160 + self.state = 2244 self.match(VHDLParser.KW_RETURN) - self.state = 2163 + self.state = 2247 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_WHEN: - self.state = 2161 + if _la == 117: + self.state = 2245 self.match(VHDLParser.KW_WHEN) - self.state = 2162 + self.state = 2246 localctx.condition = self.rule_Expression(0) - self.state = 2165 + self.state = 2249 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -14732,33 +15070,41 @@ def accept(self, visitor: ParseTreeVisitor): def rule_PortClause(self): localctx = VHDLParser.Rule_PortClauseContext(self, self._ctx, self.state) - self.enterRule(localctx, 350, self.RULE_rule_PortClause) + self.enterRule(localctx, 354, self.RULE_rule_PortClause) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2167 + self.state = 2251 self.match(VHDLParser.KW_PORT) - self.state = 2168 + self.state = 2252 self.match(VHDLParser.TOK_LP) - self.state = 2169 + self.state = 2253 localctx._rule_InterfaceSignalDeclaration = self.rule_InterfaceSignalDeclaration() localctx.ports.append(localctx._rule_InterfaceSignalDeclaration) - self.state = 2174 + self.state = 2258 + self._errHandler.sync(self) + _alt = self._interp.adaptivePredict(self._input, 243, self._ctx) + while _alt != 2 and _alt != ATN.INVALID_ALT_NUMBER: + if _alt == 1: + self.state = 2254 + self.match(VHDLParser.TOK_SEMICOL) + self.state = 2255 + localctx._rule_InterfaceSignalDeclaration = self.rule_InterfaceSignalDeclaration() + localctx.ports.append(localctx._rule_InterfaceSignalDeclaration) + self.state = 2260 + self._errHandler.sync(self) + _alt = self._interp.adaptivePredict(self._input, 243, self._ctx) + + self.state = 2262 self._errHandler.sync(self) _la = self._input.LA(1) - while _la == VHDLParser.TOK_SEMICOL: - self.state = 2170 + if _la == 150: + self.state = 2261 self.match(VHDLParser.TOK_SEMICOL) - self.state = 2171 - localctx._rule_InterfaceSignalDeclaration = self.rule_InterfaceSignalDeclaration() - localctx.ports.append(localctx._rule_InterfaceSignalDeclaration) - self.state = 2176 - self._errHandler.sync(self) - _la = self._input.LA(1) - self.state = 2177 + self.state = 2264 self.match(VHDLParser.TOK_RP) - self.state = 2178 + self.state = 2265 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -14803,18 +15149,18 @@ def accept(self, visitor: ParseTreeVisitor): def rule_PortMapAspect(self): localctx = VHDLParser.Rule_PortMapAspectContext(self, self._ctx, self.state) - self.enterRule(localctx, 352, self.RULE_rule_PortMapAspect) + self.enterRule(localctx, 356, self.RULE_rule_PortMapAspect) try: self.enterOuterAlt(localctx, 1) - self.state = 2180 + self.state = 2267 self.match(VHDLParser.KW_PORT) - self.state = 2181 + self.state = 2268 self.match(VHDLParser.KW_MAP) - self.state = 2182 + self.state = 2269 self.match(VHDLParser.TOK_LP) - self.state = 2183 + self.state = 2270 localctx.associationList = self.rule_AssociationList() - self.state = 2184 + self.state = 2271 self.match(VHDLParser.TOK_RP) except RecognitionException as re: localctx.exception = re @@ -14874,60 +15220,60 @@ def accept(self, visitor: ParseTreeVisitor): def rule_Primary(self): localctx = VHDLParser.Rule_PrimaryContext(self, self._ctx, self.state) - self.enterRule(localctx, 354, self.RULE_rule_Primary) + self.enterRule(localctx, 358, self.RULE_rule_Primary) try: - self.state = 2197 + self.state = 2284 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 230, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 245, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 2186 + self.state = 2273 self.rule_Name(0) pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 2187 + self.state = 2274 self.rule_Literal() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 2188 + self.state = 2275 self.rule_Aggregate() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 2189 + self.state = 2276 self.rule_FunctionCall() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) - self.state = 2190 + self.state = 2277 self.rule_QualifiedExpression() pass elif la_ == 6: self.enterOuterAlt(localctx, 6) - self.state = 2191 + self.state = 2278 self.rule_TypeConversion() pass elif la_ == 7: self.enterOuterAlt(localctx, 7) - self.state = 2192 + self.state = 2279 self.rule_Allocator() pass elif la_ == 8: self.enterOuterAlt(localctx, 8) - self.state = 2193 + self.state = 2280 self.match(VHDLParser.TOK_LP) - self.state = 2194 + self.state = 2281 localctx.expression = self.rule_Expression(0) - self.state = 2195 + self.state = 2282 self.match(VHDLParser.TOK_RP) pass @@ -14965,12 +15311,12 @@ def accept(self, visitor: ParseTreeVisitor): def rule_PrivateVariableDeclaration(self): localctx = VHDLParser.Rule_PrivateVariableDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 356, self.RULE_rule_PrivateVariableDeclaration) + self.enterRule(localctx, 360, self.RULE_rule_PrivateVariableDeclaration) try: self.enterOuterAlt(localctx, 1) - self.state = 2199 + self.state = 2286 self.match(VHDLParser.KW_PRIVATE) - self.state = 2200 + self.state = 2287 self.rule_VariableDeclaration() except RecognitionException as re: localctx.exception = re @@ -15002,10 +15348,10 @@ def accept(self, visitor: ParseTreeVisitor): def rule_PrivateIncompleteTypeDefinition(self): localctx = VHDLParser.Rule_PrivateIncompleteTypeDefinitionContext(self, self._ctx, self.state) - self.enterRule(localctx, 358, self.RULE_rule_PrivateIncompleteTypeDefinition) + self.enterRule(localctx, 362, self.RULE_rule_PrivateIncompleteTypeDefinition) try: self.enterOuterAlt(localctx, 1) - self.state = 2202 + self.state = 2289 self.match(VHDLParser.KW_PRIVATE) except RecognitionException as re: localctx.exception = re @@ -15045,24 +15391,24 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ProcedureCall(self): localctx = VHDLParser.Rule_ProcedureCallContext(self, self._ctx, self.state) - self.enterRule(localctx, 360, self.RULE_rule_ProcedureCall) + self.enterRule(localctx, 364, self.RULE_rule_ProcedureCall) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2204 + self.state = 2291 self.rule_Name(0) - self.state = 2206 + self.state = 2293 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_GENERIC: - self.state = 2205 + if _la == 42: + self.state = 2292 localctx.genericMapAspect = self.rule_GenericMapAspect() - self.state = 2209 + self.state = 2296 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_PARAMETER or _la == VHDLParser.TOK_LP: - self.state = 2208 + if _la == 71 or _la == 143: + self.state = 2295 localctx.parameterMapAspect = self.rule_ParameterMapAspect() @@ -15106,21 +15452,21 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ProcedureCallStatement(self): localctx = VHDLParser.Rule_ProcedureCallStatementContext(self, self._ctx, self.state) - self.enterRule(localctx, 362, self.RULE_rule_ProcedureCallStatement) + self.enterRule(localctx, 366, self.RULE_rule_ProcedureCallStatement) try: self.enterOuterAlt(localctx, 1) - self.state = 2213 + self.state = 2300 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 233, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 248, self._ctx) if la_ == 1: - self.state = 2211 + self.state = 2298 localctx.label = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 2212 + self.state = 2299 self.match(VHDLParser.TOK_COLON) - self.state = 2215 + self.state = 2302 self.rule_ProcedureCall() - self.state = 2216 + self.state = 2303 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -15168,30 +15514,30 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ProcedureSpecification(self): localctx = VHDLParser.Rule_ProcedureSpecificationContext(self, self._ctx, self.state) - self.enterRule(localctx, 364, self.RULE_rule_ProcedureSpecification) + self.enterRule(localctx, 368, self.RULE_rule_ProcedureSpecification) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2218 + self.state = 2305 self.match(VHDLParser.KW_PROCEDURE) - self.state = 2219 + self.state = 2306 localctx.name = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 2227 + self.state = 2314 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_PARAMETER or _la == VHDLParser.TOK_LP: - self.state = 2221 + if _la == 71 or _la == 143: + self.state = 2308 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_PARAMETER: - self.state = 2220 + if _la == 71: + self.state = 2307 self.match(VHDLParser.KW_PARAMETER) - self.state = 2223 + self.state = 2310 self.match(VHDLParser.TOK_LP) - self.state = 2224 + self.state = 2311 self.rule_FormalParameterList() - self.state = 2225 + self.state = 2312 self.match(VHDLParser.TOK_RP) @@ -15255,6 +15601,12 @@ def rule_AttributeSpecification(self): def rule_UseClause(self): return self.getTypedRuleContext(VHDLParser.Rule_UseClauseContext, 0) + def rule_GroupTemplateDeclaration(self): + return self.getTypedRuleContext(VHDLParser.Rule_GroupTemplateDeclarationContext, 0) + + def rule_GroupDeclaration(self): + return self.getTypedRuleContext(VHDLParser.Rule_GroupDeclarationContext, 0) + def getRuleIndex(self): return VHDLParser.RULE_rule_ProcessDeclarativeItem @@ -15267,101 +15619,113 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ProcessDeclarativeItem(self): localctx = VHDLParser.Rule_ProcessDeclarativeItemContext(self, self._ctx, self.state) - self.enterRule(localctx, 366, self.RULE_rule_ProcessDeclarativeItem) + self.enterRule(localctx, 370, self.RULE_rule_ProcessDeclarativeItem) try: - self.state = 2244 + self.state = 2333 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 236, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 251, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 2229 + self.state = 2316 self.rule_SubprogramDeclaration() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 2230 + self.state = 2317 self.rule_SubprogramBody() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 2231 + self.state = 2318 self.rule_SubprogramInstantiationDeclaration() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 2232 + self.state = 2319 self.rule_PackageDeclaration() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) - self.state = 2233 + self.state = 2320 self.rule_PackageBody() pass elif la_ == 6: self.enterOuterAlt(localctx, 6) - self.state = 2234 + self.state = 2321 self.rule_PackageInstantiationDeclaration() pass elif la_ == 7: self.enterOuterAlt(localctx, 7) - self.state = 2235 + self.state = 2322 self.rule_TypeDeclaration() pass elif la_ == 8: self.enterOuterAlt(localctx, 8) - self.state = 2236 + self.state = 2323 self.rule_SubtypeDeclaration() pass elif la_ == 9: self.enterOuterAlt(localctx, 9) - self.state = 2237 + self.state = 2324 self.rule_ConstantDeclaration() pass elif la_ == 10: self.enterOuterAlt(localctx, 10) - self.state = 2238 + self.state = 2325 self.rule_VariableDeclaration() pass elif la_ == 11: self.enterOuterAlt(localctx, 11) - self.state = 2239 + self.state = 2326 self.rule_FileDeclaration() pass elif la_ == 12: self.enterOuterAlt(localctx, 12) - self.state = 2240 + self.state = 2327 self.rule_AliasDeclaration() pass elif la_ == 13: self.enterOuterAlt(localctx, 13) - self.state = 2241 + self.state = 2328 self.rule_AttributeDeclaration() pass elif la_ == 14: self.enterOuterAlt(localctx, 14) - self.state = 2242 + self.state = 2329 self.rule_AttributeSpecification() pass elif la_ == 15: self.enterOuterAlt(localctx, 15) - self.state = 2243 + self.state = 2330 self.rule_UseClause() pass + elif la_ == 16: + self.enterOuterAlt(localctx, 16) + self.state = 2331 + self.rule_GroupTemplateDeclaration() + pass + + elif la_ == 17: + self.enterOuterAlt(localctx, 17) + self.state = 2332 + self.rule_GroupDeclaration() + pass + except RecognitionException as re: localctx.exception = re @@ -15396,19 +15760,19 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ProcessSensitivityList(self): localctx = VHDLParser.Rule_ProcessSensitivityListContext(self, self._ctx, self.state) - self.enterRule(localctx, 368, self.RULE_rule_ProcessSensitivityList) + self.enterRule(localctx, 372, self.RULE_rule_ProcessSensitivityList) try: - self.state = 2248 + self.state = 2337 self._errHandler.sync(self) token = self._input.LA(1) - if token in [VHDLParser.TOK_DLA, VHDLParser.LIT_CHARACTER, VHDLParser.LIT_STRING, VHDLParser.LIT_IDENTIFIER]: + if token in [147, 161, 162, 163]: self.enterOuterAlt(localctx, 1) - self.state = 2246 + self.state = 2335 self.rule_SensitivityList() pass - elif token in [VHDLParser.KW_ALL]: + elif token in [10]: self.enterOuterAlt(localctx, 2) - self.state = 2247 + self.state = 2336 self.match(VHDLParser.KW_ALL) pass else: @@ -15494,91 +15858,78 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ProcessStatement(self): localctx = VHDLParser.Rule_ProcessStatementContext(self, self._ctx, self.state) - self.enterRule(localctx, 370, self.RULE_rule_ProcessStatement) + self.enterRule(localctx, 374, self.RULE_rule_ProcessStatement) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2252 + self.state = 2341 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: - self.state = 2250 + if _la == 163: + self.state = 2339 localctx.label = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 2251 + self.state = 2340 self.match(VHDLParser.TOK_COLON) - self.state = 2254 + self.state = 2343 self.match(VHDLParser.KW_PROCESS) - self.state = 2259 + self.state = 2348 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.TOK_LP: - self.state = 2255 + if _la == 143: + self.state = 2344 self.match(VHDLParser.TOK_LP) - self.state = 2256 + self.state = 2345 self.rule_ProcessSensitivityList() - self.state = 2257 + self.state = 2346 self.match(VHDLParser.TOK_RP) - self.state = 2262 + self.state = 2351 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_IS: - self.state = 2261 + if _la == 50: + self.state = 2350 self.match(VHDLParser.KW_IS) - self.state = 2267 + self.state = 2356 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ( - (1 << VHDLParser.KW_ALIAS) | (1 << VHDLParser.KW_ATTRIBUTE) | (1 << VHDLParser.KW_CONSTANT) | ( - 1 << VHDLParser.KW_FILE) | (1 << VHDLParser.KW_FUNCTION) | (1 << VHDLParser.KW_IMPURE))) != 0) or ( - (((_la - 70)) & ~0x3f) == 0 and ((1 << (_la - 70)) & ( - (1 << (VHDLParser.KW_PACKAGE - 70)) | (1 << (VHDLParser.KW_PROCEDURE - 70)) | ( - 1 << (VHDLParser.KW_PURE - 70)) | (1 << (VHDLParser.KW_SHARED - 70)) | (1 << (VHDLParser.KW_SUBTYPE - 70)) | ( - 1 << (VHDLParser.KW_TYPE - 70)) | (1 << (VHDLParser.KW_USE - 70)) | ( - 1 << (VHDLParser.KW_VARIABLE - 70)))) != 0): - self.state = 2264 + while (((_la) & ~0x3f) == 0 and ((1 << _la) & 88579439100416) != 0) or ( + (((_la - 70)) & ~0x3f) == 0 and ((1 << (_la - 70)) & 842086220065) != 0): + self.state = 2353 localctx._rule_ProcessDeclarativeItem = self.rule_ProcessDeclarativeItem() localctx.declaredItems.append(localctx._rule_ProcessDeclarativeItem) - self.state = 2269 + self.state = 2358 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 2270 + self.state = 2359 self.match(VHDLParser.KW_BEGIN) - self.state = 2274 + self.state = 2363 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ( - (1 << VHDLParser.KW_ASSERT) | (1 << VHDLParser.KW_BLOCK) | (1 << VHDLParser.KW_CASE) | ( - 1 << VHDLParser.KW_EXIT) | (1 << VHDLParser.KW_FOR) | (1 << VHDLParser.KW_IF) | (1 << VHDLParser.KW_LOOP) | ( - 1 << VHDLParser.KW_NEXT) | (1 << VHDLParser.KW_NULL))) != 0) or ((((_la - 85)) & ~0x3f) == 0 and ( - (1 << (_la - 85)) & ( - (1 << (VHDLParser.KW_REPORT - 85)) | (1 << (VHDLParser.KW_RETURN - 85)) | (1 << (VHDLParser.KW_WAIT - 85)) | ( - 1 << (VHDLParser.KW_WITH - 85)) | (1 << (VHDLParser.KW_WHILE - 85)) | (1 << (VHDLParser.TOK_LP - 85)) | ( - 1 << (VHDLParser.TOK_DLA - 85)))) != 0) or ((((_la - 162)) & ~0x3f) == 0 and ((1 << (_la - 162)) & ( - (1 << (VHDLParser.LIT_CHARACTER - 162)) | (1 << (VHDLParser.LIT_STRING - 162)) | ( - 1 << (VHDLParser.LIT_IDENTIFIER - 162)))) != 0): - self.state = 2271 + while (((_la) & ~0x3f) == 0 and ((1 << _la) & -8052400777563193344) != 0) or ( + (((_la - 85)) & ~0x3f) == 0 and ((1 << (_la - 85)) & 4899916406390259715) != 0) or ( + (((_la - 161)) & ~0x3f) == 0 and ((1 << (_la - 161)) & 7) != 0): + self.state = 2360 localctx._rule_SequentialStatement = self.rule_SequentialStatement() localctx.statements.append(localctx._rule_SequentialStatement) - self.state = 2276 + self.state = 2365 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 2277 + self.state = 2366 self.match(VHDLParser.KW_END) - self.state = 2278 + self.state = 2367 self.match(VHDLParser.KW_PROCESS) - self.state = 2280 + self.state = 2369 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: - self.state = 2279 + if _la == 163: + self.state = 2368 self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 2282 + self.state = 2371 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -15666,100 +16017,87 @@ def accept(self, visitor: ParseTreeVisitor): def rule_PostponedProcessStatement(self): localctx = VHDLParser.Rule_PostponedProcessStatementContext(self, self._ctx, self.state) - self.enterRule(localctx, 372, self.RULE_rule_PostponedProcessStatement) + self.enterRule(localctx, 376, self.RULE_rule_PostponedProcessStatement) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2286 + self.state = 2375 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: - self.state = 2284 + if _la == 163: + self.state = 2373 localctx.label = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 2285 + self.state = 2374 self.match(VHDLParser.TOK_COLON) - self.state = 2288 + self.state = 2377 self.match(VHDLParser.KW_POSTPONED) - self.state = 2289 + self.state = 2378 self.match(VHDLParser.KW_PROCESS) - self.state = 2294 + self.state = 2383 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.TOK_LP: - self.state = 2290 + if _la == 143: + self.state = 2379 self.match(VHDLParser.TOK_LP) - self.state = 2291 + self.state = 2380 self.rule_SensitivityList() - self.state = 2292 + self.state = 2381 self.match(VHDLParser.TOK_RP) - self.state = 2297 + self.state = 2386 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_IS: - self.state = 2296 + if _la == 50: + self.state = 2385 self.match(VHDLParser.KW_IS) - self.state = 2302 + self.state = 2391 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ( - (1 << VHDLParser.KW_ALIAS) | (1 << VHDLParser.KW_ATTRIBUTE) | (1 << VHDLParser.KW_CONSTANT) | ( - 1 << VHDLParser.KW_FILE) | (1 << VHDLParser.KW_FUNCTION) | (1 << VHDLParser.KW_IMPURE))) != 0) or ( - (((_la - 70)) & ~0x3f) == 0 and ((1 << (_la - 70)) & ( - (1 << (VHDLParser.KW_PACKAGE - 70)) | (1 << (VHDLParser.KW_PROCEDURE - 70)) | ( - 1 << (VHDLParser.KW_PURE - 70)) | (1 << (VHDLParser.KW_SHARED - 70)) | (1 << (VHDLParser.KW_SUBTYPE - 70)) | ( - 1 << (VHDLParser.KW_TYPE - 70)) | (1 << (VHDLParser.KW_USE - 70)) | ( - 1 << (VHDLParser.KW_VARIABLE - 70)))) != 0): - self.state = 2299 + while (((_la) & ~0x3f) == 0 and ((1 << _la) & 88579439100416) != 0) or ( + (((_la - 70)) & ~0x3f) == 0 and ((1 << (_la - 70)) & 842086220065) != 0): + self.state = 2388 localctx._rule_ProcessDeclarativeItem = self.rule_ProcessDeclarativeItem() localctx.declaredItems.append(localctx._rule_ProcessDeclarativeItem) - self.state = 2304 + self.state = 2393 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 2305 + self.state = 2394 self.match(VHDLParser.KW_BEGIN) - self.state = 2309 + self.state = 2398 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ( - (1 << VHDLParser.KW_ASSERT) | (1 << VHDLParser.KW_BLOCK) | (1 << VHDLParser.KW_CASE) | ( - 1 << VHDLParser.KW_EXIT) | (1 << VHDLParser.KW_FOR) | (1 << VHDLParser.KW_IF) | (1 << VHDLParser.KW_LOOP) | ( - 1 << VHDLParser.KW_NEXT) | (1 << VHDLParser.KW_NULL))) != 0) or ((((_la - 85)) & ~0x3f) == 0 and ( - (1 << (_la - 85)) & ( - (1 << (VHDLParser.KW_REPORT - 85)) | (1 << (VHDLParser.KW_RETURN - 85)) | (1 << (VHDLParser.KW_WAIT - 85)) | ( - 1 << (VHDLParser.KW_WITH - 85)) | (1 << (VHDLParser.KW_WHILE - 85)) | (1 << (VHDLParser.TOK_LP - 85)) | ( - 1 << (VHDLParser.TOK_DLA - 85)))) != 0) or ((((_la - 162)) & ~0x3f) == 0 and ((1 << (_la - 162)) & ( - (1 << (VHDLParser.LIT_CHARACTER - 162)) | (1 << (VHDLParser.LIT_STRING - 162)) | ( - 1 << (VHDLParser.LIT_IDENTIFIER - 162)))) != 0): - self.state = 2306 + while (((_la) & ~0x3f) == 0 and ((1 << _la) & -8052400777563193344) != 0) or ( + (((_la - 85)) & ~0x3f) == 0 and ((1 << (_la - 85)) & 4899916406390259715) != 0) or ( + (((_la - 161)) & ~0x3f) == 0 and ((1 << (_la - 161)) & 7) != 0): + self.state = 2395 localctx._rule_SequentialStatement = self.rule_SequentialStatement() localctx.statements.append(localctx._rule_SequentialStatement) - self.state = 2311 + self.state = 2400 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 2312 + self.state = 2401 self.match(VHDLParser.KW_END) - self.state = 2314 + self.state = 2403 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_POSTPONED: - self.state = 2313 + if _la == 73: + self.state = 2402 self.match(VHDLParser.KW_POSTPONED) - self.state = 2316 + self.state = 2405 self.match(VHDLParser.KW_PROCESS) - self.state = 2318 + self.state = 2407 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: - self.state = 2317 + if _la == 163: + self.state = 2406 self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 2320 + self.state = 2409 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -15815,43 +16153,37 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ProtectedTypeBody(self): localctx = VHDLParser.Rule_ProtectedTypeBodyContext(self, self._ctx, self.state) - self.enterRule(localctx, 374, self.RULE_rule_ProtectedTypeBody) + self.enterRule(localctx, 378, self.RULE_rule_ProtectedTypeBody) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2322 + self.state = 2411 self.match(VHDLParser.KW_PROTECTED) - self.state = 2323 + self.state = 2412 self.match(VHDLParser.KW_BODY) - self.state = 2327 + self.state = 2416 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ( - (1 << VHDLParser.KW_ALIAS) | (1 << VHDLParser.KW_ATTRIBUTE) | (1 << VHDLParser.KW_CONSTANT) | ( - 1 << VHDLParser.KW_FILE) | (1 << VHDLParser.KW_FUNCTION) | (1 << VHDLParser.KW_IMPURE))) != 0) or ( - (((_la - 70)) & ~0x3f) == 0 and ((1 << (_la - 70)) & ( - (1 << (VHDLParser.KW_PACKAGE - 70)) | (1 << (VHDLParser.KW_PROCEDURE - 70)) | ( - 1 << (VHDLParser.KW_PURE - 70)) | (1 << (VHDLParser.KW_SHARED - 70)) | (1 << (VHDLParser.KW_SUBTYPE - 70)) | ( - 1 << (VHDLParser.KW_TYPE - 70)) | (1 << (VHDLParser.KW_USE - 70)) | ( - 1 << (VHDLParser.KW_VARIABLE - 70)))) != 0): - self.state = 2324 + while (((_la) & ~0x3f) == 0 and ((1 << _la) & 88579439100416) != 0) or ( + (((_la - 70)) & ~0x3f) == 0 and ((1 << (_la - 70)) & 842086220065) != 0): + self.state = 2413 localctx._rule_ProtectedTypeBodyDeclarativeItem = self.rule_ProtectedTypeBodyDeclarativeItem() localctx.declaredItems.append(localctx._rule_ProtectedTypeBodyDeclarativeItem) - self.state = 2329 + self.state = 2418 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 2330 + self.state = 2419 self.match(VHDLParser.KW_END) - self.state = 2331 + self.state = 2420 self.match(VHDLParser.KW_PROTECTED) - self.state = 2332 + self.state = 2421 self.match(VHDLParser.KW_BODY) - self.state = 2334 + self.state = 2423 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: - self.state = 2333 + if _la == 163: + self.state = 2422 localctx.name2 = self.match(VHDLParser.LIT_IDENTIFIER) @@ -15915,6 +16247,12 @@ def rule_AttributeSpecification(self): def rule_UseClause(self): return self.getTypedRuleContext(VHDLParser.Rule_UseClauseContext, 0) + def rule_GroupTemplateDeclaration(self): + return self.getTypedRuleContext(VHDLParser.Rule_GroupTemplateDeclarationContext, 0) + + def rule_GroupDeclaration(self): + return self.getTypedRuleContext(VHDLParser.Rule_GroupDeclarationContext, 0) + def getRuleIndex(self): return VHDLParser.RULE_rule_ProtectedTypeBodyDeclarativeItem @@ -15927,101 +16265,113 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ProtectedTypeBodyDeclarativeItem(self): localctx = VHDLParser.Rule_ProtectedTypeBodyDeclarativeItemContext(self, self._ctx, self.state) - self.enterRule(localctx, 376, self.RULE_rule_ProtectedTypeBodyDeclarativeItem) + self.enterRule(localctx, 380, self.RULE_rule_ProtectedTypeBodyDeclarativeItem) try: - self.state = 2351 + self.state = 2442 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 253, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 268, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 2336 + self.state = 2425 self.rule_SubprogramDeclaration() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 2337 + self.state = 2426 self.rule_SubprogramBody() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 2338 + self.state = 2427 self.rule_SubprogramInstantiationDeclaration() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 2339 + self.state = 2428 self.rule_PackageDeclaration() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) - self.state = 2340 + self.state = 2429 self.rule_PackageBody() pass elif la_ == 6: self.enterOuterAlt(localctx, 6) - self.state = 2341 + self.state = 2430 self.rule_PackageInstantiationDeclaration() pass elif la_ == 7: self.enterOuterAlt(localctx, 7) - self.state = 2342 + self.state = 2431 self.rule_TypeDeclaration() pass elif la_ == 8: self.enterOuterAlt(localctx, 8) - self.state = 2343 + self.state = 2432 self.rule_SubtypeDeclaration() pass elif la_ == 9: self.enterOuterAlt(localctx, 9) - self.state = 2344 + self.state = 2433 self.rule_ConstantDeclaration() pass elif la_ == 10: self.enterOuterAlt(localctx, 10) - self.state = 2345 + self.state = 2434 self.rule_VariableDeclaration() pass elif la_ == 11: self.enterOuterAlt(localctx, 11) - self.state = 2346 + self.state = 2435 self.rule_FileDeclaration() pass elif la_ == 12: self.enterOuterAlt(localctx, 12) - self.state = 2347 + self.state = 2436 self.rule_AliasDeclaration() pass elif la_ == 13: self.enterOuterAlt(localctx, 13) - self.state = 2348 + self.state = 2437 self.rule_AttributeDeclaration() pass elif la_ == 14: self.enterOuterAlt(localctx, 14) - self.state = 2349 + self.state = 2438 self.rule_AttributeSpecification() pass elif la_ == 15: self.enterOuterAlt(localctx, 15) - self.state = 2350 + self.state = 2439 self.rule_UseClause() pass + elif la_ == 16: + self.enterOuterAlt(localctx, 16) + self.state = 2440 + self.rule_GroupTemplateDeclaration() + pass + + elif la_ == 17: + self.enterOuterAlt(localctx, 17) + self.state = 2441 + self.rule_GroupDeclaration() + pass + except RecognitionException as re: localctx.exception = re @@ -16071,36 +16421,33 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ProtectedTypeDeclaration(self): localctx = VHDLParser.Rule_ProtectedTypeDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 378, self.RULE_rule_ProtectedTypeDeclaration) + self.enterRule(localctx, 382, self.RULE_rule_ProtectedTypeDeclaration) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2353 + self.state = 2444 self.match(VHDLParser.KW_PROTECTED) - self.state = 2357 + self.state = 2448 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ( - (1 << VHDLParser.KW_ALIAS) | (1 << VHDLParser.KW_ATTRIBUTE) | (1 << VHDLParser.KW_FUNCTION) | ( - 1 << VHDLParser.KW_IMPURE))) != 0) or ((((_la - 74)) & ~0x3f) == 0 and ((1 << (_la - 74)) & ( - (1 << (VHDLParser.KW_PRIVATE - 74)) | (1 << (VHDLParser.KW_PROCEDURE - 74)) | ( - 1 << (VHDLParser.KW_PURE - 74)) | (1 << (VHDLParser.KW_USE - 74)))) != 0): - self.state = 2354 + while (((_la) & ~0x3f) == 0 and ((1 << _la) & 70918500024832) != 0) or ( + (((_la - 74)) & ~0x3f) == 0 and ((1 << (_la - 74)) & 17179869203) != 0): + self.state = 2445 localctx._rule_ProtectedTypeDeclarativeItem = self.rule_ProtectedTypeDeclarativeItem() localctx.declaredItems.append(localctx._rule_ProtectedTypeDeclarativeItem) - self.state = 2359 + self.state = 2450 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 2360 + self.state = 2451 self.match(VHDLParser.KW_END) - self.state = 2361 + self.state = 2452 self.match(VHDLParser.KW_PROTECTED) - self.state = 2363 + self.state = 2454 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: - self.state = 2362 + if _la == 163: + self.state = 2453 localctx.name2 = self.match(VHDLParser.LIT_IDENTIFIER) @@ -16149,44 +16496,44 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ProtectedTypeDeclarativeItem(self): localctx = VHDLParser.Rule_ProtectedTypeDeclarativeItemContext(self, self._ctx, self.state) - self.enterRule(localctx, 380, self.RULE_rule_ProtectedTypeDeclarativeItem) + self.enterRule(localctx, 384, self.RULE_rule_ProtectedTypeDeclarativeItem) try: - self.state = 2371 + self.state = 2462 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 256, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 271, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 2365 + self.state = 2456 self.rule_SubprogramDeclaration() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 2366 + self.state = 2457 self.rule_SubprogramInstantiationDeclaration() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 2367 + self.state = 2458 self.rule_PrivateVariableDeclaration() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 2368 + self.state = 2459 self.rule_AliasDeclaration() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) - self.state = 2369 + self.state = 2460 self.rule_AttributeSpecification() pass elif la_ == 6: self.enterOuterAlt(localctx, 6) - self.state = 2370 + self.state = 2461 self.rule_UseClause() pass @@ -16224,20 +16571,20 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ProtectedTypeDefinition(self): localctx = VHDLParser.Rule_ProtectedTypeDefinitionContext(self, self._ctx, self.state) - self.enterRule(localctx, 382, self.RULE_rule_ProtectedTypeDefinition) + self.enterRule(localctx, 386, self.RULE_rule_ProtectedTypeDefinition) try: - self.state = 2375 + self.state = 2466 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 257, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 272, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 2373 + self.state = 2464 self.rule_ProtectedTypeDeclaration() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 2374 + self.state = 2465 self.rule_ProtectedTypeBody() pass @@ -16279,19 +16626,19 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ProtectedTypeInstantiationDefinition(self): localctx = VHDLParser.Rule_ProtectedTypeInstantiationDefinitionContext(self, self._ctx, self.state) - self.enterRule(localctx, 384, self.RULE_rule_ProtectedTypeInstantiationDefinition) + self.enterRule(localctx, 388, self.RULE_rule_ProtectedTypeInstantiationDefinition) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2377 + self.state = 2468 self.match(VHDLParser.KW_NEW) - self.state = 2378 + self.state = 2469 self.rule_Name(0) - self.state = 2380 + self.state = 2471 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_GENERIC: - self.state = 2379 + if _la == 42: + self.state = 2470 localctx.genericMapAspect = self.rule_GenericMapAspect() @@ -16309,15 +16656,15 @@ class Rule_QualifiedExpressionContext(ParserRuleContext): def __init__(self, parser, parent: ParserRuleContext = None, invokingState: int = -1): super().__init__(parent, invokingState) self.parser = parser - self.typeMark = None # Rule_TypeMarkContext + self.typeMark = None # Rule_NameContext self.expression = None # Rule_ExpressionContext self.aggregate = None # Rule_AggregateContext def TOK_TICK(self): return self.getToken(VHDLParser.TOK_TICK, 0) - def rule_TypeMark(self): - return self.getTypedRuleContext(VHDLParser.Rule_TypeMarkContext, 0) + def rule_Name(self): + return self.getTypedRuleContext(VHDLParser.Rule_NameContext, 0) def TOK_LP(self): return self.getToken(VHDLParser.TOK_LP, 0) @@ -16343,30 +16690,30 @@ def accept(self, visitor: ParseTreeVisitor): def rule_QualifiedExpression(self): localctx = VHDLParser.Rule_QualifiedExpressionContext(self, self._ctx, self.state) - self.enterRule(localctx, 386, self.RULE_rule_QualifiedExpression) + self.enterRule(localctx, 390, self.RULE_rule_QualifiedExpression) try: self.enterOuterAlt(localctx, 1) - self.state = 2382 - localctx.typeMark = self.rule_TypeMark() - self.state = 2383 + self.state = 2473 + localctx.typeMark = self.rule_Name(0) + self.state = 2474 self.match(VHDLParser.TOK_TICK) - self.state = 2390 + self.state = 2481 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 259, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 274, self._ctx) if la_ == 1: pass elif la_ == 2: - self.state = 2385 + self.state = 2476 self.match(VHDLParser.TOK_LP) - self.state = 2386 + self.state = 2477 localctx.expression = self.rule_Expression(0) - self.state = 2387 + self.state = 2478 self.match(VHDLParser.TOK_RP) pass elif la_ == 3: - self.state = 2389 + self.state = 2480 localctx.aggregate = self.rule_Aggregate() pass @@ -16407,26 +16754,26 @@ def accept(self, visitor: ParseTreeVisitor): def rule_Range(self): localctx = VHDLParser.Rule_RangeContext(self, self._ctx, self.state) - self.enterRule(localctx, 388, self.RULE_rule_Range) + self.enterRule(localctx, 392, self.RULE_rule_Range) try: - self.state = 2395 + self.state = 2486 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 260, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 275, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 2392 + self.state = 2483 self.rule_Name(0) pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 2393 + self.state = 2484 self.rule_SimpleRange() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 2394 + self.state = 2485 self.rule_Expression(0) pass @@ -16464,12 +16811,12 @@ def accept(self, visitor: ParseTreeVisitor): def rule_RangeConstraint(self): localctx = VHDLParser.Rule_RangeConstraintContext(self, self._ctx, self.state) - self.enterRule(localctx, 390, self.RULE_rule_RangeConstraint) + self.enterRule(localctx, 394, self.RULE_rule_RangeConstraint) try: self.enterOuterAlt(localctx, 1) - self.state = 2397 + self.state = 2488 self.match(VHDLParser.KW_RANGE) - self.state = 2398 + self.state = 2489 self.rule_Range() except RecognitionException as re: localctx.exception = re @@ -16516,27 +16863,27 @@ def accept(self, visitor: ParseTreeVisitor): def rule_RecordConstraint(self): localctx = VHDLParser.Rule_RecordConstraintContext(self, self._ctx, self.state) - self.enterRule(localctx, 392, self.RULE_rule_RecordConstraint) + self.enterRule(localctx, 396, self.RULE_rule_RecordConstraint) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2400 + self.state = 2491 self.match(VHDLParser.TOK_LP) - self.state = 2401 + self.state = 2492 self.rule_RecordElementConstraint() - self.state = 2406 + self.state = 2497 self._errHandler.sync(self) _la = self._input.LA(1) - while _la == VHDLParser.TOK_COMMA: - self.state = 2402 + while _la == 151: + self.state = 2493 self.match(VHDLParser.TOK_COMMA) - self.state = 2403 + self.state = 2494 self.rule_RecordElementConstraint() - self.state = 2408 + self.state = 2499 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 2409 + self.state = 2500 self.match(VHDLParser.TOK_RP) except RecognitionException as re: localctx.exception = re @@ -16571,12 +16918,12 @@ def accept(self, visitor: ParseTreeVisitor): def rule_RecordElementConstraint(self): localctx = VHDLParser.Rule_RecordElementConstraintContext(self, self._ctx, self.state) - self.enterRule(localctx, 394, self.RULE_rule_RecordElementConstraint) + self.enterRule(localctx, 398, self.RULE_rule_RecordElementConstraint) try: self.enterOuterAlt(localctx, 1) - self.state = 2411 + self.state = 2502 self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 2412 + self.state = 2503 self.rule_ElementConstraint() except RecognitionException as re: localctx.exception = re @@ -16619,23 +16966,23 @@ def accept(self, visitor: ParseTreeVisitor): def rule_RecordElementList(self): localctx = VHDLParser.Rule_RecordElementListContext(self, self._ctx, self.state) - self.enterRule(localctx, 396, self.RULE_rule_RecordElementList) + self.enterRule(localctx, 400, self.RULE_rule_RecordElementList) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2414 + self.state = 2505 localctx._LIT_IDENTIFIER = self.match(VHDLParser.LIT_IDENTIFIER) localctx.elements.append(localctx._LIT_IDENTIFIER) - self.state = 2419 + self.state = 2510 self._errHandler.sync(self) _la = self._input.LA(1) - while _la == VHDLParser.TOK_COMMA: - self.state = 2415 + while _la == 151: + self.state = 2506 self.match(VHDLParser.TOK_COMMA) - self.state = 2416 + self.state = 2507 localctx._LIT_IDENTIFIER = self.match(VHDLParser.LIT_IDENTIFIER) localctx.elements.append(localctx._LIT_IDENTIFIER) - self.state = 2421 + self.state = 2512 self._errHandler.sync(self) _la = self._input.LA(1) @@ -16672,12 +17019,12 @@ def accept(self, visitor: ParseTreeVisitor): def rule_RecordElementResolution(self): localctx = VHDLParser.Rule_RecordElementResolutionContext(self, self._ctx, self.state) - self.enterRule(localctx, 398, self.RULE_rule_RecordElementResolution) + self.enterRule(localctx, 402, self.RULE_rule_RecordElementResolution) try: self.enterOuterAlt(localctx, 1) - self.state = 2422 + self.state = 2513 self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 2423 + self.state = 2514 self.rule_ResolutionIndication() except RecognitionException as re: localctx.exception = re @@ -16718,21 +17065,21 @@ def accept(self, visitor: ParseTreeVisitor): def rule_RecordResolution(self): localctx = VHDLParser.Rule_RecordResolutionContext(self, self._ctx, self.state) - self.enterRule(localctx, 400, self.RULE_rule_RecordResolution) + self.enterRule(localctx, 404, self.RULE_rule_RecordResolution) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2425 + self.state = 2516 self.rule_RecordElementResolution() - self.state = 2430 + self.state = 2521 self._errHandler.sync(self) _la = self._input.LA(1) - while _la == VHDLParser.TOK_COMMA: - self.state = 2426 + while _la == 151: + self.state = 2517 self.match(VHDLParser.TOK_COMMA) - self.state = 2427 + self.state = 2518 self.rule_RecordElementResolution() - self.state = 2432 + self.state = 2523 self._errHandler.sync(self) _la = self._input.LA(1) @@ -16784,32 +17131,32 @@ def accept(self, visitor: ParseTreeVisitor): def rule_RecordTypeDefinition(self): localctx = VHDLParser.Rule_RecordTypeDefinitionContext(self, self._ctx, self.state) - self.enterRule(localctx, 402, self.RULE_rule_RecordTypeDefinition) + self.enterRule(localctx, 406, self.RULE_rule_RecordTypeDefinition) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2433 + self.state = 2524 self.match(VHDLParser.KW_RECORD) - self.state = 2437 + self.state = 2528 self._errHandler.sync(self) _la = self._input.LA(1) - while _la == VHDLParser.LIT_IDENTIFIER: - self.state = 2434 + while _la == 163: + self.state = 2525 localctx._rule_ElementDeclaration = self.rule_ElementDeclaration() localctx.elements.append(localctx._rule_ElementDeclaration) - self.state = 2439 + self.state = 2530 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 2440 + self.state = 2531 self.match(VHDLParser.KW_END) - self.state = 2441 + self.state = 2532 self.match(VHDLParser.KW_RECORD) - self.state = 2443 + self.state = 2534 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: - self.state = 2442 + if _la == 163: + self.state = 2533 localctx.name2 = self.match(VHDLParser.LIT_IDENTIFIER) @@ -16852,21 +17199,21 @@ def accept(self, visitor: ParseTreeVisitor): def rule_RecordModeViewIndication(self): localctx = VHDLParser.Rule_RecordModeViewIndicationContext(self, self._ctx, self.state) - self.enterRule(localctx, 404, self.RULE_rule_RecordModeViewIndication) + self.enterRule(localctx, 408, self.RULE_rule_RecordModeViewIndication) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2445 + self.state = 2536 self.match(VHDLParser.KW_VIEW) - self.state = 2446 + self.state = 2537 self.rule_Name(0) - self.state = 2449 + self.state = 2540 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_OF: - self.state = 2447 + if _la == 64: + self.state = 2538 self.match(VHDLParser.KW_OF) - self.state = 2448 + self.state = 2539 self.rule_SubtypeIndication() @@ -16912,23 +17259,23 @@ def accept(self, visitor: ParseTreeVisitor): def rule_RelativePathname(self): localctx = VHDLParser.Rule_RelativePathnameContext(self, self._ctx, self.state) - self.enterRule(localctx, 406, self.RULE_rule_RelativePathname) + self.enterRule(localctx, 410, self.RULE_rule_RelativePathname) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2455 + self.state = 2546 self._errHandler.sync(self) _la = self._input.LA(1) - while _la == VHDLParser.TOK_CIRCUMFLEX: - self.state = 2451 + while _la == 156: + self.state = 2542 self.match(VHDLParser.TOK_CIRCUMFLEX) - self.state = 2452 + self.state = 2543 self.match(VHDLParser.TOK_DOT) - self.state = 2457 + self.state = 2548 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 2458 + self.state = 2549 self.rule_PartialPathname() except RecognitionException as re: localctx.exception = re @@ -16981,33 +17328,33 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ReportStatement(self): localctx = VHDLParser.Rule_ReportStatementContext(self, self._ctx, self.state) - self.enterRule(localctx, 408, self.RULE_rule_ReportStatement) + self.enterRule(localctx, 412, self.RULE_rule_ReportStatement) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2462 + self.state = 2553 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: - self.state = 2460 + if _la == 163: + self.state = 2551 localctx.label = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 2461 + self.state = 2552 self.match(VHDLParser.TOK_COLON) - self.state = 2464 + self.state = 2555 self.match(VHDLParser.KW_REPORT) - self.state = 2465 + self.state = 2556 localctx.reportExpression = self.rule_Expression(0) - self.state = 2468 + self.state = 2559 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_SEVERITY: - self.state = 2466 + if _la == 91: + self.state = 2557 self.match(VHDLParser.KW_SEVERITY) - self.state = 2467 + self.state = 2558 localctx.severityExpression = self.rule_Expression(0) - self.state = 2470 + self.state = 2561 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -17048,23 +17395,23 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ResolutionIndication(self): localctx = VHDLParser.Rule_ResolutionIndicationContext(self, self._ctx, self.state) - self.enterRule(localctx, 410, self.RULE_rule_ResolutionIndication) + self.enterRule(localctx, 414, self.RULE_rule_ResolutionIndication) try: - self.state = 2477 + self.state = 2568 self._errHandler.sync(self) token = self._input.LA(1) - if token in [VHDLParser.TOK_DLA, VHDLParser.LIT_CHARACTER, VHDLParser.LIT_STRING, VHDLParser.LIT_IDENTIFIER]: + if token in [147, 161, 162, 163]: self.enterOuterAlt(localctx, 1) - self.state = 2472 + self.state = 2563 self.rule_Name(0) pass - elif token in [VHDLParser.TOK_LP]: + elif token in [143]: self.enterOuterAlt(localctx, 2) - self.state = 2473 + self.state = 2564 self.match(VHDLParser.TOK_LP) - self.state = 2474 + self.state = 2565 self.rule_ElementResolution() - self.state = 2475 + self.state = 2566 self.match(VHDLParser.TOK_RP) pass else: @@ -17103,20 +17450,20 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ReturnStatement(self): localctx = VHDLParser.Rule_ReturnStatementContext(self, self._ctx, self.state) - self.enterRule(localctx, 412, self.RULE_rule_ReturnStatement) + self.enterRule(localctx, 416, self.RULE_rule_ReturnStatement) try: - self.state = 2481 + self.state = 2572 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 271, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 286, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 2479 + self.state = 2570 self.rule_PlainReturnStatement() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 2480 + self.state = 2571 self.rule_ValueReturnStatement() pass @@ -17151,10 +17498,10 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ScalarIncompleteTypeDefinition(self): localctx = VHDLParser.Rule_ScalarIncompleteTypeDefinitionContext(self, self._ctx, self.state) - self.enterRule(localctx, 414, self.RULE_rule_ScalarIncompleteTypeDefinition) + self.enterRule(localctx, 418, self.RULE_rule_ScalarIncompleteTypeDefinition) try: self.enterOuterAlt(localctx, 1) - self.state = 2483 + self.state = 2574 self.match(VHDLParser.TOK_BOX) except RecognitionException as re: localctx.exception = re @@ -17195,32 +17542,32 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ScalarTypeDefinition(self): localctx = VHDLParser.Rule_ScalarTypeDefinitionContext(self, self._ctx, self.state) - self.enterRule(localctx, 416, self.RULE_rule_ScalarTypeDefinition) + self.enterRule(localctx, 420, self.RULE_rule_ScalarTypeDefinition) try: - self.state = 2489 + self.state = 2580 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 272, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 287, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 2485 + self.state = 2576 self.rule_EnumerationTypeDefinition() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 2486 + self.state = 2577 self.rule_IntegerTypeDefinition() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 2487 + self.state = 2578 self.rule_FloatingTypeDefinition() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 2488 + self.state = 2579 self.rule_PhysicalTypeDefinition() pass @@ -17240,7 +17587,8 @@ def __init__(self, parser, parent: ParserRuleContext = None, invokingState: int super().__init__(parent, invokingState) self.parser = parser self.name = None # Token - self.value = None # Rule_PhysicalLiteralContext + self.value = None # Token + self.unit = None # Token def OP_EQ(self): return self.getToken(VHDLParser.OP_EQ, 0) @@ -17248,11 +17596,14 @@ def OP_EQ(self): def TOK_SEMICOL(self): return self.getToken(VHDLParser.TOK_SEMICOL, 0) - def LIT_IDENTIFIER(self): - return self.getToken(VHDLParser.LIT_IDENTIFIER, 0) + def LIT_IDENTIFIER(self, i: int = None): + if i is None: + return self.getTokens(VHDLParser.LIT_IDENTIFIER) + else: + return self.getToken(VHDLParser.LIT_IDENTIFIER, i) - def rule_PhysicalLiteral(self): - return self.getTypedRuleContext(VHDLParser.Rule_PhysicalLiteralContext, 0) + def LIT_ABSTRACT(self): + return self.getToken(VHDLParser.LIT_ABSTRACT, 0) def getRuleIndex(self): return VHDLParser.RULE_rule_SecondaryUnitDeclaration @@ -17266,16 +17617,24 @@ def accept(self, visitor: ParseTreeVisitor): def rule_SecondaryUnitDeclaration(self): localctx = VHDLParser.Rule_SecondaryUnitDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 418, self.RULE_rule_SecondaryUnitDeclaration) + self.enterRule(localctx, 422, self.RULE_rule_SecondaryUnitDeclaration) + self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2491 + self.state = 2582 localctx.name = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 2492 + self.state = 2583 self.match(VHDLParser.OP_EQ) - self.state = 2493 - localctx.value = self.rule_PhysicalLiteral() - self.state = 2494 + self.state = 2585 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la == 159: + self.state = 2584 + localctx.value = self.match(VHDLParser.LIT_ABSTRACT) + + self.state = 2587 + localctx.unit = self.match(VHDLParser.LIT_IDENTIFIER) + self.state = 2588 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -17328,31 +17687,31 @@ def accept(self, visitor: ParseTreeVisitor): def rule_SelectedExpressions(self): localctx = VHDLParser.Rule_SelectedExpressionsContext(self, self._ctx, self.state) - self.enterRule(localctx, 420, self.RULE_rule_SelectedExpressions) + self.enterRule(localctx, 424, self.RULE_rule_SelectedExpressions) try: self.enterOuterAlt(localctx, 1) - self.state = 2503 + self.state = 2597 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input, 273, self._ctx) + _alt = self._interp.adaptivePredict(self._input, 289, self._ctx) while _alt != 2 and _alt != ATN.INVALID_ALT_NUMBER: if _alt == 1: - self.state = 2496 + self.state = 2590 self.rule_Expression(0) - self.state = 2497 + self.state = 2591 self.match(VHDLParser.KW_WHEN) - self.state = 2498 + self.state = 2592 self.rule_Choices() - self.state = 2499 + self.state = 2593 self.match(VHDLParser.TOK_COMMA) - self.state = 2505 + self.state = 2599 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input, 273, self._ctx) + _alt = self._interp.adaptivePredict(self._input, 289, self._ctx) - self.state = 2506 + self.state = 2600 self.rule_Expression(0) - self.state = 2507 + self.state = 2601 self.match(VHDLParser.KW_WHEN) - self.state = 2508 + self.state = 2602 self.rule_Choices() except RecognitionException as re: localctx.exception = re @@ -17368,6 +17727,7 @@ class Rule_SelectedForceAssignmentContext(ParserRuleContext): def __init__(self, parser, parent: ParserRuleContext = None, invokingState: int = -1): super().__init__(parent, invokingState) self.parser = parser + self.forceMode = None # Token def KW_WITH(self): return self.getToken(VHDLParser.KW_WITH, 0) @@ -17387,15 +17747,18 @@ def TOK_SIG_ASSIGN(self): def KW_FORCE(self): return self.getToken(VHDLParser.KW_FORCE, 0) - def rule_ForceMode(self): - return self.getTypedRuleContext(VHDLParser.Rule_ForceModeContext, 0) - def rule_SelectedExpressions(self): return self.getTypedRuleContext(VHDLParser.Rule_SelectedExpressionsContext, 0) def TOK_SEMICOL(self): return self.getToken(VHDLParser.TOK_SEMICOL, 0) + def KW_IN(self): + return self.getToken(VHDLParser.KW_IN, 0) + + def KW_OUT(self): + return self.getToken(VHDLParser.KW_OUT, 0) + def TOK_QUESTION(self): return self.getToken(VHDLParser.TOK_QUESTION, 0) @@ -17411,34 +17774,40 @@ def accept(self, visitor: ParseTreeVisitor): def rule_SelectedForceAssignment(self): localctx = VHDLParser.Rule_SelectedForceAssignmentContext(self, self._ctx, self.state) - self.enterRule(localctx, 422, self.RULE_rule_SelectedForceAssignment) + self.enterRule(localctx, 426, self.RULE_rule_SelectedForceAssignment) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2510 + self.state = 2604 self.match(VHDLParser.KW_WITH) - self.state = 2511 + self.state = 2605 self.rule_Expression(0) - self.state = 2512 + self.state = 2606 self.match(VHDLParser.KW_SELECT) - self.state = 2514 + self.state = 2608 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.TOK_QUESTION: - self.state = 2513 + if _la == 154: + self.state = 2607 self.match(VHDLParser.TOK_QUESTION) - self.state = 2516 + self.state = 2610 self.rule_Target() - self.state = 2517 + self.state = 2611 self.match(VHDLParser.TOK_SIG_ASSIGN) - self.state = 2518 + self.state = 2612 self.match(VHDLParser.KW_FORCE) - self.state = 2519 - self.rule_ForceMode() - self.state = 2520 + self.state = 2613 + localctx.forceMode = self._input.LT(1) + _la = self._input.LA(1) + if not (_la == 47 or _la == 69): + localctx.forceMode = self._errHandler.recoverInline(self) + else: + self._errHandler.reportMatch(self) + self.consume() + self.state = 2614 self.rule_SelectedExpressions() - self.state = 2521 + self.state = 2615 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -17484,56 +17853,56 @@ def accept(self, visitor: ParseTreeVisitor): def rule_SelectedName2(self): localctx = VHDLParser.Rule_SelectedName2Context(self, self._ctx, self.state) - self.enterRule(localctx, 424, self.RULE_rule_SelectedName2) + self.enterRule(localctx, 428, self.RULE_rule_SelectedName2) self._la = 0 # Token type try: - self.state = 2540 + self.state = 2634 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 277, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 293, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 2523 + self.state = 2617 localctx._LIT_IDENTIFIER = self.match(VHDLParser.LIT_IDENTIFIER) localctx.names.append(localctx._LIT_IDENTIFIER) - self.state = 2526 + self.state = 2620 self._errHandler.sync(self) _la = self._input.LA(1) while True: - self.state = 2524 + self.state = 2618 self.match(VHDLParser.TOK_DOT) - self.state = 2525 + self.state = 2619 localctx._LIT_IDENTIFIER = self.match(VHDLParser.LIT_IDENTIFIER) localctx.names.append(localctx._LIT_IDENTIFIER) - self.state = 2528 + self.state = 2622 self._errHandler.sync(self) _la = self._input.LA(1) - if not (_la == VHDLParser.TOK_DOT): + if not (_la == 153): break pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 2530 + self.state = 2624 localctx._LIT_IDENTIFIER = self.match(VHDLParser.LIT_IDENTIFIER) localctx.names.append(localctx._LIT_IDENTIFIER) - self.state = 2535 + self.state = 2629 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input, 276, self._ctx) + _alt = self._interp.adaptivePredict(self._input, 292, self._ctx) while _alt != 2 and _alt != ATN.INVALID_ALT_NUMBER: if _alt == 1: - self.state = 2531 + self.state = 2625 self.match(VHDLParser.TOK_DOT) - self.state = 2532 + self.state = 2626 localctx._LIT_IDENTIFIER = self.match(VHDLParser.LIT_IDENTIFIER) localctx.names.append(localctx._LIT_IDENTIFIER) - self.state = 2537 + self.state = 2631 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input, 276, self._ctx) + _alt = self._interp.adaptivePredict(self._input, 292, self._ctx) - self.state = 2538 + self.state = 2632 self.match(VHDLParser.TOK_DOT) - self.state = 2539 + self.state = 2633 self.match(VHDLParser.KW_ALL) pass @@ -17571,20 +17940,20 @@ def accept(self, visitor: ParseTreeVisitor): def rule_SelectedSignalAssignment(self): localctx = VHDLParser.Rule_SelectedSignalAssignmentContext(self, self._ctx, self.state) - self.enterRule(localctx, 426, self.RULE_rule_SelectedSignalAssignment) + self.enterRule(localctx, 430, self.RULE_rule_SelectedSignalAssignment) try: - self.state = 2544 + self.state = 2638 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 278, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 294, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 2542 + self.state = 2636 self.rule_SelectedWaveformAssignment() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 2543 + self.state = 2637 self.rule_SelectedForceAssignment() pass @@ -17642,30 +18011,30 @@ def accept(self, visitor: ParseTreeVisitor): def rule_SelectedVariableAssignment(self): localctx = VHDLParser.Rule_SelectedVariableAssignmentContext(self, self._ctx, self.state) - self.enterRule(localctx, 428, self.RULE_rule_SelectedVariableAssignment) + self.enterRule(localctx, 432, self.RULE_rule_SelectedVariableAssignment) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2546 + self.state = 2640 self.match(VHDLParser.KW_WITH) - self.state = 2547 + self.state = 2641 localctx.expression = self.rule_Expression(0) - self.state = 2548 + self.state = 2642 self.match(VHDLParser.KW_SELECT) - self.state = 2550 + self.state = 2644 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.TOK_QUESTION: - self.state = 2549 + if _la == 154: + self.state = 2643 self.match(VHDLParser.TOK_QUESTION) - self.state = 2552 + self.state = 2646 localctx.target = self.rule_Target() - self.state = 2553 + self.state = 2647 self.match(VHDLParser.TOK_VAR_ASSIGN) - self.state = 2554 + self.state = 2648 self.rule_SelectedExpressions() - self.state = 2555 + self.state = 2649 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -17724,32 +18093,32 @@ def accept(self, visitor: ParseTreeVisitor): def rule_SelectedWaveformAssignment(self): localctx = VHDLParser.Rule_SelectedWaveformAssignmentContext(self, self._ctx, self.state) - self.enterRule(localctx, 430, self.RULE_rule_SelectedWaveformAssignment) + self.enterRule(localctx, 434, self.RULE_rule_SelectedWaveformAssignment) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2557 + self.state = 2651 self.match(VHDLParser.KW_WITH) - self.state = 2558 + self.state = 2652 localctx.expression = self.rule_Expression(0) - self.state = 2559 + self.state = 2653 self.match(VHDLParser.KW_SELECT) - self.state = 2561 + self.state = 2655 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.TOK_QUESTION: - self.state = 2560 + if _la == 154: + self.state = 2654 self.match(VHDLParser.TOK_QUESTION) - self.state = 2563 + self.state = 2657 localctx.target = self.rule_Target() - self.state = 2564 + self.state = 2658 self.match(VHDLParser.TOK_SIG_ASSIGN) - self.state = 2565 + self.state = 2659 self.rule_DelayMechanism() - self.state = 2566 + self.state = 2660 localctx.waveform = self.rule_SelectedWaveforms() - self.state = 2567 + self.state = 2661 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -17802,31 +18171,31 @@ def accept(self, visitor: ParseTreeVisitor): def rule_SelectedWaveforms(self): localctx = VHDLParser.Rule_SelectedWaveformsContext(self, self._ctx, self.state) - self.enterRule(localctx, 432, self.RULE_rule_SelectedWaveforms) + self.enterRule(localctx, 436, self.RULE_rule_SelectedWaveforms) try: self.enterOuterAlt(localctx, 1) - self.state = 2576 + self.state = 2670 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input, 281, self._ctx) + _alt = self._interp.adaptivePredict(self._input, 297, self._ctx) while _alt != 2 and _alt != ATN.INVALID_ALT_NUMBER: if _alt == 1: - self.state = 2569 + self.state = 2663 self.rule_Waveform() - self.state = 2570 + self.state = 2664 self.match(VHDLParser.KW_WHEN) - self.state = 2571 + self.state = 2665 self.rule_Choices() - self.state = 2572 + self.state = 2666 self.match(VHDLParser.TOK_COMMA) - self.state = 2578 + self.state = 2672 self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input, 281, self._ctx) + _alt = self._interp.adaptivePredict(self._input, 297, self._ctx) - self.state = 2579 + self.state = 2673 self.rule_Waveform() - self.state = 2580 + self.state = 2674 self.match(VHDLParser.KW_WHEN) - self.state = 2581 + self.state = 2675 self.rule_Choices() except RecognitionException as re: localctx.exception = re @@ -17862,12 +18231,12 @@ def accept(self, visitor: ParseTreeVisitor): def rule_SensitivityClause(self): localctx = VHDLParser.Rule_SensitivityClauseContext(self, self._ctx, self.state) - self.enterRule(localctx, 434, self.RULE_rule_SensitivityClause) + self.enterRule(localctx, 438, self.RULE_rule_SensitivityClause) try: self.enterOuterAlt(localctx, 1) - self.state = 2583 + self.state = 2677 self.match(VHDLParser.KW_ON) - self.state = 2584 + self.state = 2678 localctx.sensitivityList = self.rule_SensitivityList() except RecognitionException as re: localctx.exception = re @@ -17910,23 +18279,23 @@ def accept(self, visitor: ParseTreeVisitor): def rule_SensitivityList(self): localctx = VHDLParser.Rule_SensitivityListContext(self, self._ctx, self.state) - self.enterRule(localctx, 436, self.RULE_rule_SensitivityList) + self.enterRule(localctx, 440, self.RULE_rule_SensitivityList) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2586 + self.state = 2680 localctx._rule_Name = self.rule_Name(0) localctx.name.append(localctx._rule_Name) - self.state = 2591 + self.state = 2685 self._errHandler.sync(self) _la = self._input.LA(1) - while _la == VHDLParser.TOK_COMMA: - self.state = 2587 + while _la == 151: + self.state = 2681 self.match(VHDLParser.TOK_COMMA) - self.state = 2588 + self.state = 2682 localctx._rule_Name = self.rule_Name(0) localctx.name.append(localctx._rule_Name) - self.state = 2593 + self.state = 2687 self._errHandler.sync(self) _la = self._input.LA(1) @@ -17966,18 +18335,18 @@ def KW_END(self): def TOK_SEMICOL(self): return self.getToken(VHDLParser.TOK_SEMICOL, 0) - def LIT_IDENTIFIER(self, i: int = None): - if i is None: - return self.getTokens(VHDLParser.LIT_IDENTIFIER) - else: - return self.getToken(VHDLParser.LIT_IDENTIFIER, i) - def TOK_COLON(self): return self.getToken(VHDLParser.TOK_COLON, 0) def KW_IS(self): return self.getToken(VHDLParser.KW_IS, 0) + def LIT_IDENTIFIER(self, i: int = None): + if i is None: + return self.getTokens(VHDLParser.LIT_IDENTIFIER) + else: + return self.getToken(VHDLParser.LIT_IDENTIFIER, i) + def rule_ProcessDeclarativeItem(self, i: int = None): if i is None: return self.getTypedRuleContexts(VHDLParser.Rule_ProcessDeclarativeItemContext) @@ -18002,80 +18371,72 @@ def accept(self, visitor: ParseTreeVisitor): def rule_SequentialBlockStatement(self): localctx = VHDLParser.Rule_SequentialBlockStatementContext(self, self._ctx, self.state) - self.enterRule(localctx, 438, self.RULE_rule_SequentialBlockStatement) + self.enterRule(localctx, 442, self.RULE_rule_SequentialBlockStatement) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2596 + self.state = 2690 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: - self.state = 2594 + if _la == 163: + self.state = 2688 localctx.label = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 2595 + self.state = 2689 self.match(VHDLParser.TOK_COLON) - self.state = 2598 + self.state = 2692 self.match(VHDLParser.KW_BLOCK) - self.state = 2600 + self.state = 2694 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_IS: - self.state = 2599 + if _la == 50: + self.state = 2693 self.match(VHDLParser.KW_IS) - self.state = 2605 + self.state = 2699 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ( - (1 << VHDLParser.KW_ALIAS) | (1 << VHDLParser.KW_ATTRIBUTE) | (1 << VHDLParser.KW_CONSTANT) | ( - 1 << VHDLParser.KW_FILE) | (1 << VHDLParser.KW_FUNCTION) | (1 << VHDLParser.KW_IMPURE))) != 0) or ( - (((_la - 70)) & ~0x3f) == 0 and ((1 << (_la - 70)) & ( - (1 << (VHDLParser.KW_PACKAGE - 70)) | (1 << (VHDLParser.KW_PROCEDURE - 70)) | ( - 1 << (VHDLParser.KW_PURE - 70)) | (1 << (VHDLParser.KW_SHARED - 70)) | (1 << (VHDLParser.KW_SUBTYPE - 70)) | ( - 1 << (VHDLParser.KW_TYPE - 70)) | (1 << (VHDLParser.KW_USE - 70)) | ( - 1 << (VHDLParser.KW_VARIABLE - 70)))) != 0): - self.state = 2602 + while (((_la) & ~0x3f) == 0 and ((1 << _la) & 88579439100416) != 0) or ( + (((_la - 70)) & ~0x3f) == 0 and ((1 << (_la - 70)) & 842086220065) != 0): + self.state = 2696 localctx._rule_ProcessDeclarativeItem = self.rule_ProcessDeclarativeItem() localctx.declaredItems.append(localctx._rule_ProcessDeclarativeItem) - self.state = 2607 + self.state = 2701 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 2608 + self.state = 2702 self.match(VHDLParser.KW_BEGIN) - self.state = 2612 + self.state = 2706 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ( - (1 << VHDLParser.KW_ASSERT) | (1 << VHDLParser.KW_BLOCK) | (1 << VHDLParser.KW_CASE) | ( - 1 << VHDLParser.KW_EXIT) | (1 << VHDLParser.KW_FOR) | (1 << VHDLParser.KW_IF) | (1 << VHDLParser.KW_LOOP) | ( - 1 << VHDLParser.KW_NEXT) | (1 << VHDLParser.KW_NULL))) != 0) or ((((_la - 85)) & ~0x3f) == 0 and ( - (1 << (_la - 85)) & ( - (1 << (VHDLParser.KW_REPORT - 85)) | (1 << (VHDLParser.KW_RETURN - 85)) | (1 << (VHDLParser.KW_WAIT - 85)) | ( - 1 << (VHDLParser.KW_WITH - 85)) | (1 << (VHDLParser.KW_WHILE - 85)) | (1 << (VHDLParser.TOK_LP - 85)) | ( - 1 << (VHDLParser.TOK_DLA - 85)))) != 0) or ((((_la - 162)) & ~0x3f) == 0 and ((1 << (_la - 162)) & ( - (1 << (VHDLParser.LIT_CHARACTER - 162)) | (1 << (VHDLParser.LIT_STRING - 162)) | ( - 1 << (VHDLParser.LIT_IDENTIFIER - 162)))) != 0): - self.state = 2609 + while (((_la) & ~0x3f) == 0 and ((1 << _la) & -8052400777563193344) != 0) or ( + (((_la - 85)) & ~0x3f) == 0 and ((1 << (_la - 85)) & 4899916406390259715) != 0) or ( + (((_la - 161)) & ~0x3f) == 0 and ((1 << (_la - 161)) & 7) != 0): + self.state = 2703 localctx._rule_SequentialStatement = self.rule_SequentialStatement() localctx.statements.append(localctx._rule_SequentialStatement) - self.state = 2614 + self.state = 2708 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 2615 + self.state = 2709 self.match(VHDLParser.KW_END) - self.state = 2617 + self.state = 2711 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_BLOCK: - self.state = 2616 + if _la == 18: + self.state = 2710 self.match(VHDLParser.KW_BLOCK) - self.state = 2619 - localctx.label2 = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 2620 + self.state = 2714 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la == 163: + self.state = 2713 + localctx.label2 = self.match(VHDLParser.LIT_IDENTIFIER) + + self.state = 2716 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -18146,92 +18507,92 @@ def accept(self, visitor: ParseTreeVisitor): def rule_SequentialStatement(self): localctx = VHDLParser.Rule_SequentialStatementContext(self, self._ctx, self.state) - self.enterRule(localctx, 440, self.RULE_rule_SequentialStatement) + self.enterRule(localctx, 444, self.RULE_rule_SequentialStatement) try: - self.state = 2636 + self.state = 2732 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 288, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 305, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 2622 + self.state = 2718 self.rule_WaitStatement() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 2623 + self.state = 2719 self.rule_AssertionStatement() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 2624 + self.state = 2720 self.rule_ReportStatement() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 2625 + self.state = 2721 self.rule_SignalAssignmentStatement() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) - self.state = 2626 + self.state = 2722 self.rule_VariableAssignmentStatement() pass elif la_ == 6: self.enterOuterAlt(localctx, 6) - self.state = 2627 + self.state = 2723 self.rule_ProcedureCallStatement() pass elif la_ == 7: self.enterOuterAlt(localctx, 7) - self.state = 2628 + self.state = 2724 self.rule_IfStatement() pass elif la_ == 8: self.enterOuterAlt(localctx, 8) - self.state = 2629 + self.state = 2725 self.rule_CaseStatement() pass elif la_ == 9: self.enterOuterAlt(localctx, 9) - self.state = 2630 + self.state = 2726 self.rule_LoopStatement() pass elif la_ == 10: self.enterOuterAlt(localctx, 10) - self.state = 2631 + self.state = 2727 self.rule_NextStatement() pass elif la_ == 11: self.enterOuterAlt(localctx, 11) - self.state = 2632 + self.state = 2728 self.rule_ExitStatement() pass elif la_ == 12: self.enterOuterAlt(localctx, 12) - self.state = 2633 + self.state = 2729 self.rule_ReturnStatement() pass elif la_ == 13: self.enterOuterAlt(localctx, 13) - self.state = 2634 + self.state = 2730 self.rule_NullStatement() pass elif la_ == 14: self.enterOuterAlt(localctx, 14) - self.state = 2635 + self.state = 2731 self.rule_SequentialBlockStatement() pass @@ -18279,33 +18640,33 @@ def accept(self, visitor: ParseTreeVisitor): def rule_SignalAssignmentStatement(self): localctx = VHDLParser.Rule_SignalAssignmentStatementContext(self, self._ctx, self.state) - self.enterRule(localctx, 442, self.RULE_rule_SignalAssignmentStatement) + self.enterRule(localctx, 446, self.RULE_rule_SignalAssignmentStatement) try: self.enterOuterAlt(localctx, 1) - self.state = 2640 + self.state = 2736 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 289, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 306, self._ctx) if la_ == 1: - self.state = 2638 + self.state = 2734 localctx.label = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 2639 + self.state = 2735 self.match(VHDLParser.TOK_COLON) - self.state = 2645 + self.state = 2741 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 290, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 307, self._ctx) if la_ == 1: - self.state = 2642 + self.state = 2738 self.rule_SimpleSignalAssignment() pass elif la_ == 2: - self.state = 2643 + self.state = 2739 self.rule_ConditionalSignalAssignment() pass elif la_ == 3: - self.state = 2644 + self.state = 2740 self.rule_SelectedSignalAssignment() pass @@ -18368,41 +18729,41 @@ def accept(self, visitor: ParseTreeVisitor): def rule_SignalDeclaration(self): localctx = VHDLParser.Rule_SignalDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 444, self.RULE_rule_SignalDeclaration) + self.enterRule(localctx, 448, self.RULE_rule_SignalDeclaration) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2647 + self.state = 2743 self.match(VHDLParser.KW_SIGNAL) - self.state = 2648 + self.state = 2744 localctx.names = self.rule_IdentifierList() - self.state = 2649 + self.state = 2745 self.match(VHDLParser.TOK_COLON) - self.state = 2650 + self.state = 2746 localctx.subtypeIndication = self.rule_SubtypeIndication() - self.state = 2652 + self.state = 2748 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_BUS or _la == VHDLParser.KW_REGISTER: - self.state = 2651 + if _la == 21 or _la == 81: + self.state = 2747 localctx.signalKind = self._input.LT(1) _la = self._input.LA(1) - if not (_la == VHDLParser.KW_BUS or _la == VHDLParser.KW_REGISTER): + if not (_la == 21 or _la == 81): localctx.signalKind = self._errHandler.recoverInline(self) else: self._errHandler.reportMatch(self) self.consume() - self.state = 2656 + self.state = 2752 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.TOK_VAR_ASSIGN: - self.state = 2654 + if _la == 141: + self.state = 2750 self.match(VHDLParser.TOK_VAR_ASSIGN) - self.state = 2655 + self.state = 2751 localctx.expression = self.rule_Expression(0) - self.state = 2658 + self.state = 2754 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -18453,39 +18814,39 @@ def accept(self, visitor: ParseTreeVisitor): def rule_SignalList(self): localctx = VHDLParser.Rule_SignalListContext(self, self._ctx, self.state) - self.enterRule(localctx, 446, self.RULE_rule_SignalList) + self.enterRule(localctx, 450, self.RULE_rule_SignalList) self._la = 0 # Token type try: - self.state = 2670 + self.state = 2766 self._errHandler.sync(self) token = self._input.LA(1) - if token in [VHDLParser.TOK_DLA, VHDLParser.LIT_CHARACTER, VHDLParser.LIT_STRING, VHDLParser.LIT_IDENTIFIER]: + if token in [147, 161, 162, 163]: self.enterOuterAlt(localctx, 1) - self.state = 2660 + self.state = 2756 localctx._rule_Name = self.rule_Name(0) localctx.names.append(localctx._rule_Name) - self.state = 2665 + self.state = 2761 self._errHandler.sync(self) _la = self._input.LA(1) - while _la == VHDLParser.TOK_COMMA: - self.state = 2661 + while _la == 151: + self.state = 2757 self.match(VHDLParser.TOK_COMMA) - self.state = 2662 + self.state = 2758 localctx._rule_Name = self.rule_Name(0) localctx.names.append(localctx._rule_Name) - self.state = 2667 + self.state = 2763 self._errHandler.sync(self) _la = self._input.LA(1) pass - elif token in [VHDLParser.KW_OTHERS]: + elif token in [68]: self.enterOuterAlt(localctx, 2) - self.state = 2668 + self.state = 2764 localctx.others = self.match(VHDLParser.KW_OTHERS) pass - elif token in [VHDLParser.KW_ALL]: + elif token in [10]: self.enterOuterAlt(localctx, 3) - self.state = 2669 + self.state = 2765 localctx.all_ = self.match(VHDLParser.KW_ALL) pass else: @@ -18505,9 +18866,9 @@ class Rule_SignatureContext(ParserRuleContext): def __init__(self, parser, parent: ParserRuleContext = None, invokingState: int = -1): super().__init__(parent, invokingState) self.parser = parser - self._rule_TypeMark = None # Rule_TypeMarkContext - self.names = list() # of Rule_TypeMarkContexts - self.returnName = None # Rule_TypeMarkContext + self._rule_Name = None # Rule_NameContext + self.names = list() # of Rule_NameContexts + self.returnName = None # Rule_NameContext def TOK_LB(self): return self.getToken(VHDLParser.TOK_LB, 0) @@ -18518,11 +18879,11 @@ def TOK_RB(self): def KW_RETURN(self): return self.getToken(VHDLParser.KW_RETURN, 0) - def rule_TypeMark(self, i: int = None): + def rule_Name(self, i: int = None): if i is None: - return self.getTypedRuleContexts(VHDLParser.Rule_TypeMarkContext) + return self.getTypedRuleContexts(VHDLParser.Rule_NameContext) else: - return self.getTypedRuleContext(VHDLParser.Rule_TypeMarkContext, i) + return self.getTypedRuleContext(VHDLParser.Rule_NameContext, i) def TOK_COMMA(self, i: int = None): if i is None: @@ -18542,44 +18903,42 @@ def accept(self, visitor: ParseTreeVisitor): def rule_Signature(self): localctx = VHDLParser.Rule_SignatureContext(self, self._ctx, self.state) - self.enterRule(localctx, 448, self.RULE_rule_Signature) + self.enterRule(localctx, 452, self.RULE_rule_Signature) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2672 + self.state = 2768 self.match(VHDLParser.TOK_LB) - self.state = 2681 + self.state = 2777 self._errHandler.sync(self) _la = self._input.LA(1) - if ((((_la - 148)) & ~0x3f) == 0 and ((1 << (_la - 148)) & ( - (1 << (VHDLParser.TOK_DLA - 148)) | (1 << (VHDLParser.LIT_CHARACTER - 148)) | ( - 1 << (VHDLParser.LIT_STRING - 148)) | (1 << (VHDLParser.LIT_IDENTIFIER - 148)))) != 0): - self.state = 2673 - localctx._rule_TypeMark = self.rule_TypeMark() - localctx.names.append(localctx._rule_TypeMark) - self.state = 2678 + if ((((_la - 147)) & ~0x3f) == 0 and ((1 << (_la - 147)) & 114689) != 0): + self.state = 2769 + localctx._rule_Name = self.rule_Name(0) + localctx.names.append(localctx._rule_Name) + self.state = 2774 self._errHandler.sync(self) _la = self._input.LA(1) - while _la == VHDLParser.TOK_COMMA: - self.state = 2674 + while _la == 151: + self.state = 2770 self.match(VHDLParser.TOK_COMMA) - self.state = 2675 - localctx._rule_TypeMark = self.rule_TypeMark() - localctx.names.append(localctx._rule_TypeMark) - self.state = 2680 + self.state = 2771 + localctx._rule_Name = self.rule_Name(0) + localctx.names.append(localctx._rule_Name) + self.state = 2776 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 2685 + self.state = 2781 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_RETURN: - self.state = 2683 + if _la == 86: + self.state = 2779 self.match(VHDLParser.KW_RETURN) - self.state = 2684 - localctx.returnName = self.rule_TypeMark() + self.state = 2780 + localctx.returnName = self.rule_Name(0) - self.state = 2687 + self.state = 2783 self.match(VHDLParser.TOK_RB) except RecognitionException as re: localctx.exception = re @@ -18629,27 +18988,27 @@ def accept(self, visitor: ParseTreeVisitor): def rule_SimpleConfigurationSpecification(self): localctx = VHDLParser.Rule_SimpleConfigurationSpecificationContext(self, self._ctx, self.state) - self.enterRule(localctx, 450, self.RULE_rule_SimpleConfigurationSpecification) + self.enterRule(localctx, 454, self.RULE_rule_SimpleConfigurationSpecification) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2689 + self.state = 2785 self.match(VHDLParser.KW_FOR) - self.state = 2690 + self.state = 2786 self.rule_ComponentSpecification() - self.state = 2691 + self.state = 2787 self.rule_BindingIndication() - self.state = 2692 + self.state = 2788 self.match(VHDLParser.TOK_SEMICOL) - self.state = 2696 + self.state = 2792 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_END: - self.state = 2693 + if _la == 33: + self.state = 2789 self.match(VHDLParser.KW_END) - self.state = 2694 + self.state = 2790 self.match(VHDLParser.KW_FOR) - self.state = 2695 + self.state = 2791 self.match(VHDLParser.TOK_SEMICOL) @@ -18667,6 +19026,7 @@ class Rule_SimpleForceAssignmentContext(ParserRuleContext): def __init__(self, parser, parent: ParserRuleContext = None, invokingState: int = -1): super().__init__(parent, invokingState) self.parser = parser + self.forceMode = None # Token def rule_Target(self): return self.getTypedRuleContext(VHDLParser.Rule_TargetContext, 0) @@ -18677,15 +19037,18 @@ def TOK_SIG_ASSIGN(self): def KW_FORCE(self): return self.getToken(VHDLParser.KW_FORCE, 0) - def rule_ForceMode(self): - return self.getTypedRuleContext(VHDLParser.Rule_ForceModeContext, 0) - def rule_ConditionalOrUnaffectedExpression(self): return self.getTypedRuleContext(VHDLParser.Rule_ConditionalOrUnaffectedExpressionContext, 0) def TOK_SEMICOL(self): return self.getToken(VHDLParser.TOK_SEMICOL, 0) + def KW_IN(self): + return self.getToken(VHDLParser.KW_IN, 0) + + def KW_OUT(self): + return self.getToken(VHDLParser.KW_OUT, 0) + def getRuleIndex(self): return VHDLParser.RULE_rule_SimpleForceAssignment @@ -18698,20 +19061,27 @@ def accept(self, visitor: ParseTreeVisitor): def rule_SimpleForceAssignment(self): localctx = VHDLParser.Rule_SimpleForceAssignmentContext(self, self._ctx, self.state) - self.enterRule(localctx, 452, self.RULE_rule_SimpleForceAssignment) + self.enterRule(localctx, 456, self.RULE_rule_SimpleForceAssignment) + self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2698 + self.state = 2794 self.rule_Target() - self.state = 2699 + self.state = 2795 self.match(VHDLParser.TOK_SIG_ASSIGN) - self.state = 2700 + self.state = 2796 self.match(VHDLParser.KW_FORCE) - self.state = 2701 - self.rule_ForceMode() - self.state = 2702 + self.state = 2797 + localctx.forceMode = self._input.LT(1) + _la = self._input.LA(1) + if not (_la == 47 or _la == 69): + localctx.forceMode = self._errHandler.recoverInline(self) + else: + self._errHandler.reportMatch(self) + self.consume() + self.state = 2798 self.rule_ConditionalOrUnaffectedExpression() - self.state = 2703 + self.state = 2799 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -18755,35 +19125,33 @@ def accept(self, visitor: ParseTreeVisitor): def rule_SimpleModeIndication(self): localctx = VHDLParser.Rule_SimpleModeIndicationContext(self, self._ctx, self.state) - self.enterRule(localctx, 454, self.RULE_rule_SimpleModeIndication) + self.enterRule(localctx, 458, self.RULE_rule_SimpleModeIndication) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2706 + self.state = 2802 self._errHandler.sync(self) _la = self._input.LA(1) - if ((((_la - 20)) & ~0x3f) == 0 and ((1 << (_la - 20)) & ( - (1 << (VHDLParser.KW_BUFFER - 20)) | (1 << (VHDLParser.KW_IN - 20)) | (1 << (VHDLParser.KW_INOUT - 20)) | ( - 1 << (VHDLParser.KW_LINKAGE - 20)) | (1 << (VHDLParser.KW_OUT - 20)))) != 0): - self.state = 2705 + if ((((_la - 20)) & ~0x3f) == 0 and ((1 << (_la - 20)) & 562959214444545) != 0): + self.state = 2801 self.rule_Mode() - self.state = 2708 + self.state = 2804 self.rule_InterfaceTypeIndication() - self.state = 2710 + self.state = 2806 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_BUS: - self.state = 2709 + if _la == 21: + self.state = 2805 self.match(VHDLParser.KW_BUS) - self.state = 2714 + self.state = 2810 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.TOK_VAR_ASSIGN: - self.state = 2712 + if _la == 141: + self.state = 2808 self.match(VHDLParser.TOK_VAR_ASSIGN) - self.state = 2713 + self.state = 2809 self.rule_ConditionalExpression() @@ -18826,14 +19194,14 @@ def accept(self, visitor: ParseTreeVisitor): def rule_SimpleRange(self): localctx = VHDLParser.Rule_SimpleRangeContext(self, self._ctx, self.state) - self.enterRule(localctx, 456, self.RULE_rule_SimpleRange) + self.enterRule(localctx, 460, self.RULE_rule_SimpleRange) try: self.enterOuterAlt(localctx, 1) - self.state = 2716 + self.state = 2812 localctx.leftBound = self.rule_Expression(0) - self.state = 2717 + self.state = 2813 localctx.direction = self.rule_Direction() - self.state = 2718 + self.state = 2814 localctx.rightBound = self.rule_Expression(0) except RecognitionException as re: localctx.exception = re @@ -18849,6 +19217,7 @@ class Rule_SimpleReleaseAssignmentContext(ParserRuleContext): def __init__(self, parser, parent: ParserRuleContext = None, invokingState: int = -1): super().__init__(parent, invokingState) self.parser = parser + self.forceMode = None # Token def rule_Target(self): return self.getTypedRuleContext(VHDLParser.Rule_TargetContext, 0) @@ -18856,12 +19225,15 @@ def rule_Target(self): def TOK_SIG_ASSIGN(self): return self.getToken(VHDLParser.TOK_SIG_ASSIGN, 0) - def rule_ForceMode(self): - return self.getTypedRuleContext(VHDLParser.Rule_ForceModeContext, 0) - def TOK_SEMICOL(self): return self.getToken(VHDLParser.TOK_SEMICOL, 0) + def KW_IN(self): + return self.getToken(VHDLParser.KW_IN, 0) + + def KW_OUT(self): + return self.getToken(VHDLParser.KW_OUT, 0) + def getRuleIndex(self): return VHDLParser.RULE_rule_SimpleReleaseAssignment @@ -18874,16 +19246,23 @@ def accept(self, visitor: ParseTreeVisitor): def rule_SimpleReleaseAssignment(self): localctx = VHDLParser.Rule_SimpleReleaseAssignmentContext(self, self._ctx, self.state) - self.enterRule(localctx, 458, self.RULE_rule_SimpleReleaseAssignment) + self.enterRule(localctx, 462, self.RULE_rule_SimpleReleaseAssignment) + self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2720 + self.state = 2816 self.rule_Target() - self.state = 2721 + self.state = 2817 self.match(VHDLParser.TOK_SIG_ASSIGN) - self.state = 2722 - self.rule_ForceMode() - self.state = 2723 + self.state = 2818 + localctx.forceMode = self._input.LT(1) + _la = self._input.LA(1) + if not (_la == 47 or _la == 69): + localctx.forceMode = self._errHandler.recoverInline(self) + else: + self._errHandler.reportMatch(self) + self.consume() + self.state = 2819 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -18921,26 +19300,26 @@ def accept(self, visitor: ParseTreeVisitor): def rule_SimpleSignalAssignment(self): localctx = VHDLParser.Rule_SimpleSignalAssignmentContext(self, self._ctx, self.state) - self.enterRule(localctx, 460, self.RULE_rule_SimpleSignalAssignment) + self.enterRule(localctx, 464, self.RULE_rule_SimpleSignalAssignment) try: - self.state = 2728 + self.state = 2824 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 302, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 319, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 2725 + self.state = 2821 self.rule_SimpleWaveformAssignment() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 2726 + self.state = 2822 self.rule_SimpleForceAssignment() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 2727 + self.state = 2823 self.rule_SimpleReleaseAssignment() pass @@ -18987,26 +19366,24 @@ def accept(self, visitor: ParseTreeVisitor): def rule_SimpleWaveformAssignment(self): localctx = VHDLParser.Rule_SimpleWaveformAssignmentContext(self, self._ctx, self.state) - self.enterRule(localctx, 462, self.RULE_rule_SimpleWaveformAssignment) + self.enterRule(localctx, 466, self.RULE_rule_SimpleWaveformAssignment) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2730 + self.state = 2826 self.rule_Target() - self.state = 2731 + self.state = 2827 self.match(VHDLParser.TOK_SIG_ASSIGN) - self.state = 2733 + self.state = 2829 self._errHandler.sync(self) _la = self._input.LA(1) - if ((((_la - 48)) & ~0x3f) == 0 and ((1 << (_la - 48)) & ( - (1 << (VHDLParser.KW_INERTIAL - 48)) | (1 << (VHDLParser.KW_REJECT - 48)) | ( - 1 << (VHDLParser.KW_TRANSPORT - 48)))) != 0): - self.state = 2732 + if ((((_la - 48)) & ~0x3f) == 0 and ((1 << (_la - 48)) & 36028814198833153) != 0): + self.state = 2828 self.rule_DelayMechanism() - self.state = 2735 + self.state = 2831 self.rule_Waveform() - self.state = 2736 + self.state = 2832 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -19047,16 +19424,16 @@ def accept(self, visitor: ParseTreeVisitor): def rule_SimpleVariableAssignment(self): localctx = VHDLParser.Rule_SimpleVariableAssignmentContext(self, self._ctx, self.state) - self.enterRule(localctx, 464, self.RULE_rule_SimpleVariableAssignment) + self.enterRule(localctx, 468, self.RULE_rule_SimpleVariableAssignment) try: self.enterOuterAlt(localctx, 1) - self.state = 2738 + self.state = 2834 self.rule_Target() - self.state = 2739 + self.state = 2835 self.match(VHDLParser.TOK_VAR_ASSIGN) - self.state = 2740 + self.state = 2836 self.rule_ConditionalOrUnaffectedExpression() - self.state = 2741 + self.state = 2837 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -19122,71 +19499,58 @@ def accept(self, visitor: ParseTreeVisitor): def rule_SubprogramBody(self): localctx = VHDLParser.Rule_SubprogramBodyContext(self, self._ctx, self.state) - self.enterRule(localctx, 466, self.RULE_rule_SubprogramBody) + self.enterRule(localctx, 470, self.RULE_rule_SubprogramBody) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2743 + self.state = 2839 self.rule_SubprogramSpecification() - self.state = 2744 + self.state = 2840 self.match(VHDLParser.KW_IS) - self.state = 2748 + self.state = 2844 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ( - (1 << VHDLParser.KW_ALIAS) | (1 << VHDLParser.KW_ATTRIBUTE) | (1 << VHDLParser.KW_CONSTANT) | ( - 1 << VHDLParser.KW_FILE) | (1 << VHDLParser.KW_FUNCTION) | (1 << VHDLParser.KW_IMPURE))) != 0) or ( - (((_la - 70)) & ~0x3f) == 0 and ((1 << (_la - 70)) & ( - (1 << (VHDLParser.KW_PACKAGE - 70)) | (1 << (VHDLParser.KW_PROCEDURE - 70)) | ( - 1 << (VHDLParser.KW_PURE - 70)) | (1 << (VHDLParser.KW_SHARED - 70)) | (1 << (VHDLParser.KW_SUBTYPE - 70)) | ( - 1 << (VHDLParser.KW_TYPE - 70)) | (1 << (VHDLParser.KW_USE - 70)) | ( - 1 << (VHDLParser.KW_VARIABLE - 70)))) != 0): - self.state = 2745 + while (((_la) & ~0x3f) == 0 and ((1 << _la) & 88579439100416) != 0) or ( + (((_la - 70)) & ~0x3f) == 0 and ((1 << (_la - 70)) & 842086220065) != 0): + self.state = 2841 localctx._rule_SubprogramDeclarativeItem = self.rule_SubprogramDeclarativeItem() localctx.declaredItems.append(localctx._rule_SubprogramDeclarativeItem) - self.state = 2750 + self.state = 2846 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 2751 + self.state = 2847 self.match(VHDLParser.KW_BEGIN) - self.state = 2755 + self.state = 2851 self._errHandler.sync(self) _la = self._input.LA(1) - while (((_la) & ~0x3f) == 0 and ((1 << _la) & ( - (1 << VHDLParser.KW_ASSERT) | (1 << VHDLParser.KW_BLOCK) | (1 << VHDLParser.KW_CASE) | ( - 1 << VHDLParser.KW_EXIT) | (1 << VHDLParser.KW_FOR) | (1 << VHDLParser.KW_IF) | (1 << VHDLParser.KW_LOOP) | ( - 1 << VHDLParser.KW_NEXT) | (1 << VHDLParser.KW_NULL))) != 0) or ((((_la - 85)) & ~0x3f) == 0 and ( - (1 << (_la - 85)) & ( - (1 << (VHDLParser.KW_REPORT - 85)) | (1 << (VHDLParser.KW_RETURN - 85)) | (1 << (VHDLParser.KW_WAIT - 85)) | ( - 1 << (VHDLParser.KW_WITH - 85)) | (1 << (VHDLParser.KW_WHILE - 85)) | (1 << (VHDLParser.TOK_LP - 85)) | ( - 1 << (VHDLParser.TOK_DLA - 85)))) != 0) or ((((_la - 162)) & ~0x3f) == 0 and ((1 << (_la - 162)) & ( - (1 << (VHDLParser.LIT_CHARACTER - 162)) | (1 << (VHDLParser.LIT_STRING - 162)) | ( - 1 << (VHDLParser.LIT_IDENTIFIER - 162)))) != 0): - self.state = 2752 + while (((_la) & ~0x3f) == 0 and ((1 << _la) & -8052400777563193344) != 0) or ( + (((_la - 85)) & ~0x3f) == 0 and ((1 << (_la - 85)) & 4899916406390259715) != 0) or ( + (((_la - 161)) & ~0x3f) == 0 and ((1 << (_la - 161)) & 7) != 0): + self.state = 2848 localctx._rule_SequentialStatement = self.rule_SequentialStatement() localctx.statements.append(localctx._rule_SequentialStatement) - self.state = 2757 + self.state = 2853 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 2758 + self.state = 2854 self.match(VHDLParser.KW_END) - self.state = 2760 + self.state = 2856 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_FUNCTION or _la == VHDLParser.KW_PROCEDURE: - self.state = 2759 + if _la == 39 or _la == 75: + self.state = 2855 self.rule_SubprogramKind() - self.state = 2763 + self.state = 2859 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_STRING or _la == VHDLParser.LIT_IDENTIFIER: - self.state = 2762 + if _la == 162 or _la == 163: + self.state = 2858 self.rule_Designator() - self.state = 2765 + self.state = 2861 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -19221,12 +19585,12 @@ def accept(self, visitor: ParseTreeVisitor): def rule_SubprogramDeclaration(self): localctx = VHDLParser.Rule_SubprogramDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 468, self.RULE_rule_SubprogramDeclaration) + self.enterRule(localctx, 472, self.RULE_rule_SubprogramDeclaration) try: self.enterOuterAlt(localctx, 1) - self.state = 2767 + self.state = 2863 self.rule_SubprogramSpecification() - self.state = 2768 + self.state = 2864 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -19288,6 +19652,12 @@ def rule_AttributeSpecification(self): def rule_UseClause(self): return self.getTypedRuleContext(VHDLParser.Rule_UseClauseContext, 0) + def rule_GroupTemplateDeclaration(self): + return self.getTypedRuleContext(VHDLParser.Rule_GroupTemplateDeclarationContext, 0) + + def rule_GroupDeclaration(self): + return self.getTypedRuleContext(VHDLParser.Rule_GroupDeclarationContext, 0) + def getRuleIndex(self): return VHDLParser.RULE_rule_SubprogramDeclarativeItem @@ -19300,101 +19670,113 @@ def accept(self, visitor: ParseTreeVisitor): def rule_SubprogramDeclarativeItem(self): localctx = VHDLParser.Rule_SubprogramDeclarativeItemContext(self, self._ctx, self.state) - self.enterRule(localctx, 470, self.RULE_rule_SubprogramDeclarativeItem) + self.enterRule(localctx, 474, self.RULE_rule_SubprogramDeclarativeItem) try: - self.state = 2785 + self.state = 2883 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 308, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 325, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 2770 + self.state = 2866 self.rule_SubprogramDeclaration() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 2771 + self.state = 2867 self.rule_SubprogramBody() pass elif la_ == 3: self.enterOuterAlt(localctx, 3) - self.state = 2772 + self.state = 2868 self.rule_SubprogramInstantiationDeclaration() pass elif la_ == 4: self.enterOuterAlt(localctx, 4) - self.state = 2773 + self.state = 2869 self.rule_PackageDeclaration() pass elif la_ == 5: self.enterOuterAlt(localctx, 5) - self.state = 2774 + self.state = 2870 self.rule_PackageBody() pass elif la_ == 6: self.enterOuterAlt(localctx, 6) - self.state = 2775 + self.state = 2871 self.rule_PackageInstantiationDeclaration() pass elif la_ == 7: self.enterOuterAlt(localctx, 7) - self.state = 2776 + self.state = 2872 self.rule_TypeDeclaration() pass elif la_ == 8: self.enterOuterAlt(localctx, 8) - self.state = 2777 + self.state = 2873 self.rule_SubtypeDeclaration() pass elif la_ == 9: self.enterOuterAlt(localctx, 9) - self.state = 2778 + self.state = 2874 self.rule_ConstantDeclaration() pass elif la_ == 10: self.enterOuterAlt(localctx, 10) - self.state = 2779 + self.state = 2875 self.rule_VariableDeclaration() pass elif la_ == 11: self.enterOuterAlt(localctx, 11) - self.state = 2780 + self.state = 2876 self.rule_FileDeclaration() pass elif la_ == 12: self.enterOuterAlt(localctx, 12) - self.state = 2781 + self.state = 2877 self.rule_AliasDeclaration() pass elif la_ == 13: self.enterOuterAlt(localctx, 13) - self.state = 2782 + self.state = 2878 self.rule_AttributeDeclaration() pass elif la_ == 14: self.enterOuterAlt(localctx, 14) - self.state = 2783 + self.state = 2879 self.rule_AttributeSpecification() pass elif la_ == 15: self.enterOuterAlt(localctx, 15) - self.state = 2784 + self.state = 2880 self.rule_UseClause() pass + elif la_ == 16: + self.enterOuterAlt(localctx, 16) + self.state = 2881 + self.rule_GroupTemplateDeclaration() + pass + + elif la_ == 17: + self.enterOuterAlt(localctx, 17) + self.state = 2882 + self.rule_GroupDeclaration() + pass + except RecognitionException as re: localctx.exception = re @@ -19449,35 +19831,35 @@ def accept(self, visitor: ParseTreeVisitor): def rule_SubprogramInstantiationDeclaration(self): localctx = VHDLParser.Rule_SubprogramInstantiationDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 472, self.RULE_rule_SubprogramInstantiationDeclaration) + self.enterRule(localctx, 476, self.RULE_rule_SubprogramInstantiationDeclaration) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2787 + self.state = 2885 self.rule_SubprogramKind() - self.state = 2788 + self.state = 2886 localctx.name = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 2789 + self.state = 2887 self.match(VHDLParser.KW_IS) - self.state = 2790 + self.state = 2888 self.match(VHDLParser.KW_NEW) - self.state = 2791 + self.state = 2889 self.rule_Name(0) - self.state = 2793 + self.state = 2891 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.TOK_LB: - self.state = 2792 + if _la == 145: + self.state = 2890 self.rule_Signature() - self.state = 2796 + self.state = 2894 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_GENERIC: - self.state = 2795 + if _la == 42: + self.state = 2893 localctx.genericMapAspect = self.rule_GenericMapAspect() - self.state = 2798 + self.state = 2896 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -19512,13 +19894,13 @@ def accept(self, visitor: ParseTreeVisitor): def rule_SubprogramKind(self): localctx = VHDLParser.Rule_SubprogramKindContext(self, self._ctx, self.state) - self.enterRule(localctx, 474, self.RULE_rule_SubprogramKind) + self.enterRule(localctx, 478, self.RULE_rule_SubprogramKind) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2800 + self.state = 2898 _la = self._input.LA(1) - if not (_la == VHDLParser.KW_FUNCTION or _la == VHDLParser.KW_PROCEDURE): + if not (_la == 39 or _la == 75): self._errHandler.recoverInline(self) else: self._errHandler.reportMatch(self) @@ -19556,19 +19938,19 @@ def accept(self, visitor: ParseTreeVisitor): def rule_SubprogramSpecification(self): localctx = VHDLParser.Rule_SubprogramSpecificationContext(self, self._ctx, self.state) - self.enterRule(localctx, 476, self.RULE_rule_SubprogramSpecification) + self.enterRule(localctx, 480, self.RULE_rule_SubprogramSpecification) try: - self.state = 2804 + self.state = 2902 self._errHandler.sync(self) token = self._input.LA(1) - if token in [VHDLParser.KW_PROCEDURE]: + if token in [75]: self.enterOuterAlt(localctx, 1) - self.state = 2802 + self.state = 2900 self.rule_ProcedureSpecification() pass - elif token in [VHDLParser.KW_FUNCTION, VHDLParser.KW_IMPURE, VHDLParser.KW_PURE]: + elif token in [39, 46, 78]: self.enterOuterAlt(localctx, 2) - self.state = 2803 + self.state = 2901 self.rule_FunctionSpecification() pass else: @@ -19618,18 +20000,18 @@ def accept(self, visitor: ParseTreeVisitor): def rule_SubtypeDeclaration(self): localctx = VHDLParser.Rule_SubtypeDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 478, self.RULE_rule_SubtypeDeclaration) + self.enterRule(localctx, 482, self.RULE_rule_SubtypeDeclaration) try: self.enterOuterAlt(localctx, 1) - self.state = 2806 + self.state = 2904 self.match(VHDLParser.KW_SUBTYPE) - self.state = 2807 + self.state = 2905 localctx.name = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 2808 + self.state = 2906 self.match(VHDLParser.KW_IS) - self.state = 2809 + self.state = 2907 localctx.subtypeIndication = self.rule_SubtypeIndication() - self.state = 2810 + self.state = 2908 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -19646,8 +20028,8 @@ def __init__(self, parser, parent: ParserRuleContext = None, invokingState: int super().__init__(parent, invokingState) self.parser = parser - def rule_TypeMark(self): - return self.getTypedRuleContext(VHDLParser.Rule_TypeMarkContext, 0) + def rule_Name(self): + return self.getTypedRuleContext(VHDLParser.Rule_NameContext, 0) def rule_ResolutionIndication(self): return self.getTypedRuleContext(VHDLParser.Rule_ResolutionIndicationContext, 0) @@ -19667,23 +20049,23 @@ def accept(self, visitor: ParseTreeVisitor): def rule_SubtypeIndication(self): localctx = VHDLParser.Rule_SubtypeIndicationContext(self, self._ctx, self.state) - self.enterRule(localctx, 480, self.RULE_rule_SubtypeIndication) + self.enterRule(localctx, 484, self.RULE_rule_SubtypeIndication) try: self.enterOuterAlt(localctx, 1) - self.state = 2813 + self.state = 2911 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 312, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 329, self._ctx) if la_ == 1: - self.state = 2812 + self.state = 2910 self.rule_ResolutionIndication() - self.state = 2815 - self.rule_TypeMark() - self.state = 2817 + self.state = 2913 + self.rule_Name(0) + self.state = 2915 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 313, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 330, self._ctx) if la_ == 1: - self.state = 2816 + self.state = 2914 self.rule_Constraint() @@ -19726,15 +20108,13 @@ def accept(self, visitor: ParseTreeVisitor): def rule_Suffix(self): localctx = VHDLParser.Rule_SuffixContext(self, self._ctx, self.state) - self.enterRule(localctx, 482, self.RULE_rule_Suffix) + self.enterRule(localctx, 486, self.RULE_rule_Suffix) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2819 + self.state = 2917 _la = self._input.LA(1) - if not (_la == VHDLParser.KW_ALL or ((((_la - 162)) & ~0x3f) == 0 and ((1 << (_la - 162)) & ( - (1 << (VHDLParser.LIT_CHARACTER - 162)) | (1 << (VHDLParser.LIT_STRING - 162)) | ( - 1 << (VHDLParser.LIT_IDENTIFIER - 162)))) != 0)): + if not (_la == 10 or ((((_la - 161)) & ~0x3f) == 0 and ((1 << (_la - 161)) & 7) != 0)): self._errHandler.recoverInline(self) else: self._errHandler.reportMatch(self) @@ -19772,19 +20152,19 @@ def accept(self, visitor: ParseTreeVisitor): def rule_Target(self): localctx = VHDLParser.Rule_TargetContext(self, self._ctx, self.state) - self.enterRule(localctx, 484, self.RULE_rule_Target) + self.enterRule(localctx, 488, self.RULE_rule_Target) try: - self.state = 2823 + self.state = 2921 self._errHandler.sync(self) token = self._input.LA(1) - if token in [VHDLParser.TOK_DLA, VHDLParser.LIT_CHARACTER, VHDLParser.LIT_STRING, VHDLParser.LIT_IDENTIFIER]: + if token in [147, 161, 162, 163]: self.enterOuterAlt(localctx, 1) - self.state = 2821 + self.state = 2919 self.rule_Name(0) pass - elif token in [VHDLParser.TOK_LP]: + elif token in [143]: self.enterOuterAlt(localctx, 2) - self.state = 2822 + self.state = 2920 self.rule_Aggregate() pass else: @@ -19824,12 +20204,12 @@ def accept(self, visitor: ParseTreeVisitor): def rule_TimeoutClause(self): localctx = VHDLParser.Rule_TimeoutClauseContext(self, self._ctx, self.state) - self.enterRule(localctx, 486, self.RULE_rule_TimeoutClause) + self.enterRule(localctx, 490, self.RULE_rule_TimeoutClause) try: self.enterOuterAlt(localctx, 1) - self.state = 2825 + self.state = 2923 self.match(VHDLParser.KW_FOR) - self.state = 2826 + self.state = 2924 localctx.expression = self.rule_Expression(0) except RecognitionException as re: localctx.exception = re @@ -19846,8 +20226,8 @@ def __init__(self, parser, parent: ParserRuleContext = None, invokingState: int super().__init__(parent, invokingState) self.parser = parser - def rule_TypeMark(self): - return self.getTypedRuleContext(VHDLParser.Rule_TypeMarkContext, 0) + def rule_Name(self): + return self.getTypedRuleContext(VHDLParser.Rule_NameContext, 0) def TOK_LP(self): return self.getToken(VHDLParser.TOK_LP, 0) @@ -19870,16 +20250,16 @@ def accept(self, visitor: ParseTreeVisitor): def rule_TypeConversion(self): localctx = VHDLParser.Rule_TypeConversionContext(self, self._ctx, self.state) - self.enterRule(localctx, 488, self.RULE_rule_TypeConversion) + self.enterRule(localctx, 492, self.RULE_rule_TypeConversion) try: self.enterOuterAlt(localctx, 1) - self.state = 2828 - self.rule_TypeMark() - self.state = 2829 + self.state = 2926 + self.rule_Name(0) + self.state = 2927 self.match(VHDLParser.TOK_LP) - self.state = 2830 + self.state = 2928 self.rule_Expression(0) - self.state = 2831 + self.state = 2929 self.match(VHDLParser.TOK_RP) except RecognitionException as re: localctx.exception = re @@ -19914,20 +20294,20 @@ def accept(self, visitor: ParseTreeVisitor): def rule_TypeDeclaration(self): localctx = VHDLParser.Rule_TypeDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 490, self.RULE_rule_TypeDeclaration) + self.enterRule(localctx, 494, self.RULE_rule_TypeDeclaration) try: - self.state = 2835 + self.state = 2933 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 315, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 332, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 2833 + self.state = 2931 self.rule_FullTypeDeclaration() pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 2834 + self.state = 2932 self.rule_IncompleteTypeDeclaration() pass @@ -19977,39 +20357,39 @@ def accept(self, visitor: ParseTreeVisitor): def rule_TypeDefinition(self): localctx = VHDLParser.Rule_TypeDefinitionContext(self, self._ctx, self.state) - self.enterRule(localctx, 492, self.RULE_rule_TypeDefinition) + self.enterRule(localctx, 496, self.RULE_rule_TypeDefinition) try: - self.state = 2843 + self.state = 2941 self._errHandler.sync(self) token = self._input.LA(1) - if token in [VHDLParser.KW_RANGE, VHDLParser.TOK_LP]: + if token in [79, 143]: self.enterOuterAlt(localctx, 1) - self.state = 2837 + self.state = 2935 self.rule_ScalarTypeDefinition() pass - elif token in [VHDLParser.KW_ARRAY, VHDLParser.KW_RECORD]: + elif token in [13, 80]: self.enterOuterAlt(localctx, 2) - self.state = 2838 + self.state = 2936 self.rule_CompositeTypeDefinition() pass - elif token in [VHDLParser.KW_ACCESS]: + elif token in [7]: self.enterOuterAlt(localctx, 3) - self.state = 2839 + self.state = 2937 self.rule_AccessTypeDefinition() pass - elif token in [VHDLParser.KW_FILE]: + elif token in [36]: self.enterOuterAlt(localctx, 4) - self.state = 2840 + self.state = 2938 self.rule_FileTypeDefinition() pass - elif token in [VHDLParser.KW_PROTECTED]: + elif token in [77]: self.enterOuterAlt(localctx, 5) - self.state = 2841 + self.state = 2939 self.rule_ProtectedTypeDefinition() pass - elif token in [VHDLParser.KW_NEW]: + elif token in [59]: self.enterOuterAlt(localctx, 6) - self.state = 2842 + self.state = 2940 self.rule_ProtectedTypeInstantiationDefinition() pass else: @@ -20023,41 +20403,6 @@ def rule_TypeDefinition(self): self.exitRule() return localctx - class Rule_TypeMarkContext(ParserRuleContext): - __slots__ = 'parser' - - def __init__(self, parser, parent: ParserRuleContext = None, invokingState: int = -1): - super().__init__(parent, invokingState) - self.parser = parser - - def rule_Name(self): - return self.getTypedRuleContext(VHDLParser.Rule_NameContext, 0) - - def getRuleIndex(self): - return VHDLParser.RULE_rule_TypeMark - - def accept(self, visitor: ParseTreeVisitor): - if hasattr(visitor, "visitRule_TypeMark"): - return visitor.visitRule_TypeMark(self) - else: - return visitor.visitChildren(self) - - def rule_TypeMark(self): - - localctx = VHDLParser.Rule_TypeMarkContext(self, self._ctx, self.state) - self.enterRule(localctx, 494, self.RULE_rule_TypeMark) - try: - self.enterOuterAlt(localctx, 1) - self.state = 2845 - self.rule_Name(0) - except RecognitionException as re: - localctx.exception = re - self._errHandler.reportError(self, re) - self._errHandler.recover(self, re) - finally: - self.exitRule() - return localctx - class Rule_UnboundArrayDefinitionContext(ParserRuleContext): __slots__ = 'parser' @@ -20105,33 +20450,33 @@ def accept(self, visitor: ParseTreeVisitor): def rule_UnboundArrayDefinition(self): localctx = VHDLParser.Rule_UnboundArrayDefinitionContext(self, self._ctx, self.state) - self.enterRule(localctx, 496, self.RULE_rule_UnboundArrayDefinition) + self.enterRule(localctx, 498, self.RULE_rule_UnboundArrayDefinition) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2847 + self.state = 2943 self.match(VHDLParser.KW_ARRAY) - self.state = 2848 + self.state = 2944 self.match(VHDLParser.TOK_LP) - self.state = 2849 + self.state = 2945 self.rule_IndexSubtypeDefinition() - self.state = 2854 + self.state = 2950 self._errHandler.sync(self) _la = self._input.LA(1) - while _la == VHDLParser.TOK_COMMA: - self.state = 2850 + while _la == 151: + self.state = 2946 self.match(VHDLParser.TOK_COMMA) - self.state = 2851 + self.state = 2947 self.rule_IndexSubtypeDefinition() - self.state = 2856 + self.state = 2952 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 2857 + self.state = 2953 self.match(VHDLParser.TOK_RP) - self.state = 2858 + self.state = 2954 self.match(VHDLParser.KW_OF) - self.state = 2859 + self.state = 2955 localctx.subtypeIndication = self.rule_SubtypeIndication() except RecognitionException as re: localctx.exception = re @@ -20169,14 +20514,14 @@ def accept(self, visitor: ParseTreeVisitor): def rule_UnspecifiedTypeIndication(self): localctx = VHDLParser.Rule_UnspecifiedTypeIndicationContext(self, self._ctx, self.state) - self.enterRule(localctx, 498, self.RULE_rule_UnspecifiedTypeIndication) + self.enterRule(localctx, 500, self.RULE_rule_UnspecifiedTypeIndication) try: self.enterOuterAlt(localctx, 1) - self.state = 2861 + self.state = 2957 self.match(VHDLParser.KW_TYPE) - self.state = 2862 + self.state = 2958 self.match(VHDLParser.KW_IS) - self.state = 2863 + self.state = 2959 self.rule_IncompleteTypeDefinition() except RecognitionException as re: localctx.exception = re @@ -20225,29 +20570,29 @@ def accept(self, visitor: ParseTreeVisitor): def rule_UseClause(self): localctx = VHDLParser.Rule_UseClauseContext(self, self._ctx, self.state) - self.enterRule(localctx, 500, self.RULE_rule_UseClause) + self.enterRule(localctx, 502, self.RULE_rule_UseClause) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2865 + self.state = 2961 self.match(VHDLParser.KW_USE) - self.state = 2866 + self.state = 2962 localctx._rule_SelectedName2 = self.rule_SelectedName2() localctx.names.append(localctx._rule_SelectedName2) - self.state = 2871 + self.state = 2967 self._errHandler.sync(self) _la = self._input.LA(1) - while _la == VHDLParser.TOK_COMMA: - self.state = 2867 + while _la == 151: + self.state = 2963 self.match(VHDLParser.TOK_COMMA) - self.state = 2868 + self.state = 2964 localctx._rule_SelectedName2 = self.rule_SelectedName2() localctx.names.append(localctx._rule_SelectedName2) - self.state = 2873 + self.state = 2969 self._errHandler.sync(self) _la = self._input.LA(1) - self.state = 2874 + self.state = 2970 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -20292,24 +20637,24 @@ def accept(self, visitor: ParseTreeVisitor): def rule_ValueReturnStatement(self): localctx = VHDLParser.Rule_ValueReturnStatementContext(self, self._ctx, self.state) - self.enterRule(localctx, 502, self.RULE_rule_ValueReturnStatement) + self.enterRule(localctx, 504, self.RULE_rule_ValueReturnStatement) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2878 + self.state = 2974 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: - self.state = 2876 + if _la == 163: + self.state = 2972 localctx.label = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 2877 + self.state = 2973 self.match(VHDLParser.TOK_COLON) - self.state = 2880 + self.state = 2976 self.match(VHDLParser.KW_RETURN) - self.state = 2881 + self.state = 2977 self.rule_ConditionalOrUnaffectedExpression() - self.state = 2882 + self.state = 2978 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -20351,28 +20696,27 @@ def accept(self, visitor: ParseTreeVisitor): def rule_VariableAssignmentStatement(self): localctx = VHDLParser.Rule_VariableAssignmentStatementContext(self, self._ctx, self.state) - self.enterRule(localctx, 504, self.RULE_rule_VariableAssignmentStatement) + self.enterRule(localctx, 506, self.RULE_rule_VariableAssignmentStatement) try: self.enterOuterAlt(localctx, 1) - self.state = 2886 + self.state = 2982 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 320, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 337, self._ctx) if la_ == 1: - self.state = 2884 + self.state = 2980 localctx.label = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 2885 + self.state = 2981 self.match(VHDLParser.TOK_COLON) - self.state = 2890 + self.state = 2986 self._errHandler.sync(self) token = self._input.LA(1) - if token in [VHDLParser.TOK_LP, VHDLParser.TOK_DLA, VHDLParser.LIT_CHARACTER, VHDLParser.LIT_STRING, - VHDLParser.LIT_IDENTIFIER]: - self.state = 2888 + if token in [143, 147, 161, 162, 163]: + self.state = 2984 self.rule_SimpleVariableAssignment() pass - elif token in [VHDLParser.KW_WITH]: - self.state = 2889 + elif token in [116]: + self.state = 2985 self.rule_SelectedVariableAssignment() pass else: @@ -20435,42 +20779,42 @@ def accept(self, visitor: ParseTreeVisitor): def rule_VariableDeclaration(self): localctx = VHDLParser.Rule_VariableDeclarationContext(self, self._ctx, self.state) - self.enterRule(localctx, 506, self.RULE_rule_VariableDeclaration) + self.enterRule(localctx, 508, self.RULE_rule_VariableDeclaration) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2893 + self.state = 2989 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_SHARED: - self.state = 2892 + if _la == 92: + self.state = 2988 self.match(VHDLParser.KW_SHARED) - self.state = 2895 + self.state = 2991 self.match(VHDLParser.KW_VARIABLE) - self.state = 2896 + self.state = 2992 self.rule_IdentifierList() - self.state = 2897 + self.state = 2993 self.match(VHDLParser.TOK_COLON) - self.state = 2898 + self.state = 2994 localctx.subtypeIndication = self.rule_SubtypeIndication() - self.state = 2900 + self.state = 2996 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_GENERIC: - self.state = 2899 + if _la == 42: + self.state = 2995 localctx.genericMapAspect = self.rule_GenericMapAspect() - self.state = 2904 + self.state = 3000 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.TOK_VAR_ASSIGN: - self.state = 2902 + if _la == 141: + self.state = 2998 self.match(VHDLParser.TOK_VAR_ASSIGN) - self.state = 2903 + self.state = 2999 localctx.expression = self.rule_Expression(0) - self.state = 2906 + self.state = 3002 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -20521,43 +20865,43 @@ def accept(self, visitor: ParseTreeVisitor): def rule_WaitStatement(self): localctx = VHDLParser.Rule_WaitStatementContext(self, self._ctx, self.state) - self.enterRule(localctx, 508, self.RULE_rule_WaitStatement) + self.enterRule(localctx, 510, self.RULE_rule_WaitStatement) self._la = 0 # Token type try: self.enterOuterAlt(localctx, 1) - self.state = 2910 + self.state = 3006 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.LIT_IDENTIFIER: - self.state = 2908 + if _la == 163: + self.state = 3004 localctx.label = self.match(VHDLParser.LIT_IDENTIFIER) - self.state = 2909 + self.state = 3005 self.match(VHDLParser.TOK_COLON) - self.state = 2912 + self.state = 3008 self.match(VHDLParser.KW_WAIT) - self.state = 2914 + self.state = 3010 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_ON: - self.state = 2913 + if _la == 65: + self.state = 3009 self.rule_SensitivityClause() - self.state = 2917 + self.state = 3013 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_UNTIL: - self.state = 2916 + if _la == 107: + self.state = 3012 self.rule_ConditionClause() - self.state = 2920 + self.state = 3016 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_FOR: - self.state = 2919 + if _la == 37: + self.state = 3015 self.rule_TimeoutClause() - self.state = 2922 + self.state = 3018 self.match(VHDLParser.TOK_SEMICOL) except RecognitionException as re: localctx.exception = re @@ -20603,38 +20947,34 @@ def accept(self, visitor: ParseTreeVisitor): def rule_Waveform(self): localctx = VHDLParser.Rule_WaveformContext(self, self._ctx, self.state) - self.enterRule(localctx, 510, self.RULE_rule_Waveform) + self.enterRule(localctx, 512, self.RULE_rule_Waveform) self._la = 0 # Token type try: - self.state = 2933 + self.state = 3029 self._errHandler.sync(self) token = self._input.LA(1) - if token in [VHDLParser.OP_ABS, VHDLParser.OP_AND, VHDLParser.OP_NAND, VHDLParser.KW_NEW, VHDLParser.OP_NOR, - VHDLParser.OP_NOT, VHDLParser.KW_NULL, VHDLParser.OP_OR, VHDLParser.OP_XNOR, VHDLParser.OP_XOR, - VHDLParser.OP_PLUS, VHDLParser.OP_MINUS, VHDLParser.OP_CONDITION, VHDLParser.TOK_LP, - VHDLParser.TOK_DLA, VHDLParser.LIT_ABSTRACT, VHDLParser.LIT_BIT_STRING, VHDLParser.LIT_CHARACTER, - VHDLParser.LIT_STRING, VHDLParser.LIT_IDENTIFIER]: + if token in [6, 11, 58, 59, 61, 62, 63, 67, 119, 120, 132, 133, 138, 143, 147, 159, 160, 161, 162, 163]: self.enterOuterAlt(localctx, 1) - self.state = 2924 + self.state = 3020 localctx._rule_WaveformElement = self.rule_WaveformElement() localctx.waveformElement.append(localctx._rule_WaveformElement) - self.state = 2929 + self.state = 3025 self._errHandler.sync(self) _la = self._input.LA(1) - while _la == VHDLParser.TOK_COMMA: - self.state = 2925 + while _la == 151: + self.state = 3021 self.match(VHDLParser.TOK_COMMA) - self.state = 2926 + self.state = 3022 localctx._rule_WaveformElement = self.rule_WaveformElement() localctx.waveformElement.append(localctx._rule_WaveformElement) - self.state = 2931 + self.state = 3027 self._errHandler.sync(self) _la = self._input.LA(1) pass - elif token in [VHDLParser.KW_UNAFFECTED]: + elif token in [105]: self.enterOuterAlt(localctx, 2) - self.state = 2932 + self.state = 3028 self.match(VHDLParser.KW_UNAFFECTED) pass else: @@ -20681,38 +21021,38 @@ def accept(self, visitor: ParseTreeVisitor): def rule_WaveformElement(self): localctx = VHDLParser.Rule_WaveformElementContext(self, self._ctx, self.state) - self.enterRule(localctx, 512, self.RULE_rule_WaveformElement) + self.enterRule(localctx, 514, self.RULE_rule_WaveformElement) self._la = 0 # Token type try: - self.state = 2945 + self.state = 3041 self._errHandler.sync(self) - la_ = self._interp.adaptivePredict(self._input, 333, self._ctx) + la_ = self._interp.adaptivePredict(self._input, 350, self._ctx) if la_ == 1: self.enterOuterAlt(localctx, 1) - self.state = 2935 + self.state = 3031 localctx.expression = self.rule_Expression(0) - self.state = 2938 + self.state = 3034 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_AFTER: - self.state = 2936 + if _la == 8: + self.state = 3032 self.match(VHDLParser.KW_AFTER) - self.state = 2937 + self.state = 3033 localctx.afterExpression = self.rule_Expression(0) pass elif la_ == 2: self.enterOuterAlt(localctx, 2) - self.state = 2940 + self.state = 3036 self.match(VHDLParser.KW_NULL) - self.state = 2943 + self.state = 3039 self._errHandler.sync(self) _la = self._input.LA(1) - if _la == VHDLParser.KW_AFTER: - self.state = 2941 + if _la == 8: + self.state = 3037 self.match(VHDLParser.KW_AFTER) - self.state = 2942 + self.state = 3038 localctx.afterExpression = self.rule_Expression(0) pass @@ -20730,7 +21070,7 @@ def sempred(self, localctx: RuleContext, ruleIndex: int, predIndex: int): if self._predicates == None: self._predicates = dict() self._predicates[92] = self.rule_Expression_sempred - self._predicates[157] = self.rule_Name_sempred + self._predicates[159] = self.rule_Name_sempred pred = self._predicates.get(ruleIndex, None) if pred is None: raise Exception("No predicate with index:" + str(ruleIndex)) diff --git a/pyVHDLParser/ANTLR4/VHDLParserVisitor.py b/pyVHDLParser/ANTLR4/VHDLParserVisitor.py index ccedbcf94..d580d60ab 100644 --- a/pyVHDLParser/ANTLR4/VHDLParserVisitor.py +++ b/pyVHDLParser/ANTLR4/VHDLParserVisitor.py @@ -1,7 +1,9 @@ +# Generated from .\VHDLParser.g4 by ANTLR 4.12.0 from antlr4 import ParseTreeVisitor from .VHDLParser import VHDLParser +# This class defines a complete generic visitor for a parse tree produced by VHDLParser. class VHDLParserVisitor(ParseTreeVisitor): # Visit a parse tree produced by VHDLParser#rule_AbsolutePathname. @@ -56,14 +58,6 @@ def visitRule_ArchitectureStatement(self, ctx: VHDLParser.Rule_ArchitectureState def visitRule_ArrayConstraint(self, ctx: VHDLParser.Rule_ArrayConstraintContext): return self.visitChildren(ctx) - # Visit a parse tree produced by VHDLParser#rule_ArrayElementConstraint. - def visitRule_ArrayElementConstraint(self, ctx: VHDLParser.Rule_ArrayElementConstraintContext): - return self.visitChildren(ctx) - - # Visit a parse tree produced by VHDLParser#rule_ArrayElementResolution. - def visitRule_ArrayElementResolution(self, ctx: VHDLParser.Rule_ArrayElementResolutionContext): - return self.visitChildren(ctx) - # Visit a parse tree produced by VHDLParser#rule_ArrayIncompleteTypeDefinition. def visitRule_ArrayIncompleteTypeDefinition(self, ctx: VHDLParser.Rule_ArrayIncompleteTypeDefinitionContext): return self.visitChildren(ctx) @@ -204,6 +198,10 @@ def visitRule_ConcurrentSignalAssignmentStatement(self, def visitRule_ConcurrentSimpleSignalAssignment(self, ctx: VHDLParser.Rule_ConcurrentSimpleSignalAssignmentContext): return self.visitChildren(ctx) + # Visit a parse tree produced by VHDLParser#rule_ConcurrentStatement. + def visitRule_ConcurrentStatement(self, ctx: VHDLParser.Rule_ConcurrentStatementContext): + return self.visitChildren(ctx) + # Visit a parse tree produced by VHDLParser#rule_ConditionClause. def visitRule_ConditionClause(self, ctx: VHDLParser.Rule_ConditionClauseContext): return self.visitChildren(ctx) @@ -336,6 +334,10 @@ def visitRule_EntityAspect(self, ctx: VHDLParser.Rule_EntityAspectContext): def visitRule_EntityClass(self, ctx: VHDLParser.Rule_EntityClassContext): return self.visitChildren(ctx) + # Visit a parse tree produced by VHDLParser#rule_EntityClassEntry. + def visitRule_EntityClassEntry(self, ctx: VHDLParser.Rule_EntityClassEntryContext): + return self.visitChildren(ctx) + # Visit a parse tree produced by VHDLParser#rule_EntityDeclaration. def visitRule_EntityDeclaration(self, ctx: VHDLParser.Rule_EntityDeclarationContext): return self.visitChildren(ctx) @@ -440,10 +442,6 @@ def visitRule_FloatingTypeDefinition(self, ctx: VHDLParser.Rule_FloatingTypeDefi def visitRule_ForGenerateStatement(self, ctx: VHDLParser.Rule_ForGenerateStatementContext): return self.visitChildren(ctx) - # Visit a parse tree produced by VHDLParser#rule_ForceMode. - def visitRule_ForceMode(self, ctx: VHDLParser.Rule_ForceModeContext): - return self.visitChildren(ctx) - # Visit a parse tree produced by VHDLParser#rule_FormalDesignator. def visitRule_FormalDesignator(self, ctx: VHDLParser.Rule_FormalDesignatorContext): return self.visitChildren(ctx) @@ -488,6 +486,18 @@ def visitRule_GenericClause(self, ctx: VHDLParser.Rule_GenericClauseContext): def visitRule_GenericMapAspect(self, ctx: VHDLParser.Rule_GenericMapAspectContext): return self.visitChildren(ctx) + # Visit a parse tree produced by VHDLParser#rule_GroupConstituent. + def visitRule_GroupConstituent(self, ctx: VHDLParser.Rule_GroupConstituentContext): + return self.visitChildren(ctx) + + # Visit a parse tree produced by VHDLParser#rule_GroupDeclaration. + def visitRule_GroupDeclaration(self, ctx: VHDLParser.Rule_GroupDeclarationContext): + return self.visitChildren(ctx) + + # Visit a parse tree produced by VHDLParser#rule_GroupTemplateDeclaration. + def visitRule_GroupTemplateDeclaration(self, ctx: VHDLParser.Rule_GroupTemplateDeclarationContext): + return self.visitChildren(ctx) + # Visit a parse tree produced by VHDLParser#rule_GuardedSignalSpecification. def visitRule_GuardedSignalSpecification(self, ctx: VHDLParser.Rule_GuardedSignalSpecificationContext): return self.visitChildren(ctx) @@ -1034,10 +1044,6 @@ def visitRule_TypeDeclaration(self, ctx: VHDLParser.Rule_TypeDeclarationContext) def visitRule_TypeDefinition(self, ctx: VHDLParser.Rule_TypeDefinitionContext): return self.visitChildren(ctx) - # Visit a parse tree produced by VHDLParser#rule_TypeMark. - def visitRule_TypeMark(self, ctx: VHDLParser.Rule_TypeMarkContext): - return self.visitChildren(ctx) - # Visit a parse tree produced by VHDLParser#rule_UnboundArrayDefinition. def visitRule_UnboundArrayDefinition(self, ctx: VHDLParser.Rule_UnboundArrayDefinitionContext): return self.visitChildren(ctx) @@ -1074,5 +1080,4 @@ def visitRule_Waveform(self, ctx: VHDLParser.Rule_WaveformContext): def visitRule_WaveformElement(self, ctx: VHDLParser.Rule_WaveformElementContext): return self.visitChildren(ctx) - del VHDLParser From 628b79094b68c60c376841e746d5cb0cdc4c04fe Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 21 Feb 2023 00:53:06 +0100 Subject: [PATCH 04/27] Updates to the ANTLR4 Visitor. --- pyVHDLParser/ANTLR4/Visitor.py | 11 ++++++++--- pyVHDLParser/LanguageModel/Expression.py | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/pyVHDLParser/ANTLR4/Visitor.py b/pyVHDLParser/ANTLR4/Visitor.py index e4b60ed05..6069bac22 100644 --- a/pyVHDLParser/ANTLR4/Visitor.py +++ b/pyVHDLParser/ANTLR4/Visitor.py @@ -1,4 +1,6 @@ -from pyVHDLModel import Mode, MixinDesignUnitWithContext +from pyVHDLModel import DesignUnit +from pyVHDLModel.Base import Mode +from pyVHDLModel.Symbol import PackageSymbol from .VHDLLexer import VHDLLexer from ..LanguageModel.DesignUnit import Context, Entity, Architecture, Configuration, Package, PackageBody @@ -20,6 +22,8 @@ def checkRepeatedName(name1: Token, name2: Token, languageEntity: str): if nameText.lower() != name2Text.lower(): raise Exception(f"Repeated {languageEntity} name '{name2Text}' must match {languageEntity} name '{nameText}'.") + return nameText + def visitRule_DesignFile(self, ctx: VHDLParser.Rule_DesignFileContext): return [self.visit(designUnit) for designUnit in ctx.designUnits] @@ -39,7 +43,7 @@ def visitRule_SelectedName2(self, ctx:VHDLParser.Rule_SelectedName2Context): def visitRule_DesignUnit(self, ctx: VHDLParser.Rule_DesignUnitContext): # translate the design unit itself - libraryUnit: MixinDesignUnitWithContext = self.visit(ctx.libraryUnit) + libraryUnit: DesignUnit = self.visit(ctx.libraryUnit) # check if there are context items and add them to the design unit for contextItem in ctx.contextItems: @@ -107,8 +111,9 @@ def visitRule_PackageDeclaration(self, ctx:VHDLParser.Rule_PackageDeclarationCon def visitRule_PackageBody(self, ctx:VHDLParser.Rule_PackageBodyContext): packageName = self.checkRepeatedName(ctx.name, ctx.name2, "package body") + packageSymbol = PackageSymbol(packageName) - return PackageBody(packageName) + return PackageBody(packageSymbol) def visitRule_GenericClause(self, ctx: VHDLParser.Rule_GenericClauseContext): generics = [] diff --git a/pyVHDLParser/LanguageModel/Expression.py b/pyVHDLParser/LanguageModel/Expression.py index c0c8aef29..ad2369466 100644 --- a/pyVHDLParser/LanguageModel/Expression.py +++ b/pyVHDLParser/LanguageModel/Expression.py @@ -27,7 +27,7 @@ # limitations under the License. # # ==================================================================================================================== # # -from pyVHDLModel.SyntaxModel import ( +from pyVHDLModel.Expression import ( AndExpression as ModelAndExpression ) From 3db36a39ff161728507156741bd19d171a27d7fd Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Mon, 6 Mar 2023 22:59:58 +0100 Subject: [PATCH 05/27] Updated coding style. --- doc/Dependency.rst | 194 ++++++++++++ doc/_extensions/DocumentMember.py | 2 +- doc/conf.py | 140 +++++---- doc/index.rst | 13 +- doc/requirements.txt | 2 +- pyVHDLParser/ANTLR4/VHDLParser.py | 16 +- .../Blocks/Assignment/SignalAssignment.py | 36 +-- .../Blocks/Assignment/VariableAssignment.py | 36 +-- .../Blocks/Attribute/AttributeDeclaration.py | 96 +++--- .../Attribute/AttributeSpecification.py | 96 +++--- pyVHDLParser/Blocks/Comment.py | 12 +- pyVHDLParser/Blocks/Common.py | 2 +- pyVHDLParser/Blocks/ControlStructure/Case.py | 28 +- pyVHDLParser/Blocks/ControlStructure/Exit.py | 26 +- .../Blocks/ControlStructure/ForLoop.py | 22 +- pyVHDLParser/Blocks/ControlStructure/If.py | 20 +- pyVHDLParser/Blocks/ControlStructure/Next.py | 26 +- pyVHDLParser/Blocks/ControlStructure/Null.py | 8 +- .../Blocks/ControlStructure/Return.py | 6 +- .../Blocks/ControlStructure/WhileLoop.py | 46 +-- pyVHDLParser/Blocks/Expression.py | 114 +++---- pyVHDLParser/Blocks/Generate/CaseGenerate.py | 48 +-- pyVHDLParser/Blocks/Generate/ForGenerate.py | 60 ++-- pyVHDLParser/Blocks/Generate/IfGenerate.py | 180 +++++------ pyVHDLParser/Blocks/Generic.py | 14 +- pyVHDLParser/Blocks/Generic1.py | 66 ++-- .../Instantiation/EntityInstantiation.py | 36 +-- .../Instantiation/FunctionInstantiation.py | 36 +-- .../Instantiation/PackageInstantiation.py | 36 +-- .../Instantiation/ProcedureInstantiation.py | 36 +-- pyVHDLParser/Blocks/InterfaceObject.py | 64 ++-- pyVHDLParser/Blocks/List/GenericList.py | 38 +-- pyVHDLParser/Blocks/List/GenericMapList.py | 62 ++-- pyVHDLParser/Blocks/List/ParameterList.py | 42 +-- pyVHDLParser/Blocks/List/PortList.py | 18 +- pyVHDLParser/Blocks/List/PortMapList.py | 62 ++-- pyVHDLParser/Blocks/List/SensitivityList.py | 22 +- pyVHDLParser/Blocks/Object/SharedVariable.py | 12 +- pyVHDLParser/Blocks/Object/__init__.py | 28 +- pyVHDLParser/Blocks/Reference/Context.py | 18 +- pyVHDLParser/Blocks/Reference/Library.py | 20 +- pyVHDLParser/Blocks/Reference/Use.py | 52 ++-- pyVHDLParser/Blocks/Reporting/Assert.py | 48 +-- pyVHDLParser/Blocks/Reporting/Report.py | 34 +-- pyVHDLParser/Blocks/Sequential/Function.py | 44 +-- pyVHDLParser/Blocks/Sequential/Package.py | 12 +- pyVHDLParser/Blocks/Sequential/PackageBody.py | 10 +- pyVHDLParser/Blocks/Sequential/Procedure.py | 32 +- pyVHDLParser/Blocks/Sequential/Process.py | 32 +- .../Blocks/Structural/Architecture.py | 28 +- pyVHDLParser/Blocks/Structural/Block.py | 34 +-- pyVHDLParser/Blocks/Structural/Component.py | 18 +- .../Blocks/Structural/Configuration.py | 20 +- pyVHDLParser/Blocks/Structural/Entity.py | 14 +- pyVHDLParser/Blocks/Type/SubType.py | 96 +++--- pyVHDLParser/Blocks/Type/Type.py | 96 +++--- pyVHDLParser/Blocks/__init__.py | 30 +- pyVHDLParser/CLI/Block.py | 20 +- pyVHDLParser/CLI/CodeDOM.py | 2 +- pyVHDLParser/CLI/Group.py | 2 +- pyVHDLParser/CLI/Token.py | 22 +- pyVHDLParser/CLI/VHDLParser.py | 12 +- pyVHDLParser/Common/Common.py | 4 +- .../DocumentModel/DesignUnit/Context.py | 8 +- .../DocumentModel/DesignUnit/Entity.py | 4 +- .../DocumentModel/DesignUnit/Package.py | 8 +- .../DocumentModel/DesignUnit/PackageBody.py | 6 +- .../DocumentModel/Sequential/Function.py | 8 +- pyVHDLParser/DocumentModel/__init__.py | 12 +- pyVHDLParser/Filters/Comment.py | 6 +- pyVHDLParser/Graph/Graph.py | 18 +- pyVHDLParser/Groups/Comment.py | 4 +- pyVHDLParser/Groups/Concurrent.py | 4 +- pyVHDLParser/Groups/Object.py | 6 +- pyVHDLParser/Groups/__init__.py | 22 +- .../SimulationModel/SimulationModel.py | 2 +- pyVHDLParser/Token/Keywords.py | 2 +- pyVHDLParser/Token/Parser.py | 284 +++++++++--------- pyVHDLParser/Token/__init__.py | 18 +- pyVHDLParser/TypeSystem/TypeSystem.py | 10 +- pyVHDLParser/TypeSystem/std.py | 4 +- pyVHDLParser/TypeSystem/std_logic_1164.py | 2 +- test/BlockParserTests/TestSuite.py | 16 +- test/Counter.py | 6 +- 84 files changed, 1596 insertions(+), 1355 deletions(-) create mode 100644 doc/Dependency.rst diff --git a/doc/Dependency.rst b/doc/Dependency.rst new file mode 100644 index 000000000..34d57b45b --- /dev/null +++ b/doc/Dependency.rst @@ -0,0 +1,194 @@ +.. _dependency: + +Dependencies +############ + +.. |img-pyTooling-lib-status| image:: https://img.shields.io/librariesio/release/pypi/pyTooling + :alt: Libraries.io status for latest release + :height: 22 + :target: https://libraries.io/github/pyTooling/pyTooling +.. |img-pyTooling-val-status| image:: https://img.shields.io/snyk/vulnerabilities/github/pyTooling/pyTooling + :alt: Snyk Vulnerabilities for GitHub Repo + :height: 22 + :target: https://img.shields.io/snyk/vulnerabilities/github/pyTooling/pyTooling + ++------------------------------------------+------------------------------------------+ +| `Libraries.io `_ | Vulnerabilities Summary | ++==========================================+==========================================+ +| |img-pyTooling-lib-status| | |img-pyTooling-val-status| | ++------------------------------------------+------------------------------------------+ + +.. _dependency-package: + +pyTooling Package (Mandatory) +***************************** + +.. rubric:: Manually Installing Package Requirements + +Use the :file:`requirements.txt` file to install all dependencies via ``pip3`` or install the package directly from +PyPI (see :ref:`installation`). + +.. code-block:: shell + + pip3 install -U -r requirements.txt + + +.. rubric:: Dependency List + +When installed as ``pyTooling``: + ++-----------------------------------------------------------------+-------------+-------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ +| **Package** | **Version** | **License** | **Dependencies** | ++=================================================================+=============+===========================================================================================+========================================================================================================================================================+ +| *No dependencies* | — — — — | — — — — | — — — — | ++-----------------------------------------------------------------+-------------+-------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ + + +When installed as ``pyTooling[yaml]``: + ++-----------------------------------------------------------------+-------------+-------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ +| **Package** | **Version** | **License** | **Dependencies** | ++=================================================================+=============+===========================================================================================+========================================================================================================================================================+ +| `ruamel.yaml `__ | ≥0.17 | `MIT `__ | *Not yet evaluated.* | ++-----------------------------------------------------------------+-------------+-------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ + + + +.. _dependency-testing: + +Unit Testing / Coverage / Type Checking (Optional) +************************************************** + +Additional Python packages needed for testing, code coverage collection and static type checking. These packages are +only needed for developers or on a CI server, thus sub-dependencies are not evaluated further. + + +.. rubric:: Manually Installing Test Requirements + +Use the :file:`tests/requirements.txt` file to install all dependencies via ``pip3``. The file will recursively install +the mandatory dependencies too. + +.. code-block:: shell + + pip3 install -U -r tests/requirements.txt + + +.. rubric:: Dependency List + ++--------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ +| **Package** | **Version** | **License** | **Dependencies** | ++====================================================================+=============+========================================================================================+======================+ +| `pytest `__ | ≥7.2.0 | `MIT `__ | *Not yet evaluated.* | ++--------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ +| `pytest-cov `__ | ≥4.0.0 | `MIT `__ | *Not yet evaluated.* | ++--------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ +| `pytest-benchmark `__ | ≥4.0.0 | `BSD 2-Clause `__ | *Not yet evaluated.* | ++--------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ +| `Coverage `__ | ≥7.2 | `Apache License, 2.0 `__ | *Not yet evaluated.* | ++--------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ +| `mypy `__ | ≥1.0.1 | `MIT `__ | *Not yet evaluated.* | ++--------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ +| `lxml `__ | ≥4.9 | `BSD 3-Clause `__ | *Not yet evaluated.* | ++--------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ + + +.. _dependency-documentation: + +Sphinx Documentation (Optional) +******************************* + +Additional Python packages needed for documentation generation. These packages are only needed for developers or on a +CI server, thus sub-dependencies are not evaluated further. + + +.. rubric:: Manually Installing Documentation Requirements + +Use the :file:`doc/requirements.txt` file to install all dependencies via ``pip3``. The file will recursively install +the mandatory dependencies too. + +.. code-block:: shell + + pip3 install -U -r doc/requirements.txt + + +.. rubric:: Dependency List + ++-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ +| **Package** | **Version** | **License** | **Dependencies** | ++=================================================================================================+==============+==========================================================================================================+======================================================================================================================================================+ +| `pyTooling `__ | ≥2.11.0 | `Apache License, 2.0 `__ | *None* | ++-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ +| `Sphinx `__ | ≥5.3.0 | `BSD 3-Clause `__ | *Not yet evaluated.* | ++-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ +| `sphinxcontrib-mermaid `__ | ≥0.8.1 | `BSD `__ | *Not yet evaluated.* | ++-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ +| `autoapi `__ | ≥2.0.1 | `Apache License, 2.0 `__ | *Not yet evaluated.* | ++-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ +| `sphinx_btd_theme `__ | ≥0.5.2 | `MIT `__ | *Not yet evaluated.* | ++-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ +| !! `sphinx_fontawesome `__ | ≥0.0.6 | `GPL 2.0 `__ | *Not yet evaluated.* | ++-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ +| `sphinx_autodoc_typehints `__ | ≥1.19.5 | `MIT `__ | *Not yet evaluated.* | ++-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ +| `ruamel.yaml `__ | ≥0.17 | `MIT `__ | *Not yet evaluated.* | ++-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ + +.. _dependency-packaging: + +Packaging (Optional) +******************** + +Additional Python packages needed for installation package generation. These packages are only needed for developers or +on a CI server, thus sub-dependencies are not evaluated further. + + +.. rubric:: Manually Installing Packaging Requirements + +Use the :file:`build/requirements.txt` file to install all dependencies via ``pip3``. The file will recursively +install the mandatory dependencies too. + +.. code-block:: shell + + pip3 install -U -r build/requirements.txt + + +.. rubric:: Dependency List + ++----------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ +| **Package** | **Version** | **License** | **Dependencies** | ++============================================================================+==============+==========================================================================================================+======================================================================================================================================================+ +| `pyTooling `__ | ≥2.11.0 | `Apache License, 2.0 `__ | *None* | ++----------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ +| `wheel `__ | ≥0.38.1 | `MIT `__ | *Not yet evaluated.* | ++----------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ + + +.. _dependency-publishing: + +Publishing (CI-Server only) +*************************** + +Additional Python packages needed for publishing the generated installation package to e.g, PyPI or any equivalent +services. These packages are only needed for maintainers or on a CI server, thus sub-dependencies are not evaluated +further. + + +.. rubric:: Manually Installing Publishing Requirements + +Use the :file:`dist/requirements.txt` file to install all dependencies via ``pip3``. The file will recursively +install the mandatory dependencies too. + +.. code-block:: shell + + pip3 install -U -r dist/requirements.txt + + +.. rubric:: Dependency List + ++----------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------+----------------------+ +| **Package** | **Version** | **License** | **Dependencies** | ++==========================================================+==============+===========================================================================================+======================+ +| `wheel `__ | ≥0.38.1 | `MIT `__ | *Not yet evaluated.* | ++----------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------+----------------------+ +| `Twine `__ | any | `Apache License, 2.0 `__ | *Not yet evaluated.* | ++----------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------+----------------------+ diff --git a/doc/_extensions/DocumentMember.py b/doc/_extensions/DocumentMember.py index 516832e8f..9d9bab156 100644 --- a/doc/_extensions/DocumentMember.py +++ b/doc/_extensions/DocumentMember.py @@ -35,7 +35,7 @@ def skip_member_handler(app, what, name, obj, skip, options): try: attributes = DocumentMemberAttribute.GetAttributes(obj) - if (len(attributes) > 0): + if len(attributes) > 0: # print("*#"*20) # try: # print("skip_member_handler: ", obj) diff --git a/doc/conf.py b/doc/conf.py index def3ca98d..713f5821c 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -1,15 +1,7 @@ -# Configuration file for the Sphinx documentation builder. -# -# This file only contains a selection of the most common options. For a full -# list see the documentation: -# https://www.sphinx-doc.org/en/master/usage/configuration.html - -# -- Path setup -------------------------------------------------------------- - # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -# +from importlib.util import find_spec from json import loads from os.path import abspath from pathlib import Path @@ -17,11 +9,12 @@ from pyTooling.Packaging import extractVersionInformation +ROOT = Path(__file__).resolve().parent + sys_path.insert(0, abspath('.')) sys_path.insert(0, abspath('..')) sys_path.insert(0, abspath('../pyVHDLParser')) sys_path.insert(0, abspath('_extensions')) -#sys_path.insert(0, os.path.abspath('_themes/sphinx_rtd_theme')) # ============================================================================== @@ -32,7 +25,7 @@ # built documents. project = "pyVHDLParser" -packageInformationFile = Path(f"../{project}/__init__.py") +packageInformationFile = Path(f"../{project.replace('.', '/')}/__init__.py") versionInformation = extractVersionInformation(packageInformationFile) author = versionInformation.Author @@ -61,7 +54,7 @@ ] # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'stata-dark' +pygments_style = "manni" # ============================================================================== @@ -80,24 +73,39 @@ # ============================================================================== # Options for HTML output # ============================================================================== -html_theme_options = { - 'home_breadcrumbs': True, - 'vcs_pageview_mode': 'blob', -} - html_context = {} -ctx = Path(__file__).resolve().parent / 'context.json' +ctx = ROOT / "context.json" if ctx.is_file(): html_context.update(loads(ctx.open('r').read())) -html_theme_path = ["."] -html_theme = "_theme" +if (ROOT / "_theme").is_dir(): + html_theme_path = ["."] + html_theme = "_theme" + html_theme_options = { + "logo_only": True, + "home_breadcrumbs": False, + "vcs_pageview_mode": 'blob', +# "body_max_width": None +# "navigation_depth": 5, + } +elif find_spec("sphinx_rtd_theme") is not None: + html_theme = "sphinx_rtd_theme" + html_theme_options = { + "logo_only": True, + "vcs_pageview_mode": 'blob', +# "navigation_depth": 5, + } +else: + html_theme = "alabaster" # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] +html_logo = str(Path(html_static_path[0]) / "logo.svg") +html_favicon = str(Path(html_static_path[0]) / "favicon.svg") + # Output file base name for HTML help builder. htmlhelp_basename = 'pyVHDLParserDoc' @@ -107,6 +115,14 @@ html_last_updated_fmt = "%d.%m.%Y" +# ============================================================================== +# Python settings +# ============================================================================== +modindex_common_prefix = [ + f"{project}." +] + + # ============================================================================== # Options for LaTeX / PDF output # ============================================================================== @@ -161,46 +177,32 @@ extensions = [ # Standard Sphinx extensions "sphinx.ext.autodoc", - 'sphinx.ext.extlinks', - 'sphinx.ext.intersphinx', - 'sphinx.ext.inheritance_diagram', - 'sphinx.ext.todo', - 'sphinx.ext.graphviz', - 'sphinx.ext.mathjax', - 'sphinx.ext.ifconfig', - 'sphinx.ext.viewcode', -# 'sphinx.ext.duration', - + "sphinx.ext.coverage", + "sphinx.ext.extlinks", + "sphinx.ext.intersphinx", + "sphinx.ext.inheritance_diagram", + "sphinx.ext.todo", + "sphinx.ext.graphviz", + "sphinx.ext.mathjax", + "sphinx.ext.ifconfig", + "sphinx.ext.viewcode", # SphinxContrib extensions -# 'sphinxcontrib.actdiag', - 'sphinxcontrib.mermaid', -# 'sphinxcontrib.seqdiag', -# 'sphinxcontrib.textstyle', -# 'sphinxcontrib.spelling', -# 'changelog', - -# BuildTheDocs extensions -# 'btd.sphinx.autoprogram', -# 'btd.sphinx.graphviz', -# 'btd.sphinx.inheritance_diagram', - + "sphinxcontrib.mermaid", # Other extensions -# 'DocumentMember', - 'sphinx_fontawesome', - 'sphinx_autodoc_typehints', - -# local extensions (patched) -# 'autoapi.sphinx', - -# local extensions -# 'DocumentMember' + "sphinx_fontawesome", + "sphinx_autodoc_typehints", + "autoapi.sphinx", ] + # ============================================================================== # Sphinx.Ext.InterSphinx # ============================================================================== intersphinx_mapping = { - 'python': ('https://docs.python.org/3', None), + 'python': ('https://docs.python.org/3', None), + 'vasg': ('https://IEEE-P1076.gitlab.io/', None), + 'pyTool': ('https://pyTooling.github.io/pyTooling/', None), + 'ghdl': ('https://GHDL.github.io/ghdl/', None), } @@ -208,7 +210,16 @@ # Sphinx.Ext.AutoDoc # ============================================================================== # see: https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#configuration +#autodoc_default_options = { +# "private-members": True, +# "special-members": True, +# "inherited-members": True, +# "exclude-members": "__weakref__" +#} +autodoc_class_signature = "separated" autodoc_member_order = "bysource" # alphabetical, groupwise, bysource +autodoc_typehints = "both" +#autoclass_content = "both" # ============================================================================== @@ -227,6 +238,26 @@ graphviz_output_format = "svg" +# ============================================================================== +# SphinxContrib.Mermaid +# ============================================================================== +mermaid_params = [ + '--backgroundColor', 'transparent', +] +mermaid_verbose = True + + +# ============================================================================== +# Sphinx.Ext.Inheritance_Diagram +# ============================================================================== +inheritance_node_attrs = { +# "shape": "ellipse", +# "fontsize": 14, +# "height": 0.75, + "color": "dodgerblue1", + "style": "filled" +} + # ============================================================================== # Sphinx.Ext.ToDo @@ -236,6 +267,11 @@ todo_link_only = True +# ============================================================================== +# Sphinx.Ext.Coverage +# ============================================================================== +coverage_show_missing_items = True + # ============================================================================== # AutoAPI.Sphinx diff --git a/doc/index.rst b/doc/index.rst index a0d1c9b33..f311cc7ce 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -98,6 +98,18 @@ Additional Aims News **** +.. only:: html + + Mar. 2023 - Enhancements + ======================== + +.. only:: latex + + .. rubric:: Mar. 2023 - Enhancements + +* Bumped dependencies to pyVHDLModel and updated interfaces. +* CLI entrypoint will be installed as a binary. + .. only:: html Jun. 2021 - Enhancements @@ -108,7 +120,6 @@ News .. rubric:: Jun. 2021 - Enhancements * Added infrastructure to run example code provided in issues as testcase. -* * New Single-File GitHub Action workflow (pipeline). * Added Dependabot configuration file. * Updated dependencies diff --git a/doc/requirements.txt b/doc/requirements.txt index 645cc7bb5..0114d2e16 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -7,7 +7,7 @@ pyTooling>=2.12.3 # Sphinx Extenstions #sphinx.ext.coverage #sphinxcontrib-actdiag>=0.8.5 -sphinxcontrib-mermaid>=0.8.0 +sphinxcontrib-mermaid>=0.8.1 #sphinxcontrib-seqdiag>=0.8.5 #sphinxcontrib-textstyle>=0.2.1 #sphinxcontrib-spelling>=2.2.0 diff --git a/pyVHDLParser/ANTLR4/VHDLParser.py b/pyVHDLParser/ANTLR4/VHDLParser.py index 42c70783c..4f5589fa7 100644 --- a/pyVHDLParser/ANTLR4/VHDLParser.py +++ b/pyVHDLParser/ANTLR4/VHDLParser.py @@ -4834,7 +4834,7 @@ def rule_ConcurrentConditionalSignalAssignment(self): self.state = 970 self._errHandler.sync(self) _la = self._input.LA(1) - if ((((_la - 48)) & ~0x3f) == 0 and ((1 << (_la - 48)) & 36028814198833153) != 0): + if (((_la - 48)) & ~0x3f) == 0 and ((1 << (_la - 48)) & 36028814198833153) != 0: self.state = 969 localctx.delayMechanism = self.rule_DelayMechanism() @@ -4994,7 +4994,7 @@ def rule_ConcurrentSelectedSignalAssignment(self): self.state = 994 self._errHandler.sync(self) _la = self._input.LA(1) - if ((((_la - 48)) & ~0x3f) == 0 and ((1 << (_la - 48)) & 36028814198833153) != 0): + if (((_la - 48)) & ~0x3f) == 0 and ((1 << (_la - 48)) & 36028814198833153) != 0: self.state = 993 localctx.delayMechanism = self.rule_DelayMechanism() @@ -5155,7 +5155,7 @@ def rule_ConcurrentSimpleSignalAssignment(self): self.state = 1017 self._errHandler.sync(self) _la = self._input.LA(1) - if ((((_la - 48)) & ~0x3f) == 0 and ((1 << (_la - 48)) & 36028814198833153) != 0): + if (((_la - 48)) & ~0x3f) == 0 and ((1 << (_la - 48)) & 36028814198833153) != 0: self.state = 1016 localctx.delayMechanism = self.rule_DelayMechanism() @@ -5561,7 +5561,7 @@ def rule_ConditionalSignalAssignment(self): self.state = 1073 self._errHandler.sync(self) _la = self._input.LA(1) - if ((((_la - 48)) & ~0x3f) == 0 and ((1 << (_la - 48)) & 36028814198833153) != 0): + if (((_la - 48)) & ~0x3f) == 0 and ((1 << (_la - 48)) & 36028814198833153) != 0: self.state = 1072 localctx.delayMechanism = self.rule_DelayMechanism() @@ -12557,7 +12557,7 @@ def rule_InterfaceVariableDeclaration(self): self.state = 1931 self._errHandler.sync(self) _la = self._input.LA(1) - if ((((_la - 20)) & ~0x3f) == 0 and ((1 << (_la - 20)) & 562959214444545) != 0): + if (((_la - 20)) & ~0x3f) == 0 and ((1 << (_la - 20)) & 562959214444545) != 0: self.state = 1930 localctx.modeName = self.rule_Mode() @@ -18912,7 +18912,7 @@ def rule_Signature(self): self.state = 2777 self._errHandler.sync(self) _la = self._input.LA(1) - if ((((_la - 147)) & ~0x3f) == 0 and ((1 << (_la - 147)) & 114689) != 0): + if (((_la - 147)) & ~0x3f) == 0 and ((1 << (_la - 147)) & 114689) != 0: self.state = 2769 localctx._rule_Name = self.rule_Name(0) localctx.names.append(localctx._rule_Name) @@ -19132,7 +19132,7 @@ def rule_SimpleModeIndication(self): self.state = 2802 self._errHandler.sync(self) _la = self._input.LA(1) - if ((((_la - 20)) & ~0x3f) == 0 and ((1 << (_la - 20)) & 562959214444545) != 0): + if (((_la - 20)) & ~0x3f) == 0 and ((1 << (_la - 20)) & 562959214444545) != 0: self.state = 2801 self.rule_Mode() @@ -19377,7 +19377,7 @@ def rule_SimpleWaveformAssignment(self): self.state = 2829 self._errHandler.sync(self) _la = self._input.LA(1) - if ((((_la - 48)) & ~0x3f) == 0 and ((1 << (_la - 48)) & 36028814198833153) != 0): + if (((_la - 48)) & ~0x3f) == 0 and ((1 << (_la - 48)) & 36028814198833153) != 0: self.state = 2828 self.rule_DelayMechanism() diff --git a/pyVHDLParser/Blocks/Assignment/SignalAssignment.py b/pyVHDLParser/Blocks/Assignment/SignalAssignment.py index 09f424889..cc0215941 100644 --- a/pyVHDLParser/Blocks/Assignment/SignalAssignment.py +++ b/pyVHDLParser/Blocks/Assignment/SignalAssignment.py @@ -43,7 +43,7 @@ def stateSignalAssignmentKeyword(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected whitespace after keyword SignalAssignment." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewBlock = SignalAssignmentBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -51,14 +51,14 @@ def stateSignalAssignmentKeyword(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace1 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = SignalAssignmentBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = SignalAssignmentBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 @@ -77,9 +77,9 @@ def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected signalAssignment name (identifier)." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = SignalAssignmentBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -87,13 +87,13 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = SignalAssignmentBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = SignalAssignmentBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart @@ -103,7 +103,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NewToken = IdentifierToken(fromExistingToken=token) parserState.NextState = cls.stateSignalAssignmentName return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -116,12 +116,12 @@ def stateSignalAssignmentName(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected ';' after signalAssignment name." if isinstance(token, CharacterToken): - if (token == ";"): + if token == ";": parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = SignalAssignmentBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() return - elif (token == "\n"): + elif token == "\n": parserState.NewBlock = SignalAssignmentBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -129,14 +129,14 @@ def stateSignalAssignmentName(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace2 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = SignalAssignmentBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace2 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = SignalAssignmentBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace2 @@ -154,14 +154,14 @@ def stateWhitespace2(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected ';'." if isinstance(token, CharacterToken): - if (token == ";"): + if token == ";": parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = SignalAssignmentBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() return - elif (token == "\n"): + elif token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = SignalAssignmentBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -169,19 +169,19 @@ def stateWhitespace2(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = SignalAssignmentBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = SignalAssignmentBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None diff --git a/pyVHDLParser/Blocks/Assignment/VariableAssignment.py b/pyVHDLParser/Blocks/Assignment/VariableAssignment.py index 09f424889..cc0215941 100644 --- a/pyVHDLParser/Blocks/Assignment/VariableAssignment.py +++ b/pyVHDLParser/Blocks/Assignment/VariableAssignment.py @@ -43,7 +43,7 @@ def stateSignalAssignmentKeyword(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected whitespace after keyword SignalAssignment." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewBlock = SignalAssignmentBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -51,14 +51,14 @@ def stateSignalAssignmentKeyword(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace1 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = SignalAssignmentBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = SignalAssignmentBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 @@ -77,9 +77,9 @@ def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected signalAssignment name (identifier)." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = SignalAssignmentBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -87,13 +87,13 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = SignalAssignmentBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = SignalAssignmentBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart @@ -103,7 +103,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NewToken = IdentifierToken(fromExistingToken=token) parserState.NextState = cls.stateSignalAssignmentName return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -116,12 +116,12 @@ def stateSignalAssignmentName(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected ';' after signalAssignment name." if isinstance(token, CharacterToken): - if (token == ";"): + if token == ";": parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = SignalAssignmentBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() return - elif (token == "\n"): + elif token == "\n": parserState.NewBlock = SignalAssignmentBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -129,14 +129,14 @@ def stateSignalAssignmentName(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace2 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = SignalAssignmentBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace2 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = SignalAssignmentBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace2 @@ -154,14 +154,14 @@ def stateWhitespace2(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected ';'." if isinstance(token, CharacterToken): - if (token == ";"): + if token == ";": parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = SignalAssignmentBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() return - elif (token == "\n"): + elif token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = SignalAssignmentBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -169,19 +169,19 @@ def stateWhitespace2(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = SignalAssignmentBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = SignalAssignmentBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None diff --git a/pyVHDLParser/Blocks/Attribute/AttributeDeclaration.py b/pyVHDLParser/Blocks/Attribute/AttributeDeclaration.py index f0162b54d..3a7243d85 100644 --- a/pyVHDLParser/Blocks/Attribute/AttributeDeclaration.py +++ b/pyVHDLParser/Blocks/Attribute/AttributeDeclaration.py @@ -43,7 +43,7 @@ def stateAttributeDeclarationKeyword(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected whitespace after keyword ATTRIBUTE." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewBlock = AttributeDeclarationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -51,14 +51,14 @@ def stateAttributeDeclarationKeyword(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace1 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = AttributeDeclarationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = AttributeDeclarationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 @@ -77,9 +77,9 @@ def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected attribute name (identifier)." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = AttributeDeclarationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -87,13 +87,13 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = AttributeDeclarationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = AttributeDeclarationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart @@ -103,7 +103,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NewToken = IdentifierToken(fromExistingToken=token) parserState.NextState = cls.stateAttributeDeclarationName return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -116,11 +116,11 @@ def stateAttributeDeclarationName(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected ';' after library name." if isinstance(token, CharacterToken): - if (token == ":"): + if token == ":": parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NextState = cls.stateColon1 return - elif (token == "\n"): + elif token == "\n": parserState.NewBlock = AttributeDeclarationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -128,14 +128,14 @@ def stateAttributeDeclarationName(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace2 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = AttributeDeclarationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace2 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = AttributeDeclarationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace2 @@ -153,13 +153,13 @@ def stateWhitespace2(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected attribute name (identifier)." if isinstance(token, CharacterToken): - if (token == ":"): + if token == ":": parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NextState = cls.stateColon1 return - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = AttributeDeclarationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -167,13 +167,13 @@ def stateWhitespace2(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = AttributeDeclarationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = AttributeDeclarationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart @@ -183,7 +183,7 @@ def stateWhitespace2(cls, parserState: ParserState): parserState.NewToken = IdentifierToken(fromExistingToken=token) parserState.NextState = cls.stateColon1() return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -196,7 +196,7 @@ def stateColon1(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected type mark or whitespace after ':'." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewBlock = AttributeDeclarationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -204,14 +204,14 @@ def stateColon1(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace3 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = AttributeDeclarationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace3 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = AttributeDeclarationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace3 @@ -234,9 +234,9 @@ def stateWhitespace3(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected type mark (identifier)." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = AttributeDeclarationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -244,13 +244,13 @@ def stateWhitespace3(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = AttributeDeclarationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = AttributeDeclarationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart @@ -260,7 +260,7 @@ def stateWhitespace3(cls, parserState: ParserState): parserState.NewToken = IdentifierToken(fromExistingToken=token) parserState.NextState = cls.stateTypeMarkName return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -273,11 +273,11 @@ def stateTypeMarkName(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected ':=' or whitespace after type mark." if isinstance(token, CharacterToken): - if (token == ":"): + if token == ":": parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NextState = cls.statePossibleVariableAssignment return - elif (token == "\n"): + elif token == "\n": parserState.NewBlock = AttributeDeclarationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -285,14 +285,14 @@ def stateTypeMarkName(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace4 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = AttributeDeclarationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace4 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = AttributeDeclarationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace4 @@ -310,13 +310,13 @@ def stateWhitespace4(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected ':=' after type mark." if isinstance(token, CharacterToken): - if (token == ":"): + if token == ":": parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NextState = cls.statePossibleVariableAssignment return - elif (token == "\n"): + elif token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = AttributeDeclarationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -324,19 +324,19 @@ def stateWhitespace4(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = AttributeDeclarationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = AttributeDeclarationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -347,7 +347,7 @@ def stateWhitespace4(cls, parserState: ParserState): @classmethod def statePossibleVariableAssignment(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == "=")): + if isinstance(token, CharacterToken) and (token == "="): parserState.NewToken = VariableAssignmentKeyword(parserState.TokenMarker) parserState.TokenMarker = parserState.NewToken parserState.NextState = cls.stateVariableAssignment @@ -360,7 +360,7 @@ def stateVariableAssignment(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected ':=' or whitespace after attributeDeclaration mark." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewBlock = AttributeDeclarationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -368,14 +368,14 @@ def stateVariableAssignment(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace5 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = AttributeDeclarationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace5 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = AttributeDeclarationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace5 @@ -393,9 +393,9 @@ def stateWhitespace5(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected expression after ':='." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = AttributeDeclarationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -403,13 +403,13 @@ def stateWhitespace5(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = AttributeDeclarationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = AttributeDeclarationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart @@ -418,7 +418,7 @@ def stateWhitespace5(cls, parserState: ParserState): elif isinstance(token, WordToken): parserState.NextState = cls.stateExpressionEnd return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -431,18 +431,18 @@ def stateExpressionEnd(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected ';'." if isinstance(token, CharacterToken): - if (token == ";"): + if token == ";": parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = AttributeDeclarationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() return - elif (token == "-"): + elif token == "-": parserState.NewBlock = AttributeDeclarationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = AttributeDeclarationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart diff --git a/pyVHDLParser/Blocks/Attribute/AttributeSpecification.py b/pyVHDLParser/Blocks/Attribute/AttributeSpecification.py index 8ba0d4f6e..3020f8370 100644 --- a/pyVHDLParser/Blocks/Attribute/AttributeSpecification.py +++ b/pyVHDLParser/Blocks/Attribute/AttributeSpecification.py @@ -43,7 +43,7 @@ def stateAttributeSpecificationKeyword(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected whitespace after keyword ATTRIBUTE." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewBlock = AttributeSpecificationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -51,14 +51,14 @@ def stateAttributeSpecificationKeyword(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace1 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = AttributeSpecificationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = AttributeSpecificationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 @@ -77,9 +77,9 @@ def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected attribute name (identifier)." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = AttributeSpecificationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -87,13 +87,13 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = AttributeSpecificationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = AttributeSpecificationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart @@ -103,7 +103,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NewToken = IdentifierToken(fromExistingToken=token) parserState.NextState = cls.stateAttributeSpecificationName return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -116,11 +116,11 @@ def stateAttributeSpecificationName(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected ';' after library name." if isinstance(token, CharacterToken): - if (token == ":"): + if token == ":": parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NextState = cls.stateColon1 return - elif (token == "\n"): + elif token == "\n": parserState.NewBlock = AttributeSpecificationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -128,14 +128,14 @@ def stateAttributeSpecificationName(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace2 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = AttributeSpecificationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace2 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = AttributeSpecificationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace2 @@ -153,13 +153,13 @@ def stateWhitespace2(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected attribute name (identifier)." if isinstance(token, CharacterToken): - if (token == ":"): + if token == ":": parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NextState = cls.stateColon1 return - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = AttributeSpecificationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -167,13 +167,13 @@ def stateWhitespace2(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = AttributeSpecificationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = AttributeSpecificationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart @@ -183,7 +183,7 @@ def stateWhitespace2(cls, parserState: ParserState): parserState.NewToken = IdentifierToken(fromExistingToken=token) parserState.NextState = cls.stateColon1() return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -196,7 +196,7 @@ def stateColon1(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected type mark or whitespace after ':'." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewBlock = AttributeSpecificationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -204,14 +204,14 @@ def stateColon1(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace3 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = AttributeSpecificationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace3 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = AttributeSpecificationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace3 @@ -234,9 +234,9 @@ def stateWhitespace3(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected type mark (identifier)." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = AttributeSpecificationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -244,13 +244,13 @@ def stateWhitespace3(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = AttributeSpecificationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = AttributeSpecificationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart @@ -260,7 +260,7 @@ def stateWhitespace3(cls, parserState: ParserState): parserState.NewToken = IdentifierToken(fromExistingToken=token) parserState.NextState = cls.stateTypeMarkName return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -273,11 +273,11 @@ def stateTypeMarkName(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected ':=' or whitespace after type mark." if isinstance(token, CharacterToken): - if (token == ":"): + if token == ":": parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NextState = cls.statePossibleVariableAssignment return - elif (token == "\n"): + elif token == "\n": parserState.NewBlock = AttributeSpecificationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -285,14 +285,14 @@ def stateTypeMarkName(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace4 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = AttributeSpecificationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace4 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = AttributeSpecificationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace4 @@ -310,13 +310,13 @@ def stateWhitespace4(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected ':=' after type mark." if isinstance(token, CharacterToken): - if (token == ":"): + if token == ":": parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NextState = cls.statePossibleVariableAssignment return - elif (token == "\n"): + elif token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = AttributeSpecificationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -324,19 +324,19 @@ def stateWhitespace4(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = AttributeSpecificationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = AttributeSpecificationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -347,7 +347,7 @@ def stateWhitespace4(cls, parserState: ParserState): @classmethod def statePossibleVariableAssignment(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == "=")): + if isinstance(token, CharacterToken) and (token == "="): parserState.NewToken = VariableAssignmentKeyword(parserState.TokenMarker) parserState.TokenMarker = parserState.NewToken parserState.NextState = cls.stateVariableAssignment @@ -360,7 +360,7 @@ def stateVariableAssignment(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected ':=' or whitespace after attributeSpecification mark." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewBlock = AttributeSpecificationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -368,14 +368,14 @@ def stateVariableAssignment(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace5 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = AttributeSpecificationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace5 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = AttributeSpecificationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace5 @@ -393,9 +393,9 @@ def stateWhitespace5(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected expression after ':='." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = AttributeSpecificationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -403,13 +403,13 @@ def stateWhitespace5(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = AttributeSpecificationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = AttributeSpecificationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart @@ -418,7 +418,7 @@ def stateWhitespace5(cls, parserState: ParserState): elif isinstance(token, WordToken): parserState.NextState = cls.stateExpressionEnd return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -431,18 +431,18 @@ def stateExpressionEnd(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected ';'." if isinstance(token, CharacterToken): - if (token == ";"): + if token == ";": parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = AttributeSpecificationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() return - elif (token == "-"): + elif token == "-": parserState.NewBlock = AttributeSpecificationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = AttributeSpecificationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart diff --git a/pyVHDLParser/Blocks/Comment.py b/pyVHDLParser/Blocks/Comment.py index 12ec7d773..e8cf9743f 100644 --- a/pyVHDLParser/Blocks/Comment.py +++ b/pyVHDLParser/Blocks/Comment.py @@ -40,7 +40,7 @@ class SingleLineCommentBlock(CommentBlock): @classmethod def statePossibleCommentStart(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == "-")): + if isinstance(token, CharacterToken) and (token == "-"): parserState.NewToken = SingleLineCommentKeyword(parserState.TokenMarker) parserState.TokenMarker = parserState.NewToken parserState.NextState = cls.stateConsumeComment @@ -51,7 +51,7 @@ def statePossibleCommentStart(cls, parserState: ParserState): @classmethod def stateConsumeComment(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken)and (token == "\n")): + if isinstance(token, CharacterToken)and (token == "\n"): parserState.NewBlock = SingleLineCommentBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.Token) parserState.NextState = cls.stateLinebreak return @@ -67,7 +67,7 @@ def stateLinebreak(cls, parserState: ParserState): parserState.Pop() else: parserState.Pop() - if (parserState.TokenMarker is None): + if parserState.TokenMarker is None: # print(" new marker: None -> {0!s}".format(token)) parserState.TokenMarker = token # print(" {DARK_GREEN}re-issue: {GREEN}{state!s} {DARK_GREEN}token={GREEN}{token}{NOCOLOR}".format(state=parserState, token=parserState.Token, **Console.Foreground)) @@ -79,7 +79,7 @@ class MultiLineCommentBlock(CommentBlock): @classmethod def statePossibleCommentStart(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == "*")): + if isinstance(token, CharacterToken) and (token == "*"): parserState.NewToken = MultiLineCommentStartKeyword(parserState.TokenMarker) parserState.TokenMarker = parserState.NewToken parserState.NextState = cls.stateConsumeComment @@ -92,7 +92,7 @@ def statePossibleCommentStart(cls, parserState: ParserState): @classmethod def stateConsumeComment(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == "*")): + if isinstance(token, CharacterToken) and (token == "*"): parserState.PushState = cls.statePossibleCommentEnd parserState.TokenMarker = token return @@ -102,7 +102,7 @@ def stateConsumeComment(cls, parserState: ParserState): @classmethod def statePossibleCommentEnd(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == "/")): + if isinstance(token, CharacterToken) and (token == "/"): parserState.NewToken = MultiLineCommentEndKeyword(parserState.TokenMarker) parserState.Pop() parserState.NewBlock = MultiLineCommentBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) diff --git a/pyVHDLParser/Blocks/Common.py b/pyVHDLParser/Blocks/Common.py index 124c772b5..c9a2e3a67 100644 --- a/pyVHDLParser/Blocks/Common.py +++ b/pyVHDLParser/Blocks/Common.py @@ -59,7 +59,7 @@ def stateLinebreak(cls, parserState: ParserState): # print(" {GREEN}continue: {0!s}{NOCOLOR}".format(parserState, **Console.Foreground)) else: parserState.Pop() - if (parserState.TokenMarker is None): + if parserState.TokenMarker is None: # print(" {DARK_GREEN}set marker: {GREEN}LinebreakBlock.stateLinebreak {DARK_GREEN}marker {GREEN}{0!s}{NOCOLOR}".format(token, **Console.Foreground)) parserState.TokenMarker = token # print(" {DARK_GREEN}re-issue: {GREEN}{state!s: <20s} {DARK_GREEN}token {GREEN}{token}{NOCOLOR}".format(state=parserState, token=parserState.Token, **Console.Foreground)) diff --git a/pyVHDLParser/Blocks/ControlStructure/Case.py b/pyVHDLParser/Blocks/ControlStructure/Case.py index 00a881503..249f0a936 100644 --- a/pyVHDLParser/Blocks/ControlStructure/Case.py +++ b/pyVHDLParser/Blocks/ControlStructure/Case.py @@ -55,7 +55,7 @@ def stateArrowKeyword(cls, parserState: ParserState): @classmethod def stateSequentialRegion(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, WordToken) and (token <= "when")): + if isinstance(token, WordToken) and (token <= "when"): newToken = WhenKeyword(fromExistingToken=token) parserState.NewToken = newToken parserState.TokenMarker = newToken @@ -79,7 +79,7 @@ class WhenBlock(SequentialBeginBlock): @classmethod def stateWhenKeyword(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == "(")): + if isinstance(token, CharacterToken) and (token == "("): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) parserState.TokenMarker = parserState.NewToken @@ -109,7 +109,7 @@ def stateWhenKeyword(cls, parserState: ParserState): def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token if isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -121,9 +121,9 @@ def stateWhitespace1(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -164,18 +164,18 @@ def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token if isinstance(token, WordToken): tokenValue = token.Value.lower() - if (tokenValue == "when"): + if tokenValue == "when": newToken = WhenKeyword(fromExistingToken=token) parserState.NewToken = newToken parserState.TokenMarker = newToken parserState.NextState = WhenBlock.stateWhenKeyword return - elif (tokenValue == "end"): + elif tokenValue == "end": parserState.NewToken = EndKeyword(fromExistingToken=token) parserState.NextState = cls.END_BLOCK.stateEndKeyword return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -187,9 +187,9 @@ def stateWhitespace1(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -209,7 +209,7 @@ class CaseBlock(Block): @classmethod def stateCaseKeyword(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == "(")): + if isinstance(token, CharacterToken) and (token == "("): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) parserState.TokenMarker = parserState.NewToken @@ -239,7 +239,7 @@ def stateCaseKeyword(cls, parserState: ParserState): def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token if isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -251,9 +251,9 @@ def stateWhitespace1(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None diff --git a/pyVHDLParser/Blocks/ControlStructure/Exit.py b/pyVHDLParser/Blocks/ControlStructure/Exit.py index 8f34a7d7e..47cb226c2 100644 --- a/pyVHDLParser/Blocks/ControlStructure/Exit.py +++ b/pyVHDLParser/Blocks/ControlStructure/Exit.py @@ -53,7 +53,7 @@ class ExitBlock(Block): @classmethod def stateExitKeyword(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == ";")): + if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() @@ -77,13 +77,13 @@ def stateExitKeyword(cls, parserState: ParserState): @classmethod def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == ";")): + if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() return elif isinstance(token, WordToken): - if (token <= "when"): + if token <= "when": parserState.NewToken = WhenKeyword(fromExistingToken=token) parserState.NextState = cls.stateWhenKeyword return @@ -100,9 +100,9 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NewBlock = block(parserState.LastBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -113,7 +113,7 @@ def stateWhitespace1(cls, parserState: ParserState): @classmethod def stateExitLoopLabel(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == ";")): + if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() @@ -137,12 +137,12 @@ def stateExitLoopLabel(cls, parserState: ParserState): @classmethod def stateWhitespace2(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == ";")): + if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() return - elif (isinstance(token, WordToken) and (token <= "when")): + elif isinstance(token, WordToken) and (token <= "when"): parserState.NewToken = WhenKeyword(fromExistingToken=token) parserState.NextState = cls.stateWhenKeyword return @@ -151,9 +151,9 @@ def stateWhitespace2(cls, parserState: ParserState): parserState.NewBlock = block(parserState.LastBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -194,13 +194,13 @@ def stateWhenKeyword(cls, parserState: ParserState): @classmethod def stateWhitespace3(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == ";")): + if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = EndBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) parserState.Pop() return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -212,7 +212,7 @@ def stateWhitespace3(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return elif (isinstance(token, SpaceToken) and ( isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): diff --git a/pyVHDLParser/Blocks/ControlStructure/ForLoop.py b/pyVHDLParser/Blocks/ControlStructure/ForLoop.py index 629eb781c..eb5dbd0b6 100644 --- a/pyVHDLParser/Blocks/ControlStructure/ForLoop.py +++ b/pyVHDLParser/Blocks/ControlStructure/ForLoop.py @@ -68,7 +68,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NextState = cls.stateIteratorName return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -80,9 +80,9 @@ def stateWhitespace1(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -110,14 +110,14 @@ def stateIteratorName(cls, parserState: ParserState): @classmethod def stateWhitespace2(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, WordToken) and (token <= "in")): + if isinstance(token, WordToken) and (token <= "in"): parserState.NewToken = InKeyword(fromExistingToken=token) # parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) # parserState.TokenMarker = None parserState.NextState = cls.stateInKeyword return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -129,9 +129,9 @@ def stateWhitespace2(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -142,7 +142,7 @@ def stateWhitespace2(cls, parserState: ParserState): @classmethod def stateInKeyword(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == "(")): + if isinstance(token, CharacterToken) and (token == "("): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) parserState.TokenMarker = parserState.NewToken @@ -167,7 +167,7 @@ def stateInKeyword(cls, parserState: ParserState): def stateWhitespace3(cls, parserState: ParserState): token = parserState.Token if isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -179,9 +179,9 @@ def stateWhitespace3(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None diff --git a/pyVHDLParser/Blocks/ControlStructure/If.py b/pyVHDLParser/Blocks/ControlStructure/If.py index 59c7c7991..14b6b9bfd 100644 --- a/pyVHDLParser/Blocks/ControlStructure/If.py +++ b/pyVHDLParser/Blocks/ControlStructure/If.py @@ -58,13 +58,13 @@ def stateSequentialRegion(cls, parserState: ParserState): if isinstance(token, WordToken): tokenValue = token.Value.lower() - if (tokenValue == "elsif"): + if tokenValue == "elsif": newToken = ElsIfKeyword(fromExistingToken=token) parserState.NewToken = newToken parserState.TokenMarker = newToken parserState.NextState = ElsIfConditionBlock.stateElsIfKeyword return - elif (tokenValue == "else"): + elif tokenValue == "else": newToken = ElseKeyword(fromExistingToken=token) parserState.NewToken = newToken parserState.NewBlock = ElseBlock(parserState.LastBlock, newToken) @@ -95,7 +95,7 @@ class IfConditionBlock(Block): @classmethod def stateIfKeyword(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == "(")): + if isinstance(token, CharacterToken) and (token == "("): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) parserState.TokenMarker = parserState.NewToken @@ -125,7 +125,7 @@ def stateIfKeyword(cls, parserState: ParserState): def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token if isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -137,9 +137,9 @@ def stateWhitespace1(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -158,7 +158,7 @@ class ElsIfConditionBlock(Block): @classmethod def stateElsIfKeyword(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == "(")): + if isinstance(token, CharacterToken) and (token == "("): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) parserState.TokenMarker = parserState.NewToken @@ -188,7 +188,7 @@ def stateElsIfKeyword(cls, parserState: ParserState): def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token if isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -200,9 +200,9 @@ def stateWhitespace1(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None diff --git a/pyVHDLParser/Blocks/ControlStructure/Next.py b/pyVHDLParser/Blocks/ControlStructure/Next.py index 87561749e..2cd381fcf 100644 --- a/pyVHDLParser/Blocks/ControlStructure/Next.py +++ b/pyVHDLParser/Blocks/ControlStructure/Next.py @@ -53,7 +53,7 @@ class NextBlock(Block): @classmethod def stateNextKeyword(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == ";")): + if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() @@ -77,13 +77,13 @@ def stateNextKeyword(cls, parserState: ParserState): @classmethod def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == ";")): + if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() return elif isinstance(token, WordToken): - if (token <= "when"): + if token <= "when": parserState.NewToken = WhenKeyword(fromExistingToken=token) parserState.NextState = cls.stateWhenKeyword return @@ -100,9 +100,9 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NewBlock = block(parserState.LastBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -113,7 +113,7 @@ def stateWhitespace1(cls, parserState: ParserState): @classmethod def stateNextLoopLabel(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == ";")): + if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() @@ -137,12 +137,12 @@ def stateNextLoopLabel(cls, parserState: ParserState): @classmethod def stateWhitespace2(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == ";")): + if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() return - elif (isinstance(token, WordToken) and (token <= "when")): + elif isinstance(token, WordToken) and (token <= "when"): parserState.NewToken = WhenKeyword(fromExistingToken=token) parserState.NextState = cls.stateWhenKeyword return @@ -151,9 +151,9 @@ def stateWhitespace2(cls, parserState: ParserState): parserState.NewBlock = block(parserState.LastBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -194,13 +194,13 @@ def stateWhenKeyword(cls, parserState: ParserState): @classmethod def stateWhitespace3(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == ";")): + if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = EndBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) parserState.Pop() return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -212,7 +212,7 @@ def stateWhitespace3(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return elif (isinstance(token, SpaceToken) and ( isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): diff --git a/pyVHDLParser/Blocks/ControlStructure/Null.py b/pyVHDLParser/Blocks/ControlStructure/Null.py index 03f2a819b..f4fd26eb2 100644 --- a/pyVHDLParser/Blocks/ControlStructure/Null.py +++ b/pyVHDLParser/Blocks/ControlStructure/Null.py @@ -47,7 +47,7 @@ class NullBlock(Block): @classmethod def stateNullKeyword(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == ";")): + if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() @@ -68,7 +68,7 @@ def stateNullKeyword(cls, parserState: ParserState): @classmethod def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == ";")): + if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() @@ -78,9 +78,9 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NewBlock = block(parserState.LastBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None diff --git a/pyVHDLParser/Blocks/ControlStructure/Return.py b/pyVHDLParser/Blocks/ControlStructure/Return.py index ac6d455ca..20b19291d 100644 --- a/pyVHDLParser/Blocks/ControlStructure/Return.py +++ b/pyVHDLParser/Blocks/ControlStructure/Return.py @@ -82,13 +82,13 @@ def stateReturnKeyword(cls, parserState: ParserState): @classmethod def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == ";")): + if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = EndBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) parserState.Pop() return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -100,7 +100,7 @@ def stateWhitespace1(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return elif (isinstance(token, SpaceToken) and ( isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): diff --git a/pyVHDLParser/Blocks/ControlStructure/WhileLoop.py b/pyVHDLParser/Blocks/ControlStructure/WhileLoop.py index 9df143610..34b1b550d 100644 --- a/pyVHDLParser/Blocks/ControlStructure/WhileLoop.py +++ b/pyVHDLParser/Blocks/ControlStructure/WhileLoop.py @@ -47,7 +47,7 @@ def stateWhileKeyword(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected whitespace after keyword WHILE." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewBlock = ConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -55,14 +55,14 @@ def stateWhileKeyword(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace1 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = ConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = ConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 @@ -81,9 +81,9 @@ def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected while name (identifier)." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = ConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -91,13 +91,13 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = ConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = ConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart @@ -107,7 +107,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NewToken = IdentifierToken(fromExistingToken=token) parserState.NextState = cls.stateWhileName return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -120,7 +120,7 @@ def stateWhileName(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected whitespace after keyword WHILE." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewBlock = ConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -128,14 +128,14 @@ def stateWhileName(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace1 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = ConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace2 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = ConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace2 @@ -153,9 +153,9 @@ def stateWhitespace2(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected keyword IS after while name." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = ConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -163,24 +163,24 @@ def stateWhitespace2(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = ConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = ConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (isinstance(token, WordToken) and (token <= "is")): + elif isinstance(token, WordToken) and (token <= "is"): parserState.NewToken = IsKeyword(fromExistingToken=token) parserState.NewBlock = ConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.NextState = cls.stateDeclarativeRegion return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -193,16 +193,16 @@ def stateDeclarativeRegion(cls, parserState: ParserState): errorMessage = "Expected one of these keywords: generic, port, begin, end." token = parserState.Token if isinstance(parserState.Token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) parserState.NewBlock = LinebreakBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = parserState.NewToken return - elif (token == "-"): + elif token == "-": parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return @@ -212,13 +212,13 @@ def stateDeclarativeRegion(cls, parserState: ParserState): return elif isinstance(token, WordToken): keyword = token.Value.lower() - if (keyword == "generic"): + if keyword == "generic": newToken = GenericKeyword(fromExistingToken=token) parserState.PushState = GenericList.OpenBlock.stateGenericKeyword - elif (keyword == "port"): + elif keyword == "port": newToken = PortKeyword(fromExistingToken=token) parserState.PushState = PortList.OpenBlock.statePortKeyword - elif (keyword == "end"): + elif keyword == "end": newToken = EndKeyword(fromExistingToken=token) parserState.NextState = EndBlock.stateEndKeyword else: diff --git a/pyVHDLParser/Blocks/Expression.py b/pyVHDLParser/Blocks/Expression.py index 73eff56e0..85b0ce7ae 100644 --- a/pyVHDLParser/Blocks/Expression.py +++ b/pyVHDLParser/Blocks/Expression.py @@ -96,7 +96,7 @@ class ExpressionBlockEndedByCharORClosingRoundBracket(ExpressionBlock): def stateBeforeExpression(cls, parserState: ParserState): token = parserState.Token if isinstance(token, CharacterToken): - if (token == "("): + if token == "(": parserState.NewToken = OpeningRoundBracketToken(fromExistingToken=token) parserState.Counter += 1 parserState.NextState = cls.stateExpression @@ -123,7 +123,7 @@ def stateBeforeExpression(cls, parserState: ParserState): parserState.NewBlock = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return elif isinstance(token, SpaceToken): parserState.NextState = cls.stateWhitespace1 @@ -139,8 +139,8 @@ def stateExpression(cls, parserState: ParserState): parserState.NewToken = cls.FUSED_CHARACTER_TRANSLATION[token.Value](fromExistingToken=token) return except KeyError: - if (token == cls.EXIT_CHAR): - if (parserState.Counter == 0): + if token == cls.EXIT_CHAR: + if parserState.Counter == 0: parserState.NewToken = cls.EXIT_TOKEN(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) _ = cls.EXIT_BLOCK(parserState.NewBlock, parserState.NewToken, endToken=parserState.NewToken) @@ -149,8 +149,8 @@ def stateExpression(cls, parserState: ParserState): else: raise BlockParserException("Mismatch in opening and closing parenthesis. Counter={0}".format(parserState.Counter), token) elif isinstance(token, CharacterToken): - if (token == cls.EXIT_CHAR): - if (parserState.Counter == 0): + if token == cls.EXIT_CHAR: + if parserState.Counter == 0: parserState.NewToken = cls.EXIT_TOKEN(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) _ = cls.EXIT_BLOCK(parserState.NewBlock, parserState.NewToken, endToken=parserState.NewToken) @@ -158,12 +158,12 @@ def stateExpression(cls, parserState: ParserState): return else: raise BlockParserException("Mismatch in opening and closing parenthesis. Counter={0}".format(parserState.Counter), token) - elif (token == "("): + elif token == "(": parserState.NewToken = OpeningRoundBracketToken(fromExistingToken=token) parserState.Counter += 1 return - elif (token == ")"): - if (parserState.Counter == 0): + elif token == ")": + if parserState.Counter == 0: parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) parserState.Pop(3, parserState.NewToken) @@ -205,8 +205,8 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NextState = cls.stateExpression return except KeyError: - if (token == cls.EXIT_CHAR): - if (parserState.Counter == 0): + if token == cls.EXIT_CHAR: + if parserState.Counter == 0: parserState.NewToken = cls.EXIT_TOKEN(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) _ = cls.EXIT_BLOCK(parserState.NewBlock, parserState.NewToken, endToken=parserState.NewToken) @@ -215,8 +215,8 @@ def stateWhitespace1(cls, parserState: ParserState): else: raise BlockParserException("Mismatch in opening and closing parenthesis. Counter={0}".format(parserState.Counter), token) elif isinstance(token, CharacterToken): - if (token == cls.EXIT_CHAR): - if (parserState.Counter == 0): + if token == cls.EXIT_CHAR: + if parserState.Counter == 0: parserState.NewToken = cls.EXIT_TOKEN(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) _ = cls.EXIT_BLOCK(parserState.NewBlock, parserState.NewToken, endToken=parserState.NewToken) @@ -224,13 +224,13 @@ def stateWhitespace1(cls, parserState: ParserState): return else: raise BlockParserException("Mismatch in opening and closing parenthesis. Counter={0}".format(parserState.Counter), token) - elif (token == "("): + elif token == "(": parserState.NewToken = OpeningRoundBracketToken(fromExistingToken=token) parserState.Counter += 1 parserState.NextState = cls.stateExpression return - elif (token == ")"): - if (parserState.Counter == 0): + elif token == ")": + if parserState.Counter == 0: parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) @@ -256,7 +256,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NextState = cls.stateExpression return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -264,16 +264,16 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.TokenMarker = None return elif isinstance(token, CommentToken): - if (not isinstance(parserState.LastBlock, LinebreakBlock)): + if not isinstance(parserState.LastBlock, LinebreakBlock): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = CommentBlock(parserState.NewBlock, token) else: parserState.NewBlock = CommentBlock(parserState.LastBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -294,11 +294,11 @@ def stateExpression(cls, parserState: ParserState): parserState.NewToken = cls.FUSED_CHARACTER_TRANSLATION[token.Value](fromExistingToken=token) return elif isinstance(token, CharacterToken): - if (token == "("): + if token == "(": parserState.NewToken = OpeningRoundBracketToken(fromExistingToken=token) parserState.Counter += 1 return - elif (token == ")"): + elif token == ")": parserState.NewToken = ClosingRoundBracketToken(fromExistingToken=token) parserState.Counter -= 1 return @@ -306,7 +306,7 @@ def stateExpression(cls, parserState: ParserState): parserState.NewToken = cls.CHARACTER_TRANSLATION[token.Value](fromExistingToken=token) return elif isinstance(token, WordToken): - if (token <= cls.EXIT_KEYWORD.__KEYWORD__): + if token <= cls.EXIT_KEYWORD.__KEYWORD__: parserState.NewToken = cls.EXIT_KEYWORD(token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) _ = cls.EXIT_BLOCK(parserState.NewBlock, parserState.NewToken) @@ -341,12 +341,12 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NextState = cls.stateExpression return elif isinstance(token, CharacterToken): - if (token == "("): + if token == "(": parserState.NewToken = OpeningRoundBracketToken(fromExistingToken=token) parserState.Counter += 1 parserState.NextState = cls.stateExpression return - elif (token == ")"): + elif token == ")": parserState.NewToken = ClosingRoundBracketToken(fromExistingToken=token) parserState.Counter -= 1 parserState.NextState = cls.stateExpression @@ -356,7 +356,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NextState = cls.stateExpression return elif isinstance(token, WordToken): - if (token <= cls.EXIT_KEYWORD.__KEYWORD__): + if token <= cls.EXIT_KEYWORD.__KEYWORD__: parserState.NewToken = cls.EXIT_KEYWORD(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) _ = cls.EXIT_BLOCK(parserState.NewBlock, parserState.NewToken) @@ -373,7 +373,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NextState = cls.stateExpression return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -381,7 +381,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.TokenMarker = None return elif isinstance(token, CommentToken): - if (not isinstance(parserState.LastBlock, LinebreakBlock)): + if not isinstance(parserState.LastBlock, LinebreakBlock): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = CommentBlock(parserState.NewBlock, token) else: @@ -390,7 +390,7 @@ def stateWhitespace1(cls, parserState: ParserState): return elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -411,11 +411,11 @@ def stateExpression(cls, parserState: ParserState): parserState.NewToken = cls.FUSED_CHARACTER_TRANSLATION[token.Value](fromExistingToken=token) return elif isinstance(token, CharacterToken): - if (token == "("): + if token == "(": parserState.NewToken = OpeningRoundBracketToken(fromExistingToken=token) parserState.Counter += 1 return - elif (token == ")"): + elif token == ")": parserState.NewToken = ClosingRoundBracketToken(fromExistingToken=token) parserState.Counter -= 1 return @@ -424,13 +424,13 @@ def stateExpression(cls, parserState: ParserState): return elif isinstance(token, WordToken): tokenValue = token.Value.lower() - if (tokenValue == cls.EXIT_KEYWORD.__KEYWORD__): + if tokenValue == cls.EXIT_KEYWORD.__KEYWORD__: parserState.NewToken = LoopKeyword(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) _ = cls.EXIT_BLOCK(parserState.NewBlock, parserState.NewToken) parserState.Pop(2, parserState.NewToken) return - elif (tokenValue == "to"): + elif tokenValue == "to": from pyVHDLParser.Blocks.ControlStructure.ForLoop import LoopIterationDirectionBlock parserState.NewToken = ToKeyword(fromExistingToken=token) @@ -438,7 +438,7 @@ def stateExpression(cls, parserState: ParserState): _ = LoopIterationDirectionBlock(parserState.NewBlock, parserState.NewToken) parserState.Pop(1, parserState.NewToken) return - elif (tokenValue == "downto"): + elif tokenValue == "downto": from pyVHDLParser.Blocks.ControlStructure.ForLoop import LoopIterationDirectionBlock parserState.NewToken = DowntoKeyword(fromExistingToken=token) @@ -475,12 +475,12 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NextState = cls.stateExpression return elif isinstance(token, CharacterToken): - if (token == "("): + if token == "(": parserState.NewToken = OpeningRoundBracketToken(fromExistingToken=token) parserState.Counter += 1 parserState.NextState = cls.stateExpression return - elif (token == ")"): + elif token == ")": parserState.NewToken = ClosingRoundBracketToken(fromExistingToken=token) parserState.Counter -= 1 parserState.NextState = cls.stateExpression @@ -491,13 +491,13 @@ def stateWhitespace1(cls, parserState: ParserState): return elif isinstance(token, WordToken): tokenValue = token.Value.lower() - if (tokenValue == cls.EXIT_KEYWORD.__KEYWORD__): + if tokenValue == cls.EXIT_KEYWORD.__KEYWORD__: parserState.NewToken = LoopKeyword(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) _ = cls.EXIT_BLOCK(parserState.NewBlock, parserState.NewToken) parserState.Pop(1, parserState.NewToken) return - elif (tokenValue == "to"): + elif tokenValue == "to": from pyVHDLParser.Blocks.ControlStructure.ForLoop import LoopIterationDirectionBlock parserState.NewToken = ToKeyword(fromExistingToken=token) @@ -505,7 +505,7 @@ def stateWhitespace1(cls, parserState: ParserState): _ = LoopIterationDirectionBlock(parserState.NewBlock, parserState.NewToken) parserState.Pop() return - elif (tokenValue == "downto"): + elif tokenValue == "downto": from pyVHDLParser.Blocks.ControlStructure.ForLoop import LoopIterationDirectionBlock parserState.NewToken = DowntoKeyword(fromExistingToken=token) @@ -524,7 +524,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NextState = cls.stateExpression return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -532,16 +532,16 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.TokenMarker = None return elif isinstance(token, CommentToken): - if (not isinstance(parserState.LastBlock, LinebreakBlock)): + if not isinstance(parserState.LastBlock, LinebreakBlock): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = CommentBlock(parserState.NewBlock, token) else: parserState.NewBlock = CommentBlock(parserState.LastBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -561,8 +561,8 @@ def stateExpression(cls, parserState: ParserState): parserState.NewToken = cls.FUSED_CHARACTER_TRANSLATION[token.Value](fromExistingToken=token) return elif isinstance(token, CharacterToken): - if (token == ";"): - if (parserState.Counter == 0): + if token == ";": + if parserState.Counter == 0: parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) _ = cls.END_BLOCK(parserState.NewBlock, parserState.NewToken, endToken=parserState.NewToken) @@ -570,12 +570,12 @@ def stateExpression(cls, parserState: ParserState): return else: raise BlockParserException("Mismatch in opening and closing parenthesis. Counter={0}".format(parserState.Counter), token) - elif (token == "("): + elif token == "(": parserState.NewToken = OpeningRoundBracketToken(fromExistingToken=token) parserState.Counter += 1 return - elif (token == ")"): - if (parserState.Counter == -1): + elif token == ")": + if parserState.Counter == -1: raise BlockParserException("Mismatch in opening and closing parenthesis. Counter={0}".format(parserState.Counter), token) else: parserState.NewToken = ClosingRoundBracketToken(fromExistingToken=token) @@ -613,8 +613,8 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NextState = cls.stateExpression return elif isinstance(token, CharacterToken): - if (token == ";"): - if (parserState.Counter == 0): + if token == ";": + if parserState.Counter == 0: parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) _ = cls.END_BLOCK(parserState.NewBlock, parserState.NewToken, endToken=parserState.NewToken) @@ -622,13 +622,13 @@ def stateWhitespace1(cls, parserState: ParserState): return else: raise BlockParserException("Mismatch in opening and closing parenthesis. Counter={0}".format(parserState.Counter), token) - elif (token == "("): + elif token == "(": parserState.NewToken = OpeningRoundBracketToken(fromExistingToken=token) parserState.Counter += 1 parserState.NextState = cls.stateExpression return - elif (token == ")"): - if (parserState.Counter == -1): + elif token == ")": + if parserState.Counter == -1: raise BlockParserException("Mismatch in opening and closing parenthesis. Counter={0}".format(parserState.Counter), token) else: parserState.NewToken = ClosingRoundBracketToken(fromExistingToken=token) @@ -650,7 +650,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NextState = cls.stateExpression return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -658,16 +658,16 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.TokenMarker = None return elif isinstance(token, CommentToken): - if (not isinstance(parserState.LastBlock, LinebreakBlock)): + if not isinstance(parserState.LastBlock, LinebreakBlock): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = CommentBlock(parserState.NewBlock, token) else: parserState.NewBlock = CommentBlock(parserState.LastBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None diff --git a/pyVHDLParser/Blocks/Generate/CaseGenerate.py b/pyVHDLParser/Blocks/Generate/CaseGenerate.py index 1b151d1cb..c4a9aa992 100644 --- a/pyVHDLParser/Blocks/Generate/CaseGenerate.py +++ b/pyVHDLParser/Blocks/Generate/CaseGenerate.py @@ -46,7 +46,7 @@ def stateGenerateKeyword(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected whitespace after keyword GENERATE." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewBlock = CaseBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -54,14 +54,14 @@ def stateGenerateKeyword(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace1 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = CaseBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = CaseBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 @@ -80,9 +80,9 @@ def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected generate name (identifier)." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = CaseBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -90,13 +90,13 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = CaseBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = CaseBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart @@ -106,7 +106,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NewToken = IdentifierToken(fromExistingToken=token) parserState.NextState = cls.stateGenerateName return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -119,7 +119,7 @@ def stateGenerateName(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected whitespace after keyword GENERATE." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewBlock = CaseBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -127,14 +127,14 @@ def stateGenerateName(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace2 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = CaseBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace2 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = CaseBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace2 @@ -152,9 +152,9 @@ def stateWhitespace2(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected keyword IS after generate name." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = CaseBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -162,24 +162,24 @@ def stateWhitespace2(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = CaseBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = CaseBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (isinstance(token, WordToken) and (token <= "is")): + elif isinstance(token, WordToken) and (token <= "is"): parserState.NewToken = IsKeyword(fromExistingToken=token) parserState.NewBlock = CaseBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.NextState = cls.stateDeclarativeRegion return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -192,16 +192,16 @@ def stateDeclarativeRegion(cls, parserState: ParserState): errorMessage = "Expected one of these keywords: generic, port, begin, end." token = parserState.Token if isinstance(parserState.Token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) parserState.NewBlock = LinebreakBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = parserState.NewToken return - elif (token == "-"): + elif token == "-": parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return @@ -211,16 +211,16 @@ def stateDeclarativeRegion(cls, parserState: ParserState): return elif isinstance(token, WordToken): keyword = token.Value.lower() - if (keyword == "generic"): + if keyword == "generic": newToken = GenericKeyword(fromExistingToken=token) parserState.PushState = GenericList.OpenBlock.stateGenericKeyword - elif (keyword == "port"): + elif keyword == "port": newToken = PortKeyword(fromExistingToken=token) parserState.PushState = PortList.OpenBlock.statePortKeyword - elif (keyword == "end"): + elif keyword == "end": newToken = EndKeyword(fromExistingToken=token) parserState.NextState = EndGenerateBlock.stateEndKeyword - elif (keyword == "begin"): + elif keyword == "begin": parserState.NewToken = BeginKeyword(fromExistingToken=token) parserState.NewBlock = BeginBlock(parserState.LastBlock, parserState.NewToken) parserState.NextState = BeginBlock.stateBeginKeyword diff --git a/pyVHDLParser/Blocks/Generate/ForGenerate.py b/pyVHDLParser/Blocks/Generate/ForGenerate.py index 3e5d3b06f..2dba8e8b3 100644 --- a/pyVHDLParser/Blocks/Generate/ForGenerate.py +++ b/pyVHDLParser/Blocks/Generate/ForGenerate.py @@ -48,7 +48,7 @@ def stateGenerateKeyword(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected whitespace after keyword GENERATE." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewBlock = RangeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -56,14 +56,14 @@ def stateGenerateKeyword(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace1 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = RangeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = RangeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 @@ -82,9 +82,9 @@ def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected generate name (identifier)." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = RangeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -92,13 +92,13 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = RangeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = RangeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart @@ -108,7 +108,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NewToken = IdentifierToken(fromExistingToken=token) parserState.NextState = cls.stateGenerateName return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -121,7 +121,7 @@ def stateGenerateName(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected whitespace after keyword GENERATE." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewBlock = RangeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -129,14 +129,14 @@ def stateGenerateName(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace2 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = RangeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace2 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = RangeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace2 @@ -154,9 +154,9 @@ def stateWhitespace2(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected keyword IS after generate name." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = RangeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -164,24 +164,24 @@ def stateWhitespace2(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = RangeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = RangeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (isinstance(token, WordToken) and (token <= "is")): + elif isinstance(token, WordToken) and (token <= "is"): parserState.NewToken = IsKeyword(fromExistingToken=token) parserState.NewBlock = RangeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.NextState = cls.stateDeclarativeRegion return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -194,16 +194,16 @@ def stateDeclarativeRegion(cls, parserState: ParserState): errorMessage = "Expected one of these keywords: generic, port, begin, end." token = parserState.Token if isinstance(parserState.Token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) parserState.NewBlock = LinebreakBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = parserState.NewToken return - elif (token == "-"): + elif token == "-": parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return @@ -213,16 +213,16 @@ def stateDeclarativeRegion(cls, parserState: ParserState): return elif isinstance(token, WordToken): keyword = token.Value.lower() - if (keyword == "generic"): + if keyword == "generic": newToken = GenericKeyword(fromExistingToken=token) parserState.PushState = GenericList.OpenBlock.stateGenericKeyword - elif (keyword == "port"): + elif keyword == "port": newToken = PortKeyword(fromExistingToken=token) parserState.PushState = PortList.OpenBlock.statePortKeyword - elif (keyword == "end"): + elif keyword == "end": newToken = EndKeyword(fromExistingToken=token) parserState.NextState = EndGenerateBlock.stateEndKeyword - elif (keyword == "begin"): + elif keyword == "begin": parserState.NewToken = BeginKeyword(fromExistingToken=token) parserState.NewBlock = BeginBlock(parserState.LastBlock, parserState.NewToken) parserState.NextState = BeginBlock.stateBeginKeyword @@ -244,16 +244,16 @@ def stateBeginKeyword(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected label or one of these keywords: assert, process." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) parserState.NewBlock = LinebreakBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = parserState.NewToken return - elif (token == "-"): + elif token == "-": parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return @@ -264,13 +264,13 @@ def stateBeginKeyword(cls, parserState: ParserState): # return elif isinstance(token, WordToken): keyword = token.Value.lower() - if (keyword == "process"): + if keyword == "process": newToken = ProcessKeyword(fromExistingToken=token) parserState.PushState = Process.OpenBlock.stateProcessKeyword - elif (keyword == "assert"): + elif keyword == "assert": newToken = AssertKeyword(fromExistingToken=token) parserState.PushState = AssertBlock.stateAssertKeyword - elif (keyword == "end"): + elif keyword == "end": newToken = EndKeyword(fromExistingToken=token) parserState.NextState = EndGenerateBlock.stateEndKeyword else: diff --git a/pyVHDLParser/Blocks/Generate/IfGenerate.py b/pyVHDLParser/Blocks/Generate/IfGenerate.py index 7ab461d35..c150b7fad 100644 --- a/pyVHDLParser/Blocks/Generate/IfGenerate.py +++ b/pyVHDLParser/Blocks/Generate/IfGenerate.py @@ -49,7 +49,7 @@ def stateGenerateKeyword(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected whitespace after keyword GENERATE." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewBlock = IfConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -57,14 +57,14 @@ def stateGenerateKeyword(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace1 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = IfConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = IfConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 @@ -83,9 +83,9 @@ def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected generate name (identifier)." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = IfConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -93,13 +93,13 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = IfConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = IfConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart @@ -109,7 +109,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NewToken = IdentifierToken(fromExistingToken=token) parserState.NextState = cls.stateGenerateName return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -122,7 +122,7 @@ def stateGenerateName(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected whitespace after keyword GENERATE." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewBlock = IfConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -130,14 +130,14 @@ def stateGenerateName(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace2 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = IfConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace2 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = IfConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace2 @@ -155,9 +155,9 @@ def stateWhitespace2(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected keyword IS after generate name." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = IfConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -165,24 +165,24 @@ def stateWhitespace2(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = IfConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = IfConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (isinstance(token, WordToken) and (token <= "is")): + elif isinstance(token, WordToken) and (token <= "is"): parserState.NewToken = IsKeyword(fromExistingToken=token) parserState.NewBlock = IfConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.NextState = cls.stateDeclarativeRegion return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -195,16 +195,16 @@ def stateDeclarativeRegion(cls, parserState: ParserState): errorMessage = "Expected one of these keywords: generic, port, begin, end." token = parserState.Token if isinstance(parserState.Token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) parserState.NewBlock = LinebreakBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = parserState.NewToken return - elif (token == "-"): + elif token == "-": parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return @@ -214,16 +214,16 @@ def stateDeclarativeRegion(cls, parserState: ParserState): return elif isinstance(token, WordToken): keyword = token.Value.lower() - if (keyword == "generic"): + if keyword == "generic": newToken = GenericKeyword(fromExistingToken=token) parserState.PushState = GenericList.OpenBlock.stateGenericKeyword - elif (keyword == "port"): + elif keyword == "port": newToken = PortKeyword(fromExistingToken=token) parserState.PushState = PortList.OpenBlock.statePortKeyword - elif (keyword == "end"): + elif keyword == "end": newToken = EndKeyword(fromExistingToken=token) parserState.NextState = EndGenerateBlock.stateEndKeyword - elif (keyword == "begin"): + elif keyword == "begin": parserState.NewToken = BeginKeyword(fromExistingToken=token) parserState.NewBlock = BeginBlock(parserState.LastBlock, parserState.NewToken) parserState.NextState = BeginBlock.stateBeginKeyword @@ -245,16 +245,16 @@ def stateBeginKeyword(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected label or one of these keywords: assert, process." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) parserState.NewBlock = LinebreakBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = parserState.NewToken return - elif (token == "-"): + elif token == "-": parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return @@ -265,13 +265,13 @@ def stateBeginKeyword(cls, parserState: ParserState): # return elif isinstance(token, WordToken): keyword = token.Value.lower() - if (keyword == "process"): + if keyword == "process": newToken = ProcessKeyword(fromExistingToken=token) parserState.PushState = Process.OpenBlock.stateProcessKeyword - elif (keyword == "assert"): + elif keyword == "assert": newToken = AssertKeyword(fromExistingToken=token) parserState.PushState = AssertBlock.stateAssertKeyword - elif (keyword == "end"): + elif keyword == "end": newToken = EndKeyword(fromExistingToken=token) parserState.NextState = EndGenerateBlock.stateEndKeyword else: @@ -291,7 +291,7 @@ def stateGenerateKeyword(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected whitespace after keyword GENERATE." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewBlock = ElsIfConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -299,14 +299,14 @@ def stateGenerateKeyword(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace1 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = ElsIfConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = ElsIfConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 @@ -325,9 +325,9 @@ def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected generate name (identifier)." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = ElsIfConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -335,13 +335,13 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = ElsIfConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = ElsIfConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart @@ -351,7 +351,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NewToken = IdentifierToken(fromExistingToken=token) parserState.NextState = cls.stateGenerateName return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -364,7 +364,7 @@ def stateGenerateName(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected whitespace after keyword GENERATE." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewBlock = ElsIfConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -372,14 +372,14 @@ def stateGenerateName(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace2 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = ElsIfConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace2 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = ElsIfConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace2 @@ -397,9 +397,9 @@ def stateWhitespace2(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected keyword IS after generate name." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = ElsIfConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -407,24 +407,24 @@ def stateWhitespace2(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = ElsIfConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = ElsIfConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (isinstance(token, WordToken) and (token <= "is")): + elif isinstance(token, WordToken) and (token <= "is"): parserState.NewToken = IsKeyword(fromExistingToken=token) parserState.NewBlock = ElsIfConditionBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.NextState = cls.stateDeclarativeRegion return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -437,16 +437,16 @@ def stateDeclarativeRegion(cls, parserState: ParserState): errorMessage = "Expected one of these keywords: generic, port, begin, end." token = parserState.Token if isinstance(parserState.Token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) parserState.NewBlock = LinebreakBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = parserState.NewToken return - elif (token == "-"): + elif token == "-": parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return @@ -456,16 +456,16 @@ def stateDeclarativeRegion(cls, parserState: ParserState): return elif isinstance(token, WordToken): keyword = token.Value.lower() - if (keyword == "generic"): + if keyword == "generic": newToken = GenericKeyword(fromExistingToken=token) parserState.PushState = GenericList.OpenBlock.stateGenericKeyword - elif (keyword == "port"): + elif keyword == "port": newToken = PortKeyword(fromExistingToken=token) parserState.PushState = PortList.OpenBlock.statePortKeyword - elif (keyword == "end"): + elif keyword == "end": newToken = EndKeyword(fromExistingToken=token) parserState.NextState = EndGenerateBlock.stateEndKeyword - elif (keyword == "begin"): + elif keyword == "begin": parserState.NewToken = BeginKeyword(fromExistingToken=token) parserState.NewBlock = ElsIfBeginBlock(parserState.LastBlock, parserState.NewToken) parserState.NextState = ElsIfBeginBlock.stateBeginKeyword @@ -487,16 +487,16 @@ def stateBeginKeyword(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected label or one of these keywords: assert, process." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) parserState.NewBlock = LinebreakBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = parserState.NewToken return - elif (token == "-"): + elif token == "-": parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return @@ -507,13 +507,13 @@ def stateBeginKeyword(cls, parserState: ParserState): # return elif isinstance(token, WordToken): keyword = token.Value.lower() - if (keyword == "process"): + if keyword == "process": newToken = ProcessKeyword(fromExistingToken=token) parserState.PushState = Process.OpenBlock.stateProcessKeyword - elif (keyword == "assert"): + elif keyword == "assert": newToken = AssertKeyword(fromExistingToken=token) parserState.PushState = AssertBlock.stateAssertKeyword - elif (keyword == "end"): + elif keyword == "end": newToken = EndKeyword(fromExistingToken=token) parserState.NextState = EndGenerateBlock.stateEndKeyword else: @@ -533,7 +533,7 @@ def stateGenerateKeyword(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected whitespace after keyword GENERATE." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewBlock = ElseGenerateBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -541,14 +541,14 @@ def stateGenerateKeyword(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace1 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = ElseGenerateBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = ElseGenerateBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 @@ -567,9 +567,9 @@ def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected generate name (identifier)." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = ElseGenerateBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -577,13 +577,13 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = ElseGenerateBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = ElseGenerateBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart @@ -593,7 +593,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NewToken = IdentifierToken(fromExistingToken=token) parserState.NextState = cls.stateGenerateName return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -606,7 +606,7 @@ def stateGenerateName(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected whitespace after keyword GENERATE." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewBlock = ElseGenerateBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -614,14 +614,14 @@ def stateGenerateName(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace2 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = ElseGenerateBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace2 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = ElseGenerateBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace2 @@ -639,9 +639,9 @@ def stateWhitespace2(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected keyword IS after generate name." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = ElseGenerateBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -649,24 +649,24 @@ def stateWhitespace2(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = ElseGenerateBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = ElseGenerateBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (isinstance(token, WordToken) and (token <= "is")): + elif isinstance(token, WordToken) and (token <= "is"): parserState.NewToken = IsKeyword(fromExistingToken=token) parserState.NewBlock = ElseGenerateBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.NextState = cls.stateDeclarativeRegion return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -679,16 +679,16 @@ def stateDeclarativeRegion(cls, parserState: ParserState): errorMessage = "Expected one of these keywords: generic, port, begin, end." token = parserState.Token if isinstance(parserState.Token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) parserState.NewBlock = LinebreakBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = parserState.NewToken return - elif (token == "-"): + elif token == "-": parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return @@ -698,16 +698,16 @@ def stateDeclarativeRegion(cls, parserState: ParserState): return elif isinstance(token, WordToken): keyword = token.Value.lower() - if (keyword == "generic"): + if keyword == "generic": newToken = GenericKeyword(fromExistingToken=token) parserState.PushState = GenericList.OpenBlock.stateGenericKeyword - elif (keyword == "port"): + elif keyword == "port": newToken = PortKeyword(fromExistingToken=token) parserState.PushState = PortList.OpenBlock.statePortKeyword - elif (keyword == "end"): + elif keyword == "end": newToken = EndKeyword(fromExistingToken=token) parserState.NextState = EndGenerateBlock.stateEndKeyword - elif (keyword == "begin"): + elif keyword == "begin": parserState.NewToken = BeginKeyword(fromExistingToken=token) parserState.NewBlock = ElseGenerateBeginBlock(parserState.LastBlock, parserState.NewToken) parserState.NextState = ElseGenerateBeginBlock.stateBeginKeyword @@ -729,16 +729,16 @@ def stateBeginKeyword(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected label or one of these keywords: assert, process." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) parserState.NewBlock = LinebreakBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = parserState.NewToken return - elif (token == "-"): + elif token == "-": parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return @@ -749,13 +749,13 @@ def stateBeginKeyword(cls, parserState: ParserState): # return elif isinstance(token, WordToken): keyword = token.Value.lower() - if (keyword == "process"): + if keyword == "process": newToken = ProcessKeyword(fromExistingToken=token) parserState.PushState = Process.OpenBlock.stateProcessKeyword - elif (keyword == "assert"): + elif keyword == "assert": newToken = AssertKeyword(fromExistingToken=token) parserState.PushState = AssertBlock.stateAssertKeyword - elif (keyword == "end"): + elif keyword == "end": newToken = EndKeyword(fromExistingToken=token) parserState.NextState = EndGenerateBlock.stateEndKeyword else: diff --git a/pyVHDLParser/Blocks/Generic.py b/pyVHDLParser/Blocks/Generic.py index 81e2640d8..a37d4e888 100644 --- a/pyVHDLParser/Blocks/Generic.py +++ b/pyVHDLParser/Blocks/Generic.py @@ -86,19 +86,19 @@ def stateDeclarativeRegion(cls, parserState: ParserState): tokenValue = token.Value.lower() for keyword in cls.KEYWORDS: - if (tokenValue == keyword.__KEYWORD__): + if tokenValue == keyword.__KEYWORD__: newToken = keyword(fromExistingToken=token) parserState.PushState = cls.KEYWORDS[keyword] parserState.NewToken = newToken parserState.TokenMarker = newToken return - if (tokenValue == "begin"): + if tokenValue == "begin": parserState.NewToken = BeginKeyword(fromExistingToken=token) parserState.NewBlock = cls.BEGIN_BLOCK(parserState.LastBlock, parserState.NewToken) parserState.NextState = cls.BEGIN_BLOCK.stateStatementRegion return - elif (tokenValue == "end"): + elif tokenValue == "end": parserState.NewToken = EndKeyword(fromExistingToken=token) parserState.NextState = cls.END_BLOCK.stateEndKeyword return @@ -180,14 +180,14 @@ def stateConcurrentRegion(cls, parserState: ParserState): tokenValue = token.Value.lower() for keyword in cls.KEYWORDS: - if (tokenValue == keyword.__KEYWORD__): + if tokenValue == keyword.__KEYWORD__: newToken = keyword(fromExistingToken=token) parserState.PushState = cls.KEYWORDS[keyword] parserState.NewToken = newToken parserState.TokenMarker = newToken return - if (tokenValue == "end"): + if tokenValue == "end": parserState.NewToken = EndKeyword(fromExistingToken=token) parserState.NextState = cls.END_BLOCK.stateEndKeyword return @@ -253,14 +253,14 @@ def stateAnyRegion(cls, parserState: ParserState): tokenValue = token.Value.lower() for keyword in cls.KEYWORDS: - if (tokenValue == keyword.__KEYWORD__): + if tokenValue == keyword.__KEYWORD__: newToken = keyword(fromExistingToken=token) parserState.PushState = cls.KEYWORDS[keyword] parserState.NewToken = newToken parserState.TokenMarker = newToken return - if (tokenValue == "end"): + if tokenValue == "end": parserState.NewToken = EndKeyword(fromExistingToken=token) parserState.NextState = cls.END_BLOCK.stateEndKeyword return diff --git a/pyVHDLParser/Blocks/Generic1.py b/pyVHDLParser/Blocks/Generic1.py index 2a03a7ae0..07fe8a02c 100644 --- a/pyVHDLParser/Blocks/Generic1.py +++ b/pyVHDLParser/Blocks/Generic1.py @@ -47,7 +47,7 @@ class EndBlock(FinalBlock): def stateEndKeyword(cls, parserState: ParserState): token = parserState.Token if isinstance(token, CharacterToken): - if ((cls.KEYWORD_IS_OPTIONAL is True) and (token == ";")): + if (cls.KEYWORD_IS_OPTIONAL is True) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() @@ -74,7 +74,7 @@ def stateEndKeyword(cls, parserState: ParserState): def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token if isinstance(token, CharacterToken): - if ((cls.KEYWORD_IS_OPTIONAL is True) and (token == ";")): + if (cls.KEYWORD_IS_OPTIONAL is True) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() @@ -82,10 +82,10 @@ def stateWhitespace1(cls, parserState: ParserState): elif isinstance(token, WordToken): IS_SINGLE_KEYWORD = isinstance(cls.KEYWORD, tuple) KW = cls.KEYWORD[0] if IS_SINGLE_KEYWORD else cls.KEYWORD - if (token <= KW.__KEYWORD__): + if token <= KW.__KEYWORD__: parserState.NewToken = KW(fromExistingToken=token) parserState.NextState = cls.stateKeyword1 - elif (cls.EXPECTED_NAME_KIND == "label"): + elif cls.EXPECTED_NAME_KIND == "label": parserState.NewToken = LabelToken(fromExistingToken=token) parserState.NextState = cls.stateSimpleName else: @@ -93,7 +93,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NextState = cls.stateSimpleName return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -105,21 +105,21 @@ def stateWhitespace1(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None return - if (cls.KEYWORD_IS_OPTIONAL is True): - if (cls.EXPECTED_NAME_KIND == "label"): + if cls.KEYWORD_IS_OPTIONAL is True: + if cls.EXPECTED_NAME_KIND == "label": errorMessage = "Expected ';', {0} keyword or {1} label.".format(cls.EXPECTED_NAME.upper(), cls.EXPECTED_NAME) else: errorMessage = "Expected ';', {0} keyword or {1} name.".format(cls.EXPECTED_NAME.upper(), cls.EXPECTED_NAME) else: - if (cls.EXPECTED_NAME_KIND == "label"): + if cls.EXPECTED_NAME_KIND == "label": errorMessage = "Expected {0} keyword or {1} label.".format(cls.EXPECTED_NAME.upper(), cls.EXPECTED_NAME) else: errorMessage = "Expected {0} keyword or {1} name.".format(cls.EXPECTED_NAME.upper(), cls.EXPECTED_NAME) @@ -132,7 +132,7 @@ def stateKeyword1(cls, parserState: ParserState): nextState = cls.stateWhitespace2 if IS_DOUBLE_KEYWORD else cls.stateWhitespace3; token = parserState.Token if isinstance(token, CharacterToken): - if (not isinstance(cls.KEYWORD, tuple) and (token == ";")): + if not isinstance(cls.KEYWORD, tuple) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() @@ -159,17 +159,17 @@ def stateKeyword1(cls, parserState: ParserState): def stateWhitespace2(cls, parserState: ParserState): token = parserState.Token if isinstance(token, CharacterToken): - if ((cls.KEYWORD_IS_OPTIONAL is True) and (not isinstance(cls.KEYWORD, tuple)) and (token == ";")): + if (cls.KEYWORD_IS_OPTIONAL is True) and (not isinstance(cls.KEYWORD, tuple)) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() return - elif (isinstance(token, WordToken) and (token <= cls.KEYWORD[1].__KEYWORD__)): + elif isinstance(token, WordToken) and (token <= cls.KEYWORD[1].__KEYWORD__): parserState.NewToken = cls.KEYWORD[1](fromExistingToken=token) parserState.NextState = cls.stateKeyword2 return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -181,21 +181,21 @@ def stateWhitespace2(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None return - if (cls.KEYWORD_IS_OPTIONAL is True): - if (cls.EXPECTED_NAME_KIND == "label"): + if cls.KEYWORD_IS_OPTIONAL is True: + if cls.EXPECTED_NAME_KIND == "label": errorMessage = "Expected ';', {0} keyword or {1} label.".format(cls.EXPECTED_NAME.upper(), cls.EXPECTED_NAME) else: errorMessage = "Expected ';', {0} keyword or {1} name.".format(cls.EXPECTED_NAME.upper(), cls.EXPECTED_NAME) else: - if (cls.EXPECTED_NAME_KIND == "label"): + if cls.EXPECTED_NAME_KIND == "label": errorMessage = "Expected {0} keyword or {1} label.".format(cls.EXPECTED_NAME.upper(), cls.EXPECTED_NAME) else: errorMessage = "Expected {0} keyword or {1} name.".format(cls.EXPECTED_NAME.upper(), cls.EXPECTED_NAME) @@ -205,7 +205,7 @@ def stateWhitespace2(cls, parserState: ParserState): @classmethod def stateKeyword2(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken)and (token == ";")): + if isinstance(token, CharacterToken)and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() @@ -232,7 +232,7 @@ def stateKeyword2(cls, parserState: ParserState): def stateWhitespace3(cls, parserState: ParserState): token = parserState.Token if isinstance(token, CharacterToken): - if (token == ";"): + if token == ";": parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() @@ -245,7 +245,7 @@ def stateWhitespace3(cls, parserState: ParserState): parserState.NextState = cls.stateSimpleName return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -257,9 +257,9 @@ def stateWhitespace3(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -270,7 +270,7 @@ def stateWhitespace3(cls, parserState: ParserState): @classmethod def stateSimpleName(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == ";")): + if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() @@ -297,13 +297,13 @@ def stateSimpleName(cls, parserState: ParserState): def stateWhitespace4(cls, parserState: ParserState): token = parserState.Token if isinstance(token, CharacterToken): - if (token == ";"): + if token == ";": parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -315,9 +315,9 @@ def stateWhitespace4(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -342,7 +342,7 @@ class CloseBlock(Block): @classmethod def stateClosingParenthesis(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == ";")): + if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() @@ -363,7 +363,7 @@ def stateClosingParenthesis(cls, parserState: ParserState): @classmethod def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken)and (token == ";")): + if isinstance(token, CharacterToken)and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() @@ -377,9 +377,9 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NewBlock = CommentBlock(parserState.LastBlock, token) parserState.TokenMarker = token return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None diff --git a/pyVHDLParser/Blocks/Instantiation/EntityInstantiation.py b/pyVHDLParser/Blocks/Instantiation/EntityInstantiation.py index 34df32ca3..6418e2e1a 100644 --- a/pyVHDLParser/Blocks/Instantiation/EntityInstantiation.py +++ b/pyVHDLParser/Blocks/Instantiation/EntityInstantiation.py @@ -43,7 +43,7 @@ def stateEntityInstantiationKeyword(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected whitespace after keyword EntityInstantiation." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -51,14 +51,14 @@ def stateEntityInstantiationKeyword(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace1 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 @@ -77,9 +77,9 @@ def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected entityInstantiation name (identifier)." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -87,13 +87,13 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart @@ -103,7 +103,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NewToken = IdentifierToken(fromExistingToken=token) parserState.NextState = cls.stateEntityInstantiationName return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -116,12 +116,12 @@ def stateEntityInstantiationName(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected ';' after entityInstantiation name." if isinstance(token, CharacterToken): - if (token == ";"): + if token == ";": parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() return - elif (token == "\n"): + elif token == "\n": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -129,14 +129,14 @@ def stateEntityInstantiationName(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace2 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace2 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace2 @@ -154,14 +154,14 @@ def stateWhitespace2(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected ';'." if isinstance(token, CharacterToken): - if (token == ";"): + if token == ";": parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() return - elif (token == "\n"): + elif token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -169,19 +169,19 @@ def stateWhitespace2(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None diff --git a/pyVHDLParser/Blocks/Instantiation/FunctionInstantiation.py b/pyVHDLParser/Blocks/Instantiation/FunctionInstantiation.py index 850cd547e..47afdee9d 100644 --- a/pyVHDLParser/Blocks/Instantiation/FunctionInstantiation.py +++ b/pyVHDLParser/Blocks/Instantiation/FunctionInstantiation.py @@ -43,7 +43,7 @@ def stateEntityInstantiationKeyword(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected whitespace after keyword EntityInstantiation." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -51,14 +51,14 @@ def stateEntityInstantiationKeyword(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace1 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 @@ -77,9 +77,9 @@ def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected entityInstantiation name (identifier)." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -87,13 +87,13 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart @@ -103,7 +103,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NewToken = IdentifierToken(fromExistingToken=token) parserState.NextState = cls.stateEntityInstantiationName return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -116,12 +116,12 @@ def stateEntityInstantiationName(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected ';' after entityInstantiation name." if isinstance(token, CharacterToken): - if (token == ";"): + if token == ";": parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() return - elif (token == "\n"): + elif token == "\n": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -129,14 +129,14 @@ def stateEntityInstantiationName(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace2 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace2 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace2 @@ -154,14 +154,14 @@ def stateWhitespace2(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected ';'." if isinstance(token, CharacterToken): - if (token == ";"): + if token == ";": parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() return - elif (token == "\n"): + elif token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -169,19 +169,19 @@ def stateWhitespace2(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None diff --git a/pyVHDLParser/Blocks/Instantiation/PackageInstantiation.py b/pyVHDLParser/Blocks/Instantiation/PackageInstantiation.py index 850cd547e..47afdee9d 100644 --- a/pyVHDLParser/Blocks/Instantiation/PackageInstantiation.py +++ b/pyVHDLParser/Blocks/Instantiation/PackageInstantiation.py @@ -43,7 +43,7 @@ def stateEntityInstantiationKeyword(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected whitespace after keyword EntityInstantiation." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -51,14 +51,14 @@ def stateEntityInstantiationKeyword(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace1 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 @@ -77,9 +77,9 @@ def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected entityInstantiation name (identifier)." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -87,13 +87,13 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart @@ -103,7 +103,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NewToken = IdentifierToken(fromExistingToken=token) parserState.NextState = cls.stateEntityInstantiationName return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -116,12 +116,12 @@ def stateEntityInstantiationName(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected ';' after entityInstantiation name." if isinstance(token, CharacterToken): - if (token == ";"): + if token == ";": parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() return - elif (token == "\n"): + elif token == "\n": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -129,14 +129,14 @@ def stateEntityInstantiationName(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace2 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace2 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace2 @@ -154,14 +154,14 @@ def stateWhitespace2(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected ';'." if isinstance(token, CharacterToken): - if (token == ";"): + if token == ";": parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() return - elif (token == "\n"): + elif token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -169,19 +169,19 @@ def stateWhitespace2(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None diff --git a/pyVHDLParser/Blocks/Instantiation/ProcedureInstantiation.py b/pyVHDLParser/Blocks/Instantiation/ProcedureInstantiation.py index 850cd547e..47afdee9d 100644 --- a/pyVHDLParser/Blocks/Instantiation/ProcedureInstantiation.py +++ b/pyVHDLParser/Blocks/Instantiation/ProcedureInstantiation.py @@ -43,7 +43,7 @@ def stateEntityInstantiationKeyword(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected whitespace after keyword EntityInstantiation." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -51,14 +51,14 @@ def stateEntityInstantiationKeyword(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace1 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 @@ -77,9 +77,9 @@ def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected entityInstantiation name (identifier)." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -87,13 +87,13 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart @@ -103,7 +103,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NewToken = IdentifierToken(fromExistingToken=token) parserState.NextState = cls.stateEntityInstantiationName return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -116,12 +116,12 @@ def stateEntityInstantiationName(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected ';' after entityInstantiation name." if isinstance(token, CharacterToken): - if (token == ";"): + if token == ";": parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() return - elif (token == "\n"): + elif token == "\n": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -129,14 +129,14 @@ def stateEntityInstantiationName(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace2 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace2 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace2 @@ -154,14 +154,14 @@ def stateWhitespace2(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected ';'." if isinstance(token, CharacterToken): - if (token == ";"): + if token == ";": parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() return - elif (token == "\n"): + elif token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -169,19 +169,19 @@ def stateWhitespace2(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = EntityInstantiationBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None diff --git a/pyVHDLParser/Blocks/InterfaceObject.py b/pyVHDLParser/Blocks/InterfaceObject.py index b6df3804c..ca18f9423 100644 --- a/pyVHDLParser/Blocks/InterfaceObject.py +++ b/pyVHDLParser/Blocks/InterfaceObject.py @@ -56,7 +56,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NextState = cls.stateObjectName return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -67,9 +67,9 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NewBlock = CommentBlock(parserState.LastBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -84,7 +84,7 @@ def stateObjectName(cls, parserState: ParserState): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NextState = cls.stateWhitespace2 return - elif (isinstance(token, CharacterToken) and (token == ":")): + elif isinstance(token, CharacterToken) and (token == ":"): parserState.NewToken = DelimiterToken(fromExistingToken=token) parserState.NextState = cls.stateColon1 return @@ -101,12 +101,12 @@ def stateObjectName(cls, parserState: ParserState): @classmethod def stateWhitespace2(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == ":")): + if isinstance(token, CharacterToken) and (token == ":"): parserState.NewToken = DelimiterToken(fromExistingToken=token) parserState.NextState = cls.stateColon1 return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -117,9 +117,9 @@ def stateWhitespace2(cls, parserState: ParserState): parserState.NewBlock = CommentBlock(parserState.LastBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -170,7 +170,7 @@ def stateWhitespace3(cls, parserState: ParserState): parserState.NextState = cls.stateSubtypeIndication return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -181,9 +181,9 @@ def stateWhitespace3(cls, parserState: ParserState): parserState.NewBlock = CommentBlock(parserState.LastBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -218,7 +218,7 @@ def stateWhitespace4(cls, parserState: ParserState): parserState.NextState = cls.stateSubtypeIndication return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -229,9 +229,9 @@ def stateWhitespace4(cls, parserState: ParserState): parserState.NewBlock = CommentBlock(parserState.LastBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -242,7 +242,7 @@ def stateWhitespace4(cls, parserState: ParserState): @classmethod def stateSubtypeIndication(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, FusedCharacterToken) and (token == ":=")): + if isinstance(token, FusedCharacterToken) and (token == ":="): parserState.NewToken = VariableAssignmentKeyword(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.NextState = cls.DELIMITER_BLOCK.stateItemDelimiter @@ -257,7 +257,7 @@ def stateSubtypeIndication(cls, parserState: ParserState): _ = cls.DELIMITER_BLOCK(parserState.NewBlock, parserState.NewToken) parserState.Pop() return - elif (token == ')'): + elif token == ')': parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) parserState.Pop(2) @@ -280,7 +280,7 @@ def stateSubtypeIndication(cls, parserState: ParserState): @classmethod def stateWhitespace5(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, FusedCharacterToken) and (token == ":=")): + if isinstance(token, FusedCharacterToken) and (token == ":="): parserState.NewToken = VariableAssignmentKeyword(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.NextState = cls.DELIMITER_BLOCK.stateItemDelimiter @@ -288,20 +288,20 @@ def stateWhitespace5(cls, parserState: ParserState): parserState.Counter = 0 return elif isinstance(token, CharacterToken): - if (token == ';'): + if token == ';': parserState.NewToken = DelimiterToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) _ = cls.DELIMITER_BLOCK(parserState.NewBlock, parserState.NewToken) parserState.Pop() return - elif (token == ')'): + elif token == ')': parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) parserState.Pop(2) parserState.TokenMarker = parserState.NewToken return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -313,9 +313,9 @@ def stateWhitespace5(cls, parserState: ParserState): _ = CommentBlock(parserState.LastBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -433,7 +433,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NextState = cls.stateTypeName return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -444,9 +444,9 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NewBlock = CommentBlock(parserState.LastBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -458,13 +458,13 @@ def stateWhitespace1(cls, parserState: ParserState): def stateTypeName(cls, parserState: ParserState): token = parserState.Token if isinstance(token, CharacterToken): - if (token == ';'): + if token == ';': parserState.NewToken = DelimiterToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) _ = cls.DELIMITER_BLOCK(parserState.NewBlock, parserState.NewToken) parserState.Pop() return - elif (token == ')'): + elif token == ')': parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) parserState.Pop(2) @@ -488,20 +488,20 @@ def stateTypeName(cls, parserState: ParserState): def stateWhitespace2(cls, parserState: ParserState): token = parserState.Token if isinstance(token, CharacterToken): - if (token == ';'): + if token == ';': parserState.NewToken = DelimiterToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) _ = cls.DELIMITER_BLOCK(parserState.NewBlock, parserState.NewToken) parserState.Pop() return - elif (token == ')'): + elif token == ')': parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) parserState.Pop(2) parserState.TokenMarker = parserState.NewToken return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -512,9 +512,9 @@ def stateWhitespace2(cls, parserState: ParserState): parserState.NewBlock = CommentBlock(parserState.LastBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None diff --git a/pyVHDLParser/Blocks/List/GenericList.py b/pyVHDLParser/Blocks/List/GenericList.py index 3e3070d27..0b4d2d60e 100644 --- a/pyVHDLParser/Blocks/List/GenericList.py +++ b/pyVHDLParser/Blocks/List/GenericList.py @@ -51,23 +51,23 @@ class DelimiterBlock(SkipableBlock): def stateItemDelimiter(cls, parserState: ParserState): token = parserState.Token if isinstance(token, WordToken): - if (token <= "constant"): + if token <= "constant": parserState.NewToken = ConstantKeyword(fromExistingToken=token) parserState.PushState = GenericListInterfaceConstantBlock.stateConstantKeyword parserState.TokenMarker = parserState.NewToken return - elif (token <= "type"): + elif token <= "type": parserState.NewToken = TypeKeyword(fromExistingToken=token) parserState.PushState = GenericListInterfaceTypeBlock.stateTypeKeyword parserState.TokenMarker = parserState.NewToken return - elif (token <= "procedure"): + elif token <= "procedure": raise NotImplementedError("Generic procedures are not supported.") - elif (token <= "function"): + elif token <= "function": raise NotImplementedError("Generic functions are not supported.") - elif (token <= "impure"): + elif token <= "impure": raise NotImplementedError("Generic impure functions are not supported.") - elif (token <= "pure"): + elif token <= "pure": raise NotImplementedError("Generic pure functions are not supported.") else: parserState.NewToken = IdentifierToken(fromExistingToken=token) @@ -118,7 +118,7 @@ class OpenBlock(Block): @classmethod def stateGenericKeyword(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken)and (token == "(")): + if isinstance(token, CharacterToken)and (token == "("): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.NextState = CloseBlock.stateClosingParenthesis @@ -140,14 +140,14 @@ def stateGenericKeyword(cls, parserState: ParserState): @classmethod def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken)and (token == "(")): + if isinstance(token, CharacterToken)and (token == "("): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.NextState = CloseBlock.stateClosingParenthesis parserState.PushState = cls.stateOpeningParenthesis return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -159,9 +159,9 @@ def stateWhitespace1(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -172,31 +172,31 @@ def stateWhitespace1(cls, parserState: ParserState): @classmethod def stateOpeningParenthesis(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken)and (token == ")")): - # if (parserState.TokenMarker != token): + if isinstance(token, CharacterToken) and (token == ")"): + # if parserState.TokenMarker != token: # parserState.NewBlock = IndentationBlock(parserState.LastBlock, parserState.TokenMarker, token.PreviousToken) parserState.Pop(1, token) return elif isinstance(token, WordToken): - if (token <= "constant"): + if token <= "constant": parserState.NewToken = ConstantKeyword(fromExistingToken=token) parserState.NextState = DelimiterBlock.stateItemDelimiter parserState.PushState = GenericListInterfaceConstantBlock.stateConstantKeyword parserState.TokenMarker = parserState.NewToken return - elif (token <= "type"): + elif token <= "type": parserState.NewToken = TypeKeyword(fromExistingToken=token) parserState.NextState = DelimiterBlock.stateItemDelimiter parserState.PushState = GenericListInterfaceTypeBlock.stateTypeKeyword parserState.TokenMarker = parserState.NewToken return - elif (token <= "procedure"): + elif token <= "procedure": raise NotImplementedError("Generic procedures are not supported.") - elif (token <= "function"): + elif token <= "function": raise NotImplementedError("Generic functions are not supported.") - elif (token <= "impure"): + elif token <= "impure": raise NotImplementedError("Generic impure functions are not supported.") - elif (token <= "pure"): + elif token <= "pure": raise NotImplementedError("Generic pure functions are not supported.") else: parserState.NewToken = IdentifierToken(fromExistingToken=token) diff --git a/pyVHDLParser/Blocks/List/GenericMapList.py b/pyVHDLParser/Blocks/List/GenericMapList.py index 2129f233e..261920fe6 100644 --- a/pyVHDLParser/Blocks/List/GenericMapList.py +++ b/pyVHDLParser/Blocks/List/GenericMapList.py @@ -43,14 +43,14 @@ def stateGenericKeyword(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected whitespace or '(' after keyword GENERIC." if isinstance(token, CharacterToken): - if (token == "("): + if token == "(": parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = OpenBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.NextState = CloseBlock.stateClosingParenthesis parserState.PushState = OpenBlock.stateOpeningParenthesis parserState.Counter = 1 return - elif (token == "\n"): + elif token == "\n": parserState.NewBlock = OpenBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -58,14 +58,14 @@ def stateGenericKeyword(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace1 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = OpenBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = OpenBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 @@ -83,16 +83,16 @@ def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected '(' after keyword GENERIC." if isinstance(token, CharacterToken): - if (token == "("): + if token == "(": parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = OpenBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.NextState = CloseBlock.stateClosingParenthesis parserState.PushState = OpenBlock.stateOpeningParenthesis parserState.Counter = 1 return - elif (token == "\n"): + elif token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = OpenBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -101,21 +101,21 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace1 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = OpenBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = OpenBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -128,24 +128,24 @@ def stateOpeningParenthesis(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected generic name (identifier)." if isinstance(token, CharacterToken): - if (token == ")"): - # if (parserState.TokenMarker != token): + if token == ")": + # if parserState.TokenMarker != token: # parserState.NewBlock = IndentationBlock(parserState.LastBlock, parserState.TokenMarker, token.PreviousToken) parserState.Pop() parserState.TokenMarker = token return - elif (token == "\n"): + elif token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) parserState.NewBlock = LinebreakBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token @@ -159,7 +159,7 @@ def stateOpeningParenthesis(cls, parserState: ParserState): parserState.TokenMarker = parserState.NewToken parserState.NextState = ItemBlock.stateItemRemainder - # if (parserState.TokenMarker != token): + # if parserState.TokenMarker != token: # parserState.NewBlock = IndentationBlock(parserState.LastBlock, parserState.TokenMarker, token) return @@ -172,20 +172,20 @@ class ItemBlock(Block): def stateItemRemainder(cls, parserState: ParserState): token = parserState.Token if isinstance(token, CharacterToken): - if (token == "("): + if token == "(": parserState.NewToken = OpeningRoundBracketToken(fromExistingToken=token) parserState.Counter += 1 - elif (token == ")"): + elif token == ")": parserState.Counter -= 1 - if (parserState.Counter == 0): + if parserState.Counter == 0: parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = ItemBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) parserState.Pop() parserState.TokenMarker = parserState.NewToken else: parserState.NewToken = ClosingRoundBracketToken(fromExistingToken=token) - elif (token == ";"): - if (parserState.Counter == 1): + elif token == ";": + if parserState.Counter == 1: parserState.NewToken = DelimiterToken(fromExistingToken=token) parserState.NewBlock = ItemBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) _ = DelimiterBlock(parserState.NewBlock, parserState.NewToken) @@ -201,7 +201,7 @@ def stateItemDelimiter(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected generic name (identifier)." - if (isinstance(token, CharacterToken) and (token == "\n")): + if isinstance(token, CharacterToken) and (token == "\n"): parserState.NewToken = LinebreakToken(fromExistingToken=token) parserState.NewBlock = LinebreakBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -227,24 +227,24 @@ def stateClosingParenthesis(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected ';' or whitespace." if isinstance(token, CharacterToken): - if (token == ";"): + if token == ";": parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = CloseBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() return - elif (token == "\n"): + elif token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) parserState.PushState = LinebreakBlock.stateLinebreak parserState.TokenMarker = parserState.NewToken return - elif (token == "-"): + elif token == "-": parserState.NewBlock = CloseBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = CloseBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 @@ -262,30 +262,30 @@ def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected ';'." if isinstance(token, CharacterToken): - if (token == ";"): + if token == ";": parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = CloseBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() return - elif (token == "\n"): + elif token == "\n": # TODO: review this linebreak case parserState.NewToken = LinebreakToken(fromExistingToken=token) parserState.PushState = LinebreakBlock.stateLinebreak parserState.TokenMarker = parserState.NewToken return - elif (token == "-"): + elif token == "-": parserState.NewBlock = CloseBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = CloseBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None diff --git a/pyVHDLParser/Blocks/List/ParameterList.py b/pyVHDLParser/Blocks/List/ParameterList.py index 974e72155..212e073c9 100644 --- a/pyVHDLParser/Blocks/List/ParameterList.py +++ b/pyVHDLParser/Blocks/List/ParameterList.py @@ -43,7 +43,7 @@ class OpenBlock(Block): @classmethod def stateParameterKeyword(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == "(")): + if isinstance(token, CharacterToken) and (token == "("): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.NextState = CloseBlock.stateClosingParenthesis @@ -66,14 +66,14 @@ def stateParameterKeyword(cls, parserState: ParserState): @classmethod def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == "(")): + if isinstance(token, CharacterToken) and (token == "("): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.PushState = cls.stateOpeningParenthesis parserState.Counter = 1 return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -85,9 +85,9 @@ def stateWhitespace1(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -99,19 +99,19 @@ def stateWhitespace1(cls, parserState: ParserState): def stateOpeningParenthesis(cls, parserState: ParserState): token = parserState.Token if isinstance(token, WordToken): - if (token <= "constant"): + if token <= "constant": parserState.NewToken = ConstantKeyword(fromExistingToken=token) parserState.NextState = DelimiterBlock.stateItemDelimiter parserState.PushState = ParameterListInterfaceConstantBlock.stateConstantKeyword parserState.TokenMarker = parserState.NewToken return - elif (token <= "variable"): + elif token <= "variable": parserState.NewToken = VariableKeyword(fromExistingToken=token) parserState.NextState = DelimiterBlock.stateItemDelimiter parserState.PushState = ParameterListInterfaceVariableBlock.stateVariableKeyword parserState.TokenMarker = parserState.NewToken return - elif (token <= "signal"): + elif token <= "signal": parserState.NewToken = SignalKeyword(fromExistingToken=token) parserState.NextState = DelimiterBlock.stateItemDelimiter parserState.PushState = ParameterListInterfaceSignalBlock.stateSignalKeyword @@ -148,11 +148,11 @@ class ItemBlock(Block): def stateItemRemainder(cls, parserState: ParserState): token = parserState.Token if isinstance(token, CharacterToken): - if (token == "("): + if token == "(": parserState.Counter += 1 - elif (token == ")"): + elif token == ")": parserState.Counter -= 1 - if (parserState.Counter == 0): + if parserState.Counter == 0: parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = ItemBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) _ = CloseBlock(parserState.NewBlock, parserState.NewToken) @@ -162,8 +162,8 @@ def stateItemRemainder(cls, parserState: ParserState): parserState.NewToken = ClosingRoundBracketToken(fromExistingToken=token) # parserState.NewBlock = CloseBlock(parserState.LastBlock, parserState.NewToken) # parserState.Pop() - elif (token == ";"): - if (parserState.Counter == 1): + elif token == ";": + if parserState.Counter == 1: parserState.NewToken = DelimiterToken(fromExistingToken=token) parserState.NewBlock = ItemBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) _ = DelimiterBlock(parserState.NewBlock, parserState.NewToken) @@ -182,33 +182,33 @@ def stateItemDelimiter(cls, parserState: ParserState): token = parserState.Token if isinstance(token, WordToken): tokenValue = token.Value.lower() - if (tokenValue == "constant"): + if tokenValue == "constant": parserState.NewToken = ConstantKeyword(fromExistingToken=token) parserState.PushState = ParameterListInterfaceConstantBlock.stateConstantKeyword parserState.TokenMarker = parserState.NewToken return - elif (tokenValue == "variable"): + elif tokenValue == "variable": parserState.NewToken = VariableKeyword(fromExistingToken=token) parserState.PushState = ParameterListInterfaceVariableBlock.stateVariableKeyword parserState.TokenMarker = parserState.NewToken return - elif (tokenValue == "signal"): + elif tokenValue == "signal": parserState.NewToken = SignalKeyword(fromExistingToken=token) parserState.PushState = ParameterListInterfaceSignalBlock.stateSignalKeyword parserState.TokenMarker = parserState.NewToken return - elif (tokenValue == "type"): + elif tokenValue == "type": parserState.NewToken = TypeKeyword(fromExistingToken=token) parserState.PushState = ParameterListInterfaceTypeBlock.stateTypeKeyword parserState.TokenMarker = parserState.NewToken return - elif (tokenValue == "procedure"): + elif tokenValue == "procedure": raise NotImplementedError("Generic procedures are not supported.") - elif (tokenValue == "function"): + elif tokenValue == "function": raise NotImplementedError("Generic functions are not supported.") - elif (tokenValue == "impure"): + elif tokenValue == "impure": raise NotImplementedError("Generic impure functions are not supported.") - elif (tokenValue == "pure"): + elif tokenValue == "pure": raise NotImplementedError("Generic pure functions are not supported.") else: parserState.NewToken = IdentifierToken(fromExistingToken=token) diff --git a/pyVHDLParser/Blocks/List/PortList.py b/pyVHDLParser/Blocks/List/PortList.py index 07f9045a0..62e229184 100644 --- a/pyVHDLParser/Blocks/List/PortList.py +++ b/pyVHDLParser/Blocks/List/PortList.py @@ -50,7 +50,7 @@ class DelimiterBlock(SkipableBlock): def stateItemDelimiter(cls, parserState: ParserState): token = parserState.Token if isinstance(token, WordToken): - if (token <= "signal"): + if token <= "signal": parserState.NewToken = SignalKeyword(fromExistingToken=token) parserState.PushState = PortListInterfaceSignalBlock.stateSignalKeyword parserState.TokenMarker = parserState.NewToken @@ -99,7 +99,7 @@ class OpenBlock(Block): @classmethod def statePortKeyword(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken)and (token == "(")): + if isinstance(token, CharacterToken)and (token == "("): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.NextState = CloseBlock.stateClosingParenthesis @@ -121,14 +121,14 @@ def statePortKeyword(cls, parserState: ParserState): @classmethod def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken)and (token == "(")): + if isinstance(token, CharacterToken)and (token == "("): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.NextState = CloseBlock.stateClosingParenthesis parserState.PushState = cls.stateOpeningParenthesis return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -140,9 +140,9 @@ def stateWhitespace1(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -153,14 +153,14 @@ def stateWhitespace1(cls, parserState: ParserState): @classmethod def stateOpeningParenthesis(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken)and (token == ")")): - # if (parserState.TokenMarker != token): + if isinstance(token, CharacterToken) and (token == ")"): + # if parserState.TokenMarker != token: # parserState.NewBlock = IndentationBlock(parserState.LastBlock, parserState.TokenMarker, token.PreviousToken) parserState.Pop() parserState.TokenMarker = token return elif isinstance(token, WordToken): - if (token <= "signal"): + if token <= "signal": parserState.NewToken = SignalKeyword(fromExistingToken=token) parserState.NextState = DelimiterBlock.stateItemDelimiter parserState.PushState = PortListInterfaceSignalBlock.stateSignalKeyword diff --git a/pyVHDLParser/Blocks/List/PortMapList.py b/pyVHDLParser/Blocks/List/PortMapList.py index 1518c93e7..71b100d41 100644 --- a/pyVHDLParser/Blocks/List/PortMapList.py +++ b/pyVHDLParser/Blocks/List/PortMapList.py @@ -43,14 +43,14 @@ def statePortKeyword(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected whitespace or '(' after keyword PORT." if isinstance(token, CharacterToken): - if (token == "("): + if token == "(": parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = OpenBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.NextState = CloseBlock.stateClosingParenthesis parserState.PushState = OpenBlock.stateOpeningParenthesis parserState.Counter = 1 return - elif (token == "\n"): + elif token == "\n": parserState.NewBlock = OpenBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -58,14 +58,14 @@ def statePortKeyword(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace1 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = OpenBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = OpenBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 @@ -84,16 +84,16 @@ def stateWhitespace1(cls, parserState: ParserState): errorMessage = "Expected '(' after keyword PORT." if isinstance(token, CharacterToken): - if (token == "("): + if token == "(": parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = OpenBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.NextState = CloseBlock.stateClosingParenthesis parserState.PushState = OpenBlock.stateOpeningParenthesis parserState.Counter = 1 return - elif (token == "\n"): + elif token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = OpenBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -102,21 +102,21 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace1 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = OpenBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = OpenBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -129,23 +129,23 @@ def stateOpeningParenthesis(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected port name (identifier)." if isinstance(token, CharacterToken): - if (token == ")"): - # if (parserState.TokenMarker != token): + if token == ")": + # if parserState.TokenMarker != token: # parserState.NewBlock = IndentationBlock(parserState.LastBlock, parserState.TokenMarker, token.PreviousToken) parserState.Pop(1, token) return - elif (token == "\n"): + elif token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) parserState.NewBlock = LinebreakBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token @@ -159,7 +159,7 @@ def stateOpeningParenthesis(cls, parserState: ParserState): parserState.TokenMarker = parserState.NewToken parserState.NextState = ItemBlock.stateItemRemainder - # if (parserState.TokenMarker != token): + # if parserState.TokenMarker != token: # parserState.NewBlock = IndentationBlock(parserState.LastBlock, parserState.TokenMarker, token) return @@ -172,20 +172,20 @@ class ItemBlock(Block): def stateItemRemainder(cls, parserState: ParserState): token = parserState.Token if isinstance(token, CharacterToken): - if (token == "("): + if token == "(": parserState.NewToken = OpeningRoundBracketToken(fromExistingToken=token) parserState.Counter += 1 - elif (token == ")"): + elif token == ")": parserState.Counter -= 1 - if (parserState.Counter == 0): + if parserState.Counter == 0: parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = ItemBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) parserState.Pop() parserState.TokenMarker = parserState.NewToken else: parserState.NewToken = ClosingRoundBracketToken(fromExistingToken=token) - elif (token == ";"): - if (parserState.Counter == 1): + elif token == ";": + if parserState.Counter == 1: parserState.NewToken = DelimiterToken(fromExistingToken=token) parserState.NewBlock = ItemBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) _ = DelimiterBlock(parserState.NewBlock, parserState.NewToken) @@ -204,7 +204,7 @@ def stateItemDelimiter(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected port name (identifier)." - if (isinstance(token, CharacterToken) and (token == "\n")): + if isinstance(token, CharacterToken) and (token == "\n"): parserState.NewToken = LinebreakToken(fromExistingToken=token) parserState.NewBlock = LinebreakBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -230,24 +230,24 @@ def stateClosingParenthesis(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected ';' or whitespace." if isinstance(token, CharacterToken): - if (token == ";"): + if token == ";": parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = CloseBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() return - elif (token == "\n"): + elif token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) parserState.PushState = LinebreakBlock.stateLinebreak parserState.TokenMarker = parserState.NewToken return - elif (token == "-"): + elif token == "-": parserState.NewBlock = CloseBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = CloseBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 @@ -265,30 +265,30 @@ def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected ';'." if isinstance(token, CharacterToken): - if (token == ";"): + if token == ";": parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = CloseBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() return - elif (token == "\n"): + elif token == "\n": # TODO: review this linebreak case parserState.NewToken = LinebreakToken(fromExistingToken=token) parserState.PushState = LinebreakBlock.stateLinebreak parserState.TokenMarker = parserState.NewToken return - elif (token == "-"): + elif token == "-": parserState.NewBlock = CloseBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = CloseBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None diff --git a/pyVHDLParser/Blocks/List/SensitivityList.py b/pyVHDLParser/Blocks/List/SensitivityList.py index 63401ad65..07441f9a6 100644 --- a/pyVHDLParser/Blocks/List/SensitivityList.py +++ b/pyVHDLParser/Blocks/List/SensitivityList.py @@ -43,7 +43,7 @@ class OpenBlock(Block): def stateOpeningParenthesis(cls, parserState: ParserState): token = parserState.Token if isinstance(token, WordToken): - if (token <= "all"): + if token <= "all": parserState.NewToken = AllKeyword(fromExistingToken=token) parserState.NewBlock = ItemBlock(parserState.LastBlock, parserState.NewToken, endToken=parserState.NewToken) parserState.TokenMarker = None @@ -80,20 +80,20 @@ class ItemBlock(Block): def stateItemRemainder(cls, parserState: ParserState): token = parserState.Token if isinstance(token, CharacterToken): - if (token == "("): + if token == "(": parserState.Counter += 1 - elif (token == ")"): + elif token == ")": parserState.NewToken = OpeningRoundBracketToken(fromExistingToken=token) parserState.Counter -= 1 - if (parserState.Counter == 0): + if parserState.Counter == 0: parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = ItemBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) parserState.Pop() parserState.TokenMarker = parserState.NewToken else: parserState.NewToken = ClosingRoundBracketToken(fromExistingToken=token) - elif (token == ";"): - if (parserState.Counter == 1): + elif token == ";": + if parserState.Counter == 1: parserState.NewToken = DelimiterToken(fromExistingToken=token) parserState.NewBlock = ItemBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) _ = DelimiterBlock(parserState.NewBlock, parserState.NewToken) @@ -140,7 +140,7 @@ class CloseBlock(Block): @classmethod def stateAllKeyword(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == ")")): + if isinstance(token, CharacterToken) and (token == ")"): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = CloseBlock(parserState.LastBlock, parserState.NewToken, endToken=parserState.NewToken) parserState.Pop() @@ -162,13 +162,13 @@ def stateAllKeyword(cls, parserState: ParserState): def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected '(' after keyword PROCESS." - if (isinstance(token, CharacterToken) and (token == ")")): + if isinstance(token, CharacterToken) and (token == ")"): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.NewToken, endToken=parserState.NewToken) parserState.Pop() return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -180,9 +180,9 @@ def stateWhitespace1(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None diff --git a/pyVHDLParser/Blocks/Object/SharedVariable.py b/pyVHDLParser/Blocks/Object/SharedVariable.py index 673c04827..5b2cfd597 100644 --- a/pyVHDLParser/Blocks/Object/SharedVariable.py +++ b/pyVHDLParser/Blocks/Object/SharedVariable.py @@ -75,7 +75,7 @@ def stateWhitespace0(cls, parserState: ParserState): parserState.NextState = cls.stateVariableKeyword return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -86,7 +86,7 @@ def stateWhitespace0(cls, parserState: ParserState): parserState.NewBlock = CommentBlock(parserState.LastBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -114,7 +114,7 @@ def stateVariableKeyword(cls, parserState: ParserState): @classmethod def stateSubtypeIndication(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == ';')): + if isinstance(token, CharacterToken) and (token == ';'): parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) _ = cls.END_BLOCK(parserState.NewBlock, parserState.NewToken) @@ -137,13 +137,13 @@ def stateSubtypeIndication(cls, parserState: ParserState): @classmethod def stateWhitespace4(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == ";")): + if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -154,7 +154,7 @@ def stateWhitespace4(cls, parserState: ParserState): parserState.NewBlock = CommentBlock(parserState.LastBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None diff --git a/pyVHDLParser/Blocks/Object/__init__.py b/pyVHDLParser/Blocks/Object/__init__.py index 2858e9a6b..0800d00ce 100644 --- a/pyVHDLParser/Blocks/Object/__init__.py +++ b/pyVHDLParser/Blocks/Object/__init__.py @@ -54,7 +54,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NextState = cls.stateObjectName return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -65,7 +65,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NewBlock = CommentBlock(parserState.LastBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -76,7 +76,7 @@ def stateWhitespace1(cls, parserState: ParserState): @classmethod def stateObjectName(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == ":")): + if isinstance(token, CharacterToken) and (token == ":"): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NextState = cls.stateColon1 return @@ -97,12 +97,12 @@ def stateObjectName(cls, parserState: ParserState): @classmethod def stateWhitespace2(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == ":")): + if isinstance(token, CharacterToken) and (token == ":"): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NextState = cls.stateColon1 return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -113,7 +113,7 @@ def stateWhitespace2(cls, parserState: ParserState): parserState.NewBlock = CommentBlock(parserState.LastBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -150,7 +150,7 @@ def stateWhitespace3(cls, parserState: ParserState): parserState.NextState = cls.stateSubtypeIndication return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -161,7 +161,7 @@ def stateWhitespace3(cls, parserState: ParserState): parserState.NewBlock = CommentBlock(parserState.LastBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -172,14 +172,14 @@ def stateWhitespace3(cls, parserState: ParserState): @classmethod def stateSubtypeIndication(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, FusedCharacterToken) and (token == ":=")): + if isinstance(token, FusedCharacterToken) and (token == ":="): parserState.NewToken = VariableAssignmentKeyword(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.PushState = cls.EXPRESSION_BLOCK.stateExpression parserState.TokenMarker = None parserState.Counter = 0 return - elif (isinstance(token, CharacterToken) and (token == ';')): + elif isinstance(token, CharacterToken) and (token == ';'): parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) _ = cls.END_BLOCK(parserState.NewBlock, parserState.NewToken) @@ -202,20 +202,20 @@ def stateSubtypeIndication(cls, parserState: ParserState): @classmethod def stateWhitespace4(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, FusedCharacterToken) and (token == ":=")): + if isinstance(token, FusedCharacterToken) and (token == ":="): parserState.NewToken = VariableAssignmentKeyword(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.PushState = cls.EXPRESSION_BLOCK.stateExpression parserState.TokenMarker = None parserState.Counter = 0 return - elif (isinstance(token, CharacterToken) and (token == ";")): + elif isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -226,7 +226,7 @@ def stateWhitespace4(cls, parserState: ParserState): parserState.NewBlock = CommentBlock(parserState.LastBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None diff --git a/pyVHDLParser/Blocks/Reference/Context.py b/pyVHDLParser/Blocks/Reference/Context.py index 5b5aa2902..138d0b634 100644 --- a/pyVHDLParser/Blocks/Reference/Context.py +++ b/pyVHDLParser/Blocks/Reference/Context.py @@ -77,7 +77,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NextState = cls.stateContextName return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -89,9 +89,9 @@ def stateWhitespace1(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -119,13 +119,13 @@ def stateContextName(cls, parserState: ParserState): @classmethod def stateWhitespace2(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, WordToken) and (token <= "is")): + if isinstance(token, WordToken) and (token <= "is"): parserState.NewToken = IsKeyword(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.NextState = cls.stateDeclarativeRegion return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -137,9 +137,9 @@ def stateWhitespace2(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -162,14 +162,14 @@ def stateDeclarativeRegion(cls, parserState: ParserState): elif isinstance(token, WordToken): tokenValue = token.Value.lower() for keyword in cls.KEYWORDS: - if (tokenValue == keyword.__KEYWORD__): + if tokenValue == keyword.__KEYWORD__: newToken = keyword(fromExistingToken=token) parserState.PushState = cls.KEYWORDS[keyword] parserState.NewToken = newToken parserState.TokenMarker = newToken return - if (tokenValue == "end"): + if tokenValue == "end": parserState.NewToken = EndKeyword(fromExistingToken=token) parserState.TokenMarker = parserState.NewToken parserState.NextState = EndBlock.stateEndKeyword diff --git a/pyVHDLParser/Blocks/Reference/Library.py b/pyVHDLParser/Blocks/Reference/Library.py index c5654d6e4..899a7a766 100644 --- a/pyVHDLParser/Blocks/Reference/Library.py +++ b/pyVHDLParser/Blocks/Reference/Library.py @@ -72,9 +72,9 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NewBlock = block(parserState.LastBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -89,13 +89,13 @@ class LibraryNameBlock(Block): def stateLibraryName(cls, parserState: ParserState): token = parserState.Token if isinstance(token, CharacterToken): - if (token == ","): + if token == ",": parserState.NewToken = DelimiterToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken) _ = DelimiterBlock(parserState.NewBlock, parserState.NewToken) parserState.NextState = DelimiterBlock.stateDelimiter return - elif (token == ";"): + elif token == ";": parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken) _ = EndBlock(parserState.NewBlock, parserState.NewToken) @@ -119,13 +119,13 @@ def stateLibraryName(cls, parserState: ParserState): def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token if isinstance(token, CharacterToken): - if (token == ","): + if token == ",": parserState.NewToken = DelimiterToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken) _ = DelimiterBlock(parserState.NewBlock, parserState.NewToken) parserState.NextState = DelimiterBlock.stateDelimiter return - elif (token == ";"): + elif token == ";": parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken) _ = EndBlock(parserState.NewBlock, parserState.NewToken) @@ -140,9 +140,9 @@ def stateWhitespace1(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -198,9 +198,9 @@ def stateWhitespace1(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None diff --git a/pyVHDLParser/Blocks/Reference/Use.py b/pyVHDLParser/Blocks/Reference/Use.py index 4f0c63776..93651560a 100644 --- a/pyVHDLParser/Blocks/Reference/Use.py +++ b/pyVHDLParser/Blocks/Reference/Use.py @@ -72,9 +72,9 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NewBlock = block(parserState.LastBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -88,7 +88,7 @@ class ReferenceNameBlock(Block): @classmethod def stateLibraryName(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == ".")): + if isinstance(token, CharacterToken) and (token == "."): parserState.NewToken = DelimiterToken(fromExistingToken=token) parserState.NextState = cls.stateDot1 return @@ -109,7 +109,7 @@ def stateLibraryName(cls, parserState: ParserState): @classmethod def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == ".")): + if isinstance(token, CharacterToken) and (token == "."): parserState.NewToken = DelimiterToken(fromExistingToken=token) parserState.NextState = cls.stateDot1 return @@ -130,9 +130,9 @@ def stateWhitespace1(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -150,7 +150,7 @@ def stateDot1(cls, parserState: ParserState): elif isinstance(token, ExtendedIdentifier): parserState.NextState = cls.statePackageName return - elif (isinstance(token, CharacterToken) and (token == ".")): + elif isinstance(token, CharacterToken) and (token == "."): parserState.NewToken = DelimiterToken(fromExistingToken=token) parserState.NextState = cls.stateDot1 return @@ -178,7 +178,7 @@ def stateWhitespace2(cls, parserState: ParserState): elif isinstance(token, ExtendedIdentifier): parserState.NextState = cls.statePackageName return - elif (isinstance(token, CharacterToken) and (token == ".")): + elif isinstance(token, CharacterToken) and (token == "."): parserState.NewToken = DelimiterToken(fromExistingToken=token) parserState.NextState = cls.stateDot1 return @@ -196,9 +196,9 @@ def stateWhitespace2(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -209,7 +209,7 @@ def stateWhitespace2(cls, parserState: ParserState): @classmethod def statePackageName(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == ".")): + if isinstance(token, CharacterToken) and (token == "."): parserState.NewToken = DelimiterToken(fromExistingToken=token) parserState.NextState = cls.stateDot2 return @@ -230,7 +230,7 @@ def statePackageName(cls, parserState: ParserState): @classmethod def stateWhitespace3(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == ".")): + if isinstance(token, CharacterToken) and (token == "."): parserState.NewToken = DelimiterToken(fromExistingToken=token) parserState.NextState = cls.stateDot2 return @@ -251,9 +251,9 @@ def stateWhitespace3(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -265,7 +265,7 @@ def stateWhitespace3(cls, parserState: ParserState): def stateDot2(cls, parserState: ParserState): token = parserState.Token if isinstance(token, WordToken): - if (token <= "all"): + if token <= "all": parserState.NewToken = AllKeyword(fromExistingToken=token) else: parserState.NewToken = IdentifierToken(fromExistingToken=token) @@ -291,12 +291,12 @@ def stateDot2(cls, parserState: ParserState): @classmethod def stateWhitespace4(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == ".")): + if isinstance(token, CharacterToken) and (token == "."): parserState.NewToken = DelimiterToken(fromExistingToken=token) parserState.NextState = cls.stateDot1 return elif isinstance(token, WordToken): - if (token <= "all"): + if token <= "all": parserState.NewToken = AllKeyword(fromExistingToken=token) else: parserState.NewToken = IdentifierToken(fromExistingToken=token) @@ -314,9 +314,9 @@ def stateWhitespace4(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -328,13 +328,13 @@ def stateWhitespace4(cls, parserState: ParserState): def stateObjectName(cls, parserState: ParserState): token = parserState.Token if isinstance(token, CharacterToken): - if (token == ","): + if token == ",": parserState.NewToken = DelimiterToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken) _ = DelimiterBlock(parserState.NewBlock, parserState.NewToken, endToken=parserState.NewToken) parserState.NextState = DelimiterBlock.stateDelimiter return - elif (token == ";"): + elif token == ";": parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken) _ = EndBlock(parserState.NewBlock, parserState.NewToken, endToken=parserState.NewToken) @@ -360,13 +360,13 @@ def stateObjectName(cls, parserState: ParserState): def stateWhitespace5(cls, parserState: ParserState): token = parserState.Token if isinstance(token, CharacterToken): - if (token == ","): + if token == ",": parserState.NewToken = DelimiterToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken) _ = DelimiterBlock(parserState.NewBlock, parserState.NewToken, endToken=parserState.NewToken) parserState.NextState = DelimiterBlock.stateDelimiter return - elif (token == ";"): + elif token == ";": parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) _ = EndBlock(parserState.NewBlock, parserState.NewToken, endToken=parserState.NewToken) @@ -382,9 +382,9 @@ def stateWhitespace5(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -442,7 +442,7 @@ def stateWhitespace1(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None diff --git a/pyVHDLParser/Blocks/Reporting/Assert.py b/pyVHDLParser/Blocks/Reporting/Assert.py index 46f5e7983..e98e3d55a 100644 --- a/pyVHDLParser/Blocks/Reporting/Assert.py +++ b/pyVHDLParser/Blocks/Reporting/Assert.py @@ -63,7 +63,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NextState = cls.stateAssertion return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -75,9 +75,9 @@ def stateWhitespace1(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -105,12 +105,12 @@ def stateAssertion(cls, parserState: ParserState): @classmethod def stateWhitespace2(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, WordToken) and (token <= "report")): + if isinstance(token, WordToken) and (token <= "report"): parserState.NewToken = ReportKeyword(fromExistingToken=token) parserState.NextState = cls.stateReportKeyword return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -122,9 +122,9 @@ def stateWhitespace2(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -157,7 +157,7 @@ def stateWhitespace3(cls, parserState: ParserState): parserState.NextState = cls.stateMessage return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -169,9 +169,9 @@ def stateWhitespace3(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -182,7 +182,7 @@ def stateWhitespace3(cls, parserState: ParserState): @classmethod def stateMessage(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken)and (token == ";")): + if isinstance(token, CharacterToken)and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() @@ -204,17 +204,17 @@ def stateMessage(cls, parserState: ParserState): @classmethod def stateWhitespace4(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken)and (token == ";")): + if isinstance(token, CharacterToken)and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() return - elif (isinstance(token, WordToken) and (token <= "severity")): + elif isinstance(token, WordToken) and (token <= "severity"): parserState.NewToken = SeverityKeyword(fromExistingToken=token) parserState.NextState = cls.stateSeverityKeyword return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -226,9 +226,9 @@ def stateWhitespace4(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -261,7 +261,7 @@ def stateWhitespace5(cls, parserState: ParserState): parserState.NextState = cls.stateSeverityLevel return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -273,9 +273,9 @@ def stateWhitespace5(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -286,7 +286,7 @@ def stateWhitespace5(cls, parserState: ParserState): @classmethod def stateSeverityLevel(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == ";")): + if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() @@ -308,13 +308,13 @@ def stateSeverityLevel(cls, parserState: ParserState): @classmethod def stateWhitespace6(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken)and (token == ";")): + if isinstance(token, CharacterToken)and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -326,9 +326,9 @@ def stateWhitespace6(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None diff --git a/pyVHDLParser/Blocks/Reporting/Report.py b/pyVHDLParser/Blocks/Reporting/Report.py index b7f67c798..ecf8cb8d7 100644 --- a/pyVHDLParser/Blocks/Reporting/Report.py +++ b/pyVHDLParser/Blocks/Reporting/Report.py @@ -63,7 +63,7 @@ def stateWhitespace3(cls, parserState: ParserState): parserState.NextState = cls.stateMessage return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -75,9 +75,9 @@ def stateWhitespace3(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -88,7 +88,7 @@ def stateWhitespace3(cls, parserState: ParserState): @classmethod def stateMessage(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken)and (token == ";")): + if isinstance(token, CharacterToken)and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() @@ -110,17 +110,17 @@ def stateMessage(cls, parserState: ParserState): @classmethod def stateWhitespace4(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken)and (token == ";")): + if isinstance(token, CharacterToken)and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() return - elif (isinstance(token, WordToken) and (token <= "severity")): + elif isinstance(token, WordToken) and (token <= "severity"): parserState.NewToken = SeverityKeyword(fromExistingToken=token) parserState.NextState = cls.stateSeverityKeyword return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -132,9 +132,9 @@ def stateWhitespace4(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -167,7 +167,7 @@ def stateWhitespace5(cls, parserState: ParserState): parserState.NextState = cls.stateSeverityLevel return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -179,9 +179,9 @@ def stateWhitespace5(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -192,7 +192,7 @@ def stateWhitespace5(cls, parserState: ParserState): @classmethod def stateSeverityLevel(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == ";")): + if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() @@ -215,13 +215,13 @@ def stateSeverityLevel(cls, parserState: ParserState): def stateWhitespace6(cls, parserState: ParserState): token = parserState.Token if isinstance(token, CharacterToken): - if (token == ";"): + if token == ";": parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -233,9 +233,9 @@ def stateWhitespace6(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None diff --git a/pyVHDLParser/Blocks/Sequential/Function.py b/pyVHDLParser/Blocks/Sequential/Function.py index 0dce52727..c5eeb4b47 100644 --- a/pyVHDLParser/Blocks/Sequential/Function.py +++ b/pyVHDLParser/Blocks/Sequential/Function.py @@ -102,7 +102,7 @@ def stateWhitespace0(cls, parserState: ParserState): parserState.NextState = cls.stateFunctionName return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -114,7 +114,7 @@ def stateWhitespace0(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -147,7 +147,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NextState = cls.stateFunctionName return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -159,7 +159,7 @@ def stateWhitespace1(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -170,7 +170,7 @@ def stateWhitespace1(cls, parserState: ParserState): @classmethod def stateFunctionName(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == "(")): + if isinstance(token, CharacterToken) and (token == "("): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) _ = ParameterList.OpenBlock(parserState.NewBlock, parserState.NewToken) @@ -196,7 +196,7 @@ def stateFunctionName(cls, parserState: ParserState): @classmethod def stateWhitespace2(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == "(")): + if isinstance(token, CharacterToken) and (token == "("): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) _ = ParameterList.OpenBlock(parserState.NewBlock, parserState.NewToken) @@ -207,26 +207,26 @@ def stateWhitespace2(cls, parserState: ParserState): return elif isinstance(token, WordToken): keyword = token.Value.lower() - if (keyword == "return"): + if keyword == "return": parserState.NewToken = ReturnKeyword(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) parserState.TokenMarker = parserState.NewToken parserState.NextState = ReturnTypeBlock.stateReturnKeyword return - elif (keyword == "generic"): + elif keyword == "generic": parserState.NewToken = GenericKeyword(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) parserState.NextState = GenericList.OpenBlock.stateGenericKeyword parserState.TokenMarker = parserState.NewToken return - elif (keyword == "parameter"): + elif keyword == "parameter": parserState.NewToken = ParameterKeyword(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) parserState.NextState = ParameterList.OpenBlock.stateParameterKeyword parserState.TokenMarker = parserState.NewToken return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -238,7 +238,7 @@ def stateWhitespace2(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -253,7 +253,7 @@ class ReturnTypeBlock(Block): def stateAfterParameterList(cls, parserState: ParserState): token = parserState.Token if isinstance(token, WordToken): - if (token <= "return"): + if token <= "return": parserState.NewToken = ReturnKeyword(fromExistingToken=token) # parserState.NewBlock = NameBlock2(parserState.LastBlock, parserState.TokenMarker, parserState.NewToken) parserState.NextState = cls.stateReturnKeyword @@ -274,12 +274,12 @@ def stateAfterParameterList(cls, parserState: ParserState): @classmethod def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, WordToken) and (token <= "return")): + if isinstance(token, WordToken) and (token <= "return"): parserState.NewToken = ReturnKeyword(fromExistingToken=token) parserState.NextState = cls.stateReturnKeyword return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -291,7 +291,7 @@ def stateWhitespace1(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -329,7 +329,7 @@ def stateWhitespace2(cls, parserState: ParserState): parserState.NextState = cls.stateReturnType return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -341,7 +341,7 @@ def stateWhitespace2(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -353,7 +353,7 @@ def stateWhitespace2(cls, parserState: ParserState): def stateReturnType(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected ';' or whitespace after type mark (return type)." - if (isinstance(token, CharacterToken) and (token == ";")): + if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() @@ -375,18 +375,18 @@ def stateReturnType(cls, parserState: ParserState): @classmethod def stateWhitespace3(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == ";")): + if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() return - elif (isinstance(token, WordToken) and (token <= "is")): + elif isinstance(token, WordToken) and (token <= "is"): parserState.NewToken = IsKeyword(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.NextState = DeclarativeRegion.stateDeclarativeRegion return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -398,7 +398,7 @@ def stateWhitespace3(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None diff --git a/pyVHDLParser/Blocks/Sequential/Package.py b/pyVHDLParser/Blocks/Sequential/Package.py index c8eb0a78c..664de6e13 100644 --- a/pyVHDLParser/Blocks/Sequential/Package.py +++ b/pyVHDLParser/Blocks/Sequential/Package.py @@ -85,7 +85,7 @@ def statePackageKeyword(cls, parserState: ParserState): def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token if isinstance(token, WordToken): - if (token <= "body"): + if token <= "body": parserState.NewToken = BodyKeyword(fromExistingToken=token) parserState.NextState = PackageBody.NameBlock.stateBodyKeyword return @@ -94,7 +94,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NextState = cls.statePackageName return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -106,7 +106,7 @@ def stateWhitespace1(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -134,14 +134,14 @@ def statePackageName(cls, parserState: ParserState): @classmethod def stateWhitespace2(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, WordToken) and (token <= "is")): + if isinstance(token, WordToken) and (token <= "is"): parserState.NewToken = IsKeyword(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.TokenMarker = None parserState.NextState = DeclarativeRegion.stateDeclarativeRegion return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -153,7 +153,7 @@ def stateWhitespace2(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None diff --git a/pyVHDLParser/Blocks/Sequential/PackageBody.py b/pyVHDLParser/Blocks/Sequential/PackageBody.py index 739c30564..d65e94c0a 100644 --- a/pyVHDLParser/Blocks/Sequential/PackageBody.py +++ b/pyVHDLParser/Blocks/Sequential/PackageBody.py @@ -78,7 +78,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NextState = cls.statePackageName return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = NameBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -90,7 +90,7 @@ def stateWhitespace1(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -118,14 +118,14 @@ def statePackageName(cls, parserState: ParserState): @classmethod def stateWhitespace2(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, WordToken) and (token <= "is")): + if isinstance(token, WordToken) and (token <= "is"): parserState.NewToken = IsKeyword(fromExistingToken=token) parserState.NewBlock = NameBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.TokenMarker = None parserState.NextState = DeclarativeRegion.stateDeclarativeRegion return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = NameBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -137,7 +137,7 @@ def stateWhitespace2(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None diff --git a/pyVHDLParser/Blocks/Sequential/Procedure.py b/pyVHDLParser/Blocks/Sequential/Procedure.py index 0f0d5d2fc..c4257465d 100644 --- a/pyVHDLParser/Blocks/Sequential/Procedure.py +++ b/pyVHDLParser/Blocks/Sequential/Procedure.py @@ -85,7 +85,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NextState = cls.stateProcedureName return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -97,7 +97,7 @@ def stateWhitespace1(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -109,7 +109,7 @@ def stateWhitespace1(cls, parserState: ParserState): def stateProcedureName(cls, parserState: ParserState): token = parserState.Token if isinstance(token, CharacterToken): - if (token == "("): + if token == "(": parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) _ = ParameterList.OpenBlock(parserState.NewBlock, parserState.NewToken) @@ -118,7 +118,7 @@ def stateProcedureName(cls, parserState: ParserState): parserState.PushState = ParameterList.OpenBlock.stateOpeningParenthesis parserState.Counter = 1 return - elif (token == ";"): + elif token == ";": parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) # .PreviousToken) # _ = EndBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) @@ -142,7 +142,7 @@ def stateProcedureName(cls, parserState: ParserState): def stateWhitespace2(cls, parserState: ParserState): token = parserState.Token if isinstance(token, CharacterToken): - if (token == "("): + if token == "(": parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) _ = ParameterList.OpenBlock(parserState.NewBlock, parserState.NewToken) @@ -151,7 +151,7 @@ def stateWhitespace2(cls, parserState: ParserState): parserState.PushState = ParameterList.OpenBlock.stateOpeningParenthesis parserState.Counter = 1 return - elif (token == ";"): + elif token == ";": parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) # .PreviousToken) # _ = EndBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) @@ -159,27 +159,27 @@ def stateWhitespace2(cls, parserState: ParserState): return elif isinstance(token, WordToken): keyword = token.Value.lower() - if (keyword == "is"): + if keyword == "is": parserState.NewToken = IsKeyword(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) _ = VoidBlock(parserState.NewBlock, parserState.NewToken) parserState.TokenMarker = parserState.NewToken parserState.NextState = VoidBlock.stateDeclarativeRegion return - elif (keyword == "generic"): + elif keyword == "generic": parserState.NewToken = GenericKeyword(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) parserState.NextState = GenericList.OpenBlock.stateGenericKeyword parserState.TokenMarker = parserState.NewToken return - elif (keyword == "parameter"): + elif keyword == "parameter": parserState.NewToken = ParameterKeyword(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) parserState.NextState = ParameterList.OpenBlock.stateParameterKeyword parserState.TokenMarker = parserState.NewToken return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -191,7 +191,7 @@ def stateWhitespace2(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -205,13 +205,13 @@ class VoidBlock(Block): @classmethod def stateAfterParameterList(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == ";")): + if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() return elif isinstance(token, WordToken): - if (token <= "is"): + if token <= "is": parserState.NewToken = IsKeyword(fromExistingToken=token) parserState.NewBlock = VoidBlock(parserState.LastBlock, parserState.TokenMarker, parserState.NewToken) parserState.NextState = DeclarativeRegion.stateDeclarativeRegion @@ -232,12 +232,12 @@ def stateAfterParameterList(cls, parserState: ParserState): @classmethod def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, WordToken) and (token <= "is")): + if isinstance(token, WordToken) and (token <= "is"): parserState.NewToken = IsKeyword(fromExistingToken=token) parserState.NextState = DeclarativeRegion.stateDeclarativeRegion return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -249,7 +249,7 @@ def stateWhitespace1(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None diff --git a/pyVHDLParser/Blocks/Sequential/Process.py b/pyVHDLParser/Blocks/Sequential/Process.py index b7825e2a7..08a7a0b1b 100644 --- a/pyVHDLParser/Blocks/Sequential/Process.py +++ b/pyVHDLParser/Blocks/Sequential/Process.py @@ -63,7 +63,7 @@ class OpenBlock(Block): @classmethod def stateProcessKeyword(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken)and (token == "(")): + if isinstance(token, CharacterToken)and (token == "("): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.NextState = OpenBlock2.stateAfterSensitivityList @@ -86,7 +86,7 @@ def stateProcessKeyword(cls, parserState: ParserState): @classmethod def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken)and (token == "(")): + if isinstance(token, CharacterToken)and (token == "("): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.NextState = OpenBlock2.stateAfterSensitivityList @@ -94,7 +94,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.Counter = 1 return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -105,9 +105,9 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NewBlock = CommentBlock(parserState.LastBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -118,7 +118,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken) for keyword in OpenBlock2.KEYWORDS: - if (tokenValue == keyword.__KEYWORD__): + if tokenValue == keyword.__KEYWORD__: newToken = keyword(fromExistingToken=token) parserState.NextState = DeclarativeRegion.stateDeclarativeRegion parserState.PushState = cls.KEYWORDS[keyword] @@ -126,7 +126,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.TokenMarker = newToken return - if (tokenValue == "begin"): + if tokenValue == "begin": parserState.NewToken = BeginKeyword(fromExistingToken=token) _ = BeginBlock(parserState.NewBlock, parserState.NewToken) parserState.TokenMarker = None @@ -167,7 +167,7 @@ def stateAfterSensitivityList(cls, parserState: ParserState): tokenValue = token.Value.lower() for keyword in OpenBlock2.KEYWORDS: - if (tokenValue == keyword.__KEYWORD__): + if tokenValue == keyword.__KEYWORD__: newToken = keyword(fromExistingToken=token) parserState.NextState = DeclarativeRegion.stateDeclarativeRegion parserState.PushState = OpenBlock2.KEYWORDS[keyword] @@ -175,13 +175,13 @@ def stateAfterSensitivityList(cls, parserState: ParserState): parserState.TokenMarker = newToken return - if (tokenValue == "begin"): + if tokenValue == "begin": parserState.NewToken = BeginKeyword(fromExistingToken=token) parserState.NewBlock = BeginBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None parserState.NextState = BeginBlock.stateSequentialRegion return - elif (tokenValue == "is"): + elif tokenValue == "is": parserState.NewToken = IsKeyword(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, parserState.NewToken) parserState.TokenMarker = None @@ -208,7 +208,7 @@ def stateWhitespace1(cls, parserState: ParserState): tokenValue = token.Value.lower() for keyword in cls.KEYWORDS: - if (tokenValue == keyword.__KEYWORD__): + if tokenValue == keyword.__KEYWORD__: newToken = keyword(fromExistingToken=token) parserState.NextState = DeclarativeRegion.stateDeclarativeRegion parserState.PushState = cls.KEYWORDS[keyword] @@ -216,20 +216,20 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.TokenMarker = newToken return - if (tokenValue == "begin"): + if tokenValue == "begin": parserState.NewToken = BeginKeyword(fromExistingToken=token) parserState.NewBlock = BeginBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None parserState.NextState = BeginBlock.stateSequentialRegion return - elif (tokenValue == "is"): + elif tokenValue == "is": parserState.NewToken = IsKeyword(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, parserState.NewToken) parserState.TokenMarker = None parserState.NextState = DeclarativeRegion.stateDeclarativeRegion return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -241,9 +241,9 @@ def stateWhitespace1(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None diff --git a/pyVHDLParser/Blocks/Structural/Architecture.py b/pyVHDLParser/Blocks/Structural/Architecture.py index f52bb5a8c..3fe2b2d4d 100644 --- a/pyVHDLParser/Blocks/Structural/Architecture.py +++ b/pyVHDLParser/Blocks/Structural/Architecture.py @@ -85,7 +85,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NextState = cls.stateArchitectureName return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -97,9 +97,9 @@ def stateWhitespace1(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -127,12 +127,12 @@ def stateArchitectureName(cls, parserState: ParserState): @classmethod def stateWhitespace2(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, WordToken) and (token <= "of")): + if isinstance(token, WordToken) and (token <= "of"): parserState.NewToken = OfKeyword(fromExistingToken=token) parserState.NextState = cls.stateOfKeyword return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -144,9 +144,9 @@ def stateWhitespace2(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -182,7 +182,7 @@ def stateWhitespace3(cls, parserState: ParserState): parserState.NextState = cls.stateEntityName return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -194,9 +194,9 @@ def stateWhitespace3(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -224,14 +224,14 @@ def stateEntityName(cls, parserState: ParserState): @classmethod def stateWhitespace4(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, WordToken) and (token <= "is")): + if isinstance(token, WordToken) and (token <= "is"): parserState.NewToken = IsKeyword(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.TokenMarker = None parserState.NextState = DeclarativeRegion.stateDeclarativeRegion return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -243,9 +243,9 @@ def stateWhitespace4(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None diff --git a/pyVHDLParser/Blocks/Structural/Block.py b/pyVHDLParser/Blocks/Structural/Block.py index be0634845..4c3aba32f 100644 --- a/pyVHDLParser/Blocks/Structural/Block.py +++ b/pyVHDLParser/Blocks/Structural/Block.py @@ -66,7 +66,7 @@ def stateBlockKeyword(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected whitespace after keyword " if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewBlock = NameBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -74,14 +74,14 @@ def stateBlockKeyword(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace1 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = NameBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = NameBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 @@ -100,9 +100,9 @@ def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected block name (identifier)." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = NameBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -110,14 +110,14 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = NameBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "/"): + elif token == "/": parserState.NewBlock = NameBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart @@ -127,7 +127,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NewToken = IdentifierToken(fromExistingToken=token) parserState.NextState = cls.stateBlockName return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -140,7 +140,7 @@ def stateBlockName(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected whitespace after keyword " if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewBlock = NameBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -148,14 +148,14 @@ def stateBlockName(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace2 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = NameBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace2 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = NameBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace2 @@ -173,9 +173,9 @@ def stateWhitespace2(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected keyword IS after block name." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = NameBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -183,24 +183,24 @@ def stateWhitespace2(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = NameBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = NameBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (isinstance(token, WordToken) and (token <= "is")): + elif isinstance(token, WordToken) and (token <= "is"): parserState.NewToken = IsKeyword(fromExistingToken=token) parserState.NewBlock = NameBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.NextState = DeclarativeRegion.stateDeclarativeRegion return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None diff --git a/pyVHDLParser/Blocks/Structural/Component.py b/pyVHDLParser/Blocks/Structural/Component.py index edd533dc5..2d3ca8965 100644 --- a/pyVHDLParser/Blocks/Structural/Component.py +++ b/pyVHDLParser/Blocks/Structural/Component.py @@ -79,7 +79,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NextState = cls.stateComponentName return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -90,9 +90,9 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NewBlock = CommentBlock(parserState.LastBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -120,14 +120,14 @@ def stateComponentName(cls, parserState: ParserState): @classmethod def stateWhitespace2(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, WordToken) and (token <= "is")): + if isinstance(token, WordToken) and (token <= "is"): parserState.NewToken = IsKeyword(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.TokenMarker = None parserState.NextState = cls.stateDeclarativeRegion return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -139,9 +139,9 @@ def stateWhitespace2(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -166,14 +166,14 @@ def stateDeclarativeRegion(cls, parserState: ParserState): tokenValue = token.Value.lower() for keyword in cls.__KEYWORDS__: - if (tokenValue == keyword.__KEYWORD__): + if tokenValue == keyword.__KEYWORD__: newToken = keyword(fromExistingToken=token) parserState.PushState = cls.__KEYWORDS__[keyword] parserState.NewToken = newToken parserState.TokenMarker = newToken return - if (tokenValue == "end"): + if tokenValue == "end": parserState.NewToken = EndKeyword(fromExistingToken=token) parserState.NextState = EndBlock.stateEndKeyword return diff --git a/pyVHDLParser/Blocks/Structural/Configuration.py b/pyVHDLParser/Blocks/Structural/Configuration.py index 377cb1002..0e3021f72 100644 --- a/pyVHDLParser/Blocks/Structural/Configuration.py +++ b/pyVHDLParser/Blocks/Structural/Configuration.py @@ -81,7 +81,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NextState = cls.stateConfigurationName return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -92,9 +92,9 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NewBlock = CommentBlock(parserState.LastBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -122,14 +122,14 @@ def stateConfigurationName(cls, parserState: ParserState): @classmethod def stateWhitespace2(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, WordToken) and (token <= "is")): + if isinstance(token, WordToken) and (token <= "is"): parserState.NewToken = IsKeyword(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.TokenMarker = None parserState.NextState = cls.stateDeclarativeRegion return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -141,9 +141,9 @@ def stateWhitespace2(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -168,18 +168,18 @@ def stateDeclarativeRegion(cls, parserState: ParserState): tokenValue = token.Value.lower() for keyword in cls.KEYWORDS: - if (tokenValue == keyword.KEYWORDS): + if tokenValue == keyword.KEYWORDS: newToken = keyword(fromExistingToken=token) parserState.PushState = cls.KEYWORDS[keyword] parserState.NewToken = newToken parserState.TokenMarker = newToken return - if (tokenValue == "begin"): + if tokenValue == "begin": parserState.NewToken = BeginKeyword(fromExistingToken=token) parserState.NextState = BeginBlock.stateBeginKeyword return - elif (tokenValue == "end"): + elif tokenValue == "end": parserState.NewToken = EndKeyword(fromExistingToken=token) parserState.NextState = EndBlock.stateEndKeyword return diff --git a/pyVHDLParser/Blocks/Structural/Entity.py b/pyVHDLParser/Blocks/Structural/Entity.py index 03f7fead3..38dfde62e 100644 --- a/pyVHDLParser/Blocks/Structural/Entity.py +++ b/pyVHDLParser/Blocks/Structural/Entity.py @@ -99,7 +99,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NextState = cls.stateEntityName return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -111,9 +111,9 @@ def stateWhitespace1(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -141,14 +141,14 @@ def stateEntityName(cls, parserState: ParserState): @classmethod def stateWhitespace2(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, WordToken) and (token <= "is")): + if isinstance(token, WordToken) and (token <= "is"): parserState.NewToken = IsKeyword(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.TokenMarker = None parserState.NextState = DeclarativeRegion.stateDeclarativeRegion return elif isinstance(token, LinebreakToken): - if (not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, token) else: @@ -160,9 +160,9 @@ def stateWhitespace2(cls, parserState: ParserState): _ = CommentBlock(parserState.NewBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return - elif (isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken))): + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None diff --git a/pyVHDLParser/Blocks/Type/SubType.py b/pyVHDLParser/Blocks/Type/SubType.py index fb131625e..7b4f86b73 100644 --- a/pyVHDLParser/Blocks/Type/SubType.py +++ b/pyVHDLParser/Blocks/Type/SubType.py @@ -43,7 +43,7 @@ def stateSubTypeKeyword(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected whitespace after keyword SUBTYPE." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -51,14 +51,14 @@ def stateSubTypeKeyword(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace1 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 @@ -77,9 +77,9 @@ def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected subtype name (identifier)." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -87,13 +87,13 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart @@ -103,7 +103,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NewToken = IdentifierToken(fromExistingToken=token) parserState.NextState = cls.stateSubTypeName return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -116,11 +116,11 @@ def stateSubTypeName(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected ';' after library name." if isinstance(token, CharacterToken): - if (token == ":"): + if token == ":": parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NextState = cls.stateColon1 return - elif (token == "\n"): + elif token == "\n": parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -128,14 +128,14 @@ def stateSubTypeName(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace2 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace2 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace2 @@ -153,13 +153,13 @@ def stateWhitespace2(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected subtype name (identifier)." if isinstance(token, CharacterToken): - if (token == ":"): + if token == ":": parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NextState = cls.stateColon1 return - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -167,13 +167,13 @@ def stateWhitespace2(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart @@ -183,7 +183,7 @@ def stateWhitespace2(cls, parserState: ParserState): parserState.NewToken = IdentifierToken(fromExistingToken=token) parserState.NextState = cls.stateColon1() return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -196,7 +196,7 @@ def stateColon1(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected typemark or whitespace after ':'." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -204,14 +204,14 @@ def stateColon1(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace3 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace3 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace3 @@ -234,9 +234,9 @@ def stateWhitespace3(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected subtype name (identifier)." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -244,13 +244,13 @@ def stateWhitespace3(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart @@ -260,7 +260,7 @@ def stateWhitespace3(cls, parserState: ParserState): parserState.NewToken = IdentifierToken(fromExistingToken=token) parserState.NextState = cls.stateTypeMarkName return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -273,11 +273,11 @@ def stateTypeMarkName(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected ':=' or whitespace after type mark." if isinstance(token, CharacterToken): - if (token == ":"): + if token == ":": parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NextState = cls.statePossibleVariableAssignment return - elif (token == "\n"): + elif token == "\n": parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -285,14 +285,14 @@ def stateTypeMarkName(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace4 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace4 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace4 @@ -310,13 +310,13 @@ def stateWhitespace4(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected ':=' after type mark." if isinstance(token, CharacterToken): - if (token == ":"): + if token == ":": parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NextState = cls.statePossibleVariableAssignment return - elif (token == "\n"): + elif token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -324,19 +324,19 @@ def stateWhitespace4(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -347,7 +347,7 @@ def stateWhitespace4(cls, parserState: ParserState): @classmethod def statePossibleVariableAssignment(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == "=")): + if isinstance(token, CharacterToken) and (token == "="): parserState.NewToken = VariableAssignmentKeyword(parserState.TokenMarker) parserState.TokenMarker = parserState.NewToken parserState.NextState = cls.stateVariableAssignment @@ -360,7 +360,7 @@ def stateVariableAssignment(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected ':=' or whitespace after type mark." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -368,14 +368,14 @@ def stateVariableAssignment(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace5 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace5 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace5 @@ -393,9 +393,9 @@ def stateWhitespace5(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected expression after ':='." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -403,13 +403,13 @@ def stateWhitespace5(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart @@ -418,7 +418,7 @@ def stateWhitespace5(cls, parserState: ParserState): elif isinstance(token, WordToken): parserState.NextState = cls.stateExpressionEnd return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -431,18 +431,18 @@ def stateExpressionEnd(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected ';'." if isinstance(token, CharacterToken): - if (token == ";"): + if token == ";": parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() return - elif (token == "-"): + elif token == "-": parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart diff --git a/pyVHDLParser/Blocks/Type/Type.py b/pyVHDLParser/Blocks/Type/Type.py index 27d2a59fc..b0f8210ec 100644 --- a/pyVHDLParser/Blocks/Type/Type.py +++ b/pyVHDLParser/Blocks/Type/Type.py @@ -43,7 +43,7 @@ def stateTypeKeyword(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected whitespace after keyword TYPE." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewBlock = TypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -51,14 +51,14 @@ def stateTypeKeyword(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace1 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = TypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = TypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 @@ -77,9 +77,9 @@ def stateWhitespace1(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected type name (identifier)." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = TypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -87,13 +87,13 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = TypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = TypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart @@ -103,7 +103,7 @@ def stateWhitespace1(cls, parserState: ParserState): parserState.NewToken = IdentifierToken(fromExistingToken=token) parserState.NextState = cls.stateTypeName return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -116,11 +116,11 @@ def stateTypeName(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected ';' after library name." if isinstance(token, CharacterToken): - if (token == ":"): + if token == ":": parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NextState = cls.stateColon1 return - elif (token == "\n"): + elif token == "\n": parserState.NewBlock = TypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -128,14 +128,14 @@ def stateTypeName(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace2 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = TypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace2 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = TypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace2 @@ -153,13 +153,13 @@ def stateWhitespace2(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected type name (identifier)." if isinstance(token, CharacterToken): - if (token == ":"): + if token == ":": parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NextState = cls.stateColon1 return - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = TypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -167,13 +167,13 @@ def stateWhitespace2(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = TypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = TypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart @@ -183,7 +183,7 @@ def stateWhitespace2(cls, parserState: ParserState): parserState.NewToken = IdentifierToken(fromExistingToken=token) parserState.NextState = cls.stateColon1() return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -196,7 +196,7 @@ def stateColon1(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected typemark or whitespace after ':'." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewBlock = TypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -204,14 +204,14 @@ def stateColon1(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace3 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = TypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace3 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = TypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace3 @@ -234,9 +234,9 @@ def stateWhitespace3(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected type name (identifier)." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = TypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -244,13 +244,13 @@ def stateWhitespace3(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = TypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = TypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart @@ -260,7 +260,7 @@ def stateWhitespace3(cls, parserState: ParserState): parserState.NewToken = IdentifierToken(fromExistingToken=token) parserState.NextState = cls.stateTypeMarkName return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -273,11 +273,11 @@ def stateTypeMarkName(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected ':=' or whitespace after type mark." if isinstance(token, CharacterToken): - if (token == ":"): + if token == ":": parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NextState = cls.statePossibleVariableAssignment return - elif (token == "\n"): + elif token == "\n": parserState.NewBlock = TypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -285,14 +285,14 @@ def stateTypeMarkName(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace4 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = TypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace4 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = TypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace4 @@ -310,13 +310,13 @@ def stateWhitespace4(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected ':=' after type mark." if isinstance(token, CharacterToken): - if (token == ":"): + if token == ":": parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NextState = cls.statePossibleVariableAssignment return - elif (token == "\n"): + elif token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = TypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -324,19 +324,19 @@ def stateWhitespace4(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = TypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = TypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -347,7 +347,7 @@ def stateWhitespace4(cls, parserState: ParserState): @classmethod def statePossibleVariableAssignment(cls, parserState: ParserState): token = parserState.Token - if (isinstance(token, CharacterToken) and (token == "=")): + if isinstance(token, CharacterToken) and (token == "="): parserState.NewToken = VariableAssignmentKeyword(parserState.TokenMarker) parserState.TokenMarker = parserState.NewToken parserState.NextState = cls.stateVariableAssignment @@ -360,7 +360,7 @@ def stateVariableAssignment(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected ':=' or whitespace after type mark." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewBlock = TypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) @@ -368,14 +368,14 @@ def stateVariableAssignment(cls, parserState: ParserState): parserState.NextState = cls.stateWhitespace5 parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = TypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace5 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = TypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace5 @@ -393,9 +393,9 @@ def stateWhitespace5(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected expression after ':='." if isinstance(token, CharacterToken): - if (token == "\n"): + if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) - if (not isinstance(parserState.LastBlock, MultiLineCommentBlock)): + if not isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewBlock = TypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: @@ -403,13 +403,13 @@ def stateWhitespace5(cls, parserState: ParserState): parserState.TokenMarker = None parserState.PushState = LinebreakBlock.stateLinebreak return - elif (token == "-"): + elif token == "-": parserState.NewBlock = TypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = TypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart @@ -418,7 +418,7 @@ def stateWhitespace5(cls, parserState: ParserState): elif isinstance(token, WordToken): parserState.NextState = cls.stateExpressionEnd return - elif (isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock)): + elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) parserState.TokenMarker = None @@ -431,18 +431,18 @@ def stateExpressionEnd(cls, parserState: ParserState): token = parserState.Token errorMessage = "Expected ';'." if isinstance(token, CharacterToken): - if (token == ";"): + if token == ";": parserState.NewToken = EndToken(fromExistingToken=token) parserState.NewBlock = TypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() return - elif (token == "-"): + elif token == "-": parserState.NewBlock = TypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return - elif (token == "/"): + elif token == "/": parserState.NewBlock = TypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart diff --git a/pyVHDLParser/Blocks/__init__.py b/pyVHDLParser/Blocks/__init__.py index 807405e46..7faee71b0 100644 --- a/pyVHDLParser/Blocks/__init__.py +++ b/pyVHDLParser/Blocks/__init__.py @@ -94,7 +94,7 @@ def __init__(self, tokenGenerator): startToken = next(self._iterator) startBlock = StartOfDocumentBlock(startToken) - if (not isinstance(startToken, StartOfDocumentToken)): + if not isinstance(startToken, StartOfDocumentToken): raise BlockParserException("First token is not a StartOfDocumentToken.", startToken) self.Token = startBlock.StartToken @@ -121,7 +121,7 @@ def PushState(self, value): @property def TokenMarker(self) -> Token: - if ((self.NewToken is not None) and (self._tokenMarker is self.Token)): + if (self.NewToken is not None) and (self._tokenMarker is self.Token): LineTerminal().WriteDebug(" {DARK_GREEN}@TokenMarker: {0!s} => {GREEN}{1!s}{NOCOLOR}".format(self._tokenMarker, self.NewToken, **LineTerminal.Foreground)) self._tokenMarker = self.NewToken return self._tokenMarker @@ -167,10 +167,10 @@ def GetGenerator(self) -> Generator['Block', Token, None]: self.Token = token # overwrite an existing token and connect the next token with the new one - if (self.NewToken is not None): + if self.NewToken is not None: # print("{MAGENTA}NewToken: {token}{NOCOLOR}".format(token=self.NewToken, **Console.Foreground)) # update topmost TokenMarker - if (self._tokenMarker is token.PreviousToken): + if self._tokenMarker is token.PreviousToken: # XXX: LineTerminal().WriteDebug(" update token marker: {0!s} -> {1!s}".format(self._tokenMarker, self.NewToken)) self._tokenMarker = self.NewToken @@ -178,19 +178,19 @@ def GetGenerator(self) -> Generator['Block', Token, None]: self.NewToken = None # an empty marker means: fill on next yield run - if (self._tokenMarker is None): + if self._tokenMarker is None: LineTerminal().WriteDebug(" new token marker: None -> {0!s}".format(token)) self._tokenMarker = token # a new block is assembled - while (self.NewBlock is not None): - if (isinstance(self.NewBlock, LinebreakBlock) and isinstance(self.LastBlock, (LinebreakBlock, EmptyLineBlock))): + while self.NewBlock is not None: + if isinstance(self.NewBlock, LinebreakBlock) and isinstance(self.LastBlock, (LinebreakBlock, EmptyLineBlock)): self.LastBlock = EmptyLineBlock(self.LastBlock, self.NewBlock.StartToken) self.LastBlock.NextBlock = self.NewBlock.NextBlock else: self.LastBlock = self.NewBlock - self.NewBlock = self.NewBlock.NextBlock + self.NewBlock = self.NewBlock.NextBlock yield self.LastBlock # if self.debug: print("{MAGENTA}------ iteration end ------{NOCOLOR}".format(**Console.Foreground)) @@ -199,7 +199,7 @@ def GetGenerator(self) -> Generator['Block', Token, None]: self.NextState(self) else: - if (isinstance(self.Token, EndOfDocumentToken) and isinstance(self.NewBlock, EndOfDocumentBlock)): + if isinstance(self.Token, EndOfDocumentToken) and isinstance(self.NewBlock, EndOfDocumentBlock): yield self.NewBlock else: raise BlockParserException("Unexpected end of document.", self.Token) @@ -223,7 +223,7 @@ def __new__(cls, className, baseClasses, classMembers: dict): states = [] for memberName, memberObject in classMembers.items(): - if (isinstance(memberObject, FunctionType) and (memberName[:5] == "state")): + if isinstance(memberObject, FunctionType) and (memberName[:5] == "state"): states.append(memberObject) classMembers['__STATES__'] = states @@ -253,7 +253,7 @@ def __iter__(self) -> 'BlockIterator': def __next__(self) -> 'Block': # in last call of '__next__', the last block in the sequence was returned - if (self.state > 0): + if self.state > 0: raise StopIteration(self.state) block = self.currentBlock @@ -265,7 +265,7 @@ def __next__(self) -> 'Block': self.state = 2 else: self.currentBlock = block.NextBlock - if (self.currentBlock is None): + if self.currentBlock is None: raise ParserException("Found open end while iterating block sequence.") # FIXME: how to append last block? return block @@ -291,7 +291,7 @@ def __iter__(self) -> 'BlockReverseIterator': def __next__(self) -> 'Block': # in last call of '__next__', the last block in the sequence was returned - if (self.state > 0): + if self.state > 0: raise StopIteration(self.state) block = self.currentBlock @@ -303,7 +303,7 @@ def __next__(self) -> 'Block': self.state = 2 else: self.currentBlock = block.PreviousBlock - if (self.currentBlock is None): + if self.currentBlock is None: raise ParserException("Found open end while iterating block sequence.") # FIXME: how to append last block? return block @@ -502,7 +502,7 @@ def stateDocument(cls, parserState: ParserState): tokenValue = token.Value.lower() for keyword in cls.KEYWORDS: - if (tokenValue == keyword.__KEYWORD__): + if tokenValue == keyword.__KEYWORD__: newToken = keyword(fromExistingToken=token) parserState.PushState = cls.KEYWORDS[keyword] parserState.NewToken = newToken diff --git a/pyVHDLParser/CLI/Block.py b/pyVHDLParser/CLI/Block.py index c098230f4..244de1110 100644 --- a/pyVHDLParser/CLI/Block.py +++ b/pyVHDLParser/CLI/Block.py @@ -55,7 +55,7 @@ def HandleBlockStreaming(self: FrontEndProtocol, args): file = Path(args.Filename) - if (not file.exists()): + if not file.exists(): print("File '{0!s}' does not exist.".format(file)) with file.open('r') as fileHandle: @@ -102,7 +102,7 @@ def HandleCheckBlockStreaming(self: FrontEndProtocol, args): file = Path(args.Filename) - if (not file.exists()): + if not file.exists(): print("File '{0!s}' does not exist.".format(file)) with file.open('r') as fileHandle: @@ -116,12 +116,12 @@ def HandleCheckBlockStreaming(self: FrontEndProtocol, args): firstBlock = next(blockIterator) self.WriteVerbose(str(firstBlock)) - if (not isinstance(firstBlock, StartOfDocumentBlock)): + if not isinstance(firstBlock, StartOfDocumentBlock): self.WriteError("{RED}First block is not StartOfDocumentBlock: {block}{NOCOLOR}".format(block=firstBlock, **self.Foreground)) self.WriteError("{YELLOW} Block: {block}{NOCOLOR}".format(block=firstBlock, **self.Foreground)) startToken = firstBlock.StartToken self.WriteDebug(str(startToken)) - if (not isinstance(startToken, StartOfDocumentToken)): + if not isinstance(startToken, StartOfDocumentToken): self.WriteError("{RED}First token is not StartOfDocumentToken: {token}{NOCOLOR}".format(token=startToken, **self.Foreground)) self.WriteError("{YELLOW} Token: {token}{NOCOLOR}".format(token=startToken, **self.Foreground)) @@ -142,11 +142,11 @@ def HandleCheckBlockStreaming(self: FrontEndProtocol, args): for token in tokenIterator: self.WriteVerbose(str(token)) - # if (token.NextToken is None): + # if token.NextToken is None: # self.WriteError("{RED}Token has an open end (NextToken).{NOCOLOR}".format(**self.Foreground)) # self.WriteError("{YELLOW} Token: {token}{NOCOLOR}".format(token=token, **self.Foreground)) # el - if (lastToken.NextToken is not token): + if lastToken.NextToken is not token: self.WriteError("{RED}Last token is not connected to the current token.{NOCOLOR}".format(**self.Foreground)) self.WriteError("{YELLOW} Last: {token!s}{NOCOLOR}".format(token=lastToken, **self.Foreground)) self.WriteError("{YELLOW} Next: {token!s}{NOCOLOR}".format(token=lastToken.NextToken, **self.Foreground)) @@ -154,10 +154,10 @@ def HandleCheckBlockStreaming(self: FrontEndProtocol, args): self.WriteError("{YELLOW} Cur.: {token!s}{NOCOLOR}".format(token=token, **self.Foreground)) self.WriteError("") - if (token.PreviousToken is None): + if token.PreviousToken is None: self.WriteError("{RED}Token has an open end (PreviousToken).{NOCOLOR}".format(**self.Foreground)) self.WriteError("{YELLOW} Token: {token}{NOCOLOR}".format(token=token, **self.Foreground)) - elif (token.PreviousToken is not lastToken): + elif token.PreviousToken is not lastToken: print("{RED}Current token is not connected to lastToken.{NOCOLOR}".format(**self.Foreground)) # print("{RED} Block: {block}{NOCOLOR}".format(block=vhdlBlock, **self.Foreground)) print("{YELLOW} Cur.: {token}{NOCOLOR}".format(token=token, **self.Foreground)) @@ -173,10 +173,10 @@ def HandleCheckBlockStreaming(self: FrontEndProtocol, args): else: self.WriteError("{RED}No EndOfDocumentBlock found.{NOCOLOR}".format(**self.Foreground)) - if (not isinstance(endBlock, EndOfDocumentBlock)): + if not isinstance(endBlock, EndOfDocumentBlock): self.WriteError("{RED}Last block is not EndOfDocumentBlock: {block}{NOCOLOR}".format(block=endBlock, **self.Foreground)) self.WriteError("{YELLOW} Block: {block}{NOCOLOR}".format(block=firstBlock, **self.Foreground)) - elif (not isinstance(endBlock.EndToken, EndOfDocumentToken)): + elif not isinstance(endBlock.EndToken, EndOfDocumentToken): self.WriteError("{RED}Last token is not EndOfDocumentToken: {token}{NOCOLOR}".format(token=endBlock.EndToken, **self.Foreground)) self.WriteError("{YELLOW} Token: {token}{NOCOLOR}".format(token=endBlock.EndToken, **self.Foreground)) diff --git a/pyVHDLParser/CLI/CodeDOM.py b/pyVHDLParser/CLI/CodeDOM.py index 8bb78d0db..9b4898471 100644 --- a/pyVHDLParser/CLI/CodeDOM.py +++ b/pyVHDLParser/CLI/CodeDOM.py @@ -48,7 +48,7 @@ def HandleCodeDOM(self : FrontEndProtocol, args): file = Path(args.Filename) - if (not file.exists()): + if not file.exists(): print("File '{0!s}' does not exist.".format(file)) # raise error with file.open('r') as fileHandle: diff --git a/pyVHDLParser/CLI/Group.py b/pyVHDLParser/CLI/Group.py index 20599bf34..7b4657b72 100644 --- a/pyVHDLParser/CLI/Group.py +++ b/pyVHDLParser/CLI/Group.py @@ -54,7 +54,7 @@ def HandleGroupStreaming(self : FrontEndProtocol, args): file = Path(args.Filename) - if (not file.exists()): + if not file.exists(): print("File '{0!s}' does not exist.".format(file)) with file.open('r') as fileHandle: diff --git a/pyVHDLParser/CLI/Token.py b/pyVHDLParser/CLI/Token.py index bde66ae09..94ad73231 100644 --- a/pyVHDLParser/CLI/Token.py +++ b/pyVHDLParser/CLI/Token.py @@ -51,7 +51,7 @@ def HandleTokenize(self: FrontEndProtocol, args): file = Path(args.Filename) - if (not file.exists()): + if not file.exists(): print(f"File '{file}' does not exist.") with file.open('r') as fileHandle: @@ -176,7 +176,7 @@ def HandleCheckTokenize(self: FrontEndProtocol, args): file = Path(args.Filename) - if (not file.exists()): + if not file.exists(): print("File '{0!s}' does not exist.".format(file)) with file.open('r') as fileHandle: @@ -194,9 +194,9 @@ def HandleCheckTokenize(self: FrontEndProtocol, args): except StopIteration: pass - if (not isinstance(firstToken, StartOfDocumentToken)): + if not isinstance(firstToken, StartOfDocumentToken): print("{RED}First token is not StartOfDocumentToken: {token}{NOCOLOR}".format(token=firstToken, **self.Foreground)) - if (firstToken.NextToken is None): + if firstToken.NextToken is None: print("{RED}First token has an open end.{NOCOLOR}".format(**self.Foreground)) tokenIterator = firstToken.GetIterator() @@ -204,26 +204,26 @@ def HandleCheckTokenize(self: FrontEndProtocol, args): token = firstToken for newToken in tokenIterator: - if (token.NextToken is None): + if token.NextToken is None: print("{RED}Token has an open end.{NOCOLOR}".format(**self.Foreground)) print("{RED} Token: {token}{NOCOLOR}".format(token=token, **self.Foreground)) - elif ((token is not firstToken) and (lastToken.NextToken is not token)): + elif (token is not firstToken) and (lastToken.NextToken is not token): print("{RED}Last token is not connected to the current token.{NOCOLOR}".format(**self.Foreground)) print("{RED} Curr: {token}{NOCOLOR}".format(token=token, **self.Foreground)) print("{DARK_RED} Prev: {token}{NOCOLOR}".format(token=token.PreviousToken, **self.Foreground)) print("{RED} Last: {token}{NOCOLOR}".format(token=lastToken, **self.Foreground)) print("{RED} Next: {token}{NOCOLOR}".format(token=lastToken.NextToken, **self.Foreground)) - if (lastToken.NextToken is None): + if lastToken.NextToken is None: print("{DARK_RED} Next: {token}{NOCOLOR}".format(token="--------", **self.Foreground)) else: print( "{DARK_RED} Next: {token}{NOCOLOR}".format(token=lastToken.NextToken.NextToken, **self.Foreground)) - if (token.PreviousToken is None): + if token.PreviousToken is None: print("{DARK_RED} Prev: {token}{NOCOLOR}".format(token="--------", **self.Foreground)) else: print("{DARK_RED} Prev: {token}{NOCOLOR}".format(token=token.PreviousToken.PreviousToken, **self.Foreground)) - elif (token.PreviousToken is not lastToken): + elif token.PreviousToken is not lastToken: print("{RED}Current token is not connected to lastToken.{NOCOLOR}".format(**self.Foreground)) print("{RED} Curr: {token}{NOCOLOR}".format(token=token, **self.Foreground)) print("{RED} Prev: {token}{NOCOLOR}".format(token=token.PreviousToken, **self.Foreground)) @@ -239,10 +239,10 @@ def HandleCheckTokenize(self: FrontEndProtocol, args): else: print("{RED}No EndOfDocumentToken found.{NOCOLOR}".format(**self.Foreground)) - if (not isinstance(token, EndOfDocumentToken)): + if not isinstance(token, EndOfDocumentToken): print( "{RED}Last token is not EndOfDocumentToken: {token}{NOCOLOR}".format(token=lastToken, **self.Foreground)) - elif (token.PreviousToken is not lastToken): + elif token.PreviousToken is not lastToken: print("{RED}EndOfDocumentToken is not connected to lastToken.{NOCOLOR}".format(**self.Foreground)) print("{RED} Curr: {token}{NOCOLOR}".format(token=token, **self.Foreground)) print("{RED} Prev: {token}{NOCOLOR}".format(token=token.PreviousToken, **self.Foreground)) diff --git a/pyVHDLParser/CLI/VHDLParser.py b/pyVHDLParser/CLI/VHDLParser.py index db4f4ee69..ed9c0a84d 100644 --- a/pyVHDLParser/CLI/VHDLParser.py +++ b/pyVHDLParser/CLI/VHDLParser.py @@ -53,9 +53,9 @@ def printImportError(ex) -> NoReturn: platform = platform_system() print("IMPORT ERROR: One or more Python packages are not available in your environment.") print("Missing package: '{0}'\n".format(ex.name)) - if (platform == "Windows"): + if platform == "Windows": print("Run: 'py.exe -3 -m pip install -r requirements.txt'\n") - elif (platform == "Linux"): + elif platform == "Linux": print("Run: 'python3 -m pip install -r requirements.txt'\n") exit(1) @@ -155,9 +155,9 @@ def HandleDefault(self, _): def HandleHelp(self, args): self.PrintHeadline() - if (args.Command is None): + if args.Command is None: self.MainParser.print_help() - elif (args.Command == "help"): + elif args.Command == "help": self.WriteError("This is a recursion ...") else: try: @@ -219,10 +219,10 @@ def main(): # mccabe:disable=MC0001 # elif isinstance(cause, ParserException): # print("{YELLOW} ParserException:{NOCOLOR} {cause}".format(cause=str(cause), **Init.Foreground)) # cause = cause.__cause__ - # if (cause is not None): + # if cause is not None: # print("{YELLOW} {name}:{NOCOLOR} {cause}".format(name=cause.__class__.__name__, cause= str(cause), **Init.Foreground)) # - # if (not (verbose or debug)): + # if not (verbose or debug): # print() # print("{CYAN} Use '-v' for verbose or '-d' for debug to print out extended messages.{NOCOLOR}".format(**Init.Foreground)) # LineTerminal.exit(1) diff --git a/pyVHDLParser/Common/Common.py b/pyVHDLParser/Common/Common.py index 0cce0802f..8d2dadc49 100644 --- a/pyVHDLParser/Common/Common.py +++ b/pyVHDLParser/Common/Common.py @@ -62,12 +62,12 @@ class VHDLVersion(Enum): def __init__(self, *_): """Patch the embedded MAP dictionary""" for k, v in self.__class__.__VHDL_VERSION_MAPPINGS__.items(): - if ((not isinstance(v, self.__class__)) and (v == self.value)): + if (not isinstance(v, self.__class__)) and (v == self.value): self.__class__.__VHDL_VERSION_MAPPINGS__[k] = self def __eq__(self, other: 'VHDLVersion') -> bool: """Return true if the internal value is equal to the second operand.""" - if ((self is VHDLVersion.Any) or (other is VHDLVersion.Any)): + if (self is VHDLVersion.Any) or (other is VHDLVersion.Any): return True else: return (self.value == other.value) diff --git a/pyVHDLParser/DocumentModel/DesignUnit/Context.py b/pyVHDLParser/DocumentModel/DesignUnit/Context.py index 8535a0271..6cab0e52c 100644 --- a/pyVHDLParser/DocumentModel/DesignUnit/Context.py +++ b/pyVHDLParser/DocumentModel/DesignUnit/Context.py @@ -57,9 +57,9 @@ def stateParse(cls, document, group): else: raise BlockParserException("ContextName not found.", None) # FIXME: change to DOMParserException - if (len(document.Libraries) != 0): + if len(document.Libraries) != 0: raise BlockParserException("A context (library statements) is not allowed for a context declaration.", None) # FIXME: change to DOMParserException - if (len(document.PackageReferences) != 0): + if len(document.PackageReferences) != 0: raise BlockParserException("A context (use statements) is not allowed for a context declaration.", None) # FIXME: change to DOMParserException context = cls(contextName) @@ -162,12 +162,12 @@ def Print(self, indent=0): print("{indent}{DARK_CYAN}USE {GREEN}{lib}{NOCOLOR}.{GREEN}{pack}{NOCOLOR}.{GREEN}{obj}{NOCOLOR};".format(indent=indentation, lib=lib, pack=pack, obj=obj, **Console.Foreground)) print() print("{indent}{DARK_CYAN}ENTITY{NOCOLOR} {YELLOW}{name}{NOCOLOR} {DARK_CYAN}IS{NOCOLOR}".format(name=self._name, indent=indentation, **Console.Foreground)) - if (len(self._genericItems) > 0): + if len(self._genericItems) > 0: print("{indent} {DARK_CYAN}GENERIC{NOCOLOR} (".format(indent=indentation, **Console.Foreground)) for generic in self._genericItems: print("{indent} {YELLOW}{name}{NOCOLOR} : {GREEN}{type}{NOCOLOR}".format(indent=indentation, name=generic, type="", **Console.Foreground)) print("{indent} );".format(indent=indentation, **Console.Foreground)) - if (len(self._portItems) > 0): + if len(self._portItems) > 0: print("{indent} {DARK_CYAN}PORT{NOCOLOR} (".format(indent=indentation, **Console.Foreground)) for port in self._portItems: print("{indent} {YELLOW}{name}{NOCOLOR} : {GREEN}{type}{NOCOLOR}".format(indent=indentation, name=port, type="", **Console.Foreground)) diff --git a/pyVHDLParser/DocumentModel/DesignUnit/Entity.py b/pyVHDLParser/DocumentModel/DesignUnit/Entity.py index 9fc547f4c..34ed1f615 100644 --- a/pyVHDLParser/DocumentModel/DesignUnit/Entity.py +++ b/pyVHDLParser/DocumentModel/DesignUnit/Entity.py @@ -173,12 +173,12 @@ def Print(self, indent=0): print("{indent}{DARK_CYAN}USE {GREEN}{lib}{NOCOLOR}.{GREEN}{pack}{NOCOLOR}.{GREEN}{obj}{NOCOLOR};".format(indent=indentation, lib=lib, pack=pack, obj=obj, **Console.Foreground)) print() print("{indent}{DARK_CYAN}ENTITY{NOCOLOR} {YELLOW}{name}{NOCOLOR} {DARK_CYAN}IS{NOCOLOR}".format(name=self._name, indent=indentation, **Console.Foreground)) - if (len(self._genericItems) > 0): + if len(self._genericItems) > 0: print("{indent} {DARK_CYAN}GENERIC{NOCOLOR} (".format(indent=indentation, **Console.Foreground)) for generic in self._genericItems: print("{indent} {YELLOW}{name}{NOCOLOR} : {GREEN}{type}{NOCOLOR}".format(indent=indentation, name=generic, type="", **Console.Foreground)) print("{indent} );".format(indent=indentation, **Console.Foreground)) - if (len(self._portItems) > 0): + if len(self._portItems) > 0: print("{indent} {DARK_CYAN}PORT{NOCOLOR} (".format(indent=indentation, **Console.Foreground)) for port in self._portItems: print("{indent} {YELLOW}{name}{NOCOLOR} : {GREEN}{type}{NOCOLOR}".format(indent=indentation, name=port, type="", **Console.Foreground)) diff --git a/pyVHDLParser/DocumentModel/DesignUnit/Package.py b/pyVHDLParser/DocumentModel/DesignUnit/Package.py index 1891b3df6..ab09283f5 100644 --- a/pyVHDLParser/DocumentModel/DesignUnit/Package.py +++ b/pyVHDLParser/DocumentModel/DesignUnit/Package.py @@ -128,13 +128,13 @@ def stateParseGeneric(cls, parserState: ParserState): #document, group): parserState.CurrentNode.AddGeneric(genericName) def AddLibraryReferences(self, libraries : List[LibraryClause]): - if ((DEBUG is True) and (len(libraries) > 0)): print("{DARK_CYAN}Adding libraries to package {GREEN}{0}{NOCOLOR}:".format(self._name, **Console.Foreground)) + if (DEBUG is True) and (len(libraries) > 0): print("{DARK_CYAN}Adding libraries to package {GREEN}{0}{NOCOLOR}:".format(self._name, **Console.Foreground)) for library in libraries: if DEBUG: print(" {GREEN}{0!s}{NOCOLOR}".format(library, **Console.Foreground)) self._libraryReferences.append(library._library) def AddUses(self, uses : List[PackageReference]): - if ((DEBUG is True) and (len(uses) > 0)): print("{DARK_CYAN}Adding uses to package {GREEN}{0}{NOCOLOR}:".format(self._name, **Console.Foreground)) + if (DEBUG is True) and (len(uses) > 0): print("{DARK_CYAN}Adding uses to package {GREEN}{0}{NOCOLOR}:".format(self._name, **Console.Foreground)) for use in uses: if DEBUG: print(" {GREEN}{0!s}{NOCOLOR}".format(use, **Console.Foreground)) self._packageReferences.append(use) @@ -163,12 +163,12 @@ def Print(self, indent=0): print("{indent}{DARK_CYAN}USE {GREEN}{lib}{NOCOLOR}.{GREEN}{pack}{NOCOLOR}.{GREEN}{item}{NOCOLOR};".format(indent=indentation, lib=use._library, pack=use._package, item=use._item, **Console.Foreground)) print() print("{indent}{DARK_CYAN}PACKAGE{NOCOLOR} {YELLOW}{name}{NOCOLOR} {DARK_CYAN}IS{NOCOLOR}".format(indent=indentation, name=self._name, **Console.Foreground)) - if (len(self._genericItems) > 0): + if len(self._genericItems) > 0: print("{indent} {DARK_CYAN}GENERIC{NOCOLOR} (".format(indent=indentation, **Console.Foreground)) for generic in self._genericItems: print("{indent} {YELLOW}{name}{NOCOLOR} : {GREEN}{type}{NOCOLOR}".format(indent=indentation, name=generic, type="", **Console.Foreground)) print("{indent} );".format(indent=indentation)) - if (len(self._declaredItems) > 0): + if len(self._declaredItems) > 0: for item in self._declaredItems: item.Print(indent+1) print("{indent}{DARK_CYAN}END PACKAGE{NOCOLOR};".format(indent=indentation, name=self._name, **Console.Foreground)) diff --git a/pyVHDLParser/DocumentModel/DesignUnit/PackageBody.py b/pyVHDLParser/DocumentModel/DesignUnit/PackageBody.py index 01183f94e..60ae9c5c1 100644 --- a/pyVHDLParser/DocumentModel/DesignUnit/PackageBody.py +++ b/pyVHDLParser/DocumentModel/DesignUnit/PackageBody.py @@ -161,13 +161,13 @@ def stateParsePort(cls, parserState: ParserState): #document, group): parserState.CurrentNode.AddPort(portName) def AddLibraries(self, libraries: List[LibraryClause]): - if ((DEBUG is True) and (len(libraries) > 0)): print("{DARK_CYAN}Adding libraries to package body {GREEN}{0}{NOCOLOR}:".format(self._name, **Console.Foreground)) + if (DEBUG is True) and (len(libraries) > 0): print("{DARK_CYAN}Adding libraries to package body {GREEN}{0}{NOCOLOR}:".format(self._name, **Console.Foreground)) for library in libraries: if DEBUG: print(" {GREEN}{0!s}{NOCOLOR}".format(library, **Console.Foreground)) self._libraries.append(library._library) def AddUses(self, uses: List[PackageReference]): - if ((DEBUG is True) and (len(uses) > 0)): print("{DARK_CYAN}Adding uses to package body {GREEN}{0}{NOCOLOR}:".format(self._name, **Console.Foreground)) + if (DEBUG is True) and (len(uses) > 0): print("{DARK_CYAN}Adding uses to package body {GREEN}{0}{NOCOLOR}:".format(self._name, **Console.Foreground)) for use in uses: if DEBUG: print(" {GREEN}{0!s}{NOCOLOR}".format(use, **Console.Foreground)) self._packageReferences.append(use) @@ -184,7 +184,7 @@ def Print(self, indent=0): print("{indent}{DARK_CYAN}USE {GREEN}{lib}{NOCOLOR}.{GREEN}{pack}{NOCOLOR}.{GREEN}{obj}{NOCOLOR};".format(indent=indentation, lib=lib, pack=pack, obj=obj, **Console.Foreground)) print() print("{indent}{DARK_CYAN}PACKAGE BODY{NOCOLOR} {GREEN}{name}{NOCOLOR} {DARK_CYAN}IS{NOCOLOR}".format(indent=indentation, name=self._name, **Console.Foreground)) - if (len(self._declaredItems) > 0): + if len(self._declaredItems) > 0: for item in self._declaredItems: item.Print(indent+1) print("{indent}{DARK_CYAN}END PACKAGE BODY{NOCOLOR};".format(indent=indentation, name=self._name, **Console.Foreground)) diff --git a/pyVHDLParser/DocumentModel/Sequential/Function.py b/pyVHDLParser/DocumentModel/Sequential/Function.py index 12f285416..353a5db8a 100644 --- a/pyVHDLParser/DocumentModel/Sequential/Function.py +++ b/pyVHDLParser/DocumentModel/Sequential/Function.py @@ -120,13 +120,13 @@ def stateParseGeneric(cls, parserState: ParserState): parserState.CurrentNode.AddGeneric(genericName) def AddLibraries(self, libraries: List[LibraryClause]): - if ((DEBUG is True) and (len(libraries) > 0)): print("{DARK_CYAN}Adding libraries to function {GREEN}{0}{NOCOLOR}:".format(self._name, **LineTerminal().Foreground)) + if (DEBUG is True) and (len(libraries) > 0): print("{DARK_CYAN}Adding libraries to function {GREEN}{0}{NOCOLOR}:".format(self._name, **LineTerminal().Foreground)) for library in libraries: if DEBUG: print(" {GREEN}{0!s}{NOCOLOR}".format(library, **LineTerminal().Foreground)) self._libraries.append(library._library) def AddUses(self, uses: List[PackageReference]): - if ((DEBUG is True) and (len(uses) > 0)): print("{DARK_CYAN}Adding uses to function {GREEN}{0}{NOCOLOR}:".format(self._name, **LineTerminal().Foreground)) + if (DEBUG is True) and (len(uses) > 0): print("{DARK_CYAN}Adding uses to function {GREEN}{0}{NOCOLOR}:".format(self._name, **LineTerminal().Foreground)) for use in uses: if DEBUG: print(" {GREEN}{0!s}{NOCOLOR}".format(use, **LineTerminal().Foreground)) self._uses.append(use) @@ -147,12 +147,12 @@ def Print(self, indent=0): print("{indent}{DARK_CYAN}USE {GREEN}{lib}{NOCOLOR}.{GREEN}{pack}{NOCOLOR}.{GREEN}{item}{NOCOLOR};".format(indent=indentation, lib=use._configuration, pack=use._function, item=use._item, **LineTerminal().Foreground)) print() print("{indent}{DARK_CYAN}FUNCTION{NOCOLOR} {YELLOW}{name}{NOCOLOR} {DARK_CYAN}IS{NOCOLOR}".format(indent=indentation, name=self._name, **LineTerminal().Foreground)) - if (len(self._genericItems) > 0): + if len(self._genericItems) > 0: print("{indent} {DARK_CYAN}GENERIC{NOCOLOR} (".format(indent=indentation, **LineTerminal().Foreground)) for generic in self._genericItems: print("{indent} {YELLOW}{name}{NOCOLOR} : {GREEN}{type}{NOCOLOR}".format(indent=indentation, name=generic, type="", **LineTerminal().Foreground)) print("{indent} );".format(indent=indentation)) - if (len(self._declaredItems) > 0): + if len(self._declaredItems) > 0: for item in self._declaredItems: item.Print(indent+1) print("{indent}{DARK_CYAN}END FUNCTION{NOCOLOR};".format(indent=indentation, name=self._name, **LineTerminal().Foreground)) diff --git a/pyVHDLParser/DocumentModel/__init__.py b/pyVHDLParser/DocumentModel/__init__.py index 0eda2f499..d4ded4300 100644 --- a/pyVHDLParser/DocumentModel/__init__.py +++ b/pyVHDLParser/DocumentModel/__init__.py @@ -69,8 +69,8 @@ def __init__(self, file: Union[Path, str]): # FIXME: parameter type self.__uses = [] def Parse(self, content=None): # FIXME: parameter type - if (content is None): - if (not self._path.exists()): + if content is None: + if not self._path.exists(): raise DOMParserException("File '{0!s}' does not exist.".format(self._path))\ from FileNotFoundError(str(self._path)) @@ -94,9 +94,9 @@ def Parse(self, content=None): # FIXME: parameter type firstGroup = groups[0] lastGroup = groups[-1] - if (not isinstance(firstGroup, StartOfDocumentGroup)): + if not isinstance(firstGroup, StartOfDocumentGroup): raise DOMParserException("Expected group is not a StartOfDocumentGroup.", firstGroup) - elif (not isinstance(lastGroup, EndOfDocumentGroup)): + elif not isinstance(lastGroup, EndOfDocumentGroup): raise DOMParserException("Expected group is not an EndOfDocumentGroup.", lastGroup) # run recursively (node, group) @@ -162,10 +162,10 @@ def AddPackageBody(self, packageBody): # FIXME: parameter type def Print(self, indent: int=0): _indent = " " * indent - if (len(self.__libraries) > 0): + if len(self.__libraries) > 0: for library in self.__libraries: print("{indent}-- unused LIBRARY {lib};".format(indent=_indent, lib=library)) - if (len(self.__uses) > 0): + if len(self.__uses) > 0: for use in self.__uses: print("{indent}-- unused USE {lib}.{pack}.{obj};".format(indent=_indent, lib=use.Library, pack=use.Package, obj=use.Item)) print() diff --git a/pyVHDLParser/Filters/Comment.py b/pyVHDLParser/Filters/Comment.py index 13de076f7..73334165a 100644 --- a/pyVHDLParser/Filters/Comment.py +++ b/pyVHDLParser/Filters/Comment.py @@ -46,17 +46,17 @@ def StripAndFuse(generator: Generator[Block, Any, None]) -> Generator[Block, Any if isinstance(block, (IndentationBlock, CommentBlock, LinebreakBlock)): continue else: - if (block.MultiPart == True): + if block.MultiPart == True: while True: nextBlock = next(iterator) if isinstance(nextBlock, (WhitespaceBlock, CommentBlock)): continue - if (type(block) is not type(nextBlock)): + if type(block) is not type(nextBlock): raise BlockParserException("Error in multipart blocks. {0} <-> {1}".format(type(block), type(nextBlock)), None) # TODO: review exception type nextBlock.StartToken.PreviousToken = block.EndToken block.EndToken = nextBlock.EndToken - if (nextBlock.MultiPart == False): + if nextBlock.MultiPart == False: break block.PreviousBlock = lastBlock diff --git a/pyVHDLParser/Graph/Graph.py b/pyVHDLParser/Graph/Graph.py index 535b5aa76..78885814a 100644 --- a/pyVHDLParser/Graph/Graph.py +++ b/pyVHDLParser/Graph/Graph.py @@ -61,21 +61,21 @@ def AddNode(self, node): self._nodes.append(node) def __colorize(self, node): - if (node.Color is NodeColors.Black): + if node.Color is NodeColors.Black: node.Color = NodeColors.Gray for edge in node._edges: edge.EdgeKind = self.__colorize(edge.End) - if (edge.EdgeKind is EdgeKinds.Forward): + if edge.EdgeKind is EdgeKinds.Forward: self._forwardEdges.append(edge) - elif (edge.EdgeKind is EdgeKinds.Backward): + elif edge.EdgeKind is EdgeKinds.Backward: self._backwardEdges.append(edge) - elif (edge.EdgeKind is EdgeKinds.Sideward): + elif edge.EdgeKind is EdgeKinds.Sideward: self._sidewardEdges.append(edge) return EdgeKinds.Forward - elif (node.Color is NodeColors.Gray): + elif node.Color is NodeColors.Gray: return EdgeKinds.Backward - elif (node.Color is NodeColors.White): + elif node.Color is NodeColors.White: return EdgeKinds.Sideward def Colorize(self): @@ -89,15 +89,15 @@ def GetTopologicalOrder(self): for node in self._nodes: node.Weight = len(node._incomingEdges) - if (node.Weight > 0): + if node.Weight > 0: workList.append(node) - while (len(workList) > 0): + while len(workList) > 0: node = workList.pop() for edge in node._outgoingEdges: end = edge.End end.Weight -= 1 - if (end.Weight == 0): + if end.Weight == 0: workList.append(end) resultList.append(node) diff --git a/pyVHDLParser/Groups/Comment.py b/pyVHDLParser/Groups/Comment.py index ca5c0dd23..9da74a8af 100644 --- a/pyVHDLParser/Groups/Comment.py +++ b/pyVHDLParser/Groups/Comment.py @@ -39,7 +39,7 @@ class CommentGroup(Group): @classmethod def stateParse(cls, parserState: ParserState): for block in parserState.GetBlockIterator: - if (not isinstance(block, CommentBlock)): + if not isinstance(block, CommentBlock): parserState.NextGroup = cls(parserState.LastGroup, parserState.BlockMarker, block) parserState.Pop() parserState.ReIssue = True @@ -53,7 +53,7 @@ class WhitespaceGroup(Group): @classmethod def stateParse(cls, parserState: ParserState): for block in parserState.GetBlockIterator: - if (not isinstance(block, (WhitespaceBlock, LinebreakBlock, IndentationBlock))): + if not isinstance(block, (WhitespaceBlock, LinebreakBlock, IndentationBlock)): parserState.NextGroup = cls(parserState.LastGroup, parserState.BlockMarker, block.PreviousBlock) parserState.Pop() parserState.ReIssue = True diff --git a/pyVHDLParser/Groups/Concurrent.py b/pyVHDLParser/Groups/Concurrent.py index e61a7dbb9..ea2eb8ec7 100644 --- a/pyVHDLParser/Groups/Concurrent.py +++ b/pyVHDLParser/Groups/Concurrent.py @@ -41,7 +41,7 @@ def stateParse(cls, parserState: ParserState): marker = parserState.Block if parserState.Block.MultiPart: for block in parserState.GetBlockIterator: - if (isinstance(block, AssertBlock) and not block.MultiPart): + if isinstance(block, AssertBlock) and not block.MultiPart: marker2 = block break else: @@ -61,7 +61,7 @@ def stateParse(cls, parserState: ParserState): marker = parserState.Block if parserState.Block.MultiPart: for block in parserState.GetBlockIterator: - if (isinstance(block, ReportBlock) and not block.MultiPart): + if isinstance(block, ReportBlock) and not block.MultiPart: marker2 = block break else: diff --git a/pyVHDLParser/Groups/Object.py b/pyVHDLParser/Groups/Object.py index 61a837ff9..1a4ff29dd 100644 --- a/pyVHDLParser/Groups/Object.py +++ b/pyVHDLParser/Groups/Object.py @@ -44,7 +44,7 @@ def stateParse(cls, parserState: ParserState): marker = parserState.Block if parserState.Block.MultiPart: for block in parserState.GetBlockIterator: - if (isinstance(block, ConstantDeclarationBlock) and not block.MultiPart): + if isinstance(block, ConstantDeclarationBlock) and not block.MultiPart: marker2 = block break else: @@ -64,7 +64,7 @@ def stateParse(cls, parserState: ParserState): marker = parserState.Block if parserState.Block.MultiPart: for block in parserState.GetBlockIterator: - if (isinstance(block, VariableDeclarationBlock) and not block.MultiPart): + if isinstance(block, VariableDeclarationBlock) and not block.MultiPart: marker2 = block break else: @@ -84,7 +84,7 @@ def stateParse(cls, parserState: ParserState): marker = parserState.Block if parserState.Block.MultiPart: for block in parserState.GetBlockIterator: - if (isinstance(block, SignalDeclarationBlock) and not block.MultiPart): + if isinstance(block, SignalDeclarationBlock) and not block.MultiPart: marker2 = block break else: diff --git a/pyVHDLParser/Groups/__init__.py b/pyVHDLParser/Groups/__init__.py index 8349a19a6..fb9b8e025 100644 --- a/pyVHDLParser/Groups/__init__.py +++ b/pyVHDLParser/Groups/__init__.py @@ -105,7 +105,7 @@ def __init__(self, blockGenerator: Generator[Block, Any, None]): startBlock = next(self._iterator) startGroup = StartOfDocumentGroup(startBlock) - if (not isinstance(startBlock, StartOfDocumentBlock)): + if not isinstance(startBlock, StartOfDocumentBlock): raise GroupParserException("First block is not a StartOfDocumentBlock.", startBlock) self.Block = None @@ -147,7 +147,7 @@ def GetBlockIterator(self): # FIXME: what return type? @property def BlockMarker(self) -> 'Block': - if ((self.NewBlock is not None) and (self._blockMarker is self.Block)): + if (self.NewBlock is not None) and (self._blockMarker is self.Block): # if self.debug: print(" {DARK_GREEN}@BlockMarker: {0!s} => {GREEN}{1!s}{NOCOLOR}".format(self._blockMarker, self.NewBlock, **Console.Foreground)) self._blockMarker = self.NewBlock return self._blockMarker @@ -173,9 +173,9 @@ def Pop(self, n: int=1): self._blockMarker = top[1] self.NextGroup = top[2] # print("{MAGENTA}appending {0!s} to {1!s}{NOCOLOR}".format(self.NewGroup.__class__.__qualname__, self.NextGroup.__class__,**Console.Foreground)) - if (self.NextGroup.InnerGroup is None): + if self.NextGroup.InnerGroup is None: self.NextGroup.InnerGroup = self.NewGroup - if (self.NewGroup.__class__ not in self.NextGroup._subGroups): + if self.NewGroup.__class__ not in self.NextGroup._subGroups: raise GroupParserException("Group '{group1}' not supported in {group2}.".format( group1=self.NewGroup.__class__, group2=self.NextGroup.__class__.__qualname__ @@ -192,7 +192,7 @@ def GetGenerator(self): # XXX: return type for block in self._iterator: # an empty marker means: set on next yield run - if (self._blockMarker is None): + if self._blockMarker is None: # if self.debug: print(" new block marker: None -> {0!s}".format(block)) self._blockMarker = block @@ -205,12 +205,12 @@ def GetGenerator(self): # XXX: return type self.NextState(self) # yield a new group - if (self.NewGroup is not None): + if self.NewGroup is not None: yield self.NewGroup self.LastGroup = self.NewGroup self.NewGroup = None - if (isinstance(self.Block, EndOfDocumentBlock) and isinstance(self.LastGroup, EndOfDocumentGroup)): + if isinstance(self.Block, EndOfDocumentBlock) and isinstance(self.LastGroup, EndOfDocumentGroup): return else: @@ -223,7 +223,7 @@ class MetaGroup(type): def __new__(cls, className, baseClasses, classMembers: dict): states = [] for memberName, memberObject in classMembers.items(): - if (isinstance(memberObject, FunctionType) and (memberName[:5] == "state")): + if isinstance(memberObject, FunctionType) and (memberName[:5] == "state"): states.append(memberObject) classMembers['__STATES__'] = states @@ -260,9 +260,9 @@ def __len__(self) -> int: def __iter__(self): # XXX: return type; iterator vs. generator block = self.StartBlock print("group={0}({1}) start={2!s} end={3!s}".format(self.__class__.__name__, self.__class__.__module__, self.StartBlock.StartToken, self.EndBlock.EndToken)) - while (block is not self.EndBlock): + while block is not self.EndBlock: yield block - if (block.NextBlock is None): + if block.NextBlock is None: raise GroupParserException("Token after {0!r} <- {1!r} <- {2!r} is empty (None).".format(block, block.PreviousToken, block.PreviousToken.PreviousToken), block) block = block.NextBlock @@ -286,7 +286,7 @@ def __str__(self) -> str: def GetSubGroups(self, groupTypes=None): # XXX: return type group = self.InnerGroup - while (group is not None): + while group is not None: yield group group = group.NextGroup diff --git a/pyVHDLParser/SimulationModel/SimulationModel.py b/pyVHDLParser/SimulationModel/SimulationModel.py index 815843fe7..91bd10b00 100644 --- a/pyVHDLParser/SimulationModel/SimulationModel.py +++ b/pyVHDLParser/SimulationModel/SimulationModel.py @@ -104,7 +104,7 @@ def __init__(self, path, subType, initializer=None): self.Simulator = None def Initialize(self): - if (self._initializer is not None): + if self._initializer is not None: result = self._initializer() else: result = self._subType.Attributes.Low() diff --git a/pyVHDLParser/Token/Keywords.py b/pyVHDLParser/Token/Keywords.py index 2c13ec5e8..efdc70e2b 100644 --- a/pyVHDLParser/Token/Keywords.py +++ b/pyVHDLParser/Token/Keywords.py @@ -411,7 +411,7 @@ def __init__(self, previousToken: Token = None, value: str = None, start: Source super().__init__(previousToken, value, str, end) else: - if (not (isinstance(fromExistingToken, WordToken) and (fromExistingToken <= self.__KEYWORD__))): + if not (isinstance(fromExistingToken, WordToken) and (fromExistingToken <= self.__KEYWORD__)): raise TokenizerException("Expected keyword {0}.".format(self.__KEYWORD__.upper()), fromExistingToken) super().__init__(fromExistingToken.PreviousToken, self.__KEYWORD__, fromExistingToken.Start, fromExistingToken.End) diff --git a/pyVHDLParser/Token/Parser.py b/pyVHDLParser/Token/Parser.py index cba5305af..5126d1b70 100644 --- a/pyVHDLParser/Token/Parser.py +++ b/pyVHDLParser/Token/Parser.py @@ -97,8 +97,8 @@ def GetVHDLTokenizer(cls, iterable: Iterator[str]): column += 1 # State: SpaceChars - if (tokenKind is cls.TokenKind.SpaceChars): - if (char in __WHITESPACE_CHARACTERS__): + if tokenKind is cls.TokenKind.SpaceChars: + if char in __WHITESPACE_CHARACTERS__: buffer += char else: end = SourceCodePosition(row, column - 1, absolute - 1) @@ -110,22 +110,22 @@ def GetVHDLTokenizer(cls, iterable: Iterator[str]): start = SourceCodePosition(row, column, absolute) buffer = char - if (char in __NUMBER_CHARACTERS__): tokenKind = cls.TokenKind.IntegerChars - elif (char in __ALPHA_CHARACTERS__): tokenKind = cls.TokenKind.AlphaChars - elif (char == "'"): tokenKind = cls.TokenKind.PossibleCharacterLiteral - elif (char == "\""): tokenKind = cls.TokenKind.PossibleStringLiteralStart - elif (char == "-"): tokenKind = cls.TokenKind.PossibleSingleLineCommentStart - elif (char == "\r"): tokenKind = cls.TokenKind.PossibleLinebreak - elif (char == "\n"): + if char in __NUMBER_CHARACTERS__: tokenKind = cls.TokenKind.IntegerChars + elif char in __ALPHA_CHARACTERS__: tokenKind = cls.TokenKind.AlphaChars + elif char == "'": tokenKind = cls.TokenKind.PossibleCharacterLiteral + elif char == "\"": tokenKind = cls.TokenKind.PossibleStringLiteralStart + elif char == "-": tokenKind = cls.TokenKind.PossibleSingleLineCommentStart + elif char == "\r": tokenKind = cls.TokenKind.PossibleLinebreak + elif char == "\n": previousToken = LinebreakToken(previousToken, char, start, start) yield previousToken tokenKind = cls.TokenKind.OtherChars - elif (char in __FUSEABLE_CHARS__): + elif char in __FUSEABLE_CHARS__: buffer = char tokenKind = cls.TokenKind.FuseableCharacter - elif (char == "."): tokenKind = cls.TokenKind.PossibleRealLiteral - elif (char == "\\"): tokenKind = cls.TokenKind.PossibleExtendedIdentifierStart - elif ((char == "`") and isinstance(previousToken, (SpaceToken, LinebreakToken))): + elif char == ".": tokenKind = cls.TokenKind.PossibleRealLiteral + elif char == "\\": tokenKind = cls.TokenKind.PossibleExtendedIdentifierStart + elif (char == "`") and isinstance(previousToken, (SpaceToken, LinebreakToken)): tokenKind = cls.TokenKind.Directive else: previousToken = CharacterToken(previousToken, char, start) @@ -133,10 +133,10 @@ def GetVHDLTokenizer(cls, iterable: Iterator[str]): tokenKind = cls.TokenKind.OtherChars # State: IntegerChars - elif (tokenKind is cls.TokenKind.IntegerChars): - if ((char in __NUMBER_CHARACTERS__) or (char == "_")): + elif tokenKind is cls.TokenKind.IntegerChars: + if (char in __NUMBER_CHARACTERS__) or (char == "_"): buffer += char - elif (char == "."): + elif char == ".": buffer += char tokenKind = cls.TokenKind.RealChars else: @@ -145,21 +145,21 @@ def GetVHDLTokenizer(cls, iterable: Iterator[str]): start = SourceCodePosition(row, column, absolute) buffer = char - if (char in __WHITESPACE_CHARACTERS__): tokenKind = cls.TokenKind.SpaceChars - elif (char in __ALPHA_CHARACTERS__): tokenKind = cls.TokenKind.AlphaChars - elif (char == "'"): tokenKind = cls.TokenKind.PossibleCharacterLiteral - elif (char == "\""): tokenKind = cls.TokenKind.PossibleStringLiteralStart - elif (char == "-"): tokenKind = cls.TokenKind.PossibleSingleLineCommentStart - elif (char == "\r"): tokenKind = cls.TokenKind.PossibleLinebreak - elif (char == "\n"): + if char in __WHITESPACE_CHARACTERS__: tokenKind = cls.TokenKind.SpaceChars + elif char in __ALPHA_CHARACTERS__: tokenKind = cls.TokenKind.AlphaChars + elif char == "'": tokenKind = cls.TokenKind.PossibleCharacterLiteral + elif char == "\"": tokenKind = cls.TokenKind.PossibleStringLiteralStart + elif char == "-": tokenKind = cls.TokenKind.PossibleSingleLineCommentStart + elif char == "\r": tokenKind = cls.TokenKind.PossibleLinebreak + elif char == "\n": previousToken = LinebreakToken(previousToken, char, start, start) yield previousToken tokenKind = cls.TokenKind.OtherChars - elif (char in __FUSEABLE_CHARS__): + elif char in __FUSEABLE_CHARS__: buffer = char tokenKind = cls.TokenKind.FuseableCharacter - elif (char == "\\"): tokenKind = cls.TokenKind.PossibleExtendedIdentifierStart - elif ((char == "`") and isinstance(previousToken, (SpaceToken, LinebreakToken))): + elif char == "\\": tokenKind = cls.TokenKind.PossibleExtendedIdentifierStart + elif (char == "`") and isinstance(previousToken, (SpaceToken, LinebreakToken)): tokenKind = cls.TokenKind.Directive else: previousToken = CharacterToken(previousToken, char, start) @@ -167,8 +167,8 @@ def GetVHDLTokenizer(cls, iterable: Iterator[str]): tokenKind = cls.TokenKind.OtherChars # State: RealChars - elif (tokenKind is cls.TokenKind.RealChars): - if ((char in __NUMBER_CHARACTERS__) or (char == "_")): + elif tokenKind is cls.TokenKind.RealChars: + if (char in __NUMBER_CHARACTERS__) or (char == "_"): buffer += char else: previousToken = RealLiteralToken(previousToken, buffer, start, SourceCodePosition(row, column, absolute)) @@ -176,21 +176,21 @@ def GetVHDLTokenizer(cls, iterable: Iterator[str]): start = SourceCodePosition(row, column, absolute) buffer = char - if (char in __WHITESPACE_CHARACTERS__): tokenKind = cls.TokenKind.SpaceChars - elif (char in __ALPHA_CHARACTERS__): tokenKind = cls.TokenKind.AlphaChars - elif (char == "'"): tokenKind = cls.TokenKind.PossibleCharacterLiteral - elif (char == "\""): tokenKind = cls.TokenKind.PossibleStringLiteralStart - elif (char == "-"): tokenKind = cls.TokenKind.PossibleSingleLineCommentStart - elif (char == "\r"): tokenKind = cls.TokenKind.PossibleLinebreak - elif (char == "\n"): + if char in __WHITESPACE_CHARACTERS__: tokenKind = cls.TokenKind.SpaceChars + elif char in __ALPHA_CHARACTERS__: tokenKind = cls.TokenKind.AlphaChars + elif char == "'": tokenKind = cls.TokenKind.PossibleCharacterLiteral + elif char == "\"": tokenKind = cls.TokenKind.PossibleStringLiteralStart + elif char == "-": tokenKind = cls.TokenKind.PossibleSingleLineCommentStart + elif char == "\r": tokenKind = cls.TokenKind.PossibleLinebreak + elif char == "\n": previousToken = LinebreakToken(previousToken, char, start, start) yield previousToken tokenKind = cls.TokenKind.OtherChars - elif (char in __FUSEABLE_CHARS__): + elif char in __FUSEABLE_CHARS__: buffer = char tokenKind = cls.TokenKind.FuseableCharacter - elif (char == "\\"): tokenKind = cls.TokenKind.PossibleExtendedIdentifierStart - elif ((char == "`") and isinstance(previousToken, (SpaceToken, LinebreakToken))): + elif char == "\\": tokenKind = cls.TokenKind.PossibleExtendedIdentifierStart + elif (char == "`") and isinstance(previousToken, (SpaceToken, LinebreakToken)): tokenKind = cls.TokenKind.Directive else: previousToken = CharacterToken(previousToken, char, start) @@ -198,8 +198,8 @@ def GetVHDLTokenizer(cls, iterable: Iterator[str]): tokenKind = cls.TokenKind.OtherChars # State: AlphaChars - elif (tokenKind is cls.TokenKind.AlphaChars): - if ((char in __ALPHA_CHARACTERS__) or (char == "_")): + elif tokenKind is cls.TokenKind.AlphaChars: + if (char in __ALPHA_CHARACTERS__) or (char == "_"): buffer += char else: previousToken = WordToken(previousToken, buffer, start, SourceCodePosition(row, column, absolute)) @@ -207,20 +207,20 @@ def GetVHDLTokenizer(cls, iterable: Iterator[str]): start = SourceCodePosition(row, column, absolute) buffer = char - if (char in __WHITESPACE_CHARACTERS__): tokenKind = cls.TokenKind.SpaceChars - elif (char == "'"): tokenKind = cls.TokenKind.PossibleCharacterLiteral - elif (char == "\""): tokenKind = cls.TokenKind.PossibleStringLiteralStart - elif (char == "-"): tokenKind = cls.TokenKind.PossibleSingleLineCommentStart - elif (char == "\r"): tokenKind = cls.TokenKind.PossibleLinebreak - elif (char == "\n"): + if char in __WHITESPACE_CHARACTERS__: tokenKind = cls.TokenKind.SpaceChars + elif char == "'": tokenKind = cls.TokenKind.PossibleCharacterLiteral + elif char == "\"": tokenKind = cls.TokenKind.PossibleStringLiteralStart + elif char == "-": tokenKind = cls.TokenKind.PossibleSingleLineCommentStart + elif char == "\r": tokenKind = cls.TokenKind.PossibleLinebreak + elif char == "\n": previousToken = LinebreakToken(previousToken, char, start, start) yield previousToken tokenKind = cls.TokenKind.OtherChars - elif (char in __FUSEABLE_CHARS__): + elif char in __FUSEABLE_CHARS__: buffer = char tokenKind = cls.TokenKind.FuseableCharacter - elif (char == "\\"): tokenKind = cls.TokenKind.PossibleExtendedIdentifierStart - elif ((char == "`") and isinstance(previousToken, (SpaceToken, LinebreakToken))): + elif char == "\\": tokenKind = cls.TokenKind.PossibleExtendedIdentifierStart + elif (char == "`") and isinstance(previousToken, (SpaceToken, LinebreakToken)): tokenKind = cls.TokenKind.Directive else: previousToken = CharacterToken(previousToken, char, start) @@ -228,8 +228,8 @@ def GetVHDLTokenizer(cls, iterable: Iterator[str]): tokenKind = cls.TokenKind.OtherChars # State: PossibleSingleLineCommentStart - elif (tokenKind is cls.TokenKind.PossibleSingleLineCommentStart): - if (char == "-"): + elif tokenKind is cls.TokenKind.PossibleSingleLineCommentStart: + if char == "-": buffer = "--" tokenKind = cls.TokenKind.SingleLineComment else: @@ -237,21 +237,21 @@ def GetVHDLTokenizer(cls, iterable: Iterator[str]): yield previousToken buffer = char - if (char in __WHITESPACE_CHARACTERS__): tokenKind = cls.TokenKind.SpaceChars - elif (char in __NUMBER_CHARACTERS__): tokenKind = cls.TokenKind.IntegerChars - elif (char in __ALPHA_CHARACTERS__): tokenKind = cls.TokenKind.AlphaChars - elif (char == "'"): tokenKind = cls.TokenKind.PossibleCharacterLiteral - elif (char == "\""): tokenKind = cls.TokenKind.PossibleStringLiteralStart - elif (char == "/r"): tokenKind = cls.TokenKind.PossibleLinebreak - elif (char == "/n"): + if char in __WHITESPACE_CHARACTERS__: tokenKind = cls.TokenKind.SpaceChars + elif char in __NUMBER_CHARACTERS__: tokenKind = cls.TokenKind.IntegerChars + elif char in __ALPHA_CHARACTERS__: tokenKind = cls.TokenKind.AlphaChars + elif char == "'": tokenKind = cls.TokenKind.PossibleCharacterLiteral + elif char == "\"": tokenKind = cls.TokenKind.PossibleStringLiteralStart + elif char == "/r": tokenKind = cls.TokenKind.PossibleLinebreak + elif char == "/n": previousToken = LinebreakToken(previousToken, char, start, start) yield previousToken tokenKind = cls.TokenKind.OtherChars - elif (char in __FUSEABLE_CHARS__): + elif char in __FUSEABLE_CHARS__: buffer = char tokenKind = cls.TokenKind.FuseableCharacter - elif (char == "\\"): tokenKind = cls.TokenKind.PossibleExtendedIdentifierStart - elif ((char == "`") and isinstance(previousToken, (SpaceToken, LinebreakToken))): + elif char == "\\": tokenKind = cls.TokenKind.PossibleExtendedIdentifierStart + elif (char == "`") and isinstance(previousToken, (SpaceToken, LinebreakToken)): tokenKind = cls.TokenKind.Directive else: previousToken = CharacterToken(previousToken, char, start) @@ -259,11 +259,11 @@ def GetVHDLTokenizer(cls, iterable: Iterator[str]): tokenKind = cls.TokenKind.OtherChars # State: PossibleLinebreak - elif (tokenKind is cls.TokenKind.PossibleLinebreak): + elif tokenKind is cls.TokenKind.PossibleLinebreak: end = SourceCodePosition(row, column, absolute) - if (char == "\n"): + if char == "\n": tokenKind = cls.TokenKind.OtherChars - if (buffer[:2] == "--"): + if buffer[:2] == "--": buffer += char previousToken = SingleLineCommentToken(previousToken, buffer, start, end) else: @@ -276,22 +276,22 @@ def GetVHDLTokenizer(cls, iterable: Iterator[str]): start = end buffer = char - if (char in __WHITESPACE_CHARACTERS__): tokenKind = cls.TokenKind.SpaceChars - elif (char in __NUMBER_CHARACTERS__): tokenKind = cls.TokenKind.IntegerChars - elif (char in __ALPHA_CHARACTERS__): tokenKind = cls.TokenKind.AlphaChars - elif (char == "'"): tokenKind = cls.TokenKind.PossibleCharacterLiteral - elif (char == "\""): tokenKind = cls.TokenKind.PossibleStringLiteralStart - elif (char == "-"): tokenKind = cls.TokenKind.PossibleSingleLineCommentStart - elif (char == "/r"): tokenKind = cls.TokenKind.PossibleLinebreak - elif (char == "/n"): + if char in __WHITESPACE_CHARACTERS__: tokenKind = cls.TokenKind.SpaceChars + elif char in __NUMBER_CHARACTERS__: tokenKind = cls.TokenKind.IntegerChars + elif char in __ALPHA_CHARACTERS__: tokenKind = cls.TokenKind.AlphaChars + elif char == "'": tokenKind = cls.TokenKind.PossibleCharacterLiteral + elif char == "\"": tokenKind = cls.TokenKind.PossibleStringLiteralStart + elif char == "-": tokenKind = cls.TokenKind.PossibleSingleLineCommentStart + elif char == "/r": tokenKind = cls.TokenKind.PossibleLinebreak + elif char == "/n": previousToken = LinebreakToken(previousToken, char, start, start) yield previousToken tokenKind = cls.TokenKind.OtherChars - elif (char in __FUSEABLE_CHARS__): + elif char in __FUSEABLE_CHARS__: buffer = char tokenKind = cls.TokenKind.FuseableCharacter - elif (char == "\\"): tokenKind = cls.TokenKind.PossibleExtendedIdentifierStart - elif ((char == "`") and isinstance(previousToken, (SpaceToken, LinebreakToken))): + elif char == "\\": tokenKind = cls.TokenKind.PossibleExtendedIdentifierStart + elif (char == "`") and isinstance(previousToken, (SpaceToken, LinebreakToken)): tokenKind = cls.TokenKind.Directive else: previousToken = CharacterToken(previousToken, char, start) @@ -299,8 +299,8 @@ def GetVHDLTokenizer(cls, iterable: Iterator[str]): tokenKind = cls.TokenKind.OtherChars # State: PossibleRealLiteral - elif (tokenKind is cls.TokenKind.PossibleRealLiteral): - if (char in __NUMBER_CHARACTERS__): + elif tokenKind is cls.TokenKind.PossibleRealLiteral: + if char in __NUMBER_CHARACTERS__: buffer += char tokenKind = cls.TokenKind.RealChars else: @@ -310,22 +310,22 @@ def GetVHDLTokenizer(cls, iterable: Iterator[str]): start = SourceCodePosition(row, column, absolute) buffer = char - if (char in __WHITESPACE_CHARACTERS__): tokenKind = cls.TokenKind.SpaceChars - elif (char in __NUMBER_CHARACTERS__): tokenKind = cls.TokenKind.IntegerChars - elif (char in __ALPHA_CHARACTERS__): tokenKind = cls.TokenKind.AlphaChars - elif (char == "'"): tokenKind = cls.TokenKind.PossibleCharacterLiteral - elif (char == "\""): tokenKind = cls.TokenKind.PossibleStringLiteralStart - elif (char == "-"): tokenKind = cls.TokenKind.PossibleSingleLineCommentStart - elif (char == "/r"): tokenKind = cls.TokenKind.PossibleLinebreak - elif (char == "/n"): + if char in __WHITESPACE_CHARACTERS__: tokenKind = cls.TokenKind.SpaceChars + elif char in __NUMBER_CHARACTERS__: tokenKind = cls.TokenKind.IntegerChars + elif char in __ALPHA_CHARACTERS__: tokenKind = cls.TokenKind.AlphaChars + elif char == "'": tokenKind = cls.TokenKind.PossibleCharacterLiteral + elif char == "\"": tokenKind = cls.TokenKind.PossibleStringLiteralStart + elif char == "-": tokenKind = cls.TokenKind.PossibleSingleLineCommentStart + elif char == "/r": tokenKind = cls.TokenKind.PossibleLinebreak + elif char == "/n": previousToken = LinebreakToken(previousToken, char, start, start) yield previousToken tokenKind = cls.TokenKind.OtherChars - elif (char in __FUSEABLE_CHARS__): + elif char in __FUSEABLE_CHARS__: buffer = char tokenKind = cls.TokenKind.FuseableCharacter - elif (char == "\\"): tokenKind = cls.TokenKind.PossibleExtendedIdentifierStart - elif ((char == "`") and isinstance(previousToken, (SpaceToken, LinebreakToken))): + elif char == "\\": tokenKind = cls.TokenKind.PossibleExtendedIdentifierStart + elif (char == "`") and isinstance(previousToken, (SpaceToken, LinebreakToken)): tokenKind = cls.TokenKind.Directive else: previousToken = CharacterToken(previousToken, char, start) @@ -333,10 +333,10 @@ def GetVHDLTokenizer(cls, iterable: Iterator[str]): tokenKind = cls.TokenKind.OtherChars # State: PossibleCharacterLiteral - elif (tokenKind is cls.TokenKind.PossibleCharacterLiteral): + elif tokenKind is cls.TokenKind.PossibleCharacterLiteral: buffer += char - if (len(buffer) == 2): - if (buffer[1] == "'"): + if len(buffer) == 2: + if buffer[1] == "'": previousToken = CharacterToken(previousToken, "'", start) yield previousToken previousToken = CharacterToken(previousToken, "'", SourceCodePosition(row, column, absolute)) @@ -344,7 +344,7 @@ def GetVHDLTokenizer(cls, iterable: Iterator[str]): tokenKind = cls.TokenKind.OtherChars else: continue - elif ((len(buffer) == 3) and (buffer[2] == "'")): + elif (len(buffer) == 3) and (buffer[2] == "'"): previousToken = CharacterLiteralToken(previousToken, buffer, start, SourceCodePosition(row, column, absolute)) yield previousToken tokenKind = cls.TokenKind.OtherChars @@ -355,117 +355,117 @@ def GetVHDLTokenizer(cls, iterable: Iterator[str]): start.Column += 1 start.Absolute += 1 buffer = buffer[:2] - if ((buffer[0] in __ALPHA_CHARACTERS__) and (buffer[1] in __ALPHA_CHARACTERS__)): + if (buffer[0] in __ALPHA_CHARACTERS__) and (buffer[1] in __ALPHA_CHARACTERS__): tokenKind = cls.TokenKind.AlphaChars - elif ((buffer[0] in __WHITESPACE_CHARACTERS__) and (buffer[1] in __WHITESPACE_CHARACTERS__)): + elif (buffer[0] in __WHITESPACE_CHARACTERS__) and (buffer[1] in __WHITESPACE_CHARACTERS__): tokenKind = cls.TokenKind.SpaceChars else: raise TokenizerException("Ambiguous syntax detected. buffer: '{buffer}'".format(buffer=buffer), start) # State: PossibleStringLiteralStart - elif (tokenKind is cls.TokenKind.PossibleStringLiteralStart): + elif tokenKind is cls.TokenKind.PossibleStringLiteralStart: buffer += char - if (char == "\""): + if char == "\"": previousToken = StringLiteralToken(previousToken, buffer, start, SourceCodePosition(row, column, absolute)) yield previousToken tokenKind = cls.TokenKind.OtherChars # State: PossibleExtendedIdentifierStart - elif (tokenKind is cls.TokenKind.PossibleExtendedIdentifierStart): + elif tokenKind is cls.TokenKind.PossibleExtendedIdentifierStart: buffer += char - if (char == "\\"): + if char == "\\": previousToken = ExtendedIdentifier(previousToken, buffer, start, SourceCodePosition(row, column, absolute)) yield previousToken tokenKind = cls.TokenKind.OtherChars # State: Directive - elif (tokenKind is cls.TokenKind.Directive): + elif tokenKind is cls.TokenKind.Directive: buffer += char - if (char == "\r"): + if char == "\r": tokenKind = cls.TokenKind.PossibleLinebreak - elif (char == "\n"): + elif char == "\n": previousToken = DirectiveToken(previousToken, buffer, start, SourceCodePosition(row, column, absolute)) yield previousToken tokenKind = cls.TokenKind.OtherChars # State: SingleLineComment - elif (tokenKind is cls.TokenKind.SingleLineComment): + elif tokenKind is cls.TokenKind.SingleLineComment: buffer += char - if (char == "\r"): + if char == "\r": tokenKind = cls.TokenKind.PossibleLinebreak - elif (char == "\n"): + elif char == "\n": previousToken = SingleLineCommentToken(previousToken, buffer, start, SourceCodePosition(row, column, absolute)) yield previousToken tokenKind = cls.TokenKind.OtherChars # State: MultiLineComment - elif (tokenKind is cls.TokenKind.MultiLineComment): + elif tokenKind is cls.TokenKind.MultiLineComment: buffer += char - if (buffer[-2:] == "*/"): + if buffer[-2:] == "*/": previousToken = MultiLineCommentToken(previousToken, buffer, start, SourceCodePosition(row, column, absolute)) yield previousToken tokenKind = cls.TokenKind.OtherChars # State: FuseableCharacter - elif (tokenKind is cls.TokenKind.FuseableCharacter): + elif tokenKind is cls.TokenKind.FuseableCharacter: fused = buffer + char - if (fused in ("=>", "**", ":=", "/=", "<=", ">=", "<>", "<<", ">>", "??", "?=", "?<", "?>", "?/=", "?<=", "?>=")): + if fused in ("=>", "**", ":=", "/=", "<=", ">=", "<>", "<<", ">>", "??", "?=", "?<", "?>", "?/=", "?<=", "?>="): previousToken = FusedCharacterToken(previousToken, fused, start, SourceCodePosition(row, column, absolute)) yield previousToken tokenKind = cls.TokenKind.OtherChars - elif (fused in ("?/", "?<", "?>")): + elif fused in ("?/", "?<", "?>"): buffer = fused - elif (fused == "/*"): + elif fused == "/*": buffer = fused tokenKind = cls.TokenKind.MultiLineComment else: previousToken = CharacterToken(previousToken, buffer[0], start) yield previousToken - if (len(buffer) == 2): + if len(buffer) == 2: previousToken = CharacterToken(previousToken, buffer[1], start) yield previousToken buffer = char - if (char in __WHITESPACE_CHARACTERS__): tokenKind = cls.TokenKind.SpaceChars - elif (char in __NUMBER_CHARACTERS__): tokenKind = cls.TokenKind.IntegerChars - elif (char in __ALPHA_CHARACTERS__): tokenKind = cls.TokenKind.AlphaChars - elif (char == "'"): tokenKind = cls.TokenKind.PossibleCharacterLiteral - elif (char == "\""): tokenKind = cls.TokenKind.PossibleStringLiteralStart - elif (char == "-"): tokenKind = cls.TokenKind.PossibleSingleLineCommentStart - elif (char == "\r"): tokenKind = cls.TokenKind.PossibleLinebreak - elif (char == "\n"): + if char in __WHITESPACE_CHARACTERS__: tokenKind = cls.TokenKind.SpaceChars + elif char in __NUMBER_CHARACTERS__: tokenKind = cls.TokenKind.IntegerChars + elif char in __ALPHA_CHARACTERS__: tokenKind = cls.TokenKind.AlphaChars + elif char == "'": tokenKind = cls.TokenKind.PossibleCharacterLiteral + elif char == "\"": tokenKind = cls.TokenKind.PossibleStringLiteralStart + elif char == "-": tokenKind = cls.TokenKind.PossibleSingleLineCommentStart + elif char == "\r": tokenKind = cls.TokenKind.PossibleLinebreak + elif char == "\n": previousToken = LinebreakToken(previousToken, char, start, start) yield previousToken tokenKind = cls.TokenKind.OtherChars - elif (char in __FUSEABLE_CHARS__): + elif char in __FUSEABLE_CHARS__: pass - elif (char == "\\"): tokenKind = cls.TokenKind.PossibleExtendedIdentifierStart - elif ((char == "`") and isinstance(previousToken, (SpaceToken, LinebreakToken))): + elif char == "\\": tokenKind = cls.TokenKind.PossibleExtendedIdentifierStart + elif (char == "`") and isinstance(previousToken, (SpaceToken, LinebreakToken)): tokenKind = cls.TokenKind.Directive else: previousToken = CharacterToken(previousToken, char, start) yield previousToken # State: OtherChars - elif (tokenKind is cls.TokenKind.OtherChars): + elif tokenKind is cls.TokenKind.OtherChars: start = SourceCodePosition(row, column, absolute) buffer = char - if (char in __WHITESPACE_CHARACTERS__): tokenKind = cls.TokenKind.SpaceChars - elif (char in __NUMBER_CHARACTERS__): tokenKind = cls.TokenKind.IntegerChars - elif (char in __ALPHA_CHARACTERS__): tokenKind = cls.TokenKind.AlphaChars - elif (char == "'"): tokenKind = cls.TokenKind.PossibleCharacterLiteral - elif (char == "\""): tokenKind = cls.TokenKind.PossibleStringLiteralStart - elif (char == "-"): tokenKind = cls.TokenKind.PossibleSingleLineCommentStart - elif (char == "\r"): tokenKind = cls.TokenKind.PossibleLinebreak - elif (char == "\n"): + if char in __WHITESPACE_CHARACTERS__: tokenKind = cls.TokenKind.SpaceChars + elif char in __NUMBER_CHARACTERS__: tokenKind = cls.TokenKind.IntegerChars + elif char in __ALPHA_CHARACTERS__: tokenKind = cls.TokenKind.AlphaChars + elif char == "'": tokenKind = cls.TokenKind.PossibleCharacterLiteral + elif char == "\"": tokenKind = cls.TokenKind.PossibleStringLiteralStart + elif char == "-": tokenKind = cls.TokenKind.PossibleSingleLineCommentStart + elif char == "\r": tokenKind = cls.TokenKind.PossibleLinebreak + elif char == "\n": previousToken = LinebreakToken(previousToken, char, start, start) yield previousToken tokenKind = cls.TokenKind.OtherChars - elif (char in __FUSEABLE_CHARS__): + elif char in __FUSEABLE_CHARS__: buffer = char tokenKind = cls.TokenKind.FuseableCharacter - elif (char == "\\"): tokenKind = cls.TokenKind.PossibleExtendedIdentifierStart - elif ((char == "`") and isinstance(previousToken, (SpaceToken, LinebreakToken))): + elif char == "\\": tokenKind = cls.TokenKind.PossibleExtendedIdentifierStart + elif (char == "`") and isinstance(previousToken, (SpaceToken, LinebreakToken)): tokenKind = cls.TokenKind.Directive else: tokenKind = cls.TokenKind.OtherChars @@ -476,35 +476,35 @@ def GetVHDLTokenizer(cls, iterable: Iterator[str]): else: raise TokenizerException("Unknown state.", SourceCodePosition(row, column, absolute)) - if (char == "\n"): + if char == "\n": column = 0 row += 1 # end for - if (tokenKind is cls.TokenKind.MultiLineComment): + if tokenKind is cls.TokenKind.MultiLineComment: raise TokenizerException("End of document before end of multi line comment.", SourceCodePosition(row, column, absolute)) # close open token when input stream is empty - if (tokenKind is cls.TokenKind.AlphaChars): + if tokenKind is cls.TokenKind.AlphaChars: previousToken = WordToken(previousToken, buffer, start, SourceCodePosition(row, column, absolute)) yield previousToken - elif (tokenKind is cls.TokenKind.IntegerChars): + elif tokenKind is cls.TokenKind.IntegerChars: previousToken = IntegerLiteralToken(previousToken, buffer, start, SourceCodePosition(row, column, absolute)) yield previousToken - elif (tokenKind is cls.TokenKind.RealChars): + elif tokenKind is cls.TokenKind.RealChars: previousToken = RealLiteralToken(previousToken, buffer, start, SourceCodePosition(row, column, absolute)) yield previousToken - elif (tokenKind is cls.TokenKind.SpaceChars): + elif tokenKind is cls.TokenKind.SpaceChars: end = SourceCodePosition(row, column - 1, absolute - 1) if isinstance(previousToken, (LinebreakToken, SingleLineCommentToken, StartOfDocumentToken)): previousToken = IndentationToken(previousToken, buffer, start, end) else: previousToken = SpaceToken(previousToken, buffer, start, end) yield previousToken - elif (tokenKind is cls.TokenKind.SingleLineComment): + elif tokenKind is cls.TokenKind.SingleLineComment: previousToken = SingleLineCommentToken(previousToken, buffer, start, SourceCodePosition(row, column, absolute)) yield previousToken - elif (tokenKind in (cls.TokenKind.OtherChars, cls.TokenKind.DelimiterChars)): + elif tokenKind in (cls.TokenKind.OtherChars, cls.TokenKind.DelimiterChars): pass else: raise TokenizerException("End of document before ...", SourceCodePosition(row, column, absolute)) diff --git a/pyVHDLParser/Token/__init__.py b/pyVHDLParser/Token/__init__.py index d32f5bf12..d8917edce 100644 --- a/pyVHDLParser/Token/__init__.py +++ b/pyVHDLParser/Token/__init__.py @@ -41,9 +41,9 @@ def CharacterTranslation(value: str, oneLiner: bool = False) -> str: charIterator = iter(value) try: while char := next(charIterator): - if (char == "\r"): + if char == "\r": nextChar = next(charIterator) - if (nextChar == "\n"): + if nextChar == "\n": buffer += "«\\r\\n»" if not oneLiner: buffer += "\n" @@ -52,15 +52,15 @@ def CharacterTranslation(value: str, oneLiner: bool = False) -> str: if not oneLiner: buffer += "\n" - if (nextChar == "\t"): + if nextChar == "\t": buffer += "«\\n»" else: buffer += nextChar - elif (char == "\n"): + elif char == "\n": buffer += "«\\n»" if not oneLiner: buffer += "\n" - elif (char == "\t"): + elif char == "\t": buffer += "«\\t»" else: buffer += char @@ -92,7 +92,7 @@ def __iter__(self) -> 'TokenIterator': def __next__(self) -> 'Token': # in last call of '__next__', the last token in the sequence was returned - if (self.state > 0): + if self.state > 0: raise StopIteration(self.state) token = self.currentToken @@ -110,7 +110,7 @@ def __next__(self) -> 'Token': self.state = 2 else: self.currentToken = token.NextToken - if (self.currentToken is None): + if self.currentToken is None: raise ParserException("Found open end while iterating token sequence.") # FIXME: how to append last token? return token @@ -137,7 +137,7 @@ def __iter__(self) -> 'TokenReverseIterator': def __next__(self) -> 'Token': # in last call of '__next__', the last token in the sequence was returned - if (self.state > 0): + if self.state > 0: raise StopIteration(self.state) token = self.currentToken @@ -155,7 +155,7 @@ def __next__(self) -> 'Token': self.currentToken = None else: self.currentToken = token.PreviousToken - if (self.currentToken is None): + if self.currentToken is None: raise ParserException("Found open end while iterating token sequence.") # FIXME: how to append last token? return token diff --git a/pyVHDLParser/TypeSystem/TypeSystem.py b/pyVHDLParser/TypeSystem/TypeSystem.py index cc9065a78..71c9d55b4 100644 --- a/pyVHDLParser/TypeSystem/TypeSystem.py +++ b/pyVHDLParser/TypeSystem/TypeSystem.py @@ -94,7 +94,7 @@ def High(self): def Pos(self, value): for pos,enumValue in enumerate(self._enum._enumeration): - if (enumValue == value): + if enumValue == value: return pos def Val(self, pos): @@ -129,7 +129,7 @@ def __init__(self, name, ranges, elementType): @property def IsConstrained(self): for range in self._ranges: - if (not range.IsConstrained): + if not range.IsConstrained: return False return self._elementType.IsConstrained @@ -153,7 +153,7 @@ def __init__(self, name, members): @property def IsContrained(self): for member in self._members: - if (not member.IsConstrained): + if not member.IsConstrained: return False return True @@ -211,7 +211,7 @@ def Value(self, str): def __init__(self, name, subType, range=None, resolutionFunction=None): - if (range is None): + if range is None: range = subType._range super().__init__(name, subType, range, resolutionFunction) @@ -228,7 +228,7 @@ class Range: def __init__(self, baseType, direction=None, left=None, right=None): self._baseType = baseType - if (direction is None): + if direction is None: self.Direction = None self.Left = None self.Right = None diff --git a/pyVHDLParser/TypeSystem/std.py b/pyVHDLParser/TypeSystem/std.py index 125335bd3..617982038 100644 --- a/pyVHDLParser/TypeSystem/std.py +++ b/pyVHDLParser/TypeSystem/std.py @@ -49,7 +49,7 @@ Real = IntegerSubType("real", UniversatReal, Range(UniversatReal, Direction.To, -10.0, 10.0)) -if (vhdlVersion < VHDLVersion.VHDL2008): +if vhdlVersion < VHDLVersion.VHDL2008: Std_Decl = PackageDeclation("std", [ Boolean, Integer, @@ -58,7 +58,7 @@ ]) Std_Body = PackageBody(Std_Decl, []) -elif (vhdlVersion >= VHDLVersion.VHDL2008): +elif vhdlVersion >= VHDLVersion.VHDL2008: Boolean_Vector = ArrayType("boolean_vector", Range(Natural), Boolean) Integer_Vector = ArrayType("integer_vector", Range(Natural), Integer) diff --git a/pyVHDLParser/TypeSystem/std_logic_1164.py b/pyVHDLParser/TypeSystem/std_logic_1164.py index 1beee4fc3..f93719e18 100644 --- a/pyVHDLParser/TypeSystem/std_logic_1164.py +++ b/pyVHDLParser/TypeSystem/std_logic_1164.py @@ -89,7 +89,7 @@ def Resolution(arguments): Std_Logic = EnumerationSubType("std_logic", Std_ULogic, resolutionFunction=Func_Resolved) -if (vhdlVersion < VHDLVersion.VHDL2008): +if vhdlVersion < VHDLVersion.VHDL2008: Std_Logic_Vector = ArrayType("std_logic_vector", Range(Natural), Std_Logic) else: pass diff --git a/test/BlockParserTests/TestSuite.py b/test/BlockParserTests/TestSuite.py index 98e4e50b2..fbcc7b0b9 100644 --- a/test/BlockParserTests/TestSuite.py +++ b/test/BlockParserTests/TestSuite.py @@ -66,7 +66,7 @@ def RunTests(self): file = self._vhdlDirectory / testCase.__FILENAME__ - if (not file.exists()): + if not file.exists(): print(" {RED}File '{0!s}' does not exist.{NOCOLOR}".format(file, **Console.Foreground)) continue @@ -134,8 +134,8 @@ def _RunConnectivityCheck(self, testCase, content): try: blockIterator = iter(vhdlBlockStream) firstBlock = next(blockIterator) - if (not isinstance(firstBlock, StartOfDocumentBlock)): print("{RED}First block is not StartOfDocumentBlock: {block}{NOCOLOR}".format(block=firstBlock, **Console.Foreground)) - elif (not isinstance(firstBlock.StartToken, StartOfDocumentToken)): print("{RED}First token is not StartOfDocumentToken: {token}{NOCOLOR}".format(token=firstBlock.StartToken, **Console.Foreground)) + if not isinstance(firstBlock, StartOfDocumentBlock): print("{RED}First block is not StartOfDocumentBlock: {block}{NOCOLOR}".format(block=firstBlock, **Console.Foreground)) + elif not isinstance(firstBlock.StartToken, StartOfDocumentToken): print("{RED}First token is not StartOfDocumentToken: {token}{NOCOLOR}".format(token=firstBlock.StartToken, **Console.Foreground)) lastBlock = None lastToken = firstBlock.StartToken @@ -146,15 +146,15 @@ def _RunConnectivityCheck(self, testCase, content): tokenIterator = iter(vhdlBlock) for token in tokenIterator: - if (token.NextToken is None): print("{RED}Token has an open end.{NOCOLOR}".format(**Console.Foreground)) - elif (lastToken.NextToken is not token): print("{RED}Last token is not connected to the current one.{NOCOLOR}".format(**Console.Foreground)) - elif (token.PreviousToken is not lastToken): print("{RED}Current token is not connected to lastToken.{NOCOLOR}".format(**Console.Foreground)) + if token.NextToken is None: print("{RED}Token has an open end.{NOCOLOR}".format(**Console.Foreground)) + elif lastToken.NextToken is not token: print("{RED}Last token is not connected to the current one.{NOCOLOR}".format(**Console.Foreground)) + elif token.PreviousToken is not lastToken: print("{RED}Current token is not connected to lastToken.{NOCOLOR}".format(**Console.Foreground)) lastToken = token else: print("{RED}No EndOfDocumentBlock found.{NOCOLOR}".format(**Console.Foreground)) - if (not isinstance(lastBlock, EndOfDocumentBlock)): print("{RED}Last block is not EndOfDocumentBlock: {block}{NOCOLOR}".format(block=lastBlock, **Console.Foreground)) - elif (not isinstance(lastBlock.StartToken, EndOfDocumentToken)): print("{RED}Last block is not EndOfDocumentToken: {token}{NOCOLOR}".format(token=lastBlock.StartToken, **Console.Foreground)) + if not isinstance(lastBlock, EndOfDocumentBlock): print("{RED}Last block is not EndOfDocumentBlock: {block}{NOCOLOR}".format(block=lastBlock, **Console.Foreground)) + elif not isinstance(lastBlock.StartToken, EndOfDocumentToken): print("{RED}Last block is not EndOfDocumentToken: {token}{NOCOLOR}".format(token=lastBlock.StartToken, **Console.Foreground)) except ParserException as ex: print("{RED}ERROR: {0!s}{NOCOLOR}".format(ex, **Console.Foreground)) except NotImplementedError as ex: print("{RED}NotImplementedError: {0!s}{NOCOLOR}".format(ex, **Console.Foreground)) diff --git a/test/Counter.py b/test/Counter.py index 7d03b2049..260feba5a 100644 --- a/test/Counter.py +++ b/test/Counter.py @@ -55,7 +55,7 @@ def Check(self): self._failing[key] = (0, expectedCount) continue - if (count != expectedCount): + if count != expectedCount: good = False self._failing[key] = (count, expectedCount) self._history.pop(key) @@ -67,9 +67,9 @@ def Check(self): def PrintReport(self): for key,(count,expectedCount) in self._failing.items(): - if (count == 0): + if count == 0: print(" {DARK_GRAY}Missing {expectedCount} {type}{NOCOLOR}".format(expectedCount=expectedCount, type=key.__name__, **Console.Foreground)) - elif (expectedCount == 0): + elif expectedCount == 0: print(" {DARK_GRAY}Found {count} unexpected {type}{NOCOLOR}".format(count=count, type=key.__name__, **Console.Foreground)) else: print(" {DARK_GRAY}Expected {expectedCount} of {type}; found {count}{NOCOLOR}".format(count=count, expectedCount=expectedCount, type=key.__name__, **Console.Foreground)) From 4ac942c0b2e08a0cd11e52079639c6449f683532 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 7 Mar 2023 00:13:50 +0100 Subject: [PATCH 06/27] Updated Sphinx config. --- doc/conf.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 713f5821c..cf8e08fed 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -14,7 +14,6 @@ sys_path.insert(0, abspath('.')) sys_path.insert(0, abspath('..')) sys_path.insert(0, abspath('../pyVHDLParser')) -sys_path.insert(0, abspath('_extensions')) # ============================================================================== @@ -38,17 +37,17 @@ # Miscellaneous settings # ============================================================================== # The master toctree document. -master_doc = 'index' +master_doc = "index" # Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] +templates_path = ["_templates"] # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. exclude_patterns = [ "_build", - "_themes", + "_theme", "Thumbs.db", ".DS_Store" ] @@ -170,7 +169,6 @@ ] - # ============================================================================== # Extensions # ============================================================================== @@ -228,7 +226,7 @@ extlinks = { "ghissue": ('https://GitHub.com/Paebbels/pyVHDLParser/issues/%s', 'issue #'), "ghpull": ('https://GitHub.com/Paebbels/pyVHDLParser/pull/%s', 'pull request #'), - "ghsrc": ('https://GitHub.com/Paebbels/pyVHDLParser/blob/main/%s?ts=2', None), + "ghsrc": ('https://GitHub.com/Paebbels/pyVHDLParser/blob/main/%s?ts=2', ""), } @@ -277,5 +275,9 @@ # AutoAPI.Sphinx # ============================================================================== autoapi_modules = { - 'pyVHDLParser': {'output': "pyVHDLParser", "override": True} + "pyVHDLModel": { +# "template": "module", + "output": "pyVHDLParser", + "override": True + } } From cc4547c196eabf12167fcc5b913adfbdfeb388b6 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 7 Mar 2023 20:10:36 +0100 Subject: [PATCH 07/27] Removed Graph data structure. Now using graphs from pyTooling.Graph. --- pyVHDLParser/Graph/CompileOrder.py | 52 ----------- pyVHDLParser/Graph/Graph.py | 137 ----------------------------- pyVHDLParser/Graph/__init__.py | 29 ------ 3 files changed, 218 deletions(-) delete mode 100644 pyVHDLParser/Graph/CompileOrder.py delete mode 100644 pyVHDLParser/Graph/Graph.py delete mode 100644 pyVHDLParser/Graph/__init__.py diff --git a/pyVHDLParser/Graph/CompileOrder.py b/pyVHDLParser/Graph/CompileOrder.py deleted file mode 100644 index ab1c4de53..000000000 --- a/pyVHDLParser/Graph/CompileOrder.py +++ /dev/null @@ -1,52 +0,0 @@ -# ==================================================================================================================== # -# __ ___ _ ____ _ ____ # -# _ __ _ \ \ / / | | | _ \| | | _ \ __ _ _ __ ___ ___ _ __ # -# | '_ \| | | \ \ / /| |_| | | | | | | |_) / _` | '__/ __|/ _ \ '__| # -# | |_) | |_| |\ V / | _ | |_| | |___| __/ (_| | | \__ \ __/ | # -# | .__/ \__, | \_/ |_| |_|____/|_____|_| \__,_|_| |___/\___|_| # -# |_| |___/ # -# ==================================================================================================================== # -# Authors: # -# Patrick Lehmann # -# # -# License: # -# ==================================================================================================================== # -# Copyright 2017-2023 Patrick Lehmann - Boetzingen, Germany # -# Copyright 2016-2017 Patrick Lehmann - Dresden, Germany # -# # -# Licensed under the Apache License, Version 2.0 (the "License"); # -# you may not use this file except in compliance with the License. # -# You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software # -# distributed under the License is distributed on an "AS IS" BASIS, # -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# See the License for the specific language governing permissions and # -# limitations under the License. # -# ==================================================================================================================== # -# -from pyTooling.Decorators import export - -from pyVHDLParser.Graph.Graph import Graph as BaseGraph -from pyVHDLParser.Graph.Graph import Node as BaseNode - - -@export -class Graph(BaseGraph): - def __init__(self): - self._nodes = [] - - def AddFile(self, file): - super().AddNode(file) - - def GetCompileOrder(self): - pass - - -@export -class VHDLDocument(BaseNode): - def __init__(self, file): - super().__init__() - self.File = file diff --git a/pyVHDLParser/Graph/Graph.py b/pyVHDLParser/Graph/Graph.py deleted file mode 100644 index 78885814a..000000000 --- a/pyVHDLParser/Graph/Graph.py +++ /dev/null @@ -1,137 +0,0 @@ -# ==================================================================================================================== # -# __ ___ _ ____ _ ____ # -# _ __ _ \ \ / / | | | _ \| | | _ \ __ _ _ __ ___ ___ _ __ # -# | '_ \| | | \ \ / /| |_| | | | | | | |_) / _` | '__/ __|/ _ \ '__| # -# | |_) | |_| |\ V / | _ | |_| | |___| __/ (_| | | \__ \ __/ | # -# | .__/ \__, | \_/ |_| |_|____/|_____|_| \__,_|_| |___/\___|_| # -# |_| |___/ # -# ==================================================================================================================== # -# Authors: # -# Patrick Lehmann # -# # -# License: # -# ==================================================================================================================== # -# Copyright 2017-2023 Patrick Lehmann - Boetzingen, Germany # -# Copyright 2016-2017 Patrick Lehmann - Dresden, Germany # -# # -# Licensed under the Apache License, Version 2.0 (the "License"); # -# you may not use this file except in compliance with the License. # -# You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software # -# distributed under the License is distributed on an "AS IS" BASIS, # -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# See the License for the specific language governing permissions and # -# limitations under the License. # -# ==================================================================================================================== # -# -from enum import Enum - -from pyTooling.Decorators import export - - -@export -class NodeColors(Enum): - Black = 0 - Gray = 1 - White = 2 - - -@export -class EdgeKinds(Enum): - Unknown = 0 - Forward = 1 - Backward = 2 - Sideward = 3 - - -@export -class Graph: - def __init__(self): - self._nodes = [] - self._roots = [] - self._forwardEdges = [] - self._backwardEdges = [] - self._sidewardEdges = [] - - def AddNode(self, node): - node.Graph = self - self._nodes.append(node) - - def __colorize(self, node): - if node.Color is NodeColors.Black: - node.Color = NodeColors.Gray - for edge in node._edges: - edge.EdgeKind = self.__colorize(edge.End) - if edge.EdgeKind is EdgeKinds.Forward: - self._forwardEdges.append(edge) - elif edge.EdgeKind is EdgeKinds.Backward: - self._backwardEdges.append(edge) - elif edge.EdgeKind is EdgeKinds.Sideward: - self._sidewardEdges.append(edge) - - return EdgeKinds.Forward - elif node.Color is NodeColors.Gray: - return EdgeKinds.Backward - elif node.Color is NodeColors.White: - return EdgeKinds.Sideward - - def Colorize(self): - for startNode in self._nodes: - if startNode.Color is not NodeColors.White: - self.__colorize(startNode) - - def GetTopologicalOrder(self): - workList = [] - resultList = [] - - for node in self._nodes: - node.Weight = len(node._incomingEdges) - if node.Weight > 0: - workList.append(node) - - while len(workList) > 0: - node = workList.pop() - for edge in node._outgoingEdges: - end = edge.End - end.Weight -= 1 - if end.Weight == 0: - workList.append(end) - - resultList.append(node) - - return resultList - - def ClearColors(self): - for node in self._nodes: - node.Color = NodeColors.Black - - def ClearWeights(self): - for node in self._nodes: - node.Weight = 0 - - -@export -class Node: - def __init__(self): - self.Graph = None - self._outgoingEdges = [] - self._incomingEdges = [] - self.Weight = 0 - self.Color = NodeColors.Black - - def DependsOn(self, node): - edge = Edge(self.Graph, self, node) - self._outgoingEdges.append(edge) - node._incomingEdges.append(edge) - - -@export -class Edge: - def __init__(self, graph, start, end): - self.Graph = graph - self.EdgeKind = EdgeKinds.Unknown - self.Start = start - self.End = end diff --git a/pyVHDLParser/Graph/__init__.py b/pyVHDLParser/Graph/__init__.py deleted file mode 100644 index d936f6829..000000000 --- a/pyVHDLParser/Graph/__init__.py +++ /dev/null @@ -1,29 +0,0 @@ -# ==================================================================================================================== # -# __ ___ _ ____ _ ____ # -# _ __ _ \ \ / / | | | _ \| | | _ \ __ _ _ __ ___ ___ _ __ # -# | '_ \| | | \ \ / /| |_| | | | | | | |_) / _` | '__/ __|/ _ \ '__| # -# | |_) | |_| |\ V / | _ | |_| | |___| __/ (_| | | \__ \ __/ | # -# | .__/ \__, | \_/ |_| |_|____/|_____|_| \__,_|_| |___/\___|_| # -# |_| |___/ # -# ==================================================================================================================== # -# Authors: # -# Patrick Lehmann # -# # -# License: # -# ==================================================================================================================== # -# Copyright 2017-2023 Patrick Lehmann - Boetzingen, Germany # -# Copyright 2016-2017 Patrick Lehmann - Dresden, Germany # -# # -# Licensed under the Apache License, Version 2.0 (the "License"); # -# you may not use this file except in compliance with the License. # -# You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software # -# distributed under the License is distributed on an "AS IS" BASIS, # -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# See the License for the specific language governing permissions and # -# limitations under the License. # -# ==================================================================================================================== # -# From 672863fb9e62c38e7c6043b85c574c8231e738b6 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 7 Mar 2023 20:42:39 +0100 Subject: [PATCH 08/27] Fixing documentation. --- doc/_extensions/DocumentMember.py | 51 ---- doc/_extensions/autoapi/__init__.py | 27 --- doc/_extensions/autoapi/apinode.py | 353 ---------------------------- doc/_extensions/autoapi/sphinx.py | 209 ---------------- doc/_static/favicon.svg | 65 +++++ doc/_static/logo.svg | 10 + doc/_templates/.gitempty | 0 doc/_templates/autoapi/module.rst | 121 ++++++---- doc/_templates/autoapi/script.rst | 148 ------------ doc/index.rst | 2 + doc/pyVHDLParser/index.rst | 15 +- 11 files changed, 151 insertions(+), 850 deletions(-) delete mode 100644 doc/_extensions/DocumentMember.py delete mode 100644 doc/_extensions/autoapi/__init__.py delete mode 100644 doc/_extensions/autoapi/apinode.py delete mode 100644 doc/_extensions/autoapi/sphinx.py create mode 100644 doc/_static/favicon.svg create mode 100644 doc/_static/logo.svg delete mode 100644 doc/_templates/.gitempty delete mode 100644 doc/_templates/autoapi/script.rst diff --git a/doc/_extensions/DocumentMember.py b/doc/_extensions/DocumentMember.py deleted file mode 100644 index 9d9bab156..000000000 --- a/doc/_extensions/DocumentMember.py +++ /dev/null @@ -1,51 +0,0 @@ -# ============================================================================== -# Authors: Patrick Lehmann -# -# Python Module: -# -# Description: -# ------------------------------------ -# - TODO -# -# License: -# ============================================================================== -# Copyright 2007-2016 Patrick Lehmann - Dresden, Germany -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -# -from SphinxExtensions import DocumentMemberAttribute - - -def skip_member_handler(app, what, name, obj, skip, options): - # try: - # print("skip_member_handler: ", obj) - # except: - # print("skip_member_handler: ERROR") - - try: - attributes = DocumentMemberAttribute.GetAttributes(obj) - if len(attributes) > 0: - # print("*#"*20) - # try: - # print("skip_member_handler: ", obj) - # except: - # print("skip_member_handler: ERROR") - - return not attributes[0].value - except: - pass - return None - -def setup(app): - app.connect('autodoc-skip-member', skip_member_handler) diff --git a/doc/_extensions/autoapi/__init__.py b/doc/_extensions/autoapi/__init__.py deleted file mode 100644 index 52a5a3f9c..000000000 --- a/doc/_extensions/autoapi/__init__.py +++ /dev/null @@ -1,27 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2015 Carlos Jenkins -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -from __future__ import unicode_literals, absolute_import -from __future__ import print_function, division - -from .apinode import __doc__, APINode # noqa - -__author__ = 'Carlos Jenkins' -__email__ = 'carlos@jenkins.co.cr' -__version__ = '1.3.1' - -__all__ = ['APINode'] diff --git a/doc/_extensions/autoapi/apinode.py b/doc/_extensions/autoapi/apinode.py deleted file mode 100644 index 9fbee1afd..000000000 --- a/doc/_extensions/autoapi/apinode.py +++ /dev/null @@ -1,353 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2015 Carlos Jenkins -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -""" -Module that provides the module tree node :class:`APINode`. - -This class will load the module identified by ``name`` and recursively build a -tree with all it's submodules and subpackages. In the process, each node -analyze and fetch the public API of that module. - -``name`` can be any node, like the root package, or any subpackage or submodule -and a tree will be built from there. ``name`` must follow the standard -"dot notation" for importing a module. - -This class will not assume any special naming, or perform any complex analysis -to determine what must be in the public interface. This is because it is not -only a difficult problem, but it involves analyzing deeply the namespace of the -module which can be quite expensive. - -In general it is very difficult to determine in a module namespace what -elements are private or public declared locally, private or public but declared -in another module and brought into the module local namespace -(``from x import y``), third party library, Python standard library, etc. At -the end, any algorithm that tries to determine this will eventually fail to -meet the requirements or expectations of the developer, leaving false positives -or removing elements expected to be present in the public API. - -For example, a common scenario is that some modules, specially package entry -points ``__init__.py``, can be setup to expose the public API of their sibling -modules, possible causing several objects to be identified as part of the -public API of both modules. - -Because of this the approach taken by this module follows the rule in PEP20 -"Explicit is better than implicit". In consequence, the node will consider -elements as public if they are explicitly listed in the ``__api__`` or -``__all__`` variables. It is up to the developer to list the elements that must -be published in the public API. - -``__api__`` is a special variable introduced by this module, and it exists for -situation were for whatever reason the developer don't want to list in the -``__all__`` variable an element that needs to be published in the public API. - -This class will extract all elements identified in ONE of those listings (not -the union), with ``__api__`` having the precedence. If none of those variables -exists in the module then it will be assumed that no public API exists for that -module and no futher actions will be taken. - -If any of those variables exists this class will iterate all elements listed in -them and will catalog them in four categories: - -- Functions. -- Exceptions. -- Classes. -- Variables. - -Being Variables the default if it cannot be determined that an element belongs -to any of other categories. -""" - -from __future__ import unicode_literals, absolute_import -from __future__ import print_function, division - -from logging import getLogger -from traceback import format_exc -from importlib import import_module -from pkgutil import iter_modules -from inspect import isclass, isfunction -from collections import OrderedDict - - -log = getLogger(__name__) - - -class APINode(object): - """ - Tree node class for module instrospection. - - :param str name: Name of the module to build the tree from. It must follow - the "dot notation" of the import mechanism. - :param dict directory: Directory to store the index of all the modules. - If None, the default, the root node will create one a pass it to the - subnodes. - - **Attributes:** - - :var name: Name of the current module. - :var subname: Last part of the name of this module. For example if name is - ``my.module.another`` the subname will be ``another``. - :var directory: Directory of the tree. This is a :py:class:`OrderedDict` - that will register all modules name with it's associated node - :class:`APINode`. All nodes of a tree share this index and thus - the whole tree can be queried from any node. - :var module: The loaded module. - :var subnodes: A list of :class:`APINode` with all child submodules - and subpackages. - :var subnodes_failed: A list of submodules and subpackages names that - failed to import. - - **Public API categories:** - - :var functions: A :py:class:`OrderedDict` of all functions found in the - public API of the module. - :var classes: A :py:class:`OrderedDict` of all classes found in the - public API of the module. - :var exceptions: A :py:class:`OrderedDict` of all exceptions found in the - public API of the module. - :var variables: A :py:class:`OrderedDict` of all other elements found in - the public API of the module. - - In all categories the order on which the elements are listed is preserved. - """ - - def __init__(self, name, directory=None): - self.module = import_module(name) - self.name = name - self.subname = name.split('.')[-1] - - self.functions = OrderedDict() - self.classes = OrderedDict() - self.exceptions = OrderedDict() - self.variables = OrderedDict() - self.api = OrderedDict(( - ('functions', self.functions), - ('classes', self.classes), - ('exceptions', self.exceptions), - ('variables', self.variables), - )) - - self.subnodes = [] - self.subnodes_failed = [] - - self.directory = OrderedDict() - if directory is not None: - self.directory = directory - - self._relevant = None - - # Now that all node public attributes exists and module was imported - # register itself in the directory - self.directory[self.name] = self - - # Check if package and iterate over subnodes - if hasattr(self.module, '__path__'): - for _, subname, ispkg in iter_modules( - self.module.__path__, self.module.__name__ + '.'): - log.info('Recursing into {}'.format(subname)) - - try: - subnode = APINode(subname, self.directory) - self.subnodes.append(subnode) - except: # Overbroad exception handling on purpose - log.error('Failed to import {}'.format(subname)) - log.debug(format_exc()) - self.subnodes_failed.append(subname) - - # Fetch all public objects - public = OrderedDict() - for public_key in ['__api__', '__all__']: - if not hasattr(self.module, public_key): - continue - - for obj_name in getattr(self.module, public_key): - if not hasattr(self.module, obj_name): - log.warning( - 'Module {} doesn\'t have a element {}'.format( - self.name, obj_name - ) - ) - continue - public[obj_name] = getattr(self.module, obj_name) - break - - # Categorize objects - for obj_name, obj in public.items(): - if isclass(obj): - if issubclass(obj, Exception): - self.exceptions[obj_name] = obj - continue - self.classes[obj_name] = obj - continue - if isfunction(obj): - self.functions[obj_name] = obj - continue - self.variables[obj_name] = obj - - # Flag to mark if this branch is relevant - # For self._relevant, None means undertermined - if self.is_root(): - self.is_relevant() - - def has_public_api(self): - """ - Check if this node has a public API. - - :rtype: bool - :return: True if any category has at least one element. - """ - return any(self.api.values()) - - def is_leaf(self): - """ - Check if the current node is a leaf in the tree. - - A leaf node not necessarily is a module, it can be a package without - modules (just the entry point ``__init__.py``). - - :rtype: bool - :return: True if no other subnodes exists for this node. - """ - return not self.subnodes - - def is_root(self): - """ - Check if the current node is the root node. - - :rtype: bool - :return: True if the current node is the root node. - """ - for key in self.directory.keys(): - return key == self.name - raise Exception('Empty directory!') - - def is_relevant(self): - """ - Check if this branch of the tree is relevant. - - A branch is relevant if the current node has a public API or if any of - its subnodes is relevant (in order to reach relevant nodes). - - Relevancy is determined at initialization by the root node. - - :rtype: bool - :return: True if the current node is relevant. - """ - if self._relevant is not None: - return self._relevant - - relevant = False - if self.has_public_api() or \ - any(s.is_relevant() for s in self.subnodes): - relevant = True - - self._relevant = relevant - - return self._relevant - - def depth(self): - """ - Get the depth of the current node in the tree. - - :rtype: int - :return: The depth of the node. For example, for node ``my.add.foo`` - the depth is 3. - """ - return len(self.name.split('.')) - - def get_module(self, name): - """ - Get a module node by it's name. - - This is just a helper that does lookup on the directory index. - - :rtype: :class:`APINode` or None - :return: The module node identified by ``name`` in the tree. ``None`` - if the name doesn't exists. - """ - return self.directory.get(name, None) - - def walk(self): - """ - Traverse the tree top-down. - - :return: This method will yield tuples ``(node, [leaves])`` for each - node in the tree. - """ - if self.is_leaf(): - raise StopIteration() - - yield (self, [n for n in self.subnodes if n.is_leaf()]) - - for subnode in [n for n in self.subnodes if not n.is_leaf()]: - for step in subnode.walk(): - yield step - - def __iter__(self): - return self.walk - - def tree(self, level=0, fullname=True): - """ - Pretty print the subtree at the current node. - - For example, for the module ``confspec``: - - :: - - confspec - confspec.manager [c] - confspec.options [c] - confspec.providers [c, v] - confspec.providers.dict [c] - confspec.providers.ini [c] - confspec.providers.json [c] - confspec.utils [f] - confspec.validation [f] - - The tags at the right of the name shows what kind of elements are - present in the public interfaces of those modules. - - :param int level: Indentation level. - :param bool fullname: Plot the full name of the module or just it's - subname. - """ - name = [(' ' * level)] - if fullname: - name.append(self.name) - else: - name.append(self.subname) - - tags = [] - for tag, category in zip(['f', 'c', 'e', 'v'], self.api.values()): - if category: - tags.append(tag) - if tags: - name.append(' [{}]'.format(', '.join(tags))) - - output = [''.join(name)] - for subnode in self.subnodes: - output.append(subnode.tree(level=level + 1, fullname=fullname)) - return '\n'.join(output) - - def __str__(self): - return self.tree() - - def __repr__(self): - return self.name - - -__all__ = ['APINode'] -__api__ = [] diff --git a/doc/_extensions/autoapi/sphinx.py b/doc/_extensions/autoapi/sphinx.py deleted file mode 100644 index e7ec50d01..000000000 --- a/doc/_extensions/autoapi/sphinx.py +++ /dev/null @@ -1,209 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2015 Carlos Jenkins -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -""" -Glue for Sphinx API. -""" - -from __future__ import unicode_literals, absolute_import -from __future__ import print_function, division - -from inspect import getdoc -from logging import getLogger -from traceback import format_exc -from os.path import join, dirname, abspath, exists -from os import environ - -from jinja2.sandbox import SandboxedEnvironment -from sphinx.util.osutil import ensuredir -from sphinx.jinja2glue import BuiltinTemplateLoader - -from . import __version__ -from .apinode import APINode - - -log = getLogger(__name__) - - -def handle_exception(func): - """ - Utility decorator to report all exceptions in module without making Sphinx - to die. - """ - def wrapper(app): - try: - func(app) - except Exception: - app.warn( - 'Unhandled exception in autoapi module: \n{}'.format( - format_exc() - ) - ) - - # Preserve docstring - if hasattr(func, '__doc__'): - wrapper.__doc__ = func.__doc__ - - return wrapper - - -def filter_summary(obj): - """ - Jinja2 filter that allows to extract the documentation summary of an - object. - """ - try: - doc = getdoc(obj) - if doc is None: - return 'Undocumented.' - - summary = doc.split('\n').pop(0) - summary.replace('\\', '\\\\') # Escape backslash in RST - return summary - except: - log.error( - 'AutoApi failed to determine autosummary for obj: {}'.format(obj) - ) - log.error(format_exc()) - - return 'AutoApi: Unable to determine summary.' - - -def get_template_env(app): - """ - Get the template environment. - - .. note:: - - Template should be loaded as a package_data using - :py:function:`pkgutil.get_data`, but because we want the user to - override the default template we need to hook it to the Sphinx loader, - and thus a file system approach is required as it is implemented like - that. - """ - template_dir = [join(dirname(abspath(__file__)), 'templates')] - template_loader = BuiltinTemplateLoader() - template_loader.init(app.builder, dirs=template_dir) - template_env = SandboxedEnvironment(loader=template_loader) - template_env.filters['summary'] = filter_summary - return template_env - - -@handle_exception -def builder_inited(app): - """ - autoapi Sphinx extension hook for the ``builder-inited`` event. - - This hook will read the configuration value ``autoapi_modules`` and render - the modules described in it. - - See http://sphinx-doc.org/extdev/appapi.html#event-builder-inited - """ - # Get modules to build documentation for - modules = app.config.autoapi_modules - if not modules: - return - - # Overwrite all files in an ReadTheDocs environment when the first builder runs (pickle) - overrideDefault = True - if (environ.get('READTHEDOCS') == "True"): - #if (app.buildername != "pickle"): - overrideDefault = False - - # Get template environment - template_env = get_template_env(app) - - print("===============================") - print("overrideDefault set to: {0!s}".format(overrideDefault)) - print("===============================") - - for module, overrides in modules.items(): - - # Get options - options = { - 'prune': False, - 'override': overrideDefault, - 'template': 'module', - 'output': module - } - if overrides: - options.update(overrides) - - # Get template - template = template_env.get_template( - 'autoapi/{}.rst'.format(options['template']) - ) - - # Build API tree - tree = APINode(module) - - # Gather nodes to document - if options['prune']: - nodes = [ - node for node in tree.directory.values() - if node.is_relevant() - ] - else: - nodes = tree.directory.values() - - if not nodes: - continue - - # Define output directory - out_dir = join(app.env.srcdir, options['output']) - ensuredir(out_dir) - - # Iterate nodes and render them - for node in nodes: - out_file = join(out_dir, node.name + app.config.source_suffix[0]) - - # Skip file if it override is off and it exists - if not options['override'] and exists(out_file): - continue - - # Consider only subnodes that are relevant if prune is enabled - subnodes = node.subnodes - if options['prune']: - subnodes = [ - subnode for subnode in node.subnodes - if subnode.is_relevant() - ] - - # Write file - with open(out_file, 'w') as fd: - fd.write( - template.render( - node=node, - subnodes=subnodes - ) - ) - - -def setup(app): - """ - autoapi Sphinx extension setup. - - See http://sphinx-doc.org/extdev/tutorial.html#the-setup-function - """ - # autodoc is required - app.setup_extension('sphinx.ext.autodoc') - app.add_config_value('autoapi_modules', {}, True) - app.connect(str('builder-inited'), builder_inited) - return {'version': __version__} - - -__all__ = ['builder_inited', 'setup'] diff --git a/doc/_static/favicon.svg b/doc/_static/favicon.svg new file mode 100644 index 000000000..30f30d25a --- /dev/null +++ b/doc/_static/favicon.svg @@ -0,0 +1,65 @@ + + + + + + + + + + + diff --git a/doc/_static/logo.svg b/doc/_static/logo.svg new file mode 100644 index 000000000..62d264f79 --- /dev/null +++ b/doc/_static/logo.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/doc/_templates/.gitempty b/doc/_templates/.gitempty deleted file mode 100644 index e69de29bb..000000000 diff --git a/doc/_templates/autoapi/module.rst b/doc/_templates/autoapi/module.rst index e359b32af..4dded81fa 100644 --- a/doc/_templates/autoapi/module.rst +++ b/doc/_templates/autoapi/module.rst @@ -1,5 +1,10 @@ +.. # Template modified by Patrick Lehmann + * removed automodule on top, because private members are activated for autodoc (no doubled documentation). + * Made sections like 'submodules' bold text, but no headlines to reduce number of ToC levels. + +{{ '=' * node.name|length }} {{ node.name }} -=={{ '=' * node.name|length }}== +{{ '=' * node.name|length }} .. automodule:: {{ node.name }} @@ -7,11 +12,10 @@ {%- block modules -%} {%- if subnodes %} -.. #----------------------------------- -{##} **Submodules** .. toctree:: + :maxdepth: 1 {% for item in subnodes %} {{ item.name }} {%- endfor %} @@ -22,21 +26,31 @@ .. currentmodule:: {{ node.name }} {##} -.. #----------------------------------- -{##} {%- if node.variables %} + **Variables** -{##} + {% for item, obj in node.variables.items() -%} - :py:data:`{{ item }}` + {#{ obj|summary }#} {% endfor -%} {%- endif -%} +{%- if node.functions %} + +**Functions** + +{% for item, obj in node.functions.items() -%} +- :py:func:`{{ item }}`: + {{ obj|summary }} + +{% endfor -%} +{%- endif -%} {%- if node.exceptions %} -{##} + **Exceptions** -{##} + {% for item, obj in node.exceptions.items() -%} - :py:exc:`{{ item }}`: {{ obj|summary }} @@ -44,11 +58,10 @@ {% endfor -%} {%- endif -%} - {%- if node.classes %} -{##} + **Classes** -{##} + {% for item, obj in node.classes.items() -%} - :py:class:`{{ item }}`: {{ obj|summary }} @@ -56,26 +69,22 @@ {% endfor -%} {%- endif -%} +{%- block variables -%} +{%- if node.variables %} -{%- if node.functions %} -{##} -**Functions** -{##} -{% for item, obj in node.functions.items() -%} -- :py:func:`{{ item }}`: - {{ obj|summary }} +--------------------- -{% endfor -%} -{%- endif -%} +**Variables** +{#% for item, obj in node.variables.items() -%} +- :py:data:`{{ item }}` +{% endfor -%#} -{%- block variables -%} -{%- if node.variables %} {% for item, obj in node.variables.items() %} .. autodata:: {{ item }} :annotation: - .. code-block:: guess + .. code-block:: text {{ obj|pprint|indent(6) }} {##} @@ -83,60 +92,68 @@ {%- endif -%} {%- endblock -%} +{%- block functions -%} +{%- if node.functions %} + +--------------------- + +**Functions** + +{% for item in node.functions %} +.. autofunction:: {{ item }} +{##} +{%- endfor -%} +{%- endif -%} +{%- endblock -%} {%- block exceptions -%} {%- if node.exceptions %} -.. #----------------------------------- +--------------------- + +**Exceptions** + +{#% for item, obj in node.exceptions.items() -%} +- :py:exc:`{{ item }}`: + {{ obj|summary }} + +{% endfor -%#} {% for item in node.exceptions %} .. autoexception:: {{ item }} - :members: - :private-members: - :inherited-members: - :undoc-members: -{##} + .. rubric:: Inheritance .. inheritance-diagram:: {{ item }} -{##} - .. rubric:: Members + :parts: 1 {##} {%- endfor -%} {%- endif -%} {%- endblock -%} - {%- block classes -%} {%- if node.classes %} -.. #----------------------------------- +--------------------- + +**Classes** + +{#% for item, obj in node.classes.items() -%} +- :py:class:`{{ item }}`: + {{ obj|summary }} + +{% endfor -%#} {% for item in node.classes %} .. autoclass:: {{ item }} :members: :private-members: - :undoc-members: + :special-members: :inherited-members: -{##} + :exclude-members: __weakref__ + .. rubric:: Inheritance .. inheritance-diagram:: {{ item }} -{##} - .. rubric:: Members -{##} -{%- endfor -%} -{%- endif -%} -{%- endblock -%} - - -{%- block functions -%} -{%- if node.functions %} - -.. #----------------------------------- - -**Functions** - -{% for item in node.functions %} -.. autofunction:: {{ item }} + :parts: 1 {##} {%- endfor -%} {%- endif -%} diff --git a/doc/_templates/autoapi/script.rst b/doc/_templates/autoapi/script.rst deleted file mode 100644 index b10d7c0d0..000000000 --- a/doc/_templates/autoapi/script.rst +++ /dev/null @@ -1,148 +0,0 @@ -{{ node.name }}.py -=={{ '=' * node.name|length }}== - -.. automodule:: {{ node.name }} - - -{##} -{%- block modules -%} -{%- if subnodes %} - -.. #----------------------------------- -{##} -**Submodules** - -.. toctree:: -{% for item in subnodes %} - {{ item.name }} -{%- endfor %} -{##} -{%- endif -%} -{%- endblock -%} -{##} -.. currentmodule:: {{ node.name }} -{##} - -.. #----------------------------------- -{##} -{%- if node.variables %} -**Variables** -{##} -{% for item, obj in node.variables.items() -%} -- :py:data:`{{ item }}` -{% endfor -%} -{%- endif -%} - - -{%- if node.exceptions %} -{##} -**Exceptions** -{##} -{% for item, obj in node.exceptions.items() -%} -- :py:exc:`{{ item }}`: - {{ obj|summary }} - -{% endfor -%} -{%- endif -%} - - -{%- if node.classes %} -{##} -**Classes** -{##} -{% for item, obj in node.classes.items() -%} -- :py:class:`{{ item }}`: - {{ obj|summary }} - -{% endfor -%} -{%- endif -%} - - -{%- if node.functions %} -{##} -**Functions** -{##} -{% for item, obj in node.functions.items() -%} -- :py:func:`{{ item }}`: - {{ obj|summary }} - -{% endfor -%} -{%- endif -%} - - -{%- block variables -%} -{%- if node.variables %} -{% for item, obj in node.variables.items() %} -.. autodata:: {{ item }} - :noindex: - :annotation: - - .. code-block:: guess - - {{ obj|pprint|indent(6) }} -{##} -{%- endfor -%} -{%- endif -%} -{%- endblock -%} - - -{%- block exceptions -%} -{%- if node.exceptions %} - -.. #----------------------------------- - -{% for item in node.exceptions %} -.. autoexception:: {{ item }} - :members: - :noindex: - :private-members: - :inherited-members: - :undoc-members: -{##} - .. rubric:: Inheritance - .. inheritance-diagram:: {{ item }} -{##} - .. rubric:: Members -{##} -{%- endfor -%} -{%- endif -%} -{%- endblock -%} - - -{%- block classes -%} -{%- if node.classes %} - -.. #----------------------------------- - -{% for item in node.classes %} -.. autoclass:: {{ item }} - :members: - :noindex: - :private-members: - :undoc-members: - :inherited-members: -{##} - .. rubric:: Inheritance - .. inheritance-diagram:: {{ item }} -{##} - .. rubric:: Members -{##} -{%- endfor -%} -{%- endif -%} -{%- endblock -%} - - -{%- block functions -%} -{%- if node.functions %} - -.. #----------------------------------- - -**Functions** - -{% for item in node.functions %} -.. autofunction:: {{ item }} - :noindex: -{##} -{%- endfor -%} -{%- endif -%} -{%- endblock -%} diff --git a/doc/index.rst b/doc/index.rst index f311cc7ce..859524093 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -223,6 +223,7 @@ This library is licensed under **Apache License 2.0**. UseCases Concepts Installation + Dependency TestApplication/index .. raw:: latex @@ -266,6 +267,7 @@ This library is licensed under **Apache License 2.0**. ChangeLog/index License + Doc-License Glossary TODOs genindex diff --git a/doc/pyVHDLParser/index.rst b/doc/pyVHDLParser/index.rst index 904f22d55..d5a9143ec 100644 --- a/doc/pyVHDLParser/index.rst +++ b/doc/pyVHDLParser/index.rst @@ -1,13 +1,8 @@ -.. toctree:: - - pyVHDLParser +Python Class Reference +###################### +Reference of all packages and modules: ------------------- +.. toctree:: -.. automodule:: pyVHDLParser - :show-inheritance: - :members: - :undoc-members: -.. # - :inherited-members: + pyVHDLParser From 12d8595c16ae310be3c6b132a6fa612f4ff9e6d7 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 7 Mar 2023 20:43:06 +0100 Subject: [PATCH 09/27] Fixing broken code. --- pyVHDLParser/DocumentModel/ObjectDeclaration/__init__.py | 8 +++++--- pyVHDLParser/DocumentModel/Sequential/Function.py | 6 ++++-- pyVHDLParser/Filters/Comment.py | 3 +-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/pyVHDLParser/DocumentModel/ObjectDeclaration/__init__.py b/pyVHDLParser/DocumentModel/ObjectDeclaration/__init__.py index e98bf0c14..72525d028 100644 --- a/pyVHDLParser/DocumentModel/ObjectDeclaration/__init__.py +++ b/pyVHDLParser/DocumentModel/ObjectDeclaration/__init__.py @@ -29,15 +29,17 @@ # from pyTooling.TerminalUI import LineTerminal -from pyVHDLModel.SyntaxModel import Constant as ConstantBase +from pyVHDLModel.Object import Constant as ConstantBase from pyVHDLParser.Token.Keywords import IdentifierToken from pyVHDLParser.Blocks import BlockParserException from pyVHDLParser.Blocks.Object.Constant import ConstantDeclarationBlock -from pyVHDLParser.DocumentModel.Parser import GroupToModelParser +# from pyVHDLParser.DocumentModel.Parser import GroupToModelParser # Type alias for type hinting -ParserState = GroupToModelParser.GroupParserState +class ParserState: + pass +# ParserState = GroupToModelParser.GroupParserState class Constant(ConstantBase): diff --git a/pyVHDLParser/DocumentModel/Sequential/Function.py b/pyVHDLParser/DocumentModel/Sequential/Function.py index 353a5db8a..8aafdee5f 100644 --- a/pyVHDLParser/DocumentModel/Sequential/Function.py +++ b/pyVHDLParser/DocumentModel/Sequential/Function.py @@ -30,7 +30,7 @@ from typing import List from pyTooling.TerminalUI import LineTerminal -from pyVHDLModel.SyntaxModel import Function as FunctionModel +from pyVHDLModel.Subprogram import Function as FunctionModel from pyVHDLParser.Token.Keywords import IdentifierToken from pyVHDLParser.Blocks import BlockParserException @@ -42,7 +42,9 @@ from pyVHDLParser.DocumentModel.Reference import LibraryClause, PackageReference # Type alias for type hinting -ParserState = GroupToModelParser.GroupParserState +class ParserState: + pass +# ParserState = GroupToModelParser.GroupParserState class Function(FunctionModel): diff --git a/pyVHDLParser/Filters/Comment.py b/pyVHDLParser/Filters/Comment.py index 73334165a..40b99ad6e 100644 --- a/pyVHDLParser/Filters/Comment.py +++ b/pyVHDLParser/Filters/Comment.py @@ -27,8 +27,7 @@ # limitations under the License. # # ==================================================================================================================== # # -from collections import Generator -from typing import Any +from typing import Generator, Any from pyVHDLParser.Blocks import BlockParserException, CommentBlock, Block from pyVHDLParser.Blocks.Common import IndentationBlock, LinebreakBlock, WhitespaceBlock From feaea21cd580009f9eed4ae6541750be2e012c12 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 7 Mar 2023 21:01:30 +0100 Subject: [PATCH 10/27] More fixes to get documentation compiling. --- doc/conf.py | 2 +- pyVHDLParser/ANTLR3/VHDLLexer.py | 130 ++++++++++++++++++ pyVHDLParser/ANTLR3/VHDLParser.py | 3 + .../DocumentModel/DesignUnit/Architecture.py | 4 +- .../DocumentModel/DesignUnit/Context.py | 4 +- .../DocumentModel/DesignUnit/Entity.py | 2 +- .../DocumentModel/DesignUnit/Package.py | 4 +- .../DocumentModel/DesignUnit/PackageBody.py | 4 +- 8 files changed, 143 insertions(+), 10 deletions(-) create mode 100644 pyVHDLParser/ANTLR3/VHDLLexer.py create mode 100644 pyVHDLParser/ANTLR3/VHDLParser.py diff --git a/doc/conf.py b/doc/conf.py index cf8e08fed..1ad5e4bd5 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -275,7 +275,7 @@ # AutoAPI.Sphinx # ============================================================================== autoapi_modules = { - "pyVHDLModel": { + "pyVHDLParser": { # "template": "module", "output": "pyVHDLParser", "override": True diff --git a/pyVHDLParser/ANTLR3/VHDLLexer.py b/pyVHDLParser/ANTLR3/VHDLLexer.py new file mode 100644 index 000000000..7a73c8d67 --- /dev/null +++ b/pyVHDLParser/ANTLR3/VHDLLexer.py @@ -0,0 +1,130 @@ + +class VHDLLexer: + OP_ABS = None + # KW_ACROSS = None + KW_ACCESS = None + KW_AFTER = None + KW_ALIAS = None + KW_ALL = None + OP_AND = None + KW_ARCHITECTURE = None + KW_ARRAY = None + KW_ASSERT = None + KW_ATTRIBUTE = None + # KW_PSL_ASSUME = None + # KW_AMS_ACROSS = None + KW_BEGIN = None + KW_BLOCK = None + KW_BODY = None + KW_BUFFER = None + KW_BUS = None + # KW_BREAK = None + KW_CASE = None + KW_COMPONENT = None + KW_CONFIGURATION = None + KW_CONSTANT = None + KW_CONTEXT = None + # KW_PSL_COVER = None + KW_DEFAULT = None + KW_DISCONNECT = None + KW_DOWNTO = None + KW_ELSE = None + KW_ELSIF = None + KW_END = None + KW_ENTITY = None + KW_EXIT = None + KW_FILE = None + KW_FOR = None + KW_FORCE = None + KW_FUNCTION = None + KW_GENERATE = None + KW_GENERIC = None + # KW_GROUP = None + KW_GUARDED = None + KW_IF = None + KW_IMPURE = None + KW_IN = None + KW_INERTIAL = None + KW_INOUT = None + KW_IS = None + KW_LABEL = None + KW_LIBRARY = None + KW_LINKAGE = None + KW_LOOP = None + KW_PSL_LITERAL = None + # KW_LIMIT = None + KW_MAP = None + OP_MOD = None + OP_NAND = None + KW_NEW = None + KW_NEXT = None + OP_NOR = None + OP_NOT = None + KW_NULL = None + # KW_NATURE = None + # KW_NOISE = None + KW_OF = None + KW_ON = None + KW_OPEN = None + OP_OR = None + KW_OTHERS = None + KW_OUT = None + KW_PACKAGE = None + KW_PARAMETER = None + KW_PORT = None + KW_POSTPONED = None + KW_PRIVATE = None + KW_PROCEDURE = None + KW_PROCESS = None + KW_PROTECTED = None + KW_PURE = None + # KW_PROCEDURAL = None + # VHDLLexer.KW_QUANTITY: 'quantityKeyword, + KW_RANGE = None + KW_RECORD = None + KW_REGISTER = None + KW_REJECT = None + KW_RELEASE = None + OP_REM = None + KW_REPORT = None + KW_RETURN = None + OP_ROL = None + OP_ROR = None + # KW_PSL_RESTRICT = None + # KW_REFERENCE = None + KW_SELECT = None + KW_SEVERITY = None + KW_SHARED = None + KW_SIGNAL = None + OP_SLA = None + OP_SLL = None + OP_SRA = None + OP_SRL = None + KW_SUBTYPE = None + # KW_PSL_STRONG = None + # KW_PSL_SEQUENCE = None + # KW_SPECTRUM = None + # KW_SUBNATURE = None + KW_THEN = None + KW_TO = None + KW_TRANSPORT = None + KW_TYPE = None + # KW_TERMINAL = None + # KW_THROUGH = None + # KW_TOLERANCE = None + KW_UNAFFECTED = None + KW_UNITS = None + KW_UNTIL = None + KW_USE = None + KW_VARIABLE = None + KW_VIEW = None + # KW_PSL_VMODE = None + # KW_PSL_VPKG = None + # KW_PSL_VPROP = None, + # KW_PSL_VUNIT = None + KW_WAIT = None + KW_WITH = None + KW_WHEN = None + KW_WHILE = None + OP_XNOR = None + OP_XOR = None diff --git a/pyVHDLParser/ANTLR3/VHDLParser.py b/pyVHDLParser/ANTLR3/VHDLParser.py new file mode 100644 index 000000000..252a903ff --- /dev/null +++ b/pyVHDLParser/ANTLR3/VHDLParser.py @@ -0,0 +1,3 @@ + +class VHDLParser: + pass diff --git a/pyVHDLParser/DocumentModel/DesignUnit/Architecture.py b/pyVHDLParser/DocumentModel/DesignUnit/Architecture.py index cd36d699f..c8073b4bc 100644 --- a/pyVHDLParser/DocumentModel/DesignUnit/Architecture.py +++ b/pyVHDLParser/DocumentModel/DesignUnit/Architecture.py @@ -27,10 +27,10 @@ # limitations under the License. # # ==================================================================================================================== # # -from pydecor import export +from pyTooling.Decorators import export from typing import List -from pyVHDLModel.SyntaxModel import Architecture as ArchitectureVHDLModel +from pyVHDLModel.DesignUnit import Architecture as ArchitectureVHDLModel from pyVHDLParser.Token.Keywords import IdentifierToken from pyVHDLParser.Blocks import BlockParserException diff --git a/pyVHDLParser/DocumentModel/DesignUnit/Context.py b/pyVHDLParser/DocumentModel/DesignUnit/Context.py index 6cab0e52c..fcc0dcc75 100644 --- a/pyVHDLParser/DocumentModel/DesignUnit/Context.py +++ b/pyVHDLParser/DocumentModel/DesignUnit/Context.py @@ -27,9 +27,9 @@ # limitations under the License. # # ==================================================================================================================== # # -from pydecor import export +from pyTooling.Decorators import export -from pyVHDLModel.SyntaxModel import Context as ContextVHDLModel +from pyVHDLModel.DesignUnit import Context as ContextVHDLModel from pyVHDLParser.Token.Keywords import IdentifierToken from pyVHDLParser.Blocks import BlockParserException diff --git a/pyVHDLParser/DocumentModel/DesignUnit/Entity.py b/pyVHDLParser/DocumentModel/DesignUnit/Entity.py index 34ed1f615..336ac40bc 100644 --- a/pyVHDLParser/DocumentModel/DesignUnit/Entity.py +++ b/pyVHDLParser/DocumentModel/DesignUnit/Entity.py @@ -30,7 +30,7 @@ from pyTooling.Decorators import export from typing import List -from pyVHDLModel.SyntaxModel import Entity as EntityVHDLModel +from pyVHDLModel.DesignUnit import Entity as EntityVHDLModel from pyVHDLParser.Token.Keywords import IdentifierToken from pyVHDLParser.Blocks import BlockParserException diff --git a/pyVHDLParser/DocumentModel/DesignUnit/Package.py b/pyVHDLParser/DocumentModel/DesignUnit/Package.py index ab09283f5..c49499056 100644 --- a/pyVHDLParser/DocumentModel/DesignUnit/Package.py +++ b/pyVHDLParser/DocumentModel/DesignUnit/Package.py @@ -27,10 +27,10 @@ # limitations under the License. # # ==================================================================================================================== # # -from pydecor import export +from pyTooling.Decorators import export from typing import List -from pyVHDLModel.SyntaxModel import Package as PackageVHDLModel +from pyVHDLModel.DesignUnit import Package as PackageVHDLModel import pyVHDLParser.Blocks.InterfaceObject from pyVHDLParser.Token.Keywords import IdentifierToken diff --git a/pyVHDLParser/DocumentModel/DesignUnit/PackageBody.py b/pyVHDLParser/DocumentModel/DesignUnit/PackageBody.py index 60ae9c5c1..d7802efda 100644 --- a/pyVHDLParser/DocumentModel/DesignUnit/PackageBody.py +++ b/pyVHDLParser/DocumentModel/DesignUnit/PackageBody.py @@ -27,10 +27,10 @@ # limitations under the License. # # ==================================================================================================================== # # -from pydecor import export from typing import List -from pyVHDLModel.SyntaxModel import PackageBody as PackageBodyVHDLModel +from pyTooling.Decorators import export +from pyVHDLModel.DesignUnit import PackageBody as PackageBodyVHDLModel import pyVHDLParser.Blocks.InterfaceObject from pyVHDLParser.Token.Keywords import IdentifierToken From cf236aaa8fba49b5cb1a0222d761be3fc82e81fc Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Wed, 8 Mar 2023 01:05:54 +0100 Subject: [PATCH 11/27] Documentation is building again. --- doc/_templates/autoapi/package.rst | 14 ++++++++++++++ doc/conf.py | 10 +++++++++- doc/index.rst | 2 +- doc/pyVHDLParser/index.rst | 8 -------- 4 files changed, 24 insertions(+), 10 deletions(-) create mode 100644 doc/_templates/autoapi/package.rst delete mode 100644 doc/pyVHDLParser/index.rst diff --git a/doc/_templates/autoapi/package.rst b/doc/_templates/autoapi/package.rst new file mode 100644 index 000000000..9cc9fbdc6 --- /dev/null +++ b/doc/_templates/autoapi/package.rst @@ -0,0 +1,14 @@ +.. # Template created by Patrick Lehmann + +Python Class Reference +###################### + +Reference of all packages and modules: + +.. automodule:: {{ node.name }} + +.. toctree:: + :maxdepth: 1 +{% for item in subnodes %} + {{ item.name }} +{%- endfor %} diff --git a/doc/conf.py b/doc/conf.py index 1ad5e4bd5..a537f66fa 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -276,8 +276,16 @@ # ============================================================================== autoapi_modules = { "pyVHDLParser": { -# "template": "module", + "template": "package", "output": "pyVHDLParser", "override": True } } + +for directory in [mod for mod in Path("../pyVHDLParser").iterdir() if mod.is_dir() and mod.name != "__pycache__"]: + print(f"Adding module rule for '{project}.{directory.name}'") + autoapi_modules[f"{project}.{directory.name}"] = { + "template": "module", + "output": "pyVHDLParser", + "override": True + } diff --git a/doc/index.rst b/doc/index.rst index 859524093..851fbab1a 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -254,7 +254,7 @@ This library is licensed under **Apache License 2.0**. :caption: References :hidden: - pyVHDLParser/index + pyVHDLParser/pyVHDLParser References/index .. raw:: latex diff --git a/doc/pyVHDLParser/index.rst b/doc/pyVHDLParser/index.rst deleted file mode 100644 index d5a9143ec..000000000 --- a/doc/pyVHDLParser/index.rst +++ /dev/null @@ -1,8 +0,0 @@ -Python Class Reference -###################### - -Reference of all packages and modules: - -.. toctree:: - - pyVHDLParser From 984412838d233c44357dfebcf2ab5a3ee85d3928 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Wed, 8 Mar 2023 02:03:32 +0100 Subject: [PATCH 12/27] Further cleanups. --- doc/genindex.rst | 4 - doc/index.rst | 4 +- doc/py-modindex.rst | 4 - pyVHDLParser/Common/Common.py | 107 ---------------------- pyVHDLParser/Common/__init__.py | 34 ------- pyVHDLParser/Functions.py | 41 --------- pyVHDLParser/Token/__init__.py | 93 ++++++------------- pyVHDLParser/TypeSystem/std.py | 41 ++++----- pyVHDLParser/TypeSystem/std_logic_1164.py | 11 +-- 9 files changed, 54 insertions(+), 285 deletions(-) delete mode 100644 doc/genindex.rst delete mode 100644 doc/py-modindex.rst delete mode 100644 pyVHDLParser/Common/Common.py delete mode 100644 pyVHDLParser/Common/__init__.py delete mode 100644 pyVHDLParser/Functions.py diff --git a/doc/genindex.rst b/doc/genindex.rst deleted file mode 100644 index c07da40d1..000000000 --- a/doc/genindex.rst +++ /dev/null @@ -1,4 +0,0 @@ -.. This file is a placeholder and will be replaced - -Index -##### diff --git a/doc/index.rst b/doc/index.rst index 851fbab1a..426ab9db0 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -269,9 +269,9 @@ This library is licensed under **Apache License 2.0**. License Doc-License Glossary - TODOs genindex - py-modindex + Python Module Index + TODOs .. # ifconfig:: visibility in ('Internal') diff --git a/doc/py-modindex.rst b/doc/py-modindex.rst deleted file mode 100644 index 23167be62..000000000 --- a/doc/py-modindex.rst +++ /dev/null @@ -1,4 +0,0 @@ -.. This file is a placeholder and will be replaced - -Module Index -############ diff --git a/pyVHDLParser/Common/Common.py b/pyVHDLParser/Common/Common.py deleted file mode 100644 index 8d2dadc49..000000000 --- a/pyVHDLParser/Common/Common.py +++ /dev/null @@ -1,107 +0,0 @@ -# ==================================================================================================================== # -# __ ___ _ ____ _ ____ # -# _ __ _ \ \ / / | | | _ \| | | _ \ __ _ _ __ ___ ___ _ __ # -# | '_ \| | | \ \ / /| |_| | | | | | | |_) / _` | '__/ __|/ _ \ '__| # -# | |_) | |_| |\ V / | _ | |_| | |___| __/ (_| | | \__ \ __/ | # -# | .__/ \__, | \_/ |_| |_|____/|_____|_| \__,_|_| |___/\___|_| # -# |_| |___/ # -# ==================================================================================================================== # -# Authors: # -# Patrick Lehmann # -# # -# License: # -# ==================================================================================================================== # -# Copyright 2017-2023 Patrick Lehmann - Boetzingen, Germany # -# Copyright 2016-2017 Patrick Lehmann - Dresden, Germany # -# # -# Licensed under the Apache License, Version 2.0 (the "License"); # -# you may not use this file except in compliance with the License. # -# You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software # -# distributed under the License is distributed on an "AS IS" BASIS, # -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# See the License for the specific language governing permissions and # -# limitations under the License. # -# ==================================================================================================================== # -# -from enum import Enum - -from pyTooling.Decorators import export - - -@export -class VHDLVersion(Enum): - Any = 0 - VHDL87 = 87 - VHDL93 = 93 - VHDL2002 = 2002 - VHDL2008 = 2008 - - __VHDL_VERSION_MAPPINGS__ = { - 87: VHDL87, - 93: VHDL93, - 2: VHDL2002, - 8: VHDL2008, - 1987: VHDL87, - 1993: VHDL93, - 2002: VHDL2002, - 2008: VHDL2008, - "87": VHDL87, - "93": VHDL93, - "02": VHDL2002, - "08": VHDL2008, - "1987": VHDL87, - "1993": VHDL93, - "2002": VHDL2002, - "2008": VHDL2008 - } - - def __init__(self, *_): - """Patch the embedded MAP dictionary""" - for k, v in self.__class__.__VHDL_VERSION_MAPPINGS__.items(): - if (not isinstance(v, self.__class__)) and (v == self.value): - self.__class__.__VHDL_VERSION_MAPPINGS__[k] = self - - def __eq__(self, other: 'VHDLVersion') -> bool: - """Return true if the internal value is equal to the second operand.""" - if (self is VHDLVersion.Any) or (other is VHDLVersion.Any): - return True - else: - return (self.value == other.value) - - def __ne__(self, other: 'VHDLVersion') -> bool: - """Return true if the internal value is unequal to the second operand.""" - return self.value != other.value - - def __lt__(self, other: 'VHDLVersion') -> bool: - """Return true if the internal value is less than to the second operand.""" - return self.value < other.value - - def __le__(self, other: 'VHDLVersion') -> bool: - """Return true if the internal value is less than or equal to the second operand.""" - return self.value <= other.value - - def __gt__(self, other: 'VHDLVersion') -> bool: - """Return true if the internal value is greater than to the second operand.""" - return self.value > other.value - - def __ge__(self, other: 'VHDLVersion') -> bool: - """Return true if the internal value is greater than or equal to the second operand.""" - return self.value >= other.value - - - def __str__(self) -> str: - return "VHDL'" + str(self.value)[-2:] - - def __repr__(self) -> str: - return str(self.value) - - @classmethod - def Parse(cls, value) -> 'VHDLVersion': - try: - return cls.__VHDL_VERSION_MAPPINGS__[value] - except KeyError: - ValueError("Value '{0!s}' cannot be parsed to member of {1}.".format(value, cls.__name__)) diff --git a/pyVHDLParser/Common/__init__.py b/pyVHDLParser/Common/__init__.py deleted file mode 100644 index 9d391e20f..000000000 --- a/pyVHDLParser/Common/__init__.py +++ /dev/null @@ -1,34 +0,0 @@ -# ==================================================================================================================== # -# __ ___ _ ____ _ ____ # -# _ __ _ \ \ / / | | | _ \| | | _ \ __ _ _ __ ___ ___ _ __ # -# | '_ \| | | \ \ / /| |_| | | | | | | |_) / _` | '__/ __|/ _ \ '__| # -# | |_) | |_| |\ V / | _ | |_| | |___| __/ (_| | | \__ \ __/ | # -# | .__/ \__, | \_/ |_| |_|____/|_____|_| \__,_|_| |___/\___|_| # -# |_| |___/ # -# ==================================================================================================================== # -# Authors: # -# Patrick Lehmann # -# # -# License: # -# ==================================================================================================================== # -# Copyright 2017-2023 Patrick Lehmann - Boetzingen, Germany # -# Copyright 2016-2017 Patrick Lehmann - Dresden, Germany # -# # -# Licensed under the Apache License, Version 2.0 (the "License"); # -# you may not use this file except in compliance with the License. # -# You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software # -# distributed under the License is distributed on an "AS IS" BASIS, # -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# See the License for the specific language governing permissions and # -# limitations under the License. # -# ==================================================================================================================== # -# -from pyVHDLParser.Common.Common import VHDLVersion - - -vhdlVersion: VHDLVersion = VHDLVersion.VHDL93 -# vhdlVersion = VHDLVersion.VHDL2008 diff --git a/pyVHDLParser/Functions.py b/pyVHDLParser/Functions.py deleted file mode 100644 index 561bd1cd4..000000000 --- a/pyVHDLParser/Functions.py +++ /dev/null @@ -1,41 +0,0 @@ -# ==================================================================================================================== # -# __ ___ _ ____ _ ____ # -# _ __ _ \ \ / / | | | _ \| | | _ \ __ _ _ __ ___ ___ _ __ # -# | '_ \| | | \ \ / /| |_| | | | | | | |_) / _` | '__/ __|/ _ \ '__| # -# | |_) | |_| |\ V / | _ | |_| | |___| __/ (_| | | \__ \ __/ | # -# | .__/ \__, | \_/ |_| |_|____/|_____|_| \__,_|_| |___/\___|_| # -# |_| |___/ # -# ==================================================================================================================== # -# Authors: # -# Patrick Lehmann # -# # -# License: # -# ==================================================================================================================== # -# Copyright 2017-2023 Patrick Lehmann - Boetzingen, Germany # -# Copyright 2016-2017 Patrick Lehmann - Dresden, Germany # -# # -# Licensed under the Apache License, Version 2.0 (the "License"); # -# you may not use this file except in compliance with the License. # -# You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software # -# distributed under the License is distributed on an "AS IS" BASIS, # -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# See the License for the specific language governing permissions and # -# limitations under the License. # -# ==================================================================================================================== # -# -from functools import reduce -from operator import or_ - -# TODO: move to lib/Utilities.py -def merge(*dicts): - """Merge 2 or more dictionaries.""" - return {k: reduce(lambda d,x: x.get(k, d), dicts, None) for k in reduce(or_, map(lambda x: x.keys(), dicts), set()) } - -def merge_with(f, *dicts): - """Merge 2 or more dictionaries. Apply function f to each element during merge.""" - return {k: reduce(lambda x: f(*x) if (len(x) > 1) else x[0])([ d[k] for d in dicts if k in d ]) for k in reduce(or_, map(lambda x: x.keys(), dicts), set()) } - diff --git a/pyVHDLParser/Token/__init__.py b/pyVHDLParser/Token/__init__.py index d8917edce..6b923b0ba 100644 --- a/pyVHDLParser/Token/__init__.py +++ b/pyVHDLParser/Token/__init__.py @@ -179,7 +179,6 @@ def __init__(self, previousToken: 'Token', start: SourceCodePosition, end: Sourc * link this token to previous token. * link previous token to this token. """ - previousToken.NextToken = self self._previousToken = previousToken self.NextToken = None @@ -189,15 +188,16 @@ def __init__(self, previousToken: 'Token', start: SourceCodePosition, end: Sourc def __len__(self) -> int: return self.End.Absolute - self.Start.Absolute + 1 - def GetIterator(self, inclusiveStartToken:bool=False, inclusiveStopToken:bool=True, stopToken:'Token'=None) -> Iterator['Token']: + def GetIterator(self, inclusiveStartToken: bool = False, inclusiveStopToken: bool = True, stopToken: 'Token' = None) -> Iterator['Token']: return TokenIterator(self, inclusiveStartToken=inclusiveStartToken, inclusiveStopToken=inclusiveStopToken, stopToken=stopToken) - def GetReverseIterator(self, inclusiveStartToken:bool=False, inclusiveStopToken:bool=True, stopToken:'Token'=None) -> Iterator['Token']: + def GetReverseIterator(self, inclusiveStartToken: bool = False, inclusiveStopToken: bool = True, stopToken: 'Token' = None) -> Iterator['Token']: return TokenReverseIterator(self, inclusiveStartToken=inclusiveStartToken, inclusiveStopToken=inclusiveStopToken, stopToken=stopToken) @property def PreviousToken(self) -> 'Token': return self._previousToken + @PreviousToken.setter def PreviousToken(self, value: 'Token'): self._previousToken = value @@ -208,10 +208,7 @@ def Length(self) -> int: return len(self) def __str__(self) -> str: - return "{name} at {pos}".format( - name=self.__class__.__qualname__, - pos=str(self.Start) - ) + return f"{self.__class__.__qualname__} at {self.Start!s}" def __repr__(self) -> str: return self.__str__() @@ -227,9 +224,8 @@ class ValuedToken(Token): Value: str #: String value of this token. - def __init__(self, previousToken: Token, value: str, start: SourceCodePosition, end: SourceCodePosition=None): + def __init__(self, previousToken: Token, value: str, start: SourceCodePosition, end: SourceCodePosition = None): """Initializes a *valued* token object.""" - super().__init__(previousToken, start, end) self.Value = value @@ -251,11 +247,8 @@ def __str__(self) -> str: return self.Value def __repr__(self) -> str: - return "<{name: <50} {value:.<59} at {pos!r}>".format( - name=self.__class__.__name__, - value="'" + CharacterTranslation(self.Value) + "' ", - pos=self.Start - ) + value = "'" + CharacterTranslation(self.Value) + "' " + return f"<{self.__class__.__name__: <50} {value:.<59} at {self.Start!r}>" @export @@ -264,7 +257,6 @@ class StartOfToken(Token): def __init__(self): """Initializes a StartOfToken object.""" - self._previousToken = None self.NextToken = None self.Start = SourceCodePosition(1, 1, 1) @@ -275,9 +267,7 @@ def __len__(self) -> int: return 0 def __str__(self) -> str: - return "<{name}>".format( - name=self.__class__.__name__ - ) + return f"<{self.__class__.__name__}>" @export @@ -293,9 +283,7 @@ def __len__(self) -> int: return 0 def __str__(self) -> str: - return "<{name}>".format( - name=self.__class__.__name__ - ) + return f"<{self.__class__.__name__}>" @export @@ -334,11 +322,8 @@ def __len__(self) -> int: return 1 def __repr__(self) -> str: - return "<{name: <50} {char:.<59} at {pos!r}>".format( - name=self.__class__.__name__, - char="'" + CharacterTranslation(self.Value) + "' ", - pos=self.Start - ) + char = "'" + CharacterTranslation(self.Value) + "' " + return f"<{self.__class__.__name__: <50} {char:.<59} at {self.Start!r}>" @export @@ -355,11 +340,8 @@ def __len__(self) -> int: return len(self.Value) def __repr__(self) -> str: - return "<{name: <50} {char:.<59} at {pos!r}>".format( - name=self.__class__.__name__, - char="'" + self.Value + "' ", - pos=self.Start - ) + char = "'" + self.Value + "' " + return f"<{self.__class__.__name__: <50} {char:.<59} at {self.Start!r}>" @export @@ -367,11 +349,8 @@ class SpaceToken(ValuedToken): """Token representing a space (space or tab).""" def __repr__(self) -> str: - return "<{name: <50} {value:.<59} at {pos!r}>".format( - name=self.__class__.__name__, - value="'" + self.Value + "' ", - pos=self.Start - ) + value = "'" + self.Value + "' " + return f"<{self.__class__.__name__: <50} {value:.<59} at {self.Start!r}>" @export @@ -398,11 +377,8 @@ def __hash__(self): return super().__hash__() def __repr__(self) -> str: - return "<{name: <50} {value:.<59} at {pos!r}>".format( - name=self.__class__.__name__, - value="'" + self.Value + "' ", - pos=self.Start - ) + value = "'" + self.Value + "' " + return f"<{self.__class__.__name__: <50} {value:.<59} at {self.Start!r}>" @export @@ -419,11 +395,8 @@ def __repr__(self) -> str: value = value.replace("\n", "\\n") value = value.replace("\r", "\\r") value = value.replace("\t", "\\t") - return "<{name: <50} {value:.<59} at {pos!r}>".format( - name=self.__class__.__name__, - value="'" + value + "' ", - pos=self.Start - ) + value = "'" + value + "' " + return f"<{self.__class__.__name__: <50} {value:.<59} at {self.Start!r}>" @export @@ -450,11 +423,8 @@ def __hash__(self): return super().__hash__() def __repr__(self) -> str: - return "<{name: <50} {value:.<59} at {pos!r}>".format( - name=self.__class__.__name__, - value=self.Value + " ", - pos=self.Start - ) + value = self.Value + " " + return f"<{self.__class__.__name__: <50} {value:.<59} at {self.Start!r}>" @export @@ -480,11 +450,8 @@ def __init__(self, previousToken: Token, value: str, start: SourceCodePosition, super().__init__(previousToken, value[1:-1], start=start, end=end) def __repr__(self) -> str: - return "<{name: <50} {value:.<59} at {pos!r}>".format( - name=self.__class__.__name__, - value="'" + self.Value + "' ", - pos=self.Start - ) + value = "'" + self.Value + "' " + return f"<{self.__class__.__name__: <50} {value:.<59} at {self.Start!r}>" @export @@ -500,11 +467,8 @@ def __init__(self, previousToken: Token, value: str, start: SourceCodePosition, super().__init__(previousToken, value[1:-1], start=start, end=end) def __repr__(self) -> str: - return "<{name: <50} {value:.<59} at {pos!r}>".format( - name=self.__class__.__name__, - value="\"" + self.Value + "\" ", - pos=self.Start - ) + value = "\"" + self.Value + "\" " + return f"<{self.__class__.__name__: <50} {value:.<59} at {self.Start!r}>" @export @@ -520,11 +484,8 @@ def __init__(self, previousToken: Token, value: str, start: SourceCodePosition, super().__init__(previousToken, value[1:-1], start=start, end=end) def __repr__(self) -> str: - return "<{name: <50} {value:.<59} at {pos!r}>".format( - name=self.__class__.__name__, - value="\"" + self.Value + "\" ", - pos=self.Start - ) + value = "\"" + self.Value + "\" " + return f"<{self.__class__.__name__: <50} {value:.<59} at {self.Start!r}>" @export diff --git a/pyVHDLParser/TypeSystem/std.py b/pyVHDLParser/TypeSystem/std.py index 617982038..d7855d54c 100644 --- a/pyVHDLParser/TypeSystem/std.py +++ b/pyVHDLParser/TypeSystem/std.py @@ -27,7 +27,6 @@ # limitations under the License. # # ==================================================================================================================== # # -from pyVHDLParser.Common import VHDLVersion, vhdlVersion from pyVHDLParser.TypeSystem.Package import PackageDeclation, PackageBody, Package from pyVHDLParser.TypeSystem.TypeSystem import EnumerationType, ArrayType, IntegerType, RealType, Direction, SubType, Range, IntegerSubType @@ -49,28 +48,28 @@ Real = IntegerSubType("real", UniversatReal, Range(UniversatReal, Direction.To, -10.0, 10.0)) -if vhdlVersion < VHDLVersion.VHDL2008: - Std_Decl = PackageDeclation("std", [ - Boolean, - Integer, - Positive, - Natural - ]) - Std_Body = PackageBody(Std_Decl, []) - -elif vhdlVersion >= VHDLVersion.VHDL2008: - Boolean_Vector = ArrayType("boolean_vector", Range(Natural), Boolean) - Integer_Vector = ArrayType("integer_vector", Range(Natural), Integer) +# if vhdlVersion < VHDLVersion.VHDL2008: +# Std_Decl = PackageDeclation("std", [ +# Boolean, +# Integer, +# Positive, +# Natural +# ]) +# Std_Body = PackageBody(Std_Decl, []) +# +# elif vhdlVersion >= VHDLVersion.VHDL2008: +Boolean_Vector = ArrayType("boolean_vector", Range(Natural), Boolean) +Integer_Vector = ArrayType("integer_vector", Range(Natural), Integer) - Std_Decl = PackageDeclation("std", [ - Boolean, - Boolean_Vector, - Integer, - Positive, - Natural - ]) - Std_Body = PackageBody(Std_Decl, []) +Std_Decl = PackageDeclation("std", [ + Boolean, + Boolean_Vector, + Integer, + Positive, + Natural +]) +Std_Body = PackageBody(Std_Decl, []) diff --git a/pyVHDLParser/TypeSystem/std_logic_1164.py b/pyVHDLParser/TypeSystem/std_logic_1164.py index f93719e18..c7618dc76 100644 --- a/pyVHDLParser/TypeSystem/std_logic_1164.py +++ b/pyVHDLParser/TypeSystem/std_logic_1164.py @@ -27,7 +27,6 @@ # limitations under the License. # # ==================================================================================================================== # # -from pyVHDLParser.Common import VHDLVersion, vhdlVersion from pyVHDLParser.TypeSystem.Package import Parameter, FunctionDeclaration, Function, PackageDeclation, PackageBody, Package from pyVHDLParser.TypeSystem.TypeSystem import EnumerationType, ArrayType, Range, SubType, EnumerationSubType from pyVHDLParser.TypeSystem.std import Natural @@ -89,11 +88,11 @@ def Resolution(arguments): Std_Logic = EnumerationSubType("std_logic", Std_ULogic, resolutionFunction=Func_Resolved) -if vhdlVersion < VHDLVersion.VHDL2008: - Std_Logic_Vector = ArrayType("std_logic_vector", Range(Natural), Std_Logic) -else: - pass - # Std_Logic_Vector = ArraySubType("std_logic_vector", Std_ULogic_Vector, resolutionFunction=Func_Resolved) +# if vhdlVersion < VHDLVersion.VHDL2008: +Std_Logic_Vector = ArrayType("std_logic_vector", Range(Natural), Std_Logic) +# else: +# pass +# # Std_Logic_Vector = ArraySubType("std_logic_vector", Std_ULogic_Vector, resolutionFunction=Func_Resolved) From 5f78007d33e230c6890d99e417e802c1cfdeec0c Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Wed, 8 Mar 2023 18:37:43 +0100 Subject: [PATCH 13/27] Fixed documentation of CLI parameters. --- doc/References/index.rst | 2 +- doc/VHDLParser-AutoProgram.py | 4 +- doc/_extensions/autoprogram.py | 633 ++++++++++++++++++++++----------- doc/conf.py | 9 +- 4 files changed, 431 insertions(+), 217 deletions(-) diff --git a/doc/References/index.rst b/doc/References/index.rst index 7ca0470ef..0ff0447e2 100644 --- a/doc/References/index.rst +++ b/doc/References/index.rst @@ -8,7 +8,7 @@ search path. .. # - This files requires a Python module called 'Frontend-AutoProgram' to be + This files requires a Python module called 'VHDLParser-AutoProgram' to be located in the 'doc' root folder. It expects a variable 'parser' of type ArgumentParser. diff --git a/doc/VHDLParser-AutoProgram.py b/doc/VHDLParser-AutoProgram.py index 4607e2271..b4148cf96 100644 --- a/doc/VHDLParser-AutoProgram.py +++ b/doc/VHDLParser-AutoProgram.py @@ -30,5 +30,5 @@ from pyVHDLParser.CLI.VHDLParser import Application -# entry point -parser = Application(sphinx=True).MainParser +# Create application instance, but do not run it. +parser = Application().MainParser diff --git a/doc/_extensions/autoprogram.py b/doc/_extensions/autoprogram.py index cfb984094..69500bb6c 100644 --- a/doc/_extensions/autoprogram.py +++ b/doc/_extensions/autoprogram.py @@ -8,32 +8,36 @@ :license: BSD, see LICENSE for details. """ +from __future__ import annotations + # pylint: disable=protected-access,missing-docstring import argparse import collections -try: - import builtins -except ImportError: - import __builtin__ as builtins -import functools +import inspect import os import re -import six -import textwrap +import sys +from typing import Any, Dict, Iterable, List, Optional, Tuple import unittest +from unittest import mock from docutils import nodes +from docutils.parsers.rst import Directive from docutils.parsers.rst.directives import unchanged -from docutils.statemachine import ViewList -from sphinx.util.compat import Directive -from sphinx.util.nodes import nested_parse_with_titles +from docutils.statemachine import StringList, ViewList +from pyTooling.Decorators import export +from six import exec_ +from six.moves import builtins, reduce from sphinx.domains import std +from sphinx.util.nodes import nested_parse_with_titles -__all__ = ('BOOLEAN_OPTIONS', 'AutoprogramDirective', 'ScannerTestCase', - 'import_object', 'scan_programs', 'setup', 'suite') +__all__ = ["suite"] -def get_subparser_action(parser): +@export +def get_subparser_action( + parser: argparse.ArgumentParser, +) -> Optional[argparse._SubParsersAction]: neg1_action = parser._actions[-1] if isinstance(neg1_action, argparse._SubParsersAction): @@ -43,71 +47,94 @@ def get_subparser_action(parser): if isinstance(a, argparse._SubParsersAction): return a + return None -def scan_programs(parser, command=[], maxdepth=0, depth=0): + +@export +def scan_programs( + parser: argparse.ArgumentParser, + command=[], + maxdepth: int = 0, + depth: int = 0, + groups: bool = False, +): if maxdepth and depth >= maxdepth: return - options = [] - for arg in parser._actions: - if not (arg.option_strings or - isinstance(arg, argparse._SubParsersAction)): - name = (arg.metavar or arg.dest).lower() - desc = (arg.help or '') % {'default': arg.default} - options.append(([name], desc)) - - for arg in parser._actions: - if arg.option_strings and arg.help is not argparse.SUPPRESS: - if isinstance(arg, (argparse._StoreAction, - argparse._AppendAction)): - if arg.choices is None: - metavar = arg.metavar or arg.dest - - if isinstance(metavar, tuple): - names = [ - '{0} <{1}>'.format( - option_string, '> <'.join(metavar).lower() - ) - for option_string in arg.option_strings - ] - else: - names = [ - '{0} <{1}>'.format(option_string, metavar.lower()) - for option_string in arg.option_strings - ] - else: - choices = '{0}'.format(','.join(arg.choices)) - names = ['{0} {{{1}}}'.format(option_string, choices) - for option_string in arg.option_strings] - else: - names = list(arg.option_strings) - desc = (arg.help or '') % {'default': arg.default} - options.append((names, desc)) - - yield command, options, parser + if groups: + yield command, [], parser + for group in parser._action_groups: + options = list(scan_options(group._group_actions)) + if options: + yield command, options, group + else: + options = list(scan_options(parser._actions)) + yield command, options, parser if parser._subparsers: - choices = () + choices: Iterable[Tuple[Any, Any]] = () subp_action = get_subparser_action(parser) if subp_action: choices = subp_action.choices.items() - if not (hasattr(collections, 'OrderedDict') and - isinstance(choices, collections.OrderedDict)): + if not ( + hasattr(collections, "OrderedDict") + and isinstance(choices, collections.OrderedDict) + ): choices = sorted(choices, key=lambda pair: pair[0]) for cmd, sub in choices: if isinstance(sub, argparse.ArgumentParser): - for program in scan_programs( - sub, command + [cmd], maxdepth, depth + 1 - ): + for program in scan_programs(sub, command + [cmd], maxdepth, depth + 1): yield program -def import_object(import_name): - module_name, expr = import_name.split(':', 1) +@export +def scan_options(actions): + for arg in actions: + if not (arg.option_strings or isinstance(arg, argparse._SubParsersAction)): + yield format_positional_argument(arg) + + for arg in actions: + if arg.option_strings and arg.help is not argparse.SUPPRESS: + yield format_option(arg) + + +@export +def format_positional_argument(arg) -> Tuple[List[str], str]: + desc = (arg.help or "") % {"default": arg.default} + name = (arg.metavar or arg.dest).lower() + return [name], desc + + +@export +def format_option(arg) -> Tuple[List[str], str]: + desc = (arg.help or "") % {"default": arg.default} + + if not isinstance(arg, (argparse._StoreAction, argparse._AppendAction)): + names = list(arg.option_strings) + return names, desc + + if arg.choices is not None: + value = "{{{0}}}".format(",".join(str(c) for c in arg.choices)) + else: + metavar = arg.metavar or arg.dest + if not isinstance(metavar, tuple): + metavar = (metavar,) + value = "<{0}>".format("> <".join(metavar).lower()) + + names = [ + "{0} {1}".format(option_string, value) for option_string in arg.option_strings + ] + + return names, desc + + +@export +def import_object(import_name: str): + module_name, expr = import_name.split(":", 1) try: mod = __import__(module_name) except ImportError: @@ -126,56 +153,61 @@ def import_object(import_name): with open(f[0]) as fobj: codestring = fobj.read() foo = imp.new_module("foo") - six.exec_(codestring, foo.__dict__) + exec_(codestring, foo.__dict__) sys.modules["foo"] = foo mod = __import__("foo") break else: - raise ImportError("No module named {}".format(module_name)) + raise - reduce_ = getattr(functools, 'reduce', None) or reduce - mod = reduce_(getattr, module_name.split('.')[1:], mod) - globals_ = builtins + mod = reduce(getattr, module_name.split(".")[1:], mod) + globals_: Dict[str, Any] = builtins # type: ignore[assignment] if not isinstance(globals_, dict): globals_ = globals_.__dict__ return eval(expr, globals_, mod.__dict__) +@export class AutoprogramDirective(Directive): has_content = False required_arguments = 1 option_spec = { - 'prog': unchanged, - 'maxdepth': unchanged, - 'start_command': unchanged, - 'strip_usage': unchanged, - 'no_usage_codeblock': unchanged, - 'label': unchanged, + "prog": unchanged, + "maxdepth": unchanged, + "start_command": unchanged, + "strip_usage": unchanged, + "no_usage_codeblock": unchanged, + "groups": unchanged, + "label": unchanged, } def make_rst(self): - import_name, = self.arguments - parser = import_object(import_name or '__undefined__') - prog = self.options.get('prog') + (import_name,) = self.arguments + parser = import_object(import_name or "__undefined__") + prog = self.options.get("prog") if prog: original_prog = parser.prog parser.prog = prog - start_command = self.options.get('start_command', '').split(' ') - strip_usage = 'strip_usage' in self.options - usage_codeblock = 'no_usage_codeblock' not in self.options - - if start_command[0] == '': + start_command = self.options.get("start_command", "").split(" ") + strip_usage = "strip_usage" in self.options + usage_codeblock = "no_usage_codeblock" not in self.options + maxdepth = int(self.options.get("maxdepth", 0)) + groups = "groups" in self.options + label = self.options.get("label", None) + + if start_command[0] == "": start_command.pop(0) if start_command: + def get_start_cmd_parser(p): looking_for = start_command.pop(0) action = get_subparser_action(p) if not action: - raise ValueError('No actions for command ' + looking_for) + raise ValueError("No actions for command " + looking_for) subp = action.choices[looking_for] @@ -188,74 +220,118 @@ def get_start_cmd_parser(p): if prog and parser.prog.startswith(original_prog): parser.prog = parser.prog.replace(original_prog, prog, 1) - for commands, options, cmd_parser in scan_programs( - parser, maxdepth=int(self.options.get('maxdepth', 0)) + for commands, options, group_or_parser in scan_programs( + parser, maxdepth=maxdepth, groups=groups ): - if prog and cmd_parser.prog.startswith(original_prog): - cmd_parser.prog = cmd_parser.prog.replace( - original_prog, prog, 1) - title = cmd_parser.prog.rstrip() - usage = cmd_parser.format_usage() - - if strip_usage: - to_strip = title.rsplit(' ', 1)[0] - len_to_strip = len(to_strip) - 4 - usage_lines = usage.splitlines() - - usage = os.linesep.join([ - usage_lines[0].replace(to_strip, '...'), - ] + [ - l[len_to_strip:] for l in usage_lines[1:] - ]) - - yield '' - yield '.. program:: ' + title - - if 'label' in self.options: - yield '' - yield '.. _%s:' % (self.options.get('label') + title).replace(" ", "-") - - yield '' - yield title - yield ('!' if commands else '?') * len(title) - yield '' - for line in (cmd_parser.description or '').splitlines(): - yield line - yield '' - - if usage_codeblock: - yield '.. code-block:: console' - yield '' - yield textwrap.indent(usage, ' ') + if isinstance(group_or_parser, argparse._ArgumentGroup): + title = group_or_parser.title + description = group_or_parser.description + usage = None + epilog = None + is_subgroup = True + is_program = False else: - yield usage - - yield '' - - for option_strings, help_ in options: - yield '.. option:: {0}'.format(', '.join(option_strings)) - yield '' - yield ' ' + help_.replace('\n', ' \n') - yield '' - yield '' - for line in (cmd_parser.epilog or '').splitlines(): - yield line or '' - - yield '' - yield '-' * 20 - yield '' + cmd_parser = group_or_parser + if prog and cmd_parser.prog.startswith(original_prog): + cmd_parser.prog = cmd_parser.prog.replace(original_prog, prog, 1) + title = cmd_parser.prog.rstrip() + description = cmd_parser.description + usage = cmd_parser.format_usage() + epilog = cmd_parser.epilog + is_subgroup = bool(commands) + is_program = True + + for line in render_rst( + title, + options, + is_program=is_program, + label=label, + is_subgroup=is_subgroup, + description=description, + usage=usage, + usage_strip=strip_usage, + usage_codeblock=usage_codeblock, + epilog=epilog, + ): + yield line def run(self): node = nodes.section() node.document = self.state.document result = ViewList() for line in self.make_rst(): - result.append(line, '') + result.append(line, "") nested_parse_with_titles(self.state, result, node) return node.children -def patch_option_role_to_allow_argument_form(): +@export +def render_rst( + title: str, + options, + is_program: bool, + label: Optional[str], + is_subgroup: bool, + description: Optional[str], + usage: str, + usage_strip: bool, + usage_codeblock: bool, + epilog: Optional[str], +) -> Iterable[str]: + if usage_strip: + to_strip = title.rsplit(" ", 1)[0] + len_to_strip = len(to_strip) - 4 + usage_lines = usage.splitlines() + + usage = os.linesep.join( + [ + usage_lines[0].replace(to_strip, "..."), + ] + + [line[len_to_strip:] for line in usage_lines[1:]] + ) + + yield "" + + if is_program: + yield ".. program:: " + title + yield "" + + if label is not None: + yield "" + yield f""".. _{(label + title).replace(" ", "-")}:""" + + yield title + yield ("!" if is_subgroup else "?") * len(title) + yield "" + + for line in inspect.cleandoc(description or "").splitlines(): + yield line + yield "" + + if usage is None: + pass + elif usage_codeblock: + yield ".. code-block:: console" + yield "" + for usage_line in usage.splitlines(): + yield " " + usage_line + else: + yield usage + + yield "" + + for option_strings, help_ in options: + yield ".. option:: {0}".format(", ".join(option_strings)) + yield "" + yield " " + help_.replace("\n", " \n") + yield "" + + for line in (epilog or "").splitlines(): + yield line or "" + + +@export +def patch_option_role_to_allow_argument_form() -> None: """Before Sphinx 1.2.2, :rst:dir:`.. option::` directive hadn't allowed to not start with a dash or slash, so it hadn't been possible to represent positional arguments (not options). @@ -265,143 +341,278 @@ def patch_option_role_to_allow_argument_form(): It monkeypatches the :rst:dir:`.. option::` directive's behavior. """ - std.option_desc_re = re.compile(r'((?:/|-|--)?[-_a-zA-Z0-9]+)(\s*.*)') + std.option_desc_re = re.compile(r"((?:/|-|--)?[-_a-zA-Z0-9]+)(\s*.*)") -def setup(app): - app.add_directive('autoprogram', AutoprogramDirective) +@export +def setup(app) -> Dict[str, bool]: + app.add_directive("autoprogram", AutoprogramDirective) patch_option_role_to_allow_argument_form() + return { + "parallel_read_safe": True, + "parallel_write_safe": True, + } +@export class ScannerTestCase(unittest.TestCase): - - def test_simple_parser(self): - parser = argparse.ArgumentParser(description='Process some integers.') - parser.add_argument('integers', metavar='N', type=int, nargs='*', - help='an integer for the accumulator') - parser.add_argument('-i', '--identity', type=int, default=0, - help='the default result for no arguments ' - '(default: 0)') - parser.add_argument('--sum', dest='accumulate', action='store_const', - const=sum, default=max, - help='sum the integers (default: find the max)') - parser.add_argument('--key-value', metavar=('KEY', 'VALUE'), nargs=2) - parser.add_argument('--max', help=argparse.SUPPRESS) # must be opt-out + def test_simple_parser(self) -> None: + parser = argparse.ArgumentParser(description="Process some integers.") + parser.add_argument( + "integers", + metavar="N", + type=int, + nargs="*", + help="an integer for the accumulator", + ) + parser.add_argument( + "-i", + "--identity", + type=int, + default=0, + help="the default result for no arguments " "(default: 0)", + ) + parser.add_argument( + "--sum", + dest="accumulate", + action="store_const", + const=sum, + default=max, + help="sum the integers (default: find the max)", + ) + parser.add_argument("--key-value", metavar=("KEY", "VALUE"), nargs=2) + parser.add_argument("--max", help=argparse.SUPPRESS) # must be opt-out programs = scan_programs(parser) programs = list(programs) self.assertEqual(1, len(programs)) - parser_info, = programs + (parser_info,) = programs program, options, cmd_parser = parser_info self.assertEqual([], program) - self.assertEqual('Process some integers.', cmd_parser.description) + self.assertEqual("Process some integers.", cmd_parser.description) self.assertEqual(5, len(options)) + self.assertEqual((["n"], "an integer for the accumulator"), options[0]) self.assertEqual( - (['n'], 'an integer for the accumulator'), - options[0] - ) - self.assertEqual( - (['-h', '--help'], 'show this help message and exit'), - options[1] + (["-h", "--help"], "show this help message and exit"), options[1] ) self.assertEqual( - (['-i ', '--identity '], - 'the default result for no arguments (default: 0)'), - options[2] + ( + ["-i ", "--identity "], + "the default result for no arguments (default: 0)", + ), + options[2], ) self.assertEqual( - (['--sum'], 'sum the integers (default: find the max)'), - options[3] + (["--sum"], "sum the integers (default: find the max)"), options[3] ) self.assertEqual( - (['--key-value ', ], ''), - options[4] + ( + [ + "--key-value ", + ], + "", + ), + options[4], ) - def test_subcommands(self): - parser = argparse.ArgumentParser(description='Process some integers.') + def test_subcommands(self) -> None: + parser = argparse.ArgumentParser(description="Process some integers.") subparsers = parser.add_subparsers() - max_parser = subparsers.add_parser('max', description='Find the max.') + max_parser = subparsers.add_parser("max", description="Find the max.") max_parser.set_defaults(accumulate=max) - max_parser.add_argument('integers', metavar='N', type=int, nargs='+', - help='An integer for the accumulator.') - sum_parser = subparsers.add_parser('sum', - description='Sum the integers.') + max_parser.add_argument( + "integers", + metavar="N", + type=int, + nargs="+", + help="An integer for the accumulator.", + ) + sum_parser = subparsers.add_parser("sum", description="Sum the integers.") sum_parser.set_defaults(accumulate=sum) - sum_parser.add_argument('integers', metavar='N', type=int, nargs='+', - help='An integer for the accumulator.') + sum_parser.add_argument( + "integers", + metavar="N", + type=int, + nargs="+", + help="An integer for the accumulator.", + ) programs = scan_programs(parser) programs = list(programs) self.assertEqual(3, len(programs)) # main program, options, cmd_parser = programs[0] self.assertEqual([], program) - self.assertEqual('Process some integers.', cmd_parser.description) + self.assertEqual("Process some integers.", cmd_parser.description) self.assertEqual(1, len(options)) self.assertEqual( - (['-h', '--help'], - 'show this help message and exit'), - options[0] + (["-h", "--help"], "show this help message and exit"), options[0] ) # max program, options, cmd_parser = programs[1] - self.assertEqual(['max'], program) - self.assertEqual('Find the max.', cmd_parser.description) + self.assertEqual(["max"], program) + self.assertEqual("Find the max.", cmd_parser.description) self.assertEqual(2, len(options)) - self.assertEqual((['n'], 'An integer for the accumulator.'), - options[0]) + self.assertEqual((["n"], "An integer for the accumulator."), options[0]) self.assertEqual( - (['-h', '--help'], - 'show this help message and exit'), - options[1] + (["-h", "--help"], "show this help message and exit"), options[1] ) # sum program, options, cmd_parser = programs[2] - self.assertEqual(['sum'], program) - self.assertEqual('Sum the integers.', cmd_parser.description) + self.assertEqual(["sum"], program) + self.assertEqual("Sum the integers.", cmd_parser.description) + self.assertEqual(2, len(options)) + self.assertEqual((["n"], "An integer for the accumulator."), options[0]) + + def test_argument_groups(self) -> None: + parser = argparse.ArgumentParser(description="This is a program.") + parser.add_argument("-v", action="store_true", help="A global argument") + plain_group = parser.add_argument_group( + "Plain Options", description="This is a group." + ) + plain_group.add_argument( + "--plain", action="store_true", help="A plain argument." + ) + fancy_group = parser.add_argument_group( + "Fancy Options", description="Another group." + ) + fancy_group.add_argument("fancy", type=int, help="Set the fancyness") + + sections = list(scan_programs(parser, groups=True)) + self.assertEqual(4, len(sections)) + + # section: unnamed + program, options, cmd_parser = sections[0] + self.assertEqual([], program) + self.assertEqual("This is a program.", cmd_parser.description) + self.assertEqual(0, len(options)) + + # section: default optionals + program, options, group = sections[1] + self.assertEqual([], program) + # See https://github.com/sphinx-contrib/autoprogram/issues/24 + if sys.version_info >= (3, 10): + self.assertEqual('options', group.title) + else: + self.assertEqual('optional arguments', group.title) + self.assertEqual(None, group.description) self.assertEqual(2, len(options)) - self.assertEqual((['n'], 'An integer for the accumulator.'), - options[0]) + self.assertEqual( + (["-h", "--help"], "show this help message and exit"), options[0] + ) + self.assertEqual((["-v"], "A global argument"), options[1]) + + # section: Plain Options + program, options, group = sections[2] + self.assertEqual([], program) + self.assertEqual("Plain Options", group.title) + self.assertEqual("This is a group.", group.description) + self.assertEqual(1, len(options)) + self.assertEqual((["--plain"], "A plain argument."), options[0]) - def test_choices(self): + # section: Fancy Options + program, options, group = sections[3] + self.assertEqual([], program) + self.assertEqual("Fancy Options", group.title) + self.assertEqual("Another group.", group.description) + self.assertEqual(1, len(options)) + self.assertEqual((["fancy"], "Set the fancyness"), options[0]) + + def test_choices(self) -> None: parser = argparse.ArgumentParser() parser.add_argument("--awesomeness", choices=["meh", "awesome"]) - program, options, cmd_parser = list(scan_programs(parser))[0] + _program, options, _cmd_parser = list(scan_programs(parser))[0] log_option = options[1] - self.assertEqual((["--awesomeness {meh,awesome}"], ''), log_option) + self.assertEqual((["--awesomeness {meh,awesome}"], ""), log_option) - def test_parse_epilog(self): + def test_parse_epilog(self) -> None: parser = argparse.ArgumentParser( - description='Process some integers.', - epilog='The integers will be processed.' + description="Process some integers.", + epilog="The integers will be processed.", ) programs = scan_programs(parser) programs = list(programs) self.assertEqual(1, len(programs)) - parser_data, = programs - program, options, cmd_parser = parser_data - self.assertEqual('The integers will be processed.', cmd_parser.epilog) + (parser_data,) = programs + _program, _options, cmd_parser = parser_data + self.assertEqual("The integers will be processed.", cmd_parser.epilog) + + +@export +class AutoprogramDirectiveTestCase(unittest.TestCase): + def setUp(self) -> None: + self.untouched_sys_path = sys.path[:] + sample_prog_path = os.path.join(os.path.dirname(__file__), "..", "doc") + sys.path.insert(0, sample_prog_path) + self.directive = AutoprogramDirective( + "autoprogram", + ["cli:parser"], + {"prog": "cli.py"}, + StringList([], items=[]), + 1, + 0, + ".. autoprogram:: cli:parser\n :prog: cli.py\n", + None, + mock.Mock(), + ) + def tearDown(self) -> None: + sys.path[:] = self.untouched_sys_path -class UtilTestCase(unittest.TestCase): + def test_make_rst(self) -> None: + self.assertEqual( + "\n".join(self.directive.make_rst()).strip(), + inspect.cleandoc( + """ + .. program:: cli.py + + cli.py + ?????? + + Process some integers. + + .. code-block:: console + + usage: cli.py [-h] [-i IDENTITY] [--sum] N [N ...] + + .. option:: n - def test_import_object(self): - cls = import_object('sphinxcontrib.autoprogram:UtilTestCase') + An integer for the accumulator. + + .. option:: -h, --help + + show this help message and exit + + .. option:: -i , --identity + + the default result for no arguments (default: 0) + + .. option:: --sum + + Sum the integers (default: find the max). + """).strip() + ) + + +@export +class UtilTestCase(unittest.TestCase): + def test_import_object(self) -> None: + cls = import_object("sphinxcontrib.autoprogram:UtilTestCase") self.assertTrue(cls is UtilTestCase) instance = import_object( 'sphinxcontrib.autoprogram:UtilTestCase("test_import_object")' ) self.assertIsInstance(instance, UtilTestCase) - if not hasattr(unittest.TestCase, 'assertIsInstance'): - def assertIsInstance(self, instance, cls): - self.assertTrue(isinstance(instance, cls), - '{0!r} is not an instance of {1.__module__}.' - '{1.__name__}'.format(instance, cls)) + if not hasattr(unittest.TestCase, "assertIsInstance"): + + def assertIsInstance(self, instance, cls) -> None: # type: ignore[override] + self.assertTrue( + isinstance(instance, cls), + "{0!r} is not an instance of {1.__module__}." + "{1.__name__}".format(instance, cls), + ) suite = unittest.TestSuite() -suite.addTests( - unittest.defaultTestLoader.loadTestsFromTestCase(ScannerTestCase) -) -suite.addTests(unittest.defaultTestLoader.loadTestsFromTestCase(UtilTestCase)) +for test_case in ScannerTestCase, AutoprogramDirectiveTestCase, UtilTestCase: + suite.addTests(unittest.defaultTestLoader.loadTestsFromTestCase(test_case)) diff --git a/doc/conf.py b/doc/conf.py index a537f66fa..b33291076 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -11,9 +11,10 @@ ROOT = Path(__file__).resolve().parent -sys_path.insert(0, abspath('.')) -sys_path.insert(0, abspath('..')) -sys_path.insert(0, abspath('../pyVHDLParser')) +sys_path.insert(0, abspath(".")) +sys_path.insert(0, abspath("..")) +sys_path.insert(0, abspath("../pyVHDLParser")) +sys_path.insert(0, abspath("_extensions")) # ============================================================================== @@ -190,6 +191,8 @@ "sphinx_fontawesome", "sphinx_autodoc_typehints", "autoapi.sphinx", + + "autoprogram" ] From 5292cf1158f938b95b915b720cd2b7ba689578a6 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 19 Mar 2023 16:51:18 +0100 Subject: [PATCH 14/27] Bumped dependencies. --- doc/Dependency.rst | 2 +- doc/requirements.txt | 2 +- pyVHDLParser/__init__.py | 2 +- pyproject.toml | 2 +- requirements.txt | 3 +-- setup.py | 5 ++++- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/doc/Dependency.rst b/doc/Dependency.rst index 34d57b45b..039d82540 100644 --- a/doc/Dependency.rst +++ b/doc/Dependency.rst @@ -86,7 +86,7 @@ the mandatory dependencies too. +--------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ | `Coverage `__ | ≥7.2 | `Apache License, 2.0 `__ | *Not yet evaluated.* | +--------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ -| `mypy `__ | ≥1.0.1 | `MIT `__ | *Not yet evaluated.* | +| `mypy `__ | ≥1.1.1 | `MIT `__ | *Not yet evaluated.* | +--------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ | `lxml `__ | ≥4.9 | `BSD 3-Clause `__ | *Not yet evaluated.* | +--------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ diff --git a/doc/requirements.txt b/doc/requirements.txt index 0114d2e16..20b9ca063 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -2,7 +2,7 @@ # Enforce latest version on ReadTheDocs sphinx>=5.3,<6.0 -pyTooling>=2.12.3 +pyTooling>=3.0.0, <4.0 # Sphinx Extenstions #sphinx.ext.coverage diff --git a/pyVHDLParser/__init__.py b/pyVHDLParser/__init__.py index b0b48781c..9c74c0825 100644 --- a/pyVHDLParser/__init__.py +++ b/pyVHDLParser/__init__.py @@ -34,7 +34,7 @@ __email__ = "Paebbels@gmail.com" __copyright__ = "Copyright 2017-2023 Patrick Lehmann - Boetzingen, Germany\nCopyright 2016-2017 Patrick Lehmann - Dresden, Germany" __license__ = "Apache License, Version 2.0" -__version__ = "0.7.0" +__version__ = "0.8.0" __keywords__ = ["parser", "vhdl", "code generator", "hdl"] from pyTooling.Decorators import export diff --git a/pyproject.toml b/pyproject.toml index 995a8f35d..536abbcf8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "pyTooling >= 2.12.0", + "pyTooling >= 3.0.0", "setuptools >= 62.3.3", "wheel >= 0.38.1" ] diff --git a/requirements.txt b/requirements.txt index 0ed40f7a4..bd88fa8f4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,6 @@ colorama>=0.4.6 py-flags>=1.1.4 -pyTooling>=2.12.3 -pyTooling.TerminalUI>=1.5.9 +pyTooling>=3.0.0, <4.0 pyAttributes>=2.5.1 pyVHDLModel==0.23.0 diff --git a/setup.py b/setup.py index 29791ebdc..ccec85932 100644 --- a/setup.py +++ b/setup.py @@ -56,5 +56,8 @@ "Topic :: Software Development :: Compilers", "Topic :: Software Development :: Testing", "Topic :: Utilities" - ] + ], + dataFiles={ + packageName: ["py.typed"] + } ) From 9f149a50fa63e5d4e327f96f79bf79d45d50f2eb Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 21 Mar 2023 20:59:59 +0100 Subject: [PATCH 15/27] New debugging technique in generating GraphML files of internal data structures. --- pyVHDLParser/Blocks/__init__.py | 12 ++--- pyVHDLParser/CLI/Block.py | 30 +++++++++++- pyVHDLParser/CLI/GraphML.py | 46 ++++++++++++++++++ pyVHDLParser/CLI/Token.py | 86 +++++---------------------------- pyVHDLParser/CLI/VHDLParser.py | 18 +++---- 5 files changed, 99 insertions(+), 93 deletions(-) create mode 100644 pyVHDLParser/CLI/GraphML.py diff --git a/pyVHDLParser/Blocks/__init__.py b/pyVHDLParser/Blocks/__init__.py index 7faee71b0..c54c8db31 100644 --- a/pyVHDLParser/Blocks/__init__.py +++ b/pyVHDLParser/Blocks/__init__.py @@ -241,7 +241,7 @@ class BlockIterator: state: int #: internal states: 0 = normal, 1 = reached stopBlock, 2 = reached EndOfBlock - def __init__(self, startBlock: 'Block', inclusiveStartBlock: bool=False, stopBlock: 'Block'=None): + def __init__(self, startBlock: 'Block', inclusiveStartBlock: bool=False, inclusiveStopBlock: bool=True, stopBlock: 'Block'=None): self.startBlock = startBlock self.currentBlock = startBlock if inclusiveStartBlock else startBlock.NextBlock self.stopBlock = stopBlock @@ -257,7 +257,7 @@ def __next__(self) -> 'Block': raise StopIteration(self.state) block = self.currentBlock - if block is self.stopToken: + if block is self.stopBlock: self.currentBlock = None self.state = 1 elif isinstance(self.currentBlock, EndOfBlock): @@ -341,11 +341,11 @@ def __iter__(self) -> TokenIterator: """Returns a token iterator that iterates from :attr:`~Block.StartToken` to :attr:`~Block.EndToken`.""" return TokenIterator(self.StartToken, inclusiveStartToken=True, stopToken=self.EndToken) - def GetIterator(self, stopBlock: 'Block'=None) -> BlockIterator: - return BlockIterator(self, stopBlock=stopBlock) + def GetIterator(self, inclusiveStartBlock: bool = False, inclusiveStopBlock: bool = True, stopBlock: 'Block'=None) -> BlockIterator: + return BlockIterator(self, inclusiveStartBlock=inclusiveStartBlock, inclusiveStopBlock=inclusiveStopBlock, stopBlock=stopBlock) - def GetReverseIterator(self, stopBlock: 'Block'=None) -> BlockReverseIterator: - return BlockReverseIterator(self, stopBlock=stopBlock) + def GetReverseIterator(self, inclusiveStartBlock: bool = False, inclusiveStopBlock: bool = True, stopBlock: 'Block'=None) -> BlockReverseIterator: + return BlockReverseIterator(self, inclusiveStartBlock=inclusiveStartBlock, inclusiveStopBlock=inclusiveStopBlock, stopBlock=stopBlock) def __str__(self) -> str: buffer = "" diff --git a/pyVHDLParser/CLI/Block.py b/pyVHDLParser/CLI/Block.py index 244de1110..21ff7bd9a 100644 --- a/pyVHDLParser/CLI/Block.py +++ b/pyVHDLParser/CLI/Block.py @@ -31,6 +31,7 @@ from pyAttributes.ArgParseAttributes import CommandAttribute +from .GraphML import GraphML from ..Base import ParserException from ..Token import Token, StartOfDocumentToken, EndOfDocumentToken from ..Token.Parser import Tokenizer @@ -53,6 +54,8 @@ class BlockStreamHandlers: def HandleBlockStreaming(self: FrontEndProtocol, args): self.PrintHeadline() + # self._writeLevel = Severity.Verbose + file = Path(args.Filename) if not file.exists(): @@ -64,8 +67,22 @@ def HandleBlockStreaming(self: FrontEndProtocol, args): tokenStream = Tokenizer.GetVHDLTokenizer(content) blockStream = TokenToBlockParser.Transform(tokenStream) + blockIterator = iter(blockStream) + firstBlock = next(blockIterator) + try: - for block in blockStream: + while next(blockIterator): + pass + except StopIteration: + pass + + if isinstance(firstBlock, StartOfDocumentBlock): + print("{YELLOW}{block!r}{NOCOLOR}".format(block=firstBlock, **self.Foreground)) + print(" {YELLOW}{token!r}{NOCOLOR}".format(token=firstBlock.StartToken, **self.Foreground)) + + try: + blockIterator = firstBlock.GetIterator(inclusiveStopBlock=False) + for block in blockIterator: if isinstance(block, (LinebreakBlock, IndentationBlock)): self.WriteNormal("{DARK_GRAY}{block!r}{NOCOLOR}".format(block=block, **self.Foreground)) elif isinstance(block, CommentBlock): @@ -84,11 +101,22 @@ def HandleBlockStreaming(self: FrontEndProtocol, args): for token in block: self.WriteVerbose(repr(token)) + blockIterator = block.GetIterator() + lastBlock = next(blockIterator) + if isinstance(lastBlock, EndOfDocumentBlock): + print("{YELLOW}{block!r}{NOCOLOR}".format(block=lastBlock, **self.Foreground)) + print(" {YELLOW}{token!r}{NOCOLOR}".format(token=lastBlock.StartToken, **self.Foreground)) + except ParserException as ex: print("{RED}ERROR: {0!s}{NOCOLOR}".format(ex, **self.Foreground)) except NotImplementedError as ex: print("{RED}NotImplementedError: {0!s}{NOCOLOR}".format(ex, **self.Foreground)) + exporter = GraphML() + exporter.AddTokenStream(firstBlock.StartToken) + # exporter.AddBlockStream(firstBlock) + exporter.WriteDocument(Path.cwd() / "temp/BlockStream.graphml") + self.exit() # ---------------------------------------------------------------------------- diff --git a/pyVHDLParser/CLI/GraphML.py b/pyVHDLParser/CLI/GraphML.py new file mode 100644 index 000000000..42d47da04 --- /dev/null +++ b/pyVHDLParser/CLI/GraphML.py @@ -0,0 +1,46 @@ +from pyTooling.Graph import Graph, Subgraph, Vertex +from pyTooling.Graph.GraphML import GraphMLDocument + +from pyVHDLParser.Token import Token + + +class GraphML: + _graph: Graph + + def __init__(self): + self._graph = Graph(name="Streams") + + def AddTokenStream(self, firstToken: Token): + subgraph = Subgraph(name="TokenStream", graph=self._graph) + + firstVertex = Vertex(vertexID=id(firstToken), value=f"{firstToken!s}", subgraph=subgraph) + firstVertex["order"] = 0 + firstVertex["kind"] = type(firstToken).__name__ + + tokenIterator = firstToken.GetIterator(inclusiveStopToken=False) + for tokenID, token in enumerate(tokenIterator, start=1): + vertex = Vertex(vertexID=id(token), value=f"{token!s}", subgraph=subgraph) + vertex["order"] = tokenID + vertex["kind"] = type(token).__name__ + + tokenIterator = token.GetIterator() + lastToken = next(tokenIterator) + lastVertex = Vertex(vertexID=id(lastToken), value=f"{lastToken!s}", subgraph=subgraph) + lastVertex["order"] = tokenID + 1 + lastVertex["kind"] = type(lastToken).__name__ + + firstVertex.EdgeToVertex(subgraph._verticesWithID[id(firstToken.NextToken)], edgeID=f"n0_next") + tokenIterator = firstToken.GetIterator(inclusiveStopToken=False) + for tokenID, token in enumerate(tokenIterator, start=1): + vertex = subgraph._verticesWithID[id(token)] + vertex.EdgeToVertex(subgraph._verticesWithID[id(token.PreviousToken)], edgeID=f"n{tokenID}_prev") + vertex.EdgeToVertex(subgraph._verticesWithID[id(token.NextToken)], edgeID=f"n{tokenID}_next") + tokenIterator = token.GetIterator() + lastToken = next(tokenIterator) + lastVertex = subgraph._verticesWithID[id(lastToken)] + lastVertex.EdgeToVertex(subgraph._verticesWithID[id(lastToken.PreviousToken)], edgeID=f"n{tokenID + 1}_prev") + + def WriteDocument(self, path): + graphMLDocument = GraphMLDocument("Streams") + graphMLDocument.FromGraph(self._graph) + graphMLDocument.WriteToFile(path) diff --git a/pyVHDLParser/CLI/Token.py b/pyVHDLParser/CLI/Token.py index 94ad73231..e35873771 100644 --- a/pyVHDLParser/CLI/Token.py +++ b/pyVHDLParser/CLI/Token.py @@ -28,16 +28,18 @@ # ==================================================================================================================== # # from pathlib import Path -from textwrap import dedent from pyAttributes.ArgParseAttributes import CommandAttribute +from pyTooling.Graph import Graph, Vertex, Subgraph +from pyTooling.Graph.GraphML import GraphMLDocument -from ..Base import ParserException -from ..Token import StartOfDocumentToken, EndOfDocumentToken, CharacterToken, SpaceToken, WordToken, LinebreakToken, CommentToken, IndentationToken -from ..Token import CharacterTranslation, SingleLineCommentToken -from ..Token.Parser import Tokenizer +from pyVHDLParser.Base import ParserException +from pyVHDLParser.CLI.GraphML import GraphML +from pyVHDLParser.Token import StartOfDocumentToken, EndOfDocumentToken, CharacterToken, SpaceToken, WordToken, LinebreakToken, CommentToken, IndentationToken +from pyVHDLParser.Token import CharacterTranslation, SingleLineCommentToken +from pyVHDLParser.Token.Parser import Tokenizer -from . import FrontEndProtocol, FilenameAttribute, translate +from pyVHDLParser.CLI import FrontEndProtocol, FilenameAttribute, translate class TokenStreamHandlers: @@ -94,75 +96,9 @@ def HandleTokenize(self: FrontEndProtocol, args): except NotImplementedError as ex: print("{RED}NotImplementedError: {0!s}{NOCOLOR}".format(ex, **self.Foreground)) - nodeFormat="t_{line}_{id}" - nodeID = 0 - line = 0 - node = nodeFormat.format(line=line, id=nodeID) - graphvizBuffer = dedent("""\ - digraph TokenStream {{ - graph [rankdir=LR splines=ortho] - node [shape=record]; - - {node} [style=filled, fillcolor=gold, label="{caption}|{{None|None|Next}}"]; - """).format( - node=node, - caption=firstToken.__class__.__qualname__ - ) - lline = 0 - sameRanked = [node] - lineStarts = [node] - - tokenIterator = firstToken.GetIterator(inclusiveStopToken=False) - for token in tokenIterator: - nodeID += 1 - nnode=nodeFormat.format(line=line, id=nodeID) - graphvizBuffer += dedent("""\ - {lnode} -> {node}; - {node} [style=filled, fillcolor={color}, label="{caption}|{{Prev|{content}|Next}}"]; - """).format( - node=nnode, - lnode=node, - color=translate(token), - caption=token.__class__.__qualname__, - content=CharacterTranslation(str(token)) - ) - node = nnode - if len(sameRanked) == 0: - lineStarts.append(node) - sameRanked.append(node) - - if isinstance(token, (LinebreakToken, SingleLineCommentToken)): - # graphvizBuffer += dedent("""\ - # - # {{ rank=same {nodes} }} - # - # """).format(nodes=" ".join(sameRanked)) - - sameRanked = [] - line += 1 - else: - lline = line - - tokenIterator = token.GetIterator() - lastToken = next(tokenIterator) - - graphvizBuffer += dedent("""\ - t_{lline}_{lid} -> t_{line}_00; - t_{line}_00 [style=filled, fillcolor=gold, label="{caption}|{{Prev|None|None}}"]; - - {{ rank=same {nodes} }} - }} - """).format( - line=line, - lline=lline, - lid=nodeID - 1, - caption=lastToken.__class__.__qualname__, - nodes=" ".join(lineStarts) - ) - - gvFile = file.with_suffix('.gv') - with gvFile.open('w') as fileHandle: - fileHandle.write(graphvizBuffer) + exporter = GraphML() + exporter.AddTokenStream(firstToken) + exporter.WriteDocument(Path.cwd() / "temp/TokenStream.graphml") self.exit() diff --git a/pyVHDLParser/CLI/VHDLParser.py b/pyVHDLParser/CLI/VHDLParser.py index ed9c0a84d..854e4bc53 100644 --- a/pyVHDLParser/CLI/VHDLParser.py +++ b/pyVHDLParser/CLI/VHDLParser.py @@ -69,8 +69,8 @@ class Application(LineTerminal, ArgParseMixin, TokenStreamHandlers, BlockStreamH # TODO: use pyTooling Platform __PLATFORM = platform_system() - def __init__(self, debug=False, verbose=False, quiet=False, sphinx=False): - super().__init__(verbose, debug, quiet) + def __init__(self): + super().__init__() # Late-initialize Block classes # -------------------------------------------------------------------------- @@ -104,11 +104,6 @@ def __init__(self, *args, **kwargs): add_help=False ) - # If executed in Sphinx to auto-document CLI arguments, exit now - # -------------------------------------------------------------------------- - if sphinx: - return - # Change error and warning reporting # -------------------------------------------------------------------------- self._LOG_MESSAGE_FORMAT__[Severity.Fatal] = "{DARK_RED}[FATAL] {message}{NOCOLOR}" @@ -199,13 +194,14 @@ def main(): # mccabe:disable=MC0001 """ from sys import argv as sys_argv - debug = "-d" in sys_argv - verbose = "-v" in sys_argv - quiet = "-q" in sys_argv - try: # handover to a class instance app = Application() # debug, verbose, quiet) + app.Configure( + verbose="-v" in sys_argv, + debug="-d" in sys_argv, + quiet="-q" in sys_argv + ) app.Run() app.exit() From c24cc30aadf7f36d1ae50e7f88dc9648e6ad96ac Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 21 Mar 2023 21:22:37 +0100 Subject: [PATCH 16/27] Fixed EndOfDocumentBlock. --- pyVHDLParser/Blocks/__init__.py | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/pyVHDLParser/Blocks/__init__.py b/pyVHDLParser/Blocks/__init__.py index c54c8db31..bca6aff45 100644 --- a/pyVHDLParser/Blocks/__init__.py +++ b/pyVHDLParser/Blocks/__init__.py @@ -315,15 +315,15 @@ class Block(metaclass=MetaBlock): Base-class for all :term:`block` classes. """ - __STATES__: List = None #: List of all `state...` methods in this class. + __STATES__: List #: List of all `state...` methods in this class. - _previousBlock: 'Block' = None #: Reference to the previous block. - NextBlock: 'Block' = None #: Reference to the next block. - StartToken: Token = None #: Reference to the first token in the scope of this block. - EndToken: Token = None #: Reference to the last token in the scope of this block. - MultiPart: bool = None #: True, if this block has multiple parts. + _previousBlock: 'Block' #: Reference to the previous block. + NextBlock: 'Block' #: Reference to the next block. + StartToken: Token #: Reference to the first token in the scope of this block. + EndToken: Token #: Reference to the last token in the scope of this block. + MultiPart: bool #: True, if this block has multiple parts. - def __init__(self, previousBlock, startToken, endToken=None, multiPart=False): + def __init__(self, previousBlock: 'Block', startToken: Token, endToken: Token = None, multiPart: bool = False): """Base-class constructor for a new block instance.""" previousBlock.NextBlock = self @@ -440,16 +440,12 @@ def __repr__(self) -> str: class EndOfBlock(Block): """Base-class for a last block in a sequence of double-linked blocks.""" - def __init__(self, endToken): - self._previousBlock = None - self.NextBlock = None - self.StartToken = None - self.EndToken = endToken - self.MultiPart = False + def __init__(self, previousBlock, endToken): + super().__init__(previousBlock, endToken) # TODO: needs review: should TokenIterator be used? - def __iter__(self): - yield self.EndToken + def __iter__(self) -> Iterator[Token]: + yield self.StartToken def __len__(self) -> int: return 0 @@ -510,7 +506,7 @@ def stateDocument(cls, parserState: ParserState): return elif isinstance(token, EndOfDocumentToken): - parserState.NewBlock = EndOfDocumentBlock(token) + parserState.NewBlock = EndOfDocumentBlock(parserState.LastBlock, token) return raise BlockParserException( From f0d689a11f9cddd9ce9085277b811f5a44697636 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 21 Mar 2023 23:03:06 +0100 Subject: [PATCH 17/27] Improved BlockIterator. --- pyVHDLParser/Blocks/__init__.py | 34 +++++++++++------- pyVHDLParser/CLI/Block.py | 4 +-- pyVHDLParser/CLI/GraphML.py | 64 +++++++++++++++++++++++++++------ pyVHDLParser/Token/__init__.py | 11 +++--- 4 files changed, 83 insertions(+), 30 deletions(-) diff --git a/pyVHDLParser/Blocks/__init__.py b/pyVHDLParser/Blocks/__init__.py index bca6aff45..f930bab1b 100644 --- a/pyVHDLParser/Blocks/__init__.py +++ b/pyVHDLParser/Blocks/__init__.py @@ -235,18 +235,20 @@ def __new__(cls, className, baseClasses, classMembers: dict): @export class BlockIterator: - startBlock: 'Block' - currentBlock: 'Block' - stopBlock: 'Block' + startBlock: 'Block' + currentBlock: 'Block' + stopBlock: 'Block' + inclusiveStopBlock: bool - state: int #: internal states: 0 = normal, 1 = reached stopBlock, 2 = reached EndOfBlock + state: int #: internal states: 0 = normal, 1 = reached stopBlock, 2 = reached EndOfBlock def __init__(self, startBlock: 'Block', inclusiveStartBlock: bool=False, inclusiveStopBlock: bool=True, stopBlock: 'Block'=None): - self.startBlock = startBlock - self.currentBlock = startBlock if inclusiveStartBlock else startBlock.NextBlock - self.stopBlock = stopBlock + self.startBlock = startBlock + self.currentBlock = startBlock if inclusiveStartBlock else startBlock.NextBlock + self.stopBlock = stopBlock + self.inclusiveStopBlock = inclusiveStopBlock - self.state = 0 + self.state = 0 def __iter__(self) -> 'BlockIterator': return self @@ -258,11 +260,17 @@ def __next__(self) -> 'Block': block = self.currentBlock if block is self.stopBlock: - self.currentBlock = None - self.state = 1 + if not self.inclusiveStopBlock: + raise StopIteration(1) + else: + self.currentBlock = None + self.state = 1 elif isinstance(self.currentBlock, EndOfBlock): - self.currentBlock = None - self.state = 2 + if not self.inclusiveStopBlock: + raise StopIteration(2) + else: + self.currentBlock = None + self.state = 2 else: self.currentBlock = block.NextBlock if self.currentBlock is None: @@ -277,7 +285,7 @@ class BlockReverseIterator: currentBlock: 'Block' stopBlock: 'Block' - state: int #: internal states: 0 = normal, 1 = reached stopBlock, 2 = reached EndOfBlock + state: int #: internal states: 0 = normal, 1 = reached stopBlock, 2 = reached StartOfBlock def __init__(self, startBlock: 'Block', inclusiveStartBlock: bool=False, stopBlock: 'Block'=None): self.startBlock = startBlock diff --git a/pyVHDLParser/CLI/Block.py b/pyVHDLParser/CLI/Block.py index 21ff7bd9a..ce7def49a 100644 --- a/pyVHDLParser/CLI/Block.py +++ b/pyVHDLParser/CLI/Block.py @@ -113,8 +113,8 @@ def HandleBlockStreaming(self: FrontEndProtocol, args): print("{RED}NotImplementedError: {0!s}{NOCOLOR}".format(ex, **self.Foreground)) exporter = GraphML() - exporter.AddTokenStream(firstBlock.StartToken) - # exporter.AddBlockStream(firstBlock) + tokenStreamSubgraph = exporter.AddTokenStream(firstBlock.StartToken) + blockStreamSubgraph = exporter.AddBlockStream(firstBlock, tokenStreamSubgraph) exporter.WriteDocument(Path.cwd() / "temp/BlockStream.graphml") self.exit() diff --git a/pyVHDLParser/CLI/GraphML.py b/pyVHDLParser/CLI/GraphML.py index 42d47da04..571f765ee 100644 --- a/pyVHDLParser/CLI/GraphML.py +++ b/pyVHDLParser/CLI/GraphML.py @@ -1,5 +1,6 @@ from pyTooling.Graph import Graph, Subgraph, Vertex from pyTooling.Graph.GraphML import GraphMLDocument +from pyVHDLParser.Blocks import Block from pyVHDLParser.Token import Token @@ -11,34 +12,77 @@ def __init__(self): self._graph = Graph(name="Streams") def AddTokenStream(self, firstToken: Token): - subgraph = Subgraph(name="TokenStream", graph=self._graph) + tokenStreamSubgraph = Subgraph(name="TokenStream", graph=self._graph) - firstVertex = Vertex(vertexID=id(firstToken), value=f"{firstToken!s}", subgraph=subgraph) + firstVertex = Vertex(vertexID=id(firstToken), value=f"{firstToken!s}", subgraph=tokenStreamSubgraph) firstVertex["order"] = 0 firstVertex["kind"] = type(firstToken).__name__ tokenIterator = firstToken.GetIterator(inclusiveStopToken=False) for tokenID, token in enumerate(tokenIterator, start=1): - vertex = Vertex(vertexID=id(token), value=f"{token!s}", subgraph=subgraph) + vertex = Vertex(vertexID=id(token), value=f"{token!s}", subgraph=tokenStreamSubgraph) vertex["order"] = tokenID vertex["kind"] = type(token).__name__ tokenIterator = token.GetIterator() lastToken = next(tokenIterator) - lastVertex = Vertex(vertexID=id(lastToken), value=f"{lastToken!s}", subgraph=subgraph) + lastVertex = Vertex(vertexID=id(lastToken), value=f"{lastToken!s}", subgraph=tokenStreamSubgraph) lastVertex["order"] = tokenID + 1 lastVertex["kind"] = type(lastToken).__name__ - firstVertex.EdgeToVertex(subgraph._verticesWithID[id(firstToken.NextToken)], edgeID=f"n0_next") + firstVertex.EdgeToVertex(tokenStreamSubgraph._verticesWithID[id(firstToken.NextToken)], edgeID=f"n0_next") tokenIterator = firstToken.GetIterator(inclusiveStopToken=False) for tokenID, token in enumerate(tokenIterator, start=1): - vertex = subgraph._verticesWithID[id(token)] - vertex.EdgeToVertex(subgraph._verticesWithID[id(token.PreviousToken)], edgeID=f"n{tokenID}_prev") - vertex.EdgeToVertex(subgraph._verticesWithID[id(token.NextToken)], edgeID=f"n{tokenID}_next") + vertex = tokenStreamSubgraph._verticesWithID[id(token)] + vertex.EdgeToVertex(tokenStreamSubgraph._verticesWithID[id(token.PreviousToken)], edgeID=f"n{tokenID}_prev") + vertex.EdgeToVertex(tokenStreamSubgraph._verticesWithID[id(token.NextToken)], edgeID=f"n{tokenID}_next") tokenIterator = token.GetIterator() lastToken = next(tokenIterator) - lastVertex = subgraph._verticesWithID[id(lastToken)] - lastVertex.EdgeToVertex(subgraph._verticesWithID[id(lastToken.PreviousToken)], edgeID=f"n{tokenID + 1}_prev") + lastVertex = tokenStreamSubgraph._verticesWithID[id(lastToken)] + lastVertex.EdgeToVertex(tokenStreamSubgraph._verticesWithID[id(lastToken.PreviousToken)], edgeID=f"n{tokenID + 1}_prev") + + return tokenStreamSubgraph + + def AddBlockStream(self, firstBlock: Block, tokenStreamSubgraph: Subgraph): + blockStreamSubgraph = Subgraph(name="BlockStream", graph=self._graph) + + firstVertex = Vertex(vertexID=id(firstBlock), value=f"{firstBlock}", subgraph=blockStreamSubgraph) + firstVertex["order"] = 0 + firstVertex["kind"] = type(firstBlock).__name__ + firstLink = firstVertex.LinkToVertex(tokenStreamSubgraph._verticesWithID[id(firstBlock.StartToken)]) + firstLink["kind"] = "block2token" + + blockIterator = firstBlock.GetIterator(inclusiveStopBlock=False) + for blockID, block in enumerate(blockIterator, start=1): + vertex = Vertex(vertexID=id(block), value=f"{block!s}", subgraph=blockStreamSubgraph) + vertex["order"] = blockID + vertex["kind"] = type(block).__name__ + startTokenLink = vertex.LinkToVertex(tokenStreamSubgraph._verticesWithID[id(block.StartToken)]) + startTokenLink["kind"] = "block2token" + if block.EndToken is not block.StartToken: + endTokenLink = vertex.LinkToVertex(tokenStreamSubgraph._verticesWithID[id(block.EndToken)]) + endTokenLink["kind"] = "block2token" + + blockIterator = block.GetIterator() + lastBlock = next(blockIterator) + lastVertex = Vertex(vertexID=id(lastBlock), value=f"{lastBlock}", subgraph=blockStreamSubgraph) + lastVertex["order"] = blockID + 1 + lastVertex["kind"] = type(lastBlock).__name__ + lastLink = lastVertex.LinkToVertex(tokenStreamSubgraph._verticesWithID[id(lastBlock.StartToken)]) + lastLink["kind"] = "block2token" + + firstVertex.EdgeToVertex(blockStreamSubgraph._verticesWithID[id(firstBlock.NextBlock)], edgeID=f"n0_next") + blockIterator = firstBlock.GetIterator(inclusiveStopBlock=False) + for blockID, block in enumerate(blockIterator, start=1): + vertex = blockStreamSubgraph._verticesWithID[id(block)] + vertex.EdgeToVertex(blockStreamSubgraph._verticesWithID[id(block.PreviousBlock)], edgeID=f"n{blockID}_prev") + vertex.EdgeToVertex(blockStreamSubgraph._verticesWithID[id(block.NextBlock)], edgeID=f"n{blockID}_next") + blockIterator = block.GetIterator() + lastBlock = next(blockIterator) + lastVertex = blockStreamSubgraph._verticesWithID[id(lastBlock)] + lastVertex.EdgeToVertex(blockStreamSubgraph._verticesWithID[id(lastBlock.PreviousBlock)], edgeID=f"n{blockID + 1}_prev") + + return blockStreamSubgraph def WriteDocument(self, path): graphMLDocument = GraphMLDocument("Streams") diff --git a/pyVHDLParser/Token/__init__.py b/pyVHDLParser/Token/__init__.py index 6b923b0ba..40054db02 100644 --- a/pyVHDLParser/Token/__init__.py +++ b/pyVHDLParser/Token/__init__.py @@ -77,7 +77,7 @@ class TokenIterator: stopToken: 'Token' inclusiveStopToken: bool - state: int #: internal states: 0 = normal, 1 = reached stopToken, 2 = reached EndOfToken + state: int #: internal states: 0 = normal, 1 = reached stopToken, 2 = reached EndOfToken def __init__(self, startToken: 'Token', inclusiveStartToken: bool=False, inclusiveStopToken: bool=True, stopToken: 'Token'=None): self.startToken = startToken @@ -118,11 +118,12 @@ def __next__(self) -> 'Token': @export class TokenReverseIterator: - startToken: 'Token' - currentToken: 'Token' - stopToken: 'Token' + startToken: 'Token' + currentToken: 'Token' + stopToken: 'Token' + inclusiveStopToken: bool - state: int #: internal states: 0 = normal, 1 = reached stopToken, 2 = reached EndOfToken + state: int #: internal states: 0 = normal, 1 = reached stopToken, 2 = reached StartOfToken def __init__(self, startToken: 'Token', inclusiveStartToken: bool=False, inclusiveStopToken: bool=True, stopToken: 'Token'=None): self.startToken = startToken From 6d43a0a4ffac649b2fc5afbdde950350e5a1669e Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 26 Mar 2023 00:00:36 +0100 Subject: [PATCH 18/27] Code cleanup. --- .../Blocks/Assignment/SignalAssignment.py | 10 +- .../Blocks/Assignment/VariableAssignment.py | 10 +- .../Blocks/Attribute/AttributeDeclaration.py | 26 +-- .../Attribute/AttributeSpecification.py | 26 +-- pyVHDLParser/Blocks/Comment.py | 14 +- pyVHDLParser/Blocks/Common.py | 4 +- pyVHDLParser/Blocks/ControlStructure/Case.py | 18 +- pyVHDLParser/Blocks/ControlStructure/Exit.py | 14 +- .../Blocks/ControlStructure/ForLoop.py | 16 +- pyVHDLParser/Blocks/ControlStructure/If.py | 16 +- pyVHDLParser/Blocks/ControlStructure/Next.py | 14 +- pyVHDLParser/Blocks/ControlStructure/Null.py | 6 +- .../Blocks/ControlStructure/Return.py | 6 +- .../Blocks/ControlStructure/WhileLoop.py | 12 +- pyVHDLParser/Blocks/Expression.py | 20 +-- pyVHDLParser/Blocks/Generate/CaseGenerate.py | 12 +- pyVHDLParser/Blocks/Generate/ForGenerate.py | 14 +- pyVHDLParser/Blocks/Generate/IfGenerate.py | 38 ++--- pyVHDLParser/Blocks/Generic.py | 14 +- pyVHDLParser/Blocks/Generic1.py | 24 +-- .../Instantiation/EntityInstantiation.py | 10 +- .../Instantiation/FunctionInstantiation.py | 10 +- .../Instantiation/PackageInstantiation.py | 10 +- .../Instantiation/ProcedureInstantiation.py | 10 +- pyVHDLParser/Blocks/InterfaceObject.py | 34 ++-- pyVHDLParser/Blocks/List/GenericList.py | 10 +- pyVHDLParser/Blocks/List/GenericMapList.py | 16 +- pyVHDLParser/Blocks/List/ParameterList.py | 12 +- pyVHDLParser/Blocks/List/PortList.py | 10 +- pyVHDLParser/Blocks/List/PortMapList.py | 16 +- pyVHDLParser/Blocks/List/SensitivityList.py | 12 +- pyVHDLParser/Blocks/Object/Constant.py | 4 +- pyVHDLParser/Blocks/Object/SharedVariable.py | 12 +- pyVHDLParser/Blocks/Object/Signal.py | 4 +- pyVHDLParser/Blocks/Object/Variable.py | 4 +- pyVHDLParser/Blocks/Object/__init__.py | 16 +- pyVHDLParser/Blocks/Reference/Context.py | 12 +- pyVHDLParser/Blocks/Reference/Library.py | 14 +- pyVHDLParser/Blocks/Reference/Use.py | 30 ++-- pyVHDLParser/Blocks/Reporting/Assert.py | 26 +-- pyVHDLParser/Blocks/Reporting/Report.py | 18 +- pyVHDLParser/Blocks/Sequential/Function.py | 28 +-- pyVHDLParser/Blocks/Sequential/Package.py | 10 +- pyVHDLParser/Blocks/Sequential/PackageBody.py | 10 +- pyVHDLParser/Blocks/Sequential/Procedure.py | 14 +- pyVHDLParser/Blocks/Sequential/Process.py | 10 +- .../Blocks/Structural/Architecture.py | 18 +- pyVHDLParser/Blocks/Structural/Block.py | 10 +- pyVHDLParser/Blocks/Structural/Component.py | 12 +- .../Blocks/Structural/Configuration.py | 12 +- pyVHDLParser/Blocks/Structural/Entity.py | 10 +- pyVHDLParser/Blocks/Type/SubType.py | 26 +-- pyVHDLParser/Blocks/Type/Type.py | 26 +-- pyVHDLParser/Blocks/__init__.py | 132 ++++++++------- pyVHDLParser/CLI/Block.py | 6 +- pyVHDLParser/CLI/GraphML.py | 43 +++++ pyVHDLParser/CLI/Group.py | 27 ++- .../DocumentModel/DesignUnit/Architecture.py | 6 +- .../DocumentModel/DesignUnit/Context.py | 10 +- .../DocumentModel/DesignUnit/Entity.py | 12 +- .../DocumentModel/DesignUnit/Package.py | 8 +- .../DocumentModel/DesignUnit/PackageBody.py | 14 +- pyVHDLParser/Groups/Comment.py | 12 +- pyVHDLParser/Groups/Concurrent.py | 8 +- pyVHDLParser/Groups/DesignUnit.py | 160 +++++++----------- pyVHDLParser/Groups/List.py | 66 +++----- pyVHDLParser/Groups/Object.py | 8 +- pyVHDLParser/Groups/Reference.py | 6 +- pyVHDLParser/Groups/Sequential/Function.py | 65 +++---- pyVHDLParser/Groups/Sequential/Procedure.py | 57 +++---- pyVHDLParser/Groups/Sequential/Process.py | 69 ++++---- pyVHDLParser/Groups/__init__.py | 92 +++++----- test/BlockParserTests/TestSuite.py | 2 +- 73 files changed, 787 insertions(+), 806 deletions(-) diff --git a/pyVHDLParser/Blocks/Assignment/SignalAssignment.py b/pyVHDLParser/Blocks/Assignment/SignalAssignment.py index cc0215941..5cd70e292 100644 --- a/pyVHDLParser/Blocks/Assignment/SignalAssignment.py +++ b/pyVHDLParser/Blocks/Assignment/SignalAssignment.py @@ -31,7 +31,7 @@ from pyVHDLParser.Token import CharacterToken, SpaceToken, WordToken, LinebreakToken from pyVHDLParser.Token.Keywords import BoundaryToken, IdentifierToken, EndToken -from pyVHDLParser.Blocks import BlockParserException, Block, ParserState +from pyVHDLParser.Blocks import BlockParserException, Block, TokenToBlockParser from pyVHDLParser.Blocks.Common import LinebreakBlock, WhitespaceBlock from pyVHDLParser.Blocks.Comment import SingleLineCommentBlock, MultiLineCommentBlock @@ -39,7 +39,7 @@ @export class SignalAssignmentBlock(Block): @classmethod - def stateSignalAssignmentKeyword(cls, parserState: ParserState): + def stateSignalAssignmentKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected whitespace after keyword SignalAssignment." if isinstance(token, CharacterToken): @@ -73,7 +73,7 @@ def stateSignalAssignmentKeyword(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected signalAssignment name (identifier)." if isinstance(token, CharacterToken): @@ -112,7 +112,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateSignalAssignmentName(cls, parserState: ParserState): + def stateSignalAssignmentName(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ';' after signalAssignment name." if isinstance(token, CharacterToken): @@ -150,7 +150,7 @@ def stateSignalAssignmentName(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateWhitespace2(cls, parserState: ParserState): + def stateWhitespace2(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ';'." if isinstance(token, CharacterToken): diff --git a/pyVHDLParser/Blocks/Assignment/VariableAssignment.py b/pyVHDLParser/Blocks/Assignment/VariableAssignment.py index cc0215941..5cd70e292 100644 --- a/pyVHDLParser/Blocks/Assignment/VariableAssignment.py +++ b/pyVHDLParser/Blocks/Assignment/VariableAssignment.py @@ -31,7 +31,7 @@ from pyVHDLParser.Token import CharacterToken, SpaceToken, WordToken, LinebreakToken from pyVHDLParser.Token.Keywords import BoundaryToken, IdentifierToken, EndToken -from pyVHDLParser.Blocks import BlockParserException, Block, ParserState +from pyVHDLParser.Blocks import BlockParserException, Block, TokenToBlockParser from pyVHDLParser.Blocks.Common import LinebreakBlock, WhitespaceBlock from pyVHDLParser.Blocks.Comment import SingleLineCommentBlock, MultiLineCommentBlock @@ -39,7 +39,7 @@ @export class SignalAssignmentBlock(Block): @classmethod - def stateSignalAssignmentKeyword(cls, parserState: ParserState): + def stateSignalAssignmentKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected whitespace after keyword SignalAssignment." if isinstance(token, CharacterToken): @@ -73,7 +73,7 @@ def stateSignalAssignmentKeyword(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected signalAssignment name (identifier)." if isinstance(token, CharacterToken): @@ -112,7 +112,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateSignalAssignmentName(cls, parserState: ParserState): + def stateSignalAssignmentName(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ';' after signalAssignment name." if isinstance(token, CharacterToken): @@ -150,7 +150,7 @@ def stateSignalAssignmentName(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateWhitespace2(cls, parserState: ParserState): + def stateWhitespace2(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ';'." if isinstance(token, CharacterToken): diff --git a/pyVHDLParser/Blocks/Attribute/AttributeDeclaration.py b/pyVHDLParser/Blocks/Attribute/AttributeDeclaration.py index 3a7243d85..b8ff20fa8 100644 --- a/pyVHDLParser/Blocks/Attribute/AttributeDeclaration.py +++ b/pyVHDLParser/Blocks/Attribute/AttributeDeclaration.py @@ -31,7 +31,7 @@ from pyVHDLParser.Token import CharacterToken, LinebreakToken, SpaceToken, WordToken from pyVHDLParser.Token.Keywords import BoundaryToken, IdentifierToken, VariableAssignmentKeyword, EndToken -from pyVHDLParser.Blocks import Block, ParserState +from pyVHDLParser.Blocks import Block, TokenToBlockParser from pyVHDLParser.Blocks.Comment import SingleLineCommentBlock, MultiLineCommentBlock from pyVHDLParser.Blocks.Common import LinebreakBlock, WhitespaceBlock @@ -39,7 +39,7 @@ @export class AttributeDeclarationBlock(Block): @classmethod - def stateAttributeDeclarationKeyword(cls, parserState: ParserState): + def stateAttributeDeclarationKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected whitespace after keyword ATTRIBUTE." if isinstance(token, CharacterToken): @@ -73,7 +73,7 @@ def stateAttributeDeclarationKeyword(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected attribute name (identifier)." if isinstance(token, CharacterToken): @@ -112,7 +112,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def stateAttributeDeclarationName(cls, parserState: ParserState): + def stateAttributeDeclarationName(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ';' after library name." if isinstance(token, CharacterToken): @@ -149,7 +149,7 @@ def stateAttributeDeclarationName(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def stateWhitespace2(cls, parserState: ParserState): + def stateWhitespace2(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected attribute name (identifier)." if isinstance(token, CharacterToken): @@ -192,7 +192,7 @@ def stateWhitespace2(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def stateColon1(cls, parserState: ParserState): + def stateColon1(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected type mark or whitespace after ':'." if isinstance(token, CharacterToken): @@ -230,7 +230,7 @@ def stateColon1(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def stateWhitespace3(cls, parserState: ParserState): + def stateWhitespace3(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected type mark (identifier)." if isinstance(token, CharacterToken): @@ -269,7 +269,7 @@ def stateWhitespace3(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def stateTypeMarkName(cls, parserState: ParserState): + def stateTypeMarkName(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ':=' or whitespace after type mark." if isinstance(token, CharacterToken): @@ -306,7 +306,7 @@ def stateTypeMarkName(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def stateWhitespace4(cls, parserState: ParserState): + def stateWhitespace4(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ':=' after type mark." if isinstance(token, CharacterToken): @@ -345,7 +345,7 @@ def stateWhitespace4(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def statePossibleVariableAssignment(cls, parserState: ParserState): + def statePossibleVariableAssignment(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == "="): parserState.NewToken = VariableAssignmentKeyword(parserState.TokenMarker) @@ -356,7 +356,7 @@ def statePossibleVariableAssignment(cls, parserState: ParserState): raise NotImplementedError("State=PossibleCommentStart: {0!r}".format(token)) @classmethod - def stateVariableAssignment(cls, parserState: ParserState): + def stateVariableAssignment(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ':=' or whitespace after attributeDeclaration mark." if isinstance(token, CharacterToken): @@ -389,7 +389,7 @@ def stateVariableAssignment(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def stateWhitespace5(cls, parserState: ParserState): + def stateWhitespace5(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected expression after ':='." if isinstance(token, CharacterToken): @@ -427,7 +427,7 @@ def stateWhitespace5(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def stateExpressionEnd(cls, parserState: ParserState): + def stateExpressionEnd(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ';'." if isinstance(token, CharacterToken): diff --git a/pyVHDLParser/Blocks/Attribute/AttributeSpecification.py b/pyVHDLParser/Blocks/Attribute/AttributeSpecification.py index 3020f8370..c12679208 100644 --- a/pyVHDLParser/Blocks/Attribute/AttributeSpecification.py +++ b/pyVHDLParser/Blocks/Attribute/AttributeSpecification.py @@ -31,7 +31,7 @@ from pyVHDLParser.Token import CharacterToken, LinebreakToken, SpaceToken, WordToken from pyVHDLParser.Token.Keywords import BoundaryToken, IdentifierToken, VariableAssignmentKeyword, EndToken -from pyVHDLParser.Blocks import Block, ParserState +from pyVHDLParser.Blocks import Block, TokenToBlockParser from pyVHDLParser.Blocks.Common import LinebreakBlock, WhitespaceBlock from pyVHDLParser.Blocks.Comment import SingleLineCommentBlock, MultiLineCommentBlock @@ -39,7 +39,7 @@ @export class AttributeSpecificationBlock(Block): @classmethod - def stateAttributeSpecificationKeyword(cls, parserState: ParserState): + def stateAttributeSpecificationKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected whitespace after keyword ATTRIBUTE." if isinstance(token, CharacterToken): @@ -73,7 +73,7 @@ def stateAttributeSpecificationKeyword(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected attribute name (identifier)." if isinstance(token, CharacterToken): @@ -112,7 +112,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def stateAttributeSpecificationName(cls, parserState: ParserState): + def stateAttributeSpecificationName(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ';' after library name." if isinstance(token, CharacterToken): @@ -149,7 +149,7 @@ def stateAttributeSpecificationName(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def stateWhitespace2(cls, parserState: ParserState): + def stateWhitespace2(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected attribute name (identifier)." if isinstance(token, CharacterToken): @@ -192,7 +192,7 @@ def stateWhitespace2(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def stateColon1(cls, parserState: ParserState): + def stateColon1(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected type mark or whitespace after ':'." if isinstance(token, CharacterToken): @@ -230,7 +230,7 @@ def stateColon1(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def stateWhitespace3(cls, parserState: ParserState): + def stateWhitespace3(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected type mark (identifier)." if isinstance(token, CharacterToken): @@ -269,7 +269,7 @@ def stateWhitespace3(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def stateTypeMarkName(cls, parserState: ParserState): + def stateTypeMarkName(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ':=' or whitespace after type mark." if isinstance(token, CharacterToken): @@ -306,7 +306,7 @@ def stateTypeMarkName(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def stateWhitespace4(cls, parserState: ParserState): + def stateWhitespace4(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ':=' after type mark." if isinstance(token, CharacterToken): @@ -345,7 +345,7 @@ def stateWhitespace4(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def statePossibleVariableAssignment(cls, parserState: ParserState): + def statePossibleVariableAssignment(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == "="): parserState.NewToken = VariableAssignmentKeyword(parserState.TokenMarker) @@ -356,7 +356,7 @@ def statePossibleVariableAssignment(cls, parserState: ParserState): raise NotImplementedError("State=PossibleCommentStart: {0!r}".format(token)) @classmethod - def stateVariableAssignment(cls, parserState: ParserState): + def stateVariableAssignment(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ':=' or whitespace after attributeSpecification mark." if isinstance(token, CharacterToken): @@ -389,7 +389,7 @@ def stateVariableAssignment(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def stateWhitespace5(cls, parserState: ParserState): + def stateWhitespace5(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected expression after ':='." if isinstance(token, CharacterToken): @@ -427,7 +427,7 @@ def stateWhitespace5(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def stateExpressionEnd(cls, parserState: ParserState): + def stateExpressionEnd(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ';'." if isinstance(token, CharacterToken): diff --git a/pyVHDLParser/Blocks/Comment.py b/pyVHDLParser/Blocks/Comment.py index e8cf9743f..0e2fd9ebb 100644 --- a/pyVHDLParser/Blocks/Comment.py +++ b/pyVHDLParser/Blocks/Comment.py @@ -31,14 +31,14 @@ from pyVHDLParser.Token import CharacterToken, SpaceToken, IndentationToken from pyVHDLParser.Token.Keywords import SingleLineCommentKeyword, MultiLineCommentStartKeyword, MultiLineCommentEndKeyword -from pyVHDLParser.Blocks import CommentBlock, ParserState +from pyVHDLParser.Blocks import CommentBlock, TokenToBlockParser from pyVHDLParser.Blocks.Common import IndentationBlock @export class SingleLineCommentBlock(CommentBlock): @classmethod - def statePossibleCommentStart(cls, parserState: ParserState): + def statePossibleCommentStart(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == "-"): parserState.NewToken = SingleLineCommentKeyword(parserState.TokenMarker) @@ -49,7 +49,7 @@ def statePossibleCommentStart(cls, parserState: ParserState): raise NotImplementedError("State=PossibleCommentStart: {0!r}".format(token)) @classmethod - def stateConsumeComment(cls, parserState: ParserState): + def stateConsumeComment(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken)and (token == "\n"): parserState.NewBlock = SingleLineCommentBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.Token) @@ -59,7 +59,7 @@ def stateConsumeComment(cls, parserState: ParserState): pass # consume everything until "\n" @classmethod - def stateLinebreak(cls, parserState: ParserState): + def stateLinebreak(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = IndentationToken(fromExistingToken=token) @@ -77,7 +77,7 @@ def stateLinebreak(cls, parserState: ParserState): @export class MultiLineCommentBlock(CommentBlock): @classmethod - def statePossibleCommentStart(cls, parserState: ParserState): + def statePossibleCommentStart(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == "*"): parserState.NewToken = MultiLineCommentStartKeyword(parserState.TokenMarker) @@ -90,7 +90,7 @@ def statePossibleCommentStart(cls, parserState: ParserState): parserState.NextState(parserState) @classmethod - def stateConsumeComment(cls, parserState: ParserState): + def stateConsumeComment(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == "*"): parserState.PushState = cls.statePossibleCommentEnd @@ -100,7 +100,7 @@ def stateConsumeComment(cls, parserState: ParserState): pass # consume everything until "*/" @classmethod - def statePossibleCommentEnd(cls, parserState: ParserState): + def statePossibleCommentEnd(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == "/"): parserState.NewToken = MultiLineCommentEndKeyword(parserState.TokenMarker) diff --git a/pyVHDLParser/Blocks/Common.py b/pyVHDLParser/Blocks/Common.py index c9a2e3a67..22124b08e 100644 --- a/pyVHDLParser/Blocks/Common.py +++ b/pyVHDLParser/Blocks/Common.py @@ -30,7 +30,7 @@ from pyTooling.Decorators import export from pyVHDLParser.Token import SpaceToken, IndentationToken -from pyVHDLParser.Blocks import ParserState, SkipableBlock +from pyVHDLParser.Blocks import TokenToBlockParser, SkipableBlock @export @@ -50,7 +50,7 @@ def __repr__(self): @export class LinebreakBlock(WhitespaceBlock): @classmethod - def stateLinebreak(cls, parserState: ParserState): + def stateLinebreak(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = IndentationToken(fromExistingToken=token) diff --git a/pyVHDLParser/Blocks/ControlStructure/Case.py b/pyVHDLParser/Blocks/ControlStructure/Case.py index 249f0a936..fb04a0c7d 100644 --- a/pyVHDLParser/Blocks/ControlStructure/Case.py +++ b/pyVHDLParser/Blocks/ControlStructure/Case.py @@ -31,7 +31,7 @@ from pyVHDLParser.Token import CharacterToken, LinebreakToken, SpaceToken, IndentationToken, CommentToken, MultiLineCommentToken, SingleLineCommentToken from pyVHDLParser.Token.Keywords import WordToken, BoundaryToken, CaseKeyword, WhenKeyword, IsKeyword, EndKeyword, MapAssociationKeyword -from pyVHDLParser.Blocks import BlockParserException, Block, CommentBlock, ParserState +from pyVHDLParser.Blocks import BlockParserException, Block, CommentBlock, TokenToBlockParser from pyVHDLParser.Blocks.Common import LinebreakBlock, IndentationBlock, WhitespaceBlock from pyVHDLParser.Blocks.Generic import SequentialBeginBlock from pyVHDLParser.Blocks.Generic1 import EndBlock as EndBlockBase @@ -49,11 +49,11 @@ class ArrowBlock(SequentialBeginBlock): END_BLOCK = EndBlock @classmethod - def stateArrowKeyword(cls, parserState: ParserState): + def stateArrowKeyword(cls, parserState: TokenToBlockParser): cls.stateSequentialRegion(parserState) @classmethod - def stateSequentialRegion(cls, parserState: ParserState): + def stateSequentialRegion(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken) and (token <= "when"): newToken = WhenKeyword(fromExistingToken=token) @@ -77,7 +77,7 @@ class WhenBlock(SequentialBeginBlock): END_BLOCK = EndBlock @classmethod - def stateWhenKeyword(cls, parserState: ParserState): + def stateWhenKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == "("): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -106,7 +106,7 @@ def stateWhenKeyword(cls, parserState: ParserState): return @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, LinebreakToken): if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): @@ -142,7 +142,7 @@ class IsBlock(SequentialBeginBlock): END_BLOCK = None @classmethod - def stateIsKeyword(cls, parserState: ParserState): + def stateIsKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): blockType = IndentationBlock if isinstance(token, IndentationToken) else WhitespaceBlock @@ -160,7 +160,7 @@ def stateIsKeyword(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after keyword IS.", token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): tokenValue = token.Value.lower() @@ -207,7 +207,7 @@ class CaseExpressionBlock(ExpressionBlockEndedByKeywordORClosingRoundBracket): @export class CaseBlock(Block): @classmethod - def stateCaseKeyword(cls, parserState: ParserState): + def stateCaseKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == "("): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -236,7 +236,7 @@ def stateCaseKeyword(cls, parserState: ParserState): return @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, LinebreakToken): if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): diff --git a/pyVHDLParser/Blocks/ControlStructure/Exit.py b/pyVHDLParser/Blocks/ControlStructure/Exit.py index 47cb226c2..aa7b1fa11 100644 --- a/pyVHDLParser/Blocks/ControlStructure/Exit.py +++ b/pyVHDLParser/Blocks/ControlStructure/Exit.py @@ -32,7 +32,7 @@ from pyVHDLParser.Token import SpaceToken, LinebreakToken, CommentToken, IndentationToken, SingleLineCommentToken, MultiLineCommentToken from pyVHDLParser.Token import WordToken, ExtendedIdentifier, CharacterToken from pyVHDLParser.Token.Keywords import BoundaryToken, IdentifierToken, EndToken, WhenKeyword -from pyVHDLParser.Blocks import Block, ParserState, CommentBlock, BlockParserException +from pyVHDLParser.Blocks import Block, TokenToBlockParser, CommentBlock, BlockParserException from pyVHDLParser.Blocks.Common import LinebreakBlock, WhitespaceBlock from pyVHDLParser.Blocks.Generic1 import EndOfStatementBlock from pyVHDLParser.Blocks.Expression import ExpressionBlockEndedBySemicolon @@ -51,7 +51,7 @@ class ExitConditionBlock(ExpressionBlockEndedBySemicolon): @export class ExitBlock(Block): @classmethod - def stateExitKeyword(cls, parserState: ParserState): + def stateExitKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) @@ -75,7 +75,7 @@ def stateExitKeyword(cls, parserState: ParserState): raise BlockParserException("Expected ';' or whitespace after keyword EXIT.", token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) @@ -111,7 +111,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise BlockParserException("Expected ';', keyword WHEN or loop label.", token) @classmethod - def stateExitLoopLabel(cls, parserState: ParserState): + def stateExitLoopLabel(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) @@ -135,7 +135,7 @@ def stateExitLoopLabel(cls, parserState: ParserState): raise BlockParserException("Expected ';' or whitespace after loop label.", token) @classmethod - def stateWhitespace2(cls, parserState: ParserState): + def stateWhitespace2(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) @@ -162,7 +162,7 @@ def stateWhitespace2(cls, parserState: ParserState): raise BlockParserException("Expected ';' or keyword WHEN.", token) @classmethod - def stateWhenKeyword(cls, parserState: ParserState): + def stateWhenKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken): if (token == ";"): @@ -192,7 +192,7 @@ def stateWhenKeyword(cls, parserState: ParserState): raise BlockParserException("Expected ';' or whitespace after keyword RETURN.", token) @classmethod - def stateWhitespace3(cls, parserState: ParserState): + def stateWhitespace3(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) diff --git a/pyVHDLParser/Blocks/ControlStructure/ForLoop.py b/pyVHDLParser/Blocks/ControlStructure/ForLoop.py index eb5dbd0b6..914be83bf 100644 --- a/pyVHDLParser/Blocks/ControlStructure/ForLoop.py +++ b/pyVHDLParser/Blocks/ControlStructure/ForLoop.py @@ -31,7 +31,7 @@ from pyVHDLParser.Token import LinebreakToken, CommentToken, MultiLineCommentToken, IndentationToken, SingleLineCommentToken, ExtendedIdentifier, CharacterToken, SpaceToken from pyVHDLParser.Token.Keywords import InKeyword, ForKeyword, LoopKeyword, BoundaryToken, IdentifierToken, WordToken -from pyVHDLParser.Blocks import BlockParserException, Block, CommentBlock, ParserState +from pyVHDLParser.Blocks import BlockParserException, Block, CommentBlock, TokenToBlockParser from pyVHDLParser.Blocks.Common import LinebreakBlock, WhitespaceBlock from pyVHDLParser.Blocks.Generic import SequentialBeginBlock from pyVHDLParser.Blocks.Generic1 import EndBlock as EndBlockBase @@ -41,7 +41,7 @@ @export class IteratorBlock(Block): @classmethod - def stateForKeyword(cls, parserState: ParserState): + def stateForKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -58,7 +58,7 @@ def stateForKeyword(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after keyword FOR.", token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): parserState.NewToken = IdentifierToken(fromExistingToken=token) @@ -91,7 +91,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise BlockParserException("Expected iterator name (identifier).", token) @classmethod - def stateIteratorName(cls, parserState: ParserState): + def stateIteratorName(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -108,7 +108,7 @@ def stateIteratorName(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after iterator name.", token) @classmethod - def stateWhitespace2(cls, parserState: ParserState): + def stateWhitespace2(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken) and (token <= "in"): parserState.NewToken = InKeyword(fromExistingToken=token) @@ -140,7 +140,7 @@ def stateWhitespace2(cls, parserState: ParserState): raise BlockParserException("Expected keyword IN after iterator name.", token) @classmethod - def stateInKeyword(cls, parserState: ParserState): + def stateInKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == "("): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -164,7 +164,7 @@ def stateInKeyword(cls, parserState: ParserState): raise BlockParserException("Expected '(' or whitespace after keyword IN.", token) @classmethod - def stateWhitespace3(cls, parserState: ParserState): + def stateWhitespace3(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, LinebreakToken): if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): @@ -208,7 +208,7 @@ class LoopBlock(SequentialBeginBlock): END_BLOCK = EndBlock @classmethod - def stateLoopKeyword(cls, parserState: ParserState): + def stateLoopKeyword(cls, parserState: TokenToBlockParser): parserState.NextState = cls.stateSequentialRegion parserState.NextState(parserState) diff --git a/pyVHDLParser/Blocks/ControlStructure/If.py b/pyVHDLParser/Blocks/ControlStructure/If.py index 14b6b9bfd..7eaef87c5 100644 --- a/pyVHDLParser/Blocks/ControlStructure/If.py +++ b/pyVHDLParser/Blocks/ControlStructure/If.py @@ -31,7 +31,7 @@ from pyVHDLParser.Token import CharacterToken, LinebreakToken, SpaceToken, IndentationToken, CommentToken, MultiLineCommentToken, SingleLineCommentToken from pyVHDLParser.Token.Keywords import WordToken, BoundaryToken, IfKeyword, ThenKeyword, ElsIfKeyword, ElseKeyword -from pyVHDLParser.Blocks import Block, CommentBlock, ParserState +from pyVHDLParser.Blocks import Block, CommentBlock, TokenToBlockParser from pyVHDLParser.Blocks.Common import LinebreakBlock, WhitespaceBlock from pyVHDLParser.Blocks.Generic import SequentialBeginBlock from pyVHDLParser.Blocks.Generic1 import EndBlock as EndBlockBase @@ -49,11 +49,11 @@ class ThenBlock(SequentialBeginBlock): END_BLOCK = EndBlock @classmethod - def stateThenKeyword(cls, parserState: ParserState): + def stateThenKeyword(cls, parserState: TokenToBlockParser): cls.stateSequentialRegion(parserState) @classmethod - def stateSequentialRegion(cls, parserState: ParserState): + def stateSequentialRegion(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): tokenValue = token.Value.lower() @@ -80,7 +80,7 @@ class ElseBlock(SequentialBeginBlock): END_BLOCK = EndBlock @classmethod - def stateElseKeyword(cls, parserState: ParserState): + def stateElseKeyword(cls, parserState: TokenToBlockParser): cls.stateSequentialRegion(parserState) @@ -93,7 +93,7 @@ class ExpressionBlockEndedByThen(ExpressionBlockEndedByKeywordORClosingRoundBrac @export class IfConditionBlock(Block): @classmethod - def stateIfKeyword(cls, parserState: ParserState): + def stateIfKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == "("): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -122,7 +122,7 @@ def stateIfKeyword(cls, parserState: ParserState): return @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, LinebreakToken): if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): @@ -156,7 +156,7 @@ def stateWhitespace1(cls, parserState: ParserState): @export class ElsIfConditionBlock(Block): @classmethod - def stateElsIfKeyword(cls, parserState: ParserState): + def stateElsIfKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == "("): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -185,7 +185,7 @@ def stateElsIfKeyword(cls, parserState: ParserState): return @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, LinebreakToken): if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): diff --git a/pyVHDLParser/Blocks/ControlStructure/Next.py b/pyVHDLParser/Blocks/ControlStructure/Next.py index 2cd381fcf..df64c9efe 100644 --- a/pyVHDLParser/Blocks/ControlStructure/Next.py +++ b/pyVHDLParser/Blocks/ControlStructure/Next.py @@ -32,7 +32,7 @@ from pyVHDLParser.Token import SpaceToken, LinebreakToken, CommentToken, IndentationToken, SingleLineCommentToken, MultiLineCommentToken from pyVHDLParser.Token import WordToken, ExtendedIdentifier, CharacterToken from pyVHDLParser.Token.Keywords import BoundaryToken, IdentifierToken, EndToken, WhenKeyword -from pyVHDLParser.Blocks import Block, ParserState, CommentBlock, BlockParserException +from pyVHDLParser.Blocks import Block, TokenToBlockParser, CommentBlock, BlockParserException from pyVHDLParser.Blocks.Common import LinebreakBlock, WhitespaceBlock from pyVHDLParser.Blocks.Generic1 import EndOfStatementBlock from pyVHDLParser.Blocks.Expression import ExpressionBlockEndedBySemicolon @@ -51,7 +51,7 @@ class NextConditionBlock(ExpressionBlockEndedBySemicolon): @export class NextBlock(Block): @classmethod - def stateNextKeyword(cls, parserState: ParserState): + def stateNextKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) @@ -75,7 +75,7 @@ def stateNextKeyword(cls, parserState: ParserState): raise BlockParserException("Expected ';' or whitespace after keyword EXIT.", token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) @@ -111,7 +111,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise BlockParserException("Expected ';', keyword WHEN or loop label.", token) @classmethod - def stateNextLoopLabel(cls, parserState: ParserState): + def stateNextLoopLabel(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) @@ -135,7 +135,7 @@ def stateNextLoopLabel(cls, parserState: ParserState): raise BlockParserException("Expected ';' or whitespace after loop label.", token) @classmethod - def stateWhitespace2(cls, parserState: ParserState): + def stateWhitespace2(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) @@ -162,7 +162,7 @@ def stateWhitespace2(cls, parserState: ParserState): raise BlockParserException("Expected ';' or keyword WHEN.", token) @classmethod - def stateWhenKeyword(cls, parserState: ParserState): + def stateWhenKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken): if (token == ";"): @@ -192,7 +192,7 @@ def stateWhenKeyword(cls, parserState: ParserState): raise BlockParserException("Expected ';' or whitespace after keyword RETURN.", token) @classmethod - def stateWhitespace3(cls, parserState: ParserState): + def stateWhitespace3(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) diff --git a/pyVHDLParser/Blocks/ControlStructure/Null.py b/pyVHDLParser/Blocks/ControlStructure/Null.py index f4fd26eb2..7851db70a 100644 --- a/pyVHDLParser/Blocks/ControlStructure/Null.py +++ b/pyVHDLParser/Blocks/ControlStructure/Null.py @@ -32,7 +32,7 @@ from pyVHDLParser.Token import SpaceToken, LinebreakToken, CommentToken, IndentationToken, SingleLineCommentToken, MultiLineCommentToken from pyVHDLParser.Token import CharacterToken from pyVHDLParser.Token.Keywords import BoundaryToken, EndToken -from pyVHDLParser.Blocks import Block, ParserState, CommentBlock, BlockParserException +from pyVHDLParser.Blocks import Block, TokenToBlockParser, CommentBlock, BlockParserException from pyVHDLParser.Blocks.Common import LinebreakBlock, WhitespaceBlock from pyVHDLParser.Blocks.Generic1 import EndOfStatementBlock @@ -45,7 +45,7 @@ class EndBlock(EndOfStatementBlock): @export class NullBlock(Block): @classmethod - def stateNullKeyword(cls, parserState: ParserState): + def stateNullKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) @@ -66,7 +66,7 @@ def stateNullKeyword(cls, parserState: ParserState): raise BlockParserException("Expected ';' or whitespace after keyword NULL.", token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) diff --git a/pyVHDLParser/Blocks/ControlStructure/Return.py b/pyVHDLParser/Blocks/ControlStructure/Return.py index 20b19291d..c3743a144 100644 --- a/pyVHDLParser/Blocks/ControlStructure/Return.py +++ b/pyVHDLParser/Blocks/ControlStructure/Return.py @@ -31,7 +31,7 @@ from pyVHDLParser.Token import CommentToken, CharacterToken, SpaceToken, LinebreakToken, IndentationToken, SingleLineCommentToken, MultiLineCommentToken from pyVHDLParser.Token.Keywords import BoundaryToken, EndToken -from pyVHDLParser.Blocks import Block, ParserState, BlockParserException, CommentBlock +from pyVHDLParser.Blocks import Block, TokenToBlockParser, BlockParserException, CommentBlock from pyVHDLParser.Blocks.Generic1 import EndOfStatementBlock from pyVHDLParser.Blocks.Common import LinebreakBlock, WhitespaceBlock from pyVHDLParser.Blocks.Expression import ExpressionBlockEndedBySemicolon @@ -50,7 +50,7 @@ class ReturnExpressionBlock(ExpressionBlockEndedBySemicolon): @export class ReturnBlock(Block): @classmethod - def stateReturnKeyword(cls, parserState: ParserState): + def stateReturnKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken): if (token == ";"): @@ -80,7 +80,7 @@ def stateReturnKeyword(cls, parserState: ParserState): raise BlockParserException("Expected ';' or whitespace after keyword RETURN.", token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) diff --git a/pyVHDLParser/Blocks/ControlStructure/WhileLoop.py b/pyVHDLParser/Blocks/ControlStructure/WhileLoop.py index 34b1b550d..4e43b5d4c 100644 --- a/pyVHDLParser/Blocks/ControlStructure/WhileLoop.py +++ b/pyVHDLParser/Blocks/ControlStructure/WhileLoop.py @@ -33,7 +33,7 @@ from pyVHDLParser.Token.Keywords import BoundaryToken, IdentifierToken, LoopKeyword from pyVHDLParser.Token.Keywords import IsKeyword, EndKeyword, GenericKeyword, PortKeyword from pyVHDLParser.Token.Parser import SpaceToken, WordToken -from pyVHDLParser.Blocks import BlockParserException, Block, ParserState +from pyVHDLParser.Blocks import BlockParserException, Block, TokenToBlockParser from pyVHDLParser.Blocks.Common import LinebreakBlock, IndentationBlock, WhitespaceBlock from pyVHDLParser.Blocks.Comment import SingleLineCommentBlock, MultiLineCommentBlock from pyVHDLParser.Blocks.Generic import EndBlock as EndBlockBase @@ -43,7 +43,7 @@ @export class ConditionBlock(Block): @classmethod - def stateWhileKeyword(cls, parserState: ParserState): + def stateWhileKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected whitespace after keyword WHILE." if isinstance(token, CharacterToken): @@ -77,7 +77,7 @@ def stateWhileKeyword(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected while name (identifier)." if isinstance(token, CharacterToken): @@ -116,7 +116,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateWhileName(cls, parserState: ParserState): + def stateWhileName(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected whitespace after keyword WHILE." if isinstance(token, CharacterToken): @@ -149,7 +149,7 @@ def stateWhileName(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateWhitespace2(cls, parserState: ParserState): + def stateWhitespace2(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected keyword IS after while name." if isinstance(token, CharacterToken): @@ -189,7 +189,7 @@ def stateWhitespace2(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateDeclarativeRegion(cls, parserState: ParserState): + def stateDeclarativeRegion(cls, parserState: TokenToBlockParser): errorMessage = "Expected one of these keywords: generic, port, begin, end." token = parserState.Token if isinstance(parserState.Token, CharacterToken): diff --git a/pyVHDLParser/Blocks/Expression.py b/pyVHDLParser/Blocks/Expression.py index 85b0ce7ae..46a5a38f3 100644 --- a/pyVHDLParser/Blocks/Expression.py +++ b/pyVHDLParser/Blocks/Expression.py @@ -38,7 +38,7 @@ from pyVHDLParser.Token.Keywords import NorOperator, AndOperator, NandOperator, XorOperator, XnorOperator, SlaOperator, SllOperator, SraOperator, SrlOperator from pyVHDLParser.Token.Keywords import NotOperator, AbsOperator, OpeningRoundBracketToken, BoundaryToken, ClosingRoundBracketToken, IdentifierToken from pyVHDLParser.Token.Keywords import LoopKeyword, ToKeyword, DowntoKeyword, EndToken -from pyVHDLParser.Blocks import Block, ParserState, BlockParserException, CommentBlock +from pyVHDLParser.Blocks import Block, TokenToBlockParser, BlockParserException, CommentBlock from pyVHDLParser.Blocks.Common import LinebreakBlock, WhitespaceBlock @@ -93,7 +93,7 @@ class ExpressionBlockEndedByCharORClosingRoundBracket(ExpressionBlock): EXIT_BLOCK: Block = None @classmethod - def stateBeforeExpression(cls, parserState: ParserState): + def stateBeforeExpression(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken): if token == "(": @@ -132,7 +132,7 @@ def stateBeforeExpression(cls, parserState: ParserState): raise BlockParserException("Expected '(', unary operator, identifier, literal or whitespace.", token) @classmethod - def stateExpression(cls, parserState: ParserState): + def stateExpression(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, FusedCharacterToken): try: @@ -197,7 +197,7 @@ def stateExpression(cls, parserState: ParserState): raise BlockParserException("Expected ?????????????.", token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, FusedCharacterToken): try: @@ -288,7 +288,7 @@ class ExpressionBlockEndedByKeywordORClosingRoundBracket(ExpressionBlock): EXIT_BLOCK = None @classmethod - def stateExpression(cls, parserState: ParserState): + def stateExpression(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, FusedCharacterToken): parserState.NewToken = cls.FUSED_CHARACTER_TRANSLATION[token.Value](fromExistingToken=token) @@ -334,7 +334,7 @@ def stateExpression(cls, parserState: ParserState): raise BlockParserException("Expected '(' or whitespace after keyword GENERIC.", token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, FusedCharacterToken): parserState.NewToken = cls.FUSED_CHARACTER_TRANSLATION[token.Value](fromExistingToken=token) @@ -405,7 +405,7 @@ class ExpressionBlockEndedByKeywordOrToOrDownto(ExpressionBlock): EXIT_BLOCK = None @classmethod - def stateExpression(cls, parserState: ParserState): + def stateExpression(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, FusedCharacterToken): parserState.NewToken = cls.FUSED_CHARACTER_TRANSLATION[token.Value](fromExistingToken=token) @@ -468,7 +468,7 @@ def stateExpression(cls, parserState: ParserState): raise BlockParserException("Expected '(' or whitespace after keyword GENERIC.", token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, FusedCharacterToken): parserState.NewToken = cls.FUSED_CHARACTER_TRANSLATION[token.Value](fromExistingToken=token) @@ -555,7 +555,7 @@ class ExpressionBlockEndedBySemicolon(ExpressionBlock): END_BLOCK = None @classmethod - def stateExpression(cls, parserState: ParserState): + def stateExpression(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, FusedCharacterToken): parserState.NewToken = cls.FUSED_CHARACTER_TRANSLATION[token.Value](fromExistingToken=token) @@ -606,7 +606,7 @@ def stateExpression(cls, parserState: ParserState): raise BlockParserException("Expected operator, '(', ')', ';' or whitespace.", token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, FusedCharacterToken): parserState.NewToken = cls.FUSED_CHARACTER_TRANSLATION[token.Value](fromExistingToken=token) diff --git a/pyVHDLParser/Blocks/Generate/CaseGenerate.py b/pyVHDLParser/Blocks/Generate/CaseGenerate.py index c4a9aa992..d4cc7671c 100644 --- a/pyVHDLParser/Blocks/Generate/CaseGenerate.py +++ b/pyVHDLParser/Blocks/Generate/CaseGenerate.py @@ -32,7 +32,7 @@ from pyVHDLParser.Token.Keywords import BoundaryToken, IdentifierToken, BeginKeyword from pyVHDLParser.Token.Keywords import IsKeyword, EndKeyword, GenericKeyword, PortKeyword from pyVHDLParser.Token import CharacterToken, SpaceToken, WordToken, LinebreakToken, IndentationToken -from pyVHDLParser.Blocks import Block, BlockParserException, ParserState +from pyVHDLParser.Blocks import Block, BlockParserException, TokenToBlockParser from pyVHDLParser.Blocks.Common import LinebreakBlock, IndentationBlock, WhitespaceBlock from pyVHDLParser.Blocks.Comment import SingleLineCommentBlock, MultiLineCommentBlock from pyVHDLParser.Blocks.Generate import EndGenerateBlock as EndGenerateBlockBase @@ -42,7 +42,7 @@ @export class CaseBlock(Block): @classmethod - def stateGenerateKeyword(cls, parserState: ParserState): + def stateGenerateKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected whitespace after keyword GENERATE." if isinstance(token, CharacterToken): @@ -76,7 +76,7 @@ def stateGenerateKeyword(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected generate name (identifier)." if isinstance(token, CharacterToken): @@ -115,7 +115,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateGenerateName(cls, parserState: ParserState): + def stateGenerateName(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected whitespace after keyword GENERATE." if isinstance(token, CharacterToken): @@ -148,7 +148,7 @@ def stateGenerateName(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateWhitespace2(cls, parserState: ParserState): + def stateWhitespace2(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected keyword IS after generate name." if isinstance(token, CharacterToken): @@ -188,7 +188,7 @@ def stateWhitespace2(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateDeclarativeRegion(cls, parserState: ParserState): + def stateDeclarativeRegion(cls, parserState: TokenToBlockParser): errorMessage = "Expected one of these keywords: generic, port, begin, end." token = parserState.Token if isinstance(parserState.Token, CharacterToken): diff --git a/pyVHDLParser/Blocks/Generate/ForGenerate.py b/pyVHDLParser/Blocks/Generate/ForGenerate.py index 2dba8e8b3..11131415c 100644 --- a/pyVHDLParser/Blocks/Generate/ForGenerate.py +++ b/pyVHDLParser/Blocks/Generate/ForGenerate.py @@ -32,7 +32,7 @@ from pyVHDLParser.Token import CharacterToken, SpaceToken, WordToken, LinebreakToken, IndentationToken from pyVHDLParser.Token.Keywords import BoundaryToken, IdentifierToken, BeginKeyword, ProcessKeyword, AssertKeyword from pyVHDLParser.Token.Keywords import IsKeyword, EndKeyword, GenericKeyword, PortKeyword -from pyVHDLParser.Blocks import Block, BlockParserException, ParserState +from pyVHDLParser.Blocks import Block, BlockParserException, TokenToBlockParser from pyVHDLParser.Blocks.Common import LinebreakBlock, IndentationBlock, WhitespaceBlock from pyVHDLParser.Blocks.Comment import SingleLineCommentBlock, MultiLineCommentBlock from pyVHDLParser.Blocks.Generate import EndGenerateBlock as EndGenerateBlockBase @@ -44,7 +44,7 @@ @export class RangeBlock(Block): @classmethod - def stateGenerateKeyword(cls, parserState: ParserState): + def stateGenerateKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected whitespace after keyword GENERATE." if isinstance(token, CharacterToken): @@ -78,7 +78,7 @@ def stateGenerateKeyword(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected generate name (identifier)." if isinstance(token, CharacterToken): @@ -117,7 +117,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateGenerateName(cls, parserState: ParserState): + def stateGenerateName(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected whitespace after keyword GENERATE." if isinstance(token, CharacterToken): @@ -150,7 +150,7 @@ def stateGenerateName(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateWhitespace2(cls, parserState: ParserState): + def stateWhitespace2(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected keyword IS after generate name." if isinstance(token, CharacterToken): @@ -190,7 +190,7 @@ def stateWhitespace2(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateDeclarativeRegion(cls, parserState: ParserState): + def stateDeclarativeRegion(cls, parserState: TokenToBlockParser): errorMessage = "Expected one of these keywords: generic, port, begin, end." token = parserState.Token if isinstance(parserState.Token, CharacterToken): @@ -240,7 +240,7 @@ def stateDeclarativeRegion(cls, parserState: ParserState): @export class BeginBlock(Block): @classmethod - def stateBeginKeyword(cls, parserState: ParserState): + def stateBeginKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected label or one of these keywords: assert, process." if isinstance(token, CharacterToken): diff --git a/pyVHDLParser/Blocks/Generate/IfGenerate.py b/pyVHDLParser/Blocks/Generate/IfGenerate.py index c150b7fad..dc420a789 100644 --- a/pyVHDLParser/Blocks/Generate/IfGenerate.py +++ b/pyVHDLParser/Blocks/Generate/IfGenerate.py @@ -33,7 +33,7 @@ from pyVHDLParser.Token.Keywords import BoundaryToken, IdentifierToken from pyVHDLParser.Token.Keywords import BeginKeyword, ProcessKeyword, AssertKeyword from pyVHDLParser.Token.Keywords import IsKeyword, EndKeyword, GenericKeyword, PortKeyword -from pyVHDLParser.Blocks import Block, BlockParserException, ParserState +from pyVHDLParser.Blocks import Block, BlockParserException, TokenToBlockParser from pyVHDLParser.Blocks.Common import LinebreakBlock, IndentationBlock, WhitespaceBlock from pyVHDLParser.Blocks.Comment import SingleLineCommentBlock, MultiLineCommentBlock from pyVHDLParser.Blocks.Generate import EndGenerateBlock as EndGenerateBlockBase @@ -45,7 +45,7 @@ @export class IfConditionBlock(Block): @classmethod - def stateGenerateKeyword(cls, parserState: ParserState): + def stateGenerateKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected whitespace after keyword GENERATE." if isinstance(token, CharacterToken): @@ -79,7 +79,7 @@ def stateGenerateKeyword(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected generate name (identifier)." if isinstance(token, CharacterToken): @@ -118,7 +118,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateGenerateName(cls, parserState: ParserState): + def stateGenerateName(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected whitespace after keyword GENERATE." if isinstance(token, CharacterToken): @@ -151,7 +151,7 @@ def stateGenerateName(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateWhitespace2(cls, parserState: ParserState): + def stateWhitespace2(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected keyword IS after generate name." if isinstance(token, CharacterToken): @@ -191,7 +191,7 @@ def stateWhitespace2(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateDeclarativeRegion(cls, parserState: ParserState): + def stateDeclarativeRegion(cls, parserState: TokenToBlockParser): errorMessage = "Expected one of these keywords: generic, port, begin, end." token = parserState.Token if isinstance(parserState.Token, CharacterToken): @@ -241,7 +241,7 @@ def stateDeclarativeRegion(cls, parserState: ParserState): @export class BeginBlock(Block): @classmethod - def stateBeginKeyword(cls, parserState: ParserState): + def stateBeginKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected label or one of these keywords: assert, process." if isinstance(token, CharacterToken): @@ -287,7 +287,7 @@ def stateBeginKeyword(cls, parserState: ParserState): @export class ElsIfConditionBlock(Block): @classmethod - def stateGenerateKeyword(cls, parserState: ParserState): + def stateGenerateKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected whitespace after keyword GENERATE." if isinstance(token, CharacterToken): @@ -321,7 +321,7 @@ def stateGenerateKeyword(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected generate name (identifier)." if isinstance(token, CharacterToken): @@ -360,7 +360,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateGenerateName(cls, parserState: ParserState): + def stateGenerateName(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected whitespace after keyword GENERATE." if isinstance(token, CharacterToken): @@ -393,7 +393,7 @@ def stateGenerateName(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateWhitespace2(cls, parserState: ParserState): + def stateWhitespace2(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected keyword IS after generate name." if isinstance(token, CharacterToken): @@ -433,7 +433,7 @@ def stateWhitespace2(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateDeclarativeRegion(cls, parserState: ParserState): + def stateDeclarativeRegion(cls, parserState: TokenToBlockParser): errorMessage = "Expected one of these keywords: generic, port, begin, end." token = parserState.Token if isinstance(parserState.Token, CharacterToken): @@ -483,7 +483,7 @@ def stateDeclarativeRegion(cls, parserState: ParserState): @export class ElsIfBeginBlock(Block): @classmethod - def stateBeginKeyword(cls, parserState: ParserState): + def stateBeginKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected label or one of these keywords: assert, process." if isinstance(token, CharacterToken): @@ -529,7 +529,7 @@ def stateBeginKeyword(cls, parserState: ParserState): @export class ElseGenerateBlock(Block): @classmethod - def stateGenerateKeyword(cls, parserState: ParserState): + def stateGenerateKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected whitespace after keyword GENERATE." if isinstance(token, CharacterToken): @@ -563,7 +563,7 @@ def stateGenerateKeyword(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected generate name (identifier)." if isinstance(token, CharacterToken): @@ -602,7 +602,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateGenerateName(cls, parserState: ParserState): + def stateGenerateName(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected whitespace after keyword GENERATE." if isinstance(token, CharacterToken): @@ -635,7 +635,7 @@ def stateGenerateName(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateWhitespace2(cls, parserState: ParserState): + def stateWhitespace2(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected keyword IS after generate name." if isinstance(token, CharacterToken): @@ -675,7 +675,7 @@ def stateWhitespace2(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateDeclarativeRegion(cls, parserState: ParserState): + def stateDeclarativeRegion(cls, parserState: TokenToBlockParser): errorMessage = "Expected one of these keywords: generic, port, begin, end." token = parserState.Token if isinstance(parserState.Token, CharacterToken): @@ -725,7 +725,7 @@ def stateDeclarativeRegion(cls, parserState: ParserState): @export class ElseGenerateBeginBlock(Block): @classmethod - def stateBeginKeyword(cls, parserState: ParserState): + def stateBeginKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected label or one of these keywords: assert, process." if isinstance(token, CharacterToken): diff --git a/pyVHDLParser/Blocks/Generic.py b/pyVHDLParser/Blocks/Generic.py index a37d4e888..88e394fb0 100644 --- a/pyVHDLParser/Blocks/Generic.py +++ b/pyVHDLParser/Blocks/Generic.py @@ -33,7 +33,7 @@ from pyVHDLParser.Token.Keywords import AssertKeyword, EndKeyword, ProcessKeyword, ReportKeyword, IfKeyword, ForKeyword, ReturnKeyword, NextKeyword, NullKeyword from pyVHDLParser.Token.Keywords import ExitKeyword, UseKeyword, SignalKeyword, ConstantKeyword, SharedKeyword, FunctionKeyword, ProcedureKeyword from pyVHDLParser.Token.Keywords import ImpureKeyword, PureKeyword, VariableKeyword, BeginKeyword, CaseKeyword -from pyVHDLParser.Blocks import BlockParserException, CommentBlock, ParserState, MetaBlock +from pyVHDLParser.Blocks import BlockParserException, CommentBlock, TokenToBlockParser, MetaBlock from pyVHDLParser.Blocks.Common import LinebreakBlock, WhitespaceBlock, IndentationBlock from pyVHDLParser.Blocks.Object.Variable import VariableDeclarationBlock from pyVHDLParser.Blocks.Generic1 import EndBlock, BeginBlock @@ -67,7 +67,7 @@ def __cls_init__(cls): @classmethod - def stateDeclarativeRegion(cls, parserState: ParserState): + def stateDeclarativeRegion(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): blockType = IndentationBlock if isinstance(token, IndentationToken) else WhitespaceBlock @@ -159,12 +159,12 @@ def __cls_init__(cls): } @classmethod - def stateStatementRegion(cls, parserState: ParserState): + def stateStatementRegion(cls, parserState: TokenToBlockParser): parserState.NextState = cls.stateConcurrentRegion parserState.NextState(parserState) @classmethod - def stateConcurrentRegion(cls, parserState: ParserState): + def stateConcurrentRegion(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): blockType = IndentationBlock if isinstance(token, IndentationToken) else WhitespaceBlock @@ -229,15 +229,15 @@ def __cls_init__(cls): } @classmethod - def stateStatementRegion(cls, parserState: ParserState): + def stateStatementRegion(cls, parserState: TokenToBlockParser): cls.stateAnyRegion(parserState) @classmethod - def stateSequentialRegion(cls, parserState: ParserState): + def stateSequentialRegion(cls, parserState: TokenToBlockParser): cls.stateAnyRegion(parserState) @classmethod - def stateAnyRegion(cls, parserState: ParserState): + def stateAnyRegion(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): blockType = IndentationBlock if isinstance(token, IndentationToken) else WhitespaceBlock diff --git a/pyVHDLParser/Blocks/Generic1.py b/pyVHDLParser/Blocks/Generic1.py index 07fe8a02c..71cd2d43f 100644 --- a/pyVHDLParser/Blocks/Generic1.py +++ b/pyVHDLParser/Blocks/Generic1.py @@ -32,7 +32,7 @@ from pyVHDLParser.Token import CharacterToken, SpaceToken, LinebreakToken, CommentToken, WordToken, MultiLineCommentToken, IndentationToken from pyVHDLParser.Token import SingleLineCommentToken, ExtendedIdentifier from pyVHDLParser.Token.Keywords import EndToken, BoundaryToken, LabelToken, IdentifierToken -from pyVHDLParser.Blocks import FinalBlock, ParserState, CommentBlock, BlockParserException, Block +from pyVHDLParser.Blocks import FinalBlock, TokenToBlockParser, CommentBlock, BlockParserException, Block from pyVHDLParser.Blocks.Common import LinebreakBlock, WhitespaceBlock @@ -44,7 +44,7 @@ class EndBlock(FinalBlock): EXPECTED_NAME_KIND = "keyword" # keyword label @classmethod - def stateEndKeyword(cls, parserState: ParserState): + def stateEndKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken): if (cls.KEYWORD_IS_OPTIONAL is True) and (token == ";"): @@ -71,7 +71,7 @@ def stateEndKeyword(cls, parserState: ParserState): raise BlockParserException("Expected ';' or whitespace.", token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken): if (cls.KEYWORD_IS_OPTIONAL is True) and (token == ";"): @@ -127,7 +127,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateKeyword1(cls, parserState: ParserState): + def stateKeyword1(cls, parserState: TokenToBlockParser): IS_DOUBLE_KEYWORD = isinstance(cls.KEYWORD, tuple) nextState = cls.stateWhitespace2 if IS_DOUBLE_KEYWORD else cls.stateWhitespace3; token = parserState.Token @@ -156,7 +156,7 @@ def stateKeyword1(cls, parserState: ParserState): raise BlockParserException("Expected ';' or whitespace.", token) @classmethod - def stateWhitespace2(cls, parserState: ParserState): + def stateWhitespace2(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken): if (cls.KEYWORD_IS_OPTIONAL is True) and (not isinstance(cls.KEYWORD, tuple)) and (token == ";"): @@ -203,7 +203,7 @@ def stateWhitespace2(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateKeyword2(cls, parserState: ParserState): + def stateKeyword2(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken)and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) @@ -229,7 +229,7 @@ def stateKeyword2(cls, parserState: ParserState): raise BlockParserException("Expected ';' or whitespace.", token) @classmethod - def stateWhitespace3(cls, parserState: ParserState): + def stateWhitespace3(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken): if token == ";": @@ -268,7 +268,7 @@ def stateWhitespace3(cls, parserState: ParserState): raise BlockParserException("Expected ';' or {0} name.".format(cls.EXPECTED_NAME), token) @classmethod - def stateSimpleName(cls, parserState: ParserState): + def stateSimpleName(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) @@ -294,7 +294,7 @@ def stateSimpleName(cls, parserState: ParserState): raise BlockParserException("Expected ';' or whitespace.", token) @classmethod - def stateWhitespace4(cls, parserState: ParserState): + def stateWhitespace4(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken): if token == ";": @@ -333,14 +333,14 @@ class BeginBlock(Block): KEYWORDS = None @classmethod - def stateStatementRegion(cls, parserState: ParserState): + def stateStatementRegion(cls, parserState: TokenToBlockParser): pass @export class CloseBlock(Block): @classmethod - def stateClosingParenthesis(cls, parserState: ParserState): + def stateClosingParenthesis(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) @@ -361,7 +361,7 @@ def stateClosingParenthesis(cls, parserState: ParserState): raise BlockParserException("Expected ';' or whitespace.", token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken)and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) diff --git a/pyVHDLParser/Blocks/Instantiation/EntityInstantiation.py b/pyVHDLParser/Blocks/Instantiation/EntityInstantiation.py index 6418e2e1a..80abfef21 100644 --- a/pyVHDLParser/Blocks/Instantiation/EntityInstantiation.py +++ b/pyVHDLParser/Blocks/Instantiation/EntityInstantiation.py @@ -31,7 +31,7 @@ from pyVHDLParser.Token import CharacterToken, SpaceToken, WordToken, LinebreakToken from pyVHDLParser.Token.Keywords import BoundaryToken, IdentifierToken, EndToken -from pyVHDLParser.Blocks import BlockParserException, Block, ParserState, FinalBlock +from pyVHDLParser.Blocks import BlockParserException, Block, TokenToBlockParser, FinalBlock from pyVHDLParser.Blocks.Common import LinebreakBlock, WhitespaceBlock from pyVHDLParser.Blocks.Comment import SingleLineCommentBlock, MultiLineCommentBlock @@ -39,7 +39,7 @@ @export class EntityInstantiationBlock(Block): @classmethod - def stateEntityInstantiationKeyword(cls, parserState: ParserState): + def stateEntityInstantiationKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected whitespace after keyword EntityInstantiation." if isinstance(token, CharacterToken): @@ -73,7 +73,7 @@ def stateEntityInstantiationKeyword(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected entityInstantiation name (identifier)." if isinstance(token, CharacterToken): @@ -112,7 +112,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateEntityInstantiationName(cls, parserState: ParserState): + def stateEntityInstantiationName(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ';' after entityInstantiation name." if isinstance(token, CharacterToken): @@ -150,7 +150,7 @@ def stateEntityInstantiationName(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateWhitespace2(cls, parserState: ParserState): + def stateWhitespace2(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ';'." if isinstance(token, CharacterToken): diff --git a/pyVHDLParser/Blocks/Instantiation/FunctionInstantiation.py b/pyVHDLParser/Blocks/Instantiation/FunctionInstantiation.py index 47afdee9d..2caee7f68 100644 --- a/pyVHDLParser/Blocks/Instantiation/FunctionInstantiation.py +++ b/pyVHDLParser/Blocks/Instantiation/FunctionInstantiation.py @@ -31,7 +31,7 @@ from pyVHDLParser.Token import CharacterToken, SpaceToken, WordToken, LinebreakToken from pyVHDLParser.Token.Keywords import BoundaryToken, IdentifierToken, EndToken -from pyVHDLParser.Blocks import BlockParserException, Block, ParserState, FinalBlock, SkipableBlock +from pyVHDLParser.Blocks import BlockParserException, Block, TokenToBlockParser, FinalBlock, SkipableBlock from pyVHDLParser.Blocks.Common import LinebreakBlock, WhitespaceBlock from pyVHDLParser.Blocks.Comment import SingleLineCommentBlock, MultiLineCommentBlock @@ -39,7 +39,7 @@ @export class EntityInstantiationBlock(Block): @classmethod - def stateEntityInstantiationKeyword(cls, parserState: ParserState): + def stateEntityInstantiationKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected whitespace after keyword EntityInstantiation." if isinstance(token, CharacterToken): @@ -73,7 +73,7 @@ def stateEntityInstantiationKeyword(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected entityInstantiation name (identifier)." if isinstance(token, CharacterToken): @@ -112,7 +112,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateEntityInstantiationName(cls, parserState: ParserState): + def stateEntityInstantiationName(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ';' after entityInstantiation name." if isinstance(token, CharacterToken): @@ -150,7 +150,7 @@ def stateEntityInstantiationName(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateWhitespace2(cls, parserState: ParserState): + def stateWhitespace2(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ';'." if isinstance(token, CharacterToken): diff --git a/pyVHDLParser/Blocks/Instantiation/PackageInstantiation.py b/pyVHDLParser/Blocks/Instantiation/PackageInstantiation.py index 47afdee9d..2caee7f68 100644 --- a/pyVHDLParser/Blocks/Instantiation/PackageInstantiation.py +++ b/pyVHDLParser/Blocks/Instantiation/PackageInstantiation.py @@ -31,7 +31,7 @@ from pyVHDLParser.Token import CharacterToken, SpaceToken, WordToken, LinebreakToken from pyVHDLParser.Token.Keywords import BoundaryToken, IdentifierToken, EndToken -from pyVHDLParser.Blocks import BlockParserException, Block, ParserState, FinalBlock, SkipableBlock +from pyVHDLParser.Blocks import BlockParserException, Block, TokenToBlockParser, FinalBlock, SkipableBlock from pyVHDLParser.Blocks.Common import LinebreakBlock, WhitespaceBlock from pyVHDLParser.Blocks.Comment import SingleLineCommentBlock, MultiLineCommentBlock @@ -39,7 +39,7 @@ @export class EntityInstantiationBlock(Block): @classmethod - def stateEntityInstantiationKeyword(cls, parserState: ParserState): + def stateEntityInstantiationKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected whitespace after keyword EntityInstantiation." if isinstance(token, CharacterToken): @@ -73,7 +73,7 @@ def stateEntityInstantiationKeyword(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected entityInstantiation name (identifier)." if isinstance(token, CharacterToken): @@ -112,7 +112,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateEntityInstantiationName(cls, parserState: ParserState): + def stateEntityInstantiationName(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ';' after entityInstantiation name." if isinstance(token, CharacterToken): @@ -150,7 +150,7 @@ def stateEntityInstantiationName(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateWhitespace2(cls, parserState: ParserState): + def stateWhitespace2(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ';'." if isinstance(token, CharacterToken): diff --git a/pyVHDLParser/Blocks/Instantiation/ProcedureInstantiation.py b/pyVHDLParser/Blocks/Instantiation/ProcedureInstantiation.py index 47afdee9d..2caee7f68 100644 --- a/pyVHDLParser/Blocks/Instantiation/ProcedureInstantiation.py +++ b/pyVHDLParser/Blocks/Instantiation/ProcedureInstantiation.py @@ -31,7 +31,7 @@ from pyVHDLParser.Token import CharacterToken, SpaceToken, WordToken, LinebreakToken from pyVHDLParser.Token.Keywords import BoundaryToken, IdentifierToken, EndToken -from pyVHDLParser.Blocks import BlockParserException, Block, ParserState, FinalBlock, SkipableBlock +from pyVHDLParser.Blocks import BlockParserException, Block, TokenToBlockParser, FinalBlock, SkipableBlock from pyVHDLParser.Blocks.Common import LinebreakBlock, WhitespaceBlock from pyVHDLParser.Blocks.Comment import SingleLineCommentBlock, MultiLineCommentBlock @@ -39,7 +39,7 @@ @export class EntityInstantiationBlock(Block): @classmethod - def stateEntityInstantiationKeyword(cls, parserState: ParserState): + def stateEntityInstantiationKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected whitespace after keyword EntityInstantiation." if isinstance(token, CharacterToken): @@ -73,7 +73,7 @@ def stateEntityInstantiationKeyword(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected entityInstantiation name (identifier)." if isinstance(token, CharacterToken): @@ -112,7 +112,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateEntityInstantiationName(cls, parserState: ParserState): + def stateEntityInstantiationName(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ';' after entityInstantiation name." if isinstance(token, CharacterToken): @@ -150,7 +150,7 @@ def stateEntityInstantiationName(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateWhitespace2(cls, parserState: ParserState): + def stateWhitespace2(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ';'." if isinstance(token, CharacterToken): diff --git a/pyVHDLParser/Blocks/InterfaceObject.py b/pyVHDLParser/Blocks/InterfaceObject.py index ca18f9423..aef737f38 100644 --- a/pyVHDLParser/Blocks/InterfaceObject.py +++ b/pyVHDLParser/Blocks/InterfaceObject.py @@ -33,7 +33,7 @@ from pyVHDLParser.Token import IndentationToken, SingleLineCommentToken, CharacterToken, FusedCharacterToken from pyVHDLParser.Token.Keywords import InKeyword, VariableAssignmentKeyword, OutKeyword, InoutKeyword, BufferKeyword, LinkageKeyword from pyVHDLParser.Token.Keywords import IdentifierToken, BoundaryToken, DelimiterToken -from pyVHDLParser.Blocks import Block, ParserState, CommentBlock, BlockParserException +from pyVHDLParser.Blocks import Block, TokenToBlockParser, CommentBlock, BlockParserException from pyVHDLParser.Blocks.Common import LinebreakBlock, WhitespaceBlock from pyVHDLParser.Blocks.Expression import ExpressionBlockEndedByCharORClosingRoundBracket @@ -46,7 +46,7 @@ class InterfaceObjectBlock(Block): DELIMITER_BLOCK = None @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): parserState.NewToken = IdentifierToken(fromExistingToken=token) @@ -78,7 +78,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise BlockParserException("Expected interface {0} name (identifier).".format(cls.OBJECT_KIND), token) @classmethod - def stateObjectName(cls, parserState: ParserState): + def stateObjectName(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -99,7 +99,7 @@ def stateObjectName(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after interface {0} name.".format(cls.OBJECT_KIND), token) @classmethod - def stateWhitespace2(cls, parserState: ParserState): + def stateWhitespace2(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == ":"): parserState.NewToken = DelimiterToken(fromExistingToken=token) @@ -128,7 +128,7 @@ def stateWhitespace2(cls, parserState: ParserState): raise BlockParserException("Expected ':' after interface {0} name.".format(cls.OBJECT_KIND), token) @classmethod - def stateColon1(cls, parserState: ParserState): + def stateColon1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): try: @@ -154,7 +154,7 @@ def stateColon1(cls, parserState: ParserState): raise BlockParserException("Expected subtype indication or whitespace after colon.", token) @classmethod - def stateWhitespace3(cls, parserState: ParserState): + def stateWhitespace3(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): tokenValue = token.Value.lower() @@ -192,7 +192,7 @@ def stateWhitespace3(cls, parserState: ParserState): raise BlockParserException("Expected subtype indication or keyword IN.", token) @classmethod - def stateModeKeyword(cls, parserState: ParserState): + def stateModeKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NextState = cls.stateWhitespace4 @@ -208,7 +208,7 @@ def stateModeKeyword(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after keyword CONSTANT.", token) @classmethod - def stateWhitespace4(cls, parserState: ParserState): + def stateWhitespace4(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): parserState.NewToken = IdentifierToken(fromExistingToken=token) @@ -240,7 +240,7 @@ def stateWhitespace4(cls, parserState: ParserState): raise BlockParserException("Expected subtype indication (name).", token) @classmethod - def stateSubtypeIndication(cls, parserState: ParserState): + def stateSubtypeIndication(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, FusedCharacterToken) and (token == ":="): parserState.NewToken = VariableAssignmentKeyword(fromExistingToken=token) @@ -278,7 +278,7 @@ def stateSubtypeIndication(cls, parserState: ParserState): raise BlockParserException("Expected ';', ':=' or whitespace after subtype indication.", token) @classmethod - def stateWhitespace5(cls, parserState: ParserState): + def stateWhitespace5(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, FusedCharacterToken) and (token == ":="): parserState.NewToken = VariableAssignmentKeyword(fromExistingToken=token) @@ -332,7 +332,7 @@ class InterfaceConstantBlock(InterfaceObjectBlock): } @classmethod - def stateConstantKeyword(cls, parserState: ParserState): + def stateConstantKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NextState = cls.stateWhitespace1 @@ -358,7 +358,7 @@ class InterfaceVariableBlock(InterfaceObjectBlock): } @classmethod - def stateVariableKeyword(cls, parserState: ParserState): + def stateVariableKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NextState = cls.stateWhitespace1 @@ -386,7 +386,7 @@ class InterfaceSignalBlock(InterfaceObjectBlock): } @classmethod - def stateSignalKeyword(cls, parserState: ParserState): + def stateSignalKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NextState = cls.stateWhitespace1 @@ -407,7 +407,7 @@ class InterfaceTypeBlock(Block): DELIMITER_BLOCK = None @classmethod - def stateTypeKeyword(cls, parserState: ParserState): + def stateTypeKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NextState = cls.stateWhitespace1 @@ -423,7 +423,7 @@ def stateTypeKeyword(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after keyword CONSTANT.", token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): parserState.NewToken = IdentifierToken(fromExistingToken=token) @@ -455,7 +455,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise BlockParserException("Expected interface type name (identifier).", token) @classmethod - def stateTypeName(cls, parserState: ParserState): + def stateTypeName(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken): if token == ';': @@ -485,7 +485,7 @@ def stateTypeName(cls, parserState: ParserState): raise BlockParserException("Expected ';', ')' or whitespace after interface type name.", token) @classmethod - def stateWhitespace2(cls, parserState: ParserState): + def stateWhitespace2(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken): if token == ';': diff --git a/pyVHDLParser/Blocks/List/GenericList.py b/pyVHDLParser/Blocks/List/GenericList.py index 0b4d2d60e..86676f1ac 100644 --- a/pyVHDLParser/Blocks/List/GenericList.py +++ b/pyVHDLParser/Blocks/List/GenericList.py @@ -33,7 +33,7 @@ from pyVHDLParser.Token.Keywords import BoundaryToken, ConstantKeyword, TypeKeyword, DelimiterToken from pyVHDLParser.Token.Keywords import IdentifierToken from pyVHDLParser.Token.Parser import SpaceToken, WordToken -from pyVHDLParser.Blocks import BlockParserException, Block, CommentBlock, ParserState, SkipableBlock +from pyVHDLParser.Blocks import BlockParserException, Block, CommentBlock, TokenToBlockParser, SkipableBlock from pyVHDLParser.Blocks.Common import LinebreakBlock, IndentationBlock, WhitespaceBlock from pyVHDLParser.Blocks.Generic1 import CloseBlock as CloseBlockBase from pyVHDLParser.Blocks.Expression import ExpressionBlockEndedByCharORClosingRoundBracket @@ -48,7 +48,7 @@ class CloseBlock(CloseBlockBase): @export class DelimiterBlock(SkipableBlock): @classmethod - def stateItemDelimiter(cls, parserState: ParserState): + def stateItemDelimiter(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): if token <= "constant": @@ -116,7 +116,7 @@ class GenericListInterfaceTypeBlock(InterfaceTypeBlock): @export class OpenBlock(Block): @classmethod - def stateGenericKeyword(cls, parserState: ParserState): + def stateGenericKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken)and (token == "("): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -138,7 +138,7 @@ def stateGenericKeyword(cls, parserState: ParserState): raise BlockParserException("Expected '(' or whitespace after keyword GENERIC.", token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken)and (token == "("): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -170,7 +170,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise BlockParserException("Expected '(' after keyword GENERIC.", token) @classmethod - def stateOpeningParenthesis(cls, parserState: ParserState): + def stateOpeningParenthesis(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == ")"): # if parserState.TokenMarker != token: diff --git a/pyVHDLParser/Blocks/List/GenericMapList.py b/pyVHDLParser/Blocks/List/GenericMapList.py index 261920fe6..5b29a2efb 100644 --- a/pyVHDLParser/Blocks/List/GenericMapList.py +++ b/pyVHDLParser/Blocks/List/GenericMapList.py @@ -31,7 +31,7 @@ from pyVHDLParser.Token import CharacterToken, SpaceToken, WordToken, LinebreakToken, IndentationToken from pyVHDLParser.Token.Keywords import BoundaryToken, IdentifierToken, EndToken, DelimiterToken, OpeningRoundBracketToken, ClosingRoundBracketToken -from pyVHDLParser.Blocks import BlockParserException, Block, ParserState, SkipableBlock +from pyVHDLParser.Blocks import BlockParserException, Block, TokenToBlockParser, SkipableBlock from pyVHDLParser.Blocks.Common import LinebreakBlock, IndentationBlock, WhitespaceBlock from pyVHDLParser.Blocks.Comment import SingleLineCommentBlock, MultiLineCommentBlock @@ -39,7 +39,7 @@ @export class OpenBlock(Block): @classmethod - def stateGenericKeyword(cls, parserState: ParserState): + def stateGenericKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected whitespace or '(' after keyword GENERIC." if isinstance(token, CharacterToken): @@ -79,7 +79,7 @@ def stateGenericKeyword(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected '(' after keyword GENERIC." if isinstance(token, CharacterToken): @@ -124,7 +124,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateOpeningParenthesis(cls, parserState: ParserState): + def stateOpeningParenthesis(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected generic name (identifier)." if isinstance(token, CharacterToken): @@ -169,7 +169,7 @@ def stateOpeningParenthesis(cls, parserState: ParserState): @export class ItemBlock(Block): @classmethod - def stateItemRemainder(cls, parserState: ParserState): + def stateItemRemainder(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken): if token == "(": @@ -197,7 +197,7 @@ def stateItemRemainder(cls, parserState: ParserState): @export class DelimiterBlock(SkipableBlock): @classmethod - def stateItemDelimiter(cls, parserState: ParserState): + def stateItemDelimiter(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected generic name (identifier)." @@ -223,7 +223,7 @@ def stateItemDelimiter(cls, parserState: ParserState): @export class CloseBlock(Block): @classmethod - def stateClosingParenthesis(cls, parserState: ParserState): + def stateClosingParenthesis(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ';' or whitespace." if isinstance(token, CharacterToken): @@ -258,7 +258,7 @@ def stateClosingParenthesis(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ';'." if isinstance(token, CharacterToken): diff --git a/pyVHDLParser/Blocks/List/ParameterList.py b/pyVHDLParser/Blocks/List/ParameterList.py index 212e073c9..7a67dbbe6 100644 --- a/pyVHDLParser/Blocks/List/ParameterList.py +++ b/pyVHDLParser/Blocks/List/ParameterList.py @@ -32,7 +32,7 @@ from pyVHDLParser.Token import CharacterToken, WordToken, SpaceToken, LinebreakToken, IndentationToken, CommentToken, MultiLineCommentToken, SingleLineCommentToken, ExtendedIdentifier from pyVHDLParser.Token.Keywords import BoundaryToken, DelimiterToken, ClosingRoundBracketToken, IdentifierToken from pyVHDLParser.Token.Keywords import ConstantKeyword, SignalKeyword, VariableKeyword, TypeKeyword -from pyVHDLParser.Blocks import BlockParserException, Block, CommentBlock, ParserState, SkipableBlock +from pyVHDLParser.Blocks import BlockParserException, Block, CommentBlock, TokenToBlockParser, SkipableBlock from pyVHDLParser.Blocks.Common import LinebreakBlock, IndentationBlock, WhitespaceBlock from pyVHDLParser.Blocks.Generic1 import CloseBlock as CloseBlockBase from pyVHDLParser.Blocks.InterfaceObject import InterfaceSignalBlock, InterfaceConstantBlock, InterfaceVariableBlock @@ -41,7 +41,7 @@ @export class OpenBlock(Block): @classmethod - def stateParameterKeyword(cls, parserState: ParserState): + def stateParameterKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == "("): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -64,7 +64,7 @@ def stateParameterKeyword(cls, parserState: ParserState): raise BlockParserException("Expected '(' or whitespace after keyword PARAMETER.", token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == "("): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -96,7 +96,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise BlockParserException("Expected '(' after keyword PARAMETER.", token) @classmethod - def stateOpeningParenthesis(cls, parserState: ParserState): + def stateOpeningParenthesis(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): if token <= "constant": @@ -145,7 +145,7 @@ def stateOpeningParenthesis(cls, parserState: ParserState): @export class ItemBlock(Block): @classmethod - def stateItemRemainder(cls, parserState: ParserState): + def stateItemRemainder(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken): if token == "(": @@ -178,7 +178,7 @@ def __init__(self, previousBlock, startToken): super().__init__(previousBlock, startToken, startToken) @classmethod - def stateItemDelimiter(cls, parserState: ParserState): + def stateItemDelimiter(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): tokenValue = token.Value.lower() diff --git a/pyVHDLParser/Blocks/List/PortList.py b/pyVHDLParser/Blocks/List/PortList.py index 62e229184..2f4728b1e 100644 --- a/pyVHDLParser/Blocks/List/PortList.py +++ b/pyVHDLParser/Blocks/List/PortList.py @@ -32,7 +32,7 @@ from pyVHDLParser.Token import CharacterToken, WordToken, SpaceToken, LinebreakToken, IndentationToken, CommentToken, MultiLineCommentToken, SingleLineCommentToken, ExtendedIdentifier from pyVHDLParser.Token.Keywords import BoundaryToken, SignalKeyword, DelimiterToken from pyVHDLParser.Token.Keywords import IdentifierToken -from pyVHDLParser.Blocks import BlockParserException, Block, CommentBlock, ParserState, SkipableBlock +from pyVHDLParser.Blocks import BlockParserException, Block, CommentBlock, TokenToBlockParser, SkipableBlock from pyVHDLParser.Blocks.Common import LinebreakBlock, IndentationBlock, WhitespaceBlock from pyVHDLParser.Blocks.Generic1 import CloseBlock as CloseBlockBase from pyVHDLParser.Blocks.Expression import ExpressionBlockEndedByCharORClosingRoundBracket @@ -47,7 +47,7 @@ class CloseBlock(CloseBlockBase): @export class DelimiterBlock(SkipableBlock): @classmethod - def stateItemDelimiter(cls, parserState: ParserState): + def stateItemDelimiter(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): if token <= "signal": @@ -97,7 +97,7 @@ class PortListInterfaceSignalBlock(InterfaceSignalBlock): @export class OpenBlock(Block): @classmethod - def statePortKeyword(cls, parserState: ParserState): + def statePortKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken)and (token == "("): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -119,7 +119,7 @@ def statePortKeyword(cls, parserState: ParserState): raise BlockParserException("Expected '(' or whitespace after keyword PORT.", token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken)and (token == "("): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -151,7 +151,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise BlockParserException("Expected '(' after keyword PORT.", token) @classmethod - def stateOpeningParenthesis(cls, parserState: ParserState): + def stateOpeningParenthesis(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == ")"): # if parserState.TokenMarker != token: diff --git a/pyVHDLParser/Blocks/List/PortMapList.py b/pyVHDLParser/Blocks/List/PortMapList.py index 71b100d41..4a91a8c3f 100644 --- a/pyVHDLParser/Blocks/List/PortMapList.py +++ b/pyVHDLParser/Blocks/List/PortMapList.py @@ -31,7 +31,7 @@ from pyVHDLParser.Token import CharacterToken, SpaceToken, WordToken, LinebreakToken, IndentationToken from pyVHDLParser.Token.Keywords import BoundaryToken, IdentifierToken, EndToken, DelimiterToken, OpeningRoundBracketToken, ClosingRoundBracketToken -from pyVHDLParser.Blocks import BlockParserException, Block, ParserState, SkipableBlock +from pyVHDLParser.Blocks import BlockParserException, Block, TokenToBlockParser, SkipableBlock from pyVHDLParser.Blocks.Common import LinebreakBlock, IndentationBlock, WhitespaceBlock from pyVHDLParser.Blocks.Comment import SingleLineCommentBlock, MultiLineCommentBlock @@ -39,7 +39,7 @@ @export class OpenBlock(Block): @classmethod - def statePortKeyword(cls, parserState: ParserState): + def statePortKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected whitespace or '(' after keyword PORT." if isinstance(token, CharacterToken): @@ -79,7 +79,7 @@ def statePortKeyword(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected '(' after keyword PORT." @@ -125,7 +125,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateOpeningParenthesis(cls, parserState: ParserState): + def stateOpeningParenthesis(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected port name (identifier)." if isinstance(token, CharacterToken): @@ -169,7 +169,7 @@ def stateOpeningParenthesis(cls, parserState: ParserState): @export class ItemBlock(Block): @classmethod - def stateItemRemainder(cls, parserState: ParserState): + def stateItemRemainder(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken): if token == "(": @@ -200,7 +200,7 @@ def __init__(self, previousBlock, startToken): super().__init__(previousBlock, startToken, startToken) @classmethod - def stateItemDelimiter(cls, parserState: ParserState): + def stateItemDelimiter(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected port name (identifier)." @@ -226,7 +226,7 @@ def stateItemDelimiter(cls, parserState: ParserState): @export class CloseBlock(Block): @classmethod - def stateClosingParenthesis(cls, parserState: ParserState): + def stateClosingParenthesis(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ';' or whitespace." if isinstance(token, CharacterToken): @@ -261,7 +261,7 @@ def stateClosingParenthesis(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ';'." if isinstance(token, CharacterToken): diff --git a/pyVHDLParser/Blocks/List/SensitivityList.py b/pyVHDLParser/Blocks/List/SensitivityList.py index 07441f9a6..4f3db0c62 100644 --- a/pyVHDLParser/Blocks/List/SensitivityList.py +++ b/pyVHDLParser/Blocks/List/SensitivityList.py @@ -33,14 +33,14 @@ from pyVHDLParser.Token import CommentToken, MultiLineCommentToken, SingleLineCommentToken from pyVHDLParser.Token.Keywords import BoundaryToken, DelimiterToken, OpeningRoundBracketToken, ClosingRoundBracketToken from pyVHDLParser.Token.Keywords import IdentifierToken, AllKeyword -from pyVHDLParser.Blocks import BlockParserException, Block, CommentBlock, ParserState, SkipableBlock +from pyVHDLParser.Blocks import BlockParserException, Block, CommentBlock, TokenToBlockParser, SkipableBlock from pyVHDLParser.Blocks.Common import LinebreakBlock, IndentationBlock, WhitespaceBlock @export class OpenBlock(Block): @classmethod - def stateOpeningParenthesis(cls, parserState: ParserState): + def stateOpeningParenthesis(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): if token <= "all": @@ -77,7 +77,7 @@ def stateOpeningParenthesis(cls, parserState: ParserState): @export class ItemBlock(Block): @classmethod - def stateItemRemainder(cls, parserState: ParserState): + def stateItemRemainder(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken): if token == "(": @@ -108,7 +108,7 @@ def __init__(self, previousBlock, startToken): super().__init__(previousBlock, startToken, startToken) @classmethod - def stateItemDelimiter(cls, parserState: ParserState): + def stateItemDelimiter(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): parserState.NewToken = IdentifierToken(fromExistingToken=token) @@ -138,7 +138,7 @@ def stateItemDelimiter(cls, parserState: ParserState): @export class CloseBlock(Block): @classmethod - def stateAllKeyword(cls, parserState: ParserState): + def stateAllKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == ")"): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -159,7 +159,7 @@ def stateAllKeyword(cls, parserState: ParserState): raise BlockParserException("Expected ')' or whitespace after keyword ALL.", token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected '(' after keyword PROCESS." if isinstance(token, CharacterToken) and (token == ")"): diff --git a/pyVHDLParser/Blocks/Object/Constant.py b/pyVHDLParser/Blocks/Object/Constant.py index 16d3ad140..07b023410 100644 --- a/pyVHDLParser/Blocks/Object/Constant.py +++ b/pyVHDLParser/Blocks/Object/Constant.py @@ -31,7 +31,7 @@ from pyVHDLParser.Token import SpaceToken, LinebreakToken, CommentToken from pyVHDLParser.Token.Keywords import BoundaryToken -from pyVHDLParser.Blocks import ParserState, CommentBlock, BlockParserException +from pyVHDLParser.Blocks import TokenToBlockParser, CommentBlock, BlockParserException from pyVHDLParser.Blocks.Common import LinebreakBlock from pyVHDLParser.Blocks.Expression import ExpressionBlockEndedBySemicolon from pyVHDLParser.Blocks.Object import ObjectDeclarationEndMarkerBlock, ObjectDeclarationBlock @@ -54,7 +54,7 @@ class ConstantDeclarationBlock(ObjectDeclarationBlock): END_BLOCK = ConstantDeclarationEndMarkerBlock @classmethod - def stateConstantKeyword(cls, parserState: ParserState): + def stateConstantKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = BoundaryToken(fromExistingToken=token) diff --git a/pyVHDLParser/Blocks/Object/SharedVariable.py b/pyVHDLParser/Blocks/Object/SharedVariable.py index 5b2cfd597..f5f67ec87 100644 --- a/pyVHDLParser/Blocks/Object/SharedVariable.py +++ b/pyVHDLParser/Blocks/Object/SharedVariable.py @@ -29,7 +29,7 @@ # from pyTooling.Decorators import export -from pyVHDLParser.Blocks import ParserState, CommentBlock, BlockParserException +from pyVHDLParser.Blocks import TokenToBlockParser, CommentBlock, BlockParserException from pyVHDLParser.Blocks.Common import LinebreakBlock, WhitespaceBlock from pyVHDLParser.Blocks.Object import ObjectDeclarationEndMarkerBlock, ObjectDeclarationBlock from pyVHDLParser.Token import SpaceToken, LinebreakToken, CommentToken, WordToken @@ -48,7 +48,7 @@ class SharedVariableDeclarationBlock(ObjectDeclarationBlock): END_BLOCK = SharedVariableDeclarationEndMarkerBlock @classmethod - def stateSharedKeyword(cls, parserState: ParserState): + def stateSharedKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -65,7 +65,7 @@ def stateSharedKeyword(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after keyword SHARED.", token) @classmethod - def stateWhitespace0(cls, parserState: ParserState): + def stateWhitespace0(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): parserState.NewToken = IdentifierToken(fromExistingToken=token) @@ -95,7 +95,7 @@ def stateWhitespace0(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after keyword SHARED.", token) @classmethod - def stateVariableKeyword(cls, parserState: ParserState): + def stateVariableKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -112,7 +112,7 @@ def stateVariableKeyword(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after keyword VARIABLE.", token) @classmethod - def stateSubtypeIndication(cls, parserState: ParserState): + def stateSubtypeIndication(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == ';'): parserState.NewToken = EndToken(fromExistingToken=token) @@ -135,7 +135,7 @@ def stateSubtypeIndication(cls, parserState: ParserState): raise BlockParserException("Expected ';' or whitespace after subtype indication.", token) @classmethod - def stateWhitespace4(cls, parserState: ParserState): + def stateWhitespace4(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) diff --git a/pyVHDLParser/Blocks/Object/Signal.py b/pyVHDLParser/Blocks/Object/Signal.py index 753a141da..780ed06fd 100644 --- a/pyVHDLParser/Blocks/Object/Signal.py +++ b/pyVHDLParser/Blocks/Object/Signal.py @@ -31,7 +31,7 @@ from pyVHDLParser.Token import SpaceToken, LinebreakToken, CommentToken from pyVHDLParser.Token.Keywords import BoundaryToken -from pyVHDLParser.Blocks import ParserState, CommentBlock, BlockParserException +from pyVHDLParser.Blocks import TokenToBlockParser, CommentBlock, BlockParserException from pyVHDLParser.Blocks.Common import LinebreakBlock from pyVHDLParser.Blocks.Expression import ExpressionBlockEndedBySemicolon from pyVHDLParser.Blocks.Object import ObjectDeclarationEndMarkerBlock, ObjectDeclarationBlock @@ -54,7 +54,7 @@ class SignalDeclarationBlock(ObjectDeclarationBlock): END_BLOCK = SignalDeclarationEndMarkerBlock @classmethod - def stateSignalKeyword(cls, parserState: ParserState): + def stateSignalKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = BoundaryToken(fromExistingToken=token) diff --git a/pyVHDLParser/Blocks/Object/Variable.py b/pyVHDLParser/Blocks/Object/Variable.py index 73edee17a..d4bd920d1 100644 --- a/pyVHDLParser/Blocks/Object/Variable.py +++ b/pyVHDLParser/Blocks/Object/Variable.py @@ -31,7 +31,7 @@ from pyVHDLParser.Token import SpaceToken, LinebreakToken, CommentToken from pyVHDLParser.Token.Keywords import BoundaryToken -from pyVHDLParser.Blocks import ParserState, CommentBlock, BlockParserException +from pyVHDLParser.Blocks import TokenToBlockParser, CommentBlock, BlockParserException from pyVHDLParser.Blocks.Common import LinebreakBlock from pyVHDLParser.Blocks.Expression import ExpressionBlockEndedBySemicolon from pyVHDLParser.Blocks.Object import ObjectDeclarationEndMarkerBlock, ObjectDeclarationBlock @@ -54,7 +54,7 @@ class VariableDeclarationBlock(ObjectDeclarationBlock): END_BLOCK = VariableDeclarationEndMarkerBlock @classmethod - def stateVariableKeyword(cls, parserState: ParserState): + def stateVariableKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = BoundaryToken(fromExistingToken=token) diff --git a/pyVHDLParser/Blocks/Object/__init__.py b/pyVHDLParser/Blocks/Object/__init__.py index 0800d00ce..c2c2072cf 100644 --- a/pyVHDLParser/Blocks/Object/__init__.py +++ b/pyVHDLParser/Blocks/Object/__init__.py @@ -32,7 +32,7 @@ from pyVHDLParser.Token import WordToken, ExtendedIdentifier, LinebreakToken, MultiLineCommentToken from pyVHDLParser.Token import CommentToken, SpaceToken, CharacterToken, FusedCharacterToken from pyVHDLParser.Token.Keywords import IdentifierToken, BoundaryToken, VariableAssignmentKeyword, EndToken -from pyVHDLParser.Blocks import Block, ParserState, CommentBlock, BlockParserException +from pyVHDLParser.Blocks import Block, TokenToBlockParser, CommentBlock, BlockParserException from pyVHDLParser.Blocks.Common import LinebreakBlock, WhitespaceBlock from pyVHDLParser.Blocks.Generic1 import EndOfStatementBlock @@ -44,7 +44,7 @@ class ObjectDeclarationBlock(Block): END_BLOCK = None @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): parserState.NewToken = IdentifierToken(fromExistingToken=token) @@ -74,7 +74,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise BlockParserException("Expected {0} name (identifier).".format(cls.OBJECT_KIND), token) @classmethod - def stateObjectName(cls, parserState: ParserState): + def stateObjectName(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == ":"): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -95,7 +95,7 @@ def stateObjectName(cls, parserState: ParserState): raise BlockParserException("Expected ':' or whitespace after {0} name.".format(cls.OBJECT_KIND), token) @classmethod - def stateWhitespace2(cls, parserState: ParserState): + def stateWhitespace2(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == ":"): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -122,7 +122,7 @@ def stateWhitespace2(cls, parserState: ParserState): raise BlockParserException("Expected colon after {0} name.".format(cls.OBJECT_KIND), token) @classmethod - def stateColon1(cls, parserState: ParserState): + def stateColon1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): parserState.NewToken = IdentifierToken(fromExistingToken=token) @@ -143,7 +143,7 @@ def stateColon1(cls, parserState: ParserState): raise BlockParserException("Expected subtype indication or whitespace after colon.", token) @classmethod - def stateWhitespace3(cls, parserState: ParserState): + def stateWhitespace3(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): parserState.NewToken = IdentifierToken(fromExistingToken=token) @@ -170,7 +170,7 @@ def stateWhitespace3(cls, parserState: ParserState): raise BlockParserException("Expected subtype indication after colon.", token) @classmethod - def stateSubtypeIndication(cls, parserState: ParserState): + def stateSubtypeIndication(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, FusedCharacterToken) and (token == ":="): parserState.NewToken = VariableAssignmentKeyword(fromExistingToken=token) @@ -200,7 +200,7 @@ def stateSubtypeIndication(cls, parserState: ParserState): raise BlockParserException("Expected ':=', ';' or whitespace after subtype indication.", token) @classmethod - def stateWhitespace4(cls, parserState: ParserState): + def stateWhitespace4(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, FusedCharacterToken) and (token == ":="): parserState.NewToken = VariableAssignmentKeyword(fromExistingToken=token) diff --git a/pyVHDLParser/Blocks/Reference/Context.py b/pyVHDLParser/Blocks/Reference/Context.py index 138d0b634..db7d2a83d 100644 --- a/pyVHDLParser/Blocks/Reference/Context.py +++ b/pyVHDLParser/Blocks/Reference/Context.py @@ -31,7 +31,7 @@ from pyVHDLParser.Token import CommentToken, SpaceToken, LinebreakToken, MultiLineCommentToken, IndentationToken, SingleLineCommentToken, ExtendedIdentifier from pyVHDLParser.Token.Keywords import WordToken, BoundaryToken, IdentifierToken, IsKeyword, UseKeyword, EndKeyword, ContextKeyword, LibraryKeyword -from pyVHDLParser.Blocks import Block, CommentBlock, BlockParserException, ParserState +from pyVHDLParser.Blocks import Block, CommentBlock, BlockParserException, TokenToBlockParser from pyVHDLParser.Blocks.Common import LinebreakBlock, IndentationBlock, WhitespaceBlock from pyVHDLParser.Blocks.Generic import EndBlock as EndBlockBase @@ -50,7 +50,7 @@ def __cls_init__(cls): LibraryKeyword: Library.StartBlock.stateLibraryKeyword } @classmethod - def stateContextKeyword(cls, parserState: ParserState): + def stateContextKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -67,7 +67,7 @@ def stateContextKeyword(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after keyword CONTEXT.", token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): parserState.NewToken = IdentifierToken(fromExistingToken=token) @@ -100,7 +100,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise BlockParserException("Expected context name (identifier).", token) @classmethod - def stateContextName(cls, parserState: ParserState): + def stateContextName(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -117,7 +117,7 @@ def stateContextName(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after context name (identifier).", token) @classmethod - def stateWhitespace2(cls, parserState: ParserState): + def stateWhitespace2(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken) and (token <= "is"): parserState.NewToken = IsKeyword(fromExistingToken=token) @@ -148,7 +148,7 @@ def stateWhitespace2(cls, parserState: ParserState): raise BlockParserException("Expected keyword IS after context name.", token) @classmethod - def stateDeclarativeRegion(cls, parserState: ParserState): + def stateDeclarativeRegion(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): blockType = IndentationBlock if isinstance(token, IndentationToken) else WhitespaceBlock diff --git a/pyVHDLParser/Blocks/Reference/Library.py b/pyVHDLParser/Blocks/Reference/Library.py index 899a7a766..53f2b6834 100644 --- a/pyVHDLParser/Blocks/Reference/Library.py +++ b/pyVHDLParser/Blocks/Reference/Library.py @@ -31,14 +31,14 @@ from pyVHDLParser.Token import CharacterToken, SpaceToken, WordToken, LinebreakToken, CommentToken, IndentationToken, SingleLineCommentToken, MultiLineCommentToken, ExtendedIdentifier from pyVHDLParser.Token.Keywords import BoundaryToken, IdentifierToken, EndToken, DelimiterToken -from pyVHDLParser.Blocks import BlockParserException, Block, CommentBlock, ParserState, FinalBlock, SkipableBlock +from pyVHDLParser.Blocks import BlockParserException, Block, CommentBlock, TokenToBlockParser, FinalBlock, SkipableBlock from pyVHDLParser.Blocks.Common import LinebreakBlock, WhitespaceBlock @export class StartBlock(Block): @classmethod - def stateLibraryKeyword(cls, parserState: ParserState): + def stateLibraryKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -57,7 +57,7 @@ def stateLibraryKeyword(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after keyword LIBRARY.", token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): parserState.NewToken = IdentifierToken(fromExistingToken=token) @@ -86,7 +86,7 @@ def stateWhitespace1(cls, parserState: ParserState): @export class LibraryNameBlock(Block): @classmethod - def stateLibraryName(cls, parserState: ParserState): + def stateLibraryName(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken): if token == ",": @@ -116,7 +116,7 @@ def stateLibraryName(cls, parserState: ParserState): raise BlockParserException("Expected ';' after library name.", token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken): if token == ",": @@ -154,7 +154,7 @@ def stateWhitespace1(cls, parserState: ParserState): @export class DelimiterBlock(SkipableBlock): @classmethod - def stateDelimiter(cls, parserState: ParserState): + def stateDelimiter(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): parserState.NewToken = IdentifierToken(fromExistingToken=token) @@ -183,7 +183,7 @@ def stateDelimiter(cls, parserState: ParserState): raise BlockParserException("Expected library name (identifier).", token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): parserState.NewToken = IdentifierToken(fromExistingToken=token) diff --git a/pyVHDLParser/Blocks/Reference/Use.py b/pyVHDLParser/Blocks/Reference/Use.py index 93651560a..b15fc303b 100644 --- a/pyVHDLParser/Blocks/Reference/Use.py +++ b/pyVHDLParser/Blocks/Reference/Use.py @@ -31,14 +31,14 @@ from pyVHDLParser.Token import CharacterToken, SpaceToken, WordToken, LinebreakToken, CommentToken, MultiLineCommentToken, IndentationToken, SingleLineCommentToken, ExtendedIdentifier from pyVHDLParser.Token.Keywords import BoundaryToken, IdentifierToken, DelimiterToken, EndToken, AllKeyword -from pyVHDLParser.Blocks import BlockParserException, Block, CommentBlock, ParserState, FinalBlock, SkipableBlock +from pyVHDLParser.Blocks import BlockParserException, Block, CommentBlock, TokenToBlockParser, FinalBlock, SkipableBlock from pyVHDLParser.Blocks.Common import LinebreakBlock, WhitespaceBlock @export class StartBlock(Block): @classmethod - def stateUseKeyword(cls, parserState: ParserState): + def stateUseKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -57,7 +57,7 @@ def stateUseKeyword(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after keyword USE.", token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): parserState.NewToken = IdentifierToken(fromExistingToken=token) @@ -86,7 +86,7 @@ def stateWhitespace1(cls, parserState: ParserState): @export class ReferenceNameBlock(Block): @classmethod - def stateLibraryName(cls, parserState: ParserState): + def stateLibraryName(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == "."): parserState.NewToken = DelimiterToken(fromExistingToken=token) @@ -107,7 +107,7 @@ def stateLibraryName(cls, parserState: ParserState): raise BlockParserException("Expected '.' after library name.", token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == "."): parserState.NewToken = DelimiterToken(fromExistingToken=token) @@ -141,7 +141,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise BlockParserException("Expected '.'.", token) @classmethod - def stateDot1(cls, parserState: ParserState): + def stateDot1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): parserState.NewToken = IdentifierToken(fromExistingToken=token) @@ -169,7 +169,7 @@ def stateDot1(cls, parserState: ParserState): raise BlockParserException("Expected package name after '.'.", token) @classmethod - def stateWhitespace2(cls, parserState: ParserState): + def stateWhitespace2(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): parserState.NewToken = IdentifierToken(fromExistingToken=token) @@ -207,7 +207,7 @@ def stateWhitespace2(cls, parserState: ParserState): raise BlockParserException("Expected package name (identifier).", token) @classmethod - def statePackageName(cls, parserState: ParserState): + def statePackageName(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == "."): parserState.NewToken = DelimiterToken(fromExistingToken=token) @@ -228,7 +228,7 @@ def statePackageName(cls, parserState: ParserState): raise BlockParserException("Expected '.' after package name.", token) @classmethod - def stateWhitespace3(cls, parserState: ParserState): + def stateWhitespace3(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == "."): parserState.NewToken = DelimiterToken(fromExistingToken=token) @@ -262,7 +262,7 @@ def stateWhitespace3(cls, parserState: ParserState): raise BlockParserException("Expected '.'.", token) @classmethod - def stateDot2(cls, parserState: ParserState): + def stateDot2(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): if token <= "all": @@ -289,7 +289,7 @@ def stateDot2(cls, parserState: ParserState): raise BlockParserException("Expected object name after '.'.", token) @classmethod - def stateWhitespace4(cls, parserState: ParserState): + def stateWhitespace4(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == "."): parserState.NewToken = DelimiterToken(fromExistingToken=token) @@ -325,7 +325,7 @@ def stateWhitespace4(cls, parserState: ParserState): raise BlockParserException("Expected object name (identifier) or keyword ALL.", token) @classmethod - def stateObjectName(cls, parserState: ParserState): + def stateObjectName(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken): if token == ",": @@ -357,7 +357,7 @@ def stateObjectName(cls, parserState: ParserState): raise BlockParserException("Expected ',', ';' or whitespace.", token) @classmethod - def stateWhitespace5(cls, parserState: ParserState): + def stateWhitespace5(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken): if token == ",": @@ -396,7 +396,7 @@ def stateWhitespace5(cls, parserState: ParserState): @export class DelimiterBlock(SkipableBlock): @classmethod - def stateDelimiter(cls, parserState: ParserState): + def stateDelimiter(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): parserState.NewToken = IdentifierToken(fromExistingToken=token) @@ -424,7 +424,7 @@ def stateDelimiter(cls, parserState: ParserState): raise BlockParserException("Expected library name (identifier) or whitespace.", token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): parserState.NewToken = IdentifierToken(fromExistingToken=token) diff --git a/pyVHDLParser/Blocks/Reporting/Assert.py b/pyVHDLParser/Blocks/Reporting/Assert.py index e98e3d55a..10a677a36 100644 --- a/pyVHDLParser/Blocks/Reporting/Assert.py +++ b/pyVHDLParser/Blocks/Reporting/Assert.py @@ -32,14 +32,14 @@ from pyVHDLParser.Token import SpaceToken, LinebreakToken, WordToken, IndentationToken, CharacterToken from pyVHDLParser.Token import CommentToken, SingleLineCommentToken, MultiLineCommentToken from pyVHDLParser.Token.Keywords import BoundaryToken, IdentifierToken, ReportKeyword, EndToken, SeverityKeyword -from pyVHDLParser.Blocks import Block, CommentBlock, ParserState, BlockParserException +from pyVHDLParser.Blocks import Block, CommentBlock, TokenToBlockParser, BlockParserException from pyVHDLParser.Blocks.Common import LinebreakBlock, WhitespaceBlock @export class AssertBlock(Block): @classmethod - def stateAssertKeyword(cls, parserState: ParserState): + def stateAssertKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -56,7 +56,7 @@ def stateAssertKeyword(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after keyword ASSERT.", token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): parserState.NewToken = IdentifierToken(fromExistingToken=token) @@ -86,7 +86,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise BlockParserException("Expected assertion (expression).", token) @classmethod - def stateAssertion(cls, parserState: ParserState): + def stateAssertion(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -103,7 +103,7 @@ def stateAssertion(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after assertion (expression).", token) @classmethod - def stateWhitespace2(cls, parserState: ParserState): + def stateWhitespace2(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken) and (token <= "report"): parserState.NewToken = ReportKeyword(fromExistingToken=token) @@ -133,7 +133,7 @@ def stateWhitespace2(cls, parserState: ParserState): raise BlockParserException("Expected keyword REPORT after assertion (expression).", token) @classmethod - def stateReportKeyword(cls, parserState: ParserState): + def stateReportKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -150,7 +150,7 @@ def stateReportKeyword(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after keyword REPORT.", token) @classmethod - def stateWhitespace3(cls, parserState: ParserState): + def stateWhitespace3(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): parserState.NewToken = IdentifierToken(fromExistingToken=token) @@ -180,7 +180,7 @@ def stateWhitespace3(cls, parserState: ParserState): raise BlockParserException("Expected report message (expression) after keyword REPORT.", token) @classmethod - def stateMessage(cls, parserState: ParserState): + def stateMessage(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken)and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) @@ -202,7 +202,7 @@ def stateMessage(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after report message (expression).", token) @classmethod - def stateWhitespace4(cls, parserState: ParserState): + def stateWhitespace4(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken)and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) @@ -237,7 +237,7 @@ def stateWhitespace4(cls, parserState: ParserState): raise BlockParserException("Expected keyword SEVERITY after report message (expression).", token) @classmethod - def stateSeverityKeyword(cls, parserState: ParserState): + def stateSeverityKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -254,7 +254,7 @@ def stateSeverityKeyword(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after keyword SEVERITY.", token) @classmethod - def stateWhitespace5(cls, parserState: ParserState): + def stateWhitespace5(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): parserState.NewToken = IdentifierToken(fromExistingToken=token) @@ -284,7 +284,7 @@ def stateWhitespace5(cls, parserState: ParserState): raise BlockParserException("Expected severity level (expression) after keyword SEVERITY.", token) @classmethod - def stateSeverityLevel(cls, parserState: ParserState): + def stateSeverityLevel(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) @@ -306,7 +306,7 @@ def stateSeverityLevel(cls, parserState: ParserState): raise BlockParserException("Expected ';' or whitespace after severity level (expression).", token) @classmethod - def stateWhitespace6(cls, parserState: ParserState): + def stateWhitespace6(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken)and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) diff --git a/pyVHDLParser/Blocks/Reporting/Report.py b/pyVHDLParser/Blocks/Reporting/Report.py index ecf8cb8d7..c3c179bb5 100644 --- a/pyVHDLParser/Blocks/Reporting/Report.py +++ b/pyVHDLParser/Blocks/Reporting/Report.py @@ -32,14 +32,14 @@ from pyVHDLParser.Token import SpaceToken, LinebreakToken, WordToken, IndentationToken, CharacterToken from pyVHDLParser.Token import CommentToken, SingleLineCommentToken, MultiLineCommentToken from pyVHDLParser.Token.Keywords import BoundaryToken, IdentifierToken, EndToken, SeverityKeyword -from pyVHDLParser.Blocks import Block, CommentBlock, ParserState, BlockParserException +from pyVHDLParser.Blocks import Block, CommentBlock, TokenToBlockParser, BlockParserException from pyVHDLParser.Blocks.Common import LinebreakBlock, WhitespaceBlock @export class ReportBlock(Block): @classmethod - def stateReportKeyword(cls, parserState: ParserState): + def stateReportKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -56,7 +56,7 @@ def stateReportKeyword(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after keyword ARCHITECTURE.", token) @classmethod - def stateWhitespace3(cls, parserState: ParserState): + def stateWhitespace3(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): parserState.NewToken = IdentifierToken(fromExistingToken=token) @@ -86,7 +86,7 @@ def stateWhitespace3(cls, parserState: ParserState): raise BlockParserException("Expected keyword REPORT after assertion.", token) @classmethod - def stateMessage(cls, parserState: ParserState): + def stateMessage(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken)and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) @@ -108,7 +108,7 @@ def stateMessage(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after assertion.", token) @classmethod - def stateWhitespace4(cls, parserState: ParserState): + def stateWhitespace4(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken)and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) @@ -143,7 +143,7 @@ def stateWhitespace4(cls, parserState: ParserState): raise BlockParserException("Expected keyword SEVERITY after message.", token) @classmethod - def stateSeverityKeyword(cls, parserState: ParserState): + def stateSeverityKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -160,7 +160,7 @@ def stateSeverityKeyword(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after keyword SEVERITY.", token) @classmethod - def stateWhitespace5(cls, parserState: ParserState): + def stateWhitespace5(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): parserState.NewToken = IdentifierToken(fromExistingToken=token) @@ -190,7 +190,7 @@ def stateWhitespace5(cls, parserState: ParserState): raise BlockParserException("Expected keyword REPORT after assertion.", token) @classmethod - def stateSeverityLevel(cls, parserState: ParserState): + def stateSeverityLevel(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) @@ -212,7 +212,7 @@ def stateSeverityLevel(cls, parserState: ParserState): raise BlockParserException("Expected ';' or whitespace after severity level.", token) @classmethod - def stateWhitespace6(cls, parserState: ParserState): + def stateWhitespace6(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken): if token == ";": diff --git a/pyVHDLParser/Blocks/Sequential/Function.py b/pyVHDLParser/Blocks/Sequential/Function.py index c5eeb4b47..074a1c885 100644 --- a/pyVHDLParser/Blocks/Sequential/Function.py +++ b/pyVHDLParser/Blocks/Sequential/Function.py @@ -33,7 +33,7 @@ from pyVHDLParser.Token.Keywords import WordToken, BoundaryToken, IdentifierToken, PureKeyword, ImpureKeyword from pyVHDLParser.Token.Keywords import ReturnKeyword, GenericKeyword, ParameterKeyword, FunctionKeyword, EndKeyword from pyVHDLParser.Token.Keywords import UseKeyword, ConstantKeyword, VariableKeyword, IsKeyword, EndToken, BeginKeyword, ProcedureKeyword, ReportKeyword -from pyVHDLParser.Blocks import Block, BlockParserException, CommentBlock, ParserState +from pyVHDLParser.Blocks import Block, BlockParserException, CommentBlock, TokenToBlockParser from pyVHDLParser.Blocks.Common import LinebreakBlock, IndentationBlock, WhitespaceBlock from pyVHDLParser.Blocks.Generic import SequentialBeginBlock, SequentialDeclarativeRegion from pyVHDLParser.Blocks.Generic1 import EndBlock as EndBlockBase @@ -61,7 +61,7 @@ class DeclarativeRegion(SequentialDeclarativeRegion): @export class NameBlock(Block): @classmethod - def statePureKeyword(cls, parserState: ParserState): + def statePureKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -78,7 +78,7 @@ def statePureKeyword(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after keyword PURE.", token) @classmethod - def stateImpureKeyword(cls, parserState: ParserState): + def stateImpureKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -95,7 +95,7 @@ def stateImpureKeyword(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after keyword IMPURE.", token) @classmethod - def stateWhitespace0(cls, parserState: ParserState): + def stateWhitespace0(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): parserState.NewToken = IdentifierToken(fromExistingToken=token) @@ -123,7 +123,7 @@ def stateWhitespace0(cls, parserState: ParserState): raise BlockParserException("Expected keyword FUNCTION.", token) @classmethod - def stateFunctionKeyword(cls, parserState: ParserState): + def stateFunctionKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -140,7 +140,7 @@ def stateFunctionKeyword(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after keyword FUNCTION.", token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): parserState.NewToken = IdentifierToken(fromExistingToken=token) @@ -168,7 +168,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise BlockParserException("Expected function name (designator).", token) @classmethod - def stateFunctionName(cls, parserState: ParserState): + def stateFunctionName(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == "("): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -194,7 +194,7 @@ def stateFunctionName(cls, parserState: ParserState): raise BlockParserException("Expected '(' or whitespace after function name.", token) @classmethod - def stateWhitespace2(cls, parserState: ParserState): + def stateWhitespace2(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == "("): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -250,7 +250,7 @@ def stateWhitespace2(cls, parserState: ParserState): @export class ReturnTypeBlock(Block): @classmethod - def stateAfterParameterList(cls, parserState: ParserState): + def stateAfterParameterList(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): if token <= "return": @@ -272,7 +272,7 @@ def stateAfterParameterList(cls, parserState: ParserState): raise BlockParserException("Expected keyword RETURN.", token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken) and (token <= "return"): parserState.NewToken = ReturnKeyword(fromExistingToken=token) @@ -300,7 +300,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise BlockParserException("Expected function name (designator).", token) @classmethod - def stateReturnKeyword(cls, parserState: ParserState): + def stateReturnKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected whitespace after keyword RETURN." if isinstance(token, SpaceToken): @@ -322,7 +322,7 @@ def stateReturnKeyword(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateWhitespace2(cls, parserState: ParserState): + def stateWhitespace2(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): parserState.NewToken = IdentifierToken(fromExistingToken=token) @@ -350,7 +350,7 @@ def stateWhitespace2(cls, parserState: ParserState): raise BlockParserException("Expected return type (type mark).", token) @classmethod - def stateReturnType(cls, parserState: ParserState): + def stateReturnType(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ';' or whitespace after type mark (return type)." if isinstance(token, CharacterToken) and (token == ";"): @@ -373,7 +373,7 @@ def stateReturnType(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateWhitespace3(cls, parserState: ParserState): + def stateWhitespace3(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) diff --git a/pyVHDLParser/Blocks/Sequential/Package.py b/pyVHDLParser/Blocks/Sequential/Package.py index 664de6e13..96112520e 100644 --- a/pyVHDLParser/Blocks/Sequential/Package.py +++ b/pyVHDLParser/Blocks/Sequential/Package.py @@ -33,7 +33,7 @@ from pyVHDLParser.Token.Keywords import PackageKeyword, IsKeyword, EndKeyword, GenericKeyword, BodyKeyword, UseKeyword, VariableKeyword, SignalKeyword from pyVHDLParser.Token.Keywords import BoundaryToken, IdentifierToken from pyVHDLParser.Token.Keywords import ConstantKeyword, SharedKeyword, ProcedureKeyword, FunctionKeyword, PureKeyword, ImpureKeyword -from pyVHDLParser.Blocks import BlockParserException, Block, CommentBlock, ParserState +from pyVHDLParser.Blocks import BlockParserException, Block, CommentBlock, TokenToBlockParser from pyVHDLParser.Blocks.Common import LinebreakBlock, IndentationBlock, WhitespaceBlock from pyVHDLParser.Blocks.Generic import SequentialDeclarativeRegion from pyVHDLParser.Blocks.Generic1 import EndBlock as EndBlockBase @@ -65,7 +65,7 @@ def __cls_init__(cls): @export class NameBlock(Block): @classmethod - def statePackageKeyword(cls, parserState: ParserState): + def statePackageKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -82,7 +82,7 @@ def statePackageKeyword(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after keyword PACKAGE.", token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): if token <= "body": @@ -115,7 +115,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise BlockParserException("Expected package name (identifier).", token) @classmethod - def statePackageName(cls, parserState: ParserState): + def statePackageName(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -132,7 +132,7 @@ def statePackageName(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after package name.", token) @classmethod - def stateWhitespace2(cls, parserState: ParserState): + def stateWhitespace2(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken) and (token <= "is"): parserState.NewToken = IsKeyword(fromExistingToken=token) diff --git a/pyVHDLParser/Blocks/Sequential/PackageBody.py b/pyVHDLParser/Blocks/Sequential/PackageBody.py index d65e94c0a..6495a2251 100644 --- a/pyVHDLParser/Blocks/Sequential/PackageBody.py +++ b/pyVHDLParser/Blocks/Sequential/PackageBody.py @@ -33,7 +33,7 @@ from pyVHDLParser.Token.Keywords import PackageKeyword, IsKeyword, EndKeyword, BodyKeyword, FunctionKeyword, SignalKeyword from pyVHDLParser.Token.Keywords import BoundaryToken, IdentifierToken from pyVHDLParser.Token.Keywords import ConstantKeyword, SharedKeyword, ProcedureKeyword, FunctionKeyword, PureKeyword, ImpureKeyword -from pyVHDLParser.Blocks import BlockParserException, Block, CommentBlock, ParserState +from pyVHDLParser.Blocks import BlockParserException, Block, CommentBlock, TokenToBlockParser from pyVHDLParser.Blocks.Common import LinebreakBlock, IndentationBlock, WhitespaceBlock from pyVHDLParser.Blocks.Generic import SequentialDeclarativeRegion from pyVHDLParser.Blocks.Generic1 import EndBlock as EndBlockBase @@ -54,7 +54,7 @@ class DeclarativeRegion(SequentialDeclarativeRegion): @export class NameBlock(Block): @classmethod - def stateBodyKeyword(cls, parserState: ParserState): + def stateBodyKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -71,7 +71,7 @@ def stateBodyKeyword(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after keyword ", token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): parserState.NewToken = IdentifierToken(fromExistingToken=token) @@ -99,7 +99,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise BlockParserException("Expected package name (identifier).", token) @classmethod - def statePackageName(cls, parserState: ParserState): + def statePackageName(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -116,7 +116,7 @@ def statePackageName(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after package name.", token) @classmethod - def stateWhitespace2(cls, parserState: ParserState): + def stateWhitespace2(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken) and (token <= "is"): parserState.NewToken = IsKeyword(fromExistingToken=token) diff --git a/pyVHDLParser/Blocks/Sequential/Procedure.py b/pyVHDLParser/Blocks/Sequential/Procedure.py index c4257465d..1669e0283 100644 --- a/pyVHDLParser/Blocks/Sequential/Procedure.py +++ b/pyVHDLParser/Blocks/Sequential/Procedure.py @@ -32,7 +32,7 @@ from pyVHDLParser.Token import SpaceToken, LinebreakToken, CommentToken, CharacterToken, IndentationToken, MultiLineCommentToken from pyVHDLParser.Token.Keywords import WordToken, BoundaryToken, IdentifierToken, GenericKeyword, ParameterKeyword, ProcedureKeyword, EndKeyword, ImpureKeyword, PureKeyword from pyVHDLParser.Token.Keywords import UseKeyword, ConstantKeyword, VariableKeyword, IsKeyword, EndToken, BeginKeyword, FunctionKeyword, ReportKeyword -from pyVHDLParser.Blocks import Block, BlockParserException, CommentBlock, ParserState +from pyVHDLParser.Blocks import Block, BlockParserException, CommentBlock, TokenToBlockParser from pyVHDLParser.Blocks.Common import LinebreakBlock, IndentationBlock, WhitespaceBlock # from pyVHDLParser.Blocks.ControlStructure import If, Case, ForLoop, WhileLoop, Return from pyVHDLParser.Blocks.Generic import SequentialBeginBlock, SequentialDeclarativeRegion @@ -61,7 +61,7 @@ class DeclarativeRegion(SequentialDeclarativeRegion): @export class NameBlock(Block): @classmethod - def stateProcedureKeyword(cls, parserState: ParserState): + def stateProcedureKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -78,7 +78,7 @@ def stateProcedureKeyword(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after keyword PROCEDURE.", token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): parserState.NewToken = IdentifierToken(fromExistingToken=token) @@ -106,7 +106,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise BlockParserException("Expected procedure name (designator).", token) @classmethod - def stateProcedureName(cls, parserState: ParserState): + def stateProcedureName(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken): if token == "(": @@ -139,7 +139,7 @@ def stateProcedureName(cls, parserState: ParserState): raise BlockParserException("Expected ';', '(' or whitespace after procedure name.", token) @classmethod - def stateWhitespace2(cls, parserState: ParserState): + def stateWhitespace2(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken): if token == "(": @@ -203,7 +203,7 @@ def stateWhitespace2(cls, parserState: ParserState): @export class VoidBlock(Block): @classmethod - def stateAfterParameterList(cls, parserState: ParserState): + def stateAfterParameterList(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == ";"): parserState.NewToken = EndToken(fromExistingToken=token) @@ -230,7 +230,7 @@ def stateAfterParameterList(cls, parserState: ParserState): raise BlockParserException("Expected keyword RETURN.", token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken) and (token <= "is"): parserState.NewToken = IsKeyword(fromExistingToken=token) diff --git a/pyVHDLParser/Blocks/Sequential/Process.py b/pyVHDLParser/Blocks/Sequential/Process.py index 08a7a0b1b..f00d3e77b 100644 --- a/pyVHDLParser/Blocks/Sequential/Process.py +++ b/pyVHDLParser/Blocks/Sequential/Process.py @@ -32,7 +32,7 @@ from pyVHDLParser.Token import CharacterToken, SpaceToken, LinebreakToken, CommentToken, IndentationToken, MultiLineCommentToken, SingleLineCommentToken from pyVHDLParser.Token.Keywords import WordToken, BoundaryToken, IsKeyword, UseKeyword, ConstantKeyword, ImpureKeyword, PureKeyword from pyVHDLParser.Token.Keywords import VariableKeyword, ProcessKeyword, BeginKeyword, FunctionKeyword, ProcedureKeyword -from pyVHDLParser.Blocks import Block, CommentBlock, BlockParserException, ParserState +from pyVHDLParser.Blocks import Block, CommentBlock, BlockParserException, TokenToBlockParser from pyVHDLParser.Blocks.Common import LinebreakBlock, IndentationBlock, WhitespaceBlock # from pyVHDLParser.Blocks.ControlStructure import If, Case, ForLoop, WhileLoop from pyVHDLParser.Blocks.Generic import SequentialBeginBlock, SequentialDeclarativeRegion @@ -61,7 +61,7 @@ class DeclarativeRegion(SequentialDeclarativeRegion): @export class OpenBlock(Block): @classmethod - def stateProcessKeyword(cls, parserState: ParserState): + def stateProcessKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken)and (token == "("): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -84,7 +84,7 @@ def stateProcessKeyword(cls, parserState: ParserState): raise BlockParserException("Expected '(' or whitespace after keyword PROCESS.", token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken)and (token == "("): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -161,7 +161,7 @@ def __cls_init__(cls): } @classmethod - def stateAfterSensitivityList(cls, parserState: ParserState): + def stateAfterSensitivityList(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): tokenValue = token.Value.lower() @@ -202,7 +202,7 @@ def stateAfterSensitivityList(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after keyword ENTITY.", token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): tokenValue = token.Value.lower() diff --git a/pyVHDLParser/Blocks/Structural/Architecture.py b/pyVHDLParser/Blocks/Structural/Architecture.py index 3fe2b2d4d..73951f2aa 100644 --- a/pyVHDLParser/Blocks/Structural/Architecture.py +++ b/pyVHDLParser/Blocks/Structural/Architecture.py @@ -31,7 +31,7 @@ from pyVHDLParser.Token import LinebreakToken, WordToken, SpaceToken, CommentToken, MultiLineCommentToken, IndentationToken, SingleLineCommentToken, ExtendedIdentifier from pyVHDLParser.Token.Keywords import ArchitectureKeyword, IsKeyword, OfKeyword, BoundaryToken, IdentifierToken -from pyVHDLParser.Blocks import BlockParserException, Block, CommentBlock, ParserState +from pyVHDLParser.Blocks import BlockParserException, Block, CommentBlock, TokenToBlockParser from pyVHDLParser.Blocks.Common import LinebreakBlock, WhitespaceBlock from pyVHDLParser.Blocks.Generic import ConcurrentBeginBlock, ConcurrentDeclarativeRegion from pyVHDLParser.Blocks.Generic1 import EndBlock as EndBlockBase @@ -58,7 +58,7 @@ class DeclarativeRegion(ConcurrentDeclarativeRegion): @export class NameBlock(Block): @classmethod - def stateArchitectureKeyword(cls, parserState: ParserState): + def stateArchitectureKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -75,7 +75,7 @@ def stateArchitectureKeyword(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after keyword ARCHITECTURE.", token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): parserState.NewToken = IdentifierToken(fromExistingToken=token) @@ -108,7 +108,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise BlockParserException("Expected architecture name (identifier).", token) @classmethod - def stateArchitectureName(cls, parserState: ParserState): + def stateArchitectureName(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -125,7 +125,7 @@ def stateArchitectureName(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after architecture name.", token) @classmethod - def stateWhitespace2(cls, parserState: ParserState): + def stateWhitespace2(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken) and (token <= "of"): parserState.NewToken = OfKeyword(fromExistingToken=token) @@ -155,7 +155,7 @@ def stateWhitespace2(cls, parserState: ParserState): raise BlockParserException("Expected keyword IS after architecture name.", token) @classmethod - def stateOfKeyword(cls, parserState: ParserState): + def stateOfKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -172,7 +172,7 @@ def stateOfKeyword(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after keyword ARCHITECTURE.", token) @classmethod - def stateWhitespace3(cls, parserState: ParserState): + def stateWhitespace3(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): parserState.NewToken = IdentifierToken(fromExistingToken=token) @@ -205,7 +205,7 @@ def stateWhitespace3(cls, parserState: ParserState): raise BlockParserException("Expected architecture name (identifier).", token) @classmethod - def stateEntityName(cls, parserState: ParserState): + def stateEntityName(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -222,7 +222,7 @@ def stateEntityName(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after architecture name.", token) @classmethod - def stateWhitespace4(cls, parserState: ParserState): + def stateWhitespace4(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken) and (token <= "is"): parserState.NewToken = IsKeyword(fromExistingToken=token) diff --git a/pyVHDLParser/Blocks/Structural/Block.py b/pyVHDLParser/Blocks/Structural/Block.py index 4c3aba32f..e02fe58f9 100644 --- a/pyVHDLParser/Blocks/Structural/Block.py +++ b/pyVHDLParser/Blocks/Structural/Block.py @@ -33,7 +33,7 @@ from pyVHDLParser.Token.Keywords import BoundaryToken, IdentifierToken, EndToken from pyVHDLParser.Token.Keywords import SignalKeyword, ConstantKeyword, VariableKeyword, SharedKeyword, ProcessKeyword, AssertKeyword, BlockKeyword from pyVHDLParser.Token.Keywords import IsKeyword, EndKeyword, BlockKeyword, BeginKeyword -from pyVHDLParser.Blocks import Block, BlockParserException, ParserState +from pyVHDLParser.Blocks import Block, BlockParserException, TokenToBlockParser from pyVHDLParser.Blocks.Common import LinebreakBlock, IndentationBlock, WhitespaceBlock from pyVHDLParser.Blocks.Comment import SingleLineCommentBlock, MultiLineCommentBlock from pyVHDLParser.Blocks.Generic import EndBlock as EndBlockBase, ConcurrentDeclarativeRegion, ConcurrentBeginBlock @@ -62,7 +62,7 @@ class DeclarativeRegion(ConcurrentDeclarativeRegion): @export class NameBlock(Block): @classmethod - def stateBlockKeyword(cls, parserState: ParserState): + def stateBlockKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected whitespace after keyword " if isinstance(token, CharacterToken): @@ -96,7 +96,7 @@ def stateBlockKeyword(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected block name (identifier)." if isinstance(token, CharacterToken): @@ -136,7 +136,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateBlockName(cls, parserState: ParserState): + def stateBlockName(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected whitespace after keyword " if isinstance(token, CharacterToken): @@ -169,7 +169,7 @@ def stateBlockName(cls, parserState: ParserState): raise BlockParserException(errorMessage, token) @classmethod - def stateWhitespace2(cls, parserState: ParserState): + def stateWhitespace2(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected keyword IS after block name." if isinstance(token, CharacterToken): diff --git a/pyVHDLParser/Blocks/Structural/Component.py b/pyVHDLParser/Blocks/Structural/Component.py index 2d3ca8965..526e55593 100644 --- a/pyVHDLParser/Blocks/Structural/Component.py +++ b/pyVHDLParser/Blocks/Structural/Component.py @@ -32,7 +32,7 @@ from pyVHDLParser.Token import LinebreakToken, WordToken, SpaceToken, CommentToken, MultiLineCommentToken, IndentationToken, SingleLineCommentToken, ExtendedIdentifier from pyVHDLParser.Token.Keywords import ComponentKeyword, IsKeyword, EndKeyword, GenericKeyword, PortKeyword, UseKeyword, BeginKeyword from pyVHDLParser.Token.Keywords import BoundaryToken, IdentifierToken -from pyVHDLParser.Blocks import BlockParserException, Block, CommentBlock, ParserState +from pyVHDLParser.Blocks import BlockParserException, Block, CommentBlock, TokenToBlockParser from pyVHDLParser.Blocks.Common import LinebreakBlock, IndentationBlock, WhitespaceBlock from pyVHDLParser.Blocks.Generic import EndBlock as EndBlockBase @@ -52,7 +52,7 @@ def __cls_init__(cls): } @classmethod - def stateComponentKeyword(cls, parserState: ParserState): + def stateComponentKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -69,7 +69,7 @@ def stateComponentKeyword(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after keyword COMPONENT.", token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): parserState.NewToken = IdentifierToken(fromExistingToken=token) @@ -101,7 +101,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise BlockParserException("Expected component name (identifier).", token) @classmethod - def stateComponentName(cls, parserState: ParserState): + def stateComponentName(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -118,7 +118,7 @@ def stateComponentName(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after component name.", token) @classmethod - def stateWhitespace2(cls, parserState: ParserState): + def stateWhitespace2(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken) and (token <= "is"): parserState.NewToken = IsKeyword(fromExistingToken=token) @@ -150,7 +150,7 @@ def stateWhitespace2(cls, parserState: ParserState): raise BlockParserException("Expected keyword IS after component name.", token) @classmethod - def stateDeclarativeRegion(cls, parserState: ParserState): + def stateDeclarativeRegion(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): diff --git a/pyVHDLParser/Blocks/Structural/Configuration.py b/pyVHDLParser/Blocks/Structural/Configuration.py index 0e3021f72..361da99f9 100644 --- a/pyVHDLParser/Blocks/Structural/Configuration.py +++ b/pyVHDLParser/Blocks/Structural/Configuration.py @@ -32,7 +32,7 @@ from pyVHDLParser.Token import LinebreakToken, WordToken, SpaceToken, CommentToken, MultiLineCommentToken, IndentationToken, SingleLineCommentToken, ExtendedIdentifier from pyVHDLParser.Token.Keywords import ConfigurationKeyword, IsKeyword, EndKeyword, GenericKeyword, PortKeyword, UseKeyword, BeginKeyword from pyVHDLParser.Token.Keywords import BoundaryToken, IdentifierToken -from pyVHDLParser.Blocks import BlockParserException, Block, CommentBlock, ParserState +from pyVHDLParser.Blocks import BlockParserException, Block, CommentBlock, TokenToBlockParser from pyVHDLParser.Blocks.Common import LinebreakBlock, IndentationBlock, WhitespaceBlock from pyVHDLParser.Blocks.Generic import ConcurrentBeginBlock, EndBlock as EndBlockBase @@ -54,7 +54,7 @@ def __cls_init__(cls): } @classmethod - def stateConfigurationKeyword(cls, parserState: ParserState): + def stateConfigurationKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -71,7 +71,7 @@ def stateConfigurationKeyword(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after keyword CONFIGURATION.", token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): parserState.NewToken = IdentifierToken(fromExistingToken=token) @@ -103,7 +103,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise BlockParserException("Expected configuration name (identifier).", token) @classmethod - def stateConfigurationName(cls, parserState: ParserState): + def stateConfigurationName(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -120,7 +120,7 @@ def stateConfigurationName(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after configuration name.", token) @classmethod - def stateWhitespace2(cls, parserState: ParserState): + def stateWhitespace2(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken) and (token <= "is"): parserState.NewToken = IsKeyword(fromExistingToken=token) @@ -152,7 +152,7 @@ def stateWhitespace2(cls, parserState: ParserState): raise BlockParserException("Expected keyword IS after configuration name.", token) @classmethod - def stateDeclarativeRegion(cls, parserState: ParserState): + def stateDeclarativeRegion(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): diff --git a/pyVHDLParser/Blocks/Structural/Entity.py b/pyVHDLParser/Blocks/Structural/Entity.py index 38dfde62e..0c00feb18 100644 --- a/pyVHDLParser/Blocks/Structural/Entity.py +++ b/pyVHDLParser/Blocks/Structural/Entity.py @@ -32,7 +32,7 @@ from pyVHDLParser.Token import LinebreakToken, WordToken, SpaceToken, CommentToken, MultiLineCommentToken, IndentationToken, SingleLineCommentToken, ExtendedIdentifier from pyVHDLParser.Token.Keywords import EntityKeyword, IsKeyword, GenericKeyword, PortKeyword from pyVHDLParser.Token.Keywords import BoundaryToken, IdentifierToken -from pyVHDLParser.Blocks import BlockParserException, Block, CommentBlock, ParserState +from pyVHDLParser.Blocks import BlockParserException, Block, CommentBlock, TokenToBlockParser from pyVHDLParser.Blocks.Common import LinebreakBlock, WhitespaceBlock from pyVHDLParser.Blocks.Generic import ConcurrentBeginBlock, ConcurrentDeclarativeRegion from pyVHDLParser.Blocks.Generic1 import EndBlock as EndBlockBase @@ -72,7 +72,7 @@ def __cls_init__(cls): @export class NameBlock(Block): @classmethod - def stateEntityKeyword(cls, parserState: ParserState): + def stateEntityKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -89,7 +89,7 @@ def stateEntityKeyword(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after keyword ENTITY.", token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken): parserState.NewToken = IdentifierToken(fromExistingToken=token) @@ -122,7 +122,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise BlockParserException("Expected entity name (identifier).", token) @classmethod - def stateEntityName(cls, parserState: ParserState): + def stateEntityName(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -139,7 +139,7 @@ def stateEntityName(cls, parserState: ParserState): raise BlockParserException("Expected whitespace after entity name.", token) @classmethod - def stateWhitespace2(cls, parserState: ParserState): + def stateWhitespace2(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, WordToken) and (token <= "is"): parserState.NewToken = IsKeyword(fromExistingToken=token) diff --git a/pyVHDLParser/Blocks/Type/SubType.py b/pyVHDLParser/Blocks/Type/SubType.py index 7b4f86b73..8070c3285 100644 --- a/pyVHDLParser/Blocks/Type/SubType.py +++ b/pyVHDLParser/Blocks/Type/SubType.py @@ -31,7 +31,7 @@ from pyVHDLParser.Token import CharacterToken, LinebreakToken, SpaceToken, WordToken from pyVHDLParser.Token.Keywords import BoundaryToken, IdentifierToken, VariableAssignmentKeyword, EndToken -from pyVHDLParser.Blocks import Block, ParserState +from pyVHDLParser.Blocks import Block, TokenToBlockParser from pyVHDLParser.Blocks.Common import LinebreakBlock, WhitespaceBlock from pyVHDLParser.Blocks.Comment import SingleLineCommentBlock, MultiLineCommentBlock @@ -39,7 +39,7 @@ @export class SubTypeBlock(Block): @classmethod - def stateSubTypeKeyword(cls, parserState: ParserState): + def stateSubTypeKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected whitespace after keyword SUBTYPE." if isinstance(token, CharacterToken): @@ -73,7 +73,7 @@ def stateSubTypeKeyword(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected subtype name (identifier)." if isinstance(token, CharacterToken): @@ -112,7 +112,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def stateSubTypeName(cls, parserState: ParserState): + def stateSubTypeName(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ';' after library name." if isinstance(token, CharacterToken): @@ -149,7 +149,7 @@ def stateSubTypeName(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def stateWhitespace2(cls, parserState: ParserState): + def stateWhitespace2(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected subtype name (identifier)." if isinstance(token, CharacterToken): @@ -192,7 +192,7 @@ def stateWhitespace2(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def stateColon1(cls, parserState: ParserState): + def stateColon1(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected typemark or whitespace after ':'." if isinstance(token, CharacterToken): @@ -230,7 +230,7 @@ def stateColon1(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def stateWhitespace3(cls, parserState: ParserState): + def stateWhitespace3(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected subtype name (identifier)." if isinstance(token, CharacterToken): @@ -269,7 +269,7 @@ def stateWhitespace3(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def stateTypeMarkName(cls, parserState: ParserState): + def stateTypeMarkName(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ':=' or whitespace after type mark." if isinstance(token, CharacterToken): @@ -306,7 +306,7 @@ def stateTypeMarkName(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def stateWhitespace4(cls, parserState: ParserState): + def stateWhitespace4(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ':=' after type mark." if isinstance(token, CharacterToken): @@ -345,7 +345,7 @@ def stateWhitespace4(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def statePossibleVariableAssignment(cls, parserState: ParserState): + def statePossibleVariableAssignment(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == "="): parserState.NewToken = VariableAssignmentKeyword(parserState.TokenMarker) @@ -356,7 +356,7 @@ def statePossibleVariableAssignment(cls, parserState: ParserState): raise NotImplementedError("State=PossibleCommentStart: {0!r}".format(token)) @classmethod - def stateVariableAssignment(cls, parserState: ParserState): + def stateVariableAssignment(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ':=' or whitespace after type mark." if isinstance(token, CharacterToken): @@ -389,7 +389,7 @@ def stateVariableAssignment(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def stateWhitespace5(cls, parserState: ParserState): + def stateWhitespace5(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected expression after ':='." if isinstance(token, CharacterToken): @@ -427,7 +427,7 @@ def stateWhitespace5(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def stateExpressionEnd(cls, parserState: ParserState): + def stateExpressionEnd(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ';'." if isinstance(token, CharacterToken): diff --git a/pyVHDLParser/Blocks/Type/Type.py b/pyVHDLParser/Blocks/Type/Type.py index b0f8210ec..d3c393e6e 100644 --- a/pyVHDLParser/Blocks/Type/Type.py +++ b/pyVHDLParser/Blocks/Type/Type.py @@ -31,7 +31,7 @@ from pyVHDLParser.Token import CharacterToken, LinebreakToken, SpaceToken, WordToken from pyVHDLParser.Token.Keywords import BoundaryToken, IdentifierToken, VariableAssignmentKeyword, EndToken -from pyVHDLParser.Blocks import Block, ParserState +from pyVHDLParser.Blocks import Block, TokenToBlockParser from pyVHDLParser.Blocks.Common import LinebreakBlock, WhitespaceBlock from pyVHDLParser.Blocks.Comment import SingleLineCommentBlock, MultiLineCommentBlock @@ -39,7 +39,7 @@ @export class TypeBlock(Block): @classmethod - def stateTypeKeyword(cls, parserState: ParserState): + def stateTypeKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected whitespace after keyword TYPE." if isinstance(token, CharacterToken): @@ -73,7 +73,7 @@ def stateTypeKeyword(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def stateWhitespace1(cls, parserState: ParserState): + def stateWhitespace1(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected type name (identifier)." if isinstance(token, CharacterToken): @@ -112,7 +112,7 @@ def stateWhitespace1(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def stateTypeName(cls, parserState: ParserState): + def stateTypeName(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ';' after library name." if isinstance(token, CharacterToken): @@ -149,7 +149,7 @@ def stateTypeName(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def stateWhitespace2(cls, parserState: ParserState): + def stateWhitespace2(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected type name (identifier)." if isinstance(token, CharacterToken): @@ -192,7 +192,7 @@ def stateWhitespace2(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def stateColon1(cls, parserState: ParserState): + def stateColon1(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected typemark or whitespace after ':'." if isinstance(token, CharacterToken): @@ -230,7 +230,7 @@ def stateColon1(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def stateWhitespace3(cls, parserState: ParserState): + def stateWhitespace3(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected type name (identifier)." if isinstance(token, CharacterToken): @@ -269,7 +269,7 @@ def stateWhitespace3(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def stateTypeMarkName(cls, parserState: ParserState): + def stateTypeMarkName(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ':=' or whitespace after type mark." if isinstance(token, CharacterToken): @@ -306,7 +306,7 @@ def stateTypeMarkName(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def stateWhitespace4(cls, parserState: ParserState): + def stateWhitespace4(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ':=' after type mark." if isinstance(token, CharacterToken): @@ -345,7 +345,7 @@ def stateWhitespace4(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def statePossibleVariableAssignment(cls, parserState: ParserState): + def statePossibleVariableAssignment(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, CharacterToken) and (token == "="): parserState.NewToken = VariableAssignmentKeyword(parserState.TokenMarker) @@ -356,7 +356,7 @@ def statePossibleVariableAssignment(cls, parserState: ParserState): raise NotImplementedError("State=PossibleCommentStart: {0!r}".format(token)) @classmethod - def stateVariableAssignment(cls, parserState: ParserState): + def stateVariableAssignment(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ':=' or whitespace after type mark." if isinstance(token, CharacterToken): @@ -389,7 +389,7 @@ def stateVariableAssignment(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def stateWhitespace5(cls, parserState: ParserState): + def stateWhitespace5(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected expression after ':='." if isinstance(token, CharacterToken): @@ -427,7 +427,7 @@ def stateWhitespace5(cls, parserState: ParserState): raise TokenParserException(errorMessage, token) @classmethod - def stateExpressionEnd(cls, parserState: ParserState): + def stateExpressionEnd(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ';'." if isinstance(token, CharacterToken): diff --git a/pyVHDLParser/Blocks/__init__.py b/pyVHDLParser/Blocks/__init__.py index f930bab1b..9f897669e 100644 --- a/pyVHDLParser/Blocks/__init__.py +++ b/pyVHDLParser/Blocks/__init__.py @@ -28,9 +28,10 @@ # ==================================================================================================================== # # from types import FunctionType -from typing import List, Callable, Iterator, Generator +from typing import List, Callable, Iterator, Generator, Tuple, Any from pyTooling.Decorators import export +from pyTooling.MetaClasses import ExtendedType from pyTooling.TerminalUI import LineTerminal from pyVHDLParser import StartOfDocument, EndOfDocument, StartOfSnippet, EndOfSnippet @@ -56,35 +57,35 @@ def Token(self) -> Token: return self._token -@export -class TokenToBlockParser: - """Wrapping class to offer some class methods.""" - - @staticmethod - def Transform(tokenGenerator: Iterator[Token]) -> Generator['Block', Token, None]: - """Returns a generator, that reads from a token generator and emits a chain of blocks.""" - - state = ParserState(tokenGenerator) - return state.GetGenerator() +# @export +# class TokenToBlockParser: +# """Wrapping class to offer some class methods.""" +# +# @staticmethod +# def Transform(tokenGenerator: Iterator[Token]) -> Generator['Block', Token, None]: +# """Returns a generator, that reads from a token generator and emits a chain of blocks.""" +# +# state = ParserState(tokenGenerator) +# return state.GetGenerator() @export -class ParserState: +class TokenToBlockParser(metaclass=ExtendedType, useSlots=True): """Represents the current state of a token-to-block parser.""" _iterator: Iterator[Token] - _stack: List[Callable] + _stack: List[Tuple[Callable[['TokenToBlockParser'], None], int]] _tokenMarker: Token Token: Token - NextState: Callable - ReIssue: bool + NextState: Callable[['TokenToBlockParser'], None] + # ReIssue: bool NewToken: Token NewBlock: 'Block' LastBlock: 'Block' Counter: int - def __init__(self, tokenGenerator): + def __init__(self, tokenGenerator: Iterator[Token]): """Initializes the parser state.""" self._iterator = iter(tokenGenerator) @@ -92,25 +93,26 @@ def __init__(self, tokenGenerator): self._tokenMarker = None startToken = next(self._iterator) - startBlock = StartOfDocumentBlock(startToken) if not isinstance(startToken, StartOfDocumentToken): raise BlockParserException("First token is not a StartOfDocumentToken.", startToken) + startBlock = StartOfDocumentBlock(startToken) + self.Token = startBlock.StartToken self.NextState = StartOfDocumentBlock.stateDocument - self.ReIssue = False + # self.ReIssue = False self.NewToken = None self.NewBlock = startBlock self.LastBlock = None self.Counter = 0 - @property - def PushState(self) -> Callable: + def PushState(self) -> Callable[['TokenToBlockParser'], None]: return self.NextState + @PushState.setter - def PushState(self, value): + def PushState(self, value: Callable[['TokenToBlockParser'], None]): self._stack.append(( self.NextState, self.Counter @@ -125,17 +127,22 @@ def TokenMarker(self) -> Token: LineTerminal().WriteDebug(" {DARK_GREEN}@TokenMarker: {0!s} => {GREEN}{1!s}{NOCOLOR}".format(self._tokenMarker, self.NewToken, **LineTerminal.Foreground)) self._tokenMarker = self.NewToken return self._tokenMarker + @TokenMarker.setter - def TokenMarker(self, value): + def TokenMarker(self, value: Token): self._tokenMarker = value - def __eq__(self, other) -> bool: + def __eq__(self, other: Any) -> bool: """Implement a '==' operator for the current state.""" return self.NextState is other + def __ne__(self, other: Any) -> bool: + """Implement a '!=' operator for the current state.""" + return self.NextState is not other + def __str__(self) -> str: """Returns the current state (function name) as str.""" - return "{state}".format(state=self.NextState.__func__.__qualname__) + return f"{self.NextState.__func__.__qualname__}" def __repr__(self) -> str: """Returns the current state (full) as str.""" @@ -147,19 +154,15 @@ def __repr__(self) -> str: newBlock=self.NewBlock, ) - def Pop(self, n=1, tokenMarker=None): - top = None + def Pop(self, n: int = 1, tokenMarker: Token = None) -> None: for i in range(n): top = self._stack.pop() LineTerminal().WriteDebug("popped: " + str(top[0])) - self.NextState = top[0] - self.Counter = top[1] + self.NextState, self.Counter = top self._tokenMarker = tokenMarker - - def GetGenerator(self) -> Generator['Block', Token, None]: + def __call__(self) -> Generator['Block', Token, None]: from pyVHDLParser.Token import EndOfDocumentToken - from pyVHDLParser.Blocks import BlockParserException, EndOfDocumentBlock from pyVHDLParser.Blocks.Common import LinebreakBlock, EmptyLineBlock for token in self._iterator: @@ -235,49 +238,64 @@ def __new__(cls, className, baseClasses, classMembers: dict): @export class BlockIterator: - startBlock: 'Block' - currentBlock: 'Block' - stopBlock: 'Block' - inclusiveStopBlock: bool + _startBlock: 'Block' + _currentBlock: 'Block' + _stopBlock: 'Block' + _inclusiveStopBlock: bool - state: int #: internal states: 0 = normal, 1 = reached stopBlock, 2 = reached EndOfBlock + _state: int #: internal states: 0 = normal, 1 = reached stopBlock, 2 = reached EndOfBlock def __init__(self, startBlock: 'Block', inclusiveStartBlock: bool=False, inclusiveStopBlock: bool=True, stopBlock: 'Block'=None): - self.startBlock = startBlock - self.currentBlock = startBlock if inclusiveStartBlock else startBlock.NextBlock - self.stopBlock = stopBlock - self.inclusiveStopBlock = inclusiveStopBlock + self._startBlock = startBlock if inclusiveStartBlock else startBlock.NextBlock + self._currentBlock = self._startBlock + self._stopBlock = stopBlock + self._inclusiveStopBlock = inclusiveStopBlock - self.state = 0 + self._state = 0 def __iter__(self) -> 'BlockIterator': return self def __next__(self) -> 'Block': # in last call of '__next__', the last block in the sequence was returned - if self.state > 0: - raise StopIteration(self.state) + if self._state > 0: + raise StopIteration(self._state) - block = self.currentBlock - if block is self.stopBlock: - if not self.inclusiveStopBlock: + block = self._currentBlock + if block is self._stopBlock: + if not self._inclusiveStopBlock: raise StopIteration(1) else: - self.currentBlock = None - self.state = 1 - elif isinstance(self.currentBlock, EndOfBlock): - if not self.inclusiveStopBlock: + self._currentBlock = None + self._state = 1 + elif isinstance(self._currentBlock, EndOfBlock): + if not self._inclusiveStopBlock: raise StopIteration(2) else: - self.currentBlock = None - self.state = 2 + self._currentBlock = None + self._state = 2 else: - self.currentBlock = block.NextBlock - if self.currentBlock is None: + self._currentBlock = block.NextBlock + if self._currentBlock is None: raise ParserException("Found open end while iterating block sequence.") # FIXME: how to append last block? return block + @property + def StartBlock(self) -> 'Block': + return self._startBlock + + @property + def CurrentBlock(self) -> 'Block': + return self._currentBlock + + @property + def StopBlock(self) -> 'Block': + return self._stopBlock + + def Reset(self): + self._currentBlock = self._startBlock + @export class BlockReverseIterator: @@ -399,7 +417,7 @@ def States(self) -> List[Callable]: return self.__STATES__ @classmethod - def stateError(cls, parserState: ParserState): + def stateError(cls, parserState: TokenToBlockParser): """Predefined state to catch error situations.""" raise BlockParserException("Reached unreachable state!") @@ -488,7 +506,7 @@ def __cls_init__(cls): } @classmethod - def stateDocument(cls, parserState: ParserState): + def stateDocument(cls, parserState: TokenToBlockParser): from pyVHDLParser.Blocks.Common import IndentationBlock, WhitespaceBlock, LinebreakBlock token = parserState.Token @@ -514,7 +532,7 @@ def stateDocument(cls, parserState: ParserState): return elif isinstance(token, EndOfDocumentToken): - parserState.NewBlock = EndOfDocumentBlock(parserState.LastBlock, token) + parserState.NewBlock = EndOfDocumentBlock(parserState.LastBlock, token) return raise BlockParserException( diff --git a/pyVHDLParser/CLI/Block.py b/pyVHDLParser/CLI/Block.py index ce7def49a..c44041a72 100644 --- a/pyVHDLParser/CLI/Block.py +++ b/pyVHDLParser/CLI/Block.py @@ -35,7 +35,7 @@ from ..Base import ParserException from ..Token import Token, StartOfDocumentToken, EndOfDocumentToken from ..Token.Parser import Tokenizer -from ..Blocks import TokenToBlockParser, Block, StartOfDocumentBlock, EndOfDocumentBlock, CommentBlock +from ..Blocks import Block, TokenToBlockParser, StartOfDocumentBlock, EndOfDocumentBlock, CommentBlock from ..Blocks.Common import LinebreakBlock, IndentationBlock from ..Blocks.List import GenericList, PortList from ..Blocks.InterfaceObject import InterfaceConstantBlock, InterfaceSignalBlock @@ -65,7 +65,7 @@ def HandleBlockStreaming(self: FrontEndProtocol, args): content = fileHandle.read() tokenStream = Tokenizer.GetVHDLTokenizer(content) - blockStream = TokenToBlockParser.Transform(tokenStream) + blockStream = TokenToBlockParser(tokenStream)() blockIterator = iter(blockStream) firstBlock = next(blockIterator) @@ -137,7 +137,7 @@ def HandleCheckBlockStreaming(self: FrontEndProtocol, args): content = fileHandle.read() vhdlTokenStream = Tokenizer.GetVHDLTokenizer(content) - vhdlBlockStream = TokenToBlockParser.Transform(vhdlTokenStream) + vhdlBlockStream = TokenToBlockParser(vhdlTokenStream)() try: blockIterator = iter(vhdlBlockStream) diff --git a/pyVHDLParser/CLI/GraphML.py b/pyVHDLParser/CLI/GraphML.py index 571f765ee..000e7736b 100644 --- a/pyVHDLParser/CLI/GraphML.py +++ b/pyVHDLParser/CLI/GraphML.py @@ -1,5 +1,7 @@ from pyTooling.Graph import Graph, Subgraph, Vertex from pyTooling.Graph.GraphML import GraphMLDocument +from pyVHDLParser.Groups import Group + from pyVHDLParser.Blocks import Block from pyVHDLParser.Token import Token @@ -84,6 +86,47 @@ def AddBlockStream(self, firstBlock: Block, tokenStreamSubgraph: Subgraph): return blockStreamSubgraph + def AddGroupStream(self, firstGroup: Group, blockStreamSubgraph: Subgraph): + groupStreamSubgraph = Subgraph(name="GroupStream", graph=self._graph) + + firstVertex = Vertex(vertexID=id(firstGroup), value=f"{firstGroup}", subgraph=groupStreamSubgraph) + firstVertex["order"] = 0 + firstVertex["kind"] = type(firstGroup).__name__ + firstLink = firstVertex.LinkToVertex(blockStreamSubgraph._verticesWithID[id(firstGroup.StartToken)]) + firstLink["kind"] = "group2block" + + groupIterator = firstGroup.GetIterator(inclusiveStopBlock=False) + for groupID, group in enumerate(groupIterator, start=1): + vertex = Vertex(vertexID=id(group), value=f"{group!s}", subgraph=groupStreamSubgraph) + vertex["order"] = groupID + vertex["kind"] = type(group).__name__ + startBlockLink = vertex.LinkToVertex(blockStreamSubgraph._verticesWithID[id(group.StartToken)]) + startBlockLink["kind"] = "group2block" + if group.EndToken is not group.StartToken: + endBlockLink = vertex.LinkToVertex(blockStreamSubgraph._verticesWithID[id(group.EndToken)]) + endBlockLink["kind"] = "group2block" + + groupIterator = group.GetIterator() + lastGroup = next(groupIterator) + lastVertex = Vertex(vertexID=id(lastGroup), value=f"{lastGroup}", subgraph=groupStreamSubgraph) + lastVertex["order"] = groupID + 1 + lastVertex["kind"] = type(lastGroup).__name__ + lastLink = lastVertex.LinkToVertex(blockStreamSubgraph._verticesWithID[id(lastGroup.StartToken)]) + lastLink["kind"] = "group2block" + + firstVertex.EdgeToVertex(groupStreamSubgraph._verticesWithID[id(firstGroup.NextBlock)], edgeID=f"n0_next") + groupIterator = firstGroup.GetIterator(inclusiveStopBlock=False) + for groupID, group in enumerate(groupIterator, start=1): + vertex = groupStreamSubgraph._verticesWithID[id(group)] + vertex.EdgeToVertex(groupStreamSubgraph._verticesWithID[id(group.PreviousBlock)], edgeID=f"n{groupID}_prev") + vertex.EdgeToVertex(groupStreamSubgraph._verticesWithID[id(group.NextBlock)], edgeID=f"n{groupID}_next") + groupIterator = group.GetIterator() + lastGroup = next(groupIterator) + lastVertex = groupStreamSubgraph._verticesWithID[id(lastGroup)] + lastVertex.EdgeToVertex(groupStreamSubgraph._verticesWithID[id(lastGroup.PreviousBlock)], edgeID=f"n{groupID + 1}_prev") + + return groupStreamSubgraph + def WriteDocument(self, path): graphMLDocument = GraphMLDocument("Streams") graphMLDocument.FromGraph(self._graph) diff --git a/pyVHDLParser/CLI/Group.py b/pyVHDLParser/CLI/Group.py index 7b4657b72..ac7e1d721 100644 --- a/pyVHDLParser/CLI/Group.py +++ b/pyVHDLParser/CLI/Group.py @@ -31,12 +31,13 @@ from pyAttributes.ArgParseAttributes import CommandAttribute +from .GraphML import GraphML from ..Base import ParserException from ..Token import CharacterToken, SpaceToken, WordToken, LinebreakToken, CommentToken, IndentationToken from ..Token.Parser import Tokenizer from ..Token.Keywords import BoundaryToken, EndToken, KeywordToken, DelimiterToken from ..Blocks import TokenToBlockParser -from ..Groups import BlockToGroupParser +from ..Groups import BlockToGroupParser, StartOfDocumentGroup from . import FrontEndProtocol, WithTokensAttribute, WithBlocksAttribute, FilenameAttribute @@ -60,6 +61,24 @@ def HandleGroupStreaming(self : FrontEndProtocol, args): with file.open('r') as fileHandle: content = fileHandle.read() + tokenStream = Tokenizer.GetVHDLTokenizer(content) + blockStream = TokenToBlockParser(tokenStream)() + groupStream = BlockToGroupParser(blockStream)() + + groupIterator = iter(groupStream) + firstGroup = next(groupIterator) + + try: + while next(groupIterator): + pass + except StopIteration: + pass + + if isinstance(firstGroup, StartOfDocumentGroup): + print("{YELLOW}{group!r}{NOCOLOR}".format(block=firstGroup, **self.Foreground)) + print(" {YELLOW}{block!r}{NOCOLOR}".format(block=firstGroup.StartBlock, **self.Foreground)) + print(" {YELLOW}{token!r}{NOCOLOR}".format(token=firstGroup.StartBlock.StartToken, **self.Foreground)) + buffered = True if buffered: self.WriteVerbose("Reading and buffering tokens...") @@ -104,4 +123,10 @@ def HandleGroupStreaming(self : FrontEndProtocol, args): except NotImplementedError as ex: print("{RED}NotImplementedError: {0!s}{NOCOLOR}".format(ex, **self.Foreground)) + exporter = GraphML() + tokenStreamSubgraph = exporter.AddTokenStream(firstBlock.StartToken) + blockStreamSubgraph = exporter.AddBlockStream(firstBlock, tokenStreamSubgraph) + blockStreamSubgraph = exporter.AddGroupStream(firstBlock, blockStreamSubgraph) + exporter.WriteDocument(Path.cwd() / "temp/BlockStream.graphml") + self.exit() diff --git a/pyVHDLParser/DocumentModel/DesignUnit/Architecture.py b/pyVHDLParser/DocumentModel/DesignUnit/Architecture.py index c8073b4bc..4648aad4a 100644 --- a/pyVHDLParser/DocumentModel/DesignUnit/Architecture.py +++ b/pyVHDLParser/DocumentModel/DesignUnit/Architecture.py @@ -36,7 +36,7 @@ from pyVHDLParser.Blocks import BlockParserException from pyVHDLParser.Blocks.Object.Constant import ConstantDeclarationBlock from pyVHDLParser.Blocks.Structural import Architecture as ArchitectureBlocks -from pyVHDLParser.Groups import ParserState +from pyVHDLParser.Groups import BlockToGroupParser from pyVHDLParser.DocumentModel.Reference import LibraryClause, PackageReference @@ -50,7 +50,7 @@ def __init__(self, architectureName, entityName): self._entity = entityName @classmethod - def stateParse(cls, parserState: ParserState): #document, group): + def stateParse(cls, parserState: BlockToGroupParser): #document, group): # cls.stateParseArchitectureName(parserState) # # for block in parserState.GroupIterator: @@ -67,7 +67,7 @@ def stateParse(cls, parserState: ParserState): #document, group): # parserState.CurrentBlock = None @classmethod - def stateParseArchitectureName(cls, parserState: ParserState): #document, group): + def stateParseArchitectureName(cls, parserState: BlockToGroupParser): #document, group): assert isinstance(parserState.CurrentGroup, ArchitectureBlock.NameBlock) tokenIterator = iter(parserState) diff --git a/pyVHDLParser/DocumentModel/DesignUnit/Context.py b/pyVHDLParser/DocumentModel/DesignUnit/Context.py index fcc0dcc75..e95782bca 100644 --- a/pyVHDLParser/DocumentModel/DesignUnit/Context.py +++ b/pyVHDLParser/DocumentModel/DesignUnit/Context.py @@ -34,7 +34,7 @@ from pyVHDLParser.Token.Keywords import IdentifierToken from pyVHDLParser.Blocks import BlockParserException from pyVHDLParser.Blocks.Reference import Context as ContextBlocks -from pyVHDLParser.Groups import ParserState +from pyVHDLParser.Groups import BlockToGroupParser from pyVHDLParser.DocumentModel.Reference import LibraryClause, PackageReference @@ -83,7 +83,7 @@ def stateParse(cls, document, group): @classmethod - def stateParseGenericList(cls, parserState: ParserState): #document, group): + def stateParseGenericList(cls, parserState: BlockToGroupParser): #document, group): assert isinstance(parserState.CurrentGroup, GenericListBlocks.OpenBlock) for block in parserState.GroupIterator: @@ -97,7 +97,7 @@ def stateParseGenericList(cls, parserState: ParserState): #document, group): parserState.Pop() @classmethod - def stateParseGeneric(cls, parserState: ParserState): #document, group): + def stateParseGeneric(cls, parserState: BlockToGroupParser): #document, group): assert isinstance(parserState.CurrentGroup, pyVHDLParser.Blocks.InterfaceObject.InterfaceConstantBlock) tokenIterator = iter(parserState) @@ -112,7 +112,7 @@ def stateParseGeneric(cls, parserState: ParserState): #document, group): parserState.CurrentNode.AddGeneric(genericName) @classmethod - def stateParsePortList(cls, parserState: ParserState): #document, group): + def stateParsePortList(cls, parserState: BlockToGroupParser): #document, group): assert isinstance(parserState.CurrentGroup, PortListBlocks.OpenBlock) for block in parserState.GroupIterator: @@ -126,7 +126,7 @@ def stateParsePortList(cls, parserState: ParserState): #document, group): parserState.Pop() @classmethod - def stateParsePort(cls, parserState: ParserState): #document, group): + def stateParsePort(cls, parserState: BlockToGroupParser): #document, group): assert isinstance(parserState.CurrentGroup, pyVHDLParser.Blocks.InterfaceObject.InterfaceSignalBlock) tokenIterator = iter(parserState) diff --git a/pyVHDLParser/DocumentModel/DesignUnit/Entity.py b/pyVHDLParser/DocumentModel/DesignUnit/Entity.py index 336ac40bc..e5aa972db 100644 --- a/pyVHDLParser/DocumentModel/DesignUnit/Entity.py +++ b/pyVHDLParser/DocumentModel/DesignUnit/Entity.py @@ -38,7 +38,7 @@ from pyVHDLParser.Blocks.Object.Constant import ConstantDeclarationBlock import pyVHDLParser.Blocks.InterfaceObject from pyVHDLParser.Blocks.Structural import Entity as EntityBlocks -from pyVHDLParser.Groups import ParserState +from pyVHDLParser.Groups import BlockToGroupParser from pyVHDLParser.Groups.List import GenericListGroup, PortListGroup from pyVHDLParser.DocumentModel.Reference import LibraryClause, PackageReference @@ -51,7 +51,7 @@ def __init__(self, entityName): super().__init__(entityName) @classmethod - def stateParse(cls, parserState: ParserState): #document, group): + def stateParse(cls, parserState: BlockToGroupParser): #document, group): for block in parserState.CurrentGroup: if isinstance(block, EntityBlocks.NameBlock): for token in block: @@ -94,7 +94,7 @@ def stateParse(cls, parserState: ParserState): #document, group): @classmethod - def stateParseGenericList(cls, parserState: ParserState): #document, group): + def stateParseGenericList(cls, parserState: BlockToGroupParser): #document, group): assert isinstance(parserState.CurrentGroup, GenericListBlocks.OpenBlock) for block in parserState.GroupIterator: @@ -108,7 +108,7 @@ def stateParseGenericList(cls, parserState: ParserState): #document, group): parserState.Pop() @classmethod - def stateParseGeneric(cls, parserState: ParserState): #document, group): + def stateParseGeneric(cls, parserState: BlockToGroupParser): #document, group): assert isinstance(parserState.CurrentGroup, pyVHDLParser.Blocks.InterfaceObject.InterfaceConstantBlock) tokenIterator = iter(parserState) @@ -123,7 +123,7 @@ def stateParseGeneric(cls, parserState: ParserState): #document, group): parserState.CurrentNode.AddGeneric(genericName) @classmethod - def stateParsePortList(cls, parserState: ParserState): #document, group): + def stateParsePortList(cls, parserState: BlockToGroupParser): #document, group): assert isinstance(parserState.CurrentGroup, PortListBlocks.OpenBlock) for block in parserState.GroupIterator: @@ -137,7 +137,7 @@ def stateParsePortList(cls, parserState: ParserState): #document, group): parserState.Pop() @classmethod - def stateParsePort(cls, parserState: ParserState): #document, group): + def stateParsePort(cls, parserState: BlockToGroupParser): #document, group): assert isinstance(parserState.CurrentGroup, pyVHDLParser.Blocks.InterfaceObject.InterfaceSignalBlock) tokenIterator = iter(parserState) diff --git a/pyVHDLParser/DocumentModel/DesignUnit/Package.py b/pyVHDLParser/DocumentModel/DesignUnit/Package.py index c49499056..ed48f073c 100644 --- a/pyVHDLParser/DocumentModel/DesignUnit/Package.py +++ b/pyVHDLParser/DocumentModel/DesignUnit/Package.py @@ -38,7 +38,7 @@ from pyVHDLParser.Blocks.List import GenericList as GenericListBlocks from pyVHDLParser.Blocks.Object.Constant import ConstantDeclarationBlock from pyVHDLParser.Blocks.Sequential import Package as PackageBlock -from pyVHDLParser.Groups import ParserState +from pyVHDLParser.Groups import BlockToGroupParser from pyVHDLParser.Groups.List import GenericListGroup from pyVHDLParser.DocumentModel.Reference import LibraryClause, PackageReference @@ -77,7 +77,7 @@ def stateParse(cls, document, group): # parserState.CurrentBlock = None @classmethod - def stateParsePackageName(cls, parserState: ParserState): #document, group): + def stateParsePackageName(cls, parserState: BlockToGroupParser): #document, group): assert isinstance(parserState.CurrentGroup, PackageBlock.NameBlock) tokenIterator = iter(parserState) @@ -100,7 +100,7 @@ def stateParsePackageName(cls, parserState: ParserState): #document, group): oldNode.PackageReferences.clear() @classmethod - def stateParseGenericList(cls, parserState: ParserState): #document, group): + def stateParseGenericList(cls, parserState: BlockToGroupParser): #document, group): assert isinstance(parserState.CurrentGroup, GenericListBlocks.OpenBlock) for block in parserState.GroupIterator: @@ -114,7 +114,7 @@ def stateParseGenericList(cls, parserState: ParserState): #document, group): parserState.Pop() @classmethod - def stateParseGeneric(cls, parserState: ParserState): #document, group): + def stateParseGeneric(cls, parserState: BlockToGroupParser): #document, group): assert isinstance(parserState.CurrentGroup, pyVHDLParser.Blocks.InterfaceObject.InterfaceConstantBlock) tokenIterator = iter(parserState) diff --git a/pyVHDLParser/DocumentModel/DesignUnit/PackageBody.py b/pyVHDLParser/DocumentModel/DesignUnit/PackageBody.py index d7802efda..97bf56eaf 100644 --- a/pyVHDLParser/DocumentModel/DesignUnit/PackageBody.py +++ b/pyVHDLParser/DocumentModel/DesignUnit/PackageBody.py @@ -38,7 +38,7 @@ from pyVHDLParser.Blocks.List import GenericList as GenericListBlocks, PortList as PortListBlocks from pyVHDLParser.Blocks.Object.Constant import ConstantDeclarationBlock from pyVHDLParser.Blocks.Sequential import PackageBody as PackageBodyBlock -from pyVHDLParser.Groups import ParserState +from pyVHDLParser.Groups import BlockToGroupParser from pyVHDLParser.DocumentModel.Reference import LibraryClause, PackageReference @@ -51,7 +51,7 @@ def __init__(self, packageBodyName): self._name = packageBodyName @classmethod - def stateParse(cls, parserState: ParserState): #document, group): + def stateParse(cls, parserState: BlockToGroupParser): #document, group): assert isinstance(parserState.CurrentGroup, PackageBodyBlock.NameBlock) cls.stateParsePackageBodyName(parserState) @@ -79,7 +79,7 @@ def stateParse(cls, parserState: ParserState): #document, group): # parserState.CurrentBlock = None @classmethod - def stateParsePackageBodyName(cls, parserState: ParserState): #document, group): + def stateParsePackageBodyName(cls, parserState: BlockToGroupParser): #document, group): assert isinstance(parserState.CurrentGroup, PackageBodyBlock.NameBlock) tokenIterator = iter(parserState) @@ -103,7 +103,7 @@ def stateParsePackageBodyName(cls, parserState: ParserState): #document, group): oldNode.PackageReferences.clear() @classmethod - def stateParseGenericList(cls, parserState: ParserState): #document, group): + def stateParseGenericList(cls, parserState: BlockToGroupParser): #document, group): assert isinstance(parserState.CurrentGroup, GenericListBlocks.OpenBlock) for block in parserState.GroupIterator: @@ -117,7 +117,7 @@ def stateParseGenericList(cls, parserState: ParserState): #document, group): parserState.Pop() @classmethod - def stateParseGeneric(cls, parserState: ParserState): #document, group): + def stateParseGeneric(cls, parserState: BlockToGroupParser): #document, group): assert isinstance(parserState.CurrentGroup, pyVHDLParser.Blocks.InterfaceObject.InterfaceConstantBlock) tokenIterator = iter(parserState) @@ -132,7 +132,7 @@ def stateParseGeneric(cls, parserState: ParserState): #document, group): parserState.CurrentNode.AddGeneric(genericName) @classmethod - def stateParsePortList(cls, parserState: ParserState): #document, group): + def stateParsePortList(cls, parserState: BlockToGroupParser): #document, group): assert isinstance(parserState.CurrentGroup, PortListBlocks.OpenBlock) for block in parserState.GroupIterator: @@ -146,7 +146,7 @@ def stateParsePortList(cls, parserState: ParserState): #document, group): parserState.Pop() @classmethod - def stateParsePort(cls, parserState: ParserState): #document, group): + def stateParsePort(cls, parserState: BlockToGroupParser): #document, group): assert isinstance(parserState.CurrentGroup, pyVHDLParser.Blocks.InterfaceObject.InterfaceSignalBlock) tokenIterator = iter(parserState) diff --git a/pyVHDLParser/Groups/Comment.py b/pyVHDLParser/Groups/Comment.py index 9da74a8af..b13190a1e 100644 --- a/pyVHDLParser/Groups/Comment.py +++ b/pyVHDLParser/Groups/Comment.py @@ -31,19 +31,18 @@ from pyVHDLParser.Blocks import CommentBlock from pyVHDLParser.Blocks.Common import WhitespaceBlock, LinebreakBlock, IndentationBlock -from pyVHDLParser.Groups import ParserState, GroupParserException, Group +from pyVHDLParser.Groups import BlockToGroupParser, GroupParserException, Group @export class CommentGroup(Group): @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): for block in parserState.GetBlockIterator: if not isinstance(block, CommentBlock): parserState.NextGroup = cls(parserState.LastGroup, parserState.BlockMarker, block) parserState.Pop() - parserState.ReIssue = True - return + return True raise GroupParserException("End of library clause not found.", block) @@ -51,12 +50,11 @@ def stateParse(cls, parserState: ParserState): @export class WhitespaceGroup(Group): @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): for block in parserState.GetBlockIterator: if not isinstance(block, (WhitespaceBlock, LinebreakBlock, IndentationBlock)): parserState.NextGroup = cls(parserState.LastGroup, parserState.BlockMarker, block.PreviousBlock) parserState.Pop() - parserState.ReIssue = True - return + return True raise GroupParserException("End of library clause not found.", block) diff --git a/pyVHDLParser/Groups/Concurrent.py b/pyVHDLParser/Groups/Concurrent.py index ea2eb8ec7..db2093336 100644 --- a/pyVHDLParser/Groups/Concurrent.py +++ b/pyVHDLParser/Groups/Concurrent.py @@ -31,13 +31,13 @@ from pyVHDLParser.Blocks.Reporting.Assert import AssertBlock from pyVHDLParser.Blocks.Reporting.Report import ReportBlock -from pyVHDLParser.Groups import ParserState, Group, GroupParserException +from pyVHDLParser.Groups import BlockToGroupParser, Group, GroupParserException @export class AssertGroup(Group): @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): marker = parserState.Block if parserState.Block.MultiPart: for block in parserState.GetBlockIterator: @@ -57,7 +57,7 @@ def stateParse(cls, parserState: ParserState): @export class ReportGroup(Group): @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): marker = parserState.Block if parserState.Block.MultiPart: for block in parserState.GetBlockIterator: @@ -77,7 +77,7 @@ def stateParse(cls, parserState: ParserState): @export class SignalAssignmentGroup(Group): @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): block = parserState.Block raise NotImplementedError("State=Parse: {0!r}".format(block)) diff --git a/pyVHDLParser/Groups/DesignUnit.py b/pyVHDLParser/Groups/DesignUnit.py index 44e334c16..f98a67e2b 100644 --- a/pyVHDLParser/Groups/DesignUnit.py +++ b/pyVHDLParser/Groups/DesignUnit.py @@ -41,7 +41,7 @@ from pyVHDLParser.Blocks.Reporting.Assert import AssertBlock from pyVHDLParser.Blocks.Sequential import Package, PackageBody, Function, Procedure, Process from pyVHDLParser.Blocks.Structural import Entity, Architecture, Component, Configuration -from pyVHDLParser.Groups import GroupParserException, Group, EndOfDocumentGroup, ParserState +from pyVHDLParser.Groups import GroupParserException, Group, EndOfDocumentGroup, BlockToGroupParser from pyVHDLParser.Groups.Comment import CommentGroup, WhitespaceGroup from pyVHDLParser.Groups.Concurrent import AssertGroup from pyVHDLParser.Groups.List import GenericListGroup, ParameterListGroup, PortListGroup @@ -70,7 +70,7 @@ def __init__(self, previousGroup, startBlock, endBlock=None): } @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): currentBlock = parserState.Block if isinstance(currentBlock, Context.NameBlock): @@ -87,22 +87,19 @@ def stateParse(cls, parserState: ParserState): parserState.PushState = WhitespaceGroup.stateParse parserState.NextGroup = WhitespaceGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, CommentBlock): parserState.PushState = CommentGroup.stateParse parserState.NextGroup = CommentGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True else: for block in cls.SIMPLE_BLOCKS: if isinstance(currentBlock, block): group = cls.SIMPLE_BLOCKS[block] parserState.PushState = group.stateParse parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True if isinstance(currentBlock, EndOfDocumentBlock): parserState.NextGroup = EndOfDocumentGroup(currentBlock) @@ -145,7 +142,7 @@ def __init__(self, previousGroup, startBlock, endBlock=None): )) @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): currentBlock = parserState.Block # consume OpenBlock @@ -158,7 +155,7 @@ def stateParse(cls, parserState: ParserState): raise GroupParserException("Begin of entity expected.", currentBlock) @classmethod - def stateParseGenerics(cls, parserState: ParserState): + def stateParseGenerics(cls, parserState: BlockToGroupParser): currentBlock = parserState.Block if isinstance(currentBlock, GenericList.OpenBlock): @@ -166,27 +163,23 @@ def stateParseGenerics(cls, parserState: ParserState): parserState.PushState = GenericListGroup.stateParse parserState.NextGroup = GenericListGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, PortList.OpenBlock): parserState.NextState = cls.stateParseDeclarations parserState.PushState = PortListGroup.stateParse parserState.NextGroup = PortListGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, (LinebreakBlock, IndentationBlock)): parserState.PushState = WhitespaceGroup.stateParse parserState.NextGroup = WhitespaceGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, CommentBlock): parserState.PushState = CommentGroup.stateParse parserState.NextGroup = CommentGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True if isinstance(currentBlock, EndOfDocumentBlock): parserState.NextGroup = EndOfDocumentGroup(currentBlock) @@ -195,7 +188,7 @@ def stateParseGenerics(cls, parserState: ParserState): raise GroupParserException("End of generic clause not found.", currentBlock) @classmethod - def stateParsePorts(cls, parserState: ParserState): + def stateParsePorts(cls, parserState: BlockToGroupParser): currentBlock = parserState.Block if isinstance(currentBlock, PortList.OpenBlock): @@ -203,20 +196,17 @@ def stateParsePorts(cls, parserState: ParserState): parserState.PushState = PortListGroup.stateParse parserState.NextGroup = PortListGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, (LinebreakBlock, IndentationBlock)): parserState.PushState = WhitespaceGroup.stateParse parserState.NextGroup = WhitespaceGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, CommentBlock): parserState.PushState = CommentGroup.stateParse parserState.NextGroup = CommentGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True if isinstance(currentBlock, EndOfDocumentBlock): parserState.NextGroup = EndOfDocumentGroup(currentBlock) @@ -225,7 +215,7 @@ def stateParsePorts(cls, parserState: ParserState): raise GroupParserException("End of port clause not found.", currentBlock) @classmethod - def stateParseDeclarations(cls, parserState: ParserState): + def stateParseDeclarations(cls, parserState: BlockToGroupParser): currentBlock = parserState.Block if isinstance(currentBlock, Entity.BeginBlock): @@ -240,30 +230,26 @@ def stateParseDeclarations(cls, parserState: ParserState): parserState.PushState = WhitespaceGroup.stateParse parserState.NextGroup = WhitespaceGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, CommentBlock): parserState.PushState = CommentGroup.stateParse parserState.NextGroup = CommentGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True else: for block in cls.DECLARATION_SIMPLE_BLOCKS: if isinstance(currentBlock, block): group = cls.DECLARATION_SIMPLE_BLOCKS[block] parserState.PushState = group.stateParse parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True for block in cls.DECLARATION_COMPOUND_BLOCKS: if isinstance(currentBlock, block): group = cls.DECLARATION_COMPOUND_BLOCKS[block] parserState.PushState = group.stateParse parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True if isinstance(currentBlock, EndOfDocumentBlock): parserState.NextGroup = EndOfDocumentGroup(currentBlock) @@ -272,7 +258,7 @@ def stateParseDeclarations(cls, parserState: ParserState): raise GroupParserException("End of entity declarative region not found.", currentBlock) @classmethod - def stateParseStatements(cls, parserState: ParserState): + def stateParseStatements(cls, parserState: BlockToGroupParser): currentBlock = parserState.Block if isinstance(currentBlock, Entity.EndBlock): @@ -284,30 +270,26 @@ def stateParseStatements(cls, parserState: ParserState): parserState.PushState = WhitespaceGroup.stateParse parserState.NextGroup = WhitespaceGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, CommentBlock): parserState.PushState = CommentGroup.stateParse parserState.NextGroup = CommentGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True else: for block in cls.STATEMENT_SIMPLE_BLOCKS: if isinstance(currentBlock, block): group = cls.STATEMENT_SIMPLE_BLOCKS[block] parserState.PushState = group.stateParse parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True for block in cls.STATEMENT_COMPOUND_BLOCKS: if isinstance(currentBlock, block): group = cls.STATEMENT_COMPOUND_BLOCKS[block] parserState.PushState = group.stateParse parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True if isinstance(currentBlock, EndOfDocumentBlock): parserState.NextGroup = EndOfDocumentGroup(currentBlock) @@ -351,7 +333,7 @@ def __init__(self, previousGroup, startBlock, endBlock=None): )) @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): currentBlock = parserState.Block if isinstance(currentBlock, Architecture.NameBlock): @@ -361,14 +343,12 @@ def stateParse(cls, parserState: ParserState): parserState.PushState = WhitespaceGroup.stateParse parserState.NextGroup = WhitespaceGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, CommentBlock): parserState.PushState = CommentGroup.stateParse parserState.NextGroup = CommentGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, EndOfDocumentBlock): parserState.NextGroup = EndOfDocumentGroup(currentBlock) return @@ -378,7 +358,7 @@ def stateParse(cls, parserState: ParserState): ), currentBlock) @classmethod - def stateParseDeclarations(cls, parserState: ParserState): + def stateParseDeclarations(cls, parserState: BlockToGroupParser): currentBlock = parserState.Block if isinstance(currentBlock, Architecture.BeginBlock): @@ -388,30 +368,26 @@ def stateParseDeclarations(cls, parserState: ParserState): parserState.PushState = WhitespaceGroup.stateParse parserState.NextGroup = WhitespaceGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, CommentBlock): parserState.PushState = CommentGroup.stateParse parserState.NextGroup = CommentGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True else: for block in cls.DECLARATION_SIMPLE_BLOCKS: if isinstance(currentBlock, block): group = cls.DECLARATION_SIMPLE_BLOCKS[block] parserState.PushState = group.stateParse parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True for block in cls.DECLARATION_COMPOUND_BLOCKS: if isinstance(currentBlock, block): group = cls.DECLARATION_COMPOUND_BLOCKS[block] parserState.PushState = group.stateParse parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True if isinstance(currentBlock, EndOfDocumentBlock): parserState.NextGroup = EndOfDocumentGroup(currentBlock) @@ -422,7 +398,7 @@ def stateParseDeclarations(cls, parserState: ParserState): ), currentBlock) @classmethod - def stateParseStatements(cls, parserState: ParserState): + def stateParseStatements(cls, parserState: BlockToGroupParser): currentBlock = parserState.Block if isinstance(currentBlock, Architecture.EndBlock): @@ -434,30 +410,26 @@ def stateParseStatements(cls, parserState: ParserState): parserState.PushState = WhitespaceGroup.stateParse parserState.NextGroup = WhitespaceGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, CommentBlock): parserState.PushState = CommentGroup.stateParse parserState.NextGroup = CommentGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True else: for block in cls.STATEMENT_SIMPLE_BLOCKS: if isinstance(currentBlock, block): group = cls.STATEMENT_SIMPLE_BLOCKS[block] parserState.PushState = group.stateParse parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True for block in cls.STATEMENT_COMPOUND_BLOCKS: if isinstance(currentBlock, block): group = cls.STATEMENT_COMPOUND_BLOCKS[block] parserState.PushState = group.stateParse parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True if isinstance(currentBlock, EndOfDocumentBlock): parserState.NextGroup = EndOfDocumentGroup(currentBlock) @@ -496,7 +468,7 @@ def __init__(self, previousGroup, startBlock, endBlock=None): )) @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): currentBlock = parserState.Block if isinstance(currentBlock, Package.NameBlock): @@ -510,30 +482,26 @@ def stateParse(cls, parserState: ParserState): parserState.PushState = WhitespaceGroup.stateParse parserState.NextGroup = WhitespaceGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, CommentBlock): parserState.PushState = CommentGroup.stateParse parserState.NextGroup = CommentGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True else: for block in cls.DECLARATION_SIMPLE_BLOCKS: if isinstance(currentBlock, block): group = cls.DECLARATION_SIMPLE_BLOCKS[block] parserState.PushState = group.stateParse parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True for block in cls.DECLARATION_COMPOUND_BLOCKS: if isinstance(currentBlock, block): group = cls.DECLARATION_COMPOUND_BLOCKS[block] parserState.PushState = group.stateParse parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True if isinstance(currentBlock, EndOfDocumentBlock): parserState.NextGroup = EndOfDocumentGroup(currentBlock) @@ -572,7 +540,7 @@ def __init__(self, previousGroup, startBlock, endBlock=None): )) @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): currentBlock = parserState.Block if isinstance(currentBlock, PackageBody.NameBlock): @@ -586,22 +554,19 @@ def stateParse(cls, parserState: ParserState): parserState.PushState = WhitespaceGroup.stateParse parserState.NextGroup = WhitespaceGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, CommentBlock): parserState.PushState = CommentGroup.stateParse parserState.NextGroup = CommentGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True else: for block in cls.DECLARATION_SIMPLE_BLOCKS: if isinstance(currentBlock, block): group = cls.DECLARATION_SIMPLE_BLOCKS[block] parserState.PushState = group.stateParse parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True for block in cls.DECLARATION_COMPOUND_BLOCKS: if isinstance(currentBlock, block): @@ -609,8 +574,7 @@ def stateParse(cls, parserState: ParserState): parserState.PushState = group.stateParse parserState.NextGroup = group(parserState.LastGroup, parserState.BlockMarker, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True if isinstance(currentBlock, EndOfDocumentBlock): parserState.NextGroup = EndOfDocumentGroup(currentBlock) @@ -641,7 +605,7 @@ def __init__(self, previousGroup, startBlock, endBlock=None): } @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): currentBlock = parserState.Block if isinstance(currentBlock, Component.NameBlock): @@ -655,30 +619,26 @@ def stateParse(cls, parserState: ParserState): parserState.PushState = WhitespaceGroup.stateParse parserState.NextGroup = WhitespaceGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, CommentBlock): parserState.PushState = CommentGroup.stateParse parserState.NextGroup = CommentGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True else: for block in cls.SIMPLE_BLOCKS: if isinstance(currentBlock, block): group = cls.SIMPLE_BLOCKS[block] parserState.PushState = group.stateParse parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True for block in cls.COMPOUND_BLOCKS: if isinstance(currentBlock, block): group = cls.COMPOUND_BLOCKS[block] parserState.PushState = group.stateParse parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True if isinstance(currentBlock, EndOfDocumentBlock): parserState.NextGroup = EndOfDocumentGroup(currentBlock) @@ -709,7 +669,7 @@ def __init__(self, previousGroup, startBlock, endBlock=None): } @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): currentBlock = parserState.Block if isinstance(currentBlock, Configuration.NameBlock): @@ -723,30 +683,26 @@ def stateParse(cls, parserState: ParserState): parserState.PushState = WhitespaceGroup.stateParse parserState.NextGroup = WhitespaceGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, CommentBlock): parserState.PushState = CommentGroup.stateParse parserState.NextGroup = CommentGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True else: for block in cls.SIMPLE_BLOCKS: if isinstance(currentBlock, block): group = cls.SIMPLE_BLOCKS[block] parserState.PushState = group.stateParse parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True for block in cls.COMPOUND_BLOCKS: if isinstance(currentBlock, block): group = cls.COMPOUND_BLOCKS[block] parserState.PushState = group.stateParse parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True if isinstance(currentBlock, EndOfDocumentBlock): parserState.NextGroup = EndOfDocumentGroup(currentBlock) diff --git a/pyVHDLParser/Groups/List.py b/pyVHDLParser/Groups/List.py index 3e220b963..4870d510a 100644 --- a/pyVHDLParser/Groups/List.py +++ b/pyVHDLParser/Groups/List.py @@ -33,7 +33,7 @@ from pyVHDLParser.Blocks.Common import LinebreakBlock, IndentationBlock import pyVHDLParser.Blocks.InterfaceObject from pyVHDLParser.Blocks.List import GenericList, ParameterList, PortList, SensitivityList -from pyVHDLParser.Groups import ParserState, GroupParserException, Group, EndOfDocumentGroup +from pyVHDLParser.Groups import BlockToGroupParser, GroupParserException, Group, EndOfDocumentGroup from pyVHDLParser.Groups.Comment import WhitespaceGroup, CommentGroup @@ -49,7 +49,7 @@ def __init__(self, previousGroup, startBlock, endBlock=None): } @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): currentBlock = parserState.Block if isinstance(currentBlock, GenericList.OpenBlock): @@ -58,8 +58,7 @@ def stateParse(cls, parserState: ParserState): parserState.PushState = GenericListItemGroup.stateParse parserState.NextGroup = GenericListItemGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, GenericList.CloseBlock): parserState.Pop() return @@ -67,14 +66,12 @@ def stateParse(cls, parserState: ParserState): parserState.PushState = WhitespaceGroup.stateParse parserState.NextGroup = WhitespaceGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, CommentBlock): parserState.PushState = CommentGroup.stateParse parserState.NextGroup = CommentGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True if isinstance(currentBlock, EndOfDocumentBlock): parserState.NextGroup = EndOfDocumentGroup(currentBlock) @@ -86,7 +83,7 @@ def stateParse(cls, parserState: ParserState): @export class GenericListItemGroup(Group): @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): for block in parserState.GetBlockIterator: if isinstance(block, GenericList.DelimiterBlock): parserState.Pop() @@ -94,8 +91,7 @@ def stateParse(cls, parserState: ParserState): elif isinstance(block, GenericList.CloseBlock): # parserState.NextGroup = cls(parserState.LastGroup, parserState.BlockMarker, block) parserState.Pop() - parserState.ReIssue = True - return + return True raise GroupParserException("End of generic not found.", block) @@ -103,7 +99,7 @@ def stateParse(cls, parserState: ParserState): @export class GenericMapGroup(Group): @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): block = parserState.Block raise NotImplementedError("State=Parse: {0!r}".format(block)) @@ -112,7 +108,7 @@ def stateParse(cls, parserState: ParserState): @export class GenericMapItemGroup(Group): @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): block = parserState.Block raise NotImplementedError("State=Parse: {0!r}".format(block)) @@ -130,7 +126,7 @@ def __init__(self, previousGroup, startBlock, endBlock=None): } @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): currentBlock = parserState.Block if isinstance(currentBlock, PortList.OpenBlock): @@ -144,14 +140,12 @@ def stateParse(cls, parserState: ParserState): parserState.PushState = WhitespaceGroup.stateParse parserState.NextGroup = WhitespaceGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, CommentBlock): parserState.PushState = CommentGroup.stateParse parserState.NextGroup = CommentGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True if isinstance(currentBlock, EndOfDocumentBlock): parserState.NextGroup = EndOfDocumentGroup(currentBlock) @@ -163,7 +157,7 @@ def stateParse(cls, parserState: ParserState): @export class PortListItemGroup(Group): @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): for block in parserState.GetBlockIterator: if isinstance(block, PortList.DelimiterBlock): parserState.Pop() @@ -171,8 +165,7 @@ def stateParse(cls, parserState: ParserState): elif isinstance(block, PortList.CloseBlock): # parserState.NextGroup = cls(parserState.LastGroup, parserState.BlockMarker, block) parserState.Pop() - parserState.ReIssue = True - return + return True raise GroupParserException("End of port not found.", block) @@ -180,7 +173,7 @@ def stateParse(cls, parserState: ParserState): @export class PortMapGroup(Group): @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): block = parserState.Block raise NotImplementedError("State=Parse: {0!r}".format(block)) @@ -189,7 +182,7 @@ def stateParse(cls, parserState: ParserState): @export class PortMapItemGroup(Group): @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): block = parserState.Block raise NotImplementedError("State=Parse: {0!r}".format(block)) @@ -207,7 +200,7 @@ def __init__(self, previousGroup, startBlock, endBlock=None): } @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): currentBlock = parserState.Block if isinstance(currentBlock, ParameterList.OpenBlock): @@ -221,14 +214,12 @@ def stateParse(cls, parserState: ParserState): parserState.PushState = WhitespaceGroup.stateParse parserState.NextGroup = WhitespaceGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, CommentBlock): parserState.PushState = CommentGroup.stateParse parserState.NextGroup = CommentGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True if isinstance(currentBlock, EndOfDocumentBlock): parserState.NextGroup = EndOfDocumentGroup(currentBlock) @@ -240,7 +231,7 @@ def stateParse(cls, parserState: ParserState): @export class ParameterListItemGroup(Group): @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): for block in parserState.GetBlockIterator: if isinstance(block, ParameterList.DelimiterBlock): parserState.Pop() @@ -248,8 +239,7 @@ def stateParse(cls, parserState: ParserState): elif isinstance(block, ParameterList.CloseBlock): # parserState.NextGroup = cls(parserState.LastGroup, parserState.BlockMarker, block) parserState.Pop() - parserState.ReIssue = True - return + return True raise GroupParserException("End of parameter not found.", block) @@ -257,7 +247,7 @@ def stateParse(cls, parserState: ParserState): @export class ParameterMapGroup(Group): @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): block = parserState.Block raise NotImplementedError("State=Parse: {0!r}".format(block)) @@ -266,7 +256,7 @@ def stateParse(cls, parserState: ParserState): @export class ParameterMapItemGroup(Group): @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): block = parserState.Block raise NotImplementedError("State=Parse: {0!r}".format(block)) @@ -284,7 +274,7 @@ def __init__(self, previousGroup, startBlock, endBlock=None): } @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): currentBlock = parserState.Block if isinstance(currentBlock, SensitivityList.OpenBlock): @@ -298,14 +288,12 @@ def stateParse(cls, parserState: ParserState): parserState.PushState = WhitespaceGroup.stateParse parserState.NextGroup = WhitespaceGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, CommentBlock): parserState.PushState = CommentGroup.stateParse parserState.NextGroup = CommentGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True if isinstance(currentBlock, EndOfDocumentBlock): parserState.NextGroup = EndOfDocumentGroup(currentBlock) @@ -317,7 +305,7 @@ def stateParse(cls, parserState: ParserState): @export class SensitivityListItemGroup(Group): @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): block = parserState.Block raise NotImplementedError("State=Parse: {0!r}".format(block)) diff --git a/pyVHDLParser/Groups/Object.py b/pyVHDLParser/Groups/Object.py index 1a4ff29dd..fa859c9f5 100644 --- a/pyVHDLParser/Groups/Object.py +++ b/pyVHDLParser/Groups/Object.py @@ -34,13 +34,13 @@ from pyVHDLParser.Blocks.Object.Constant import ConstantDeclarationBlock from pyVHDLParser.Blocks.Reference.Library import EndBlock, StartBlock from pyVHDLParser.Blocks.Reference.Use import EndBlock, StartBlock -from pyVHDLParser.Groups import ParserState, GroupParserException, Group +from pyVHDLParser.Groups import BlockToGroupParser, GroupParserException, Group @export class ConstantGroup(Group): @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): marker = parserState.Block if parserState.Block.MultiPart: for block in parserState.GetBlockIterator: @@ -60,7 +60,7 @@ def stateParse(cls, parserState: ParserState): @export class VariableGroup(Group): @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): marker = parserState.Block if parserState.Block.MultiPart: for block in parserState.GetBlockIterator: @@ -80,7 +80,7 @@ def stateParse(cls, parserState: ParserState): @export class SignalGroup(Group): @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): marker = parserState.Block if parserState.Block.MultiPart: for block in parserState.GetBlockIterator: diff --git a/pyVHDLParser/Groups/Reference.py b/pyVHDLParser/Groups/Reference.py index b2f1258c4..56feabd03 100644 --- a/pyVHDLParser/Groups/Reference.py +++ b/pyVHDLParser/Groups/Reference.py @@ -30,13 +30,13 @@ from pyTooling.Decorators import export from pyVHDLParser.Blocks.Reference import Library, Use -from pyVHDLParser.Groups import ParserState, GroupParserException, Group +from pyVHDLParser.Groups import BlockToGroupParser, GroupParserException, Group @export class LibraryGroup(Group): @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): for block in parserState.GetBlockIterator: if isinstance(block, Library.EndBlock): parserState.NextGroup = cls(parserState.LastGroup, parserState.BlockMarker, block) @@ -49,7 +49,7 @@ def stateParse(cls, parserState: ParserState): @export class UseGroup(Group): @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): for block in parserState.GetBlockIterator: if isinstance(block, Use.EndBlock): parserState.NextGroup = cls(parserState.LastGroup, parserState.BlockMarker, block) diff --git a/pyVHDLParser/Groups/Sequential/Function.py b/pyVHDLParser/Groups/Sequential/Function.py index 81fd75f0f..887c1d104 100644 --- a/pyVHDLParser/Groups/Sequential/Function.py +++ b/pyVHDLParser/Groups/Sequential/Function.py @@ -41,7 +41,7 @@ from pyVHDLParser.Blocks.Reference import Use from pyVHDLParser.Blocks.Reporting.Report import ReportBlock from pyVHDLParser.Blocks.Sequential import Function -from pyVHDLParser.Groups import ParserState, Group, GroupParserException, EndOfDocumentGroup +from pyVHDLParser.Groups import BlockToGroupParser, Group, GroupParserException, EndOfDocumentGroup from pyVHDLParser.Groups.Comment import WhitespaceGroup, CommentGroup from pyVHDLParser.Groups.Concurrent import ReportGroup from pyVHDLParser.Groups.List import GenericListGroup, ParameterListGroup @@ -84,7 +84,7 @@ def __init__(self, previousGroup, startBlock, endBlock=None): )) @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): currentBlock = parserState.Block # consume OpenBlock @@ -97,7 +97,7 @@ def stateParse(cls, parserState: ParserState): raise GroupParserException("Begin of function expected.", currentBlock) @classmethod - def stateParseGenerics(cls, parserState: ParserState): + def stateParseGenerics(cls, parserState: BlockToGroupParser): currentBlock = parserState.Block if isinstance(currentBlock, GenericList.OpenBlock): @@ -105,34 +105,29 @@ def stateParseGenerics(cls, parserState: ParserState): parserState.PushState = GenericListGroup.stateParse parserState.NextGroup = GenericListGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, ParameterList.OpenBlock): parserState.NextState = cls.stateParseDeclarations parserState.PushState = ParameterListGroup.stateParse parserState.NextGroup = ParameterListGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, Function.ReturnTypeBlock): if isinstance(currentBlock.EndToken, EndToken): parserState.Pop() else: parserState.NextState = cls.stateParse2 - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, (LinebreakBlock, IndentationBlock)): parserState.PushState = WhitespaceGroup.stateParse parserState.NextGroup = WhitespaceGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, CommentBlock): parserState.PushState = CommentGroup.stateParse parserState.NextGroup = CommentGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True if isinstance(currentBlock, EndOfDocumentBlock): parserState.NextGroup = EndOfDocumentGroup(currentBlock) @@ -141,7 +136,7 @@ def stateParseGenerics(cls, parserState: ParserState): raise GroupParserException("End of generic clause not found.", currentBlock) @classmethod - def stateParseParameters(cls, parserState: ParserState): + def stateParseParameters(cls, parserState: BlockToGroupParser): currentBlock = parserState.Block if isinstance(currentBlock, GenericList.OpenBlock): @@ -149,20 +144,17 @@ def stateParseParameters(cls, parserState: ParserState): parserState.PushState = ParameterListGroup.stateParse parserState.NextGroup = ParameterListGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, (LinebreakBlock, IndentationBlock)): parserState.PushState = WhitespaceGroup.stateParse parserState.NextGroup = WhitespaceGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, CommentBlock): parserState.PushState = CommentGroup.stateParse parserState.NextGroup = CommentGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True if isinstance(currentBlock, EndOfDocumentBlock): parserState.NextGroup = EndOfDocumentGroup(currentBlock) @@ -172,7 +164,7 @@ def stateParseParameters(cls, parserState: ParserState): # FIXME move to FunctionGroup2 as stateParse @classmethod - def stateParse2(cls, parserState: ParserState): + def stateParse2(cls, parserState: BlockToGroupParser): currentBlock = parserState.Block # consume OpenBlock @@ -184,11 +176,10 @@ def stateParse2(cls, parserState: ParserState): return else: parserState.Pop() - parserState.ReIssue = True - return + return True @classmethod - def stateParseDeclarations(cls, parserState: ParserState): + def stateParseDeclarations(cls, parserState: BlockToGroupParser): currentBlock = parserState.Block if isinstance(currentBlock, Function.BeginBlock): @@ -203,30 +194,26 @@ def stateParseDeclarations(cls, parserState: ParserState): parserState.PushState = WhitespaceGroup.stateParse parserState.NextGroup = WhitespaceGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, CommentBlock): parserState.PushState = CommentGroup.stateParse parserState.NextGroup = CommentGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True else: for block in cls.DECLARATION_SIMPLE_BLOCKS: if isinstance(currentBlock, block): group = cls.DECLARATION_SIMPLE_BLOCKS[block] parserState.PushState = group.stateParse parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True for block in cls.DECLARATION_COMPOUND_BLOCKS: if isinstance(currentBlock, block): group = cls.DECLARATION_COMPOUND_BLOCKS[block] parserState.PushState = group.stateParse parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True if isinstance(currentBlock, EndOfDocumentBlock): parserState.NextGroup = EndOfDocumentGroup(currentBlock) @@ -235,7 +222,7 @@ def stateParseDeclarations(cls, parserState: ParserState): raise GroupParserException("End of function declarative region not found.", currentBlock) @classmethod - def stateParseStatements(cls, parserState: ParserState): + def stateParseStatements(cls, parserState: BlockToGroupParser): currentBlock = parserState.Block if isinstance(currentBlock, Function.EndBlock): @@ -246,30 +233,26 @@ def stateParseStatements(cls, parserState: ParserState): parserState.PushState = WhitespaceGroup.stateParse parserState.NextGroup = WhitespaceGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, CommentBlock): parserState.PushState = CommentGroup.stateParse parserState.NextGroup = CommentGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True else: for block in cls.STATEMENT_SIMPLE_BLOCKS: if isinstance(currentBlock, block): group = cls.STATEMENT_SIMPLE_BLOCKS[block] parserState.PushState = group.stateParse parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True for block in cls.STATEMENT_COMPOUND_BLOCKS: if isinstance(currentBlock, block): group = cls.STATEMENT_COMPOUND_BLOCKS[block] parserState.PushState = group.stateParse parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True if isinstance(currentBlock, EndOfDocumentBlock): parserState.NextGroup = EndOfDocumentGroup(currentBlock) diff --git a/pyVHDLParser/Groups/Sequential/Procedure.py b/pyVHDLParser/Groups/Sequential/Procedure.py index bfffb2649..4b9ff15c6 100644 --- a/pyVHDLParser/Groups/Sequential/Procedure.py +++ b/pyVHDLParser/Groups/Sequential/Procedure.py @@ -40,7 +40,7 @@ from pyVHDLParser.Blocks.Reference import Use from pyVHDLParser.Blocks.Reporting.Report import ReportBlock from pyVHDLParser.Blocks.Sequential import Procedure -from pyVHDLParser.Groups import ParserState, Group, GroupParserException, EndOfDocumentGroup +from pyVHDLParser.Groups import BlockToGroupParser, Group, GroupParserException, EndOfDocumentGroup from pyVHDLParser.Groups.Comment import WhitespaceGroup, CommentGroup from pyVHDLParser.Groups.List import GenericListGroup, ParameterListGroup from pyVHDLParser.Groups.Object import ConstantGroup, VariableGroup @@ -81,7 +81,7 @@ def __init__(self, previousGroup, startBlock, endBlock=None): )) @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): currentBlock = parserState.Block # consume OpenBlock @@ -94,7 +94,7 @@ def stateParse(cls, parserState: ParserState): raise GroupParserException("Begin of procedure expected.", currentBlock) @classmethod - def stateParseGenerics(cls, parserState: ParserState): + def stateParseGenerics(cls, parserState: BlockToGroupParser): currentBlock = parserState.Block if isinstance(currentBlock, GenericList.OpenBlock): @@ -102,15 +102,13 @@ def stateParseGenerics(cls, parserState: ParserState): parserState.PushState = GenericListGroup.stateParse parserState.NextGroup = GenericListGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, ParameterList.OpenBlock): parserState.NextState = cls.stateParseDeclarations parserState.PushState = ParameterListGroup.stateParse parserState.NextGroup = ParameterListGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, Procedure.VoidBlock): parserState.NextState = cls.stateParseDeclarations return @@ -118,14 +116,12 @@ def stateParseGenerics(cls, parserState: ParserState): parserState.PushState = WhitespaceGroup.stateParse parserState.NextGroup = WhitespaceGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, CommentBlock): parserState.PushState = CommentGroup.stateParse parserState.NextGroup = CommentGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True if isinstance(currentBlock, EndOfDocumentBlock): parserState.NextGroup = EndOfDocumentGroup(currentBlock) @@ -135,7 +131,7 @@ def stateParseGenerics(cls, parserState: ParserState): @classmethod - def stateParseParameters(cls, parserState: ParserState): + def stateParseParameters(cls, parserState: BlockToGroupParser): currentBlock = parserState.Block if isinstance(currentBlock, GenericList.OpenBlock): @@ -143,20 +139,17 @@ def stateParseParameters(cls, parserState: ParserState): parserState.PushState = ParameterListGroup.stateParse parserState.NextGroup = ParameterListGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, (LinebreakBlock, IndentationBlock)): parserState.PushState = WhitespaceGroup.stateParse parserState.NextGroup = WhitespaceGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, CommentBlock): parserState.PushState = CommentGroup.stateParse parserState.NextGroup = CommentGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True if isinstance(currentBlock, EndOfDocumentBlock): parserState.NextGroup = EndOfDocumentGroup(currentBlock) @@ -165,7 +158,7 @@ def stateParseParameters(cls, parserState: ParserState): raise GroupParserException("End of parameters not found.", currentBlock) @classmethod - def stateParseDeclarations(cls, parserState: ParserState): + def stateParseDeclarations(cls, parserState: BlockToGroupParser): currentBlock = parserState.Block if isinstance(currentBlock, Procedure.BeginBlock): @@ -180,30 +173,26 @@ def stateParseDeclarations(cls, parserState: ParserState): parserState.PushState = WhitespaceGroup.stateParse parserState.NextGroup = WhitespaceGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, CommentBlock): parserState.PushState = CommentGroup.stateParse parserState.NextGroup = CommentGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True else: for block in cls.DECLARATION_SIMPLE_BLOCKS: if isinstance(currentBlock, block): group = cls.DECLARATION_SIMPLE_BLOCKS[block] parserState.PushState = group.stateParse parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True for block in cls.DECLARATION_COMPOUND_BLOCKS: if isinstance(currentBlock, block): group = cls.DECLARATION_COMPOUND_BLOCKS[block] parserState.PushState = group.stateParse parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True if isinstance(currentBlock, EndOfDocumentBlock): parserState.NextGroup = EndOfDocumentGroup(currentBlock) @@ -212,7 +201,7 @@ def stateParseDeclarations(cls, parserState: ParserState): raise GroupParserException("End of procedure declarative region not found.", currentBlock) @classmethod - def stateParseStatements(cls, parserState: ParserState): + def stateParseStatements(cls, parserState: BlockToGroupParser): currentBlock = parserState.Block if isinstance(currentBlock, Procedure.EndBlock): @@ -224,30 +213,26 @@ def stateParseStatements(cls, parserState: ParserState): parserState.PushState = WhitespaceGroup.stateParse parserState.NextGroup = WhitespaceGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, CommentBlock): parserState.PushState = CommentGroup.stateParse parserState.NextGroup = CommentGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True else: for block in cls.STATEMENT_SIMPLE_BLOCKS: if isinstance(currentBlock, block): group = cls.STATEMENT_SIMPLE_BLOCKS[block] parserState.PushState = group.stateParse parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True for block in cls.STATEMENT_COMPOUND_BLOCKS: if isinstance(currentBlock, block): group = cls.STATEMENT_COMPOUND_BLOCKS[block] parserState.PushState = group.stateParse parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True if isinstance(currentBlock, EndOfDocumentBlock): parserState.NextGroup = EndOfDocumentGroup(currentBlock) diff --git a/pyVHDLParser/Groups/Sequential/Process.py b/pyVHDLParser/Groups/Sequential/Process.py index 0307a6d09..0b8ce55b5 100644 --- a/pyVHDLParser/Groups/Sequential/Process.py +++ b/pyVHDLParser/Groups/Sequential/Process.py @@ -40,7 +40,7 @@ from pyVHDLParser.Blocks.Reference import Use from pyVHDLParser.Blocks.Reporting.Report import ReportBlock from pyVHDLParser.Blocks.Sequential import Process -from pyVHDLParser.Groups import ParserState, Group, GroupParserException, EndOfDocumentGroup +from pyVHDLParser.Groups import BlockToGroupParser, Group, GroupParserException, EndOfDocumentGroup from pyVHDLParser.Groups.Comment import WhitespaceGroup, CommentGroup from pyVHDLParser.Groups.List import GenericListGroup, ParameterListGroup, SensitivityListGroup from pyVHDLParser.Groups.Object import ConstantGroup, VariableGroup @@ -81,7 +81,7 @@ def __init__(self, previousGroup, startBlock, endBlock=None): )) @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): currentBlock = parserState.Block # consume OpenBlock @@ -94,7 +94,7 @@ def stateParse(cls, parserState: ParserState): raise GroupParserException("Begin of process expected.", currentBlock) @classmethod - def stateParseSensitivityList(cls, parserState: ParserState): + def stateParseSensitivityList(cls, parserState: BlockToGroupParser): currentBlock = parserState.Block if isinstance(currentBlock, SensitivityList.OpenBlock): @@ -102,20 +102,17 @@ def stateParseSensitivityList(cls, parserState: ParserState): parserState.PushState = SensitivityListGroup.stateParse parserState.NextGroup = SensitivityListGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, (LinebreakBlock, IndentationBlock)): parserState.PushState = WhitespaceGroup.stateParse parserState.NextGroup = WhitespaceGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, CommentBlock): parserState.PushState = CommentGroup.stateParse parserState.NextGroup = CommentGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True if isinstance(currentBlock, EndOfDocumentBlock): parserState.NextGroup = EndOfDocumentGroup(currentBlock) @@ -124,7 +121,7 @@ def stateParseSensitivityList(cls, parserState: ParserState): raise GroupParserException("End of process sensitivity list not found.", currentBlock) @classmethod - def stateParseDeclarations(cls, parserState: ParserState): + def stateParseDeclarations(cls, parserState: BlockToGroupParser): currentBlock = parserState.Block if isinstance(currentBlock, Process.BeginBlock): @@ -139,30 +136,26 @@ def stateParseDeclarations(cls, parserState: ParserState): parserState.PushState = WhitespaceGroup.stateParse parserState.NextGroup = WhitespaceGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, CommentBlock): parserState.PushState = CommentGroup.stateParse parserState.NextGroup = CommentGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True else: for block in cls.DECLARATION_SIMPLE_BLOCKS: if isinstance(currentBlock, block): group = cls.DECLARATION_SIMPLE_BLOCKS[block] parserState.PushState = group.stateParse parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True for block in cls.DECLARATION_COMPOUND_BLOCKS: if isinstance(currentBlock, block): group = cls.DECLARATION_COMPOUND_BLOCKS[block] parserState.PushState = group.stateParse parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True if isinstance(currentBlock, EndOfDocumentBlock): parserState.NextGroup = EndOfDocumentGroup(currentBlock) @@ -171,7 +164,7 @@ def stateParseDeclarations(cls, parserState: ParserState): raise GroupParserException("End of process declarative region not found.", currentBlock) @classmethod - def stateParseStatements(cls, parserState: ParserState): + def stateParseStatements(cls, parserState: BlockToGroupParser): currentBlock = parserState.Block if isinstance(currentBlock, Process.EndBlock): @@ -183,30 +176,26 @@ def stateParseStatements(cls, parserState: ParserState): parserState.PushState = WhitespaceGroup.stateParse parserState.NextGroup = WhitespaceGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, CommentBlock): parserState.PushState = CommentGroup.stateParse parserState.NextGroup = CommentGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True else: for block in cls.STATEMENT_SIMPLE_BLOCKS: if isinstance(currentBlock, block): group = cls.STATEMENT_SIMPLE_BLOCKS[block] parserState.PushState = group.stateParse parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True for block in cls.STATEMENT_COMPOUND_BLOCKS: if isinstance(currentBlock, block): group = cls.STATEMENT_COMPOUND_BLOCKS[block] parserState.PushState = group.stateParse parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True if isinstance(currentBlock, EndOfDocumentBlock): parserState.NextGroup = EndOfDocumentGroup(currentBlock) @@ -219,7 +208,7 @@ def stateParseStatements(cls, parserState: ParserState): @export class IfGroup(Group): @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): block = parserState.Block raise NotImplementedError("State=Parse: {0!r}".format(block)) @@ -228,7 +217,7 @@ def stateParse(cls, parserState: ParserState): @export class IfBranchGroup(Group): @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): block = parserState.Block raise NotImplementedError("State=Parse: {0!r}".format(block)) @@ -237,7 +226,7 @@ def stateParse(cls, parserState: ParserState): @export class ElsIfBranchGroup(Group): @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): block = parserState.Block raise NotImplementedError("State=Parse: {0!r}".format(block)) @@ -246,7 +235,7 @@ def stateParse(cls, parserState: ParserState): @export class ElseBranchGroup(Group): @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): block = parserState.Block raise NotImplementedError("State=Parse: {0!r}".format(block)) @@ -255,7 +244,7 @@ def stateParse(cls, parserState: ParserState): @export class CaseGroup(Group): @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): block = parserState.Block raise NotImplementedError("State=Parse: {0!r}".format(block)) @@ -264,7 +253,7 @@ def stateParse(cls, parserState: ParserState): @export class ChoiceGroup(Group): @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): block = parserState.Block raise NotImplementedError("State=Parse: {0!r}".format(block)) @@ -273,7 +262,7 @@ def stateParse(cls, parserState: ParserState): @export class ForLoopGroup(Group): @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): block = parserState.Block raise NotImplementedError("State=Parse: {0!r}".format(block)) @@ -282,7 +271,7 @@ def stateParse(cls, parserState: ParserState): @export class WhileLoopGroup(Group): @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): block = parserState.Block raise NotImplementedError("State=Parse: {0!r}".format(block)) @@ -291,7 +280,7 @@ def stateParse(cls, parserState: ParserState): @export class NextGroup(Group): @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): block = parserState.Block raise NotImplementedError("State=Parse: {0!r}".format(block)) @@ -300,7 +289,7 @@ def stateParse(cls, parserState: ParserState): @export class ExitGroup(Group): @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): block = parserState.Block raise NotImplementedError("State=Parse: {0!r}".format(block)) @@ -309,7 +298,7 @@ def stateParse(cls, parserState: ParserState): @export class ReturnGroup(Group): @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): block = parserState.Block raise NotImplementedError("State=Parse: {0!r}".format(block)) @@ -318,7 +307,7 @@ def stateParse(cls, parserState: ParserState): @export class VariableAssignmentGroup(Group): @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): block = parserState.Block raise NotImplementedError("State=Parse: {0!r}".format(block)) @@ -327,7 +316,7 @@ def stateParse(cls, parserState: ParserState): @export class SignalAssignmentGroup(Group): @classmethod - def stateParse(cls, parserState: ParserState): + def stateParse(cls, parserState: BlockToGroupParser): block = parserState.Block raise NotImplementedError("State=Parse: {0!r}".format(block)) diff --git a/pyVHDLParser/Groups/__init__.py b/pyVHDLParser/Groups/__init__.py index fb9b8e025..a1c21b40d 100644 --- a/pyVHDLParser/Groups/__init__.py +++ b/pyVHDLParser/Groups/__init__.py @@ -28,8 +28,9 @@ # ==================================================================================================================== # # from types import FunctionType -from typing import Iterator, Callable, List, Generator, Any, Dict +from typing import Iterator, Callable, List, Generator, Any, Dict, Tuple +from pyTooling.MetaClasses import ExtendedType from pyTooling.TerminalUI import LineTerminal from pyTooling.Decorators import export @@ -50,22 +51,22 @@ def __init__(self, message: str, block: Block): self._block = block -@export -class BlockToGroupParser: - """Wrapping class to offer some class methods.""" - - @staticmethod - def Transform(blockGenerator: Generator[Block, Any, None]) -> Generator['Group', Any, None]: - """Returns a generator, that reads from a token generator and emits a chain of blocks.""" - - state = ParserState(blockGenerator) - return state.GetGenerator() +# @export +# class BlockToGroupParser: +# """Wrapping class to offer some class methods.""" +# +# @staticmethod +# def Transform(blockGenerator: Generator[Block, Any, None]) -> Generator['Group', Any, None]: +# """Returns a generator, that reads from a token generator and emits a chain of blocks.""" +# +# state = ParserState(blockGenerator) +# return state.GetGenerator() @export class BlockIterator: def __init__(self, parserState, blockGenerator: Iterator): - self._parserState: ParserState = parserState + self._parserState: BlockToGroupParser = parserState #self._blockIterator = iter(FastForward(groupGenerator)) self._blockIterator = iter(blockGenerator) @@ -79,21 +80,20 @@ def __next__(self) -> 'Block': @export -class ParserState: +class BlockToGroupParser(metaclass=ExtendedType, useSlots=True): """Represents the current state of a block-to-group parser.""" - _iterator: Iterator - _stack: List[Callable] + _iterator: Iterator + _stack: List[Tuple[Callable[['BlockToGroupParser'], bool], Block, 'Group']] _blockMarker: Block - Block: Block - NextState: Callable - ReIssue: bool + Block: Block + NextState: Callable[['BlockToGroupParser'], bool] - NewBlock: Block - NewGroup: 'Group' - LastGroup: 'Group' - NextGroup: 'Group' + NewBlock: Block + NewGroup: 'Group' + LastGroup: 'Group' + NextGroup: 'Group' def __init__(self, blockGenerator: Generator[Block, Any, None]): """Initializes the parser state.""" @@ -110,17 +110,17 @@ def __init__(self, blockGenerator: Generator[Block, Any, None]): self.Block = None self.NextState = StartOfDocumentGroup.stateDocument - self.ReIssue = False self.NewBlock = None self.NewGroup = None self.LastGroup = None self.NextGroup = startGroup @property - def PushState(self) -> 'Group': + def PushState(self) -> Callable[['BlockToGroupParser'], bool]: return self.NextState + @PushState.setter - def PushState(self, value: Callable): + def PushState(self, value: Callable[['BlockToGroupParser'], bool]): assert (self.NextGroup is not None) self._stack.append(( self.NextState, @@ -151,27 +151,30 @@ def BlockMarker(self) -> 'Block': # if self.debug: print(" {DARK_GREEN}@BlockMarker: {0!s} => {GREEN}{1!s}{NOCOLOR}".format(self._blockMarker, self.NewBlock, **Console.Foreground)) self._blockMarker = self.NewBlock return self._blockMarker + @BlockMarker.setter def BlockMarker(self, value: Block): # if self.debug: print(" {DARK_GREEN}@BlockMarker: {0!s} --> {GREEN}{1!s}{NOCOLOR}".format(self._blockMarker, value, **Console.Foreground)) self._blockMarker = value - def __eq__(self, other: Callable) -> bool: + def __eq__(self, other: Callable[['ParserState'], bool]) -> bool: """Return true if parser state is equal to the second operand.""" return self.NextState is other + def __ne__(self, other: Callable[['ParserState'], bool]) -> bool: + """Return true if parser state is not equal to the second operand.""" + return self.NextState is not other + def __str__(self) -> str: return self.NextState.__func__.__qualname__ - def Pop(self, n: int=1): - self.NewGroup = self.NextGroup + def Pop(self, n: int = 1) -> None: + self.NewGroup = self.NextGroup - top = None for i in range(n): top = self._stack.pop() - self.NextState = top[0] - self._blockMarker = top[1] - self.NextGroup = top[2] + self.NextState, self._blockMarker, self.NextGroup = top + # print("{MAGENTA}appending {0!s} to {1!s}{NOCOLOR}".format(self.NewGroup.__class__.__qualname__, self.NextGroup.__class__,**Console.Foreground)) if self.NextGroup.InnerGroup is None: self.NextGroup.InnerGroup = self.NewGroup @@ -183,9 +186,7 @@ def Pop(self, n: int=1): self.NextGroup._subGroups[self.NewGroup.__class__].append(self.NewGroup) - def GetGenerator(self): # XXX: return type - from pyVHDLParser.Groups import GroupParserException - + def __call__(self) -> Generator['Group', None, None]: # yield StartOfDocumentGroup self.LastGroup = self.NextGroup yield self.LastGroup @@ -198,11 +199,10 @@ def GetGenerator(self): # XXX: return type # if self.debug: print("{MAGENTA}------ iteration end ------{NOCOLOR}".format(**Console.Foreground)) # execute a state and reissue execution if needed - self.ReIssue = True - while self.ReIssue: - self.ReIssue = False + reissue = True + while reissue: LineTerminal().WriteDryRun("{DARK_GRAY}reissue state={state!s: <50} block={block!s: <40} {NOCOLOR}".format(state=self, block=self.Block, **LineTerminal.Foreground)) - self.NextState(self) + reissue = self.NextState(self) # yield a new group if self.NewGroup is not None: @@ -385,7 +385,7 @@ def __init__(self, startBlock: Block): } @classmethod - def stateDocument(cls, parserState: ParserState): + def stateDocument(cls, parserState: BlockToGroupParser): from pyVHDLParser.Groups.DesignUnit import ContextGroup, EntityGroup, ArchitectureGroup, PackageGroup, PackageBodyGroup, ConfigurationGroup from pyVHDLParser.Groups.Reference import LibraryGroup, UseGroup from pyVHDLParser.Groups.Comment import CommentGroup, WhitespaceGroup @@ -409,14 +409,12 @@ def stateDocument(cls, parserState: ParserState): parserState.PushState = WhitespaceGroup.stateParse parserState.NextGroup = WhitespaceGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True elif isinstance(currentBlock, CommentBlock): parserState.PushState = CommentGroup.stateParse parserState.NextGroup = CommentGroup(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True else: for blk in SIMPLE_BLOCKS: if isinstance(currentBlock, blk): @@ -424,8 +422,7 @@ def stateDocument(cls, parserState: ParserState): parserState.PushState = group.stateParse parserState.NextGroup = group(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True for blk in COMPOUND_BLOCKS: if isinstance(currentBlock, blk): @@ -433,8 +430,7 @@ def stateDocument(cls, parserState: ParserState): parserState.PushState = group.stateParse parserState.NextGroup = group(parserState.LastGroup, currentBlock) parserState.BlockMarker = currentBlock - parserState.ReIssue = True - return + return True if isinstance(currentBlock, EndOfDocumentBlock): parserState.NewGroup = EndOfDocumentGroup(currentBlock) diff --git a/test/BlockParserTests/TestSuite.py b/test/BlockParserTests/TestSuite.py index fbcc7b0b9..6187e5e59 100644 --- a/test/BlockParserTests/TestSuite.py +++ b/test/BlockParserTests/TestSuite.py @@ -27,7 +27,7 @@ # # load dependencies from pyVHDLParser.Base import ParserException -from pyVHDLParser.Blocks import StartOfDocumentBlock, EndOfDocumentBlock, ParserState +from pyVHDLParser.Blocks import StartOfDocumentBlock, EndOfDocumentBlock, TokenToBlockParser from pyVHDLParser.Filters.Comment import StripAndFuse from pyVHDLParser.Functions import Console from pyVHDLParser.Token import StartOfDocumentToken, EndOfDocumentToken From 97e6b0400b988b1e788c0474669613a57fa83d9c Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 26 Mar 2023 00:25:36 +0100 Subject: [PATCH 19/27] Changed metaclasses. --- pyVHDLParser/Blocks/Expression.py | 6 +++--- pyVHDLParser/Blocks/Generic.py | 8 +++++--- pyVHDLParser/Blocks/Generic1.py | 6 ++++-- pyVHDLParser/Blocks/__init__.py | 20 ++++---------------- pyVHDLParser/Groups/__init__.py | 7 ++++--- pyVHDLParser/Token/__init__.py | 7 ++++--- pyVHDLParser/__init__.py | 5 +++-- 7 files changed, 27 insertions(+), 32 deletions(-) diff --git a/pyVHDLParser/Blocks/Expression.py b/pyVHDLParser/Blocks/Expression.py index 46a5a38f3..744c4c381 100644 --- a/pyVHDLParser/Blocks/Expression.py +++ b/pyVHDLParser/Blocks/Expression.py @@ -88,9 +88,9 @@ class ExpressionBlock(Block): @export class ExpressionBlockEndedByCharORClosingRoundBracket(ExpressionBlock): - EXIT_CHAR: str = None - EXIT_TOKEN: Token = None - EXIT_BLOCK: Block = None + EXIT_CHAR: str + EXIT_TOKEN: Token + EXIT_BLOCK: Block @classmethod def stateBeforeExpression(cls, parserState: TokenToBlockParser): diff --git a/pyVHDLParser/Blocks/Generic.py b/pyVHDLParser/Blocks/Generic.py index 88e394fb0..37d45df7a 100644 --- a/pyVHDLParser/Blocks/Generic.py +++ b/pyVHDLParser/Blocks/Generic.py @@ -27,6 +27,8 @@ # limitations under the License. # # ==================================================================================================================== # # +from typing import Any + from pyTooling.Decorators import export from pyVHDLParser.Token import LinebreakToken, WordToken, SpaceToken, CommentToken, IndentationToken @@ -43,10 +45,10 @@ class DeclarativeRegion(metaclass=MetaBlock): """Base-class for all declarative region blocks.""" - BEGIN_BLOCK: BeginBlock = None - END_BLOCK: EndBlock = None + BEGIN_BLOCK: BeginBlock + END_BLOCK: EndBlock - KEYWORDS = None + KEYWORDS: Any # TODO: what type? @classmethod def __cls_init__(cls): diff --git a/pyVHDLParser/Blocks/Generic1.py b/pyVHDLParser/Blocks/Generic1.py index 71cd2d43f..0b4bec812 100644 --- a/pyVHDLParser/Blocks/Generic1.py +++ b/pyVHDLParser/Blocks/Generic1.py @@ -27,6 +27,8 @@ # limitations under the License. # # ==================================================================================================================== # # +from typing import Any + from pyTooling.Decorators import export from pyVHDLParser.Token import CharacterToken, SpaceToken, LinebreakToken, CommentToken, WordToken, MultiLineCommentToken, IndentationToken @@ -328,9 +330,9 @@ def stateWhitespace4(cls, parserState: TokenToBlockParser): @export class BeginBlock(Block): - END_BLOCK: EndBlock = None + END_BLOCK: EndBlock - KEYWORDS = None + KEYWORDS: Any # TODO: what type? @classmethod def stateStatementRegion(cls, parserState: TokenToBlockParser): diff --git a/pyVHDLParser/Blocks/__init__.py b/pyVHDLParser/Blocks/__init__.py index 9f897669e..93b7b6d8b 100644 --- a/pyVHDLParser/Blocks/__init__.py +++ b/pyVHDLParser/Blocks/__init__.py @@ -57,18 +57,6 @@ def Token(self) -> Token: return self._token -# @export -# class TokenToBlockParser: -# """Wrapping class to offer some class methods.""" -# -# @staticmethod -# def Transform(tokenGenerator: Iterator[Token]) -> Generator['Block', Token, None]: -# """Returns a generator, that reads from a token generator and emits a chain of blocks.""" -# -# state = ParserState(tokenGenerator) -# return state.GetGenerator() - - @export class TokenToBlockParser(metaclass=ExtendedType, useSlots=True): """Represents the current state of a token-to-block parser.""" @@ -209,7 +197,7 @@ def __call__(self) -> Generator['Block', Token, None]: @export -class MetaBlock(type): +class MetaBlock(ExtendedType): """ A :term:`meta-class` to construct *Block* classes. @@ -223,16 +211,16 @@ class MetaBlock(type): def __new__(cls, className, baseClasses, classMembers: dict): # """Register all state*** methods in a list called `__STATES__`.""" - states = [] for memberName, memberObject in classMembers.items(): if isinstance(memberObject, FunctionType) and (memberName[:5] == "state"): states.append(memberObject) - classMembers['__STATES__'] = states + block = super().__new__(cls, className, baseClasses, classMembers, useSlots=True) + block.__STATES__ = states - block = super().__new__(cls, className, baseClasses, classMembers) cls.BLOCKS.append(block) + return block diff --git a/pyVHDLParser/Groups/__init__.py b/pyVHDLParser/Groups/__init__.py index a1c21b40d..9f3b96c04 100644 --- a/pyVHDLParser/Groups/__init__.py +++ b/pyVHDLParser/Groups/__init__.py @@ -218,7 +218,7 @@ def __call__(self) -> Generator['Group', None, None]: @export -class MetaGroup(type): +class MetaGroup(ExtendedType): """Register all state*** methods in an array called '__STATES__'""" def __new__(cls, className, baseClasses, classMembers: dict): states = [] @@ -226,8 +226,9 @@ def __new__(cls, className, baseClasses, classMembers: dict): if isinstance(memberObject, FunctionType) and (memberName[:5] == "state"): states.append(memberObject) - classMembers['__STATES__'] = states - return super().__new__(cls, className, baseClasses, classMembers) + group = super().__new__(cls, className, baseClasses, classMembers, useSlots=True) + group.__STATES__ = states + return group @export diff --git a/pyVHDLParser/Token/__init__.py b/pyVHDLParser/Token/__init__.py index 40054db02..c1d5dea42 100644 --- a/pyVHDLParser/Token/__init__.py +++ b/pyVHDLParser/Token/__init__.py @@ -30,6 +30,7 @@ from typing import Iterator from pyTooling.Decorators import export +from pyTooling.MetaClasses import ExtendedType from pyVHDLParser import SourceCodePosition, StartOfDocument, EndOfDocument, StartOfSnippet, EndOfSnippet from pyVHDLParser.Base import ParserException @@ -71,7 +72,7 @@ def CharacterTranslation(value: str, oneLiner: bool = False) -> str: @export -class TokenIterator: +class TokenIterator(metaclass=ExtendedType, useSlots=True): startToken: 'Token' currentToken: 'Token' stopToken: 'Token' @@ -117,7 +118,7 @@ def __next__(self) -> 'Token': @export -class TokenReverseIterator: +class TokenReverseIterator(metaclass=ExtendedType, useSlots=True): startToken: 'Token' currentToken: 'Token' stopToken: 'Token' @@ -163,7 +164,7 @@ def __next__(self) -> 'Token': @export -class Token: +class Token(metaclass=ExtendedType, useSlots=True): """Base-class for all token classes.""" _previousToken: 'Token' #: Reference to the previous token diff --git a/pyVHDLParser/__init__.py b/pyVHDLParser/__init__.py index 9c74c0825..1c0327e39 100644 --- a/pyVHDLParser/__init__.py +++ b/pyVHDLParser/__init__.py @@ -38,6 +38,7 @@ __keywords__ = ["parser", "vhdl", "code generator", "hdl"] from pyTooling.Decorators import export +from pyTooling.MetaClasses import ExtendedType @export @@ -63,7 +64,7 @@ def __str__(self) -> str: @export -class StartOf: +class StartOf(metaclass=ExtendedType, useSlots=True): """Base-class (mixin) for all StartOf*** classes.""" @@ -78,7 +79,7 @@ class StartOfSnippet(StartOf): @export -class EndOf: +class EndOf(metaclass=ExtendedType, useSlots=True): """Base-class (mixin) for all EndOf*** classes.""" From c427da9866e06e53fb72b373cd899480759597a7 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 26 Mar 2023 00:39:14 +0100 Subject: [PATCH 20/27] Fixed unit tests. --- pyVHDLParser/CLI/Group.py | 6 +++--- pyVHDLParser/DocumentModel/__init__.py | 4 ++-- test/BlockParserTests/TestSuite.py | 6 +++--- tests/unit/Common.py | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/pyVHDLParser/CLI/Group.py b/pyVHDLParser/CLI/Group.py index ac7e1d721..22dfbea39 100644 --- a/pyVHDLParser/CLI/Group.py +++ b/pyVHDLParser/CLI/Group.py @@ -91,17 +91,17 @@ def HandleGroupStreaming(self : FrontEndProtocol, args): self.WriteVerbose("Reading and buffering blocks...") try: - blockStream = [block for block in TokenToBlockParser.Transform(tokenStream)] + blockStream = [block for block in TokenToBlockParser(tokenStream)()] except ParserException as ex: print("{RED}ERROR: {0!s}{NOCOLOR}".format(ex, **self.Foreground)) except NotImplementedError as ex: print("{RED}NotImplementedError: {0!s}{NOCOLOR}".format(ex, **self.Foreground)) else: tokenStream = Tokenizer.GetVHDLTokenizer(content) - blockStream = TokenToBlockParser.Transform(tokenStream) + blockStream = TokenToBlockParser(tokenStream)() self.WriteVerbose("Transforming blocks to groups...") - groupStream = BlockToGroupParser.Transform(blockStream) + groupStream = BlockToGroupParser(blockStream)() try: for group in groupStream: diff --git a/pyVHDLParser/DocumentModel/__init__.py b/pyVHDLParser/DocumentModel/__init__.py index d4ded4300..305619bb0 100644 --- a/pyVHDLParser/DocumentModel/__init__.py +++ b/pyVHDLParser/DocumentModel/__init__.py @@ -78,8 +78,8 @@ def Parse(self, content=None): # FIXME: parameter type content = fileHandle.read() vhdlTokenStream = Tokenizer.GetVHDLTokenizer(content) - vhdlBlockStream = TokenToBlockParser.Transform(vhdlTokenStream) - vhdlGroupStream = BlockToGroupParser.Transform(vhdlBlockStream) + vhdlBlockStream = TokenToBlockParser(vhdlTokenStream)() + vhdlGroupStream = BlockToGroupParser(vhdlBlockStream)() try: groups = [group for group in vhdlGroupStream] except BlockParserException as ex: diff --git a/test/BlockParserTests/TestSuite.py b/test/BlockParserTests/TestSuite.py index 6187e5e59..12752d5d8 100644 --- a/test/BlockParserTests/TestSuite.py +++ b/test/BlockParserTests/TestSuite.py @@ -89,7 +89,7 @@ def _RunExpectedBlocks(self, testCase, content): # History check counter = testCase.GetExpectedBlocks() wordTokenStream = Tokenizer.GetVHDLTokenizer(content, alphaCharacters=self.__ALPHA_CHARACTERS__, numberCharacters="") - vhdlBlockStream = TokenToBlockParser.Transform(wordTokenStream) + vhdlBlockStream = TokenToBlockParser(wordTokenStream)() try: for vhdlBlock in vhdlBlockStream: @@ -109,7 +109,7 @@ def _RunExpectedBlocksAfterStrip(self, testCase, content): counter = testCase.GetExpectedBlocksAfterStrip() wordTokenStream = Tokenizer.GetVHDLTokenizer(content, alphaCharacters=self.__ALPHA_CHARACTERS__, numberCharacters="") - vhdlBlockStream = TokenToBlockParser.Transform(wordTokenStream) + vhdlBlockStream = TokenToBlockParser(wordTokenStream)() strippedBlockStream = StripAndFuse(vhdlBlockStream) try: @@ -129,7 +129,7 @@ def _RunExpectedBlocksAfterStrip(self, testCase, content): def _RunConnectivityCheck(self, testCase, content): # Connectivity check wordTokenStream = Tokenizer.GetVHDLTokenizer(content, alphaCharacters=self.__ALPHA_CHARACTERS__, numberCharacters="") - vhdlBlockStream = TokenToBlockParser.Transform(wordTokenStream) + vhdlBlockStream = TokenToBlockParser(wordTokenStream)() try: blockIterator = iter(vhdlBlockStream) diff --git a/tests/unit/Common.py b/tests/unit/Common.py index 5d7a2fdaf..dea07e7ca 100644 --- a/tests/unit/Common.py +++ b/tests/unit/Common.py @@ -172,7 +172,7 @@ class BlockSequence(ITestcase): #, ExpectedDataMixin): def test_BlockSequence(self) -> None: # test['name'] tokenStream = Tokenizer.GetVHDLTokenizer(self.code) - blockStream = TokenToBlockParser.Transform(tokenStream) + blockStream = TokenToBlockParser(tokenStream)() blockIterator = iter(blockStream) listIterator = iter(self.blockStream.blocks) @@ -216,7 +216,7 @@ class BlockSequenceWithParserError(ITestcase): #, ExpectedDataMixin): def test_BlockSequenceError(self) -> None: # test['name'] tokenStream = Tokenizer.GetVHDLTokenizer(self.code) - blockStream = TokenToBlockParser.Transform(tokenStream) + blockStream = TokenToBlockParser(tokenStream)() blockIterator = iter(blockStream) listIterator = iter(self.blockStream.blocks) @@ -263,7 +263,7 @@ def test_BlockLinking(self) -> None: with self.assertRaises(BlockParserException) as ex: tokenStream = Tokenizer.GetVHDLTokenizer(self.code) - blockStream = TokenToBlockParser.Transform(tokenStream) + blockStream = TokenToBlockParser(tokenStream)() blockIterator = iter(blockStream) firstBlock = next(blockIterator) @@ -317,7 +317,7 @@ class BlockLinking(ITestcase): #, ExpectedDataMixin): def test_BlockLinking(self) -> None: # test['name'] tokenStream = Tokenizer.GetVHDLTokenizer(self.code) - blockStream = TokenToBlockParser.Transform(tokenStream) + blockStream = TokenToBlockParser(tokenStream)() blockIterator = iter(blockStream) firstBlock = next(blockIterator) From dd38b46731ad629ec9ed3e6f1e35bd2fe5ed9cca Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 26 Mar 2023 10:44:04 +0200 Subject: [PATCH 21/27] Use SourceCodePosition with slots. --- pyVHDLParser/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyVHDLParser/__init__.py b/pyVHDLParser/__init__.py index 1c0327e39..e6f696c86 100644 --- a/pyVHDLParser/__init__.py +++ b/pyVHDLParser/__init__.py @@ -42,7 +42,7 @@ @export -class SourceCodePosition: +class SourceCodePosition(metaclass=ExtendedType, useSlots=True): """Represent a position (row, column, absolute) in a source code file.""" Row: int #: Row in the source code file From f5ab47ab3816cdd30b9f4dcc4f41b8714adc55e3 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Mon, 27 Mar 2023 00:23:02 +0200 Subject: [PATCH 22/27] Renamed SubType to Subtype --- doc/requirements.txt | 2 +- .../Blocks/Type/{SubType.py => Subtype.py} | 74 +++++++++---------- pyVHDLParser/Blocks/Type/SubtypeIndication.py | 0 .../ObjectDeclaration/__init__.py | 2 +- .../SimulationModel/SimulationModel.py | 6 +- pyVHDLParser/TypeSystem/Package.py | 4 +- pyVHDLParser/TypeSystem/TypeSystem.py | 34 ++++----- pyVHDLParser/TypeSystem/std.py | 10 +-- pyVHDLParser/TypeSystem/std_logic_1164.py | 6 +- pyproject.toml | 2 +- requirements.txt | 2 +- 11 files changed, 71 insertions(+), 71 deletions(-) rename pyVHDLParser/Blocks/Type/{SubType.py => Subtype.py} (88%) create mode 100644 pyVHDLParser/Blocks/Type/SubtypeIndication.py diff --git a/doc/requirements.txt b/doc/requirements.txt index 20b9ca063..d44c03788 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -2,7 +2,7 @@ # Enforce latest version on ReadTheDocs sphinx>=5.3,<6.0 -pyTooling>=3.0.0, <4.0 +pyTooling>=4.0.0, <5.0 # Sphinx Extenstions #sphinx.ext.coverage diff --git a/pyVHDLParser/Blocks/Type/SubType.py b/pyVHDLParser/Blocks/Type/Subtype.py similarity index 88% rename from pyVHDLParser/Blocks/Type/SubType.py rename to pyVHDLParser/Blocks/Type/Subtype.py index 8070c3285..94f5a8b40 100644 --- a/pyVHDLParser/Blocks/Type/SubType.py +++ b/pyVHDLParser/Blocks/Type/Subtype.py @@ -37,14 +37,14 @@ @export -class SubTypeBlock(Block): +class SubtypeBlock(Block): @classmethod - def stateSubTypeKeyword(cls, parserState: TokenToBlockParser): + def stateSubtypeKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected whitespace after keyword SUBTYPE." if isinstance(token, CharacterToken): if token == "\n": - parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) + parserState.NewBlock = SubtypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) parserState.TokenMarker = None @@ -52,14 +52,14 @@ def stateSubTypeKeyword(cls, parserState: TokenToBlockParser): parserState.PushState = LinebreakBlock.stateLinebreak return elif token == "-": - parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) + parserState.NewBlock = SubtypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return elif token == "/": - parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) + parserState.NewBlock = SubtypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace1 parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart @@ -80,7 +80,7 @@ def stateWhitespace1(cls, parserState: TokenToBlockParser): if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) if not isinstance(parserState.LastBlock, MultiLineCommentBlock): - parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) + parserState.NewBlock = SubtypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: parserState.NewBlock = LinebreakBlock(parserState.LastBlock, parserState.NewToken) @@ -88,20 +88,20 @@ def stateWhitespace1(cls, parserState: TokenToBlockParser): parserState.PushState = LinebreakBlock.stateLinebreak return elif token == "-": - parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) + parserState.NewBlock = SubtypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return elif token == "/": - parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) + parserState.NewBlock = SubtypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return elif isinstance(token, WordToken): parserState.NewToken = IdentifierToken(fromExistingToken=token) - parserState.NextState = cls.stateSubTypeName + parserState.NextState = cls.stateSubtypeName return elif isinstance(token, SpaceToken) and isinstance(parserState.LastBlock, MultiLineCommentBlock): parserState.NewToken = BoundaryToken(fromExistingToken=token) @@ -112,7 +112,7 @@ def stateWhitespace1(cls, parserState: TokenToBlockParser): raise TokenParserException(errorMessage, token) @classmethod - def stateSubTypeName(cls, parserState: TokenToBlockParser): + def stateSubtypeName(cls, parserState: TokenToBlockParser): token = parserState.Token errorMessage = "Expected ';' after library name." if isinstance(token, CharacterToken): @@ -121,7 +121,7 @@ def stateSubTypeName(cls, parserState: TokenToBlockParser): parserState.NextState = cls.stateColon1 return elif token == "\n": - parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) + parserState.NewBlock = SubtypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) parserState.TokenMarker = None @@ -129,14 +129,14 @@ def stateSubTypeName(cls, parserState: TokenToBlockParser): parserState.PushState = LinebreakBlock.stateLinebreak return elif token == "-": - parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) + parserState.NewBlock = SubtypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace2 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return elif token == "/": - parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) + parserState.NewBlock = SubtypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace2 parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart @@ -160,7 +160,7 @@ def stateWhitespace2(cls, parserState: TokenToBlockParser): if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) if not isinstance(parserState.LastBlock, MultiLineCommentBlock): - parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) + parserState.NewBlock = SubtypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: parserState.NewBlock = LinebreakBlock(parserState.LastBlock, parserState.NewToken) @@ -168,13 +168,13 @@ def stateWhitespace2(cls, parserState: TokenToBlockParser): parserState.PushState = LinebreakBlock.stateLinebreak return elif token == "-": - parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) + parserState.NewBlock = SubtypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return elif token == "/": - parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) + parserState.NewBlock = SubtypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token @@ -197,7 +197,7 @@ def stateColon1(cls, parserState: TokenToBlockParser): errorMessage = "Expected typemark or whitespace after ':'." if isinstance(token, CharacterToken): if token == "\n": - parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) + parserState.NewBlock = SubtypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) parserState.TokenMarker = None @@ -205,14 +205,14 @@ def stateColon1(cls, parserState: TokenToBlockParser): parserState.PushState = LinebreakBlock.stateLinebreak return elif token == "-": - parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) + parserState.NewBlock = SubtypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace3 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return elif token == "/": - parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) + parserState.NewBlock = SubtypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace3 parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart @@ -237,7 +237,7 @@ def stateWhitespace3(cls, parserState: TokenToBlockParser): if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) if not isinstance(parserState.LastBlock, MultiLineCommentBlock): - parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) + parserState.NewBlock = SubtypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: parserState.NewBlock = LinebreakBlock(parserState.LastBlock, parserState.NewToken) @@ -245,13 +245,13 @@ def stateWhitespace3(cls, parserState: TokenToBlockParser): parserState.PushState = LinebreakBlock.stateLinebreak return elif token == "-": - parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) + parserState.NewBlock = SubtypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return elif token == "/": - parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) + parserState.NewBlock = SubtypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token @@ -278,7 +278,7 @@ def stateTypeMarkName(cls, parserState: TokenToBlockParser): parserState.NextState = cls.statePossibleVariableAssignment return elif token == "\n": - parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) + parserState.NewBlock = SubtypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) parserState.TokenMarker = None @@ -286,14 +286,14 @@ def stateTypeMarkName(cls, parserState: TokenToBlockParser): parserState.PushState = LinebreakBlock.stateLinebreak return elif token == "-": - parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) + parserState.NewBlock = SubtypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace4 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return elif token == "/": - parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) + parserState.NewBlock = SubtypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace4 parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart @@ -317,7 +317,7 @@ def stateWhitespace4(cls, parserState: TokenToBlockParser): elif token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) if not isinstance(parserState.LastBlock, MultiLineCommentBlock): - parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) + parserState.NewBlock = SubtypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: parserState.NewBlock = LinebreakBlock(parserState.LastBlock, parserState.NewToken) @@ -325,13 +325,13 @@ def stateWhitespace4(cls, parserState: TokenToBlockParser): parserState.PushState = LinebreakBlock.stateLinebreak return elif token == "-": - parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) + parserState.NewBlock = SubtypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return elif token == "/": - parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) + parserState.NewBlock = SubtypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token @@ -361,7 +361,7 @@ def stateVariableAssignment(cls, parserState: TokenToBlockParser): errorMessage = "Expected ':=' or whitespace after type mark." if isinstance(token, CharacterToken): if token == "\n": - parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) + parserState.NewBlock = SubtypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.NewToken = LinebreakToken(fromExistingToken=token) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) parserState.TokenMarker = None @@ -369,14 +369,14 @@ def stateVariableAssignment(cls, parserState: TokenToBlockParser): parserState.PushState = LinebreakBlock.stateLinebreak return elif token == "-": - parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) + parserState.NewBlock = SubtypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace5 parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return elif token == "/": - parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) + parserState.NewBlock = SubtypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.NextState = cls.stateWhitespace5 parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart @@ -396,7 +396,7 @@ def stateWhitespace5(cls, parserState: TokenToBlockParser): if token == "\n": parserState.NewToken = LinebreakToken(fromExistingToken=token) if not isinstance(parserState.LastBlock, MultiLineCommentBlock): - parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) + parserState.NewBlock = SubtypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken, multiPart=True) _ = LinebreakBlock(parserState.NewBlock, parserState.NewToken) else: parserState.NewBlock = LinebreakBlock(parserState.LastBlock, parserState.NewToken) @@ -404,13 +404,13 @@ def stateWhitespace5(cls, parserState: TokenToBlockParser): parserState.PushState = LinebreakBlock.stateLinebreak return elif token == "-": - parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) + parserState.NewBlock = SubtypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return elif token == "/": - parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) + parserState.NewBlock = SubtypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token @@ -433,17 +433,17 @@ def stateExpressionEnd(cls, parserState: TokenToBlockParser): if isinstance(token, CharacterToken): if token == ";": parserState.NewToken = EndToken(fromExistingToken=token) - parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) + parserState.NewBlock = SubtypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken) parserState.Pop() return elif token == "-": - parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) + parserState.NewBlock = SubtypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = SingleLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token return elif token == "/": - parserState.NewBlock = SubTypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) + parserState.NewBlock = SubtypeBlock(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) parserState.TokenMarker = None parserState.PushState = MultiLineCommentBlock.statePossibleCommentStart parserState.TokenMarker = token diff --git a/pyVHDLParser/Blocks/Type/SubtypeIndication.py b/pyVHDLParser/Blocks/Type/SubtypeIndication.py new file mode 100644 index 000000000..e69de29bb diff --git a/pyVHDLParser/DocumentModel/ObjectDeclaration/__init__.py b/pyVHDLParser/DocumentModel/ObjectDeclaration/__init__.py index 72525d028..5f5979947 100644 --- a/pyVHDLParser/DocumentModel/ObjectDeclaration/__init__.py +++ b/pyVHDLParser/DocumentModel/ObjectDeclaration/__init__.py @@ -73,7 +73,7 @@ def stateParseConstantName(cls, parserState: ParserState): parserState.CurrentNode = constant def __str__(self): - return "{GREEN}{0}{NOCOLOR} : {YELLOW}{1}{NOCOLOR}".format(self._name, self._subType, **LineTerminal().Foreground) + return "{GREEN}{0}{NOCOLOR} : {YELLOW}{1}{NOCOLOR}".format(self._name, self._subtype, **LineTerminal().Foreground) def Print(self, indent=0): indentation = " " * indent diff --git a/pyVHDLParser/SimulationModel/SimulationModel.py b/pyVHDLParser/SimulationModel/SimulationModel.py index 91bd10b00..cf70acad6 100644 --- a/pyVHDLParser/SimulationModel/SimulationModel.py +++ b/pyVHDLParser/SimulationModel/SimulationModel.py @@ -94,9 +94,9 @@ def __str__(self): @export class Signal: - def __init__(self, path, subType, initializer=None): + def __init__(self, path, subtype, initializer=None): self._path = path - self._subType = subType + self._subtype = subtype self._initializer = initializer self._drivingValue = None self._projectedWaveform = ProjectedWaveform(self) @@ -107,7 +107,7 @@ def Initialize(self): if self._initializer is not None: result = self._initializer() else: - result = self._subType.Attributes.Low() + result = self._subtype.Attributes.Low() self._waveform.Initialize(result) def SetValue(self, value): diff --git a/pyVHDLParser/TypeSystem/Package.py b/pyVHDLParser/TypeSystem/Package.py index de3fa9c2a..1f52baa78 100644 --- a/pyVHDLParser/TypeSystem/Package.py +++ b/pyVHDLParser/TypeSystem/Package.py @@ -32,9 +32,9 @@ @export class Parameter: - def __init__(self, name, subType): + def __init__(self, name, subtype): self._name = name - self._subType = subType + self._subtype = subtype @export diff --git a/pyVHDLParser/TypeSystem/TypeSystem.py b/pyVHDLParser/TypeSystem/TypeSystem.py index 71c9d55b4..dd84081d3 100644 --- a/pyVHDLParser/TypeSystem/TypeSystem.py +++ b/pyVHDLParser/TypeSystem/TypeSystem.py @@ -159,10 +159,10 @@ def IsContrained(self): @export -class SubType: +class Subtype: class _Attributes(_Attributes): - def __init__(self, subType): - self._subType = subType + def __init__(self, subtype): + self._subtype = subtype def Low(self): raise NotImplementedError() @@ -171,9 +171,9 @@ def High(self): raise NotImplementedError() - def __init__(self, name, subType, range=None, resolutionFunction=None): + def __init__(self, name, subtype, range=None, resolutionFunction=None): self._name = name - self._subType = subType + self._subtype = subtype self._range = range self._resolutionFunction = resolutionFunction self.Attributes = self._Attributes(self) @@ -188,32 +188,32 @@ def IsConstrained(self): @export -class IntegerSubType(SubType): - class _Attributes(SubType._Attributes): +class IntegerSubtype(Subtype): + class _Attributes(Subtype._Attributes): def Left(self): - return self._subType._range.Left + return self._subtype._range.Left def Right(self): - return self._subType._range.Right + return self._subtype._range.Right @export -class EnumerationSubType(SubType): - class _Attributes(SubType._Attributes): +class EnumerationSubtype(Subtype): + class _Attributes(Subtype._Attributes): def Low(self): - return self._subType._range.Left + return self._subtype._range.Left def High(self): - return self._subType._range.Right + return self._subtype._range.Right def Value(self, str): - return self._subType._subType.Attributes.Value(str) + return self._subtype._subtype.Attributes.Value(str) - def __init__(self, name, subType, range=None, resolutionFunction=None): + def __init__(self, name, subtype, range=None, resolutionFunction=None): if range is None: - range = subType._range - super().__init__(name, subType, range, resolutionFunction) + range = subtype._range + super().__init__(name, subtype, range, resolutionFunction) @export diff --git a/pyVHDLParser/TypeSystem/std.py b/pyVHDLParser/TypeSystem/std.py index d7855d54c..fc75fbb4b 100644 --- a/pyVHDLParser/TypeSystem/std.py +++ b/pyVHDLParser/TypeSystem/std.py @@ -28,7 +28,7 @@ # ==================================================================================================================== # # from pyVHDLParser.TypeSystem.Package import PackageDeclation, PackageBody, Package -from pyVHDLParser.TypeSystem.TypeSystem import EnumerationType, ArrayType, IntegerType, RealType, Direction, SubType, Range, IntegerSubType +from pyVHDLParser.TypeSystem.TypeSystem import EnumerationType, ArrayType, IntegerType, RealType, Direction, Subtype, Range, IntegerSubtype Boolean_Values = [ @@ -40,12 +40,12 @@ UniversatInteger = IntegerType("universat_integer") -Integer = IntegerSubType("integer", UniversatInteger, Range(UniversatInteger, Direction.To, -2**31, 2*31)) -Natural = IntegerSubType("natural", Integer, Range(UniversatInteger, Direction.To, 0, Integer.Attributes.Right)) -Positive = IntegerSubType("positive", Integer, Range(UniversatInteger, Direction.To, 1, Integer.Attributes.Right)) +Integer = IntegerSubtype("integer", UniversatInteger, Range(UniversatInteger, Direction.To, -2**31, 2*31)) +Natural = IntegerSubtype("natural", Integer, Range(UniversatInteger, Direction.To, 0, Integer.Attributes.Right)) +Positive = IntegerSubtype("positive", Integer, Range(UniversatInteger, Direction.To, 1, Integer.Attributes.Right)) UniversatReal = RealType("universat_real") -Real = IntegerSubType("real", UniversatReal, Range(UniversatReal, Direction.To, -10.0, 10.0)) +Real = IntegerSubtype("real", UniversatReal, Range(UniversatReal, Direction.To, -10.0, 10.0)) # if vhdlVersion < VHDLVersion.VHDL2008: diff --git a/pyVHDLParser/TypeSystem/std_logic_1164.py b/pyVHDLParser/TypeSystem/std_logic_1164.py index c7618dc76..8958457c4 100644 --- a/pyVHDLParser/TypeSystem/std_logic_1164.py +++ b/pyVHDLParser/TypeSystem/std_logic_1164.py @@ -28,7 +28,7 @@ # ==================================================================================================================== # # from pyVHDLParser.TypeSystem.Package import Parameter, FunctionDeclaration, Function, PackageDeclation, PackageBody, Package -from pyVHDLParser.TypeSystem.TypeSystem import EnumerationType, ArrayType, Range, SubType, EnumerationSubType +from pyVHDLParser.TypeSystem.TypeSystem import EnumerationType, ArrayType, Range, Subtype, EnumerationSubtype from pyVHDLParser.TypeSystem.std import Natural @@ -86,13 +86,13 @@ def Resolution(arguments): Func_Resolved = Function(Func_Resolved_Decl, Resolution) -Std_Logic = EnumerationSubType("std_logic", Std_ULogic, resolutionFunction=Func_Resolved) +Std_Logic = EnumerationSubtype("std_logic", Std_ULogic, resolutionFunction=Func_Resolved) # if vhdlVersion < VHDLVersion.VHDL2008: Std_Logic_Vector = ArrayType("std_logic_vector", Range(Natural), Std_Logic) # else: # pass -# # Std_Logic_Vector = ArraySubType("std_logic_vector", Std_ULogic_Vector, resolutionFunction=Func_Resolved) +# # Std_Logic_Vector = ArraySubtype("std_logic_vector", Std_ULogic_Vector, resolutionFunction=Func_Resolved) diff --git a/pyproject.toml b/pyproject.toml index 536abbcf8..58d471e8c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "pyTooling >= 3.0.0", + "pyTooling >= 4.0.0", "setuptools >= 62.3.3", "wheel >= 0.38.1" ] diff --git a/requirements.txt b/requirements.txt index bd88fa8f4..9c0a7fcc6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ colorama>=0.4.6 py-flags>=1.1.4 -pyTooling>=3.0.0, <4.0 +pyTooling>=4.0.0, <5.0 pyAttributes>=2.5.1 pyVHDLModel==0.23.0 From 5a6b8b0875057413bc43c542f1a7914ebb3957bf Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Mon, 27 Mar 2023 00:42:47 +0200 Subject: [PATCH 23/27] Removed init value. --- pyVHDLParser/Blocks/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyVHDLParser/Blocks/__init__.py b/pyVHDLParser/Blocks/__init__.py index 93b7b6d8b..e074b7d88 100644 --- a/pyVHDLParser/Blocks/__init__.py +++ b/pyVHDLParser/Blocks/__init__.py @@ -45,7 +45,7 @@ class BlockParserException(ParserException): """Base-class for exceptions when reading tokens and generating blocks.""" - _token: Token = None #: Token that was involved in an exception situation + _token: Token #: Token that was involved in an exception situation def __init__(self, message, token): super().__init__(message) From a1113f4caf9d03087bd070630eb1ef2059677822 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Mon, 27 Mar 2023 23:20:26 +0200 Subject: [PATCH 24/27] Added ANTLR4 runtime for documentation. --- doc/requirements.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/requirements.txt b/doc/requirements.txt index d44c03788..a588e24a0 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -20,3 +20,5 @@ sphinx_autodoc_typehints>=1.12.0 btd.sphinx.autoprogram>=0.1.7.post1 #btd.sphinx.graphviz>=2.3.1.post1 #btd.sphinx.inheritance_diagram>=2.3.1.post1 + +antlr4-python3-runtime==4.12.0 From 68168b6227381b61a8d146c0dad695f214df7e1a Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Mon, 27 Mar 2023 23:38:50 +0200 Subject: [PATCH 25/27] With ANTLR4 --- pyVHDLParser/Blocks/Expression.py | 140 +++++++++++++++++- pyVHDLParser/Blocks/InterfaceObject.py | 19 ++- .../Blocks/Type/ResolutionIndication.py | 49 ++++++ pyVHDLParser/Blocks/Type/SubtypeIndication.py | 47 ++++++ pyVHDLParser/CLI/VHDLParser.py | 4 +- pyVHDLParser/Decorators.py | 92 ++++++++++++ 6 files changed, 346 insertions(+), 5 deletions(-) create mode 100644 pyVHDLParser/Blocks/Type/ResolutionIndication.py diff --git a/pyVHDLParser/Blocks/Expression.py b/pyVHDLParser/Blocks/Expression.py index 744c4c381..9f295bcc1 100644 --- a/pyVHDLParser/Blocks/Expression.py +++ b/pyVHDLParser/Blocks/Expression.py @@ -388,7 +388,145 @@ def stateWhitespace1(cls, parserState: TokenToBlockParser): parserState.NewBlock = CommentBlock(parserState.LastBlock, token) parserState.TokenMarker = None return - elif (isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken))): + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): + return + elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): + parserState.NewToken = BoundaryToken(fromExistingToken=token) + parserState.NewBlock = WhitespaceBlock(parserState.LastBlock, parserState.NewToken) + parserState.TokenMarker = None + return + + raise BlockParserException("Expected ????????????.", token) + + +@export +class ExpressionBlockEndedByToOrDownto(ExpressionBlock): + EXIT_BLOCK = None + + @classmethod + def stateExpression(cls, parserState: TokenToBlockParser): + token = parserState.Token + if isinstance(token, FusedCharacterToken): + parserState.NewToken = cls.FUSED_CHARACTER_TRANSLATION[token.Value](fromExistingToken=token) + return + elif isinstance(token, CharacterToken): + if token == "(": + parserState.NewToken = OpeningRoundBracketToken(fromExistingToken=token) + parserState.Counter += 1 + return + elif token == ")": + parserState.NewToken = ClosingRoundBracketToken(fromExistingToken=token) + parserState.Counter -= 1 + return + else: + parserState.NewToken = cls.CHARACTER_TRANSLATION[token.Value](fromExistingToken=token) + return + elif isinstance(token, WordToken): + tokenValue = token.Value.lower() + if tokenValue == "to": + from pyVHDLParser.Blocks.ControlStructure.ForLoop import LoopIterationDirectionBlock + + parserState.NewToken = ToKeyword(fromExistingToken=token) + parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) + _ = LoopIterationDirectionBlock(parserState.NewBlock, parserState.NewToken) + parserState.Pop(1, parserState.NewToken) + return + elif tokenValue == "downto": + from pyVHDLParser.Blocks.ControlStructure.ForLoop import LoopIterationDirectionBlock + + parserState.NewToken = DowntoKeyword(fromExistingToken=token) + parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) + _ = LoopIterationDirectionBlock(parserState.NewBlock, parserState.NewToken) + parserState.Pop(1, parserState.NewToken) + return + else: + try: + parserState.NewToken = cls.OPERATOR_TRANSLATIONS[token.Value](fromExistingToken=token) + except KeyError: + parserState.NewToken = IdentifierToken(fromExistingToken=token) + return + elif isinstance(token, LiteralToken): + return + elif isinstance(token, SpaceToken): + parserState.NextState = cls.stateWhitespace1 + return + elif isinstance(token, (LinebreakToken, CommentToken)): + block = LinebreakBlock if isinstance(token, LinebreakToken) else CommentBlock + parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) + _ = block(parserState.NewBlock, token) + parserState.TokenMarker = None + parserState.NextState = cls.stateWhitespace1 + return + + raise BlockParserException("Expected '(' or whitespace after keyword GENERIC.", token) + + @classmethod + def stateWhitespace1(cls, parserState: TokenToBlockParser): + token = parserState.Token + if isinstance(token, FusedCharacterToken): + parserState.NewToken = cls.FUSED_CHARACTER_TRANSLATION[token.Value](fromExistingToken=token) + parserState.NextState = cls.stateExpression + return + elif isinstance(token, CharacterToken): + if token == "(": + parserState.NewToken = OpeningRoundBracketToken(fromExistingToken=token) + parserState.Counter += 1 + parserState.NextState = cls.stateExpression + return + elif token == ")": + parserState.NewToken = ClosingRoundBracketToken(fromExistingToken=token) + parserState.Counter -= 1 + parserState.NextState = cls.stateExpression + return + else: + parserState.NewToken = cls.CHARACTER_TRANSLATION[token.Value](fromExistingToken=token) + parserState.NextState = cls.stateExpression + return + elif isinstance(token, WordToken): + tokenValue = token.Value.lower() + if tokenValue == "to": + from pyVHDLParser.Blocks.ControlStructure.ForLoop import LoopIterationDirectionBlock + + parserState.NewToken = ToKeyword(fromExistingToken=token) + parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) + _ = LoopIterationDirectionBlock(parserState.NewBlock, parserState.NewToken) + parserState.Pop() + return + elif tokenValue == "downto": + from pyVHDLParser.Blocks.ControlStructure.ForLoop import LoopIterationDirectionBlock + + parserState.NewToken = DowntoKeyword(fromExistingToken=token) + parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) + _ = LoopIterationDirectionBlock(parserState.NewBlock, parserState.NewToken) + parserState.Pop() + return + else: + try: + parserState.NewToken = cls.OPERATOR_TRANSLATIONS[token.Value](fromExistingToken=token) + except KeyError: + parserState.NewToken = IdentifierToken(fromExistingToken=token) + parserState.NextState = cls.stateExpression + return + elif isinstance(token, LiteralToken): + parserState.NextState = cls.stateExpression + return + elif isinstance(token, LinebreakToken): + if not (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): + parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) + _ = LinebreakBlock(parserState.NewBlock, token) + else: + parserState.NewBlock = LinebreakBlock(parserState.LastBlock, token) + parserState.TokenMarker = None + return + elif isinstance(token, CommentToken): + if not isinstance(parserState.LastBlock, LinebreakBlock): + parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=token.PreviousToken, multiPart=True) + _ = CommentBlock(parserState.NewBlock, token) + else: + parserState.NewBlock = CommentBlock(parserState.LastBlock, token) + parserState.TokenMarker = None + return + elif isinstance(token, IndentationToken) and isinstance(token.PreviousToken, (LinebreakToken, SingleLineCommentToken)): return elif isinstance(token, SpaceToken) and (isinstance(parserState.LastBlock, CommentBlock) and isinstance(parserState.LastBlock.StartToken, MultiLineCommentToken)): parserState.NewToken = BoundaryToken(fromExistingToken=token) diff --git a/pyVHDLParser/Blocks/InterfaceObject.py b/pyVHDLParser/Blocks/InterfaceObject.py index aef737f38..b7c3e6fc9 100644 --- a/pyVHDLParser/Blocks/InterfaceObject.py +++ b/pyVHDLParser/Blocks/InterfaceObject.py @@ -29,6 +29,8 @@ # from pyTooling.Decorators import export +from pyVHDLParser.Blocks.Type.ResolutionIndication import RecordResolutionIndicationBlock, \ + SimpleResolutionIndicationBlock from pyVHDLParser.Token import SpaceToken, LinebreakToken, CommentToken, WordToken, ExtendedIdentifier, MultiLineCommentToken from pyVHDLParser.Token import IndentationToken, SingleLineCommentToken, CharacterToken, FusedCharacterToken from pyVHDLParser.Token.Keywords import InKeyword, VariableAssignmentKeyword, OutKeyword, InoutKeyword, BufferKeyword, LinkageKeyword @@ -195,7 +197,12 @@ def stateWhitespace3(cls, parserState: TokenToBlockParser): def stateModeKeyword(cls, parserState: TokenToBlockParser): token = parserState.Token if isinstance(token, SpaceToken): - parserState.NextState = cls.stateWhitespace4 + parserState.NextState = cls.stateSubtypeIndication + parserState.PushState = SimpleResolutionIndicationBlock.stateResolutionFunction + return + elif isinstance(token, CharacterToken) and (token == "("): + parserState.NextState = cls.stateSubtypeIndication + parserState.PushState = RecordResolutionIndicationBlock.stateOpeningParentesis return elif isinstance(token, (LinebreakToken, CommentToken)): block = LinebreakBlock if isinstance(token, LinebreakToken) else CommentBlock @@ -251,7 +258,15 @@ def stateSubtypeIndication(cls, parserState: TokenToBlockParser): parserState.Counter = 0 return elif isinstance(token, CharacterToken): - if (token == ';'): + if token == '(': + # parserState.NewToken = BoundaryToken(fromExistingToken=token) + # parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, + # endToken=parserState.NewToken.PreviousToken) + # parserState.TokenMarker = parserState.NewToken + # parserState.NextState = LoopBlock.stateSequentialRegion + # parserState.PushState = ExpressionBlockEndedByLoopORToORDownto.stateExpression + # return + # elif token == ';': parserState.NewToken = DelimiterToken(fromExistingToken=token) parserState.NewBlock = cls(parserState.LastBlock, parserState.TokenMarker, endToken=parserState.NewToken.PreviousToken) _ = cls.DELIMITER_BLOCK(parserState.NewBlock, parserState.NewToken) diff --git a/pyVHDLParser/Blocks/Type/ResolutionIndication.py b/pyVHDLParser/Blocks/Type/ResolutionIndication.py new file mode 100644 index 000000000..9ec69acd0 --- /dev/null +++ b/pyVHDLParser/Blocks/Type/ResolutionIndication.py @@ -0,0 +1,49 @@ +# ==================================================================================================================== # +# __ ___ _ ____ _ ____ # +# _ __ _ \ \ / / | | | _ \| | | _ \ __ _ _ __ ___ ___ _ __ # +# | '_ \| | | \ \ / /| |_| | | | | | | |_) / _` | '__/ __|/ _ \ '__| # +# | |_) | |_| |\ V / | _ | |_| | |___| __/ (_| | | \__ \ __/ | # +# | .__/ \__, | \_/ |_| |_|____/|_____|_| \__,_|_| |___/\___|_| # +# |_| |___/ # +# ==================================================================================================================== # +# Authors: # +# Patrick Lehmann # +# # +# License: # +# ==================================================================================================================== # +# Copyright 2017-2023 Patrick Lehmann - Boetzingen, Germany # +# Copyright 2016-2017 Patrick Lehmann - Dresden, Germany # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); # +# you may not use this file except in compliance with the License. # +# You may obtain a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +# ==================================================================================================================== # +# +from pyTooling.Decorators import export + +from pyVHDLParser.Blocks import Block + + +@export +class SimpleResolutionIndicationBlock(Block): + def stateResolutionFunction(self): + pass + + +@export +class ArrayResolutionIndicationBlock(Block): + pass + + +@export +class RecordResolutionIndicationBlock(Block): + def stateOpeningParentesis(self): + pass diff --git a/pyVHDLParser/Blocks/Type/SubtypeIndication.py b/pyVHDLParser/Blocks/Type/SubtypeIndication.py index e69de29bb..486bc9214 100644 --- a/pyVHDLParser/Blocks/Type/SubtypeIndication.py +++ b/pyVHDLParser/Blocks/Type/SubtypeIndication.py @@ -0,0 +1,47 @@ +# ==================================================================================================================== # +# __ ___ _ ____ _ ____ # +# _ __ _ \ \ / / | | | _ \| | | _ \ __ _ _ __ ___ ___ _ __ # +# | '_ \| | | \ \ / /| |_| | | | | | | |_) / _` | '__/ __|/ _ \ '__| # +# | |_) | |_| |\ V / | _ | |_| | |___| __/ (_| | | \__ \ __/ | # +# | .__/ \__, | \_/ |_| |_|____/|_____|_| \__,_|_| |___/\___|_| # +# |_| |___/ # +# ==================================================================================================================== # +# Authors: # +# Patrick Lehmann # +# # +# License: # +# ==================================================================================================================== # +# Copyright 2017-2023 Patrick Lehmann - Boetzingen, Germany # +# Copyright 2016-2017 Patrick Lehmann - Dresden, Germany # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); # +# you may not use this file except in compliance with the License. # +# You may obtain a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +# ==================================================================================================================== # +# +from pyTooling.Decorators import export + +from pyVHDLParser.Blocks import Block + + +@export +class SubtypeIndicationBlock(Block): + pass + + +@export +class ArrayConstrainedSubtypeIndicationBlock(Block): + pass + + +@export +class RecordConstrainedSubtypeIndicationBlock(Block): + pass diff --git a/pyVHDLParser/CLI/VHDLParser.py b/pyVHDLParser/CLI/VHDLParser.py index 854e4bc53..bfdbbb665 100644 --- a/pyVHDLParser/CLI/VHDLParser.py +++ b/pyVHDLParser/CLI/VHDLParser.py @@ -44,7 +44,7 @@ from pyVHDLParser.CLI.Block import BlockStreamHandlers from pyVHDLParser.CLI.Group import GroupStreamHandlers from pyVHDLParser.CLI.CodeDOM import CodeDOMHandlers -# from pyVHDLParser.CLI.ANTLR import ANTLRHandlers +from pyVHDLParser.CLI.ANTLR import ANTLRHandlers @export @@ -62,7 +62,7 @@ def printImportError(ex) -> NoReturn: @export -class Application(LineTerminal, ArgParseMixin, TokenStreamHandlers, BlockStreamHandlers, GroupStreamHandlers, CodeDOMHandlers): # , ANTLRHandlers): +class Application(LineTerminal, ArgParseMixin, TokenStreamHandlers, BlockStreamHandlers, GroupStreamHandlers, CodeDOMHandlers, ANTLRHandlers): HeadLine = "pyVHDLParser - Test Application" # load platform information (Windows, Linux, Darwin, ...) diff --git a/pyVHDLParser/Decorators.py b/pyVHDLParser/Decorators.py index 65bc15bbc..3f6a675a5 100644 --- a/pyVHDLParser/Decorators.py +++ b/pyVHDLParser/Decorators.py @@ -27,3 +27,95 @@ # limitations under the License. # # ==================================================================================================================== # # +import functools +import time +from typing import Dict + + +class ExecutionTimer: + _times: Dict = None + + def __init__(self): + self._times = {} + + def AddExecutionTime(self, function, executionTime): + try: + self._times[function].append(executionTime) + except ValueError: + self._times[function] = [ executionTime ] + + +class ExecutionCounter: + _counts: Dict = None + + def __init__(self): + self._counts = {} + + def IncrementCallCounter(self, function): + try: + self._counts[function] += 1 + except ValueError: + self._counts[function] = 1 + + +def LogExecutionTime(function): + """Measure the runtime execution time of functions and methods.""" + + @functools.wraps(function) + def wrapper(*args, **kwargs): + start_time = time.perf_counter() + value = function(*args, **kwargs) + end_time = time.perf_counter() + + __TIMER__.AddExecutionTime(function, end_time - start_time) + + return value + + return wrapper + +def LogExecutionCount(function): + """Count how often a functions or methods was called.""" + + @functools.wraps(function) + def wrapper(*args, **kwargs): + value = function(*args, **kwargs) + + __COUNTER__.IncrementCallCounter(function) + + return value + + return wrapper + +__TIMER__ = ExecutionTimer() +__COUNTER__ = ExecutionCounter() + +# def debug(func): +# """Print the function signature and return value""" +# @functools.wraps(func) +# def wrapper_debug(*args, **kwargs): +# args_repr = [repr(a) for a in args] # 1 +# kwargs_repr = [f"{k}={v!r}" for k, v in kwargs.items()] # 2 +# signature = ", ".join(args_repr + kwargs_repr) # 3 +# print(f"Calling {func.__name__}({signature})") +# value = func(*args, **kwargs) +# print(f"{func.__name__!r} returned {value!r}") # 4 +# return value +# return wrapper_debug + +# class CountCalls: +# def __init__(self, func): +# functools.update_wrapper(self, func) +# self.func = func +# self.num_calls = 0 +# +# def __call__(self, *args, **kwargs): +# self.num_calls += 1 +# print(f"Call {self.num_calls} of {self.func.__name__!r}") +# return self.func(*args, **kwargs) +# +# def set_unit(unit): +# """Register a unit on a function""" +# def decorator_set_unit(func): +# func.unit = unit +# return func +# return decorator_set_unit From 8d4ac2b8f44fc0f55fc9b3415ecc827e30ac6440 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 28 Mar 2023 00:09:34 +0200 Subject: [PATCH 26/27] Bumped dependencies. --- doc/requirements.txt | 2 +- pyproject.toml | 2 +- requirements.txt | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index a588e24a0..9061f5c3a 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -2,7 +2,7 @@ # Enforce latest version on ReadTheDocs sphinx>=5.3,<6.0 -pyTooling>=4.0.0, <5.0 +pyTooling>=4.0.1, <5.0 # Sphinx Extenstions #sphinx.ext.coverage diff --git a/pyproject.toml b/pyproject.toml index 58d471e8c..63574b7ac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "pyTooling >= 4.0.0", + "pyTooling >= 4.0.1", "setuptools >= 62.3.3", "wheel >= 0.38.1" ] diff --git a/requirements.txt b/requirements.txt index 9c0a7fcc6..3cbb9fb2d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ colorama>=0.4.6 py-flags>=1.1.4 -pyTooling>=4.0.0, <5.0 +pyTooling>=4.0.1, <5.0 pyAttributes>=2.5.1 -pyVHDLModel==0.23.0 +pyVHDLModel==0.24.0 From 53376d92cb8f72c60ec414792548d7eea7a9fa7b Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 28 Mar 2023 00:17:44 +0200 Subject: [PATCH 27/27] Added missing file for ANTLR4. --- pyVHDLParser/ANTLR4/__init__.py | 201 ++++++++++++++++++++++++++++++++ 1 file changed, 201 insertions(+) create mode 100644 pyVHDLParser/ANTLR4/__init__.py diff --git a/pyVHDLParser/ANTLR4/__init__.py b/pyVHDLParser/ANTLR4/__init__.py new file mode 100644 index 000000000..7b789ba16 --- /dev/null +++ b/pyVHDLParser/ANTLR4/__init__.py @@ -0,0 +1,201 @@ +from typing import Dict, List + +from antlr4 import CommonTokenStream, Token as antlrToken + +from .. import SourceCodePosition +from ..Token import Token, StartOfDocumentToken, EndOfDocumentToken, FusedCharacterToken, IntegerLiteralToken, \ + IndentationToken, LinebreakToken, SpaceToken, SingleLineCommentToken, MultiLineCommentToken, CharacterToken, \ + StringLiteralToken, BitStringLiteralToken +from ..Token.Keywords import * + +from .VHDLLexer import VHDLLexer + + +class ANTLR2Token: + TRANSLATE: Dict[int, type(KeywordToken)] = { + VHDLLexer.OP_ABS: AbsOperator, + # VHDLLexer.KW_ACROSS: AcrossKeyword, + VHDLLexer.KW_ACCESS: AccessKeyword, + VHDLLexer.KW_AFTER: AfterKeyword, + VHDLLexer.KW_ALIAS: AliasKeyword, + VHDLLexer.KW_ALL: AllKeyword, + VHDLLexer.OP_AND: AndOperator, + VHDLLexer.KW_ARCHITECTURE: ArchitectureKeyword, + VHDLLexer.KW_ARRAY: ArrayKeyword, + VHDLLexer.KW_ASSERT: AssertKeyword, + VHDLLexer.KW_ATTRIBUTE: AttributeKeyword, + # VHDLLexer.KW_PSL_ASSUME: AssumeKeyword, + # VHDLLexer.KW_AMS_ACROSS: AcrossKeyword, + VHDLLexer.KW_BEGIN: BeginKeyword, + VHDLLexer.KW_BLOCK: BlockKeyword, + VHDLLexer.KW_BODY: BodyKeyword, + VHDLLexer.KW_BUFFER: BufferKeyword, + VHDLLexer.KW_BUS: BusKeyword, + # VHDLLexer.KW_BREAK: BreakKeyword, + VHDLLexer.KW_CASE: CaseKeyword, + VHDLLexer.KW_COMPONENT: ComponentKeyword, + VHDLLexer.KW_CONFIGURATION: ConfigurationKeyword, + VHDLLexer.KW_CONSTANT: ConstantKeyword, + VHDLLexer.KW_CONTEXT: ContextKeyword, + # VHDLLexer.KW_PSL_COVER: CoverKeyword, + VHDLLexer.KW_DEFAULT: DefaultKeyword, + VHDLLexer.KW_DISCONNECT: DisconnectKeyword, + VHDLLexer.KW_DOWNTO: DowntoKeyword, + VHDLLexer.KW_ELSE: ElseKeyword, + VHDLLexer.KW_ELSIF: ElsIfKeyword, + VHDLLexer.KW_END: EndKeyword, + VHDLLexer.KW_ENTITY: EntityKeyword, + VHDLLexer.KW_EXIT: ExitKeyword, + VHDLLexer.KW_FILE: FileKeyword, + VHDLLexer.KW_FOR: ForKeyword, + VHDLLexer.KW_FORCE: ForceKeyword, + VHDLLexer.KW_FUNCTION: FunctionKeyword, + VHDLLexer.KW_GENERATE: GenerateKeyword, + VHDLLexer.KW_GENERIC: GenericKeyword, + # VHDLLexer.KW_GROUP: GroupKeyword, + VHDLLexer.KW_GUARDED: GuardedKeyword, + VHDLLexer.KW_IF: IfKeyword, + VHDLLexer.KW_IMPURE: ImpureKeyword, + VHDLLexer.KW_IN: InKeyword, + VHDLLexer.KW_INERTIAL: InertialKeyword, + VHDLLexer.KW_INOUT: InoutKeyword, + VHDLLexer.KW_IS: IsKeyword, + VHDLLexer.KW_LABEL: LabelKeyword, + VHDLLexer.KW_LIBRARY: LibraryKeyword, + VHDLLexer.KW_LINKAGE: LinkageKeyword, + VHDLLexer.KW_LOOP: LoopKeyword, + VHDLLexer.KW_PSL_LITERAL: LiteralKeyword, + # VHDLLexer.KW_LIMIT: LimitKeyword, + VHDLLexer.KW_MAP: MapKeyword, + VHDLLexer.OP_MOD: ModuloOperator, + VHDLLexer.OP_NAND: NandOperator, + VHDLLexer.KW_NEW: NewKeyword, + VHDLLexer.KW_NEXT: NextKeyword, + VHDLLexer.OP_NOR: NorOperator, + VHDLLexer.OP_NOT: NotOperator, + VHDLLexer.KW_NULL: NullKeyword, + # VHDLLexer.KW_NATURE: NatureKeyword, + # VHDLLexer.KW_NOISE: NoiseKeyword, + VHDLLexer.KW_OF: OfKeyword, + VHDLLexer.KW_ON: OnKeyword, + VHDLLexer.KW_OPEN: OpenKeyword, + VHDLLexer.OP_OR: OrOperator, + VHDLLexer.KW_OTHERS: OthersKeyword, + VHDLLexer.KW_OUT: OutKeyword, + VHDLLexer.KW_PACKAGE: PackageKeyword, + VHDLLexer.KW_PARAMETER: ParameterKeyword, + VHDLLexer.KW_PORT: PortKeyword, + VHDLLexer.KW_POSTPONED: PostponedKeyword, + VHDLLexer.KW_PRIVATE: PrivateKeyword, + VHDLLexer.KW_PROCEDURE: ProcedureKeyword, + VHDLLexer.KW_PROCESS: ProcessKeyword, + VHDLLexer.KW_PROTECTED: ProtectedKeyword, + VHDLLexer.KW_PURE: PureKeyword, + # VHDLLexer.KW_PROCEDURAL: ProceduralKeyword, + # VHDLLexer.KW_QUANTITY: 'quantityKeyword, + VHDLLexer.KW_RANGE: RangeKeyword, + VHDLLexer.KW_RECORD: RecordKeyword, + VHDLLexer.KW_REGISTER: RegisterKeyword, + VHDLLexer.KW_REJECT: RejectKeyword, + VHDLLexer.KW_RELEASE: ReleaseKeyword, + VHDLLexer.OP_REM: RemainderOperator, + VHDLLexer.KW_REPORT: ReportKeyword, + VHDLLexer.KW_RETURN: ReturnKeyword, + VHDLLexer.OP_ROL: RolOperator, + VHDLLexer.OP_ROR: RorOperator, + # VHDLLexer.KW_PSL_RESTRICT: RestrictKeyword, + # VHDLLexer.KW_REFERENCE: ReferenceKeyword, + VHDLLexer.KW_SELECT: SelectKeyword, + VHDLLexer.KW_SEVERITY: SeverityKeyword, + VHDLLexer.KW_SHARED: SharedKeyword, + VHDLLexer.KW_SIGNAL: SignalKeyword, + VHDLLexer.OP_SLA: SlaOperator, + VHDLLexer.OP_SLL: SllOperator, + VHDLLexer.OP_SRA: SraOperator, + VHDLLexer.OP_SRL: SrlOperator, + VHDLLexer.KW_SUBTYPE: SubtypeKeyword, + # VHDLLexer.KW_PSL_STRONG: StrongKeyword, + # VHDLLexer.KW_PSL_SEQUENCE: SequenceKeyword, + # VHDLLexer.KW_SPECTRUM: SpectrumKeyword, + # VHDLLexer.KW_SUBNATURE: SubnatureKeyword, + VHDLLexer.KW_THEN: ThenKeyword, + VHDLLexer.KW_TO: ToKeyword, + VHDLLexer.KW_TRANSPORT: TransportKeyword, + VHDLLexer.KW_TYPE: TypeKeyword, + # VHDLLexer.KW_TERMINAL: TerminalKeyword, + # VHDLLexer.KW_THROUGH: ThroughKeyword, + # VHDLLexer.KW_TOLERANCE: ToleranceKeyword, + VHDLLexer.KW_UNAFFECTED: UnaffectedKeyword, + VHDLLexer.KW_UNITS: UnitsKeyword, + VHDLLexer.KW_UNTIL: UntilKeyword, + VHDLLexer.KW_USE: UseKeyword, + VHDLLexer.KW_VARIABLE: VariableKeyword, + VHDLLexer.KW_VIEW: ViewKeyword, + # VHDLLexer.KW_PSL_VMODE: VModeKeyword, + # VHDLLexer.KW_PSL_VPKG: VPackageKeyword, + # VHDLLexer.KW_PSL_VPROP: VPropertyKeyword,, + # VHDLLexer.KW_PSL_VUNIT: VunitKeyword, + VHDLLexer.KW_WAIT: WaitKeyword, + VHDLLexer.KW_WITH: WithKeyword, + VHDLLexer.KW_WHEN: WhenKeyword, + VHDLLexer.KW_WHILE: WhileKeyword, + VHDLLexer.OP_XNOR: XnorOperator, + VHDLLexer.OP_XOR: XorOperator, + } + + def ConvertToTokenChain(self, tokenStream: CommonTokenStream) -> List[Token]: + allTokens: List[Token] = [] + tokenIndex: int = -1 + + lastToken = StartOfDocumentToken() + while True: + allTokens.append(lastToken) + tokenIndex += 1 + + aToken: antlrToken = tokenStream.get(tokenIndex) + start = SourceCodePosition(aToken.line, aToken.column, -1) + + if aToken.type == antlrToken.EOF: + allTokens.append(EndOfDocumentToken(lastToken, start)) + return allTokens + + try: + tokenType = self.TRANSLATE[aToken.type] + lastToken = tokenType(lastToken, aToken.text, start) + continue + + except KeyError: + pass + + if aToken.type in ( + VHDLLexer.TOK_SEMICOL, VHDLLexer.TOK_COMMA, VHDLLexer.TOK_COLON, VHDLLexer.TOK_DOT, VHDLLexer.TOK_LP, + VHDLLexer.TOK_RP, VHDLLexer.TOK_LB, VHDLLexer.TOK_RB, VHDLLexer.OP_MINUS, VHDLLexer.OP_PLUS, VHDLLexer.OP_MUL, + VHDLLexer.OP_DIV, VHDLLexer.TOK_BAR, VHDLLexer.TOK_TICK, VHDLLexer.OP_CONCAT, VHDLLexer.OP_CONDITION): + lastToken = CharacterToken(lastToken, aToken.text, start) + elif aToken.type in ( + VHDLLexer.TOK_SIG_ASSIGN, VHDLLexer.TOK_VAR_ASSIGN, VHDLLexer.TOK_BOX, VHDLLexer.OP_POW, VHDLLexer.OP_EQ, + VHDLLexer.OP_NE, VHDLLexer.OP_LT, VHDLLexer.OP_LT, VHDLLexer.OP_GT, VHDLLexer.OP_GE, VHDLLexer.OP_IEQ, + VHDLLexer.OP_INE, VHDLLexer.OP_ILT, VHDLLexer.OP_ILE, VHDLLexer.OP_IGT, VHDLLexer.OP_IGE, VHDLLexer.TOK_RARROW): + lastToken = FusedCharacterToken(lastToken, aToken.text, start, start) + elif aToken.type == VHDLLexer.LIT_IDENTIFIER: + lastToken = IdentifierToken(lastToken, aToken.text, start) + elif aToken.type == VHDLLexer.LIT_ABSTRACT: + lastToken = IntegerLiteralToken(lastToken, aToken.text, start) + elif aToken.type == VHDLLexer.LIT_CHARACTER: + lastToken = CharacterToken(lastToken, aToken.text, start) + elif aToken.type == VHDLLexer.LIT_STRING: + lastToken = StringLiteralToken(lastToken, aToken.text, start, start) + elif aToken.type == VHDLLexer.LIT_BIT_STRING: + lastToken = BitStringLiteralToken(lastToken, aToken.text, start, start) + elif aToken.type == VHDLLexer.WHITESPACE: + tokenType = IndentationToken if isinstance(lastToken, LinebreakToken) else SpaceToken + lastToken = tokenType(lastToken, aToken.text, start) + elif aToken.type == VHDLLexer.LINEBREAK: + lastToken = LinebreakToken(lastToken, aToken.text, start) + elif aToken.type == VHDLLexer.COMMENT_LINE: + lastToken = SingleLineCommentToken(lastToken, aToken.text, start) + elif aToken.type == VHDLLexer.COMMENT_BLOCK: + lastToken = MultiLineCommentToken(lastToken, aToken.text, start) + else: + raise Exception( + f"Unknown ANTLR4 token type '{VHDLLexer.symbolicNames[aToken.type]}' ({aToken.type}) with value '{aToken.text}'.")