pydpm_xl 0.1.10__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- py_dpm/AST/ASTConstructor.py +503 -0
- py_dpm/AST/ASTObjects.py +827 -0
- py_dpm/AST/ASTTemplate.py +101 -0
- py_dpm/AST/ASTVisitor.py +13 -0
- py_dpm/AST/MLGeneration.py +588 -0
- py_dpm/AST/ModuleAnalyzer.py +79 -0
- py_dpm/AST/ModuleDependencies.py +203 -0
- py_dpm/AST/WhereClauseChecker.py +12 -0
- py_dpm/AST/__init__.py +0 -0
- py_dpm/AST/check_operands.py +302 -0
- py_dpm/DataTypes/ScalarTypes.py +324 -0
- py_dpm/DataTypes/TimeClasses.py +370 -0
- py_dpm/DataTypes/TypePromotion.py +195 -0
- py_dpm/DataTypes/__init__.py +0 -0
- py_dpm/Exceptions/__init__.py +0 -0
- py_dpm/Exceptions/exceptions.py +84 -0
- py_dpm/Exceptions/messages.py +114 -0
- py_dpm/OperationScopes/OperationScopeService.py +247 -0
- py_dpm/OperationScopes/__init__.py +0 -0
- py_dpm/Operators/AggregateOperators.py +138 -0
- py_dpm/Operators/BooleanOperators.py +30 -0
- py_dpm/Operators/ClauseOperators.py +159 -0
- py_dpm/Operators/ComparisonOperators.py +69 -0
- py_dpm/Operators/ConditionalOperators.py +362 -0
- py_dpm/Operators/NumericOperators.py +101 -0
- py_dpm/Operators/Operator.py +388 -0
- py_dpm/Operators/StringOperators.py +27 -0
- py_dpm/Operators/TimeOperators.py +53 -0
- py_dpm/Operators/__init__.py +0 -0
- py_dpm/Utils/ValidationsGenerationUtils.py +429 -0
- py_dpm/Utils/__init__.py +0 -0
- py_dpm/Utils/operands_mapping.py +73 -0
- py_dpm/Utils/operator_mapping.py +89 -0
- py_dpm/Utils/tokens.py +172 -0
- py_dpm/Utils/utils.py +2 -0
- py_dpm/ValidationsGeneration/PropertiesConstraintsProcessor.py +190 -0
- py_dpm/ValidationsGeneration/Utils.py +364 -0
- py_dpm/ValidationsGeneration/VariantsProcessor.py +265 -0
- py_dpm/ValidationsGeneration/__init__.py +0 -0
- py_dpm/ValidationsGeneration/auxiliary_functions.py +98 -0
- py_dpm/__init__.py +61 -0
- py_dpm/api/__init__.py +140 -0
- py_dpm/api/ast_generator.py +438 -0
- py_dpm/api/complete_ast.py +241 -0
- py_dpm/api/data_dictionary_validation.py +577 -0
- py_dpm/api/migration.py +77 -0
- py_dpm/api/semantic.py +224 -0
- py_dpm/api/syntax.py +182 -0
- py_dpm/client.py +106 -0
- py_dpm/data_handlers.py +99 -0
- py_dpm/db_utils.py +117 -0
- py_dpm/grammar/__init__.py +0 -0
- py_dpm/grammar/dist/__init__.py +0 -0
- py_dpm/grammar/dist/dpm_xlLexer.interp +428 -0
- py_dpm/grammar/dist/dpm_xlLexer.py +804 -0
- py_dpm/grammar/dist/dpm_xlLexer.tokens +106 -0
- py_dpm/grammar/dist/dpm_xlParser.interp +249 -0
- py_dpm/grammar/dist/dpm_xlParser.py +5224 -0
- py_dpm/grammar/dist/dpm_xlParser.tokens +106 -0
- py_dpm/grammar/dist/dpm_xlParserListener.py +742 -0
- py_dpm/grammar/dist/dpm_xlParserVisitor.py +419 -0
- py_dpm/grammar/dist/listeners.py +10 -0
- py_dpm/grammar/dpm_xlLexer.g4 +435 -0
- py_dpm/grammar/dpm_xlParser.g4 +260 -0
- py_dpm/migration.py +282 -0
- py_dpm/models.py +2139 -0
- py_dpm/semantics/DAG/DAGAnalyzer.py +158 -0
- py_dpm/semantics/DAG/__init__.py +0 -0
- py_dpm/semantics/SemanticAnalyzer.py +320 -0
- py_dpm/semantics/Symbols.py +223 -0
- py_dpm/semantics/__init__.py +0 -0
- py_dpm/utils/__init__.py +0 -0
- py_dpm/utils/ast_serialization.py +481 -0
- py_dpm/views/data_types.sql +12 -0
- py_dpm/views/datapoints.sql +65 -0
- py_dpm/views/hierarchy_operand_reference.sql +11 -0
- py_dpm/views/hierarchy_preconditions.sql +13 -0
- py_dpm/views/hierarchy_variables.sql +26 -0
- py_dpm/views/hierarchy_variables_context.sql +14 -0
- py_dpm/views/key_components.sql +18 -0
- py_dpm/views/module_from_table.sql +11 -0
- py_dpm/views/open_keys.sql +13 -0
- py_dpm/views/operation_info.sql +27 -0
- py_dpm/views/operation_list.sql +18 -0
- py_dpm/views/operations_versions_from_module_version.sql +30 -0
- py_dpm/views/precondition_info.sql +17 -0
- py_dpm/views/report_type_operand_reference_info.sql +18 -0
- py_dpm/views/subcategory_info.sql +17 -0
- py_dpm/views/table_info.sql +19 -0
- pydpm_xl-0.1.10.dist-info/LICENSE +674 -0
- pydpm_xl-0.1.10.dist-info/METADATA +50 -0
- pydpm_xl-0.1.10.dist-info/RECORD +94 -0
- pydpm_xl-0.1.10.dist-info/WHEEL +4 -0
- pydpm_xl-0.1.10.dist-info/entry_points.txt +3 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
from py_dpm.AST.ASTObjects import AggregationOp, BinOp, ComplexNumericOp, CondExpr, Constant, Dimension, FilterOp, GetOp, GroupingClause, \
|
|
2
|
+
OperationRef, ParExpr, PersistentAssignment, PreconditionItem, PropertyReference, RenameOp, Scalar, Set, Start, TemporaryAssignment, \
|
|
3
|
+
TimeShiftOp, UnaryOp, VarID, VarRef, WhereClauseOp, WithExpression
|
|
4
|
+
from py_dpm.AST.ASTVisitor import NodeVisitor
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ASTTemplate(NodeVisitor):
|
|
8
|
+
"""
|
|
9
|
+
Template to start a new visitor for the AST
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
def __init__(self):
|
|
13
|
+
pass
|
|
14
|
+
|
|
15
|
+
def visit_Start(self, node: Start):
|
|
16
|
+
for child in node.children:
|
|
17
|
+
self.visit(child)
|
|
18
|
+
|
|
19
|
+
def visit_ParExpr(self, node: ParExpr):
|
|
20
|
+
self.visit(node.expression)
|
|
21
|
+
|
|
22
|
+
def visit_BinOp(self, node: BinOp):
|
|
23
|
+
self.visit(node.left)
|
|
24
|
+
self.visit(node.right)
|
|
25
|
+
|
|
26
|
+
def visit_UnaryOp(self, node: UnaryOp):
|
|
27
|
+
self.visit(node.operand)
|
|
28
|
+
|
|
29
|
+
def visit_CondExpr(self, node: CondExpr):
|
|
30
|
+
self.visit(node.condition)
|
|
31
|
+
self.visit(node.then_expr)
|
|
32
|
+
if node.else_expr:
|
|
33
|
+
self.visit(node.else_expr)
|
|
34
|
+
|
|
35
|
+
def visit_VarRef(self, node: VarRef):
|
|
36
|
+
pass
|
|
37
|
+
|
|
38
|
+
def visit_VarID(self, node: VarID):
|
|
39
|
+
pass
|
|
40
|
+
|
|
41
|
+
def visit_Constant(self, node: Constant):
|
|
42
|
+
pass
|
|
43
|
+
|
|
44
|
+
def visit_WithExpression(self, node: WithExpression):
|
|
45
|
+
self.visit(node.partial_selection)
|
|
46
|
+
self.visit(node.expression)
|
|
47
|
+
|
|
48
|
+
def visit_AggregationOp(self, node: AggregationOp):
|
|
49
|
+
self.visit(node.operand)
|
|
50
|
+
if node.grouping_clause:
|
|
51
|
+
self.visit(node.grouping_clause)
|
|
52
|
+
|
|
53
|
+
def visit_GroupingClause(self, node: GroupingClause):
|
|
54
|
+
pass
|
|
55
|
+
|
|
56
|
+
def visit_Dimension(self, node: Dimension):
|
|
57
|
+
pass
|
|
58
|
+
|
|
59
|
+
def visit_Set(self, node: Set):
|
|
60
|
+
for child in node.children:
|
|
61
|
+
self.visit(child)
|
|
62
|
+
|
|
63
|
+
def visit_Scalar(self, node: Scalar):
|
|
64
|
+
pass
|
|
65
|
+
|
|
66
|
+
def visit_ComplexNumericOp(self, node: ComplexNumericOp):
|
|
67
|
+
for operand in node.operands:
|
|
68
|
+
self.visit(operand)
|
|
69
|
+
|
|
70
|
+
def visit_RenameOp(self, node: RenameOp):
|
|
71
|
+
self.visit(node.operand)
|
|
72
|
+
|
|
73
|
+
def visit_TimeShiftOp(self, node: TimeShiftOp):
|
|
74
|
+
self.visit(node.operand)
|
|
75
|
+
|
|
76
|
+
def visit_FilterOp(self, node: FilterOp):
|
|
77
|
+
self.visit(node.selection)
|
|
78
|
+
self.visit(node.condition)
|
|
79
|
+
|
|
80
|
+
def visit_WhereClauseOp(self, node: WhereClauseOp):
|
|
81
|
+
self.visit(node.operand)
|
|
82
|
+
self.visit(node.condition.right)
|
|
83
|
+
|
|
84
|
+
def visit_GetOp(self, node: GetOp):
|
|
85
|
+
self.visit(node.operand)
|
|
86
|
+
|
|
87
|
+
def visit_PreconditionItem(self, node: PreconditionItem):
|
|
88
|
+
pass
|
|
89
|
+
|
|
90
|
+
def visit_PropertyReference(self, node: PropertyReference):
|
|
91
|
+
pass
|
|
92
|
+
|
|
93
|
+
def visit_OperationRef(self, node: OperationRef):
|
|
94
|
+
pass
|
|
95
|
+
|
|
96
|
+
def visit_PersistentAssignment(self, node: PersistentAssignment):
|
|
97
|
+
self.visit(node.left)
|
|
98
|
+
self.visit(node.right)
|
|
99
|
+
|
|
100
|
+
def visit_TemporaryAssignment(self, node: TemporaryAssignment):
|
|
101
|
+
self.visit(node.right)
|
py_dpm/AST/ASTVisitor.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
class NodeVisitor(object):
|
|
2
|
+
"""
|
|
3
|
+
Foundation of the Visit pattern. Gets the AST Object class name and checks if a method
|
|
4
|
+
named visit_ + class name is present. If not, raises a NotImplementedError.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
def visit(self, node):
|
|
8
|
+
method_name = 'visit_' + type(node).__name__
|
|
9
|
+
visitor = getattr(self, method_name, self.generic_visit)
|
|
10
|
+
return visitor(node)
|
|
11
|
+
|
|
12
|
+
def generic_visit(self, node):
|
|
13
|
+
raise NotImplementedError('No visit_{} method'.format(type(node).__name__))
|