1/* original parser id follows */
2/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
3/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
4
5#define YYBYACC 1
6#define YYMAJOR 1
7#define YYMINOR 9
8#define YYCHECK "yyyymmdd"
9
10#define YYEMPTY (-1)
11#define yyclearin (yychar = YYEMPTY)
--- 370 unchanged lines hidden (view full) ---
382 262, 263, 264, 265, 266, -1, 259, 269, 261, 262,
383 263, 264, 265, 259, 260, 260, 259, -1, -1, -1,
384 -1, -1, -1, -1, -1, -1, -1, -1, -1, 259,
385 -1, 261, 262, 263, 264, 265, -1, -1, -1, 269,
386};
387#if YYBTYACC
388static const YYINT demo_ctable[] = { -1,
389 1, 10, -1, 21, 4, -1, 23, 29, -1, 1,
390 51, -1, 101, 56, -1, -1, -1, -1, -1, -1,
391 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
392 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
393 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
394 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
395 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
396 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
397 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
398 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
399 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
400 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
401 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
402 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
403 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
404 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
405 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
406 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
407 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
408 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
409 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
410 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
411 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
412 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
413 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
414 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
415 -1, -1, -1, -1, -1, -1, -1, -1, -1,
416};
417#endif
418#define YYFINAL 1
419#ifndef YYDEBUG
420#define YYDEBUG 0
421#endif
422#define YYMAXTOKEN 269
423#define YYUNDFTOKEN 301
--- 230 unchanged lines hidden (view full) ---
654extern Decl * build_function(Decl *decl, Decl_List *dlist, Type *type);
655extern Decl_List * append_dlist(Decl_List *dlist, Decl *decl);
656extern Decl_List * build_dlist(Decl *decl);
657extern Expr * build_expr(Expr *left, enum Operator op, Expr *right);
658extern Expr * var_expr(Scope *scope, char *id);
659extern Code * build_expr_code(Expr *expr);
660extern Code * build_if(Expr *cond_expr, Code *then_stmt, Code *else_stmt);
661extern Code * code_append(Code *stmt_list, Code *stmt);
662#line 663 "btyacc_demo.tab.c"
663
664/* Release memory associated with symbol. */
665#if ! defined YYDESTRUCT_IS_DECLARED
666static void
667YYDESTRUCT_DECL()
668{
669 switch (psymb)
670 {
671 case 43:
672#line 83 "btyacc_demo.y"
673 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
674 msg,
675 (*loc).first_line, (*loc).first_column,
676 (*loc).last_line, (*loc).last_column);
677 /* in this example, we don't know what to do here */ }
678 break;
679#line 680 "btyacc_demo.tab.c"
680 case 45:
681#line 83 "btyacc_demo.y"
682 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
683 msg,
684 (*loc).first_line, (*loc).first_column,
685 (*loc).last_line, (*loc).last_column);
686 /* in this example, we don't know what to do here */ }
687 break;
688#line 689 "btyacc_demo.tab.c"
689 case 42:
690#line 83 "btyacc_demo.y"
691 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
692 msg,
693 (*loc).first_line, (*loc).first_column,
694 (*loc).last_line, (*loc).last_column);
695 /* in this example, we don't know what to do here */ }
696 break;
697#line 698 "btyacc_demo.tab.c"
698 case 47:
699#line 83 "btyacc_demo.y"
700 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
701 msg,
702 (*loc).first_line, (*loc).first_column,
703 (*loc).last_line, (*loc).last_column);
704 /* in this example, we don't know what to do here */ }
705 break;
706#line 707 "btyacc_demo.tab.c"
707 case 37:
708#line 83 "btyacc_demo.y"
709 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
710 msg,
711 (*loc).first_line, (*loc).first_column,
712 (*loc).last_line, (*loc).last_column);
713 /* in this example, we don't know what to do here */ }
714 break;
715#line 716 "btyacc_demo.tab.c"
716 case 257:
717#line 83 "btyacc_demo.y"
718 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
719 msg,
720 (*loc).first_line, (*loc).first_column,
721 (*loc).last_line, (*loc).last_column);
722 /* in this example, we don't know what to do here */ }
723 break;
724#line 725 "btyacc_demo.tab.c"
725 case 258:
726#line 83 "btyacc_demo.y"
727 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
728 msg,
729 (*loc).first_line, (*loc).first_column,
730 (*loc).last_line, (*loc).last_column);
731 /* in this example, we don't know what to do here */ }
732 break;
733#line 734 "btyacc_demo.tab.c"
734 case 40:
735#line 83 "btyacc_demo.y"
736 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
737 msg,
738 (*loc).first_line, (*loc).first_column,
739 (*loc).last_line, (*loc).last_column);
740 /* in this example, we don't know what to do here */ }
741 break;
742#line 743 "btyacc_demo.tab.c"
743 case 91:
744#line 83 "btyacc_demo.y"
745 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
746 msg,
747 (*loc).first_line, (*loc).first_column,
748 (*loc).last_line, (*loc).last_column);
749 /* in this example, we don't know what to do here */ }
750 break;
751#line 752 "btyacc_demo.tab.c"
752 case 46:
753#line 83 "btyacc_demo.y"
754 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
755 msg,
756 (*loc).first_line, (*loc).first_column,
757 (*loc).last_line, (*loc).last_column);
758 /* in this example, we don't know what to do here */ }
759 break;
760#line 761 "btyacc_demo.tab.c"
761 case 259:
762#line 78 "btyacc_demo.y"
763 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
764 msg,
765 (*loc).first_line, (*loc).first_column,
766 (*loc).last_line, (*loc).last_column);
767 free((*val).id); }
768 break;
769#line 770 "btyacc_demo.tab.c"
770 case 260:
771#line 78 "btyacc_demo.y"
772 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
773 msg,
774 (*loc).first_line, (*loc).first_column,
775 (*loc).last_line, (*loc).last_column);
776 free((*val).expr); }
777 break;
778#line 779 "btyacc_demo.tab.c"
779 case 261:
780#line 83 "btyacc_demo.y"
781 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
782 msg,
783 (*loc).first_line, (*loc).first_column,
784 (*loc).last_line, (*loc).last_column);
785 /* in this example, we don't know what to do here */ }
786 break;
787#line 788 "btyacc_demo.tab.c"
788 case 262:
789#line 83 "btyacc_demo.y"
790 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
791 msg,
792 (*loc).first_line, (*loc).first_column,
793 (*loc).last_line, (*loc).last_column);
794 /* in this example, we don't know what to do here */ }
795 break;
796#line 797 "btyacc_demo.tab.c"
797 case 263:
798#line 83 "btyacc_demo.y"
799 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
800 msg,
801 (*loc).first_line, (*loc).first_column,
802 (*loc).last_line, (*loc).last_column);
803 /* in this example, we don't know what to do here */ }
804 break;
805#line 806 "btyacc_demo.tab.c"
806 case 264:
807#line 83 "btyacc_demo.y"
808 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
809 msg,
810 (*loc).first_line, (*loc).first_column,
811 (*loc).last_line, (*loc).last_column);
812 /* in this example, we don't know what to do here */ }
813 break;
814#line 815 "btyacc_demo.tab.c"
815 case 265:
816#line 83 "btyacc_demo.y"
817 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
818 msg,
819 (*loc).first_line, (*loc).first_column,
820 (*loc).last_line, (*loc).last_column);
821 /* in this example, we don't know what to do here */ }
822 break;
823#line 824 "btyacc_demo.tab.c"
824 case 266:
825#line 83 "btyacc_demo.y"
826 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
827 msg,
828 (*loc).first_line, (*loc).first_column,
829 (*loc).last_line, (*loc).last_column);
830 /* in this example, we don't know what to do here */ }
831 break;
832#line 833 "btyacc_demo.tab.c"
833 case 267:
834#line 83 "btyacc_demo.y"
835 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
836 msg,
837 (*loc).first_line, (*loc).first_column,
838 (*loc).last_line, (*loc).last_column);
839 /* in this example, we don't know what to do here */ }
840 break;
841#line 842 "btyacc_demo.tab.c"
842 case 268:
843#line 83 "btyacc_demo.y"
844 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
845 msg,
846 (*loc).first_line, (*loc).first_column,
847 (*loc).last_line, (*loc).last_column);
848 /* in this example, we don't know what to do here */ }
849 break;
850#line 851 "btyacc_demo.tab.c"
851 case 269:
852#line 83 "btyacc_demo.y"
853 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
854 msg,
855 (*loc).first_line, (*loc).first_column,
856 (*loc).last_line, (*loc).last_column);
857 /* in this example, we don't know what to do here */ }
858 break;
859#line 860 "btyacc_demo.tab.c"
860 case 59:
861#line 83 "btyacc_demo.y"
862 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
863 msg,
864 (*loc).first_line, (*loc).first_column,
865 (*loc).last_line, (*loc).last_column);
866 /* in this example, we don't know what to do here */ }
867 break;
868#line 869 "btyacc_demo.tab.c"
869 case 44:
870#line 83 "btyacc_demo.y"
871 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
872 msg,
873 (*loc).first_line, (*loc).first_column,
874 (*loc).last_line, (*loc).last_column);
875 /* in this example, we don't know what to do here */ }
876 break;
877#line 878 "btyacc_demo.tab.c"
878 case 41:
879#line 83 "btyacc_demo.y"
880 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
881 msg,
882 (*loc).first_line, (*loc).first_column,
883 (*loc).last_line, (*loc).last_column);
884 /* in this example, we don't know what to do here */ }
885 break;
886#line 887 "btyacc_demo.tab.c"
887 case 93:
888#line 83 "btyacc_demo.y"
889 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
890 msg,
891 (*loc).first_line, (*loc).first_column,
892 (*loc).last_line, (*loc).last_column);
893 /* in this example, we don't know what to do here */ }
894 break;
895#line 896 "btyacc_demo.tab.c"
896 case 123:
897#line 83 "btyacc_demo.y"
898 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
899 msg,
900 (*loc).first_line, (*loc).first_column,
901 (*loc).last_line, (*loc).last_column);
902 /* in this example, we don't know what to do here */ }
903 break;
904#line 905 "btyacc_demo.tab.c"
905 case 125:
906#line 83 "btyacc_demo.y"
907 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
908 msg,
909 (*loc).first_line, (*loc).first_column,
910 (*loc).last_line, (*loc).last_column);
911 /* in this example, we don't know what to do here */ }
912 break;
913#line 914 "btyacc_demo.tab.c"
914 case 270:
915#line 83 "btyacc_demo.y"
916 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
917 msg,
918 (*loc).first_line, (*loc).first_column,
919 (*loc).last_line, (*loc).last_column);
920 /* in this example, we don't know what to do here */ }
921 break;
922#line 923 "btyacc_demo.tab.c"
923 case 271:
924#line 83 "btyacc_demo.y"
925 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
926 msg,
927 (*loc).first_line, (*loc).first_column,
928 (*loc).last_line, (*loc).last_column);
929 /* in this example, we don't know what to do here */ }
930 break;
931#line 932 "btyacc_demo.tab.c"
932 case 272:
933#line 78 "btyacc_demo.y"
934 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
935 msg,
936 (*loc).first_line, (*loc).first_column,
937 (*loc).last_line, (*loc).last_column);
938 free((*val).expr); }
939 break;
940#line 941 "btyacc_demo.tab.c"
941 case 273:
942#line 67 "btyacc_demo.y"
943 { /* 'msg' is a 'char *' indicating the context of destructor invocation*/
944 printf("%s accessed by symbol \"decl\" (case s.b. 273) @ position[%d,%d..%d,%d]\n",
945 msg,
946 (*loc).first_line, (*loc).first_column,
947 (*loc).last_line, (*loc).last_column);
948 free((*val).decl->scope); free((*val).decl->type); }
949 break;
950#line 951 "btyacc_demo.tab.c"
951 case 274:
952#line 83 "btyacc_demo.y"
953 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
954 msg,
955 (*loc).first_line, (*loc).first_column,
956 (*loc).last_line, (*loc).last_column);
957 /* in this example, we don't know what to do here */ }
958 break;
959#line 960 "btyacc_demo.tab.c"
960 case 275:
961#line 83 "btyacc_demo.y"
962 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
963 msg,
964 (*loc).first_line, (*loc).first_column,
965 (*loc).last_line, (*loc).last_column);
966 /* in this example, we don't know what to do here */ }
967 break;
968#line 969 "btyacc_demo.tab.c"
969 case 276:
970#line 78 "btyacc_demo.y"
971 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
972 msg,
973 (*loc).first_line, (*loc).first_column,
974 (*loc).last_line, (*loc).last_column);
975 free((*val).code); }
976 break;
977#line 978 "btyacc_demo.tab.c"
978 case 277:
979#line 78 "btyacc_demo.y"
980 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
981 msg,
982 (*loc).first_line, (*loc).first_column,
983 (*loc).last_line, (*loc).last_column);
984 free((*val).code); }
985 break;
986#line 987 "btyacc_demo.tab.c"
987 case 278:
988#line 78 "btyacc_demo.y"
989 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
990 msg,
991 (*loc).first_line, (*loc).first_column,
992 (*loc).last_line, (*loc).last_column);
993 free((*val).code); }
994 break;
995#line 996 "btyacc_demo.tab.c"
996 case 279:
997#line 73 "btyacc_demo.y"
998 { printf("%s accessed by symbol with type <decl> (case s.b. 279 & 280) @ position[%d,%d..%d,%d]\n",
999 msg,
1000 (*loc).first_line, (*loc).first_column,
1001 (*loc).last_line, (*loc).last_column);
1002 free((*val).decl); }
1003 break;
1004#line 1005 "btyacc_demo.tab.c"
1005 case 280:
1006#line 73 "btyacc_demo.y"
1007 { printf("%s accessed by symbol with type <decl> (case s.b. 279 & 280) @ position[%d,%d..%d,%d]\n",
1008 msg,
1009 (*loc).first_line, (*loc).first_column,
1010 (*loc).last_line, (*loc).last_column);
1011 free((*val).decl); }
1012 break;
1013#line 1014 "btyacc_demo.tab.c"
1014 case 281:
1015#line 78 "btyacc_demo.y"
1016 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1017 msg,
1018 (*loc).first_line, (*loc).first_column,
1019 (*loc).last_line, (*loc).last_column);
1020 free((*val).type); }
1021 break;
1022#line 1023 "btyacc_demo.tab.c"
1023 case 282:
1024#line 78 "btyacc_demo.y"
1025 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1026 msg,
1027 (*loc).first_line, (*loc).first_column,
1028 (*loc).last_line, (*loc).last_column);
1029 free((*val).type); }
1030 break;
1031#line 1032 "btyacc_demo.tab.c"
1032 case 283:
1033#line 78 "btyacc_demo.y"
1034 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1035 msg,
1036 (*loc).first_line, (*loc).first_column,
1037 (*loc).last_line, (*loc).last_column);
1038 free((*val).type); }
1039 break;
1040#line 1041 "btyacc_demo.tab.c"
1041 case 284:
1042#line 78 "btyacc_demo.y"
1043 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1044 msg,
1045 (*loc).first_line, (*loc).first_column,
1046 (*loc).last_line, (*loc).last_column);
1047 free((*val).type); }
1048 break;
1049#line 1050 "btyacc_demo.tab.c"
1050 case 285:
1051#line 78 "btyacc_demo.y"
1052 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1053 msg,
1054 (*loc).first_line, (*loc).first_column,
1055 (*loc).last_line, (*loc).last_column);
1056 free((*val).type); }
1057 break;
1058#line 1059 "btyacc_demo.tab.c"
1059 case 286:
1060#line 78 "btyacc_demo.y"
1061 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1062 msg,
1063 (*loc).first_line, (*loc).first_column,
1064 (*loc).last_line, (*loc).last_column);
1065 free((*val).scope); }
1066 break;
1067#line 1068 "btyacc_demo.tab.c"
1068 case 287:
1069#line 78 "btyacc_demo.y"
1070 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1071 msg,
1072 (*loc).first_line, (*loc).first_column,
1073 (*loc).last_line, (*loc).last_column);
1074 free((*val).dlist); }
1075 break;
1076#line 1077 "btyacc_demo.tab.c"
1077 case 288:
1078#line 78 "btyacc_demo.y"
1079 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1080 msg,
1081 (*loc).first_line, (*loc).first_column,
1082 (*loc).last_line, (*loc).last_column);
1083 free((*val).dlist); }
1084 break;
1085#line 1086 "btyacc_demo.tab.c"
1086 case 289:
1087#line 78 "btyacc_demo.y"
1088 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1089 msg,
1090 (*loc).first_line, (*loc).first_column,
1091 (*loc).last_line, (*loc).last_column);
1092 free((*val).scope); }
1093 break;
1094#line 1095 "btyacc_demo.tab.c"
1095 case 290:
1096#line 78 "btyacc_demo.y"
1097 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1098 msg,
1099 (*loc).first_line, (*loc).first_column,
1100 (*loc).last_line, (*loc).last_column);
1101 free((*val).scope); }
1102 break;
1103#line 1104 "btyacc_demo.tab.c"
1104 case 291:
1105#line 78 "btyacc_demo.y"
1106 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1107 msg,
1108 (*loc).first_line, (*loc).first_column,
1109 (*loc).last_line, (*loc).last_column);
1110 free((*val).type); }
1111 break;
1112#line 1113 "btyacc_demo.tab.c"
1113 case 292:
1114#line 78 "btyacc_demo.y"
1115 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1116 msg,
1117 (*loc).first_line, (*loc).first_column,
1118 (*loc).last_line, (*loc).last_column);
1119 free((*val).scope); }
1120 break;
1121#line 1122 "btyacc_demo.tab.c"
1122 case 293:
1123#line 78 "btyacc_demo.y"
1124 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1125 msg,
1126 (*loc).first_line, (*loc).first_column,
1127 (*loc).last_line, (*loc).last_column);
1128 free((*val).scope); }
1129 break;
1130#line 1131 "btyacc_demo.tab.c"
1131 case 294:
1132#line 78 "btyacc_demo.y"
1133 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1134 msg,
1135 (*loc).first_line, (*loc).first_column,
1136 (*loc).last_line, (*loc).last_column);
1137 free((*val).type); }
1138 break;
1139#line 1140 "btyacc_demo.tab.c"
1140 case 295:
1141#line 78 "btyacc_demo.y"
1142 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1143 msg,
1144 (*loc).first_line, (*loc).first_column,
1145 (*loc).last_line, (*loc).last_column);
1146 free((*val).scope); }
1147 break;
1148#line 1149 "btyacc_demo.tab.c"
1149 case 296:
1150#line 78 "btyacc_demo.y"
1151 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1152 msg,
1153 (*loc).first_line, (*loc).first_column,
1154 (*loc).last_line, (*loc).last_column);
1155 free((*val).type); }
1156 break;
1157#line 1158 "btyacc_demo.tab.c"
1158 case 297:
1159#line 78 "btyacc_demo.y"
1160 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1161 msg,
1162 (*loc).first_line, (*loc).first_column,
1163 (*loc).last_line, (*loc).last_column);
1164 free((*val).scope); }
1165 break;
1166#line 1167 "btyacc_demo.tab.c"
1167 case 298:
1168#line 78 "btyacc_demo.y"
1169 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1170 msg,
1171 (*loc).first_line, (*loc).first_column,
1172 (*loc).last_line, (*loc).last_column);
1173 free((*val).scope); }
1174 break;
1175#line 1176 "btyacc_demo.tab.c"
1176 case 299:
1177#line 78 "btyacc_demo.y"
1178 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1179 msg,
1180 (*loc).first_line, (*loc).first_column,
1181 (*loc).last_line, (*loc).last_column);
1182 free((*val).scope); }
1183 break;
1184#line 1185 "btyacc_demo.tab.c"
1185 case 300:
1186#line 78 "btyacc_demo.y"
1187 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1188 msg,
1189 (*loc).first_line, (*loc).first_column,
1190 (*loc).last_line, (*loc).last_column);
1191 free((*val).scope); }
1192 break;
1193#line 1194 "btyacc_demo.tab.c"
1194 }
1195}
1196#define YYDESTRUCT_IS_DECLARED 1
1197#endif
1198
1199/* For use in generated program */
1200#define yydepth (int)(yystack.s_mark - yystack.s_base)
1201#if YYBTYACC
1202#define yytrial (yyps->save)
1203#endif /* YYBTYACC */
1204
1205#if YYDEBUG
1206#include <stdio.h> /* needed for printf */
1207#endif
1208
1209#include <stdlib.h> /* needed for malloc, etc */
1210#include <string.h> /* needed for memset */
1211
1212/* allocate initial stack or double stack size, up to YYMAXDEPTH */
1213static int yygrowstack(YYSTACKDATA *data)
1214{
1215 int i;
1216 unsigned newsize;
1217 short *newss;
1218 YYSTYPE *newvs;
--- 167 unchanged lines hidden (view full) ---
1386 yychar = *yylexp++;
1387 break;
1388 }
1389 if (yyps->save)
1390 {
1391 /* in trial mode; save scanner results for future parse attempts */
1392 if (yylvp == yylvlim)
1393 { /* Enlarge lexical value queue */
1394 size_t p = (size_t) (yylvp - yylvals);
1395 size_t s = (size_t) (yylvlim - yylvals);
1396
1397 s += YYLVQUEUEGROWTH;
1398 if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem;
1399 if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem;
1400#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1401 if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem;
1402#endif
1403 yylvp = yylve = yylvals + p;
--- 79 unchanged lines hidden (view full) ---
1483 }
1484#endif
1485 save = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
1486 if (save == NULL) goto yyenomem;
1487 save->save = yyps->save;
1488 save->state = yystate;
1489 save->errflag = yyerrflag;
1490 save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
1491 memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
1492 save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
1493 memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1494#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1495 save->yystack.p_mark = save->yystack.p_base + (yystack.p_mark - yystack.p_base);
1496 memcpy (save->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1497#endif
1498 ctry = yytable[yyn];
1499 if (yyctable[ctry] == -1)
1500 {
1501#if YYDEBUG
1502 if (yydebug && yychar >= YYEOF)
1503 fprintf(stderr, "%s[%d]: backtracking 1 token\n", YYDEBUGSTR, yydepth);
1504#endif
--- 38 unchanged lines hidden (view full) ---
1543 {
1544 yylvp--;
1545#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1546 yylpp--;
1547#endif
1548 yylexp--;
1549 yychar = YYEMPTY;
1550 }
1551 save->lexeme = (int) (yylvp - yylvals);
1552 yyps->save = save;
1553 }
1554 if (yytable[yyn] == ctry)
1555 {
1556#if YYDEBUG
1557 if (yydebug)
1558 fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
1559 YYDEBUGSTR, yydepth, yystate, yyctable[ctry]);
--- 77 unchanged lines hidden (view full) ---
1637 if (yyerrctx) yyFreeState(yyerrctx);
1638 /* Create and fill out new saved error context state */
1639 yyerrctx = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
1640 if (yyerrctx == NULL) goto yyenomem;
1641 yyerrctx->save = yyps->save;
1642 yyerrctx->state = yystate;
1643 yyerrctx->errflag = yyerrflag;
1644 yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
1645 memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
1646 yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
1647 memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1648#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1649 yyerrctx->yystack.p_mark = yyerrctx->yystack.p_base + (yystack.p_mark - yystack.p_base);
1650 memcpy (yyerrctx->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1651#endif
1652 yyerrctx->lexeme = (int) (yylvp - yylvals);
1653 }
1654 yylvp = yylvals + save->lexeme;
1655#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1656 yylpp = yylpsns + save->lexeme;
1657#endif
1658 yylexp = yylexemes + save->lexeme;
1659 yychar = YYEMPTY;
1660 yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
1661 memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
1662 yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
1663 memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1664#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1665 yystack.p_mark = yystack.p_base + (save->yystack.p_mark - save->yystack.p_base);
1666 memcpy (yystack.p_base, save->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1667#endif
1668 ctry = ++save->ctry;
1669 yystate = save->state;
1670 /* We tried shift, try reduce now */
1671 if ((yyn = yyctable[ctry]) >= 0) goto yyreduce;
1672 yyps->save = save->save;
1673 save->save = NULL;
1674 yyFreeState(save);
--- 13 unchanged lines hidden (view full) ---
1688#endif
1689 yylexp = yylexemes + yyerrctx->lexeme;
1690 yychar = yylexp[-1];
1691 yylval = yylvp[-1];
1692#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1693 yylloc = yylpp[-1];
1694#endif
1695 yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
1696 memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
1697 yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
1698 memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1699#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1700 yystack.p_mark = yystack.p_base + (yyerrctx->yystack.p_mark - yyerrctx->yystack.p_base);
1701 memcpy (yystack.p_base, yyerrctx->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1702#endif
1703 yystate = yyerrctx->state;
1704 yyFreeState(yyerrctx);
1705 yyerrctx = NULL;
1706 }
1707 yynewerrflag = 1;
1708 }
1709 if (yynewerrflag == 0) goto yyinrecovery;
--- 403 unchanged lines hidden (view full) ---
2113#line 193 "btyacc_demo.y"
2114 { yyval.code = code_append(yystack.l_mark[-2].code, yystack.l_mark[0].code); }
2115break;
2116case 61:
2117 if (!yytrial)
2118#line 197 "btyacc_demo.y"
2119 { yyval.code = yystack.l_mark[-1].code; }
2120break;
2121#line 2122 "btyacc_demo.tab.c"
2122 default:
2123 break;
2124 }
2125 yystack.s_mark -= yym;
2126 yystate = *yystack.s_mark;
2127 yystack.l_mark -= yym;
2128#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
2129 yystack.p_mark -= yym;
--- 34 unchanged lines hidden (view full) ---
2164 yychar = *yylexp++;
2165 break;
2166 }
2167 if (yyps->save)
2168 {
2169 /* in trial mode; save scanner results for future parse attempts */
2170 if (yylvp == yylvlim)
2171 { /* Enlarge lexical value queue */
2172 size_t p = (size_t) (yylvp - yylvals);
2173 size_t s = (size_t) (yylvlim - yylvals);
2174
2175 s += YYLVQUEUEGROWTH;
2176 if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL)
2177 goto yyenomem;
2178 if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL)
2179 goto yyenomem;
2180#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
2181 if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL)
--- 86 unchanged lines hidden (view full) ---
2268 }
2269 yylvp = yylvals + yypath->lexeme;
2270#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
2271 yylpp = yylpsns + yypath->lexeme;
2272#endif
2273 yylexp = yylexemes + yypath->lexeme;
2274 yychar = YYEMPTY;
2275 yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
2276 memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
2277 yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
2278 memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
2279#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
2280 yystack.p_mark = yystack.p_base + (yypath->yystack.p_mark - yypath->yystack.p_base);
2281 memcpy (yystack.p_base, yypath->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
2282#endif
2283 yystate = yypath->state;
2284 goto yyloop;
2285#endif /* YYBTYACC */
2286
2287yyoverflow:
2288 YYERROR_CALL("yacc stack overflow");
2289#if YYBTYACC
--- 67 unchanged lines hidden ---
2/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
3/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
4
5#define YYBYACC 1
6#define YYMAJOR 1
7#define YYMINOR 9
8#define YYCHECK "yyyymmdd"
9
10#define YYEMPTY (-1)
11#define yyclearin (yychar = YYEMPTY)
--- 370 unchanged lines hidden (view full) ---
382 262, 263, 264, 265, 266, -1, 259, 269, 261, 262,
383 263, 264, 265, 259, 260, 260, 259, -1, -1, -1,
384 -1, -1, -1, -1, -1, -1, -1, -1, -1, 259,
385 -1, 261, 262, 263, 264, 265, -1, -1, -1, 269,
386};
387#if YYBTYACC
388static const YYINT demo_ctable[] = { -1,
389 1, 10, -1, 21, 4, -1, 23, 29, -1, 1,
390 51, -1, 101, 56, -1, -1, -1, -1, -1, -1,
391 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
392 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
393 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
394 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
395 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
396 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
397 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
398 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
399 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
400 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
401 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
402 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
403 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
404 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
405 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
406 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
407 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
408 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
409 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
410 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
411 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
412 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
413 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
414 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
415 -1, -1, -1, -1, -1, -1, -1, -1, -1,
416};
417#endif
418#define YYFINAL 1
419#ifndef YYDEBUG
420#define YYDEBUG 0
421#endif
422#define YYMAXTOKEN 269
423#define YYUNDFTOKEN 301
--- 230 unchanged lines hidden (view full) ---
654extern Decl * build_function(Decl *decl, Decl_List *dlist, Type *type);
655extern Decl_List * append_dlist(Decl_List *dlist, Decl *decl);
656extern Decl_List * build_dlist(Decl *decl);
657extern Expr * build_expr(Expr *left, enum Operator op, Expr *right);
658extern Expr * var_expr(Scope *scope, char *id);
659extern Code * build_expr_code(Expr *expr);
660extern Code * build_if(Expr *cond_expr, Code *then_stmt, Code *else_stmt);
661extern Code * code_append(Code *stmt_list, Code *stmt);
662#line 663 "btyacc_demo.tab.c"
663
664/* Release memory associated with symbol. */
665#if ! defined YYDESTRUCT_IS_DECLARED
666static void
667YYDESTRUCT_DECL()
668{
669 switch (psymb)
670 {
671 case 43:
672#line 83 "btyacc_demo.y"
673 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
674 msg,
675 (*loc).first_line, (*loc).first_column,
676 (*loc).last_line, (*loc).last_column);
677 /* in this example, we don't know what to do here */ }
678 break;
679#line 680 "btyacc_demo.tab.c"
680 case 45:
681#line 83 "btyacc_demo.y"
682 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
683 msg,
684 (*loc).first_line, (*loc).first_column,
685 (*loc).last_line, (*loc).last_column);
686 /* in this example, we don't know what to do here */ }
687 break;
688#line 689 "btyacc_demo.tab.c"
689 case 42:
690#line 83 "btyacc_demo.y"
691 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
692 msg,
693 (*loc).first_line, (*loc).first_column,
694 (*loc).last_line, (*loc).last_column);
695 /* in this example, we don't know what to do here */ }
696 break;
697#line 698 "btyacc_demo.tab.c"
698 case 47:
699#line 83 "btyacc_demo.y"
700 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
701 msg,
702 (*loc).first_line, (*loc).first_column,
703 (*loc).last_line, (*loc).last_column);
704 /* in this example, we don't know what to do here */ }
705 break;
706#line 707 "btyacc_demo.tab.c"
707 case 37:
708#line 83 "btyacc_demo.y"
709 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
710 msg,
711 (*loc).first_line, (*loc).first_column,
712 (*loc).last_line, (*loc).last_column);
713 /* in this example, we don't know what to do here */ }
714 break;
715#line 716 "btyacc_demo.tab.c"
716 case 257:
717#line 83 "btyacc_demo.y"
718 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
719 msg,
720 (*loc).first_line, (*loc).first_column,
721 (*loc).last_line, (*loc).last_column);
722 /* in this example, we don't know what to do here */ }
723 break;
724#line 725 "btyacc_demo.tab.c"
725 case 258:
726#line 83 "btyacc_demo.y"
727 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
728 msg,
729 (*loc).first_line, (*loc).first_column,
730 (*loc).last_line, (*loc).last_column);
731 /* in this example, we don't know what to do here */ }
732 break;
733#line 734 "btyacc_demo.tab.c"
734 case 40:
735#line 83 "btyacc_demo.y"
736 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
737 msg,
738 (*loc).first_line, (*loc).first_column,
739 (*loc).last_line, (*loc).last_column);
740 /* in this example, we don't know what to do here */ }
741 break;
742#line 743 "btyacc_demo.tab.c"
743 case 91:
744#line 83 "btyacc_demo.y"
745 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
746 msg,
747 (*loc).first_line, (*loc).first_column,
748 (*loc).last_line, (*loc).last_column);
749 /* in this example, we don't know what to do here */ }
750 break;
751#line 752 "btyacc_demo.tab.c"
752 case 46:
753#line 83 "btyacc_demo.y"
754 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
755 msg,
756 (*loc).first_line, (*loc).first_column,
757 (*loc).last_line, (*loc).last_column);
758 /* in this example, we don't know what to do here */ }
759 break;
760#line 761 "btyacc_demo.tab.c"
761 case 259:
762#line 78 "btyacc_demo.y"
763 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
764 msg,
765 (*loc).first_line, (*loc).first_column,
766 (*loc).last_line, (*loc).last_column);
767 free((*val).id); }
768 break;
769#line 770 "btyacc_demo.tab.c"
770 case 260:
771#line 78 "btyacc_demo.y"
772 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
773 msg,
774 (*loc).first_line, (*loc).first_column,
775 (*loc).last_line, (*loc).last_column);
776 free((*val).expr); }
777 break;
778#line 779 "btyacc_demo.tab.c"
779 case 261:
780#line 83 "btyacc_demo.y"
781 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
782 msg,
783 (*loc).first_line, (*loc).first_column,
784 (*loc).last_line, (*loc).last_column);
785 /* in this example, we don't know what to do here */ }
786 break;
787#line 788 "btyacc_demo.tab.c"
788 case 262:
789#line 83 "btyacc_demo.y"
790 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
791 msg,
792 (*loc).first_line, (*loc).first_column,
793 (*loc).last_line, (*loc).last_column);
794 /* in this example, we don't know what to do here */ }
795 break;
796#line 797 "btyacc_demo.tab.c"
797 case 263:
798#line 83 "btyacc_demo.y"
799 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
800 msg,
801 (*loc).first_line, (*loc).first_column,
802 (*loc).last_line, (*loc).last_column);
803 /* in this example, we don't know what to do here */ }
804 break;
805#line 806 "btyacc_demo.tab.c"
806 case 264:
807#line 83 "btyacc_demo.y"
808 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
809 msg,
810 (*loc).first_line, (*loc).first_column,
811 (*loc).last_line, (*loc).last_column);
812 /* in this example, we don't know what to do here */ }
813 break;
814#line 815 "btyacc_demo.tab.c"
815 case 265:
816#line 83 "btyacc_demo.y"
817 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
818 msg,
819 (*loc).first_line, (*loc).first_column,
820 (*loc).last_line, (*loc).last_column);
821 /* in this example, we don't know what to do here */ }
822 break;
823#line 824 "btyacc_demo.tab.c"
824 case 266:
825#line 83 "btyacc_demo.y"
826 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
827 msg,
828 (*loc).first_line, (*loc).first_column,
829 (*loc).last_line, (*loc).last_column);
830 /* in this example, we don't know what to do here */ }
831 break;
832#line 833 "btyacc_demo.tab.c"
833 case 267:
834#line 83 "btyacc_demo.y"
835 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
836 msg,
837 (*loc).first_line, (*loc).first_column,
838 (*loc).last_line, (*loc).last_column);
839 /* in this example, we don't know what to do here */ }
840 break;
841#line 842 "btyacc_demo.tab.c"
842 case 268:
843#line 83 "btyacc_demo.y"
844 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
845 msg,
846 (*loc).first_line, (*loc).first_column,
847 (*loc).last_line, (*loc).last_column);
848 /* in this example, we don't know what to do here */ }
849 break;
850#line 851 "btyacc_demo.tab.c"
851 case 269:
852#line 83 "btyacc_demo.y"
853 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
854 msg,
855 (*loc).first_line, (*loc).first_column,
856 (*loc).last_line, (*loc).last_column);
857 /* in this example, we don't know what to do here */ }
858 break;
859#line 860 "btyacc_demo.tab.c"
860 case 59:
861#line 83 "btyacc_demo.y"
862 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
863 msg,
864 (*loc).first_line, (*loc).first_column,
865 (*loc).last_line, (*loc).last_column);
866 /* in this example, we don't know what to do here */ }
867 break;
868#line 869 "btyacc_demo.tab.c"
869 case 44:
870#line 83 "btyacc_demo.y"
871 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
872 msg,
873 (*loc).first_line, (*loc).first_column,
874 (*loc).last_line, (*loc).last_column);
875 /* in this example, we don't know what to do here */ }
876 break;
877#line 878 "btyacc_demo.tab.c"
878 case 41:
879#line 83 "btyacc_demo.y"
880 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
881 msg,
882 (*loc).first_line, (*loc).first_column,
883 (*loc).last_line, (*loc).last_column);
884 /* in this example, we don't know what to do here */ }
885 break;
886#line 887 "btyacc_demo.tab.c"
887 case 93:
888#line 83 "btyacc_demo.y"
889 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
890 msg,
891 (*loc).first_line, (*loc).first_column,
892 (*loc).last_line, (*loc).last_column);
893 /* in this example, we don't know what to do here */ }
894 break;
895#line 896 "btyacc_demo.tab.c"
896 case 123:
897#line 83 "btyacc_demo.y"
898 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
899 msg,
900 (*loc).first_line, (*loc).first_column,
901 (*loc).last_line, (*loc).last_column);
902 /* in this example, we don't know what to do here */ }
903 break;
904#line 905 "btyacc_demo.tab.c"
905 case 125:
906#line 83 "btyacc_demo.y"
907 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
908 msg,
909 (*loc).first_line, (*loc).first_column,
910 (*loc).last_line, (*loc).last_column);
911 /* in this example, we don't know what to do here */ }
912 break;
913#line 914 "btyacc_demo.tab.c"
914 case 270:
915#line 83 "btyacc_demo.y"
916 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
917 msg,
918 (*loc).first_line, (*loc).first_column,
919 (*loc).last_line, (*loc).last_column);
920 /* in this example, we don't know what to do here */ }
921 break;
922#line 923 "btyacc_demo.tab.c"
923 case 271:
924#line 83 "btyacc_demo.y"
925 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
926 msg,
927 (*loc).first_line, (*loc).first_column,
928 (*loc).last_line, (*loc).last_column);
929 /* in this example, we don't know what to do here */ }
930 break;
931#line 932 "btyacc_demo.tab.c"
932 case 272:
933#line 78 "btyacc_demo.y"
934 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
935 msg,
936 (*loc).first_line, (*loc).first_column,
937 (*loc).last_line, (*loc).last_column);
938 free((*val).expr); }
939 break;
940#line 941 "btyacc_demo.tab.c"
941 case 273:
942#line 67 "btyacc_demo.y"
943 { /* 'msg' is a 'char *' indicating the context of destructor invocation*/
944 printf("%s accessed by symbol \"decl\" (case s.b. 273) @ position[%d,%d..%d,%d]\n",
945 msg,
946 (*loc).first_line, (*loc).first_column,
947 (*loc).last_line, (*loc).last_column);
948 free((*val).decl->scope); free((*val).decl->type); }
949 break;
950#line 951 "btyacc_demo.tab.c"
951 case 274:
952#line 83 "btyacc_demo.y"
953 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
954 msg,
955 (*loc).first_line, (*loc).first_column,
956 (*loc).last_line, (*loc).last_column);
957 /* in this example, we don't know what to do here */ }
958 break;
959#line 960 "btyacc_demo.tab.c"
960 case 275:
961#line 83 "btyacc_demo.y"
962 { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
963 msg,
964 (*loc).first_line, (*loc).first_column,
965 (*loc).last_line, (*loc).last_column);
966 /* in this example, we don't know what to do here */ }
967 break;
968#line 969 "btyacc_demo.tab.c"
969 case 276:
970#line 78 "btyacc_demo.y"
971 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
972 msg,
973 (*loc).first_line, (*loc).first_column,
974 (*loc).last_line, (*loc).last_column);
975 free((*val).code); }
976 break;
977#line 978 "btyacc_demo.tab.c"
978 case 277:
979#line 78 "btyacc_demo.y"
980 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
981 msg,
982 (*loc).first_line, (*loc).first_column,
983 (*loc).last_line, (*loc).last_column);
984 free((*val).code); }
985 break;
986#line 987 "btyacc_demo.tab.c"
987 case 278:
988#line 78 "btyacc_demo.y"
989 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
990 msg,
991 (*loc).first_line, (*loc).first_column,
992 (*loc).last_line, (*loc).last_column);
993 free((*val).code); }
994 break;
995#line 996 "btyacc_demo.tab.c"
996 case 279:
997#line 73 "btyacc_demo.y"
998 { printf("%s accessed by symbol with type <decl> (case s.b. 279 & 280) @ position[%d,%d..%d,%d]\n",
999 msg,
1000 (*loc).first_line, (*loc).first_column,
1001 (*loc).last_line, (*loc).last_column);
1002 free((*val).decl); }
1003 break;
1004#line 1005 "btyacc_demo.tab.c"
1005 case 280:
1006#line 73 "btyacc_demo.y"
1007 { printf("%s accessed by symbol with type <decl> (case s.b. 279 & 280) @ position[%d,%d..%d,%d]\n",
1008 msg,
1009 (*loc).first_line, (*loc).first_column,
1010 (*loc).last_line, (*loc).last_column);
1011 free((*val).decl); }
1012 break;
1013#line 1014 "btyacc_demo.tab.c"
1014 case 281:
1015#line 78 "btyacc_demo.y"
1016 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1017 msg,
1018 (*loc).first_line, (*loc).first_column,
1019 (*loc).last_line, (*loc).last_column);
1020 free((*val).type); }
1021 break;
1022#line 1023 "btyacc_demo.tab.c"
1023 case 282:
1024#line 78 "btyacc_demo.y"
1025 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1026 msg,
1027 (*loc).first_line, (*loc).first_column,
1028 (*loc).last_line, (*loc).last_column);
1029 free((*val).type); }
1030 break;
1031#line 1032 "btyacc_demo.tab.c"
1032 case 283:
1033#line 78 "btyacc_demo.y"
1034 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1035 msg,
1036 (*loc).first_line, (*loc).first_column,
1037 (*loc).last_line, (*loc).last_column);
1038 free((*val).type); }
1039 break;
1040#line 1041 "btyacc_demo.tab.c"
1041 case 284:
1042#line 78 "btyacc_demo.y"
1043 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1044 msg,
1045 (*loc).first_line, (*loc).first_column,
1046 (*loc).last_line, (*loc).last_column);
1047 free((*val).type); }
1048 break;
1049#line 1050 "btyacc_demo.tab.c"
1050 case 285:
1051#line 78 "btyacc_demo.y"
1052 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1053 msg,
1054 (*loc).first_line, (*loc).first_column,
1055 (*loc).last_line, (*loc).last_column);
1056 free((*val).type); }
1057 break;
1058#line 1059 "btyacc_demo.tab.c"
1059 case 286:
1060#line 78 "btyacc_demo.y"
1061 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1062 msg,
1063 (*loc).first_line, (*loc).first_column,
1064 (*loc).last_line, (*loc).last_column);
1065 free((*val).scope); }
1066 break;
1067#line 1068 "btyacc_demo.tab.c"
1068 case 287:
1069#line 78 "btyacc_demo.y"
1070 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1071 msg,
1072 (*loc).first_line, (*loc).first_column,
1073 (*loc).last_line, (*loc).last_column);
1074 free((*val).dlist); }
1075 break;
1076#line 1077 "btyacc_demo.tab.c"
1077 case 288:
1078#line 78 "btyacc_demo.y"
1079 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1080 msg,
1081 (*loc).first_line, (*loc).first_column,
1082 (*loc).last_line, (*loc).last_column);
1083 free((*val).dlist); }
1084 break;
1085#line 1086 "btyacc_demo.tab.c"
1086 case 289:
1087#line 78 "btyacc_demo.y"
1088 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1089 msg,
1090 (*loc).first_line, (*loc).first_column,
1091 (*loc).last_line, (*loc).last_column);
1092 free((*val).scope); }
1093 break;
1094#line 1095 "btyacc_demo.tab.c"
1095 case 290:
1096#line 78 "btyacc_demo.y"
1097 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1098 msg,
1099 (*loc).first_line, (*loc).first_column,
1100 (*loc).last_line, (*loc).last_column);
1101 free((*val).scope); }
1102 break;
1103#line 1104 "btyacc_demo.tab.c"
1104 case 291:
1105#line 78 "btyacc_demo.y"
1106 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1107 msg,
1108 (*loc).first_line, (*loc).first_column,
1109 (*loc).last_line, (*loc).last_column);
1110 free((*val).type); }
1111 break;
1112#line 1113 "btyacc_demo.tab.c"
1113 case 292:
1114#line 78 "btyacc_demo.y"
1115 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1116 msg,
1117 (*loc).first_line, (*loc).first_column,
1118 (*loc).last_line, (*loc).last_column);
1119 free((*val).scope); }
1120 break;
1121#line 1122 "btyacc_demo.tab.c"
1122 case 293:
1123#line 78 "btyacc_demo.y"
1124 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1125 msg,
1126 (*loc).first_line, (*loc).first_column,
1127 (*loc).last_line, (*loc).last_column);
1128 free((*val).scope); }
1129 break;
1130#line 1131 "btyacc_demo.tab.c"
1131 case 294:
1132#line 78 "btyacc_demo.y"
1133 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1134 msg,
1135 (*loc).first_line, (*loc).first_column,
1136 (*loc).last_line, (*loc).last_column);
1137 free((*val).type); }
1138 break;
1139#line 1140 "btyacc_demo.tab.c"
1140 case 295:
1141#line 78 "btyacc_demo.y"
1142 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1143 msg,
1144 (*loc).first_line, (*loc).first_column,
1145 (*loc).last_line, (*loc).last_column);
1146 free((*val).scope); }
1147 break;
1148#line 1149 "btyacc_demo.tab.c"
1149 case 296:
1150#line 78 "btyacc_demo.y"
1151 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1152 msg,
1153 (*loc).first_line, (*loc).first_column,
1154 (*loc).last_line, (*loc).last_column);
1155 free((*val).type); }
1156 break;
1157#line 1158 "btyacc_demo.tab.c"
1158 case 297:
1159#line 78 "btyacc_demo.y"
1160 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1161 msg,
1162 (*loc).first_line, (*loc).first_column,
1163 (*loc).last_line, (*loc).last_column);
1164 free((*val).scope); }
1165 break;
1166#line 1167 "btyacc_demo.tab.c"
1167 case 298:
1168#line 78 "btyacc_demo.y"
1169 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1170 msg,
1171 (*loc).first_line, (*loc).first_column,
1172 (*loc).last_line, (*loc).last_column);
1173 free((*val).scope); }
1174 break;
1175#line 1176 "btyacc_demo.tab.c"
1176 case 299:
1177#line 78 "btyacc_demo.y"
1178 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1179 msg,
1180 (*loc).first_line, (*loc).first_column,
1181 (*loc).last_line, (*loc).last_column);
1182 free((*val).scope); }
1183 break;
1184#line 1185 "btyacc_demo.tab.c"
1185 case 300:
1186#line 78 "btyacc_demo.y"
1187 { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n",
1188 msg,
1189 (*loc).first_line, (*loc).first_column,
1190 (*loc).last_line, (*loc).last_column);
1191 free((*val).scope); }
1192 break;
1193#line 1194 "btyacc_demo.tab.c"
1194 }
1195}
1196#define YYDESTRUCT_IS_DECLARED 1
1197#endif
1198
1199/* For use in generated program */
1200#define yydepth (int)(yystack.s_mark - yystack.s_base)
1201#if YYBTYACC
1202#define yytrial (yyps->save)
1203#endif /* YYBTYACC */
1204
1205#if YYDEBUG
1206#include <stdio.h> /* needed for printf */
1207#endif
1208
1209#include <stdlib.h> /* needed for malloc, etc */
1210#include <string.h> /* needed for memset */
1211
1212/* allocate initial stack or double stack size, up to YYMAXDEPTH */
1213static int yygrowstack(YYSTACKDATA *data)
1214{
1215 int i;
1216 unsigned newsize;
1217 short *newss;
1218 YYSTYPE *newvs;
--- 167 unchanged lines hidden (view full) ---
1386 yychar = *yylexp++;
1387 break;
1388 }
1389 if (yyps->save)
1390 {
1391 /* in trial mode; save scanner results for future parse attempts */
1392 if (yylvp == yylvlim)
1393 { /* Enlarge lexical value queue */
1394 size_t p = (size_t) (yylvp - yylvals);
1395 size_t s = (size_t) (yylvlim - yylvals);
1396
1397 s += YYLVQUEUEGROWTH;
1398 if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem;
1399 if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem;
1400#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1401 if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem;
1402#endif
1403 yylvp = yylve = yylvals + p;
--- 79 unchanged lines hidden (view full) ---
1483 }
1484#endif
1485 save = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
1486 if (save == NULL) goto yyenomem;
1487 save->save = yyps->save;
1488 save->state = yystate;
1489 save->errflag = yyerrflag;
1490 save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
1491 memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
1492 save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
1493 memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1494#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1495 save->yystack.p_mark = save->yystack.p_base + (yystack.p_mark - yystack.p_base);
1496 memcpy (save->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1497#endif
1498 ctry = yytable[yyn];
1499 if (yyctable[ctry] == -1)
1500 {
1501#if YYDEBUG
1502 if (yydebug && yychar >= YYEOF)
1503 fprintf(stderr, "%s[%d]: backtracking 1 token\n", YYDEBUGSTR, yydepth);
1504#endif
--- 38 unchanged lines hidden (view full) ---
1543 {
1544 yylvp--;
1545#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1546 yylpp--;
1547#endif
1548 yylexp--;
1549 yychar = YYEMPTY;
1550 }
1551 save->lexeme = (int) (yylvp - yylvals);
1552 yyps->save = save;
1553 }
1554 if (yytable[yyn] == ctry)
1555 {
1556#if YYDEBUG
1557 if (yydebug)
1558 fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
1559 YYDEBUGSTR, yydepth, yystate, yyctable[ctry]);
--- 77 unchanged lines hidden (view full) ---
1637 if (yyerrctx) yyFreeState(yyerrctx);
1638 /* Create and fill out new saved error context state */
1639 yyerrctx = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
1640 if (yyerrctx == NULL) goto yyenomem;
1641 yyerrctx->save = yyps->save;
1642 yyerrctx->state = yystate;
1643 yyerrctx->errflag = yyerrflag;
1644 yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
1645 memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
1646 yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
1647 memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1648#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1649 yyerrctx->yystack.p_mark = yyerrctx->yystack.p_base + (yystack.p_mark - yystack.p_base);
1650 memcpy (yyerrctx->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1651#endif
1652 yyerrctx->lexeme = (int) (yylvp - yylvals);
1653 }
1654 yylvp = yylvals + save->lexeme;
1655#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1656 yylpp = yylpsns + save->lexeme;
1657#endif
1658 yylexp = yylexemes + save->lexeme;
1659 yychar = YYEMPTY;
1660 yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
1661 memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
1662 yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
1663 memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1664#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1665 yystack.p_mark = yystack.p_base + (save->yystack.p_mark - save->yystack.p_base);
1666 memcpy (yystack.p_base, save->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1667#endif
1668 ctry = ++save->ctry;
1669 yystate = save->state;
1670 /* We tried shift, try reduce now */
1671 if ((yyn = yyctable[ctry]) >= 0) goto yyreduce;
1672 yyps->save = save->save;
1673 save->save = NULL;
1674 yyFreeState(save);
--- 13 unchanged lines hidden (view full) ---
1688#endif
1689 yylexp = yylexemes + yyerrctx->lexeme;
1690 yychar = yylexp[-1];
1691 yylval = yylvp[-1];
1692#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1693 yylloc = yylpp[-1];
1694#endif
1695 yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
1696 memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
1697 yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
1698 memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1699#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1700 yystack.p_mark = yystack.p_base + (yyerrctx->yystack.p_mark - yyerrctx->yystack.p_base);
1701 memcpy (yystack.p_base, yyerrctx->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1702#endif
1703 yystate = yyerrctx->state;
1704 yyFreeState(yyerrctx);
1705 yyerrctx = NULL;
1706 }
1707 yynewerrflag = 1;
1708 }
1709 if (yynewerrflag == 0) goto yyinrecovery;
--- 403 unchanged lines hidden (view full) ---
2113#line 193 "btyacc_demo.y"
2114 { yyval.code = code_append(yystack.l_mark[-2].code, yystack.l_mark[0].code); }
2115break;
2116case 61:
2117 if (!yytrial)
2118#line 197 "btyacc_demo.y"
2119 { yyval.code = yystack.l_mark[-1].code; }
2120break;
2121#line 2122 "btyacc_demo.tab.c"
2122 default:
2123 break;
2124 }
2125 yystack.s_mark -= yym;
2126 yystate = *yystack.s_mark;
2127 yystack.l_mark -= yym;
2128#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
2129 yystack.p_mark -= yym;
--- 34 unchanged lines hidden (view full) ---
2164 yychar = *yylexp++;
2165 break;
2166 }
2167 if (yyps->save)
2168 {
2169 /* in trial mode; save scanner results for future parse attempts */
2170 if (yylvp == yylvlim)
2171 { /* Enlarge lexical value queue */
2172 size_t p = (size_t) (yylvp - yylvals);
2173 size_t s = (size_t) (yylvlim - yylvals);
2174
2175 s += YYLVQUEUEGROWTH;
2176 if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL)
2177 goto yyenomem;
2178 if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL)
2179 goto yyenomem;
2180#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
2181 if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL)
--- 86 unchanged lines hidden (view full) ---
2268 }
2269 yylvp = yylvals + yypath->lexeme;
2270#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
2271 yylpp = yylpsns + yypath->lexeme;
2272#endif
2273 yylexp = yylexemes + yypath->lexeme;
2274 yychar = YYEMPTY;
2275 yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
2276 memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
2277 yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
2278 memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
2279#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
2280 yystack.p_mark = yystack.p_base + (yypath->yystack.p_mark - yypath->yystack.p_base);
2281 memcpy (yystack.p_base, yypath->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
2282#endif
2283 yystate = yypath->state;
2284 goto yyloop;
2285#endif /* YYBTYACC */
2286
2287yyoverflow:
2288 YYERROR_CALL("yacc stack overflow");
2289#if YYBTYACC
--- 67 unchanged lines hidden ---