comp.lang.ada
 help / color / mirror / Atom feed
* ANTLR grammar for Ada available
@ 2003-03-02 19:28 Oliver Kellogg
  2003-03-03 10:35 ` Oliver Kellogg
                   ` (2 more replies)
  0 siblings, 3 replies; 26+ messages in thread
From: Oliver Kellogg @ 2003-03-02 19:28 UTC (permalink / raw)


This is to announce the availability of a first version of an
Ada grammar for the ANTLR language recognizer.

The grammar is at http://www.antlr.org/resources/ada .

Currently the main program is just a syntax checker for
Ada. The Abstract Syntax Tree (AST) construction is
still under development. Anybody wishing to contribute
in this area, feel free to contact me.

Oliver M. Kellogg
-- okellogg at users dot sourceforge dot net






^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ANTLR grammar for Ada available
  2003-03-02 19:28 ANTLR grammar for Ada available Oliver Kellogg
@ 2003-03-03 10:35 ` Oliver Kellogg
  2003-03-23 22:21 ` Oliver Kellogg
  2018-12-28  9:32 ` olivermkellogg
  2 siblings, 0 replies; 26+ messages in thread
From: Oliver Kellogg @ 2003-03-03 10:35 UTC (permalink / raw)


Oops, the URL should be

http://www.antlr.org/grammars/ada/

Apologies for any inconvenience.

> This is to announce the availability of a first version of an
> Ada grammar for the ANTLR language recognizer.
>



^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ANTLR grammar for Ada available
  2003-03-02 19:28 ANTLR grammar for Ada available Oliver Kellogg
  2003-03-03 10:35 ` Oliver Kellogg
@ 2003-03-23 22:21 ` Oliver Kellogg
  2003-03-24  1:32   ` John R. Strohm
  2018-12-28  9:32 ` olivermkellogg
  2 siblings, 1 reply; 26+ messages in thread
From: Oliver Kellogg @ 2003-03-23 22:21 UTC (permalink / raw)


The grammar has been updated to support AST (Abstract Syntax Tree)
construction.

O. Kellogg

[...] wrote in message news:<b3tlui$vl3$07$1@news.t-online.com>...
> This is to announce the availability of a first version of an
> Ada grammar for the ANTLR language recognizer.
> 
> The grammar is at http://www.antlr.org/resources/ada .
> 
> Currently the main program is just a syntax checker for
> Ada. The Abstract Syntax Tree (AST) construction is
> still under development. Anybody wishing to contribute
> in this area, feel free to contact me.
> 
> Oliver M. Kellogg
> -- okellogg at users dot sourceforge dot net



^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ANTLR grammar for Ada available
  2003-03-23 22:21 ` Oliver Kellogg
@ 2003-03-24  1:32   ` John R. Strohm
  0 siblings, 0 replies; 26+ messages in thread
From: John R. Strohm @ 2003-03-24  1:32 UTC (permalink / raw)


The URL is http://www.antlr.org/grammars/ada.  Not what you said.

"Oliver Kellogg" <okellogg@freenet.de> wrote in message
news:6a6390b8.0303231421.3a7ba6eb@posting.google.com...
> The grammar has been updated to support AST (Abstract Syntax Tree)
> construction.
>
> O. Kellogg
>
> [...] wrote in message news:<b3tlui$vl3$07$1@news.t-online.com>...
> > This is to announce the availability of a first version of an
> > Ada grammar for the ANTLR language recognizer.
> >
> > The grammar is at http://www.antlr.org/resources/ada .
> >
> > Currently the main program is just a syntax checker for
> > Ada. The Abstract Syntax Tree (AST) construction is
> > still under development. Anybody wishing to contribute
> > in this area, feel free to contact me.
> >
> > Oliver M. Kellogg
> > -- okellogg at users dot sourceforge dot net





^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ANTLR grammar for Ada available
  2003-03-02 19:28 ANTLR grammar for Ada available Oliver Kellogg
  2003-03-03 10:35 ` Oliver Kellogg
  2003-03-23 22:21 ` Oliver Kellogg
@ 2018-12-28  9:32 ` olivermkellogg
  2018-12-28 13:38   ` Vincent DIEMUNSCH
  2019-01-01 19:30   ` Stephen Leake
  2 siblings, 2 replies; 26+ messages in thread
