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