Version: 9.12.0
pythfilter Namespace Reference

Functions

def output (s, spos, immediate=0)
 Output string s. More...
 
def rec_name_n_param (type, tok)
 Records a name and parameters. More...
 
def start_recording ()
 Starts the recording of a name & param part. More...
 
def is_recording_finished ()
 Test if recording is finished. More...
 
def gather_comment (type, tok, spos)
 Gather comment block. More...
 
def print_comment (spos)
 Output comment block and empty buffer. More...
 
def set_state (s)
 
def get_state ()
 
def push_state (s)
 
def pop_state ()
 
def tok_eater (type, tok, spos, epos, line)
 
def dump (filename)
 
def filter (filename)
 
def filterFile (filename, out=sys.stdout)
 
def preparePath (path)
 
def isNewer (file1, file2)
 
def convert (srcpath, destpath)
 

Variables

int OUTSIDE = 0
 
int BUILD_COMMENT = 1
 
int BUILD_CLASS_DECL = 2
 
int BUILD_CLASS_BODY = 3
 
int BUILD_DEF_DECL = 4
 
int BUILD_DEF_BODY = 5
 
int IMPORT = 6
 
int IMPORT_OP = 7
 
int IMPORT_APPEND = 8
 
 outfile = sys.stdout
 
list outbuffer = []
 
int out_row = 0
 
int out_col = 0
 
string name = ""
 
string param = ""
 
string doc_string = ""
 
int record_state = 0
 
int bracket_counter = 0
 
tuple class_spos = (0,0)
 
tuple def_spos = (0,0)
 
tuple import_spos = (0,0)
 
string import_token = ""
 
list comment_block = []
 
int comment_finished = 0
 
list modules = []
 
list stateStack = [OUTSIDE]
 
bool module_has_docstring = False
 
string protection_level = "public"
 
bool private_member = False
 
string namespace = ""
 
bool filter_file = False
 
 opts
 
 args
 
 filename = string.join(args)
 
def c = convert(args[0],args[1])
 

Function Documentation

◆ convert()

def pythfilter.convert (   srcpath,
  destpath 
)
Convert a Python source tree into a C+ stub tree.

All *.py files in srcpath (including sub-directories) are filtered
and written to destpath. If destpath exists, only the files
that have been modified are filtered again. Files that were deleted
from srcpath are also deleted in destpath if they are still present.
The function returns the number of processed *.py files.

References filterFile(), isNewer(), and preparePath().

◆ dump()

◆ filter()

def pythfilter.filter (   filename)

References output(), and print_comment().

Referenced by filterFile().

◆ filterFile()

def pythfilter.filterFile (   filename,
  out = sys.stdout 
)

References dump(), and filter().

Referenced by convert().

◆ gather_comment()

def pythfilter.gather_comment (   type,
  tok,
  spos 
)

Gather comment block.

References print_comment().

Referenced by tok_eater().

◆ get_state()

def pythfilter.get_state ( )

Referenced by tok_eater().

◆ is_recording_finished()

def pythfilter.is_recording_finished ( )

Test if recording is finished.

Referenced by tok_eater().

◆ isNewer()

def pythfilter.isNewer (   file1,
  file2 
)
Check if file1 is newer than file2.

file1 must be an existing file.

Referenced by convert().

◆ output()

def pythfilter.output (   s,
  spos,
  immediate = 0 
)

Output string s.

'
' may only be at the end of the string (not somewhere in the middle).

In: s - String spos - Startpos

Referenced by filter(), print_comment(), and tok_eater().

◆ pop_state()

def pythfilter.pop_state ( )

Referenced by tok_eater().

◆ preparePath()

def pythfilter.preparePath (   path)
Prepare a path.

Checks if the path exists and creates it if it does not exist.

Referenced by convert().

◆ print_comment()

def pythfilter.print_comment (   spos)

Output comment block and empty buffer.

References output().

Referenced by filter(), gather_comment(), and tok_eater().

◆ push_state()

def pythfilter.push_state (   s)

Referenced by tok_eater().

◆ rec_name_n_param()

def pythfilter.rec_name_n_param (   type,
  tok 
)

Records a name and parameters.

The name is either a class name or a function name. Then the parameter is either the base class or the function parameters. The name is stored in the global variable "name", the parameters in "param". The variable "record_state" holds the current state of this internal state machine. The recording is started by calling start_recording().

In: type, tok

Referenced by tok_eater().

◆ set_state()

def pythfilter.set_state (   s)

Referenced by tok_eater().

◆ start_recording()

def pythfilter.start_recording ( )

Starts the recording of a name & param part.

The function rec_name_n_param() has to be fed with tokens. After the necessary tokens are fed the name and parameters can be found in the global variables "name" und "param".

Referenced by tok_eater().

◆ tok_eater()

def pythfilter.tok_eater (   type,
  tok,
  spos,
  epos,
  line 
)

Variable Documentation

◆ args

◆ bracket_counter

int pythfilter.bracket_counter = 0

◆ BUILD_CLASS_BODY

int pythfilter.BUILD_CLASS_BODY = 3

◆ BUILD_CLASS_DECL

int pythfilter.BUILD_CLASS_DECL = 2

◆ BUILD_COMMENT

int pythfilter.BUILD_COMMENT = 1

◆ BUILD_DEF_BODY

int pythfilter.BUILD_DEF_BODY = 5

◆ BUILD_DEF_DECL

int pythfilter.BUILD_DEF_DECL = 4

◆ c

◆ class_spos

tuple pythfilter.class_spos = (0,0)

