Hi,

> Is this your own language?
Yes, it's a little toy language I'm working on for educational purposes 
and fun of course.
> Note that in C, C++, Java, C#, and other
> languages with C-derived syntax, "int a, b = 3" would not assign anything
> to a; it would leave a uninitialized. It's liable to confuse programmers
> of these languages if your language has C-like syntax but differs on this
> point. [*]
> I also think you may be trying too hard to collapse semantic equivalences
> while generating the AST. A declaration initialiser is a different
> construct from an assignment. It might (in some language) be equivalent
> to an uninitialised declaration followed by an assignment, but an AST is
> still an abstract *syntax* tree -- it should preserve syntactic distinctions
> such as that between "int a; a = 3;" and "int a = 3;". 
> (Whether to distinguish between "int a, b;" and "int a; int b;" is
> slightly less obvious, but my personal preference would be to preserve
> that distinction in the AST as well.
>   
Those a very good points. I will certainly consider them but first I 
have to get some code generated, I have already
defined much more grammar than intended. I guess that's what one gets 
for antlr being such an awesome tool that makes
defining languages so much fun :)

Thank you very much for your feedback, it's much appreciated.

Stefan

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to