We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am using the swift version of ANTLR4.13.1 to parse the objc code file, and I always encounter a crash. My code structure is as follows:
let queue = OperationQueue() for path in paths { let opt = BlockOperation { guard let input = try? ANTLRFileStream(path) else { return nil } let lexer = ObjectiveCLexer(input) let tokens = CommonTokenStream(lexer) guard let parser = try? ObjectiveCParser(tokens) else { return nil } parser.setErrorHandler(BailErrorStrategy()) guard let unit = try? parser.translationUnit(), unit.exception == nil else { return nil } // soming.... } queue.addOperation(opt) }
Crash stack:
The text was updated successfully, but these errors were encountered:
I use the following code to solve the thread-safety problem and do not know if there is a risk,any help me :)
private class OC_Parsor: ObjectiveCParser { private let _cache = PredictionContextCache() override init(_ input: TokenStream) throws { RuntimeMetaData.checkVersion("4.13.1", RuntimeMetaData.VERSION) try super.init(input) _interp = ParserATNSimulator(self, ObjectiveCParser._ATN, ObjectiveCParser._decisionToDFA, _cache) } }
Sorry, something went wrong.
No branches or pull requests
I am using the swift version of ANTLR4.13.1 to parse the objc code file, and I always encounter a crash. My code structure is as follows:
Crash stack:
The text was updated successfully, but these errors were encountered: