Welcome, Guest
Username: Password:
  • Page:
  • 1

TOPIC:

Not-quite-optional semicolons 22 Sep 2002 21:42 #6222

Seeking clarification regarding the "optional" semicolon in a number of
lists in the TTCN-3 BNF.

The non-terminals which have such a rule are listed below, alongside the
actual repeated non-terminal that has the "optional" semicolon.

ModuleDefinitionsList ModuleDefinition
FunctionStatementOrDefList FunctionStatementOrDef
MessageAttribs MessageList
ProcedureAttribs ProcedureList
MixedAttribs MixedList
ComponentDefList ComponentElementDef
AltStepLocalDefList AltstepLocalDef
ExceptSpec ExceptElement
ImportSpec ImportElement
ControlStatementOrDefList ControlStatementOrDef
CallBodyStatementList CallBodyStatement
MultiWithAttrib SingleWithAttrib
AltGuardList GuardStatement
InterleavedGuardList InterleavedGuardElement

Is it true that the semicolon is optional if the preceeding statement
ends in a "}" or the statement is the last in the list (followed by a
"}") and mandatory otherwise?

Cheers,
--
Carl Cerecke - Software Designer
Da Vinci Communications Ltd
Christchurch - New Zealand
TEL : +64 3 3838311
FAX : +64 3 3838310
e-mail: This email address is being protected from spambots. You need JavaScript enabled to view it.
www : www.davinci-communications.com

Please Log in to join the conversation.

Not-quite-optional semicolons 23 Sep 2002 06:59 #6223

Annex A of the standard states:

A.1.2 Statement terminator symbols
In general all TTCN-3 language constructs (i.e. definitions,
declarations, statements and operations) are terminated with a
semi-colon (;). The semi-colon is optional if the language construct
ends with a right-hand curly brace (}) or the following symbol is a
right-hand curly brace (}), i.e. the language construct is the last
statement in a block of statements, operations and declarations.

Regards
Anthony Wiles

>
Original Message
> From: Carl Cerecke [This email address is being protected from spambots. You need JavaScript enabled to view it.]
> Sent: 22 September 2002 23:43
> To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Subject: Not-quite-optional semicolons
>
>
> Seeking clarification regarding the "optional" semicolon in a
> number of
> lists in the TTCN-3 BNF.
>
> The non-terminals which have such a rule are listed below,
> alongside the
> actual repeated non-terminal that has the "optional" semicolon.
>
> ModuleDefinitionsList ModuleDefinition
> FunctionStatementOrDefList FunctionStatementOrDef
> MessageAttribs MessageList
> ProcedureAttribs ProcedureList
> MixedAttribs MixedList
> ComponentDefList ComponentElementDef
> AltStepLocalDefList AltstepLocalDef
> ExceptSpec ExceptElement
> ImportSpec ImportElement
> ControlStatementOrDefList ControlStatementOrDef
> CallBodyStatementList CallBodyStatement
> MultiWithAttrib SingleWithAttrib
> AltGuardList GuardStatement
> InterleavedGuardList InterleavedGuardElement
>
> Is it true that the semicolon is optional if the preceeding statement
> ends in a "}" or the statement is the last in the list (followed by a
> "}") and mandatory otherwise?
>
> Cheers,
> --
>
> Carl Cerecke - Software Designer
> Da Vinci Communications Ltd
> Christchurch - New Zealand
>
> TEL : +64 3 3838311
> FAX : +64 3 3838310
> e-mail: This email address is being protected from spambots. You need JavaScript enabled to view it.
> www : www.davinci-communications.com
>
>

Please Log in to join the conversation.

Not-quite-optional semicolons 23 Sep 2002 07:50 #6224

Except A.1.2 clause you can also look at rejected CR120 from CR archive. I
have carefully checked the use of semicolons through the whole BNF and there
are some exceptions, i.e. some semicolons are completely unnecessary in BNF.
CR status is "no technical defect; optional semicolon shall be kept for
style uniqueness" and that is OK, we do no need more complications in
analysing language behaviour and that's why implementation may be simple, in
full accordance with A.1.2:

[ ; ]

I hope may be always implemented as :

if TokenId = ptT3SemiColon then
NextToken
else
if TokenId <> ptT3BraceClose then
if LastTokenId <> ptT3BraceClose then
T3SyntaxError(ParserErrorMessage, [ ptT3SemiColon ]);


Best Regards,
Mariusz Kupiec


Original Message
From: "Carl Cerecke" <This email address is being protected from spambots. You need JavaScript enabled to view it.>
To: <This email address is being protected from spambots. You need JavaScript enabled to view it.>
Sent: Sunday, September 22, 2002 11:42 PM
Subject: Not-quite-optional semicolons


> Seeking clarification regarding the "optional" semicolon in a number of
> lists in the TTCN-3 BNF.
>
> The non-terminals which have such a rule are listed below, alongside the
> actual repeated non-terminal that has the "optional" semicolon.
>
> ModuleDefinitionsList ModuleDefinition
> FunctionStatementOrDefList FunctionStatementOrDef
> MessageAttribs MessageList
> ProcedureAttribs ProcedureList
> MixedAttribs MixedList
> ComponentDefList ComponentElementDef
> AltStepLocalDefList AltstepLocalDef
> ExceptSpec ExceptElement
> ImportSpec ImportElement
> ControlStatementOrDefList ControlStatementOrDef
> CallBodyStatementList CallBodyStatement
> MultiWithAttrib SingleWithAttrib
> AltGuardList GuardStatement
> InterleavedGuardList InterleavedGuardElement
>
> Is it true that the semicolon is optional if the preceeding statement
> ends in a "}" or the statement is the last in the list (followed by a
> "}") and mandatory otherwise?
>
> Cheers,
> --
>
> Carl Cerecke - Software Designer
> Da Vinci Communications Ltd
> Christchurch - New Zealand
>
> TEL : +64 3 3838311
> FAX : +64 3 3838310
> e-mail: This email address is being protected from spambots. You need JavaScript enabled to view it.
> www : www.davinci-communications.com
>
>
>
> Wykorzystaj mnie... >>> link.interia.pl/f1654
>
>
>


Wydarzenia minuta po minucie... >>> link.interia.pl/f1656

Please Log in to join the conversation.

  • Page:
  • 1

FacebookTwitterGoogle BookmarksRedditNewsvineTechnoratiLinkedin