Anonymous | Login | Signup for a new account | 2025-03-16 00:31 UTC | ![]() |
Main | My View | View Issues | Change Log | Roadmap |
View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0000773 | Taste | [All Projects] ASN.1 Compiler v4 | public | 2018-05-16 07:58 | 2018-07-05 08:35 | ||||
Reporter | maxime | ||||||||
Assigned To | gmamais | ||||||||
Priority | normal | Severity | feature | Reproducibility | N/A | ||||
Status | closed | Resolution | fixed | ||||||
Platform | OS | OS Version | |||||||
Summary | 0000773: Renaming policy - forbidden keywords in fields and same field name/type name | ||||||||
Description | In the following to cases:
I propose to apply a renaming policy to the field names instead of emitting an error. The objective is to allow these kind of types:
in that example, the fields could be renamed "MySeq_main" (in C) and "MySeq_address" (in Ada), as it is done when renaming conflicting enumerant. | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | |||||||||
![]() |
|||||||||||
|
![]() |
|
(0003356) maxime (administrator) 2018-06-11 07:44 edited on: 2018-07-05 08:47 |
I also suggest to print on the console what the renaming policy is doing, by displaying info messages such as:
|
(0003357) maxime (administrator) 2018-06-11 08:54 |
However, since this would break a lot of code, I think there must be a command line to let the user control what he wants: --fieldPrefix auto|prefix=user_defined_string auto: use same policy set for enumerants |
(0003358) gmamais (developer) 2018-06-12 06:09 |
I had started the implementation of this mantis but without taking into account the the last two notes. I have some questions though: In your example, the 'address' name conflicts with the 'Address' type. However, this a problem only in Ada not in C. 2) prefix=string : let the user define his own prefix for all fields of SEQ/CHOICE I assume that in this case, all sequence/choice children will be prefixed with this value, not only the conflicting ones. Right? 3)Would you like the c_name / ada_name to be exported in the custom STGs backends? |
(0003371) maxime (administrator) 2018-06-13 14:21 |
1) Only in Ada 2) yes, all choice/children unconditionally The ACN inserted fields are never made visible to the user, so internally you may or may not add the prefix. In the ICDs, there should be no prefix. 3) yes, I think it's needed, same as EnumValue (I believe) for conflicting enumerants thanks! |
(0003375) gmamais (developer) 2018-06-13 18:43 edited on: 2018-06-16 15:20 |
One more question:
How would you expect the generated Ada code in auto mode?
Option 2: all fields are prefixed. In this case, the generated code would be as
Option 3: Use the value of |
(0003376) maxime (administrator) 2018-06-13 18:51 |
I would expect option 1. The renaming has to be kept local, so that if the user later changes this field, the other existing fields are not all impacted/broken. |
(0003377) gmamais (developer) 2018-06-14 19:02 |
fixed in the latest GitHub commit as specified. See test case |
(0003378) maxime (administrator) 2018-06-16 14:49 |
Thanks! Please note that in the command line help, you miss the keyword ENUMERATED here:
|
(0003379) maxime (administrator) 2018-06-16 15:19 |
I updated xml.stg and python.stg to use sCName and sAdaName in the generated custom STGs |
(0003380) maxime (administrator) 2018-06-16 15:22 |
I have tried using the name " |
(0003381) gmamais (developer) 2018-06-16 17:01 |
open is not a C or Ada keyword and that is why is not renamed. The list of keywords per language are let ada_keyworkds = [ "abort"; "else"; "new"; "return"; "abs"; "elsif"; "not"; "reverse"; "abstract"; "end"; "null"; "accept"; "entry"; "select"; "access"; "exception"; "of"; "separate"; "aliased"; "exit"; "or"; "some"; "all"; "others"; "subtype"; "and"; "for"; "out"; "synchronized"; "array"; "function"; "overriding"; "at"; "tagged"; "generic"; "package"; "task"; "begin"; "goto"; "pragma"; "terminate"; "body"; "private"; "then"; "if"; "procedure"; "type"; "case"; "in"; "protected"; "constant"; "interface"; "until"; "is"; "raise"; "use"; "declare"; "range"; "delay"; "limited"; "record"; "when"; "delta"; "loop"; "rem"; "while"; "digits"; "renames"; "with"; "do"; "mod"; "requeue"; "xor" ] Regarding the type typo in help message, I will fix it in the next commit. |
(0003382) gmamais (developer) 2018-06-16 17:07 |
typo fixed. |
(0003383) maxime (administrator) 2018-06-16 18:24 |
Thanks! I think we are all good now (indeed, you are right about "open" - sorry for the confusion). Closing!! We'll now need to update the B mappers (to use the new CName/AdaName) and Opengeode code generator. |
![]() |
|||
Date Modified | Username | Field | Change |
2018-05-16 07:58 | maxime | New Issue | |
2018-05-16 07:58 | maxime | Status |
new => assigned |
2018-05-16 07:58 | maxime | Assigned To |
=> gmamais |
2018-05-16 07:58 | maxime | Relationship added |
child of 0000771 |
2018-06-11 07:44 | maxime | Note Added: 0003356 | |
2018-06-11 08:54 | maxime | Note Added: 0003357 | |
2018-06-12 06:09 | gmamais | Note Added: 0003358 | |
2018-06-12 18:06 | gmamais | Status |
assigned => feedback |
2018-06-13 14:21 | maxime | Note Added: 0003371 | |
2018-06-13 14:21 | maxime | Status |
feedback => assigned |
2018-06-13 18:43 | gmamais | Note Added: 0003375 | |
2018-06-13 18:51 | maxime | Note Added: 0003376 | |
2018-06-14 19:02 | gmamais | Note Added: 0003377 | |
2018-06-14 19:02 | gmamais | Status |
assigned => resolved |
2018-06-14 19:02 | gmamais | Resolution |
open => fixed |
2018-06-16 14:49 | maxime | Note Added: 0003378 | |
2018-06-16 15:19 | maxime | Note Added: 0003379 | |
2018-06-16 15:20 | maxime | Note Edited: 0003375 | View Revisions |
2018-06-16 15:22 | maxime | Note Added: 0003380 | |
2018-06-16 17:01 | gmamais | Note Added: 0003381 | |
2018-06-16 17:01 | gmamais | Status |
resolved => new |
2018-06-16 17:07 | gmamais | Note Added: 0003382 | |
2018-06-16 17:07 | gmamais | Status |
new => resolved |
2018-06-16 18:24 | maxime | Note Added: 0003383 | |
2018-06-16 18:24 | maxime | Status |
resolved => closed |
2018-06-16 18:26 | maxime | Description Updated | View Revisions |
2018-06-16 18:27 | maxime | Description Updated | View Revisions |
2018-07-05 08:35 | maxime | Relationship added |
related to 0000411 |
2018-07-05 08:47 | maxime | Note Edited: 0003356 | View Revisions |
Copyright © 2000 - 2011 MantisBT Group |