|
-
July 28th, 2019, 11:11 AM
#1
How can I use ANTLR generated lexer/parser source code?
Hi. I was convinced to use ANTLR to generate code for lexer and parser for my JSON Java library, however I can google anything and still can't seem to find info on how to use the ANTLR generated source codes. I found tutorials on how to set up ANTLR with JetBrains IDE (which I am using), and how to generate the source codes I need (and how to add them to the sources in project). What I didn't find, is how the actual generated Java source codes should be used. The generated source code files do not contain any JavaDoc, only informs about deprecated methods, nothing else. This isn't much helping. I can find tutorials on how to create own lexer/parser rules (own grammar), but nothing about the actual usage of the generated source code. Not even the ANTLR Mega Tutorial (https://tomassetti.me/antlr-mega-tutorial/) which displays as first in Google search and which is generally pointed to when someone asks about ANTLR. So I have JSON.g4 already downloaded, already used, and I already created the source code files for the lexer and parser, including visitor. But I'm stuck, I don't know how to use it Does anybody here know how to use ANTLR? How to use the generated code? I can't find well explained tutorial. I need something more like an idiotic way explained, because technically I'm still new to programming as whole (not just Java), still learning. I know the language, the types, but I'm still learning on how to work with Java. I can make simple program like "Hello World" or some kind of calculator. But I thought that this isn't actually something to pull of and decided to go with something bigger, like a library. These tutorials treat people like someone who know the language well and know how to work with it as well as they know it. That isn't my case. Like I said, I'd like to find more like an idiotic way of explanation. I found a book, but the thing is that I can't actually buy any book, not even virtual. I need money for my study, which isn't actually programming, it's Electrical Engineering. I am learning programming for a hobby, not a job...
As for the project, all you need can be found on GitHub: https://github.com/Polda18/JavaJSON
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|