551 while (*t1!=0 && *t1!=
'/') {
557 if ((
int)strlen(user)>0) {
561 r=(
char *)malloc(strlen(user)+strlen(t1)+1);
562 sprintf(r,
"%s%s",user,t1);
570 r=(
char *)malloc(strlen(home)+strlen(s)+1);
571 sprintf(r,
"%s%s",home,s+1);
604 if ((stdin_flag=(!strcmp(file,
"stdin")))) {
614 Errorline(
"file '%s' does not exist.\n",file);
653 if (!strcmp(file,
"stdout"))
656 if (!strcmp(file,
"stderr"))
662 Errorline(
"file '%s' could not be opened for output.\n",file);
732 Errorline(
"in tokenizer, put_back_char three times (last=%d).\n",c);
749 Errorline(
"in parser, put_back_token three times (last=%P).\n",t);
785 }
while (c!=EOF && c!=
EOLN);
842 fprintf(stderr,
"base2int('%c'): illegal argument\n",n);
847 #define isoctal(c) (c=='0'||c=='1'||c=='2'||c=='3'||c=='4'||c=='5'||c=='6'||c=='7')
876 else if (e==
'"' && c==
'\\') {
886 case 'a': c=
'\a';
break;
887 case 'b': c=
'\b';
break;
888 case 'f': c=
'\f';
break;
889 case 'n': c=
'\n';
break;
890 case 'r': c=
'\r';
break;
891 case 't': c=
'\t';
break;
892 case 'v': c=
'\v';
break;
903 else if (!isxdigit(c)) {
912 if (isxdigit(c)) n = 16*n+
base2int(c);
941 warningline(
"string too long, extra ignored (%E).\n");
1043 warningline(
"name too long, extra ignored (%E).\n");
1053 if(module && len==0) {
1140 if (c==
'e' || c==
'E') {
1142 if (c2==
'+' || c2==
'-' ||
DIGIT(c2)) {
1144 posflag = (c2==
'+' ||
DIGIT(c2));
1150 while (pwr>=100) { pwr-=100;
if (posflag) p*=1e100;
else p/=1e100; }
1151 while (pwr>=10 ) { pwr-=10;
if (posflag) p*=1e10;
else p/=1e10; }
1152 while (pwr>0 ) { pwr-=1;
if (posflag) p*=1e1;
else p/=1e1; }
1223 }
while(c!=EOF && (c<=32));
1252 if(c==
'.' || c==
'?') {
1256 if(c2<=
' ' || c2==EOF) {
1290 Errorline(
"illegal character %d in input (%E).\n",c);
1299 if (!strcmp((
char *)tok->
value_3,
"_")) {
1343 else if (c<0 || c>32) {
1347 }
while(c && c!=EOF);
1349 if (for_parser)
prompt=
"| ";
void begin_terminal_io()
begin_terminal_io
void psi_term_error()
psi_term_error
long open_output_file(string file)
open_output_file
void init_parse_state()
init_parse_state
#define FEATCMP
indicates to use featcmp for comparison (in trees.c)
#define LINE_COUNT
feature name
ptr_definition lf_false
symbol in bi module
ptr_definition nothing
symbol in bi module
ptr_definition integer
symbol in bi module
ptr_definition final_question
symbol in syntax module
void read_token_b(ptr_psi_term tok)
read_token_b
void bk_stack_add_psi_attr(ptr_psi_term t, char *attrname, ptr_psi_term g)
bk_stack_add_psi_attr
ptr_module create_module(char *module)
ptr_module create_module(char *module)
ptr_node bk_stack_insert(long comp, char *keystr, ptr_node *tree, GENERIC info)
bk_stack_insert
long psi_term_line_number
void heap_mod_int_attr(ptr_psi_term t, char *attrname, long value)
heap_mod_int_attr
int base2int(int n)
base2int
ptr_module current_module
The current module for the tokenizer.
ptr_definition cut
symbol in syntax module
#define SAVED_PSI_TERM
feature name
ptr_psi_term heap_psi_term(long stat)
heap_psi_term
#define OLD_SAVED_CHAR
feature name
void save_state(ptr_psi_term t)
save_state
ptr_definition comment
symbol in bi module
void save_parse_state(ptr_parse_block pb)
save_parse_state
void put_back_token(psi_term t)
put_back_token
void stdin_cleareof()
stdin_cleareof
#define CURRENT_MODULE
feature name
ptr_definition stream
symbol in bi module
void perr_s(char *s1, char *s2)
perr_s
struct wl_psi_term * ptr_psi_term
quotedStackCopy
#define global_it
was enum (def_type) in extern.h now there is typedef ptr_definition
ptr_node bk2_stack_insert(long comp, char *keystr, ptr_node *tree, GENERIC info)
bk2_stack_insert
void read_name(ptr_psi_term tok, long ch, long(*f)(long), ptr_definition typ)
read_name
void end_terminal_io()
end_terminal_io
#define REAL
Which C type to use to represent reals and integers in Wild_Life.
void read_string(ptr_psi_term tok, long e)
read_string
long parse_ok
indicates whether there was a syntax error
ptr_definition update_symbol(ptr_module module, char *symbol)
update_symbol
ptr_node heap_insert(long comp, char *keystr, ptr_node *tree, GENERIC info)
heap_insert
ptr_psi_term null_psi_term
Used to represent an empty parse token.
ptr_definition real
symbol in bi module
ptr_definition inputfilesym
symbol in bi module
void read_string_error(int n)
read_string_error
void Errorline(char *format,...)
Errorline.
unsigned long * GENERIC
unsigned long *GENERIC
ptr_definition variable
symbol in bi module
void stack_add_psi_attr(ptr_psi_term t, char *attrname, ptr_psi_term g)
stack_add_psi_attr
void read_token_main(ptr_psi_term tok, long for_parser)
read_token_main
void read_number(ptr_psi_term tok, long c)
read_number
ptr_node stack_insert(long comp, char *keystr, ptr_node *tree, GENERIC info)
stack_insert
void infoline(char *format,...)
infoline
char * heap_copy_string(char *s)
heap_copy_string
ptr_definition final_dot
symbol in syntax module
void restore_state(ptr_psi_term t)
restore_state
void Syntaxerrorline(char *format,...)
Syntaxerrorline.
#define TRUE
Standard boolean.
#define STREAM
feature name
#define START_OF_LINE
feature name
void heap_add_str_attr(ptr_psi_term t, char *attrname, char *str)
heap_add_str_attr
#define STRCMP
indicates to use strcmp for comparison (c function)
ptr_definition eof
symbol in syntax module
void heap_add_psi_attr(ptr_psi_term t, char *attrname, ptr_psi_term g)
heap_add_psi_attr
ptr_definition constant
symbol in bi module
ptr_psi_term global_value
#define FALSE
Standard boolean.
ptr_psi_term stack_psi_term(long stat)
stack_psi_term
#define INPUT_FILE_NAME
feature name
#define OLD_SAVED_PSI_TERM
feature name
void heap_add_int_attr(ptr_psi_term t, char *attrname, long value)
heap_add_int_attr
char * expand_file_name(char *s)
expand_file_name
void new_state(ptr_psi_term *t)
new_state
ptr_node find(long comp, char *keystr, ptr_node tree)
find
long legal_in_name(long c)
legal_in_name
GENERIC get_attr(ptr_psi_term t, char *attrname)
get_attr
ptr_psi_term stack_copy_psi_term(psi_term t)
stack_copy_psi_term
void stack_add_str_attr(ptr_psi_term t, char *attrname, char *str)
stack_add_str_attr
ptr_psi_term saved_psi_term
ptr_psi_term error_psi_term
symbol in bi module
void read_comment(ptr_psi_term tok)
read_comment
long stdin_terminal
set in init_io in lib.c to true - never changed - used in token.c
#define EOF_FLAG
feature name
long symbolic(long c)
symbolic
void restore_parse_state(ptr_parse_block pb)
restore_parse_state
void stack_add_int_attr(ptr_psi_term t, char *attrname, long value)
stack_add_int_attr
void heap_mod_str_attr(ptr_psi_term t, char *attrname, char *str)
heap_mod_str_attr
#define STRLEN
Maximum size of file names and input tokens (which includes input strings) (Note: calculated tokens c...
void TOKEN_ERROR(ptr_psi_term p)
TOKEN_ERROR.
void warningline(char *format,...)
warningline
FILE * get_stream(ptr_psi_term t)
get_stream
ptr_definition lf_true
symbol in bi module
#define SAVED_CHAR
feature name
long open_input_file(char *file)
open_input_file
long read_char()
read_char
ptr_definition quoted_string
symbol in bi module
void perr_i(char *str, long i)
perr_i
GENERIC heap_alloc(long s)
heap_alloc
ptr_choice_point choice_stack
ptr_psi_term old_saved_psi_term
void read_token(ptr_psi_term tok)
read_token
char * stack_copy_string(char *s)
stack_copy_string
void put_back_char(long c)
put_back_char