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

TOPIC: Length restriction

Length restriction 03 Oct 2006 08:46 #6951

Hi All

In the TTCN-3 standard section B 1.4.1 says that 'length' restriction may be
used as an attribute of the AnyElement or AnyElementOrNone (not inside
permutation).

Just to refresh memory.
B.1.3.1: The matching symbol "?" (AnyElement) is used to indicate that it
replaces single elements of a string (except character strings), a record of, a
set of or an array. It shall be used only within values of string types, record
of types, set of types and arrays.
B.1.3.2: The matching symbol "*" (AnyElementsOrNone) is used to indicate that it
replaces none or any number of consecutive elements of a string (except
character strings), a record of, a set of or an array. The "*"
symbol matches the longest sequence of elements possible, according to the
pattern as specified by the symbols surrounding the "*".


So it means that the following is correct, isn't it?
type record of integer ROI;
template ROI t_ROI := {* length (3), 7, *} // exactly the same as {?, ?, ?, 7,
*}

1) But could you tell me what does it mean when 'length' is used with AnyElement
(not AnyValue), i.e. '?'. Is it redundant in this case?
template ROI t_ROI := {? length (3)} //what does this template express?

2) And since AnyElement may be used inside bit/octet/hexstring templates I guess
it's legal to write the following although template declaration looks very
suspicious:
template bitstring t_bitstr := '* length(3) 000111*'B // exactly the same as
'???000111*'B ?

Best regards,
/Pavel
The administrator has disabled public write access.

Length restriction 10 Oct 2006 07:40 #6957

Hi,

> 2) And since AnyElement may be used inside bit/octet/hexstring
templates I guess
> it's legal to write the following although template declaration looks
very suspicious:
> template bitstring t_bitstr := '* length(3) 000111*'B // exactly the
same as '???000111*'B ?

I always thought, AnyElement may be written in matching expressions for string
as well:

template charstring t_charstr := pattern "* length(3) xyz"

Question 1: How is the whitespace after the length(3) interpreted ?

Question 2: If no legel length() expression follows, it the length(
then part of the charstring, instead of part of the * ?

template charstring t_:charstr2 := pattern "* length(4] xyz"

Question 3: If inside a character pattern the character * or ? should be
written, how is that done ?

Kind regards,
Matthias


Innovation 2006 - die Telelogic Anwenderkonferenz Westin Bellevue Hotel,
Dresden, 8. bis 10. November 2006 www.telelogic.com/ugc_de

Dr. Matthias Jung
Senior Consultant
Telelogic Deutschland GmbH, Otto-Brenner-Str. 247, Bielefeld, D-33604, = Germany
Phone: +49 (521) 145 0333
Fax: +49 (521) 145 0350
Mobile phone: +49 (170) 1892704

This email address is being protected from spambots. You need JavaScript enabled to view it.
www.telelogic.de

Telelogic - Requirements-Driven Innovation!
Telelogic - Product Life Demo
Aktuelle Events:
Effective Requirements Management, 16.-17.10.2006, in = Bielefeld
Using DOORS for Requirements Management, 18.-19.10.2006, = in
Bielefeld
SYNERGY/CM 6.4 Upgrade, 26.10.2006, in Hallbergmoos
Registrieren: www.telelogic.de/company/events/index.cfm





The information contained in this e-mail, including any attachment or =
enclosure, is intended only for the person or entity to which it is = addressed
and may contain confidential material. Any unauthorised use, = review,
retransmissions, dissemination, copying or other use of this = information by
persons or entities other than the intended recipient is = prohibited.
The administrator has disabled public write access.

Length restriction 10 Oct 2006 08:51 #6959

Hi

>> 2) And since AnyElement may be used inside bit/octet/hexstring
>>templates I guess it's legal to write the following although template
>>declaration looks very suspicious:
>> template bitstring t_bitstr := '* length(3) 000111*'B // exactly the
>>same as '???000111*'B ?

>I always thought, AnyElement may be written in matching expressions for
>string as well:

> template charstring t_charstr := pattern "* length(3) xyz"

Yes, but length restrictions in 'pattern' expressions are specified using
#(n,m) notation. Above template will look like:
template charstring t_charstr := pattern "?#3xyz"

>Question 1: How is the whitespace after the length(3) interpreted ?

"length(3)" inside 'pattern' simply matches "length3" while brackets are treated
as grouping symbols thus above pattern may be rewritten as
template charstring t_charstr := pattern "* length3 xyz"

>Question 3: If inside a character pattern the character * or ? should be
> written, how is that done ?

I think section B1.3.1 wants to say that "?" used inside character strings is
treated as AnyElement only in 'pattern' expressions but in simple character
string template it's treated as "?" character. And this differs from
bit/octet/hexstring templates.

I think table 6 in section 14.3.0 is a bit confusing. It should note this
peculiarity.

Best regards,
/Pavel
The administrator has disabled public write access.
  • Page:
  • 1

FacebookTwitterGoogle BookmarksRedditNewsvineTechnoratiLinkedin