From: olivermkellogg @ 2018-12-28  9:32 UTC (permalink / raw)


Since ANTLR version 2 is very outdated and the links to v2 grammars are mostly dead, I have resurrected the project on GitHub:

https://github.com/okellogg/ada_antlr_grammar

I plan to update the grammar to Ada 202x and ANTLR version 3.
(Going to ANTLR v4 straight away looks too earth shaking).

- Oliver


On Sunday, March 2, 2003 at 8:28:16 PM UTC+1, Oliver Kellogg wrote:
> This is to announce the availability of a first version of an
> Ada grammar for the ANTLR language recognizer.
> 
> The grammar is at http://www.antlr.org/ [...]
> 
> Currently the main program is just a syntax checker for
> Ada. The Abstract Syntax Tree (AST) construction is
> still under development. Anybody wishing to contribute
> in this area, feel free to contact me.
> 
> Oliver M. Kellogg
> -- okellogg at users dot sourceforge dot net

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ANTLR grammar for Ada available
  2018-12-28  9:32 ` olivermkellogg
@ 2018-12-28 13:38   ` Vincent DIEMUNSCH
  2018-12-28 14:50     ` olivermkellogg
  2018-12-31  5:38     ` alby.gamper
  2019-01-01 19:30   ` Stephen Leake
  1 sibling, 2 replies; 26+ messages in thread
From: Vincent DIEMUNSCH @ 2018-12-28 13:38 UTC (permalink / raw)


Le vendredi 28 décembre 2018 10:32:49 UTC+1, oliverm...@gmail.com a écrit :
> Since ANTLR version 2 is very outdated and the links to v2 grammars are mostly dead, I have resurrected the project on GitHub:
> 
> https://github.com/okellogg/ada_antlr_grammar
> 
> I plan to update the grammar to Ada 202x and ANTLR version 3.
> (Going to ANTLR v4 straight away looks too earth shaking).
> 
> - Oliver

Great Idea Oliver ! 

ANTLR v3 is, in my opinion, the way to go, since ANTLR v4 is unduly complex for a regular language like Ada.

But the target language of the ANTLR generator in the GitHub repository is C++... Why not generate an AST for Ada in Ada ? Many Ada compilers are written in Ada, in fact.

Kind regards,

Vincent


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ANTLR grammar for Ada available
  2018-12-28 13:38   ` Vincent DIEMUNSCH
@ 2018-12-28 14:50     ` olivermkellogg
  2018-12-31  5:38     ` alby.gamper
  1 sibling, 0 replies; 26+ messages in thread
From: olivermkellogg @ 2018-12-28 14:50 UTC (permalink / raw)


On Friday, December 28, 2018 at 2:38:33 PM UTC+1, Vincent DIEMUNSCH wrote:
> [...]
> But the target language of the ANTLR generator in the GitHub repository is
> C++... Why not generate an AST for Ada in Ada ? Many Ada compilers are
> written in Ada, in fact.

Good point.
I might add support for target_java at a later date once the basic updates for Ada202x are done.
About target_ada, I'd first have to look at what shape the ANTLR Ada support is in.
That would be one too many "construction sites" for me right now :)

- Oliver


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ANTLR grammar for Ada available
  2018-12-28 13:38   ` Vincent DIEMUNSCH
  2018-12-28 14:50     ` olivermkellogg
