6.1.1.2.1.1.2.4. pycropml.transpiler.antlr_py.extract_metadata module

class pycropml.transpiler.antlr_py.extract_metadata.MetaExtraction[source]

Bases: object

externFunction(tree, algo, type_=False, rec=None)[source]
getAttNode(tree, **attVal)[source]

get the nodes (as a tree) with a specific value of attribute

Parameters:
  • tree (Node) – a tree in which the node will be searched

  • attValue (dict) – the value and the attribute of the node

Returns:

a list of nodes

Return type:

List[Node]

getFromComment(file, c_st_single, c_st_multi, c_end_multi)[source]
getTypeNode(tree, nodetype, change=True)[source]

get nodes of type nodetype

Parameters:
  • tree (Node) – a tree in where the nodes are searched

  • nodetype (str) – the type of the nodes

  • change (bool, optional) – check if it is the same type of node which is searched. Defaults to True.

getmethod(tree, nameMethod, func=False, class_type=None)[source]

This method return a specific method name. It can be used to get the algorithm

Parameters:
  • tree (-) – a tree from where the method will be extracted

  • nameMethod (-) – the name of the method

Returns:

a specific method

Return type:

Node

translist(tree, nodetype)[source]