- Timestamp:
- Jan 2, 2015 12:43:14 PM (10 years ago)
- Location:
- trunk/src/VBox/ExtPacks/VBoxDTrace
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ExtPacks/VBoxDTrace/VBoxDTrace/Makefile.kmk
r53699 r53701 101 101 VBoxDTrace_USES += yacc 102 102 VBoxDTrace_YACCTOOL = BISON 103 VBoxDTrace_YACCFLAGS = -d 103 VBoxDTrace_YACCFLAGS = -d -y 104 104 VBoxDTrace_SOURCES += \ 105 105 $(VBOXDT_PATH_LIBDTRACE)/common/dt_grammar.y … … 113 113 VBoxDTrace_USES += lex 114 114 VBoxDTrace_LEXTOOL = FLEX 115 VBoxDTrace_LEXFLAGS = -l 115 VBoxDTrace_LEXFLAGS = -l -B #-d -T 116 116 VBoxDTrace_DEFS += USING_FLEX 117 117 VBoxDTrace_SOURCES += \ -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_cc.c
r53699 r53701 2145 2145 pcb.pcb_token = context; 2146 2146 2147 #ifdef USING_FLEX /* In case flex starts work too early. Moved from dt_pcb_push. */ 2148 yyinit(&pcb); 2149 #endif 2147 2150 if (context != DT_CTX_DPROG) 2148 2151 yybegin(YYS_EXPR); … … 2171 2174 * we optionally display the parse tree if debugging is enabled. 2172 2175 */ 2173 fprintf(stderr, "debug: calling yyparse\n"); /* REMOVE ME */2174 2176 if (yyparse() != 0 || yypcb->pcb_root == NULL) 2175 xyerror(D_EMPTY, "empty D program translation unit (#1)\n"); /* REMOVE (#1) */2177 xyerror(D_EMPTY, "empty D program translation unit\n"); 2176 2178 2177 2179 yybegin(YYS_DONE); … … 2204 2206 if ((dnp = yypcb->pcb_root->dn_list) == NULL && 2205 2207 !(yypcb->pcb_cflags & DTRACE_C_EMPTY)) 2206 xyerror(D_EMPTY, "empty D program translation unit (#2)\n"); /* REMOVE (#2) */2208 xyerror(D_EMPTY, "empty D program translation unit\n"); 2207 2209 2208 2210 if ((yypcb->pcb_prog = dt_program_create(dtp)) == NULL) -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_lex.l
r53699 r53701 55 55 result = (int)fread(buf, 1, max_size, yypcb->pcb_fileptr); \ 56 56 if (!result && ferror(yypcb->pcb_fileptr)) \ 57 YY_FATAL_ERROR("input in flex scanner failed"); \ 57 longjmp(yypcb->pcb_jmpbuf, EDT_FIO); \ 58 /*YY_FATAL_ERROR("input in flex scanner failed");*/ \ 58 59 } else { \ 59 60 size_t off = yypcb->pcb_strptr - yypcb->pcb_string; \ … … 65 66 memcpy(buf, yypcb->pcb_strptr, result); \ 66 67 yypcb->pcb_strptr += result; \ 67 fprintf(stderr, "yy_input -> %d '%.*s'\n", result, result, buf); /* REMOVE ME*/ \68 /*fprintf(stderr, "yy_input -> %d '%.*s'\n", result, result, buf);*/ \ 68 69 } else { \ 69 70 buf[0] = '\0'; \ 70 result = (YYSTATE) == S0; \71 fprintf(stderr, "yy_input -> %d\n", result); /* REMOVE ME*/ \71 result = 0; \ 72 /*fprintf(stderr, "yy_input -> %d\n", result);*/ \ 72 73 } \ 73 74 } \ … … 519 520 tok = DT_TOK_DIV; 520 521 521 unput(c);522 if (c != EOF) unput(c); 522 523 return (tok); 523 524 } … … 599 600 <S0>{RGX_WS} ; /* discard */ 600 601 <S0>"\\"\n ; /* discard */ 601 /* VBOX - START */602 <S0>"\0" {603 fprintf(stderr, "<S0>\\0\n");604 return (DT_TOK_EOF);605 }606 /* VBOX - END */607 602 <S0>. yyerror("syntax error near \"%c\"\n", yytext[0]); 608 603 … … 610 605 <S1>"*/" BEGIN(yypcb->pcb_cstate); 611 606 /* VBOX - START */ 612 <S1> "\0"yyerror("end-of-file encountered before matching */\n");607 <S1><<EOF>> yyerror("end-of-file encountered before matching */\n"); 613 608 /* VBOX - END */ 614 609 <S1>.|\n ; /* discard */ … … 671 666 672 667 <S2>{RGX_WS} ; /* discard */ 673 /* VBOX - START */674 <S2>"\0" {675 fprintf(stderr, "<S2>\\0\n");676 return (DT_TOK_EOF);677 }678 /* VBOX - END */679 668 <S2>. yyerror("syntax error near \"%c\"\n", yytext[0]); 680 669 … … 707 696 708 697 /* VBOX - BEGIN */ 709 <S3> "\0"yyerror("end-of-file encountered before end of control line\n");698 <S3><<EOF>> yyerror("end-of-file encountered before end of control line\n"); 710 699 /* VBOX - END */ 711 700 <S3>. yyerror("syntax error near \"%c\"\n", yytext[0]); … … 767 756 #ifndef USING_FLEX 768 757 yysptr = yysbuf; 758 #else 759 yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE)); 769 760 #endif 770 761 } … … 838 829 if ((c1 = input()) == c0) 839 830 ttok = DT_TOK_IDENT; 840 unput(c1);831 if (c1 != EOF) unput(c1); 841 832 break; 842 833 … … 844 835 if ((c1 = input()) != c0) 845 836 ttok = DT_TOK_IDENT; 846 unput(c1);837 if (c1 != EOF) unput(c1); 847 838 break; 848 839 case '[': … … 859 850 } 860 851 861 unput(c0);852 if (c0 != EOF) unput(c0); 862 853 return (ttok); 863 854 } -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_pcb.c
r53655 r53701 91 91 dtp->dt_gen++; 92 92 93 #ifndef USING_FLEX /* In case flex starts work too early. Moved to dt_compile. */ 93 94 yyinit(pcb); 95 #endif 94 96 } 95 97
Note:
See TracChangeset
for help on using the changeset viewer.