Syntax question...

Jarrett Billingsley kb3ctd2 at yahoo.com
Mon Oct 30 17:49:46 PST 2006


"%u" <ra at wolven.net> wrote in message 
news:ei68it$2e9a$1 at digitaldaemon.com...
> Thanx for the reply Jarret, I was beginning to feel a little ignored 
> there...  And
> sorry bout the html stuff.  I didn't realize there would be a problem 
> until I saw
> my post on here, then I changed my email settings.  I set them to rich 
> text. Can
> this news group handle that or should I just set it to plain text?

If this message that I'm replying to is rich text, then it looks through my 
reader and on the web interface.  Have a look at your original post through 
the web interface 
(http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D&artnum=43421) 
and you'll see why HTML posting is generally discouraged :S

> You gave some great samples there of VB style code, but I was just using 
> VB as an
> example... it's not really what I'm wanting to do.  Basically, I want a 
> "new"
> syntax.  Although it would borrow heavily from other languages that make 
> sense to me.

What kind of syntax are you thinking?  (I'm genuinely interested :) )

> So what exactly does not "too incredibly difficult" mean?  Which would be 
> easier,
> modifying the existing front end source code, or doing as Hasan suggested 
> and
> writing a front end for the D front end...    I don't really like that 
> concept,
> but maybe it would be easier?

Well the front end source is... kind of messy, to say the least.  Thankfully 
about all you'd have to mess with are the lexer and parser bits (lex.c and 
parse.c, imagine that), which aren't _too_ bad.  Once you've got yourself a 
nice Basic-style lexer/parser set up, you could compile GDC with it and test 
it out.  Of course, that might be a bit daunting, so..

What Hasan suggested is certainly not a bad idea either, and would also mean 
you wouldn't have to recompile the D compiler in order to get it to work. 
However, it would involve writing a backend for your frontend which would 
produce the appropriate D code, which could be a bit tricky, but not so bad 
if you're not worried about it producing the nicest-looking D code. 
Although the nice thing about this approach is that your DBasic frontend 
could be written in whatever you want, instead of being limited to C++ as 
with the other approach.

In any case, it would be nice to have some kind of D grammar to start from, 
so you'd know what all the various language constructs your new syntax would 
have to support, rather than picking out all the grammar bits from the D 
spec.  There _is_ one somewhere, but (1) I don't know if it's kept entirely 
up to date and (2) don't know what it's called or where it is.  :| 





More information about the Digitalmars-d mailing list