@ 2018-12-31  5:38     ` alby.gamper
  2018-12-31  7:02       ` alby.gamper
  2018-12-31 12:32       ` Vincent DIEMUNSCH
  1 sibling, 2 replies; 26+ messages in thread
From: alby.gamper @ 2018-12-31  5:38 UTC (permalink / raw)


On Saturday, December 29, 2018 at 12:38:33 AM UTC+11, Vincent DIEMUNSCH wrote:
> Le vendredi 28 décembre 2018 10:32:49 UTC+1, oliverm...@gmail.com a écrit :
> > Since ANTLR version 2 is very outdated and the links to v2 grammars are mostly dead, I have resurrected the project on GitHub:
> > 
> > https://github.com/okellogg/ada_antlr_grammar
> > 
> > I plan to update the grammar to Ada 202x and ANTLR version 3.
> > (Going to ANTLR v4 straight away looks too earth shaking).
> > 
> > - Oliver
> 
> Great Idea Oliver ! 
> 
> ANTLR v3 is, in my opinion, the way to go, since ANTLR v4 is unduly complex for a regular language like Ada.
> 
> But the target language of the ANTLR generator in the GitHub repository is C++... Why not generate an AST for Ada in Ada ? Many Ada compilers are written in Ada, in fact.
> 
> Kind regards,
> 
> Vincent

Hi Vincent

I would be very interested in your reasoning in saying that ANTLR v4 is more
complex than V3. In my experience v4 capabilities in auto generating a AST and
being able to visit/listen to specific nodes in the AST far surpasses the V3
capabilities and make it easier to parse Ada Syntactically at a rudimentary level.
Note I am in no way a ANTLR/Ada expert in this area, but I have used ANTLR v4
with my ADA 2012 grammar and used it in "VisualAda" to implement Intellisense
outlining and other intelisense features (albeit very limited at the moment).

Feature wise, I believe a well constructed ANTLR v4 grammar is on par with
libadalang (BUT NOT performant with libadalang ?)

Alex

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ANTLR grammar for Ada available
  2018-12-31  5:38     ` alby.gamper
@ 2018-12-31  7:02       ` alby.gamper
  2018-12-31  8:08         ` Paul Rubin
  2019-01-01  4:29         ` Shark8
  2018-12-31 12:32       ` Vincent DIEMUNSCH
  1 sibling, 2 replies; 26+ messages in thread
From: alby.gamper @ 2018-12-31  7:02 UTC (permalink / raw)



Hi

Would anyone be interested in the ANTLR v4 grammar for Ada 2012, and a sample C#
sample / driver application to demonstrate the visitor/listener features of v4 ?

I can post this up on GitHub if their is enough interest !

I appreciate an Ada runtime/sample would be far more appropriate, but given that
an Ada runtime for v4 does not yet exist, its the best I can do at the moment.

Alex


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ANTLR grammar for Ada available
  2018-12-31  7:02       ` alby.gamper
@ 2018-12-31  8:08         ` Paul Rubin
  2018-12-31 10:08           ` alby.gamper
  2019-01-01  4:29         ` Shark8
  1 sibling, 1 reply; 26+ messages in thread
From: Paul Rubin @ 2018-12-31  8:08 UTC (permalink / raw)


alby.gamper@gmail.com writes:
> Would anyone be interested in the ANTLR v4 grammar for Ada 2012, and a
> sample C# sample / driver application to demonstrate the
> visitor/listener features of v4 ?

Sure!  I'm more interested in the grammar itself than the C# wrapper.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ANTLR grammar for Ada available
  2018-12-31  8:08         ` Paul Rubin
@ 2018-12-31 10:08           ` alby.gamper
  2018-12-31 10:22             ` Paul Rubin
  2019-01-01 22:20             ` olivermkellogg
  0 siblings, 2 replies; 26+ messages in thread
From: alby.gamper @ 2018-12-31 10:08 UTC (permalink / raw)


On Monday, December 31, 2018 at 7:08:16 PM UTC+11, Paul Rubin wrote:
> alby.gamper@gmail.com writes:
> > Would anyone be interested in the ANTLR v4 grammar for Ada 2012, and a
> > sample C# sample / driver application to demonstrate the
> > visitor/listener features of v4 ?
> 
> Sure!  I'm more interested in the grammar itself than the C# wrapper.

Hi Paul

Thanks for the feedback!, Let me wait for some further feedback from the
Ada community, so I can ascertain the extent of the interest in this piece
of work.

My reasoning in this is!, the grammar is NOT 100% perfect, BUT I would like
it to become so, and with input from MORE experienced language / grammar experts
than myself, we can all contribute to make it a robust library than can be
used by everyone with confidence.

Note that I don't believe this as a competing library to the great work that
AdaCore have done with "libadalang", But an alternative to those use cases
where the client application CANNOT easily be written in Ada (such as an
Microsoft Visual Studio Plugin/Extension)

Alex


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ANTLR grammar for Ada available
  2018-12-31 10:08           ` alby.gamper
@ 2018-12-31 10:22             ` Paul Rubin
  2018-12-31 10:42               ` alby.gamper
  2019-01-01 22:20             ` olivermkellogg
  1 sibling, 1 reply; 26+ messages in thread
From: Paul Rubin @ 2018-12-31 10:22 UTC (permalink / raw)


