From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!aioe.org!5WHqCw2XxjHb2npjM9GYbw.user.gioia.aioe.org.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: ANN: Simple Components v Date: Sun, 17 Jan 2021 18:38:07 +0100 Organization: Aioe.org NNTP Server Message-ID: References: <4370e6f1-4504-4dff-8208-e1ad7eeac9a5n@googlegroups.com> <38687765-d3ee-4966-a4e3-c975bd73ceadn@googlegroups.com> <7d0f4046-76e7-47ae-ab56-751941fc1a5fn@googlegroups.com> <094c6469-f72a-4879-bc17-fcc09d24f837n@googlegroups.com> <0d57b74b-8d1e-4783-99cf-3afb27cd30d1n@googlegroups.com> NNTP-Posting-Host: 5WHqCw2XxjHb2npjM9GYbw.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 X-Notice: Filtered by postfilter v. 0.9.2 Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:61166 List-Id: 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