A procedural approach to pattern matching in SNOBOL4

  • Authors:
  • Frederick C. Druseikis;John N. Doyle

  • Affiliations:
  • -;-

  • Venue:
  • ACM '74 Proceedings of the 1974 annual conference - Volume 1
  • Year:
  • 1974

Quantified Score

Hi-index 0.02

Visualization

Abstract

This paper presents a methodology for describing and implementing pattern matching in SNOBOL4. The basic element of the formulation is the coroutine. The coroutine notion permits a complete procedural implementation as well as a concise description of the pattern-matching process. Matching procedures are represented by co-routines whose order of invocation is determined from the tree structure of a given pattern. The context for a coroutine's operation maintains the details of a local matching process. Side effects that may require reversal in the event of backtracking are undone by the coroutine that caused the effect. The system described has been used to implement extensions to the existing pattern-matching facilities of SNOBOL4.