09.06.2013 Views

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

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

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

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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

lex (continued)<br />

Example<br />

See Also<br />

yacc<br />

Notes<br />

D<br />

%%<br />

if<br />

[a-z] +<br />

O{D} +<br />

{D} +<br />

"+ +"<br />

"+"<br />

"/* "<br />

[0-9]<br />

printf(" IF statement\n");<br />

pri ntf("tag, value %s\n",yytext);<br />

pri ntf("octal number %s\n" ,yytext);<br />

printf("decimal number %s\n" ,yytext);<br />

pri ntf("unary op\n");<br />

printf("bi nary op\n");<br />

{ loop:<br />

while (input() ! = \(fm\(**\(fm);<br />

swi<strong>tc</strong>h (input())<br />

}<br />

{<br />

case \(fm/\(fm: break;<br />

case \(fm\(**\(fm : unput(\(fm\(**\(fm);<br />

default: go to loop;<br />

}<br />

Programming Commands<br />

This program translates its input into C source code, which in segmented programming<br />

environments is suitable for compiling as a small model program only. (See cc.)<br />

B-79

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

Saved successfully!

Ooh no, something went wrong!