7.1.1.2.1.4.1.3. pycropml.transpiler.rules.cymlRules module¶
- class pycropml.transpiler.rules.cymlRules.CymlRules[source]¶
Bases:
GeneralRule- binary_op = {'!=': '!=', '%': '%', '&': '&', '*': '*', '+': '+', '-': '-', '/': '/', '<': '<', '<=': '<=', '==': '==', '>': '>', '>=': '>=', 'and': 'and', 'not': 'not', 'or': 'or'}¶
- constant = {'math': {'pi': 'pi'}}¶
- functions = {'datetime': {'datetime': 'datetime'}, 'io': {'print': <function translatePrint>, 'read': 'read', 'read_file': 'File.ReadAllText', 'write_file': 'File.WriteAllText'}, 'math': {'acos': 'acos', 'asin': 'asin', 'atan': 'atan', 'ceil': 'ceil', 'cos': 'cos', 'exp': 'exp', 'floor': 'floor', 'ln': 'log', 'log': 'log', 'pow': 'pow', 'round': 'round', 'sin': 'sin', 'sqrt': 'sqrt', 'tan': 'tan'}, 'system': {'abs': 'abs', 'copy': <function translateCopy>, 'integr': <function translateIntegr>, 'max': 'max', 'min': 'min', 'modulo': <function translateModulo>, 'pow': 'pow', 'round': 'round'}}¶
- methods = {'array': {'allocate': '.allocate', 'append': '.append', 'len': 'len', 'sum': 'sum'}, 'datetime': {'datetime': 'datetime', 'day': 'day'}, 'dict': {'get': '.get', 'keys': <function translateDictkeys>, 'len': 'len'}, 'float': {'int': 'int'}, 'int': {'double': 'float', 'float': 'float', 'int': 'int'}, 'list': {'allocate': '.allocate', 'append': '.append', 'contains?': <function CymlRules.<lambda>>, 'extend': '.extend', 'index': '.index', 'len': 'len', 'not contains?': <function translateNotContains>, 'pop': '.pop', 'sum': 'sum'}, 'str': {'find': '.index', 'index': '.index', 'int': 'int'}}¶
- types = {'bool': 'bool', 'datetime': 'datetime', 'dict': 'dict', 'float': 'float', 'int': 'int', 'list': 'list', 'str': 'str', 'tuple': 'tuple'}¶
- unary_op = {'+': '+', '-': '-', 'not': 'not ', '~': '~'}¶