6.1.11:Complex Chunk Expressions

複雑なチャンク表現

More complex chunk expressions can be constructed by specifying a chunk within another chunk. For example, the chunk expression word 4 of line 250 specifies the fourth word of line 250.

チャンク内にもう一つのチャンクを含んだより複雑なチャンク表現式を作ることができます。例えば、チャンク表現式「word 4 of line 250」は250行目の四番目の単語を指定しています。

When combining chunks of different types to construct a complex chunk expression, you must specify the chunk types in order. The following statements all include valid chunk expressions:

異なる形式のチャンクを統合して複雑なチャンク表現式を作る時には、チャンクの形式を決められた順序で指定する必要があります。次のステイトメントは全て正しいチャンク表現式を含んでいます。

char 7 of word 3 of myValue
変数「myValue」の3番目の単語の七つ目のキャラクタ

word 9 of item 2 of myValue
変数「myValue」の2つ目のアイテムの九つ目の単語

last char of word 8 of line 4 of myValue
変数「myValue」の四行目の八つ目の単語の最後のキャラクタ


These, however, are not valid chunk expressions:

逆に、次の例は誤ったチャンク表現式です:

word 8 of char 2 of myValue -- chars can't contain words
変数「myValue」の二番目のキャラクタの八つ目の単語;キャラクタは単語を包含できない

item 9 of first word of myValue -- words can't contain items
変数「myValue」の最初の単語の九つ目のアイテム;単語はアイテムを包含できない

line 3 of last item of myValue -- items can't contain lines
変数「myValue」の最後のアイテムの三行目;アイテムは行を包含できない