6.1.1.2.1.4.1.8. pycropml.transpiler.rules.pythonRules module

class pycropml.transpiler.rules.pythonRules.PythonRules[source]

Bases: GeneralRule

binary_op = {'!=': '!=', '%': '%', '*': '*', '+': '+', '-': '-', '/': '/', '<': '<', '<=': '<=', '==': '==', '>': '>', '>=': '>=', 'and': 'and', 'is': 'is', 'is_not': 'is not', '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', 'isnan': 'isnan', 'ln': 'log', 'log': 'log', 'round': 'round', 'sin': 'sin', 'sqrt': 'sqrt', 'tan': 'tan'}, 'system': {'abs': 'abs', 'copy': <function translateCopy>, 'integr': <function translateIntegr>, 'list': 'list', 'max': 'max', 'min': 'min', 'modulo': <function translateModulo>, 'pow': 'pow', 'range': 'range', 'round': 'round'}}
methods = {'array': {'allocate': <function PythonRules.<lambda>>, 'append': '.append', 'len': 'len', 'sum': 'sum'}, 'datetime': {'datetime': 'datetime', 'day': 'day'}, 'dict': {'get': '.get', 'keys': <function translateDictkeys>, 'len': 'len'}, 'float': {'int': 'int'}, 'int': {'float': 'float', 'int': 'int'}, 'list': {'allocate': <function PythonRules.<lambda>>, 'append': '.append', 'contains?': <function PythonRules.<lambda>>, 'extend': '.extend', 'index': '.index', 'len': 'len', 'not contains?': <function translateNotContains>, 'pop': '.pop', 'sum': 'sum'}, 'str': {'find': '.index', 'int': 'int'}}
types = {'bool': 'bool', 'datetime': 'datetime', 'dict': 'dict', 'float': 'float', 'int': 'int', 'list': 'list', 'str': 'str', 'tuple': 'tuple'}
unary_op = {'+': '+', '-': '-', 'not': 'not ', '~': '~'}
pycropml.transpiler.rules.pythonRules.translateCopy(node)[source]
pycropml.transpiler.rules.pythonRules.translateDictkeys(node)[source]
pycropml.transpiler.rules.pythonRules.translateIntegr(node)[source]
pycropml.transpiler.rules.pythonRules.translateModulo(node)[source]
pycropml.transpiler.rules.pythonRules.translateNotContains(node)[source]
pycropml.transpiler.rules.pythonRules.translatePrint(node)[source]