comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: ANN: Simple Components v
Date: Sun, 17 Jan 2021 18:38:07 +0100	[thread overview]
Message-ID: <ru1sls$1l9h$1@gioia.aioe.org> (raw)
In-Reply-To: 0d57b74b-8d1e-4783-99cf-3afb27cd30d1n@googlegroups.com

On 2021-01-17 18:17, reinert wrote:
> søndag 17. januar 2021 kl. 17:55:59 UTC+1 skrev Shark8:
>> Dmitry isn't asking about the manner in which you are using prefix-notation, he's asking what the context (types, operations, etc) you're talking about.
>> In any case, converting between inline/pre-/post-fix operators is trivial: parse the operations and operands into a structure [typically a binary tree], and then walk the tree as needed to produce your desired output.
>>
>>
> Yes, pretty trivial and too simple for "Simple components" :-) One may define operators (function of max two arguments) hard-coded
> in an actual Ada program or  assume it is defined outside of it in a script (a bit more complex).

It is table-driven. You provide tables with brackets, 
prefix/suffix/infix operators, commas, ligatures (like Ada's =>) to the 
parser. So, it is fully dynamic, nothing is hard-coded, no grammar involved.

  Also note that check of user input and error messages (to the user) 
adds complexity.

Not much. For a syntax error you get a primitive operation callback from 
where you either:

- raise an exception with the current source location encoded into. E.g. 
mismatched bracket, association violation (e.g. X and Y or Z) etc.

- correct error, e.g. if you detect an unexpected closing bracket or 
missing operation, you might decide that this indicates the end of the 
expression.

> I am just checking out what is available to avoid spending time to reinvent the wheel.

That is reasonable.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

  reply	other threads:[~2021-01-17 17:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-13 12:01 ANN: Simple Components v Dmitry A. Kazakov
2021-01-15 19:42 ` reinert
2021-01-15 20:05   ` Dmitry A. Kazakov
2021-01-17  5:34     ` reinert
2021-01-17  5:37       ` reinert
2021-01-17  6:54       ` Dmitry A. Kazakov
2021-01-17 16:20         ` reinert
2021-01-17 16:55           ` Shark8
2021-01-17 17:17             ` reinert
2021-01-17 17:38               ` Dmitry A. Kazakov [this message]
2021-01-18  6:50                 ` reinert
2021-01-17 17:27             ` Dmitry A. Kazakov
2021-01-17 17:26           ` Dmitry A. Kazakov
replies disabled

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