alby.gamper@gmail.com writes:
> Thanks for the feedback!, Let me wait for some further feedback from
> the Ada community, so I can ascertain the extent of the interest in
> this piece of work.

No problem.

> Note that I don't believe this as a competing library to the great work that
> AdaCore have done with "libadalang",

Libadalang also looks interesting!  I didn't know about it before.

> But an alternative to those use cases where the client application
> CANNOT easily be written in Ada (such as an Microsoft Visual Studio
> Plugin/Extension)

You can also use libadalang from C or Python, apparently.  I don't know
if that helps with Visual Studio.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ANTLR grammar for Ada available
  2018-12-31 10:22             ` Paul Rubin
@ 2018-12-31 10:42               ` alby.gamper
  0 siblings, 0 replies; 26+ messages in thread
From: alby.gamper @ 2018-12-31 10:42 UTC (permalink / raw)


On Monday, December 31, 2018 at 9:22:35 PM UTC+11, Paul Rubin wrote:
> alby.gamper@gmail.com writes:
> > Thanks for the feedback!, Let me wait for some further feedback from
> > the Ada community, so I can ascertain the extent of the interest in
> > this piece of work.
> 
> No problem.
> 
> > Note that I don't believe this as a competing library to the great work that
> > AdaCore have done with "libadalang",
> 
> Libadalang also looks interesting!  I didn't know about it before.
> 
> > But an alternative to those use cases where the client application
> > CANNOT easily be written in Ada (such as an Microsoft Visual Studio
> > Plugin/Extension)
> 
> You can also use libadalang from C or Python, apparently.  I don't know
> if that helps with Visual Studio.

Hi Paul

Yes "libadalang" can of course be used from C/C++ but this requires a small
C++/CLI wrapper library WHEN used from a Visual Studio plugin/extension.

I am in the process of testing/setting this up as we speak, and hope to be
able to confirm that this all works as the MS documentation says id should :-)

Alex

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ANTLR grammar for Ada available
  2018-12-31  5:38     ` alby.gamper
  2018-12-31  7:02       ` alby.gamper
@ 2018-12-31 12:32       ` Vincent DIEMUNSCH
  2018-12-31 17:05         ` olivermkellogg
  1 sibling, 1 reply; 26+ messages in thread
From: Vincent DIEMUNSCH @ 2018-12-31 12:32 UTC (permalink / raw)


Le lundi 31 décembre 2018 06:38:20 UTC+1, alby....@gmail.com a écrit :
> Hi Vincent
> 
> I would be very interested in your reasoning in saying that ANTLR v4 is more
> complex than V3. In my experience v4 capabilities in auto generating a AST and
> being able to visit/listen to specific nodes in the AST far surpasses the V3
> capabilities and make it easier to parse Ada Syntactically at a rudimentary level.

Hi Alex,

You are certainly right about the quality of the generated AST, superior in V4. My point was simply that, from a pure parser perspective, the ability of backtracking and memorizing previous attempts, as it is done in V4, although more powerful, is not necessary for parsing the Ada language. Hence it seemed to me perfectly reasonable to stay in V3 for Ada, if the runtime support already exists.

But if the advantage of a better AST is really big, then developing an Ada runtime for ANTLR V4 may be the best choice :-).

Regards,

Vincent

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ANTLR grammar for Ada available
  2018-12-31 12:32       ` Vincent DIEMUNSCH
@ 2018-12-31 17:05         ` olivermkellogg
  2018-12-31 17:31           ` Lucretia
  0 siblings, 1 reply; 26+ messages in thread
From: olivermkellogg @ 2018-12-31 17:05 UTC (permalink / raw)


On Monday, December 31, 2018 at 1:32:50 PM UTC+1, Vincent DIEMUNSCH wrote:
> [...]
> Hi Alex,
> 
> You are certainly right about the quality of the generated AST, superior in
> V4. My point was simply that, from a pure parser perspective, the ability
> of backtracking and memorizing previous attempts, as it is done in V4,
> although more powerful, is not necessary for parsing the Ada language.
> Hence it seemed to me perfectly reasonable to stay in V3 for Ada, if the
> runtime support already exists.

I agree and would add that I actually prefer working with the less sophisticated V2/V3 technology because it elicits weaknesses in the RM Annex P grammar which might go unnoticed using the more powerful V4 technology.
See my posting "Ada grammar rules for names too permissive" [1].

- Oliver

[1] https://groups.google.com/forum/#!topic/comp.lang.ada/U5e7j_b0Yzs


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ANTLR grammar for Ada available
  2018-12-31 17:05         ` olivermkellogg
