Closed binglinchengxiash closed 3 years ago
Hi!
It's unclear to me what do you want from GoParser
and GoParserBase
. Could you provide more details about what do you want to do?
Hi! It's unclear to me what do you want from
GoParser
andGoParserBase
. Could you provide more details about what do you want to do? Sorry for not expressing clearly.I want to train code2vec model using go language,and I use astiner to generate the input data needed by code2vec.I follow up this example to extend go language. I have encountered some problems in step3.Can you give me some detailed descriptions?
If you took go grammar from grammar repository try to take GoParserBase from https://github.com/antlr/grammars-v4/blob/master/golang/Java/GoParserBase.java and place it in the src/main/java/me/vovak/antlr/parser and run task again. Then you can write GoParser that will wrap parser from grammar.
If you took go grammar from grammar repository try to take GoParserBase from https://github.com/antlr/grammars-v4/blob/master/golang/Java/GoParserBase.java and place it in the src/main/java/me/vovak/antlr/parser and run task again. Then you can write GoParser that will wrap parser from grammar.
Thank you very much.I will try later.
If you took go grammar from grammar repository try to take GoParserBase from https://github.com/antlr/grammars-v4/blob/master/golang/Java/GoParserBase.java and place it in the src/main/java/me/vovak/antlr/parser and run task again. Then you can write GoParser that will wrap parser from grammar.
I have implemented GoParser, but I don’t know how to implement GoMethodSpliter, do you know how to do it?GoMethodSpliter is used to generated methods from go source code.
I have implemented GoParser, but I don’t know how to implement GoMethodSpliter, do you know how to do it?GoMethodSpliter is used to generated methods from go source code.
Now you need to split your Tree into subtrees and then create list of Function Info. You can search for examples in parse directory: every combination of parser and language has its own implementation of splitter and function info.
I have implemented GoParser, but I don’t know how to implement GoMethodSpliter, do you know how to do it?GoMethodSpliter is used to generated methods from go source code.
Now you need to split your Tree into subtrees and then create list of Function Info. You can search for examples in parse directory: every combination of parser and language has its own implementation of splitter and function info.
OK,thank you,I will search some examples later.
I met some problems.not find class GoparserBase,I wonder how to write GoparserBase?