* Copyright (c) 1983 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
static char sccsid
[] = "@(#)languages.c 5.1 (Berkeley) %G%";
static char rcsid
[] = "$Header: languages.c,v 1.5 84/12/26 10:39:49 linton Exp $";
typedef struct Language
*Language
;
L_PRINTDECL
, L_PRINTVAL
, L_TYPEMATCH
, L_BUILDAREF
, L_EVALAREF
,
L_MODINIT
, L_HASMODULES
, L_PASSADDR
,
typedef LanguageOperation();
LanguageOperation
*op
[20];
* Initialize language information.
* The last language initialized will be the default one
* for otherwise indistinguised symbols.
primlang
= language_define("$builtin symbols", ".?");
public Language
findlanguage(suffix
)
while (lang
!= nil
and not streq(lang
->suffix
, suffix
)) {
public String
language_name(lang
)
return (lang
== nil
) ? "(nil)" : lang
->name
;
public Language
language_define(name
, suffix
)
public language_setop(lang
, op
, operation
)
LanguageOperation
*operation
;
assert(ord(op
) < ord(L_ENDOP
));
lang
->op
[ord(op
)] = operation
;
public LanguageOperation
*language_op(lang
, op
)