blang/src/blang.c

25 lines
376 B
C

#include <stdio.h>
#include <stdlib.h>
#include "blang.h"
#include "ops.h"
int main(int argc, char **argv){
struct State s;
int c;
void (*op)(struct State *);
s.chart = *argv;
while((c = getc(stdin)) != EOF){
/* proper exit is ^* */
if(s.chart == (char *)0)
return (int)s.hand;
if((op = Ops_lookup(c)) == NULL)
continue;
else
op(&s);
}
return 1;
}