Otawa
0.10
|
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <otawa/ast.h>
#include <otawa/ast/ASTLoader.h>
#include "ast_parser.h"
#include <unistd.h>
Typedefs | |
typedef signed char | flex_int8_t |
typedef short int | flex_int16_t |
typedef int | flex_int32_t |
typedef unsigned char | flex_uint8_t |
typedef unsigned short int | flex_uint16_t |
typedef unsigned int | flex_uint32_t |
typedef struct yy_buffer_state * | YY_BUFFER_STATE |
typedef size_t | yy_size_t |
typedef unsigned char | YY_CHAR |
typedef int | yy_state_type |
Functions | |
void | ast_restart (FILE *input_file) |
Immediately switch to a different input stream. More... | |
void | ast__switch_to_buffer (YY_BUFFER_STATE new_buffer) |
Switch to a different input buffer. More... | |
YY_BUFFER_STATE | ast__create_buffer (FILE *file, int size) |
Allocate and initialize an input buffer state. More... | |
void | ast__delete_buffer (YY_BUFFER_STATE b) |
Destroy the buffer. More... | |
void | ast__flush_buffer (YY_BUFFER_STATE b) |
Discard all buffered characters. More... | |
void | ast_push_buffer_state (YY_BUFFER_STATE new_buffer) |
Pushes the new state onto the stack. More... | |
void | ast_pop_buffer_state (void) |
Removes and deletes the top of the stack, if present. More... | |
YY_BUFFER_STATE | ast__scan_buffer (char *base, yy_size_t size) |
Setup the input buffer state to scan directly from a user-specified character buffer. More... | |
YY_BUFFER_STATE | ast__scan_string (yyconst char *yystr) |
Setup the input buffer state to scan a string. More... | |
YY_BUFFER_STATE | ast__scan_bytes (yyconst char *yybytes, int _yybytes_len) |
Setup the input buffer state to scan the given bytes. More... | |
void * | ast_alloc (yy_size_t) |
void * | ast_realloc (void *, yy_size_t) |
void | ast_free (void *) |
int | ast_lex_destroy (void) |
int | ast_get_debug (void) |
void | ast_set_debug (int debug_flag) |
YY_EXTRA_TYPE | ast_get_extra (void) |
void | ast_set_extra (YY_EXTRA_TYPE user_defined) |
FILE * | ast_get_in (void) |
Get the input stream. More... | |
void | ast_set_in (FILE *in_str) |
Set the input stream. More... | |
FILE * | ast_get_out (void) |
Get the output stream. More... | |
void | ast_set_out (FILE *out_str) |
int | ast_get_leng (void) |
Get the length of the current token. More... | |
char * | ast_get_text (void) |
Get the current token. More... | |
int | ast_get_lineno (void) |
Get the current line number. More... | |
void | ast_set_lineno (int line_number) |
Set the current line number. More... | |
int | ast_lex (void) |
if (!(yy_init)) | |
while (1) | |
Variables | |
int | ast_leng |
FILE * | ast_in = (FILE *) 0 |
FILE * | ast_out = (FILE *) 0 |
int | ast_lineno = 1 |
char * | ast_text |
int | ast__flex_debug = 0 |
YY_DECL | |
The main scanner function which does all the work. More... | |
register char * | yy_cp |
register char * | yy_bp |
register int | yy_act |
#define ast_wrap | ( | n | ) | 1 |
Referenced by while().
#define BEGIN (yy_start) = 1 + 2 * |
Referenced by while().
#define EOB_ACT_CONTINUE_SCAN 0 |
Referenced by while().
#define EOB_ACT_END_OF_FILE 1 |
Referenced by while().
#define EOB_ACT_LAST_MATCH 2 |
Referenced by while().
#define FLEX_BETA |
#define FLEX_SCANNER |
#define FLEXINT_H |
#define INITIAL 0 |
Referenced by while().
#define INT16_MAX (32767) |
#define INT16_MIN (-32767-1) |
#define INT32_MAX (2147483647) |
#define INT32_MIN (-2147483647-1) |
#define INT8_MAX (127) |
#define INT8_MIN (-128) |
#define REJECT reject_used_but_not_detected |
#define UINT16_MAX (65535U) |
#define UINT32_MAX (4294967295U) |
#define UINT8_MAX (255U) |
#define unput | ( | c | ) | yyunput( c, (yytext_ptr) ) |
#define YY_AT_BOL | ( | ) | (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) |
#define YY_BREAK break; |
Referenced by while().
#define YY_BUF_SIZE 16384 |
Referenced by ast_restart(), and if().
#define YY_BUFFER_EOF_PENDING 2 |
#define YY_BUFFER_NEW 0 |
Referenced by ast__flush_buffer(), ast__scan_buffer(), and while().
#define YY_BUFFER_NORMAL 1 |
Referenced by while().
#define yy_create_buffer ast__create_buffer |
#define YY_CURRENT_BUFFER |
Referenced by ast__delete_buffer(), ast__flush_buffer(), ast__switch_to_buffer(), ast_lex_destroy(), ast_pop_buffer_state(), ast_push_buffer_state(), ast_restart(), and if().
#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] |
Referenced by ast__delete_buffer(), ast__switch_to_buffer(), ast_lex_destroy(), ast_pop_buffer_state(), ast_push_buffer_state(), ast_restart(), if(), and while().
#define YY_DECL int ast_lex (void) |
#define YY_DECL_IS_OURS 1 |
#define yy_delete_buffer ast__delete_buffer |
#define YY_DO_BEFORE_ACTION |
#define YY_END_OF_BUFFER 21 |
Referenced by while().
#define YY_END_OF_BUFFER_CHAR 0 |
Referenced by ast__flush_buffer(), ast__scan_buffer(), and ast__scan_bytes().
#define YY_EXIT_FAILURE 2 |
#define YY_EXTRA_TYPE void * |
#define YY_FATAL_ERROR | ( | msg | ) | yy_fatal_error( msg ) |
Referenced by ast__create_buffer(), ast__scan_buffer(), ast__scan_bytes(), and while().
#define yy_flex_debug ast__flex_debug |
#define YY_FLEX_MAJOR_VERSION 2 |
#define YY_FLEX_MINOR_VERSION 5 |
#define YY_FLEX_SUBMINOR_VERSION 35 |
#define yy_flush_buffer ast__flush_buffer |
#define YY_FLUSH_BUFFER ast__flush_buffer(YY_CURRENT_BUFFER ) |
#define yy_init_buffer ast__init_buffer |
#define YY_INPUT | ( | buf, | |
result, | |||
max_size | |||
) |
#define YY_INT_ALIGNED short int |
#define YY_LESS_LINENO | ( | n | ) |
#define yy_load_buffer_state ast__load_buffer_state |
#define YY_MORE_ADJ 0 |
Referenced by while().
#define yy_new_buffer ast__create_buffer |
#define YY_NEW_FILE ast_restart(ast_in ) |
Referenced by while().
#define YY_NULL 0 |
#define YY_NUM_RULES 20 |
#define YY_READ_BUF_SIZE 8192 |
#define YY_RESTORE_YY_MORE_OFFSET |
Referenced by while().
#define YY_RULE_SETUP YY_USER_ACTION |
Referenced by while().
#define YY_SC_TO_UI | ( | c | ) | ((unsigned int) (unsigned char) c) |
Referenced by while().
#define yy_set_bol | ( | at_bol | ) |
#define yy_set_interactive | ( | is_interactive | ) |
#define YY_SKIP_YYWRAP |
#define YY_START (((yy_start) - 1) / 2) |
Referenced by while().
#define YY_START_STACK_INCR 25 |
#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) |
#define YY_STATE_EOF | ( | state | ) | (YY_END_OF_BUFFER + state + 1) |
Referenced by while().
#define YY_STRUCT_YY_BUFFER_STATE |
#define yy_switch_to_buffer ast__switch_to_buffer |
#define YY_TYPEDEF_YY_BUFFER_STATE |
#define YY_TYPEDEF_YY_SIZE_T |
#define YY_USER_ACTION |
#define yyalloc ast_alloc |
#define yyconst |
#define yyfree ast_free |
#define yyin ast_in |
#define yyleng ast_leng |
#define yyless | ( | n | ) |
#define yyless | ( | n | ) |
#define yylex ast_lex |
#define yylineno ast_lineno |
#define yymore | ( | ) | yymore_used_but_not_detected |
#define yyout ast_out |
#define yyrealloc ast_realloc |
#define yyrestart ast_restart |
#define YYSTATE YY_START |
#define YYTABLES_NAME "yytables" |
#define yytext ast_text |
#define yywrap ast_wrap |
typedef short int flex_int16_t |
typedef int flex_int32_t |
typedef signed char flex_int8_t |
typedef unsigned short int flex_uint16_t |
typedef unsigned int flex_uint32_t |
typedef unsigned char flex_uint8_t |
typedef struct yy_buffer_state* YY_BUFFER_STATE |
typedef unsigned char YY_CHAR |
typedef int yy_state_type |
YY_BUFFER_STATE ast__create_buffer | ( | FILE * | file, |
int | size | ||
) |
Allocate and initialize an input buffer state.
file | A readable stream. |
size | The character buffer size in bytes. When in doubt, use YY_BUF_SIZE . |
References ast_alloc(), and YY_FATAL_ERROR.
Referenced by ast_restart(), and if().
void ast__delete_buffer | ( | YY_BUFFER_STATE | b | ) |
Destroy the buffer.
b | a buffer created with ast__create_buffer() |
References ast_free(), YY_CURRENT_BUFFER, and YY_CURRENT_BUFFER_LVALUE.
Referenced by ast_lex_destroy(), and ast_pop_buffer_state().
void ast__flush_buffer | ( | YY_BUFFER_STATE | b | ) |
Discard all buffered characters.
On the next scan, YY_INPUT will be called.
b | the buffer state to be flushed, usually YY_CURRENT_BUFFER . |
References YY_BUFFER_NEW, YY_CURRENT_BUFFER, and YY_END_OF_BUFFER_CHAR.
YY_BUFFER_STATE ast__scan_buffer | ( | char * | base, |
yy_size_t | size | ||
) |
Setup the input buffer state to scan directly from a user-specified character buffer.
base | the character buffer |
size | the size in bytes of the character buffer |
References ast__switch_to_buffer(), ast_alloc(), base(), YY_BUFFER_NEW, YY_END_OF_BUFFER_CHAR, and YY_FATAL_ERROR.
Referenced by ast__scan_bytes().
YY_BUFFER_STATE ast__scan_bytes | ( | yyconst char * | yybytes, |
int | _yybytes_len | ||
) |
Setup the input buffer state to scan the given bytes.
The next call to ast_lex() will scan from a copy of bytes.
yybytes | the byte buffer to scan |
_yybytes_len | the number of bytes in the buffer pointed to by bytes. |
References ast__scan_buffer(), ast_alloc(), buf, YY_END_OF_BUFFER_CHAR, and YY_FATAL_ERROR.
Referenced by ast__scan_string().
YY_BUFFER_STATE ast__scan_string | ( | yyconst char * | yystr | ) |
Setup the input buffer state to scan a string.
The next call to ast_lex() will scan from a copy of str.
yystr | a NUL-terminated string to scan |
References ast__scan_bytes().
void ast__switch_to_buffer | ( | YY_BUFFER_STATE | new_buffer | ) |
Switch to a different input buffer.
new_buffer | The new input buffer. |
References YY_CURRENT_BUFFER, and YY_CURRENT_BUFFER_LVALUE.
Referenced by ast__scan_buffer().
void * ast_alloc | ( | yy_size_t | size | ) |
References malloc().
Referenced by ast__create_buffer(), ast__scan_buffer(), and ast__scan_bytes().
void ast_free | ( | void * | ptr | ) |
References free().
Referenced by ast__delete_buffer(), and ast_lex_destroy().
int ast_get_debug | ( | void | ) |
References ast__flex_debug.
YY_EXTRA_TYPE ast_get_extra | ( | void | ) |
FILE * ast_get_in | ( | void | ) |
Get the input stream.
References ast_in.
int ast_get_leng | ( | void | ) |
Get the length of the current token.
References ast_leng.
int ast_get_lineno | ( | void | ) |
Get the current line number.
References ast_lineno.
FILE * ast_get_out | ( | void | ) |
Get the output stream.
References ast_out.
char * ast_get_text | ( | void | ) |
Get the current token.
References ast_text.
int ast_lex | ( | void | ) |
int ast_lex_destroy | ( | void | ) |
References ast__delete_buffer(), ast_free(), ast_pop_buffer_state(), YY_CURRENT_BUFFER, and YY_CURRENT_BUFFER_LVALUE.
void ast_pop_buffer_state | ( | void | ) |
Removes and deletes the top of the stack, if present.
The next element becomes the new top.
References ast__delete_buffer(), YY_CURRENT_BUFFER, and YY_CURRENT_BUFFER_LVALUE.
Referenced by ast_lex_destroy().
void ast_push_buffer_state | ( | YY_BUFFER_STATE | new_buffer | ) |
Pushes the new state onto the stack.
The new state becomes the current state. This function will allocate the stack if necessary.
new_buffer | The new state. |
References YY_CURRENT_BUFFER, and YY_CURRENT_BUFFER_LVALUE.
void * ast_realloc | ( | void * | ptr, |
yy_size_t | size | ||
) |
void ast_restart | ( | FILE * | input_file | ) |
Immediately switch to a different input stream.
input_file | A readable stream. |
INITIAL
. References ast__create_buffer(), ast_in, YY_BUF_SIZE, YY_CURRENT_BUFFER, and YY_CURRENT_BUFFER_LVALUE.
void ast_set_debug | ( | int | debug_flag | ) |
void ast_set_extra | ( | YY_EXTRA_TYPE | user_defined | ) |
void ast_set_in | ( | FILE * | in_str | ) |
Set the input stream.
This does not discard the current input buffer.
in_str | A readable stream. |
References ast_in.
void ast_set_lineno | ( | int | line_number | ) |
Set the current line number.
line_number |
void ast_set_out | ( | FILE * | out_str | ) |
References ast_out.
if | ( | ! | yy_init | ) |
References ast__create_buffer(), ast_in, ast_out, YY_BUF_SIZE, YY_CURRENT_BUFFER, and YY_CURRENT_BUFFER_LVALUE.
while | ( | 1 | ) |
References _LABEL, APPEL, ast_in, ast_leng, ast_lval, ast_text, ast_wrap, BI_OP, BIN_OP, CODE, DOWHILE, ECHO, EOB_ACT_CONTINUE_SCAN, EOB_ACT_END_OF_FILE, EOB_ACT_LAST_MATCH, ERROR, FOR, otawa::sem::IF, INITIAL, NAME, NUMBER, SEQ, VIDE, WHILE, YY_BREAK, YY_BUFFER_NEW, YY_BUFFER_NORMAL, yy_cp, YY_CURRENT_BUFFER_LVALUE, YY_DO_BEFORE_ACTION, YY_END_OF_BUFFER, YY_FATAL_ERROR, YY_MORE_ADJ, YY_NEW_FILE, YY_RESTORE_YY_MORE_OFFSET, YY_RULE_SETUP, YY_SC_TO_UI, YY_START, YY_STATE_EOF, yyterminate, and yytext_ptr.
int ast__flex_debug = 0 |
Referenced by ast_get_debug().
FILE* ast_in = (FILE *) 0 |
Referenced by ast_get_in(), ast_restart(), ast_set_in(), if(), and while().
int ast_leng |
Referenced by ast_get_leng(), and while().
int ast_lineno = 1 |
Referenced by ast_get_lineno().
FILE * ast_out = (FILE *) 0 |
Referenced by ast_get_out(), ast_set_out(), and if().
char * ast_text |
Referenced by ast_get_text(), and while().
register int yy_act |
register char * yy_bp |
register char* yy_cp |
Referenced by while().
YY_DECL |
The main scanner function which does all the work.