Exemple #1
0
    def run(self):
        AppData.instance().m_bConvOver = False
        Logger.instance().info("File Conv Start")
        
        Utils.makeDir(Config.instance().m_tmpCodePath)
        Utils.makeDir(Config.instance().m_destCodePath)
        
        Utils.traverseDirs(Config.instance().m_srcCodePath, CodeConv.pInstance.convCpp2CSharp)

        Logger.instance().info("File Conv End")
        AppData.instance().m_bConvOver = True
Exemple #2
0
 def parseCpp(self, filePathName):
     with open(filePathName, 'r', encoding = 'utf8') as fHandle:
         tokenParseData = TokenParseData.TokenParseData('')
         try:
             tokenParseData.m_fileStr = fHandle.read();       # 读取所有的内容
         except Exception as e:
             Utils.logStackInfo()
             Logger.instance().info("{0} 文件解析错误".format(filePathName))
             return
         
             
         Utils.skipSpaceAndBr(tokenParseData)          # 删除左边的空格
         while len(tokenParseData.m_fileStr):
             oneToken = Utils.getToken(tokenParseData)
             if oneToken == "#ifndef":
                 Utils.skipCurLine(tokenParseData)
             elif oneToken == "#define":
                 Utils.skipCurLine(tokenParseData)
             elif oneToken == "#include":
                 Utils.skipCurLine(tokenParseData)
             elif oneToken[0:3] == "/**":
                 self.m_curCppElem = CppMultiComment.CppMultiComment()
                 self.m_pStack.push(self.m_curCppElem)
                 self.m_curCppElem.parseCppElem(tokenParseData)
             elif oneToken[0:2] == "//":
                 Utils.skipCurLine(tokenParseData)
             elif oneToken == "struct":
                 self.m_curCppElem = CppStructItem.CppStructItem()
                 self.m_curCppElem.parseCppElem(tokenParseData)
 
             
             Utils.skipSpaceAndBr(tokenParseData)          # 删除左边的空格
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
Exemple #3
0
 def parseCppElem(self, strParam):
     Utils.skipSpaceAndBr(strParam)          # 删除左边的空格
     pass;
Exemple #4
0
 def parseCppElem(self, strParam):
     super.parseCppElem(strParam)
     while len(strParam):
         oneToken = Utils.getToken(strParam)
         if oneToken[0:2] == "*/":
             break