@ 2018-12-31 17:31           ` Lucretia
  0 siblings, 0 replies; 26+ messages in thread
From: Lucretia @ 2018-12-31 17:31 UTC (permalink / raw)


On Monday, 31 December 2018 17:05:18 UTC, oliverm...@gmail.com  wrote:

> I agree and would add that I actually prefer working with the less sophisticated V2/V3 technology because it elicits weaknesses in the RM Annex P grammar which might go unnoticed using the more powerful V4 technology.
> See my posting "Ada grammar rules for names too permissive" [1].

The problem with the grammar in appendix P is that it's defined badly, i've commented before that they couldn't even be bothered to place the pragma non-terminals in the correct place, so you have to guess based on really annoyingly worded paragraphs and hope they're right.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ANTLR grammar for Ada available
  2018-12-31  7:02       ` alby.gamper
  2018-12-31  8:08         ` Paul Rubin
@ 2019-01-01  4:29         ` Shark8
  2019-01-01  6:58           ` Lucretia
  1 sibling, 1 reply; 26+ messages in thread
From: Shark8 @ 2019-01-01  4:29 UTC (permalink / raw)


On Monday, December 31, 2018 at 12:02:11 AM UTC-7, alby....@gmail.com wrote:
> Would anyone be interested in the ANTLR v4 grammar for Ada 2012, and a sample C# sample / driver application to demonstrate the visitor/listener features of v4?
Yes; though I do question a bit of the utility of C# sample/drivers here -- if you've got ANTLR popping out a DOTNET frontend, wouldn't it be easier to tie-in to the DOTNET backend?

Or am I misunderstanding the set-up here?

> 
> I can post this up on GitHub if their is enough interest!
That would be cool.

> 
> I appreciate an Ada runtime/sample would be far more appropriate, but given that an Ada runtime for v4 does not yet exist, its the best I can do at the moment.
I was thinking about this a few years ago; in the context of a multilanguage environment/compiler -- In that sense, I was thinking a sort of "language/IR for [language] runtimes" where the language's runtime is described therein and 'linked' with the source from the various languages that are then fed to the backend.


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ANTLR grammar for Ada available
  2019-01-01  4:29         ` Shark8
@ 2019-01-01  6:58           ` Lucretia
  2019-01-02  8:13             ` alby.gamper
  0 siblings, 1 reply; 26+ messages in thread
From: Lucretia @ 2019-01-01  6:58 UTC (permalink / raw)


On Tuesday, 1 January 2019 04:29:26 UTC, Shark8  wrote:
> On Monday, December 31, 2018 at 12:02:11 AM UTC-7, alby....@gmail.com wrote:
> > Would anyone be interested in the ANTLR v4 grammar for Ada 2012, and a sample C# sample / driver application to demonstrate the visitor/listener features of v4?
> Yes; though I do question a bit of the utility of C# sample/drivers here -- if you've got ANTLR popping out a DOTNET frontend, wouldn't it be easier to tie-in to the DOTNET backend?

It's obvious he means a C# generated parser using this ANTLRv4 grammar.

Personally, I don't get why people "ask" "if there is interest" before they release something, just release it. There's obviously interest, just don't slap it under a GPL license, that would dick-ish.


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ANTLR grammar for Ada available
  2018-12-28  9:32 ` olivermkellogg
  2018-12-28 13:38   ` Vincent DIEMUNSCH
