Re: Using Bison and Delphi

"Mike Hahn" <mikehahn@rogers.com>
5 Dec 2004 21:35:26 -0500

          From comp.compilers

Related articles
Using Bison and Delphi mikehahn@rogers.com (Mike Hahn) (2004-11-17)
Re: Using Bison and Delphi vbdis@aol.com (2004-11-19)
Re: Using Bison and Delphi mikehahn@rogers.com (Mike Hahn) (2004-11-20)
Re: Using Bison and Delphi vbdis@aol.com (2004-11-26)
Re: Using Bison and Delphi vbdis@aol.com (2004-11-28)
Re: Using Bison and Delphi jeremy.wright@microfocus.com (Jeremy Wright) (2004-11-28)
Re: Using Bison and Delphi mikehahn@rogers.com (Mike Hahn) (2004-12-05)
Re: Using Bison and Delphi strohm@airmail.net (John R. Strohm) (2004-12-06)
Ada use of parens vs brackets arnold@skeeve.com (Aharon Robbins) (2004-12-11)
Re: Ada use of parens vs brackets mailbox@dmitry-kazakov.de (Dmitry A. Kazakov) (2004-12-13)
Re: Ada use of parens vs brackets nick.roberts@acm.org (Nick Roberts) (2004-12-16)
| List of all articles for this month |
From: "Mike Hahn" <mikehahn@rogers.com>
Newsgroups: comp.compilers
Date: 5 Dec 2004 21:35:26 -0500
Organization: Compilers Central
References: 04-11-078 04-11-099
Keywords: syntax, design
Posted-Date: 05 Dec 2004 21:35:26 EST

"VBDis" <vbdis@aol.com> wrote:
> "Mike Hahn" <mikehahn@rogers.com> schreibt:
>
> >= foo (bar func1 (arg1, arg2,... ) func2 (arg1, arg2,... ));
>
> Okay, with such a syntax the dot operators may be omitted. But without the
> comma-separated argument lists (as in the original posting) it would be
almost
> impossible. Remember:
>
> >foo mymethod (arg1 arg2... );
>
> Did you also consider how to access class fields instead of class methods,
> methods without parameters, and the handling of an (implied?) Self/this
object
> reference?


I admit that my language might be hard to parse. If an open
parenthesis followed by an object name is encountered, you don't know
until reaching the close parenthesis what you're dealing with. One
possible solution to that problem is using a colon (:) operator for
method calls and a dollar-sign ($) operator for array references, and
no operator for variable references.


(: foo p1 (x1 x2) p2 x3 myfunc (x4 x5))
($ foo p1 (x1 x2) p2 x3 myarray (x4 x5))
(foo p1 (x1 x2) p2 x3 myvariable)


In the first expression, the p1 function returns an object with a p2
method, which returns an object with a myfunc method, returning the
value of the expression.


As for referencing methods/properties of the current class, you don't
need the object name at the front. Also I can use the "self" keyword
like Java does. Does that make any sense? I am a newbie when it comes
to writing compilers.


Mike Hahn
http://parenscript.sf.net



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.