a procedural approach to pattern matching in snobol4
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.
procedure pattern match pattern matching paper methodology implementation coroutines completeness process order tree structure context locality effect event backtracking systems extensibility control structures