/* Copyright (c) 1980 Regents of the University of California */
/* sccs id: @(#)ex_re.h 6.1 %G% */
* Regular expression definitions.
* The regular expressions in ex are similar to those in ed,
* with the addition of the word boundaries from Toronto ed
* and allowing character classes to have [a-b] as in the shell.
* The numbers for the nodes below are spaced further apart then
* necessary because I at one time partially put in + and | (one or
* There are three regular expressions here, the previous (in re),
* the previous substitute (in subre) and the previous scanning (in scanre).
* It would be possible to get rid of "re" by making it a stack parameter
* to the appropriate routines.
struct regexp re
; /* Last re */
struct regexp scanre
; /* Last scanning re */
struct regexp subre
; /* Last substitute re */
* Defining circfl and expbuf like this saves us from having to change
* old code in the ex_re.c stuff.
* Since the phototypesetter v7-epsilon
* C compiler doesn't have structure assignment...
#define savere(a) copy(&a, &re, sizeof (struct regexp))
#define resre(a) copy(&re, &a, sizeof (struct regexp))
* Definitions for substitute
char *braslist
[NBRA
]; /* Starts of \(\)'ed text in lhs */
char *braelist
[NBRA
]; /* Ends... */
char rhsbuf
[RHSSIZE
]; /* Rhs of last substitute */
* Definitions of codes for the compiled re's.
* The re algorithm is described in a paper
* by K. Thompson in the CACM about 10 years ago
* and is the same as in ed.