@ 2019-01-01 19:30   ` Stephen Leake
  1 sibling, 0 replies; 26+ messages in thread
From: Stephen Leake @ 2019-01-01 19:30 UTC (permalink / raw)


On Friday, December 28, 2018 at 1:32:49 AM UTC-8, oliverm...@gmail.com wrote:
> Since ANTLR version 2 is very outdated and the links to v2 grammars are mostly dead, I have resurrected the project on GitHub:
> 
> https://github.com/okellogg/ada_antlr_grammar 

On the topic of Ada parsers, I recently released WisiToken (http://stephe-leake.org/ada/wisitoken.html), which is a parser generator for generalized LR parsers with error correction. An Ada grammar for it is in the Emacs Ada mode package http://www.nongnu.org/ada-mode/. 

WisiToken is specifically designed to handle the syntax typically encountered IDE indentation. It would be interesting to compare its error-handling ability to ANTLR; I could not find much about ANTLR error handling on the web.

WisiToken parsers generate an AST, and provides simple AST traversal; I'd be interested in what additional features people would like in that area.

WisiToken grammar files are currently BNF with some declarations; I'm working on adding support for EBNF features like repeating and optional tokens (by translating them to BNF), with the goal of being able to read the published Java and Python grammars.


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ANTLR grammar for Ada available
  2018-12-31 10:08           ` alby.gamper
  2018-12-31 10:22             ` Paul Rubin
@ 2019-01-01 22:20             ` olivermkellogg
  2019-01-02  8:07               ` alby.gamper
  2019-01-03 10:55               ` alby.gamper
  1 sibling, 2 replies; 26+ messages in thread
From: olivermkellogg @ 2019-01-01 22:20 UTC (permalink / raw)


On Monday, December 31, 2018 at 11:08:52 AM UTC+1, alby....@gmail.com wrote:
> [...]
> Thanks for the feedback!, Let me wait for some further feedback from the
> Ada community, so I can ascertain the extent of the interest in this piece
> of work.

Sure, I'd be interested too, to compare with
https://github.com/okellogg/ada_antlr_grammar/blob/master/antlr4/ada.g4

On this grammar, I am getting the following message from org.antlr.v4.Tool :

> error(119): ada.g4::: The following sets of rules are mutually
                        left-recursive
> [name, explicit_dereference, prefix, implicit_dereference,
> subtype_mark, function_call, generalized_reference, type_conversion,
> qualified_expression, indexed_component, slice, selected_component,
> attribute_reference, generalized_indexing]

Have you encountered a similar problem in your version?

- Oliver

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ANTLR grammar for Ada available
  2019-01-01 22:20             ` olivermkellogg
@ 2019-01-02  8:07               ` alby.gamper
  2019-01-02  8:32                 ` alby.gamper
  2019-01-03 10:55               ` alby.gamper
  1 sibling, 1 reply; 26+ messages in thread
From: alby.gamper @ 2019-01-02  8:07 UTC (permalink / raw)


On Wednesday, January 2, 2019 at 9:20:22 AM UTC+11, oliverm...@gmail.com wrote:
> On Monday, December 31, 2018 at 11:08:52 AM UTC+1, alby....@gmail.com wrote:
> > [...]
> > Thanks for the feedback!, Let me wait for some further feedback from the
> > Ada community, so I can ascertain the extent of the interest in this piece
> > of work.
> 
> Sure, I'd be interested too, to compare with
> https://github.com/okellogg/ada_antlr_grammar/blob/master/antlr4/ada.g4
> 
> On this grammar, I am getting the following message from org.antlr.v4.Tool :
> 
> > error(119): ada.g4::: The following sets of rules are mutually
>                         left-recursive
> > [name, explicit_dereference, prefix, implicit_dereference,
> > subtype_mark, function_call, generalized_reference, type_conversion,
> > qualified_expression, indexed_component, slice, selected_component,
> > attribute_reference, generalized_indexing]
> 
> Have you encountered a similar problem in your version?
> 
> - Oliver

Hi Oliver

My version of the grammar was done a couple of years ago, So I don't recall this
specific error as such, I do recall issues with the "name" terminals (ie section
4.1)

Alex


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ANTLR grammar for Ada available
  2019-01-01  6:58           ` Lucretia
@ 2019-01-02  8:13             ` alby.gamper
  0 siblings, 0 replies; 26+ messages in thread
From: alby.gamper @ 2019-01-02  8:13 UTC (permalink / raw)


On Tuesday, January 1, 2019 at 5:58:58 PM UTC+11, Lucretia wrote:
> On Tuesday, 1 January 2019 04:29:26 UTC, Shark8  wrote:
> > On Monday, December 31, 2018 at 12:02:11 AM UTC-7, alby....@gmail.com wrote:
> > > Would anyone be interested in the ANTLR v4 grammar for Ada 2012, and a sample C# sample / driver application to demonstrate the visitor/listener features of v4?
> > Yes; though I do question a bit of the utility of C# sample/drivers here -- if you've got ANTLR popping out a DOTNET frontend, wouldn't it be easier to tie-in to the DOTNET backend?
> 
> It's obvious he means a C# generated parser using this ANTLRv4 grammar.
> 
> Personally, I don't get why people "ask" "if there is interest" before they release something, just release it. There's obviously interest, just don't slap it under a GPL license, that would dick-ish.

