#include <stdio.h>#include <unistd.h>#include <string.h>#include "bif_arg.h"#include "bif_parse.h"Include dependency graph for bif_lex.cc:

Go to the source code of this file.
Classes | |
| struct | yy_buffer_state |
Defines | |
| #define | FLEX_SCANNER |
| #define | YY_FLEX_MAJOR_VERSION 2 |
| #define | YY_FLEX_MINOR_VERSION 5 |
| #define | yyconst |
| #define | YY_PROTO(proto) () |
| #define | YY_NULL 0 |
| #define | YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) |
| #define | BEGIN yy_start = 1 + 2 * |
| #define | YY_START ((yy_start - 1) / 2) |
| #define | YYSTATE YY_START |
| #define | YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) |
| #define | YY_NEW_FILE yyrestart( yyin ) |
| #define | YY_END_OF_BUFFER_CHAR 0 |
| #define | YY_BUF_SIZE 16384 |
| #define | EOB_ACT_CONTINUE_SCAN 0 |
| #define | EOB_ACT_END_OF_FILE 1 |
| #define | EOB_ACT_LAST_MATCH 2 |
| #define | yyless(n) |
| #define | unput(c) yyunput( c, yytext_ptr ) |
| #define | YY_BUFFER_NEW 0 |
| #define | YY_BUFFER_NORMAL 1 |
| #define | YY_BUFFER_EOF_PENDING 2 |
| #define | YY_CURRENT_BUFFER yy_current_buffer |
| #define | YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) |
| #define | yy_new_buffer yy_create_buffer |
| #define | yy_set_interactive(is_interactive) |
| #define | yy_set_bol(at_bol) |
| #define | YY_AT_BOL() (yy_current_buffer->yy_at_bol) |
| #define | yytext_ptr yytext |
| #define | YY_DO_BEFORE_ACTION |
| #define | YY_NUM_RULES 30 |
| #define | YY_END_OF_BUFFER 31 |
| #define | REJECT reject_used_but_not_detected |
| #define | yymore() yymore_used_but_not_detected |
| #define | YY_MORE_ADJ 0 |
| #define | YY_RESTORE_YY_MORE_OFFSET |
| #define | INITIAL 0 |
| #define | YY_NO_PUSH_STATE 1 |
| #define | YY_NO_POP_STATE 1 |
| #define | YY_NO_TOP_STATE 1 |
| #define | YY_READ_BUF_SIZE 8192 |
| #define | ECHO (void) fwrite( yytext, yyleng, 1, yyout ) |
| #define | YY_INPUT(buf, result, max_size) |
| #define | yyterminate() return YY_NULL |
| #define | YY_START_STACK_INCR 25 |
| #define | YY_FATAL_ERROR(msg) yy_fatal_error( msg ) |
| #define | YY_DECL int yylex YY_PROTO(( void )) |
| #define | YY_BREAK break; |
| #define | YY_RULE_SETUP YY_USER_ACTION |
| #define | YY_EXIT_FAILURE 2 |
| #define | yyless(n) |
Typedefs | |
| typedef yy_buffer_state * | YY_BUFFER_STATE |
| typedef unsigned int | yy_size_t |
| typedef unsigned char | YY_CHAR |
| typedef int | yy_state_type |
Functions | |
| void yyrestart | YY_PROTO ((FILE *input_file)) |
| void yy_switch_to_buffer | YY_PROTO ((YY_BUFFER_STATE new_buffer)) |
| void yy_load_buffer_state | YY_PROTO ((void)) |
| YY_BUFFER_STATE yy_create_buffer | YY_PROTO ((FILE *file, int size)) |
| void yy_delete_buffer | YY_PROTO ((YY_BUFFER_STATE b)) |
| void yy_init_buffer | YY_PROTO ((YY_BUFFER_STATE b, FILE *file)) |
| YY_BUFFER_STATE yy_scan_buffer | YY_PROTO ((char *base, yy_size_t size)) |
| YY_BUFFER_STATE yy_scan_string | YY_PROTO ((yyconst char *yy_str)) |
| YY_BUFFER_STATE yy_scan_bytes | YY_PROTO ((yyconst char *bytes, int len)) |
| void *yy_flex_alloc | YY_PROTO ((yy_size_t)) |
| void *yy_flex_realloc | YY_PROTO ((void *, yy_size_t)) |
| void yy_flex_free | YY_PROTO ((void *)) |
| yy_state_type yy_try_NUL_trans | YY_PROTO ((yy_state_type current_state)) |
| void yy_fatal_error | YY_PROTO ((yyconst char msg[])) |
| char * | copy_string (const char *s) |
| int | check_c_mode (int t) |
| void yyunput | YY_PROTO ((int c, char *buf_ptr)) |
| FILE * | open_output_file (const char *surfix) |
| int | main (int argc, char *argv[]) |
Variables | |
| int | yyleng |
| FILE * | yyin = (FILE *) 0 *yyout = (FILE *) 0 |
| FILE * | yyout |
| YY_BUFFER_STATE | yy_current_buffer = 0 |
| char | yy_hold_char |
| int | yy_n_chars |
| char * | yy_c_buf_p = (char *) 0 |
| int | yy_init = 1 |
| int | yy_start = 0 |
| int | yy_did_buffer_switch_on_eof |
| char * | yytext |
| yyconst short int | yy_accept [96] |
| yyconst int | yy_ec [256] |
| yyconst int | yy_meta [48] |
| yyconst short int | yy_base [101] |
| yyconst short int | yy_def [101] |
| yyconst short int | yy_nxt [194] |
| yyconst short int | yy_chk [194] |
| yy_state_type | yy_last_accepting_state |
| char * | yy_last_accepting_cpos |
| int | line_number = 1 |
| int | in_c_code |
| register char * | yy_bp |
| int | size |
| FILE * | file |
| int | len |
| char * | input_filename = 0 |
| FILE * | fp_bro_init |
| FILE * | fp_func_def |
| FILE * | fp_func_h |
| FILE * | fp_func_init |
| FILE * | fp_netvar_h |
| FILE * | fp_netvar_def |
| FILE * | fp_netvar_init |
|
|
Definition at line 80 of file bif_lex.cc. |
|
|
Definition at line 545 of file bif_lex.cc. |
|
|
Definition at line 105 of file bif_lex.cc. |
|
|
Definition at line 106 of file bif_lex.cc. |
|
|
Definition at line 107 of file bif_lex.cc. |
|
|
Definition at line 8 of file bif_lex.cc. |
|
|
Definition at line 438 of file bif_lex.cc. |
|
|
Definition at line 432 of file bif_lex.cc. |
|
|
Definition at line 136 of file bif_lex.cc. |
|
|
Definition at line 263 of file bif_lex.cc. |
|
|
Definition at line 604 of file bif_lex.cc. |
|
|
Definition at line 98 of file bif_lex.cc. |
|
|
Definition at line 199 of file bif_lex.cc. |
|
|
Definition at line 187 of file bif_lex.cc. |
|
|
Definition at line 188 of file bif_lex.cc. |
|
|
Definition at line 208 of file bif_lex.cc. |
|
|
Definition at line 592 of file bif_lex.cc. |
|
|
Value: yytext_ptr = yy_bp; \ yyleng = (int) (yy_cp - yy_bp); \ yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ yy_c_buf_p = yy_cp; Definition at line 279 of file bif_lex.cc. |
|
|
Definition at line 287 of file bif_lex.cc. |
|
|
Definition at line 95 of file bif_lex.cc. |
|
|
|
|
|
Definition at line 585 of file bif_lex.cc. |
|
|
Definition at line 9 of file bif_lex.cc. |
|
|
Definition at line 10 of file bif_lex.cc. |
|
|
Definition at line 237 of file bif_lex.cc. |
|
|
Value: if ( yy_current_buffer->yy_is_interactive ) \ { \ int c = '*', n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); Definition at line 552 of file bif_lex.cc. |
|
|
Definition at line 434 of file bif_lex.cc. |
|
|
Definition at line 247 of file bif_lex.cc. |
|
|
Definition at line 93 of file bif_lex.cc. |
|
|
Definition at line 515 of file bif_lex.cc. |
|
|
Definition at line 514 of file bif_lex.cc. |
|
|
Definition at line 516 of file bif_lex.cc. |
|
|
Definition at line 67 of file bif_lex.cc. |
|
|
Definition at line 286 of file bif_lex.cc. |
|
|
Definition at line 63 of file bif_lex.cc. |
|
|
Definition at line 536 of file bif_lex.cc. |
|
|
Definition at line 435 of file bif_lex.cc. |
|
|
Definition at line 607 of file bif_lex.cc. |
|
|
Definition at line 74 of file bif_lex.cc. |
|
|
Value: { \
if ( ! yy_current_buffer ) \
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
yy_current_buffer->yy_at_bol = at_bol; \
}
Definition at line 256 of file bif_lex.cc. |
|
|
Value: { \
if ( ! yy_current_buffer ) \
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
yy_current_buffer->yy_is_interactive = is_interactive; \
}
Definition at line 249 of file bif_lex.cc. |
|
|
Definition at line 86 of file bif_lex.cc. |
|
|
Definition at line 580 of file bif_lex.cc. |
|
|
Definition at line 90 of file bif_lex.cc. |
|
|
Definition at line 56 of file bif_lex.cc. |
|
|
Value: do \ { \ \ yytext[yyleng] = yy_hold_char; \ yy_c_buf_p = yytext + n; \ yy_hold_char = *yy_c_buf_p; \ *yy_c_buf_p = '\0'; \ yyleng = n; \ } \ while ( 0 ) Definition at line 125 of file bif_lex.cc. |
|
|
Value: do \ { \ \ *yy_cp = yy_hold_char; \ YY_RESTORE_YY_MORE_OFFSET \ yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; \ } \ while ( 0 ) Definition at line 125 of file bif_lex.cc. |
|
|
Definition at line 433 of file bif_lex.cc. |
|
|
Definition at line 87 of file bif_lex.cc. |
|
|
Definition at line 575 of file bif_lex.cc. |
|
|
Definition at line 269 of file bif_lex.cc. |
|
|
Definition at line 100 of file bif_lex.cc. |
|
|
Definition at line 265 of file bif_lex.cc. |
|
|
Definition at line 142 of file bif_lex.cc. |
|
|
Definition at line 267 of file bif_lex.cc. |
|
|
Definition at line 457 of file bif_lex.cc. References copy_string(), in_c_code, TOK_C_TOKEN, yylval, and yytext.
00458 {
00459 if ( ! in_c_code )
00460 return t;
00461
00462 yylval.str = copy_string(yytext);
00463 return TOK_C_TOKEN;
00464 }
|
|
|
Definition at line 446 of file bif_lex.cc.
00447 {
00448 char* c = new char[strlen(s)+1];
00449 strcpy(c, s);
00450 return c;
00451 }
|
|
||||||||||||
|
Definition at line 1797 of file bif_lex.cc. References fp_bro_init, fp_func_def, fp_func_h, fp_func_init, fp_netvar_def, fp_netvar_h, fp_netvar_init, input_filename, open_output_file(), YY_BUF_SIZE, yy_create_buffer, yy_switch_to_buffer, and yyparse.
01798 {
01799 for ( int i = 1; i < argc; i++ )
01800 {
01801 FILE* fp_input;
01802 char *slash;
01803
01804 input_filename = argv[i];
01805 slash = strrchr(input_filename, '/');
01806
01807 if ( (fp_input = fopen(input_filename, "r")) == NULL )
01808 {
01809 fprintf(stderr, "Error: cannot open file: %s\n", input_filename);
01810 exit(1);
01811 }
01812
01813 if ( slash )
01814 input_filename = slash + 1;
01815
01816 fp_bro_init = open_output_file("bro");
01817 fp_func_h = open_output_file("func_h");
01818 fp_func_def = open_output_file("func_def");
01819 fp_func_init = open_output_file("func_init");
01820 fp_netvar_h = open_output_file("netvar_h");
01821 fp_netvar_def = open_output_file("netvar_def");
01822 fp_netvar_init = open_output_file("netvar_init");
01823
01824 yy_switch_to_buffer(yy_create_buffer(fp_input, YY_BUF_SIZE));
01825 yyparse();
01826
01827 fclose(fp_input);
01828 fclose(fp_bro_init);
01829 fclose(fp_func_h);
01830 fclose(fp_func_def);
01831 fclose(fp_func_init);
01832 fclose(fp_netvar_h);
01833 fclose(fp_netvar_def);
01834 fclose(fp_netvar_init);
01835 }
01836 }
|
|
|
Definition at line 1782 of file bif_lex.cc. References input_filename, and snprintf(). Referenced by main().
01783 {
01784 char fn[1024];
01785 FILE* fp;
01786
01787 snprintf(fn, sizeof(fn), "%s.%s", input_filename, surfix);
01788 if ( (fp = fopen(fn, "w")) == NULL )
01789 {
01790 fprintf(stderr, "Error: cannot open file: %s\n", fn);
01791 exit(1);
01792 }
01793
01794 return fp;
01795 }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 1451 of file bif_lex.cc. |
|
|
Definition at line 1774 of file bif_lex.cc. |
|
|
Definition at line 1775 of file bif_lex.cc. |
|
|
Definition at line 1776 of file bif_lex.cc. |
|
|
Definition at line 1777 of file bif_lex.cc. |
|
|
Definition at line 1779 of file bif_lex.cc. |
|
|
Definition at line 1778 of file bif_lex.cc. |
|
|
Definition at line 1780 of file bif_lex.cc. |
|
|
Definition at line 455 of file bif_lex.cc. Referenced by check_c_mode(), and yyparse(). |
|
|
Definition at line 1772 of file bif_lex.cc. Referenced by compile(), main(), Object::Object(), open_output_file(), yyerror(), and yyparse(). |
|
|
Definition at line 1564 of file bif_lex.cc. |
|
|
Definition at line 453 of file bif_lex.cc. Referenced by dbg_eval_expr(), Object::Object(), pinpoint(), yyerror(), and FileInfo::~FileInfo(). |
|
|
Definition at line 1732 of file bif_lex.cc. |
|
|
Initial value:
{ 0,
0, 0, 31, 29, 3, 2, 29, 1, 29, 29,
4, 29, 29, 26, 25, 24, 26, 26, 26, 26,
3, 0, 28, 0, 1, 0, 9, 10, 5, 6,
27, 0, 0, 0, 0, 0, 0, 26, 26, 26,
26, 26, 26, 0, 0, 7, 8, 27, 11, 0,
0, 0, 0, 0, 26, 26, 26, 26, 26, 0,
0, 0, 0, 0, 0, 26, 16, 26, 26, 26,
17, 0, 0, 22, 0, 0, 0, 15, 14, 26,
26, 19, 18, 21, 0, 0, 26, 26, 23, 20,
26, 26, 12, 13, 0
}
Definition at line 288 of file bif_lex.cc. |
|
|
Initial value:
{ 0,
0, 0, 145, 146, 142, 146, 44, 0, 43, 0,
146, 132, 35, 0, 0, 0, 104, 18, 99, 107,
137, 50, 146, 46, 0, 10, 146, 146, 146, 146,
0, 127, 111, 112, 106, 102, 98, 0, 81, 75,
83, 78, 70, 55, 88, 146, 146, 0, 146, 93,
93, 84, 95, 87, 68, 66, 62, 66, 58, 0,
52, 82, 74, 77, 65, 47, 0, 46, 44, 49,
146, 69, 68, 146, 66, 60, 59, 0, 0, 41,
33, 146, 146, 146, 59, 58, 33, 37, 146, 146,
31, 25, 0, 0, 146, 122, 126, 58, 128, 130
}
Definition at line 344 of file bif_lex.cc. |
|
|
Definition at line 1223 of file bif_lex.cc. |
|
|
Definition at line 220 of file bif_lex.cc. |
|
|
Initial value:
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 7, 9, 13,
9, 9, 13, 22, 18, 26, 26, 24, 44, 13,
18, 98, 13, 92, 13, 61, 44, 91, 61, 88,
87, 86, 85, 81, 7, 80, 77, 76, 61, 75,
22, 73, 72, 70, 69, 44, 68, 66, 9, 9,
24, 45, 65, 64, 63, 62, 59, 58, 57, 45,
45, 56, 45, 45, 45, 45, 45, 55, 54, 53,
52, 51, 50, 43, 42, 41, 40, 39, 45, 45,
45, 45, 96, 37, 96, 96, 97, 36, 97, 97,
99, 99, 100, 100, 35, 34, 33, 32, 21, 20,
19, 17, 12, 5, 3, 95, 95, 95, 95, 95,
95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
95, 95, 95
}
Definition at line 400 of file bif_lex.cc. |
|
|
Definition at line 202 of file bif_lex.cc. |
|
|
Initial value:
{ 0,
95, 1, 95, 95, 95, 95, 96, 97, 95, 98,
95, 95, 95, 99, 99, 99, 99, 99, 99, 99,
95, 96, 95, 96, 97, 95, 95, 95, 95, 95,
100, 95, 95, 95, 95, 95, 95, 99, 99, 99,
99, 99, 99, 96, 96, 95, 95, 100, 95, 95,
95, 95, 95, 95, 99, 99, 99, 99, 99, 45,
95, 95, 95, 95, 95, 99, 99, 99, 99, 99,
95, 95, 95, 95, 95, 95, 95, 99, 99, 99,
99, 95, 95, 95, 95, 95, 99, 99, 95, 95,
99, 99, 99, 99, 0, 95, 95, 95, 95, 95
}
Definition at line 359 of file bif_lex.cc. |
|
|
Definition at line 227 of file bif_lex.cc. |
|
|
Definition at line 303 of file bif_lex.cc. |
|
|
Definition at line 212 of file bif_lex.cc. |
|
|
Definition at line 221 of file bif_lex.cc. |
|
|
Definition at line 427 of file bif_lex.cc. |
|
|
Definition at line 426 of file bif_lex.cc. |
|
|
Initial value:
{ 0,
1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
1, 3, 3, 1, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
1, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 1, 1
}
Definition at line 335 of file bif_lex.cc. |
|
|
Definition at line 214 of file bif_lex.cc. |
|
|
Initial value:
{ 0,
4, 5, 6, 7, 8, 9, 10, 4, 4, 11,
12, 4, 4, 13, 14, 14, 14, 14, 15, 14,
14, 14, 14, 14, 14, 14, 14, 16, 14, 14,
4, 17, 18, 19, 14, 14, 14, 14, 20, 14,
14, 14, 14, 14, 14, 4, 4, 23, 26, 33,
27, 28, 34, 23, 40, 46, 47, 44, 23, 35,
41, 31, 36, 94, 37, 71, 44, 93, 72, 92,
91, 90, 89, 88, 24, 87, 86, 85, 73, 84,
24, 83, 82, 81, 80, 24, 79, 78, 29, 30,
45, 23, 77, 76, 75, 74, 70, 69, 68, 60,
60, 67, 60, 60, 60, 60, 60, 66, 65, 64,
63, 62, 61, 59, 58, 57, 56, 55, 24, 60,
60, 60, 22, 54, 22, 22, 25, 53, 25, 25,
38, 38, 48, 48, 52, 51, 50, 49, 21, 43,
42, 39, 32, 21, 95, 3, 95, 95, 95, 95,
95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
95, 95, 95
}
Definition at line 374 of file bif_lex.cc. |
|
|
Definition at line 222 of file bif_lex.cc. |
|
|
Definition at line 266 of file bif_lex.cc. |
|
|
Definition at line 217 of file bif_lex.cc. |
|
|
Definition at line 103 of file bif_lex.cc. |
|
|
Definition at line 436 of file bif_lex.cc. |
1.3.5