Intel XENIX 286 Programmers Guide (86) - Tenox.tc

Intel XENIX 286 Programmers Guide (86) - Tenox.tc Intel XENIX 286 Programmers Guide (86) - Tenox.tc

09.06.2013 Views

XENIX Programming Programm ing Commands ratfor (continued) Translation of relationals: >, > =,etc., become .GT., .GE., etc. Return (expression): Define: Include: returns expression to caller from function define name replacement include filename The option -h causes quoted strings to be turned into 27H constructs. -C copies comments to the output, and attempts to format it neatly. Normally, continuation lines are marked with an &. in colu mn 1; the option -6x makes the continuation character x and places it in colu mn 6. Notes This program translates its input into FORTRAN source code, which in segmented programming environments is suitable for compiling as a small model program only. 8-103

Programming Commands XENIX Programming regcmp - Syntax regcmp [-1 file Description Compiles regular expressions. regcmp, in most cases, precludes the need for calling regcmp from C programs. This saves on both execution time and program size. The command regcmp compiles the regular expressions in file and places the output in fiZe.i. If the - option is used, the output will be placed in fiZe.c. The format of entries in file is a name (C variable) followed by one or more blanks followed by a regular expression enclosed in double quotation marks. The output of regcmp is C source code. Compiled regular expressions are represented as extern char vectors. fiZe.i files may thus be included into C programs, or fiZe.c files may be compiled and later loaded. In the C program that uses the regcmp output, regex(abc,line), applies the regular expression named abc to line. Diagnostics are selfexplanatory. Examples name 1 1 ([A-Za-z][A-Za-z0-9 ]*)$011 tel no 11\( {0, 1 }([2-9][0 1 ][ 1 -9])$0\){0, 1 } * II II ([2-9][0-91{2} )$1 [-]{0, 1} II I I ([0-9]{ 4})$211 In the C program that uses the regcmp output regex(telno, line, area, exch, rest) will apply the regular expression named telno to line. See Also regex in "System Functions" in the XENIX 286 C Library Guide B-104

Programming Commands <strong>XENIX</strong> Programming<br />

regcmp -<br />

Syntax<br />

regcmp [-1 file<br />

Description<br />

Compiles regular expressions.<br />

regcmp, in most cases, precludes the need for calling regcmp from C programs. This<br />

saves on both execution time and program size. The command regcmp compiles the<br />

regular expressions in file and places the output in fiZe.i. If the - option is used, the<br />

output will be placed in fiZe.c. The format of entries in file is a name (C variable)<br />

followed by one or more blanks followed by a regular expression enclosed in double<br />

quotation marks.<br />

The output of regcmp is C source code. Compiled regular expressions are represented<br />

as extern char vectors. fiZe.i files may thus be included into C programs, or fiZe.c files<br />

may be compiled and later loaded. In the C program that uses the regcmp output,<br />

regex(abc,line), applies the regular expression named abc to line. Diagnostics are selfexplanatory.<br />

Examples<br />

name 1 1 ([A-Za-z][A-Za-z0-9 ]*)$011<br />

tel no<br />

11\( {0, 1 }([2-9][0 1 ][ 1 -9])$0\){0, 1 } * II<br />

II ([2-9][0-91{2} )$1 [-]{0, 1} II<br />

I<br />

I ([0-9]{ 4})$211<br />

In the C program that uses the regcmp output<br />

regex(telno, line, area, exch, rest)<br />

will apply the regular expression named telno to line.<br />

See Also<br />

regex in "System Functions" in the <strong>XENIX</strong> <strong>2<strong>86</strong></strong> C Library <strong>Guide</strong><br />

B-104

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!