Closed sdfgsdfgd closed 2 months ago
after generating the grammar sources for python it looks like the Python3LexerBase
is unresolved and there are a few errors in Python3Lexer and Python3Parser
What could be going wrong here....... I'm 1 step away from an awesome solution for AST parsing 3 languages, helpppp
ok I had to manually also import the java base classes additionally, for these targets.
everything is working nao
Hi @sdfgsdfgd . I am happy to hear you get this one solved. If I understand correctly there is nothing to be changed in antlr-kotlin, if not explaining how to use base parsers. Correct?
hi how are you all
I'm trying to use 3 different lexer/parsers for Kotlin, Python and Javascript, via antlr-kotlin runtime.
My purpose is to use Kotlin to be able to parse AST Trees of kotlin/python/JS codes
Kotlin lexer and parser works really nice with
after running the
./gradlew generateKotlinGrammarSource
but with
Python3Lexer
andPython3Parser
, I can't get aCommonTokenStream
withCommonTokenStream(Python3Lexer(CharStreams.fromFileName(path)))
it says
Python3Lexer
doesn't implement aTokenSource
interface. Am I catching a bug or is the python3/python targets not working on antlr-kotlin ?I only included the 2 .g4 files from the antlr-grammars repository for each of these languages ? am I maybe missing a g4 file
This is my build gradle:
These are the python files I got from antlr-grammar /Users/x/Desktop/kotlin/PROJECT/composeApp/src/desktopMain/kotlin/antlr/Python3Lexer.g4 /Users/x/Desktop/kotlin/PROJECT/composeApp/src/desktopMain/kotlin/antlr/Python3Parser.g4
I could find about 2 of these files within the Python directory which should be what I need right ? or do I need some other g4 ?
What could I be doing wrong, this thing is working perfectly with kotlin lexer/parser but not with python or js :/