@sharwell Terr has said Antlr4 is for smaller language tools, not compilers
Tree rewriting is a hard problem. Not from the basics, but from a long-term maintainability perspective
yeah, i bet
My fork of ANTLR 4 is more suited to compilers for larger languages. One of Terr's primary target audiences is teaching, and for that simplicity and clarity are important. Some of the things I've had to do to make it work well in high-performance environments are brutally complex.
The Boo and Groovy programming languages are both planning to use ANTLR 4 for the front-end of their next major releases.
@sharwell Why do we not have some methods defined in Python runtime's Lexer.py while they are defined in Java runtime's Lexer. So, As Python3 grammar contains java code, I'm having hard time converting it to python code to make it usable for python3 target, because Python runtime's Lexer lacks some methods.
@aptrishu I'm not sure, I don't do any work on the Python target. You'll need to ask this as a specific question on the antlr/antlr4 project.
(Specific meaning include the names of the method(s) you wanted to call)
Thanks, my main concern was why some of the methods were not implemented in Python runtime, like it has missing getCharPositionInLine(). I have asked this on google mailing group and in the issue at projects repo. No response there till now. I'll wait.
filled an issue antlr/antlr4#1746
@thosakwe Which is easier to convert to Dart: TypeScript or Java?
TypeScript is also possible but Java is easier
@pureconfig Regarding antlr/antlr4#1756, in reality it's not unreasonable to not need special handling at all. In my forks the current runtime releases work fine with code generated by/compiled for any release going back to at least 4.2, and maybe even 4.1 (whenever I started restricting source or binary breaking changes in new releases). If going the other way is a concern (code generator newer than runtime), you can using strong naming (.NET), OSGi and/or dependency version restrictions (Java), static linking (C++, Go), or dependency restrictions (npm) to prevent binding against an older version of the runtime than the code targets.
So my strategy is a combination of the following:
Make sure the generated code is correct at compile time by disallowingstrongly discouraging code generation via an IDE extension or command line.
Ship the code generator and runtime library together in matched-version packages. For example, installing the Antlr4 package in a C# project will integrate the 4.5.3 code generator into the build process at the same time it adds a reference to the 4.5.3 runtime library.
Avoid source or binary breaking changes over time to minimize the cost of adopting new releases.
:memo: This strategy is great for enterprise users with large software systems that need to be reliable, but it places most of the burden of compatibility on myself (and that's no small issue). Adopting the same strategy for the main release would be problematic with so many targets and authors involved - I only worry about releasing one target at a time with my forks, and unlike in research/education where Terence is, my users are typically willing to wait when compatibility issues delay releases.
@sharwell i understand
hi there. i've just started using antlr4's cpp target but i'm getting some weird behavior. certain fields of the context in one of my listener's "enter" functions is null but it shouldn't be. it isn't even specified as optional in the grammar.
the parse tree prints just fine when i use toStringTree() though
i.e. the subrule for which the context is null parsed correctly since it appears in the s-exp form of the tree
is parsed correctly*
how do i debug this?
hmm, it seems i forgot what the point of a listener was. enter rules are called on the spot, before any subrules of the rule are processed so it's natural that contexts of those subrules are going to be null
i have to use a visitor for what i want to do :D
I'm struggling with the Xpath feature in antlr cpp. Can someone help me with this ?
It's 15 lines
How can i read Excel file in c++ line by line ?
I've made a grammar in ANTLR4 and I want to know if it is possible to turn the grammar into LL(1). Is it?