Added function registering, added gettext

This commit is contained in:
Jesse van den Kieboom 2006-01-02 17:46:20 +00:00
parent b553e1791b
commit 65c9d12baa
1 changed files with 21 additions and 18 deletions

View File

@ -42,6 +42,7 @@
//#include "sym_table.h"
#include "utils.h"
#include "version.h"
#include "../gm-support.h"
static Stmt *prog_start;
static int dollars_ok;
@ -306,9 +307,9 @@ excepts:
count++;
}
if (!tmp->codes)
yyerror("Unreachable EXCEPT clause");
yyerror(_("Unreachable EXCEPT clause"));
else if (count > 255)
yyerror("Too many EXCEPT clauses (max. 255)");
yyerror(_("Too many EXCEPT clauses (max. 255)"));
}
except
{
@ -420,7 +421,7 @@ expr:
| '$'
{
if (!dollars_ok)
yyerror("Illegal context for `$' expression.");
yyerror(_("Illegal context for `$' expression."));
$$ = alloc_expr(EXPR_LENGTH);
}
| expr '=' expr
@ -433,15 +434,15 @@ expr:
e->e.scatter = scatter_from_arglist(e->e.list);
vet_scatter(e->e.scatter);
} else
yyerror("Empty list in scattering assignment.");
yyerror(_("Empty list in scattering assignment."));
} else {
if (e->kind == EXPR_RANGE)
e = e->e.range.base;
while (e->kind == EXPR_INDEX)
e = e->e.bin.lhs;
if (e->kind != EXPR_ID && e->kind != EXPR_PROP)
yyerror("Illegal expression on left side of"
" assignment.");
yyerror(_("Illegal expression on left side of"
" assignment."));
}
$$ = alloc_binary(EXPR_ASGN, $1, $3);
}
@ -465,7 +466,7 @@ expr:
fname->e.var.v.str = $1;
a->next = $3;
warning("Unknown built-in function: ", $1);
warning(_("Unknown built-in function: "), $1);
$$->e.call.func = number_func_by_name("call_function");
$$->e.call.args = a;
} else {
@ -787,7 +788,7 @@ start_over:
goto start_over;
}
if (c == EOF) {
yyerror("End of program while in a comment");
yyerror(_("End of program while in a comment"));
return c;
}
}
@ -807,7 +808,7 @@ start_over:
c = lex_getc();
}
if (!isdigit(c)) {
yyerror("Malformed object number");
yyerror(_("Malformed object number"));
lex_ungetc(c);
return 0;
}
@ -863,7 +864,7 @@ start_over:
c = lex_getc();
}
if (!isdigit(c)) {
yyerror("Malformed floating-point literal");
yyerror(_("Malformed floating-point literal"));
lex_ungetc(c);
return 0;
}
@ -882,7 +883,7 @@ start_over:
d = strtod(reset_stream(token_stream), 0);
if (!IS_REAL(d)) {
yyerror("Floating-point literal out of range");
yyerror(_("Floating-point literal out of range"));
d = 0.0;
}
yylval.real = alloc_float(d);
@ -910,7 +911,7 @@ start_over:
return t;
} else { /* New keyword being used as an identifier */
if (!must_rename_keywords)
warning("Renaming old use of new keyword: ", buf);
warning(_("Renaming old use of new keyword: "), buf);
must_rename_keywords = 1;
}
}
@ -927,7 +928,7 @@ start_over:
if (c == '\\')
c = lex_getc();
if (c == '\n' || c == EOF) {
yyerror("Missing quote");
yyerror(_("Missing quote"));
break;
}
stream_add_char(token_stream, c);
@ -978,7 +979,7 @@ scatter_from_arglist(Arg_List *a)
dealloc_node(a->expr);
dealloc_node(a);
} else {
yyerror("Scattering assignment targets must be simple variables.");
yyerror(_("Scattering assignment targets must be simple variables."));
return 0;
}
}
@ -994,7 +995,7 @@ vet_scatter(Scatter *sc)
for (; sc; sc = sc->next) {
if (sc->kind == SCAT_REST) {
if (seen_rest)
yyerror("More than one `@' target in scattering assignment.");
yyerror(_("More than one `@' target in scattering assignment."));
else
seen_rest = 1;
}
@ -1002,7 +1003,7 @@ vet_scatter(Scatter *sc)
}
if (count > 255)
yyerror("Too many targets in scattering assignment.");
yyerror(_("Too many targets in scattering assignment."));
}
struct loop_entry {
@ -1067,9 +1068,9 @@ check_loop_name(const char *name, enum loop_exit_kind kind)
if (!name) {
if (!loop_stack || loop_stack->is_barrier) {
if (kind == LOOP_BREAK)
yyerror("No enclosing loop for `break' statement");
yyerror(_("No enclosing loop for `break' statement"));
else
yyerror("No enclosing loop for `continue' statement");
yyerror(_("No enclosing loop for `continue' statement"));
}
return;
}
@ -1101,6 +1102,8 @@ parse_program(DB_Version version, Parser_Client c, void *data)
dollars_ok = 0;
loop_stack = 0;
language_version = version;
register_bi_functions();
begin_code_allocation();
yyparse();