EX_ID("break", BREAK, BREAK, 0, 0),
EX_ID("case", CASE, CASE, 0, 0),
- EX_ID("char", DECLARE, CHAR, CHAR, 0),
+ EX_ID("char", DECLARE, CHARACTER, CHARACTER, 0),
EX_ID("continue", CONTINUE, CONTINUE, 0, 0),
EX_ID("default", DEFAULT, DEFAULT, 0, 0),
EX_ID("double", DECLARE, FLOATING, FLOATING, 0),
EX_ID("substr", SUBSTR, SUBSTR, STRING, 0),
EX_ID("switch", SWITCH, SWITCH, 0, 0),
EX_ID("unsigned", DECLARE, UNSIGNED, UNSIGNED, 0),
- EX_ID("void", DECLARE, VOID, 0, 0),
+ EX_ID("void", DECLARE, VOIDTYPE, 0, 0),
EX_ID("while", WHILE, WHILE, 0, 0),
EX_ID({0}, 0, 0, 0, 0)
string, char, fmt->fmt.size, 0);
break;
case 'c':
- if (node->type != CHAR) {
+ if (node->type != CHARACTER) {
exerror("scanf: %s: char variable address argument expected",
node->data.variable.symbol->name);
return -1;
{
*tmp = *expr->data.operand.left;
tmp->data.constant.value = v;
- if ((*ex->disc->stringof) (ex, tmp, 0))
+ if ((*ex->disc->stringof) (ex, tmp, 0, ex->disc))
exerror("%s: no string representation of %s value",
expr->data.operand.left->data.variable.symbol->name,
extypename(ex, expr->data.operand.left->type));
if (!sym)
sym = name ? (Exid_t *) dtmatch(ex->symbols, name) : &ex->main;
if (sym && sym->lex == PROCEDURE && sym->value) {
- if (type != DELETE)
+ if (type != DELETE_T)
return excast(ex, sym->value->data.procedure.body, type,
NiL, 0);
exfreenode(ex, sym->value);
exerror("cannot convert %s to STRING", extypename(p, type));
if (x->op != CONSTANT) {
if (!BUILTIN(type)) {
- if ((*p->disc->stringof) (p, x, 1) < 0) {
+ if ((*p->disc->stringof) (p, x, 1, p->disc) < 0) {
exerror("cannot convert %s to STRING",
extypename(p, type));
}
}
x = exnewnode(p, cvt, 0, STRING, x, 0);
} else if (!BUILTIN(type)) {
- if ((*p->disc->stringof) (p, x, 0) < 0)
+ if ((*p->disc->stringof) (p, x, 0, p->disc) < 0)
exerror("cannot convert constant %s to STRING",
extypename(p, x->type));
} else
char *s;
char *e;
- if (x && x->type != type && type && type != VOID) {
+ if (x && x->type != type && type && type != VOIDTYPE) {
if (!x->type) {
x->type = type;
return x;
%token MINTOKEN
-%token INT
%token INTEGER
%token UNSIGNED
-%token CHAR
+%token CHARACTER
%token FLOATING
%token STRING
-%token VOID
+%token VOIDTYPE
%token ADDRESS
%token ARRAY
/* previously known as EXID, but EXID is also defined by bison in y.tab.h */
#define EX_ID(n,l,i,t,f) {{0},(l),(i),(t),0,(f),0,{0},n}
-#define DELETE BREAK /* exexpr() delete `type' */
+#define DELETE_T BREAK /* exexpr() delete `type' */
-#define INTEGRAL(t) ((t)>=INT&&(t)<=CHAR)
+#define INTEGRAL(t) ((t)>=INTEGER&&(t)<=CHARACTER)
#define BUILTIN(t) ((t) > MINTOKEN)
/* function type mechanism
/* binary operator function */
char *(*typename) (Expr_t *, int);
/* application type names */
- int (*stringof) (Expr_t *, Exnode_t *, int);
+ int (*stringof) (Expr_t *, Exnode_t *, int, Exdisc_t *);
/* value to string conversion */
Extype_t(*keyf) (Expr_t *, Extype_t, int, Exdisc_t *);
/* dictionary key for external type objects */
switch (exlval.id->lex) {
case DECLARE:
- if (exlval.id->index == CHAR) {
+ if (exlval.id->index == CHARACTER) {
/*
* `char*' === `string'
* the * must immediately follow char