Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
pureformat
@pureformat
Really impressed by Mike's work on the cpp target. Solved a lot of problems for me :D
Sam Harwell
@sharwell
Why isn't what a focus anymore?
pureformat
@pureformat
@sharwell Terr has said Antlr4 is for smaller language tools, not compilers
Sam Harwell
@sharwell
Tree rewriting is a hard problem. Not from the basics, but from a long-term maintainability perspective
pureformat
@pureformat
yeah, i bet
Sam Harwell
@sharwell
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.
pureformat
@pureformat
@sharwell I didn't know about this fork. Will the cpp target work with it?
or will this be back ported?
Sam Harwell
@sharwell
No, it uses a totally rewritten analysis core. Each target must be created for either this fork or the standard release. I maintain the Java, C#, and TypeScript releases of the optimized fork.
pureformat
@pureformat
hm
I'm surprised how slow antlr4 can get on certain grammars. The profiler says ambiguity, which makes me partly blame the grammar. But I can't change the grammar...
pureformat
@pureformat
but... it's so god damn convenient to use :)
Tobe Osakwe
@thosakwe
I'm in the midst of getting a Dart target out, but it takes so long. 😅 Hopefully within the next few months it will be done
pureformat
@pureformat
dart, haha. Forgot that language even existed.
Tobe Osakwe
@thosakwe
Yeah, it's growing a lot now.
pureformat
@pureformat
never hear about it
maybe you have to be in the angular space to do so
Tobe Osakwe
@thosakwe
Definitely. It's mostly a frontend lang at this point
Pe
People have tried to make server frameworks for it, none so far have been able to bridge the existing gap and make Dart really usable for full-stack
Except mine 😜
Rishav Kumar
@aptrishu
@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.
Sam Harwell
@sharwell
@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)
Rishav Kumar
@aptrishu
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.
Rishav Kumar
@aptrishu
filled an issue antlr/antlr4#1746
Sam Harwell
@sharwell
@thosakwe Which is easier to convert to Dart: TypeScript or Java?
Tobe Osakwe
@thosakwe
Java
@sharwell
TypeScript is also possible but Java is easier
Sam Harwell
@sharwell
@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.
Sam Harwell
@sharwell
So my strategy is a combination of the following:
  1. Make sure the generated code is correct at compile time by disallowing strongly discouraging code generation via an IDE extension or command line.
  2. 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.
  3. 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.
pureformat
@pureformat
@sharwell i understand
antlrnoob
@antlrnoob
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?
antlrnoob
@antlrnoob
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
malickf
@malickf
Hello
I'm struggling with the Xpath feature in antlr cpp. Can someone help me with this ?
Alan
@Alann200
Hey can anybody help me translate a JavaScript to c++?
It's 15 lines
Tobe Osakwe
@thosakwe
No
bÜNYAMİN
@yasarbunyamin20_twitter
Hi
How can i read Excel file in c++ line by line ?