Open mbolotov opened 4 years ago
I think this is related to performance problems in Swift runtime itself. Check issues in ANTLR tool repository or create new if required.
Wait, it's swift3 grammar on java target
@KvanTTT, this is on java target as @studentmain noticed. Why should we create another issue?
Sorry, my fault. I'm reopening.
Also, take a look at our fork with Swift5 grammar. We are working on it and we are going to merge that grammar as soon as possible.
@KvanTTT thanks for pointing to the Swift5 grammar! It works much faster then the original Swfit3 one. I just had to switch from c# back to java support there.
@KvanTTT thanks for pointing to the Swift5 grammar! It works much faster then the original Swfit3 one. I just had to switch from c# back to java support there.
@Mikhail Bolotov @mbolotov Hello,I also doing want to target Java to get Swift ast. But I am not familiar with C#, so can you get me one copy of the two files(SwiftBaseLexer.cs、SwiftBaseParser.cs) in Java version? Thanks!
Swift3 parser takes about 5 seconds to parse file of such content:
For comparison, the java8 parser takes about 25 ms to parse a similar file in java. To reproduce I used the following code:
This test is available here in my fork: https://github.com/mbolotov/grammars-v4/blob/master/swift/swift3/src/test/java/PerformanceTest.java