Skip to content
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

Allow lists of comma-separated attributes after a type name to be consistent with other C-family languages #254

Open
Nava2 opened this issue Aug 26, 2015 · 8 comments
Labels
attributes Component-SyntaxAndParsing Related to the Umple grammar and the parser that builds the abstract syntax tree and analyses models Diffic-Med A non-trivial problem that may take over a week or may not be obvious how to fix or require analysis Priority-High This problem or enhancement is likely to be highly visible and or impactful of users Status-Accepted Type-Enhancement ucosp Suitable for 4th year capstone projects Usability

Comments

@Nava2
Copy link
Contributor

Nava2 commented Aug 26, 2015

Originally reported on Google Code with ID 355
Owned by @howzlife


Allow

class X {
Integer a,b;
}

and

class X {
Integer a, b;
}

to initialize two variables.

Currently the former raises error 130 and the latter generates 'extra code'.. This
is to be consistent with C-family languages


Reported by @umple on 2012-11-21 20:06:45

@Nava2
Copy link
Contributor Author

Nava2 commented Aug 26, 2015

Reported by @umple on 2013-05-01 02:04:27

  • Owner changed: atojet

@Nava2 Nava2 added Priority-Medium This problem or request is likely to be of significant benefit if dealt with Usability Status-Accepted Diffic-Easy Should be obvious how to fix it and doable in less than a week by an experienced Umple developer Type-Enhancement Component-SyntaxAndParsing Related to the Umple grammar and the parser that builds the abstract syntax tree and analyses models ucosp Suitable for 4th year capstone projects attributes labels Aug 26, 2015
@Nava2
Copy link
Contributor Author

Nava2 commented Aug 26, 2015

Essentially this should just require modifying the parser to generate new tokens, then
changing metamodel parsing so the generated code is identical to the case where it
was:

Integer a;
Integer b;

Testing should be done for a list of three or more items, different Umple datatypes,
and different non-umple datatypes.


Reported by @umple on 2013-05-01 02:06:55

@Nava2
Copy link
Contributor Author

Nava2 commented Aug 26, 2015

A few issues prevent this to be as straighforward as it should be. The main one being:

  • Irregular behavior when parsing a grammar rule with optional clauses. To reproduce
    this do the following:
    In the umple_classes.grammar file, erase all attribute rules except simpleAttribute.
    Change the [[simpleAttribute]] clause to be like "simpleAttribute- : [name] [=foo:foo]?
    ;" (without quotes). In the .ump file to be compiled, inside a class, notice that when
    "foo" is present (ie. "attribute foo;"), the simple attribute is recognized and parsed,
    but when "foo" is not present (ie. "attribute;"), the line is not recognized and it's
    parsed as extra code.

Since the current rules for attributes use the [type,name>1,0] clause, this (supposed)
problem is avoided, but it prevents the rewriting to something like:

complexAttribute- : [=unique]? [=lazy]? [=modifier:immutable|settable|internal|defaulted|const]?
[type]? [=list:[]]? [~name](, [~name])* (= [**value])? ;

As this is marked as low-priority, I'll wait for the confirmation from a different
developer and get back to it later.


Reported by atojet on 2013-06-18 14:01:32

@Nava2
Copy link
Contributor Author

Nava2 commented Aug 26, 2015

Issue 314 has been merged into this issue.


Reported by @umple on 2013-09-04 16:34:12

  • cc added: +@umple, +ahmedvc@hotmail.com

@Nava2
Copy link
Contributor Author

Nava2 commented Aug 26, 2015

I have raised the priority of this, as it should be doable and would be useful


Reported by @umple on 2014-09-05 14:51:18

  • Labels added: Priority-Medium, ucosp
  • Labels removed: Priority-Low

@Nava2
Copy link
Contributor Author

Nava2 commented Aug 26, 2015

Reported by @umple on 2014-09-05 14:51:38

  • Owner removed

@Nava2
Copy link
Contributor Author

Nava2 commented Aug 26, 2015

Reported by @umple on 2014-09-09 17:09:59

@TimLethbridge TimLethbridge added Diffic-VEasy Should be obvious how to fix it, likely in just a few lines, and should take less than a day Priority-High This problem or enhancement is likely to be highly visible and or impactful of users and removed Diffic-Easy Should be obvious how to fix it and doable in less than a week by an experienced Umple developer Priority-Medium This problem or request is likely to be of significant benefit if dealt with labels Nov 28, 2016
@TimLethbridge
Copy link
Member

I have raised the priority of this issue since it has been around for a very, very long time! Twice others have opened duplicates.

@TimLethbridge TimLethbridge changed the title Allow lists of attributes after a type name to be consistent with other C-family languages Allow lists of comma-separated attributes after a type name to be consistent with other C-family languages Nov 28, 2016
@glorialaw glorialaw assigned glorialaw and unassigned glorialaw Oct 13, 2018
@vash-evg vash-evg self-assigned this Nov 2, 2018
@TimLethbridge TimLethbridge added Diffic-Med A non-trivial problem that may take over a week or may not be obvious how to fix or require analysis and removed Diffic-VEasy Should be obvious how to fix it, likely in just a few lines, and should take less than a day labels Jul 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
attributes Component-SyntaxAndParsing Related to the Umple grammar and the parser that builds the abstract syntax tree and analyses models Diffic-Med A non-trivial problem that may take over a week or may not be obvious how to fix or require analysis Priority-High This problem or enhancement is likely to be highly visible and or impactful of users Status-Accepted Type-Enhancement ucosp Suitable for 4th year capstone projects Usability
Projects
None yet
Development

No branches or pull requests

5 participants