Browse Prior Art Database

Parallel Detection of Innermost Nested Delimiters

IP.com Disclosure Number: IPCOM000073880D
Original Publication Date: 1971-Feb-01
Included in the Prior Art Database: 2005-Feb-23
Document File: 1 page(s) / 12K

Publishing Venue

IBM

Related People

Painter, JA: AUTHOR

Abstract

Programming in FORTRAN or similar languages may advantageously require the detection of innermost nested delimiters such as a pair of left and right parentheses, in a statement.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 78% of the total text.

Page 1 of 1

Parallel Detection of Innermost Nested Delimiters

Programming in FORTRAN or similar languages may advantageously require the detection of innermost nested delimiters such as a pair of left and right parentheses, in a statement.

A method for detecting such delimiters in a statement or character string S of length N requires setting up three binary bit strings of length N. For parentheses, the three bit strings are called LP, RP and O. For bit string LP, the character string S is scanned and, for each character, the corresponding bit of LP is set to 1 if the character is a left parenthesis, to 0 otherwise. For bit string RP, the corresponding bit for each character is set to 1 if the character is a right parenthesis, to 0 otherwise. For bit string 0, the corresponding bit for each character is set to 1 if the character is other than a left or right parenthesis, to 0 if it is one or the other. Thus, 0 = 7 (LP v RP).

The right delimiter string RP is then shifted left one position to form R*. This may be accomplished by either multiplying RP by 2, by forming RP + RP, or by actually shifting RP left by one position. The result R* is then added (in binary) to bit string 0. The ripple of carries from each right parenthesis during the binary addition forms a 1 at the position of the next parenthesis to the left. These represent either a deeper level of nesting in the case of right parentheses, or the locally deepest level of nesting in the case of left parentheses.

The re...