-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Declaration semantics in Structorizer has to be reassessed #980
Comments
The discussion will have to keep in mind at least these issues: #61, #113, #335, #368, #408, #423, #739, #800. |
In an analogy to some Pascal distributions and Oberon we might indeed think of a modified semantics of declarations in future Structorizer versions, particularly for arrays:
In the consequence, Structorizer would have to maintain a declaration table apart from an inferred type association table (or a declaration flag in the type association map). So is it worth the efforts? Should it even be optional? In any case, something is to be done about the misinterpretation of texts like |
In addition, we will have to decide whether it is desirable and feasible also to accept declarations in C and/or Java style (then with or without
The multitude of possible syntactic approaches adds to the already intrinsic ambiguity of an underlying grammar, in particular if type names may consist of more than one word (like |
Issue #977 revealed that the semantics and processing of declarations (particularly that of arrays) in Structorizer is deficiently based and has to be revisited. The user example in the issue contained an element with the text:
var v1[10], i: int
Originally posted by @codemanyak in #977 (comment)
The following diagram shows several possible declaration types suggested by different programming languages. With all possible syntactic tolerance of Structorizer appreciated, we need a specification which of them are to be accepted and what effect they are meant to have w.r.t. Executor, Analyser, and code generation:
This result seems hardly acceptable:
Should we accept Pascal's
array [0..9] of int
at all, as it suggests a flexible start index (i.e., an index base transformation) we do not actually support? Should the "execution" of an array declaration rather result in an array of the specified size but fill withnull
values? But what to do then with array declarations of unspecified size (e.g. v5)?The text was updated successfully, but these errors were encountered: