summaryrefslogtreecommitdiff
path: root/lib/meta.c
diff options
context:
space:
mode:
authorPixel <>2001-04-17 06:55:02 +0000
committerPixel <>2001-04-17 06:55:02 +0000
commita7bc5cfa7399926941a3754e3cbdc671f24b4b3d (patch)
tree6527baa45482798b61777cae9bf84eccb44075db /lib/meta.c
parent502e0cd237a9a474b224ab9a741fe4d91ecdec36 (diff)
Pout
Diffstat (limited to 'lib/meta.c')
-rw-r--r--lib/meta.c63
1 files changed, 22 insertions, 41 deletions
diff --git a/lib/meta.c b/lib/meta.c
index 4f71ad7..0392770 100644
--- a/lib/meta.c
+++ b/lib/meta.c
@@ -19,12 +19,8 @@
\*************************/
static char meta_ops[] = ":.;(){}[=, ";
-static char meta_firsts[] =
-
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_";
-static char meta_chars[] =
-
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_0123456789";
+static char meta_firsts[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_";
+static char meta_chars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_0123456789";
phon_t *phons = NULL;
field_t *fields = NULL;
@@ -127,8 +123,7 @@ void meta_parse_line(char *line)
}
if (*line) {
if (*line != ';') {
- exception(1,
- _("Expecting ';' for field separator."));
+ exception(1, _("Expecting ';' for field separator."));
}
line++;
gotname = 0;
@@ -249,9 +244,7 @@ void meta_parse_line(char *line)
if (isident(buffer)) {
p1 = Estrdup(buffer);
if (*line != '=') {
- exception(1,
- _
- ("Expecting operator '=' for field 'p'."));
+ exception(1, _("Expecting operator '=' for field 'p'."));
}
line++;
} else {
@@ -345,9 +338,8 @@ void meta_parse_line(char *line)
instruct->strings = (char **)
Emalloc(nbfields * sizeof(char *));
- instruct->etypes =
+ instruct->etypes = (int *) Emalloc(nbfields * sizeof(int));
- (int *) Emalloc(nbfields * sizeof(int));
instruct->implicits = (char **)
Emalloc(nbimplicit * sizeof(char *));
@@ -598,11 +590,9 @@ void main(void)
fprintf(stderr, "\nListe des champs:\n");
for (field = fields->next; field; field = field->next) {
- fprintf(stderr, " o Champ nommé %s, contenant %i parties:\n",
- field->name, field->nbr);
+ fprintf(stderr, " o Champ nommé %s, contenant %i parties:\n", field->name, field->nbr);
for (i = 0; i < field->nbr; i++) {
- fprintf(stderr, " + %s (%i bits)\n", field->names[i],
- field->sizes[i]);
+ fprintf(stderr, " + %s (%i bits)\n", field->names[i], field->sizes[i]);
}
}
@@ -613,33 +603,26 @@ void main(void)
pattern->name, pattern->nbr);
for (i = 0; i < pattern->nbr; i++) {
fprintf(stderr, " + %s (%s) type: %s\n",
- pattern->expr[i]->name ? pattern->
- expr[i]->name : "Opérateur [",
- pattern->expr[i]->string ? pattern->
- expr[i]->string : "Aucune chaîne associée",
- pattern->
- expr[i]->type ? "Constante prédéfinie" : pattern->expr[i]->
- left ? "Binaire" : pattern->
- expr[i]->right ? "Unaire" : "Feuille");
+ pattern->expr[i]->name ? pattern->expr[i]->name : "Opérateur [",
+ pattern->expr[i]->string ? pattern->expr[i]->string : "Aucune chaîne associée",
+ pattern->expr[i]->type ? "Constante prédéfinie" : pattern->
+ expr[i]->left ? "Binaire" : pattern->expr[i]->right ? "Unaire" : "Feuille");
if (pattern->expr[i]->left) {
fprintf(stderr,
" - gauche: %s (%s) type: %s\n",
- pattern->expr[i]->left->name ? pattern->expr[i]->left->
- name : "Opérateur [",
- pattern->expr[i]->left->string ? pattern->expr[i]->
- left->string : "Aucune chaîne associée",
- pattern->expr[i]->
- left->type ? "Constante prédéfinie" : "Feuille");
+ pattern->expr[i]->left->name ? pattern->expr[i]->left->name : "Opérateur [",
+ pattern->expr[i]->left->string ? pattern->expr[i]->left->
+ string : "Aucune chaîne associée",
+ pattern->expr[i]->left->type ? "Constante prédéfinie" : "Feuille");
}
if (pattern->expr[i]->right) {
fprintf(stderr,
" - droite: %s (%s) type: %s\n",
- pattern->expr[i]->right->name ? pattern->expr[i]->
- right->name : "Opérateur [",
- pattern->expr[i]->right->string ? pattern->expr[i]->
- right->string : "Aucune chaîne associée",
- pattern->expr[i]->
- right->type ? "Constante prédéfinie" : "Feuille");
+ pattern->expr[i]->right->name ? pattern->expr[i]->right->
+ name : "Opérateur [",
+ pattern->expr[i]->right->string ? pattern->expr[i]->right->
+ string : "Aucune chaîne associée",
+ pattern->expr[i]->right->type ? "Constante prédéfinie" : "Feuille");
}
}
}
@@ -653,10 +636,8 @@ void main(void)
for (i = 0; i < instruct->nbexplicit; i++) {
fprintf(stderr, " + %s <= %s (type %s)\n",
instruct->names[i],
- instruct->
- strings[i] ? instruct->strings[i] :
- "Pas de chaîne associée",
- instruct->etypes[i] ? "prédéfinit" : "direct");
+ instruct->strings[i] ? instruct->strings[i] :
+ "Pas de chaîne associée", instruct->etypes[i] ? "prédéfinit" : "direct");
}
fprintf(stderr, " => Champs implicites.\n");
for (i = 0; i < instruct->nbimplicit; i++) {