Hi Lucretia

Correct, I was referring to a C# generated parser and yes, now that its obvious
that their is interest in this area, I will publish on GitHub later this week
(under MIT license) Sorry I cant make it sooner, as I would also like to include
a visual studio project/solution for the grammar built as a C# library, along
with a test app

Alex

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ANTLR grammar for Ada available
  2019-01-02  8:07               ` alby.gamper
@ 2019-01-02  8:32                 ` alby.gamper
  0 siblings, 0 replies; 26+ messages in thread
From: alby.gamper @ 2019-01-02  8:32 UTC (permalink / raw)


On Wednesday, January 2, 2019 at 7:07:18 PM UTC+11, alby....@gmail.com wrote:
> On Wednesday, January 2, 2019 at 9:20:22 AM UTC+11, oliverm...@gmail.com wrote:
> > On Monday, December 31, 2018 at 11:08:52 AM UTC+1, alby....@gmail.com wrote:
> > > [...]
> > > Thanks for the feedback!, Let me wait for some further feedback from the
> > > Ada community, so I can ascertain the extent of the interest in this piece
> > > of work.
> > 
> > Sure, I'd be interested too, to compare with
> > https://github.com/okellogg/ada_antlr_grammar/blob/master/antlr4/ada.g4
> > 
> > On this grammar, I am getting the following message from org.antlr.v4.Tool :
> > 
> > > error(119): ada.g4::: The following sets of rules are mutually
> >                         left-recursive
> > > [name, explicit_dereference, prefix, implicit_dereference,
> > > subtype_mark, function_call, generalized_reference, type_conversion,
> > > qualified_expression, indexed_component, slice, selected_component,
> > > attribute_reference, generalized_indexing]
> > 
> > Have you encountered a similar problem in your version?
> > 
> > - Oliver
> 
> Hi Oliver
> 
> My version of the grammar was done a couple of years ago, So I don't recall this
> specific error as such, I do recall issues with the "name" terminals (ie section
> 4.1)
> 
> Alex

Hi Oliver

Having had a further look at your grammar, this seems to be the same area that I
had issues with. I'll post my version up later this week, so we can compare our
approaches, Note however my grammar is for Ada 2012, but also based of the
grammar found in the Ada RM. One minor diff is that my lexer rules are at the
end of the grammar file (as was/is typical in ANTLR grammars). Your approach is
however far more readable/referable back to the RM

Alex


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ANTLR grammar for Ada available
  2019-01-01 22:20             ` olivermkellogg
  2019-01-02  8:07               ` alby.gamper
@ 2019-01-03 10:55               ` alby.gamper
  2019-01-17 21:13                 ` olivermkellogg
  1 sibling, 1 reply; 26+ messages in thread
From: alby.gamper @ 2019-01-03 10:55 UTC (permalink / raw)


On Wednesday, January 2, 2019 at 9:20:22 AM UTC+11, oliverm...@gmail.com wrote:
> On Monday, December 31, 2018 at 11:08:52 AM UTC+1, alby....@gmail.com wrote:
> > [...]
> > Thanks for the feedback!, Let me wait for some further feedback from the
> > Ada community, so I can ascertain the extent of the interest in this piece
> > of work.
> 
> Sure, I'd be interested too, to compare with
> https://github.com/okellogg/ada_antlr_grammar/blob/master/antlr4/ada.g4
> 
> On this grammar, I am getting the following message from org.antlr.v4.Tool :
> 
> > error(119): ada.g4::: The following sets of rules are mutually
>                         left-recursive
> > [name, explicit_dereference, prefix, implicit_dereference,
> > subtype_mark, function_call, generalized_reference, type_conversion,
> > qualified_expression, indexed_component, slice, selected_component,
> > attribute_reference, generalized_indexing]
> 
> Have you encountered a similar problem in your version?
> 
> - Oliver

Hi Oliver

My Antlr grammar can be found at https://github.com/Alex-Gamper/Ada-Grammar.git
You can use it standalone or open the visual studio solution and run/debug the
test console application as is. Feel free to raise issues / PR's on GitHub !

