def ParseFileWithClearedPPDirective(self): self.PreprocessFileWithClear() # restore from ListOfList to ListOfString self.Profile.FileLinesList = [ "".join(list) for list in self.Profile.FileLinesList ] FileStringContents = '' for fileLine in self.Profile.FileLinesList: FileStringContents += fileLine cStream = antlr3.StringStream(FileStringContents) lexer = CLexer(cStream) tStream = antlr3.CommonTokenStream(lexer) parser = CParser(tStream) parser.translation_unit()
def ParseFile(self): self.PreprocessFile() # restore from ListOfList to ListOfString # print(self.Profile.FileLinesList) self.Profile.FileLinesList = [ "".join(list) for list in self.Profile.FileLinesList ] FileStringContents = '' for fileLine in self.Profile.FileLinesList: FileStringContents += fileLine cStream = antlr4.InputStream(FileStringContents) lexer = CLexer(cStream) tStream = antlr4.CommonTokenStream(lexer) parser = CParser(tStream) parser.translation_unit()