next up previous 204
Next: Flagging a Group Expression
Up: Group Expressions
Previous: Modification Elements


Nesting Within Group Expressions

There is sometimes a clash of interests to be resolved when deciding on the best choice for the character which delimits elements within a group expression. The default delimiter character is the comma, but this character can sometimes be useful within an element, for instance when specifying a set of indices. For instance, if the user gave the group expression:

      A(1,2),B(3,10)

in which each element is a literal name corresponding to an array element, it would be wrong to split this up using the commas as delimiters into the four strings ``A(1'', ``2)'', ``B(3'' and ``10)''.

To get round this particular problem, GRP ignores delimiters which occur within matching ``nesting characters''. There are two nesting characters, the ``open nest'' character (usually set to ``('') and the ``close nest'' character (usually set to ``)''). Thus in the above example, the commas occurring within the parentheses would not be treated as delimiters, resulting in the group expression being split into the two elements A(1,2) and B(3,10). The characters to use as the opening and closing nest characters may be set by the calling application (see section [*]).


next up previous 204
Next: Flagging a Group Expression
Up: Group Expressions
Previous: Modification Elements

GRP Routines for Managing Groups of Objects
Starlink User Note 150
D.S. Berry
21st October 2009
E-mail:ussc@star.rl.ac.uk

Copyright © 2009 Science and Technology Facilities Council