Wild Life: parser.c Source File

Wild Life 2.30

- Main Page
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Macros
parser.c
Go to the documentation of this file.
1
7 /* Copyright 1991 Digital Equipment Corporation.
8 ** Distributed only by permission.
9 **
10 ** Last modified on Thu Mar 3 14:16:16 MET 1994 by rmeyer
11 ** modified on Mon Sep 27 09:37:03 1993 by Rmeyer
12 ** modified on Tue Jun 9 14:03:14 1992 by vanroy
13 ** modified on Thu Aug 22 18:14:49 1991 by herve
14 *****************************************************************/
15 /* $Id: parser.c,v 1.2 1994/12/08 23:32:03 duchier Exp $ */
16
17 #include "defs.h"
18
31 int bad_psi_term(ptr_psi_term t)
32 {
33 char *s,c;
34 long r;
35
36 if(t->type==final_dot || t->type==final_question) /* RM: Jul 9 1993 */
37 return TRUE;
38
39 s=t->type->keyword->symbol;
40 c=s[0];
41 r=(s[1]==0 &&
42 (c=='(' ||
43 c==')' ||
44 c=='[' ||
45 c==']' ||
46 c=='{' ||
47 c=='}'
48 /* || c=='.' || c=='?' RM: Jul 7 1993 */
49 )
50 );
51
52 return r;
53 }
54
64 void show(long limit)
65 {
66 long i;
67
68 for (i=1;i<=parser_stack_index;i++) {
69 if (i==limit)
70 printf("-> ");
71 else
72 printf(" ");
73 printf("%3ld: ",i);
74 switch (op_stack[i]) {
75 case fx:
76 printf("FX ");
77 break;
78 case xfx:
79 printf("XFX ");
80 break;
81 case xf:
82 printf("XF ");
83 break;
84 case nop:
85 printf("NOP ");
86 break;
87 default:
88 printf("??? ");
89 }
90 printf(" prec=%4ld ",int_stack[i]);
91 display_psi_stdout(&(psi_term_stack[i]));
92 printf("\n");
93 }
94 printf("\n");
95 }
96
107 void push(psi_term tok,long prec,long op)
108 {
109 if (parser_stack_index==PARSER_STACK_SIZE) {
110 perr("*** Parser error ");
111 psi_term_error();
112 perr(": stack full.\n");
113 }
114 else {
115 parser_stack_index++;
116 psi_term_stack[parser_stack_index]=tok;
117 int_stack[parser_stack_index]=prec;
118 op_stack[parser_stack_index]=op;
119 }
120 }
121
132 long pop(ptr_psi_term tok,long *op)
133 {
134 long r=0;
135
136 if (parser_stack_index==0) {
137 /*
138 perr("*** Parser error ");
139 psi_term_error();
140 perr(": stack empty.\n");
141 */
142
143 (*tok)= *error_psi_term;
144 parse_ok=FALSE;
145 }
146 else {
147 (*tok)=psi_term_stack[parser_stack_index];
148 (*op)=op_stack[parser_stack_index];
149 r=int_stack[parser_stack_index];
150 parser_stack_index--;
151 }
152
153 return r;
154 }
155
163 long look()
164 {
165 return int_stack[parser_stack_index];
166 }
167
180 long precedence(psi_term tok,long typ)
181 {
182 long r=NOP;
183 ptr_operator_data o;
184
185 o=tok.type->op_data;
186 while(o && r==NOP) {
187 if(typ==o->type)
188 r=o->precedence;
189 else
190 o=o->next;
191 }
192
193 return r;
194 }
195
205 ptr_psi_term stack_copy_psi_term(psi_term t)
206 {
207 ptr_psi_term p;
208
209 p=STACK_ALLOC(psi_term);
210 (*p)=t;
211 #ifdef TS
212 p->time_stamp=global_time_stamp; /* 9.6 */
213 #endif
214
215 return p;
216 }
217
226 ptr_psi_term heap_copy_psi_term(psi_term t)
227 {
228 ptr_psi_term p;
229
230 p=HEAP_ALLOC(psi_term);
231 (*p)=t;
232 #ifdef TS
233 p->time_stamp=global_time_stamp; /* 9.6 */
234 #endif
235
236 return p;
237 }
238
251 void feature_insert(char *keystr,ptr_node *tree,ptr_psi_term psi)
252 {
253 ptr_node loc;
254 ptr_psi_term stk_psi;
255
256 // printf("before find in feature_insert feature=%s\n",keystr);
257 if ((loc=find(FEATCMP,keystr,*tree))) {
258 /* Give an error message if there is a duplicate feature: */
259 Syntaxerrorline("duplicate feature %s\n",keystr);
260 }
261 else {
262 /* If the feature does not exist, insert it. */
263 stk_psi=stack_copy_psi_term(*psi); // 19.8 */
264 stack_insert_copystr(keystr,tree,(GENERIC)stk_psi); /* 10.8 */
265 }
266 }
267
268 /*** RM 9 Dec 1992 START ***/
269
278 psi_term list_nil(ptr_definition type) /* RM: Feb 1 1993 */
279 {
280 psi_term nihil;
281
282 if(type==disjunction) /* RM: Feb 1 1993 */
283 nihil.type=disj_nil;
284 else
285 nihil.type=nil;
286
287 nihil.status=0;
288 nihil.flags=FALSE; /* 14.9 */
289 nihil.attr_list=NULL;
290 nihil.resid=NULL;
291 nihil.value_3=NULL;
292 nihil.coref=NULL;
293
294 return nihil;
295 }
296
329 psi_term parse_list(ptr_definition typ,char e,char s)
330 {
331 ptr_psi_term car=NULL;
332 ptr_psi_term cdr=NULL;
333 psi_term result;
334 psi_term t;
335 char a;
336
337 result=list_nil(typ); /* RM: Feb 1 1993 */
338
339 if (parse_ok) {
340
341 /* Character used for building cons pairs */
342 a='|'; /* RM: Jan 11 1993 */
343
344
345 read_token(&t);
346
347 if(!equ_tokc(t,e)) {
348
349 /* Read the CAR of the list */
350 put_back_token(t);
351 car=stack_copy_psi_term(read_life_form(s,a));
352
353 /* Read the CDR of the list */
354 read_token(&t);
355 if(equ_tokch(t,s))
356 cdr=stack_copy_psi_term(parse_list(typ,e,s));
357 else if(equ_tokch(t,e))
358 cdr=stack_copy_psi_term(list_nil(typ));
359 else if(equ_tokch(t,'|')) {
360 cdr=stack_copy_psi_term(read_life_form(e,0));
361 read_token(&t);
362 if(!equ_tokch(t,e)) {
363 if (stringparse) parse_ok=FALSE;
364 else {
365 perr("*** Syntax error ");psi_term_error();
366 perr(": bad symbol for end of list '");
367 display_psi_stderr(&t);
368 perr("'.\n");
369 put_back_token(t);
370 }
371 }
372 }
373 else
374 if (stringparse) parse_ok=FALSE;
375 else {
376 perr("*** Syntax error ");psi_term_error();
377 perr(": bad symbol in list '");
378 display_psi_stderr(&t);
379 perr("'.\n");
380 put_back_token(t);
381 }
382
383 result.type=typ;
384 if(car)
385 (void)stack_insert(FEATCMP,one,&(result.attr_list),(GENERIC)car);
386 if(cdr)
387 (void)stack_insert(FEATCMP,two,&(result.attr_list),(GENERIC)cdr);
388 }
389 }
390
391 return result;
392 }
393 /*** RM 9 Dec 1992 END ***/
394
421 psi_term read_psi_term()
422 {
423 psi_term t,t2,t3;
424 char s[10];
425 long count=0,f=TRUE,f2,v;
426 ptr_psi_term module;
427
428 if(parse_ok) {
429
430 read_token(&t);
431
432 if(equ_tokch(t,'['))
433 t=parse_list(alist,']',','); /*** RICHARD Nov_4 ***/
434 else
435 if(equ_tokch(t,'{'))
436 t=parse_list(disjunction,'}',';'); /*** RICHARD Nov_4 ***/
437
438 /* The syntax <a,b,c> for conjunctions has been abandoned.
439 else
440 if(equ_tokch(t,'<'))
441 t=parse_list(conjunction,'>',',');
442 */
443
444 if(parse_ok
445 && t.type!=eof
446 && !bad_psi_term(&t)
447 /* && (precedence(t,fx)==NOP)
448 && (precedence(t,fy)==NOP) */
449 ) {
450 read_token(&t2);
451 if(equ_tokch(t2,'(')) {
452
453 do {
454
455 f2=TRUE;
456 read_token(&t2);
457
458 if(wl_const_3(t2) && !bad_psi_term(&t2)) {
459 read_token(&t3);
460 if(equ_tok(t3,"=>")) {
461 t3=read_life_form(',',')');
462
463 if(t2.type->keyword->private_feature) /* RM: Mar 11 1993 */
464 feature_insert(t2.type->keyword->combined_name,
465 /* RM: Jan 13 1993 */
466 &(t.attr_list),
467 &t3);
468 else
469 feature_insert(t2.type->keyword->symbol,
470 /* RM: Jan 13 1993 */
471 &(t.attr_list),
472 &t3);
473
474 f2=FALSE;
475 }
476 else
477 put_back_token(t3);
478 }
479
480 if(parse_ok && equal_types(t2.type,integer)) {
481 read_token(&t3);
482 if(equ_tok(t3,"=>")) {
483 t3=read_life_form(',',')');
484 v= *(REAL *)t2.value_3;
485 (void)snprintf(s,10,"%ld",v);
486 feature_insert(s,&(t.attr_list),&t3);
487 f2=FALSE;
488 }
489 else
490 put_back_token(t3);
491 }
492
493 if(f2) {
494 put_back_token(t2);
495 t2=read_life_form(',',')');
496 ++count;
497 (void)snprintf(s,10,"%ld",count);
498 feature_insert(s,&(t.attr_list),&t2);
499 }
500
501 read_token(&t2);
502
503 if(equ_tokch(t2,')'))
504 f=FALSE;
505 else
506 if(!equ_tokch(t2,',')) {
507 if (stringparse) parse_ok=FALSE;
508 else {
509 /*
510 perr("*** Syntax error ");psi_term_error();
511 perr(": ',' expected in argument list.\n");
512 */
513
514 /* RM: Feb 1 1993 */
515 Syntaxerrorline("',' expected in argument list (%E)\n");
516
517 f=FALSE;
518 }
519 }
520
521 } while(f && parse_ok);
522 }
523 else
524 put_back_token(t2);
525 }
526 }
527 else
528 t= *error_psi_term;
529
530 if(t.type==variable && t.attr_list) {
531 t2=t;
532 t.type=apply;
533 t.value_3=NULL;
534 t.coref=NULL;
535 t.resid=NULL;
536 (void)stack_insert(FEATCMP,(char *)functor->keyword->symbol,
537 &(t.attr_list),
538 (GENERIC)stack_copy_psi_term(t2));
539 }
540
541
542 /* RM: Mar 12 1993 Nasty hack for Bruno's features in modules */
543 if((t.type==add_module1 || t.type==add_module2 || t.type==add_module3) &&
544 !find(FEATCMP,two,t.attr_list)) {
545
546 module=stack_psi_term(4);
547 module->type=quoted_string;
548 module->value_3=(GENERIC)heap_copy_string(current_module->module_name);
549
550 (void)stack_insert(FEATCMP,two,&(t.attr_list),(GENERIC)module);
551 }
552
553 return t;
554 }
555
571 psi_term make_life_form(ptr_psi_term tok,ptr_psi_term arg1,ptr_psi_term arg2)
572 {
573 ptr_psi_term a1,a2;
574
575 deref_ptr(tok);
576 tok->attr_list=NULL;
577 tok->resid=NULL;
578
579 /* Here beginneth a terrible FIX,
580 I will have to rewrite the tokeniser and the parser to handle
581 POINTERS to psi-terms instead of PSI_TERMS !!!
582 */
583
584 a1=arg1;
585 a2=arg2;
586
587 if (a1)
588 deref_ptr(a1);
589 if (a2)
590 deref_ptr(a2);
591
592 /* End of extremely ugly fix. */
593
594 if (/* UNI FALSE */ equ_tokch((*tok),':') && arg1 && arg2) {
595
596 if (a1!=a2) {
597 if (a1->type==top &&
598 !a1->attr_list &&
599 !a1->resid) {
600 if (a1!=arg1)
601 /* push_ptr_value(psi_term_ptr,&(a1->coref)); 9.6 */
602 push_psi_ptr_value(a1,(GENERIC *)&(a1->coref));
603 a1->coref=stack_copy_psi_term(*arg2);
604 tok=arg1;
605 }
606 else
607 if(a2->type==top &&
608 !a2->attr_list &&
609 !a2->resid) {
610 if(a2!=arg2)
611 /* push_ptr_value(psi_term_ptr,&(a2->coref)); 9.6 */
612 push_psi_ptr_value(a2,(GENERIC *)&(a2->coref));
613 a2->coref=stack_copy_psi_term(*arg1);
614 tok=arg2;
615 }
616 else { /* RM: Feb 22 1993 Now reports an error */
617 Syntaxerrorline("':' occurs where '&' required (%E)\n");
618 *tok= *error_psi_term;
619 /* make_unify_pair(tok,arg1,arg2); Old code */
620 }
621 }
622 else
623 tok=arg1;
624 }
625 else {
626
627 /* RM: Jun 21 1993 */
628 /* And now for another nasty hack: reading negative numbers */
629 if(tok->type==minus_symbol &&
630 a1 &&
631 !a2 &&
632 a1->value_3 &&
633 (a1->type==integer || a1->type==real)) {
634
635 tok->type=a1->type;
636 tok->value_3=(GENERIC)heap_alloc(sizeof(REAL));
637 *(REAL *)tok->value_3 = - *(REAL *)a1->value_3;
638
639 return *tok;
640 }
641 /* End of other nasty hack */
642
643 (void)stack_insert(FEATCMP,one,&(tok->attr_list),(GENERIC)stack_copy_psi_term(*arg1));
644 if (arg2)
645 (void)stack_insert(FEATCMP,two,&(tok->attr_list),(GENERIC)stack_copy_psi_term(*arg2));
646 }
647
648 return *tok;
649 }
650
662 void crunch(long prec,long limit)
663 {
664 psi_term t,t1,t2,t3;
665 long op1,op2,op3;
666
667 if(parse_ok && prec>=look() && parser_stack_index>limit) {
668
669 (void)pop(&t1,&op1);
670
671 switch(op1) {
672
673 case nop:
674 (void)pop(&t2,&op2);
675 if(op2==fx)
676 t=make_life_form(&t2,&t1,NULL);
677 else
678 if(op2==xfx) {
679 (void)pop(&t3,&op3);
680 if(op3==nop)
681 t=make_life_form(&t2,&t3,&t1);
682 else {
683 printf("*** Parser: ooops, NOP expected.\n");
684 parse_ok=FALSE;
685 t= *error_psi_term;
686 }
687 }
688 break;
689
690 case xf:
691 (void)pop(&t2,&op2);
692 if(op2==nop)
693 t=make_life_form(&t1,&t2,NULL);
694 else {
695 printf("*** Parser: ugh, NOP expected.\n");
696 t= *error_psi_term;
697 parse_ok=FALSE;
698 }
699 break;
700
701 default:
702 printf("*** Parser: yuck, weirdo operator.\n");
703 }
704
705 push(t,look(),nop);
706
707 crunch(prec,limit);
708 }
709 }
710
728 psi_term read_life_form(char ch1,char ch2)
729 {
730 psi_term t,t2;
731 long limit,pr_op,pr_1,pr_2,start=0;
732 long fin=FALSE;
733 long state=0;
734 long prec=0;
735
736 long op;
737
738 limit=parser_stack_index+1;
739
740 if (parse_ok)
741 do {
742 if (state)
743 read_token(&t);
744 else
745 t=read_psi_term();
746
747 if (!start)
748 start=line_count;
749
750 if (!fin)
751 if (state) {
752 if (equ_tokc(t,ch1) || equ_tokc(t,ch2)) {
753 fin=TRUE;
754 put_back_token(t);
755 }
756 else {
757 pr_op=precedence(t,xf);
758 pr_1=pr_op-1;
759
760 if(pr_op==NOP) {
761 pr_op=precedence(t,yf);
762 pr_1=pr_op;
763 }
764
765 if(pr_op==NOP) {
766
767 pr_op=precedence(t,xfx);
768 pr_1=pr_op-1;
769 pr_2=pr_op-1;
770
771 if(pr_op==NOP) {
772 pr_op=precedence(t,xfy);
773 pr_1=pr_op-1;
774 pr_2=pr_op;
775 }
776
777 if(pr_op==NOP) {
778 pr_op=precedence(t,yfx);
779 pr_1=pr_op;
780 pr_2=pr_op-1;
781 }
782
783 /* if(pr_op==NOP) {
784 pr_op=precedence(t,yfy);
785 pr_1=pr_op;
786 pr_2=pr_op-1;
787 }
788 */
789
790 if(pr_op==NOP) {
791 fin=TRUE;
792 put_back_token(t);
793 }
794 else
795 {
796 crunch(pr_1,limit);
797 push(t,pr_2,xfx);
798 prec=pr_2;
799 state=0;
800 }
801 }
802 else {
803 crunch(pr_1,limit);
804 push(t,pr_1,xf);
805 prec=pr_1;
806 }
807 }
808 }
809 else {
810
811 if(t.attr_list)
812 pr_op=NOP;
813 else {
814 pr_op=precedence(t,fx);
815 pr_2=pr_op-1;
816
817 if(pr_op==NOP) {
818 pr_op=precedence(t,fy);
819 pr_2=pr_op;
820 }
821 }
822
823 if(pr_op==NOP) {
824 if(equ_tokch(t,'(')) {
825 t2=read_life_form(')',0);
826 if(parse_ok) {
827 push(t2,prec,nop);
828 read_token(&t2);
829 if(!equ_tokch(t2,')')) {
830 if (stringparse) parse_ok=FALSE;
831 else {
832 /*
833 perr("*** Syntax error ");psi_term_error();
834 perr(": ')' missing.\n");
835 */
836
837 /* RM: Feb 1 1993 */
838 Syntaxerrorline("')' missing (%E)\n");
839
840 put_back_token(t2);
841 }
842 }
843 state=1;
844 }
845 }
846 else
847 if(bad_psi_term(&t)) {
848 put_back_token(t);
849 /* psi_term_error(); */
850 fin=TRUE;
851 }
852 else {
853 push(t,prec,nop);
854 state=1;
855 }
856 }
857 else {
858 push(t,pr_2,fx);
859 prec=pr_2;
860 }
861
862 }
863
864 } while (!fin && parse_ok);
865
866 if (state)
867 crunch(MAX_PRECEDENCE,limit);
868
869 if (parse_ok && parser_stack_index!=limit) {
870 if (stringparse) parse_ok=FALSE;
871 else {
872 /*
873 perr("*** Syntax error ");psi_term_error();
874 perr(": bad expression.\n");
875 */
876
877 /* RM: Feb 1 1993 */
878 Syntaxerrorline("bad expression (%E)\n");
879 }
880 }
881 else
882 (void)pop(&t,&op);
883
884 if (!parse_ok)
885 t= *error_psi_term;
886
887 parser_stack_index=limit-1;
888
889 return t;
890 }
891
907 psi_term parse(long *q)
908 {
909 psi_term s,t,u;
910 long c;
911
912 parser_stack_index=0;
913 parse_ok=TRUE;
914
915 /*s=read_life_form('.','?');*/
916 s=read_life_form(0,0);
917
918 if (parse_ok) {
919 if (s.type!=eof) {
920 read_token(&t);
921
922 /*
923 if (equ_tokch(t,'?'))
924 *q=QUERY;
925 else if (equ_tokch(t,'.'))
926 *q=FACT;
927 */
928
929 /* RM: Jul 7 1993 */
930 if (t.type==final_question)
931 {
932 *q=QUERY;
933 }
934 else if (t.type==final_dot)
935 {
936 *q=FACT;
937 }
938 else
939 {
940 if (stringparse) parse_ok=FALSE;
941 else {
942
943 /*
944 perr("*** Syntax error ");psi_term_error();perr(": ");
945 display_psi_stderr(&t);
946 perr(".\n");
947 */
948
949 /* RM: Feb 1 1993 */
950 Syntaxerrorline("'%P' (%E)\n",&t);
951
952 }
953 *q=ERROR;
954 }
955 }
956 }
957
958
959 if (!parse_ok) {
960
961 while (saved_psi_term!=NULL) read_token(&u);
962
963 prompt="error>";
964 while((c=read_char()) && c!=EOF && c!='.' && c!='?' && c!=EOLN) {}
965
966 *q=ERROR;
967 }
968 else if (saved_char)
969 do {
970 c=read_char();
971 if (c==EOLN)
972 c=0;
973 else if (c<0 || c>32) {
974 put_back_char(c);
975 c=0;
976 }
977 } while(c && c!=EOF);
978
979 /* Make sure arguments of nonstrict terms are marked quoted. */
980 if (parse_ok) mark_nonstrict(&s); /* 25.8 */
981
982 /* mark_eval(&s); 24.8 XXX */
983
984 /* Mark all the psi-terms corresponding to variables in the var_tree as */
985 /* quoted. This is needed for correct parsing of inputs; otherwise vars */
986 /* that occur in an increment of a query are marked to be evaluated again! */
987 /* mark_quote_tree(var_tree); 24.8 XXX */
988
989
990 return s;
991 }
disjunction
ptr_definition disjunction
symbol in bi module
Definition: def_glob.h:249
heap_copy_psi_term
ptr_psi_term heap_copy_psi_term(psi_term t)
heap_copy_psi_term
Definition: parser.c:226
alist
ptr_definition alist
symbol in bi module
Definition: def_glob.h:319
psi_term_error
void psi_term_error()
psi_term_error
Definition: token.c:761
wl_psi_term::resid
ptr_residuation resid
Definition: def_struct.h:189
wl_operator_data::precedence
long precedence
Definition: def_struct.h:75
yfx
#define yfx
was enum (operator) but va_arg could not handle - now typedef
Definition: def_const.h:1037
FEATCMP
#define FEATCMP
indicates to use featcmp for comparison (in trees.c)
Definition: def_const.h:979
perr
void perr(char *str)
perr
Definition: error.c:763
equ_tokc
#define equ_tokc(A, B)
Definition: def_macro.h:76
apply
ptr_definition apply
symbol in bi module
Definition: def_glob.h:178
PARSER_STACK_SIZE
#define PARSER_STACK_SIZE
Maximum depth of the parser stack.
Definition: def_const.h:198
put_back_char
void put_back_char(long c)
put_back_char
Definition: token.c:729
read_token
void read_token(ptr_psi_term tok)
read_token
Definition: token.c:1186
integer
ptr_definition integer
symbol in bi module
Definition: def_glob.h:312
functor
ptr_definition functor
symbol in bi module
Definition: def_glob.h:298
wl_keyword::combined_name
char * combined_name
Definition: def_struct.h:119
final_question
ptr_definition final_question
symbol in syntax module
Definition: def_glob.h:615
xfx
#define xfx
was enum (operator) but va_arg could not handle - now typedef
Definition: def_const.h:1021
wl_operator_data
Definition: def_struct.h:73
current_module
ptr_module current_module
The current module for the tokenizer.
Definition: def_glob.h:729
two
char * two
Definition: def_glob.h:892
show
void show(long limit)
show
Definition: parser.c:64
wl_operator_data::next
ptr_operator_data next
Definition: def_struct.h:76
push_psi_ptr_value
void push_psi_ptr_value(ptr_psi_term q, GENERIC *p)
push_psi_ptr_value
Definition: login.c:474
fx
#define fx
was enum (operator) but va_arg could not handle - now typedef
Definition: def_const.h:1000
defs.h
includes
NOP
#define NOP
returned by precedence if token is not an operator
Definition: def_const.h:1337
wl_psi_term
Definition: def_struct.h:177
look
long look()
look
Definition: parser.c:163
FACT
#define FACT
Fact Kind of user input.
Definition: def_const.h:338
push
void push(psi_term tok, long prec, long op)
push
Definition: parser.c:107
mark_nonstrict
void mark_nonstrict(ptr_psi_term t)
mark_nonstrict
Definition: copy.c:513
wl_definition::keyword
ptr_keyword keyword
Definition: def_struct.h:147
display_psi_stdout
void display_psi_stdout(ptr_psi_term t)
display_psi_stdout
Definition: print.c:1536
precedence
long precedence(psi_term tok, long typ)
precedence
Definition: parser.c:180
NULL
#define NULL
Definition: def_const.h:533
add_module3
ptr_definition add_module3
symbol in bi module for feature_values
Definition: def_glob.h:157
xfy
#define xfy
was enum (operator) but va_arg could not handle - now typedef
Definition: def_const.h:1030
add_module2
ptr_definition add_module2
symbol in bi module for str2psi
Definition: def_glob.h:150
REAL
#define REAL
Which C type to use to represent reals and integers in Wild_Life.
Definition: def_const.h:132
parse_list
psi_term parse_list(ptr_definition typ, char e, char s)
parse_list
Definition: parser.c:329
parse_ok
long parse_ok
indicates whether there was a syntax error
Definition: def_glob.h:765
wl_keyword::symbol
char * symbol
Definition: def_struct.h:118
saved_char
long saved_char
Definition: def_glob.h:849
nop
#define nop
was enum (operator) but va_arg could not handle - now typedef
Definition: def_const.h:986
display_psi_stderr
void display_psi_stderr(ptr_psi_term t)
display_psi_stderr
Definition: print.c:1550
QUERY
#define QUERY
Query Kind of user input.
Definition: def_const.h:345
ERROR
#define ERROR
Error Kind of user input.
Definition: def_const.h:352
put_back_token
void put_back_token(psi_term t)
put_back_token
Definition: token.c:746
real
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
line_count
long line_count
Definition: def_glob.h:1015
GENERIC
unsigned long * GENERIC
unsigned long *GENERIC
Definition: def_struct.h:35
read_life_form
psi_term read_life_form(char ch1, char ch2)
read_life_form
Definition: parser.c:728
EOLN
#define EOLN
End of line.
Definition: def_const.h:309
feature_insert
void feature_insert(char *keystr, ptr_node *tree, ptr_psi_term psi)
feature_insert
Definition: parser.c:251
variable
ptr_definition variable
symbol in bi module
Definition: def_glob.h:438
wl_const_3
#define wl_const_3(S)
Definition: def_macro.h:109
stack_insert
ptr_node stack_insert(long comp, char *keystr, ptr_node *tree, GENERIC info)
stack_insert
Definition: trees.c:337
deref_ptr
#define deref_ptr(P)
Definition: def_macro.h:100
heap_copy_string
char * heap_copy_string(char *s)
heap_copy_string
Definition: trees.c:172
final_dot
ptr_definition final_dot
symbol in syntax module
Definition: def_glob.h:608
Syntaxerrorline
void Syntaxerrorline(char *format,...)
Syntaxerrorline.
Definition: error.c:557
TRUE
#define TRUE
Standard boolean.
Definition: def_const.h:268
pop
long pop(ptr_psi_term tok, long *op)
pop
Definition: parser.c:132
crunch
void crunch(long prec, long limit)
crunch
Definition: parser.c:662
minus_symbol
ptr_definition minus_symbol
symbol in syntax module
Definition: def_glob.h:333
parse
psi_term parse(long *q)
parse
Definition: parser.c:907
eof
ptr_definition eof
symbol in syntax module
Definition: def_glob.h:263
bad_psi_term
int bad_psi_term(ptr_psi_term t)
bad_psi_term
Definition: parser.c:31
FALSE
#define FALSE
Standard boolean.
Definition: def_const.h:275
add_module1
ptr_definition add_module1
symbol in bi module for features
Definition: def_glob.h:143
stack_psi_term
ptr_psi_term stack_psi_term(long stat)
stack_psi_term
Definition: lefun.c:21
nil
ptr_definition nil
symbol in bi module
Definition: def_glob.h:340
wl_psi_term::value_3
GENERIC value_3
Definition: def_struct.h:186
stack_copy_psi_term
ptr_psi_term stack_copy_psi_term(psi_term t)
stack_copy_psi_term
Definition: parser.c:205
disj_nil
ptr_definition disj_nil
symbol in syntax module
Definition: def_glob.h:256
wl_module::module_name
char * module_name
Definition: def_struct.h:106
wl_psi_term::coref
ptr_psi_term coref
Definition: def_struct.h:188
one
char * one
Definition: def_glob.h:891
equal_types
#define equal_types(A, B)
Definition: def_macro.h:111
STACK_ALLOC
#define STACK_ALLOC(A)
Definition: def_macro.h:21
xf
#define xf
was enum (operator) but va_arg could not handle - now typedef
Definition: def_const.h:993
find
ptr_node find(long comp, char *keystr, ptr_node tree)
find
Definition: trees.c:394
wl_psi_term::status
long status
Definition: def_struct.h:182
yf
#define yf
was enum (operator) but va_arg could not handle - now typedef
Definition: def_const.h:1007
wl_psi_term::flags
long flags
Definition: def_struct.h:185
wl_definition
Definition: def_struct.h:145
saved_psi_term
ptr_psi_term saved_psi_term
Definition: def_glob.h:851
error_psi_term
ptr_psi_term error_psi_term
symbol in bi module
Definition: def_glob.h:118
MAX_PRECEDENCE
#define MAX_PRECEDENCE
Maximum operator precedence.
Definition: def_const.h:205
top
ptr_definition top
symbol in syntax module
Definition: def_glob.h:403
list_nil
psi_term list_nil(ptr_definition type)
list_nil
Definition: parser.c:278
make_life_form
psi_term make_life_form(ptr_psi_term tok, ptr_psi_term arg1, ptr_psi_term arg2)
make_life_form
Definition: parser.c:571
prompt
char * prompt
Definition: def_glob.h:1018
read_char
long read_char()
read_char
Definition: token.c:680
global_time_stamp
unsigned long global_time_stamp
Definition: login.c:28
wl_keyword::private_feature
int private_feature
Definition: def_struct.h:121
parser_stack_index
long parser_stack_index
index to parser stack
Definition: def_glob.h:164
equ_tok
#define equ_tok(A, B)
Definition: def_macro.h:67
stringparse
long stringparse
Definition: def_glob.h:859
wl_node
Definition: def_struct.h:197
wl_psi_term::type
ptr_definition type
Definition: def_struct.h:181
read_psi_term
psi_term read_psi_term()
read_psi_term
Definition: parser.c:421
HEAP_ALLOC
#define HEAP_ALLOC(A)
Definition: def_macro.h:20
wl_psi_term::attr_list
ptr_node attr_list
Definition: def_struct.h:187
quoted_string
ptr_definition quoted_string
symbol in bi module
Definition: def_glob.h:368
wl_definition::op_data
ptr_operator_data op_data
Definition: def_struct.h:158
heap_alloc
GENERIC heap_alloc(long s)
heap_alloc
Definition: memory.c:1616
stack_insert_copystr
void stack_insert_copystr(char *keystr, ptr_node *tree, GENERIC info)
stack_insert_copystr
Definition: trees.c:301
int_stack
long int_stack[PARSER_STACK_SIZE]
Definition: def_glob.h:959
psi_term_stack
psi_term psi_term_stack[PARSER_STACK_SIZE]
Definition: def_glob.h:958
fy
#define fy
was enum (operator) but va_arg could not handle - now typedef
Definition: def_const.h:1014
equ_tokch
#define equ_tokch(A, B)
Definition: def_macro.h:71