Alex

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ANTLR grammar for Ada available
  2019-01-03 10:55               ` alby.gamper
@ 2019-01-17 21:13                 ` olivermkellogg
  2019-01-18 10:19                   ` alby.gamper
  0 siblings, 1 reply; 26+ messages in thread
From: olivermkellogg @ 2019-01-17 21:13 UTC (permalink / raw)


On Thursday, January 3, 2019 at 11:55:18 AM UTC+1, alby....@gmail.com wrote:
> [...]
> My Antlr grammar can be found at https://github.com/Alex-Gamper/Ada-Grammar.git
> You can use it standalone or open the visual studio solution and run/debug the
> test console application as is. Feel free to raise issues / PR's on GitHub !
> 
> Alex

Hello Alex,

Thanks for publishing your grammar.

The port of my ANTLR-2 Ada grammar to ANTLR-3 [1] is starting to be usable.
Once that is fully functioning I will look at merging you work on `name' into my ada.g4 [2].

Cheers,

Oliver

[1] https://github.com/okellogg/ada_antlr_grammar/blob/master/antlr3/target_java/Ada.g
[2] https://github.com/okellogg/ada_antlr_grammar/blob/master/antlr4/ada.g4

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ANTLR grammar for Ada available
  2019-01-17 21:13                 ` olivermkellogg
@ 2019-01-18 10:19                   ` alby.gamper
  0 siblings, 0 replies; 26+ messages in thread
From: alby.gamper @ 2019-01-18 10:19 UTC (permalink / raw)


On Friday, January 18, 2019 at 8:13:51 AM UTC+11, oliverm...@gmail.com wrote:
> On Thursday, January 3, 2019 at 11:55:18 AM UTC+1, alby....@gmail.com wrote:
> > [...]
> > My Antlr grammar can be found at https://github.com/Alex-Gamper/Ada-Grammar.git
> > You can use it standalone or open the visual studio solution and run/debug the
> > test console application as is. Feel free to raise issues / PR's on GitHub !
> > 
> > Alex
> 
> Hello Alex,
> 
> Thanks for publishing your grammar.
> 
> The port of my ANTLR-2 Ada grammar to ANTLR-3 [1] is starting to be usable.
> Once that is fully functioning I will look at merging you work on `name' into my ada.g4 [2].
> 
> Cheers,
> 
> Oliver
> 
> [1] https://github.com/okellogg/ada_antlr_grammar/blob/master/antlr3/target_java/Ada.g
> [2] https://github.com/okellogg/ada_antlr_grammar/blob/master/antlr4/ada.g4

Hi Oliver

Glad to help in any way I can with my limited expertise in this area of lexical
and parsing analysis, and yes I agree that the 'name' rule needs some work to
resolve some ambiguities, and may require ANTLR's 'semantic predicates' to
resolve (as you have probably already envisaged) and thought about.

Alex


^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2019-01-18 10:19 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-02 19:28 ANTLR grammar for Ada available Oliver Kellogg
2003-03-03 10:35 ` Oliver Kellogg
2003-03-23 22:21 ` Oliver Kellogg
2003-03-24  1:32   ` John R. Strohm
2018-12-28  9:32 ` olivermkellogg
2018-12-28 13:38   ` Vincent DIEMUNSCH
2018-12-28 14:50     ` olivermkellogg
2018-12-31  5:38     ` alby.gamper
2018-12-31  7:02       ` alby.gamper
2018-12-31  8:08         ` Paul Rubin
2018-12-31 10:08           ` alby.gamper
2018-12-31 10:22             ` Paul Rubin
2018-12-31 10:42               ` alby.gamper
2019-01-01 22:20             ` olivermkellogg
2019-01-02  8:07               ` alby.gamper
2019-01-02  8:32                 ` alby.gamper
2019-01-03 10:55               ` alby.gamper
2019-01-17 21:13                 ` olivermkellogg
2019-01-18 10:19                   ` alby.gamper
2019-01-01  4:29         ` Shark8
2019-01-01  6:58           ` Lucretia
2019-01-02  8:13             ` alby.gamper
2018-12-31 12:32       ` Vincent DIEMUNSCH
2018-12-31 17:05         ` olivermkellogg
2018-12-31 17:31           ` Lucretia
2019-01-01 19:30   ` Stephen Leake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox