GNU PROLOG with UTF8 support
Macros | Enumerations | Functions | Variables
ma_parser.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <ctype.h>
#include <setjmp.h>
#include "ma_parser.h"
#include "ma_protos.h"
Include dependency graph for ma_parser.c:

Macros

#define MA_PARSER_FILE
 
#define MAX_LINE_LEN   65536
 
#define MAX_STR_LEN   32768
 
#define MAX_ARGS   128
 
#define MAX_SWITCH_CASES   65536
 
#define Pre_Pass()   (pass_no < nb_passes)
 
#define Stop_Previous_Code()
 

Enumerations

enum  {
  PL_CODE, PL_JUMP, PREP_CP, HERE_CP,
  PL_CALL, PL_FAIL, PL_RET, JUMP,
  MOVE, CALL_C, JUMP_RET, FAIL_RET,
  MOVE_RET, SWITCH_RET, C_CODE, C_RET,
  LONG
}
 

Functions

static void Parser (int pass_no, int nb_passes)
 
static int Read_If_Global (int initializer)
 
static void Read_Function (void)
 
static void Read_Switch (void)
 
static int Read_Index (void)
 
static int Read_Optional_Index (void)
 
static int Read_Token (int what)
 
static int Scanner (void)
 
int Parse_Ma_File (char *file_name_in, int comment)
 
void Syntax_Error (char *s)
 

Variables

int needs_pre_pass
 
char * inst []
 
int reload_e
 
int inside_code
 
char fct_name [MAX_STR_LEN]
 
int fc
 
int nb_args
 
int nb_args_in_words
 
ArgInf arg [MAX_ARGS]
 
int nb_swt
 
SwtInf swt [MAX_SWITCH_CASES]
 
jmp_buf jumper
 
int keep_source_lines
 
FILE * file_in
 
int cur_line_no
 
char cur_line_str [MAX_LINE_LEN]
 
char * cur_line_p
 
char * beg_last_token
 
char str_val [MAX_STR_LEN]
 
PlLong int_val
 
double dbl_val
 

Macro Definition Documentation

#define MA_PARSER_FILE
#define MAX_ARGS   128
#define MAX_LINE_LEN   65536
#define MAX_STR_LEN   32768
#define MAX_SWITCH_CASES   65536
#define Pre_Pass ( )    (pass_no < nb_passes)
#define Stop_Previous_Code ( )
Value:
{ \
if (!Pre_Pass() && inside_code) \
{ \
} \
}
#define Pre_Pass()
Definition: ma_parser.c:221
int inside_code
Definition: ma_parser.c:107
void Code_Stop(void)
Definition: alpha_any.c:636

Enumeration Type Documentation

anonymous enum
Enumerator
PL_CODE 
PL_JUMP 
PREP_CP 
HERE_CP 
PL_CALL 
PL_FAIL 
PL_RET 
JUMP 
MOVE 
CALL_C 
JUMP_RET 
FAIL_RET 
MOVE_RET 
SWITCH_RET 
C_CODE 
C_RET 
LONG 

Function Documentation

int Parse_Ma_File ( char *  file_name_in,
int  comment 
)

Here is the call graph for this function:

Here is the caller graph for this function:

static void Parser ( int  pass_no,
int  nb_passes 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static void Read_Function ( void  )
static

Here is the call graph for this function:

Here is the caller graph for this function:

static int Read_If_Global ( int  initializer)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static int Read_Index ( void  )
static

Here is the call graph for this function:

Here is the caller graph for this function:

static int Read_Optional_Index ( void  )
static

Here is the call graph for this function:

Here is the caller graph for this function:

static void Read_Switch ( void  )
static

Here is the call graph for this function:

Here is the caller graph for this function:

static int Read_Token ( int  what)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static int Scanner ( void  )
static

Here is the call graph for this function:

Here is the caller graph for this function:

void Syntax_Error ( char *  s)

Here is the caller graph for this function:

Variable Documentation

char* beg_last_token
int cur_line_no
char* cur_line_p
char cur_line_str[MAX_LINE_LEN]
double dbl_val
int fc
char fct_name[MAX_STR_LEN]
FILE* file_in
int inside_code
char* inst[]
Initial value:
= {
"pl_code", "pl_jump", "prep_cp", "here_cp", "pl_call", "pl_fail",
"pl_ret", "jump", "move", "call_c", "jump_ret", "fail_ret", "move_ret",
"switch_ret", "c_code", "c_ret", "long", NULL }
PlLong int_val
jmp_buf jumper
int keep_source_lines
int nb_args
int nb_args_in_words
int nb_swt
int needs_pre_pass
int reload_e
char str_val[MAX_STR_LEN]