Hi,
+1 to javacc if that works for you use case. Apache Jena ARQ module uses it, in 
case you want to look at an existing project for ideas [1].

Cheers,
Bruno

[1] https://github.com/apache/jena/tree/master/jena-arq/Grammar


    On Saturday, 19 December 2020, 7:48:31 am NZDT, Matt Juntunen 
<matt.juntu...@hotmail.com> wrote:  
 
 Hi Gilles,

It never even occurred to me to look at an existing parser generator. Blah! 
That may have saved a crazy amount of time. I'll take a look at it and see if 
it (or another one) will work for what I want.

I ultimately plan to move all of this code to a top-level maven module but I 
haven't done that yet since it is still very much in flux.

Regards,
Matt

________________________________
From: Gilles Sadowski <gillese...@gmail.com>
Sent: Friday, December 18, 2020 10:50 AM
To: Commons Developers List <dev@commons.apache.org>
Subject: Re: [geometry] Parse error type

Hello Matt.

Le ven. 18 déc. 2020 à 16:16, Matt Juntunen
<matt.juntu...@hotmail.com> a écrit :
>
> Hi all,
>
> I've created a simple text parser

Did you consider leaving that job to a specialized tool[1] ?
Because...

> class [1] as part of writing the 3D file format IO functionality for 
> GEOMETRY-101. One of the primary goals of the class is to provide 
> standardized and informative parse errors that include line and column 
> numbers from the text input.

... that's what they do. ;-)

> (Nothing is worse than attempting to process a file and receiving a 
> completely generic, unhelpful exception message.) That portion is working 
> well. However, I'm wondering what exception type to use for these 
> standardized parse errors. I'm currently using IllegalStateException since 
> you can conceptualize the parser as a state machine. However, I feel like 
> there is probably a better solution.
>
> Any ideas?

Any reason for not reusing an existing tool?
If not, I'd be weary to introduce/maintain such a (usually lengthy) code.

In either case (using an existing library or implementing the parser if there
is indeed a good reason to do it), I'd think that it is a good time to create
a new maven module for hosting this functionality; it is more than a usage
"example", and could become the indispensable complement to the "core"
modules (as IIUC the parser creates the Java objects specific to this
component).

Regards,
Gilles

[1] E.g. https://javacc.github.io/javacc (I'm not using it, I've not tested it).

> [...]

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org
  

Reply via email to