updated limits
This commit is contained in:
parent
e073d7c884
commit
8338a5c59d
17
src/modal.c
17
src/modal.c
|
@ -1,15 +1,19 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#define RULES 0x2000
|
||||||
|
#define DICT 0x10000
|
||||||
|
#define BANK 0x8000
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
unsigned int id, refs;
|
unsigned int id, refs;
|
||||||
char *a, *b;
|
char *a, *b;
|
||||||
} Rule;
|
} Rule;
|
||||||
|
|
||||||
static int flip, quiet, debug, cycles = 0x10000;
|
static int flip, quiet, unused, debug, cycles = 0x10000;
|
||||||
static Rule rules[0x1000], *rules_ = rules, lambda;
|
static Rule rules[RULES], *rules_ = rules, lambda;
|
||||||
static char dict[0x8000], *dict_ = dict, empty;
|
static char dict[DICT], *dict_ = dict, empty;
|
||||||
static char bank_a[0x4000], *src_ = bank_a;
|
static char bank_a[BANK], *src_ = bank_a;
|
||||||
static char bank_b[0x4000], *dst_ = bank_b;
|
static char bank_b[BANK], *dst_ = bank_b;
|
||||||
static char *regs[0x100], stack[0x10], *stack_ = stack;
|
static char *regs[0x100], stack[0x10], *stack_ = stack;
|
||||||
|
|
||||||
#define spacer(c) (c <= ' ' || c == '(' || c == ')')
|
#define spacer(c) (c <= ' ' || c == '(' || c == ')')
|
||||||
|
@ -290,6 +294,7 @@ main(int argc, char **argv)
|
||||||
case 'q': /* quiet */ quiet = 1; break;
|
case 'q': /* quiet */ quiet = 1; break;
|
||||||
case 'p': /* debug */ debug = 1; break;
|
case 'p': /* debug */ debug = 1; break;
|
||||||
case 'n': /* infinite */ cycles = 0xffffffff; break;
|
case 'n': /* infinite */ cycles = 0xffffffff; break;
|
||||||
|
case 'u': /* unused */ unused = 1; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!(f = fopen(argv[i], "r")))
|
if(!(f = fopen(argv[i], "r")))
|
||||||
|
@ -314,7 +319,7 @@ main(int argc, char **argv)
|
||||||
if(!quiet) {
|
if(!quiet) {
|
||||||
while(rules_-- > rules) {
|
while(rules_-- > rules) {
|
||||||
if(rules_->a) {
|
if(rules_->a) {
|
||||||
if(!rules_->refs)
|
if(unused && !rules_->refs)
|
||||||
fprintf(stderr, "-- Unused rule: %d <> (%s) (%s)\n", rules_->id, rules_->a, rules_->b);
|
fprintf(stderr, "-- Unused rule: %d <> (%s) (%s)\n", rules_->id, rules_->a, rules_->b);
|
||||||
if(debug)
|
if(debug)
|
||||||
fprintf(stderr, " (%s) (%s), %d times.\n", rules_->a, rules_->b, rules_->refs);
|
fprintf(stderr, " (%s) (%s), %d times.\n", rules_->a, rules_->b, rules_->refs);
|
||||||
|
|
Loading…
Reference in New Issue