blang/src/main.c

24 lines
406 B
C
Raw Normal View History

#include <stdint.h>
2022-12-09 04:45:46 +00:00
#include <stdio.h>
#include <stdlib.h>
2022-12-21 05:12:26 +00:00
#include "libblang.h"
2022-12-09 04:45:46 +00:00
2022-12-10 00:26:10 +00:00
int main(int argc, char **argv){
struct State s;
2022-12-09 04:45:46 +00:00
int c;
2022-12-10 00:26:10 +00:00
void (*op)(struct State *);
2022-12-21 05:12:26 +00:00
s.chart = argv[1];
2022-12-10 02:59:48 +00:00
s.counter = s.chart;
2022-12-10 00:26:10 +00:00
2022-12-21 05:12:26 +00:00
for(s.counter = s.chart; *s.counter != '!'; ++s.counter);
for(;; ++s.counter){
2022-12-10 00:26:10 +00:00
if(s.chart == (char *)0)
return (int)s.hand;
2022-12-21 05:12:26 +00:00
if((op = Ops_lookup(*s.counter)) != NULL)
2022-12-10 00:26:10 +00:00
op(&s);
2022-12-09 04:45:46 +00:00
}
}