Issue 11549: The VSL grammar does not define the "( )" symbol (marte-ftf) Source: THALES (Mr. Sebastien Demathieu, sebastien.demathieu(at)thalesgroup.com) Nature: Enhancement Severity: Minor Summary: The VSL grammar does not define the "( )" symbol that allows one to indicate priorities in the syntax of arithmetical expressions. In the expression, "((1+2) * 3)" for instance. Resolution: To allow building unambiguous expressions (mainly arithmetical ones), the language should include both proper rules supporting parentheses (i.e., “(“ and “)”) as well as precedence rules to specify the order in operations evaluation. In VSL, these aspects concern two different sections of MARTE. Parentheses need to be specified in the VSL grammar section, and precedence rules in the library of primitive types. The latter is because “operations” (e.g., arithmetic operations: +, -, *, /) are defined as operations of MARTE primitive types (Real, Integer, etc.). Hence, this resolution proposes to add/modify VSL as defined below. Revised Text: Parentheses allow user to specify priorities (precedence rules) in “operation call expressions” (especially for infix operators). In order to allow VSL to specify parentheses where needed, the <operation-call-expr> rule should be revised. Modify Section “B.3.3.14 Operation Call Expressions” (p. 417) with the following rules: ---------start: ----- <operation-call-expr> ::= (<value-specification> '.' <operation-name> '('[ <argument-value> [','<argument-value>]* ]')') | ( <argument-value> <operation-name> <argument-value> | '('<argument-value> <operation-name> <argument-value> ')' ) <argument-value> ::= <value-specification> <operation-name> ::= <body-text> Disambiguating rules - The parentheses in the first case (no infix operator) should be mandatory. - Precedence rules are defined for infix operators that are defined in the standard MARTE library. ---------end ----- In addition, Annex D, Section “D.1 MARTE Library for Primitive Types” should provide a section that defines precedence rules. Add the following precedence rules at the end of Section D.1.: ---------start: ----- Precedence Rules The precedence order for the operations, starting with highest precedence, in VSL is: • unary ‘not’, unary minus ‘-’ and unary plus ‘+’ • ‘*’ and ‘/’ • binary ‘+’ and ‘-’ • ‘<’, ‘>’, ‘<=’, ‘>=’ • ‘= =’, ‘<>’ • ‘and’, ‘or’ and ‘xor’ Parentheses ‘(’ and ‘)’ can be used to change precedence. ---------end ----- Disposition: Resolved Actions taken: October 8, 2007: received issue October 16, 2009: closed issue Discussion: Resolution: Precedence rules to evaluate expressions are missing in VSL. This should be added at the same level where semantic of operations is defined. In this case, operations are defined in the Library annex. However, it's not clear how the grammar should be updated to support these precedence rules. The resolution proposes to defer this issue to evaluate the VSL grammar more carefully. Disposition: Deferred End of Annotations:===== m: webmaster@omg.org Date: 08 Oct 2007 11:24:54 -0400 To: Subject: Issue/Bug Report -------------------------------------------------------------------------------- Name: Sébastien Demathieu Company: Thales mailFrom: sebastien.demathieu@thalesgroup.com Notification: Yes Specification: A UML Profile for MARTE Section: Annex B FormalNumber: realtime/07-08-04 Version: Beta 1 RevisionDate: 08/2007 Page: 397 Nature: Enhancement Severity: Minor HTTP User Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7 Description The VSL grammar does not define the "( )" symbol that allows one to indicate priorities in the syntax of arithmetical expressions. In the expression, "((1+2) * 3)" for instance. Date: Wed, 23 Apr 2008 17:43:12 +0200 From: Sébastien Demathieu Organization: Thales Research & Technology User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) To: "'ESPINOZA Huascar 218344'" Cc: Laurent Rioux , marte-ftf@omg.org Subject: Re: Issues Annex B (VSL) X-MIME-Autoconverted: from quoted-printable to 8bit by amethyst.omg.org id m3NFimIA016455 Huascar, Here are our comments on the VSL resolutions: - 12209: please can you let us know what is the resolution to be added to the ballot (A or B)? - 11163: do we understand the rationale beyond this request before making it "closed, no change"? Maybe we can get in touch with the author of the issue? - 11339: this issue focuses only on a "syntax error": there is no conceptual problem: In the BNF of VSL, one calls a term that is not defined in other part of the BNF. If we would just introduce this new term in the BNF then we're done. I can propose a resolution for this one if you want. - 11548: This issue is different from 11547 because the "[ ]" operator applies to a variable here. If one cannot apply a "[ ]" operator on a variable that relates to a collection then we might have a problem with the use of collections in VSL. We need to address this problem at any rate (for ballot 2 or for the next round). - 11549: The resolution is not complete in the sense that the proposed changes do not appear in an updated version of the BNF (introducing the "( )" terms along with the priorities). - 11872: It is not clear that can support the proposed changes through a library. We have attempted to made these changes and we did not get to a conclusion at this point on whether we can or we cannot do it. I would suggest changing it to "deferred" Please let me know what you think about it. Thanks, Sébastien Laurent Rioux a écrit : There are still missing 3 issues inside the wiki and to solve Laurent -----Message d'origine----- De : ESPINOZA Huascar 218344 [mailto:Huascar.ESPINOZA@cea.fr] Envoyé : mercredi 23 avril 2008 16:25 À : marte-ftf@omg.org Objet : Issues Annex B (VSL) Hello, I uploaded the issue resolution for Annex B (VSL) to the MARTE wiki. Please let me know if you have any questions. Issue 12209 has two proposals. We still need to have a consensus on this. Regards, Huascar -- Huascar ESPINOZA, Ph.D. CEA LIST Model-Driven Engineering for Real-Time Embedded Systems 91191 GIF/YVETTE CEDEX Phone/Fax: +33 1 69 08 45 87 / 20 82 FRANCE Subject: [Issue 11549] The VSL grammar does not define the "( )" symbol Date: Mon, 8 Dec 2008 14:31:23 +0100 X-MS-Has-Attach: yes X-MS-TNEF-Correlator: Thread-Topic: [Issue 11549] The VSL grammar does not define the "( )" symbol Thread-Index: AclZMvgP2CHUcGBvQyKVETs+7+NqlgABhKAg From: "ESPINOZA Huascar 218344" To: X-OriginalArrivalTime: 08 Dec 2008 13:31:24.0336 (UTC) FILETIME=[43DD6300:01C95939] Hi again, Please find enclosed the proposed resolution for Issue 11549 (Resolved): The VSL grammar does not define the "( )" symbol. Cheers, Huascar -- Huascar ESPINOZA, Ph.D. CEA LIST Model-Driven Engineering for Real-Time Embedded Systems 91191 GIF/YVETTE CEDEX Phone/Fax: +33 1 69 08 45 87 / 20 82 FRANCE 11549_Resolved_Ballot1.doc From: "Lonnie VanZandt" To: "'ESPINOZA Huascar 218344'" , Subject: RE: [Issue 11549] The VSL grammar does not define the "( )" symbol Date: Mon, 8 Dec 2008 17:02:58 -0700 Organization: Predictable Response Consulting, LLC X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AclZMvgP2CHUcGBvQyKVETs+7+NqlgABhKAgABX22BA= X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=5.0.0-0811170000 definitions=main-0812080144 X-SpamInfo: helo-dns, Certain rules already did have the PARENS tokens. I agree that the operator precedence has to be handled in the type model behind the VSL because the VSL grammar actually does not define non-member expression operators. (This was a bit odd at first as I wondered why the Antlr v2 grammar did not have the ubiquitous grammar spec for infix binary operators.) As noted below, operators are implemented as Operation calls on the types returned as lvalues from the expression terms. -----Original Message----- From: ESPINOZA Huascar 218344 [mailto:Huascar.ESPINOZA@cea.fr] Sent: Monday, December 08, 2008 6:31 AM To: marte-ftf@omg.org Subject: [Issue 11549] The VSL grammar does not define the "( )" symbol Hi again, Please find enclosed the proposed resolution for Issue 11549 (Resolved): The VSL grammar does not define the "( )" symbol. Cheers, Huascar -- Huascar ESPINOZA, Ph.D. CEA LIST Model-Driven Engineering for Real-Time Embedded Systems 91191 GIF/YVETTE CEDEX Phone/Fax: +33 1 69 08 45 87 / 20 82 FRANCE Subject: RE: [Issue 11549] The VSL grammar does not define the "( )" symbol Date: Tue, 9 Dec 2008 09:46:21 +0100 X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [Issue 11549] The VSL grammar does not define the "( )" symbol Thread-Index: AclZMvgP2CHUcGBvQyKVETs+7+NqlgABhKAgABX22BAAEl9rIA== From: "ESPINOZA Huascar 218344" To: "Lonnie VanZandt" , X-OriginalArrivalTime: 09 Dec 2008 08:46:21.0678 (UTC) FILETIME=[9C4CA0E0:01C959DA] X-MIME-Autoconverted: from quoted-printable to 8bit by amethyst.omg.org id mB98jXi1010528 Right Lonnie. BTW, I used the term "bracket", but it should be changed by round brackets, open brackets, or parentheses. Cheers, Huascar -----Message d'origine----- De : Lonnie VanZandt [mailto:lonniev@predictableresponse.com] Envoyé : mardi 9 décembre 2008 01:03 À : ESPINOZA Huascar 218344; marte-ftf@omg.org Objet : RE: [Issue 11549] The VSL grammar does not define the "( )" symbol Certain rules already did have the PARENS tokens. I agree that the operator precedence has to be handled in the type model behind the VSL because the VSL grammar actually does not define non-member expression operators. (This was a bit odd at first as I wondered why the Antlr v2 grammar did not have the ubiquitous grammar spec for infix binary operators.) As noted below, operators are implemented as Operation calls on the types returned as lvalues from the expression terms. -----Original Message----- From: ESPINOZA Huascar 218344 [mailto:Huascar.ESPINOZA@cea.fr] Sent: Monday, December 08, 2008 6:31 AM To: marte-ftf@omg.org Subject: [Issue 11549] The VSL grammar does not define the "( )" symbol Hi again, Please find enclosed the proposed resolution for Issue 11549 (Resolved): The VSL grammar does not define the "( )" symbol. Cheers, Huascar -- Huascar ESPINOZA, Ph.D. CEA LIST Model-Driven Engineering for Real-Time Embedded Systems 91191 GIF/YVETTE CEDEX Phone/Fax: +33 1 69 08 45 87 / 20 82 FRANCE