groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guillaume Laforge <glafo...@gmail.com>
Subject Re: making parser modules for antlr2 and antlr4
Date Thu, 27 Oct 2016 07:55:53 GMT
To me, those seem to be private APIs.
The general AST classes are heavily used by AST transforms, etc, so there's
a real use case for them being "public"... but I don't really see when
someone would try to hook into this area of Groovy. Is there a use case
where a user would do that?
If there's indeed not, I think we should consider they are private APIs,
and we'll be able to make the appropriate changes.

On Thu, Oct 27, 2016 at 1:47 AM, Jochen Theodorou <blackdrag@gmx.org> wrote:

>
> and found a new problem... org.codehaus.groovy.syntax.Numbers has a
> parseInteger method which takes an AST class from antlr as first parameter.
> The method is used from the parser and I think it is for the parser mainly.
> Of course the new parser uses this method as well. The purpose is to parse
> things like "109G" and "0x1234".
>
> The reason it has a AST parameter is for error reporting. You can use it
> with a null value, then there will be no error reporting. The reporting is
> done using ASTRuntimeException, which is one of our classes in the antlr
> package. For the parser only the error reporting version is
> interesting...but the new parser does not do that.
>
> First of all...do we see that as public API? Because if not, I can change
> it freely... and I would like to change ASTRuntimeException. instead of
> using the AST I would like to use only line and column as parameters
>
> bye Jochen
>



-- 
Guillaume Laforge
Apache Groovy committer & PMC Vice-President
Developer Advocate @ Google Cloud Platform

Blog: http://glaforge.appspot.com/
Social: @glaforge <http://twitter.com/glaforge> / Google+
<https://plus.google.com/u/0/114130972232398734985/posts>

Mime
View raw message