◆ comment_block

list pythfilter.comment_block = []

◆ comment_finished

int pythfilter.comment_finished = 0

◆ def_spos

tuple pythfilter.def_spos = (0,0)

◆ doc_string

string pythfilter.doc_string = ""

◆ filename

pythfilter.filename = string.join(args)

◆ filter_file

bool pythfilter.filter_file = False

◆ IMPORT

int pythfilter.IMPORT = 6

◆ IMPORT_APPEND

int pythfilter.IMPORT_APPEND = 8

◆ IMPORT_OP

int pythfilter.IMPORT_OP = 7

◆ import_spos

tuple pythfilter.import_spos = (0,0)

◆ import_token

string pythfilter.import_token = ""

◆ module_has_docstring

bool pythfilter.module_has_docstring = False

◆ modules

list pythfilter.modules = []

◆ name

string pythfilter.name = ""

Referenced by SALOME_NamingService._Find(), SALOME_ModuleCatalogImpl::Private._parse_xml_file(), GENERIC_DESTRUCTOR.Add(), Launcher::XML_Persistence.addAttr(), Kernel_Utils.AddExtension(), Launcher::XML_Persistence.addNode(), Launcher::XML_Persistence.addNumericalNode(), Launcher::Job.addSpecificParameter(), BuildTree(), HDFascii.ConvertFromHDFToASCII(), create_calcium_port(), create_multiple_calcium_port(), CreateAttributeFromASCII(), CreateDatasetFromASCII(), CreateGroupFromASCII(), ResourcesManager_cpp.DeleteResourceInCatalog(), DESTRUCTOR_OF< TYPE >.DESTRUCTOR_OF(), DumpStudy(), ecp_cd_(), CalciumInterface.ecp_ecriture(), CalciumInterface.ecp_fin(), CalciumInterface.ecp_lecture(), HDFfile.ExistInternalObject(), HDFgroup.ExistInternalObject(), SALOME_NamingService.Find(), SALOMEDSImpl_Study.FindComponent(), SALOME_ModuleCatalogImpl::Private.findComponent(), HDFgroup.GetAllObjects(), SALOME_ModuleCatalogImpl.GetComponent(), SALOME_ModuleCatalogImpl.GetComponentInfo(), SALOME_ContainerManager.GetenvThreadSafe(), SALOME_ContainerManager.GetenvThreadSafeAsString(), SALOME_StudyEditor.getParameterBool(), SALOME_StudyEditor.getParameterInt(), SALOMEDS_IParameters.getProperty(), SALOMEDSImpl_IParameters.getProperty(), SALOME_ResourcesManager.GetResourceDefinition(), SALOME_ResourcesManager_Client.GetResourceDefinition(), ResourcesManager_cpp.GetResourcesDescr(), HDFattrCreate(), HDFattrOpen(), HDFdatasetCreate(), HDFdatasetOpen(), HDFfileCreate(), HDFfileMount(), HDFfileOpen(), HDFfileUmount(), HDFgroupCreate(), HDFgroupOpen(), HDFobject.HDFobject(), HDFobjectIdentify(), HDFobjectType(), HouseKeeping(), SALOME_Trace.Initialize(), SALOMESDS::DataScopeServerBase.listVars(), Salome_file_i.load(), SALOME_LifeCycleCORBA.Load_ParallelComponent(), main(), makeName(), SALOMEDS_SObject_i.Name(), SALOMEDSImpl_Study.Name(), NOTIFICATION_channel(), Num(), Launcher::XML_Persistence.parseUserNode(), SALOME_ResourcesCatalog_Handler.ProcessCluster(), SALOME_ResourcesCatalog_Handler.ProcessMachine(), SALOME_Launcher_Handler.ProcessXmlDocument(), SALOME_ModuleCatalog_Handler.ProcessXmlDocument(), RankInfo(), SALOME_NamingService.ResolveComponent(), SALOME_NamingService.ResolveFirst(), restoreName(), SaveAttributeInASCIIfile(), SaveDatasetInASCIIfile(), SaveGroupInASCIIfile(), SALOMEDS_SObject_i.SetAttrString(), SALOMEDSImpl_SObject.SetAttrString(), SALOMEDS_SObject.SetAttrString(), Engines_Component_i.setContainerName(), SALOME_StudyEditor.setParameterBool(), SALOME_StudyEditor.setParameterInt(), SALOMEDS_IParameters.setProperty(), SALOMEDSImpl_IParameters.setProperty(), SALOME_LifeCycleCORBA.shutdownServers(), Test(), NamingServiceTest.testCreateDirectory(), NamingServiceTest.testResolveFirst(), NamingServiceTest.testResolveFirstRelative(), NamingServiceTest.testResolveFirstUnknown(), NamingServiceTest.testResolveFirstUnknownRelative(), and TraceCollector_WaitForServerReadiness().

◆ namespace

string pythfilter.namespace = ""

◆ opts

pythfilter.opts

◆ out_col

int pythfilter.out_col = 0

◆ out_row

int pythfilter.out_row = 0

◆ outbuffer

list pythfilter.outbuffer = []

◆ outfile

pythfilter.outfile = sys.stdout

◆ OUTSIDE

int pythfilter.OUTSIDE = 0

◆ param

string pythfilter.param = ""

◆ private_member

bool pythfilter.private_member = False

◆ protection_level

string pythfilter.protection_level = "public"

◆ record_state

int pythfilter.record_state = 0

◆ stateStack

list pythfilter.stateStack = [OUTSIDE]