Burp
Macros | Typedefs | Functions
syntax_analyse.c File Reference
#include "syntax_analyse.h"
Include dependency graph for syntax_analyse.c:

Macros

#define ERROR_UNKNOWN_OCCURED(token)
 
#define ERROR_OCCURED(token)
 
#define ERROR_INT_UNEXCEPTED(token, error_token_tmp)
 

Typedefs

typedef Tree branch()
 

Functions

void freeTree (Tree t)
 
char * message_error ()
 
void freeSyntaxAnalyseContest ()
 
Tree init_file_tree (char *pathname)
 

Macro Definition Documentation

◆ ERROR_INT_UNEXCEPTED

#define ERROR_INT_UNEXCEPTED (   token,
  error_token_tmp 
)
Value:
error_token_tmp = malloc(size_cur_token + 1);\
if(error_token_tmp == NULL) return NULL;\
int number = (int) g_scanner_cur_value (gs).v_int;\
snprintf(error_token_tmp,size_cur_token + 1,"%d",number);\
updateErrorMessage(error_token_tmp, token);\
free(error_token_tmp);\
g_scanner_destroy (gs);\
gs = NULL;\
return NULL;

from for a case if a G_TOKEN_INT IS NOT EXCEPTED ( need to declare int size_cur_token before ) [ size_cur_token ] should be defined and have the good value, error_token_tmp is the buffer to stock the result temporarily

◆ ERROR_OCCURED

#define ERROR_OCCURED (   token)
Value:
updateErrorMessage(g_scanner_cur_value (gs).v_string, token);\
g_scanner_destroy (gs);\
gs = NULL;\
return NULL;

macro executed when an error occured during the syntax analyse ( with a string value )

◆ ERROR_UNKNOWN_OCCURED

#define ERROR_UNKNOWN_OCCURED (   token)
Value:
updateErrorMessage("UNKNOWN", token);\
return NULL;

macro executed when a analyse error occure with something we do not know ( v_string could be without \0 )

Typedef Documentation

◆ branch

typedef Tree branch()

Function Documentation

◆ freeSyntaxAnalyseContest()

void freeSyntaxAnalyseContest ( )

Free the context of the syntax analyse, excepted syntax tree Todo after last syntax analyse

◆ freeTree()

void freeTree ( Tree  t)

free a syntax tree

◆ init_file_tree()

Tree init_file_tree ( char *  pathname)

Do the syntax analyse of the file [ pathname ] and return it return NULL if an error occured, if message_error is also at NULL then the bug is a file opening error

◆ message_error()

char* message_error ( )

if an error occured return it if not, return NULL