Back to index

salome-kernel  6.5.0
Classes | Functions | Variables
IDLparser Namespace Reference

Classes

class  Tree
class  parameter
class  dataStreamParameter
class  Service
class  Interface
class  Component
class  Catalog
class  Member
class  Type
class  SeqType
class  StructType
class  ObjType
class  ModuleCatalogVisitor

Functions

def getParamValue
def error
def parseComment
def run

Variables

dictionary common_data
int nb_components = 0
dictionary ttsMap
string CatalogFileName_old = '_old'
 C.Dump()
string CatalogFileName_new = '_new'
tuple f = open(CatalogFileName_new, 'w')

Function Documentation

def IDLparser.error (   message)

Definition at line 69 of file IDLparser.py.

00069 
00070 def error (message):
00071     print "ERROR : ", message
00072 
00073 
00074 #--------------------------------------------------
00075 # base class implementing tree
#--------------------------------------------------

Here is the caller graph for this function:

def IDLparser.getParamValue (   param_name,
  default_value,
  args 
)

Definition at line 53 of file IDLparser.py.

00053 
00054 def getParamValue( param_name, default_value, args ):
00055     pattern="^"+param_name+"="
00056 
00057     res = default_value        #initial value
00058     for opt in args:
00059         s = re.compile(pattern).search(opt)
00060         if s:
00061             res = opt[s.end():]
00062             break     #found
00063 
00064     return res
00065 
00066 
00067 #--------------------------------------------------
00068 # print error message
#--------------------------------------------------

Here is the caller graph for this function:

def IDLparser.parseComment (   comment)

Definition at line 268 of file IDLparser.py.

00268 
00269 def parseComment(comment):
00270 
00271     spaces = '[\t\n ]*'
00272     word = spaces + '([a-zA-Z][a-zA-Z0-9_]*)' + spaces
00273 
00274     result = []
00275     type = None
00276     key = None
00277 
00278     ## match :  // followed by a 'DataStreamPorts' string,
00279     ## the service name, and a list of ports
00280     pattern = '// *DataStreamPorts{,1}' + word
00281     m = re.match(pattern, comment)
00282 
00283     ## if there is a match, parse remaining part of comment
00284     if m:
00285         ## service
00286         type = 'DataStreamPorts'
00287         key = m.group(1)
00288 
00289         sPorts = comment[m.end():]
00290         pattern = word + '\('+word+','+word +','+word+'\)' \
00291                   + spaces + ',{,1}' + spaces
00292         while len(sPorts) > 0:
00293             ## process next DataStreamPort
00294             ## match a definition like xx(a,b,c) with a possible trailing ,
00295             ## returns a tuple (xx, a, b, c) and
00296             ## the remaining part of input string
00297             m = re.match(pattern, sPorts)
00298             if m is None:
00299                 raise LookupError, \
00300                       'format error in DataStreamPort definition : '+sPorts
00301             sPorts = sPorts[m.end():]
00302             result.append(m.groups())
00303 
00304     return type, key, result;
00305 
00306 #--------------------------------------------------
00307 # implements service tree
#--------------------------------------------------

Here is the caller graph for this function:

def IDLparser.run (   tree,
  args 
)

Definition at line 822 of file IDLparser.py.

00822 
00823 def run(tree, args):
00824 
00825     CatalogFileName=getParamValue("catalog", "CatalogModulePersonnel.xml", args)
00826     if re.compile(".*?.xml$").match(CatalogFileName, 1) is None:
00827         CatalogFileName = CatalogFileName + '.xml'
00828 
00829     #=========  Read parameters  ======================
00830     common_data["ICON"]       = getParamValue("icon",       "",                args)
00831     common_data["AUTHOR"]     = getParamValue("author",     os.getenv("USER"), args)
00832     common_data["VERSION"]    = getParamValue("version",    "1",               args)
00833     common_data["COMP_NAME"]  = getParamValue("name",       "",                args)
00834     common_data["COMP_UNAME"] = getParamValue("username",   "",                args)
00835     common_data["COMP_TYPE"]  = getParamValue("type",       "OTHER",           args)
00836     common_data["COMP_MULT"]  = getParamValue("multistudy", "1",               args)
00837     common_data["COMP_IMPL"]  = getParamValue("impltype",   "1",               args)
00838 
00839     print common_data
00840 
00841     remove_comp = getParamValue("remove", "", args)
00842 
00843     #==================================================
00844 
00845     if (os.path.exists(CatalogFileName)):
00846         print "Importing", CatalogFileName
00847         C = Catalog(CatalogFileName)
00848     else:
00849         print "Creating ",CatalogFileName
00850         C = Catalog()
00851 
00852     print "Reading idl file"
00853 
00854     visitor = ModuleCatalogVisitor(C)
00855     tree.accept(visitor)

Here is the call graph for this function:


Variable Documentation

Definition at line 869 of file IDLparser.py.

C.Dump()

Definition at line 863 of file IDLparser.py.

Initial value:
00001 {"AUTHOR"     : "",
00002              "ICON"       : "",
00003              "VERSION"    : "",
00004              "COMP_TYPE"  : "",
00005              "COMP_NAME"  : "",
00006              "COMP_UNAME" : "",
00007              "COMP_MULT"  : "",
00008              "COMP_IMPL"  : ""
00009              }

Definition at line 35 of file IDLparser.py.

tuple IDLparser.f = open(CatalogFileName_new, 'w')

Definition at line 870 of file IDLparser.py.

Definition at line 45 of file IDLparser.py.

dictionary IDLparser.ttsMap
Initial value:
00001 {
00002     idltype.tk_void:       "void",
00003     idltype.tk_short:      "short",
00004     idltype.tk_long:       "long",
00005     idltype.tk_ushort:     "unsigned short",
00006     idltype.tk_ulong:      "unsigned long",
00007     idltype.tk_float:      "float",
00008     idltype.tk_double:     "double",
00009     idltype.tk_boolean:    "boolean",
00010     idltype.tk_char:       "char",
00011     idltype.tk_octet:      "octet",
00012     idltype.tk_any:        "any",
00013     idltype.tk_TypeCode:   "CORBA::TypeCode",
00014     idltype.tk_Principal:  "CORBA::Principal",
00015     idltype.tk_longlong:   "long long",
00016     idltype.tk_ulonglong:  "unsigned long long",
00017     idltype.tk_longdouble: "long double",
00018     idltype.tk_wchar:      "wchar"
00019     }

Definition at line 642 of file IDLparser.py.