home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_11_04
/
1104070b
< prev
next >
Wrap
Text File
|
1992-12-23
|
580b
|
40 lines
/* mixcalc.c */
/* Copyright 1992 by P.J. LaBrocca */
#include "mixed.h"
#include "mixcalc.h"
#include <stdio.h>
#ifdef __ZTC__ /* For Zortech Compiler */
_stack = 15000;
#endif
enum token_value curr_tok;
void main()
{
mixed_t ans;
mixed_t work;
init_primes();
mix_clear( &ans );
mix_init( &work, 3, 1, 7 );
setjmp( startup );
M = &work;
while(1) {
printf("> ");
curr_tok = gettok();
if(curr_tok == END) {
break;
}
if(curr_tok == PRINT)
continue;
ans = expr( );
mix_print( mix_reduce( &ans) );
}
}