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 The definitions section contains a combination of • Definitions, in the form "name space translation" • Included code, in the form "space code" • Included code, in the form %{ code % } • Start conditions, in the form %5 name1 name2 ... • Character set tables, in the form %T number space character-string %T • Changes to internal array sizes, in the form %x nnn lex: Lexical Analyzer Generator where nnn is a decimal integer representing an array size and x selects the parameter as follows: Letter p n e a k 0 Parameter positions states tree nodes transitions packed character classes output array size Lines in the rules section have the form expression action where the action may be continued on succeeding lines by using braces to delimit it. 9-23

lex: Lexical Analyzer Generator Regular expressions in lex use the following operators: x The character x "x" An x, even if x is an operator \x An x, even if x is an operator [xy] The character x or y [x-z] The characters x, y, or z ["x] Any character but x "x X x$ x? x* x+ xly (x} x/y {xx} x{m,n} 9-24 Any character but newline An x at the beginning of a line An x when lex is in start condition y An x at the end of a line An optional x 0,1,2, ••• instances of x 1,2,3, .•. instances of x An x or a y An x An x but only if followed by y The translation of xx from the definitions section m through n occurrences of x XENIX Programming

lex: Lexical Analyzer Generator<br />

Regular expressions in lex use the following operators:<br />

x The character x<br />

"x" An x, even if x is an operator<br />

\x An x, even if x is an operator<br />

[xy] The character x or y<br />

[x-z] The characters x, y, or z<br />

["x] Any character but x<br />

"x<br />

X<br />

x$<br />

x?<br />

x*<br />

x+<br />

xly<br />

(x}<br />

x/y<br />

{xx}<br />

x{m,n}<br />

9-24<br />

Any character but newline<br />

An x at the beginning of a line<br />

An x when lex is in start condition y<br />

An x at the end of a line<br />

An optional x<br />

0,1,2, ••• instances of x<br />

1,2,3, .•. instances of x<br />

An x or a y<br />

An x<br />

An x but only if followed by y<br />

The translation of xx from the definitions section<br />

m through n occurrences of x<br />

<strong>XENIX</strong> Programming

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

Saved successfully!

Ooh no, something went wrong!