fprintf(outfile, "\t");
if (pVector[i]) {
Operator o;
- NonTerminal t;
+ NonTerminal t1, t2;
fprintf(outfile, "{");
fprintf(outfile, "%5d, %5d, %5d, %5d",
pVector[i]->rule->lhs->num,
(o = pVector[i]->rule->pat->op) ? o->num : 0,
- (t = pVector[i]->rule->pat->children[0]) ? t->num : 0,
- (t = pVector[i]->rule->pat->children[1]) ? t->num : 0
+ (t1 = pVector[i]->rule->pat->children[0]) ? t1->num : 0,
+ (t2 = pVector[i]->rule->pat->children[1]) ? t2->num : 0
);
fprintf(outfile, "} /* ");
printRule(pVector[i], "0");
};
typedef struct strTable *StrTable;
+extern void doGrammarNts ARGS((void));
+void makeRuleDescArray ARGS((void));
+void makeDeltaCostArray ARGS((void));
+void makeStateStringArray ARGS((void));
+
extern StrTable newStrTable ARGS((void));
extern StrTableElement addString ARGS((StrTable, char *, int, int *));
static char version[] = "BURG, Version 1.0";
-extern void main ARGS((int argc, char **argv));
+extern int main ARGS((int argc, char **argv));
-void
+int
main(argc, argv) int argc; char **argv;
{
int i;
fprintf(stderr, "%s\n", version);
break;
case 'p':
- needStr = &prefix;
+ needStr = (char**)&prefix;
break;
case 'o':
needStr = &outFileName;
for (i = 1; i < globalMap->count; i++) {
sortedStates[i-1] = globalMap->set[i];
}
- qsort(sortedStates, globalMap->count-1, sizeof(Item_Set), stateCompare);
+ qsort(sortedStates, globalMap->count-1, sizeof(Item_Set), (int(*)(const void *, const void *))stateCompare);
previousOp = 0;
for (i = 0; i < globalMap->count-1; i++) {
sortedStates[i]->newNum = i;
sortedRules = (RuleAST*) zalloc(max_ruleAST * sizeof(RuleAST));
count = 0;
foreachList((ListFn) assignRules, ruleASTs);
- qsort(sortedRules, max_ruleAST, sizeof(RuleAST), ruleCompare);
+ qsort(sortedRules, max_ruleAST, sizeof(RuleAST), (int(*)(const void *, const void *))ruleCompare);
previousLHS = 0;
base_counter = 0;
for (i = 0; i < max_ruleAST; i++) {
fprintf(outfile, "\t");
if (pVector[i]) {
Operator o;
- NonTerminal t;
+ NonTerminal t1, t2;
fprintf(outfile, "{");
fprintf(outfile, "%5d, %5d, %5d, %5d",
pVector[i]->rule->lhs->num,
(o = pVector[i]->rule->pat->op) ? o->num : 0,
- (t = pVector[i]->rule->pat->children[0]) ? t->num : 0,
- (t = pVector[i]->rule->pat->children[1]) ? t->num : 0
+ (t1 = pVector[i]->rule->pat->children[0]) ? t1->num : 0,
+ (t2 = pVector[i]->rule->pat->children[1]) ? t2->num : 0
);
fprintf(outfile, "} /* ");
printRule(pVector[i], "0");
};
typedef struct strTable *StrTable;
+extern void doGrammarNts ARGS((void));
+void makeRuleDescArray ARGS((void));
+void makeDeltaCostArray ARGS((void));
+void makeStateStringArray ARGS((void));
+
extern StrTable newStrTable ARGS((void));
extern StrTableElement addString ARGS((StrTable, char *, int, int *));
static char version[] = "BURG, Version 1.0";
-extern void main ARGS((int argc, char **argv));
+extern int main ARGS((int argc, char **argv));
-void
+int
main(argc, argv) int argc; char **argv;
{
int i;
fprintf(stderr, "%s\n", version);
break;
case 'p':
- needStr = &prefix;
+ needStr = (char**)&prefix;
break;
case 'o':
needStr = &outFileName;
for (i = 1; i < globalMap->count; i++) {
sortedStates[i-1] = globalMap->set[i];
}
- qsort(sortedStates, globalMap->count-1, sizeof(Item_Set), stateCompare);
+ qsort(sortedStates, globalMap->count-1, sizeof(Item_Set), (int(*)(const void *, const void *))stateCompare);
previousOp = 0;
for (i = 0; i < globalMap->count-1; i++) {
sortedStates[i]->newNum = i;
sortedRules = (RuleAST*) zalloc(max_ruleAST * sizeof(RuleAST));
count = 0;
foreachList((ListFn) assignRules, ruleASTs);
- qsort(sortedRules, max_ruleAST, sizeof(RuleAST), ruleCompare);
+ qsort(sortedRules, max_ruleAST, sizeof(RuleAST), (int(*)(const void *, const void *))ruleCompare);
previousLHS = 0;
base_counter = 0;
for (i = 0; i < max_ruleAST; i++) {