GNU PROLOG with UTF8 support
Data Structures | Macros | Functions | Variables
wam_parser.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <ctype.h>
#include <setjmp.h>
#include <locale.h>
#include "wam_parser.h"
#include "wam_protos.h"
#include "../EnginePl/pl_long.h"
#include "../EnginePl/pl_wchar.h"
Include dependency graph for wam_parser.c:

Data Structures

struct  ParseInf
 

Macros

#define MAX_FCT_ARITY   10
 
#define MAX_LINE_LEN   65536
 
#define MAX_STR_LEN   32768
 
#define MAX_ARGS   65536 /* for big swith_on_... */
 

Functions

static void Parser (void)
 
static int Parse_And_Treat_Decl_Or_Inst (ParseInf *in)
 
static void Read_Argument (ArgTyp arg_type, ArgVal **top)
 
static void Read_Token (int what)
 
static int Scanner (int complex_atom)
 
static char Peek_Char (int skip_spaces)
 
int Parse_Wam_File (char *file_name_in, int comment)
 
void Syntax_Error (char *s)
 

Variables

ParseInf decl []
 
ParseInf inst []
 
ArgVal arg [MAX_ARGS]
 
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 MAX_ARGS   65536 /* for big swith_on_... */
#define MAX_FCT_ARITY   10
#define MAX_LINE_LEN   65536
#define MAX_STR_LEN   32768

Function Documentation

static int Parse_And_Treat_Decl_Or_Inst ( ParseInf in)
static

Here is the call graph for this function:

Here is the caller graph for this function:

int Parse_Wam_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 ( void  )
static

Here is the call graph for this function:

Here is the caller graph for this function:

static char Peek_Char ( int  skip_spaces)
static

Here is the caller graph for this function:

static void Read_Argument ( ArgTyp  arg_type,
ArgVal **  top 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static void Read_Token ( int  what)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static int Scanner ( int  complex_atom)
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
ParseInf decl[]
Initial value:
= {
{"file_name", F_file_name, 1, {ATOM}},
{"directive", F_directive, 3, {INTEGER, ATOM, LIST_INST}},
{"predicate", F_predicate, 7, {MP_N, INTEGER, ATOM, ATOM, ATOM, ATOM, LIST_INST}},
{"ensure_linked", F_ensure_linked, 1, {L1(MP_N)}},
{NULL, NULL, 0, {0}}
}
Definition: wam_parser.h:57
#define L1(t)
Definition: wam_parser.h:62
void F_predicate(ArgVal arg[])
Definition: wam2ma.c:475
Definition: ma_parser.h:53
void F_file_name(ArgVal arg[])
Definition: wam2ma.c:461
Definition: wam_parser.h:49
void F_ensure_linked(ArgVal arg[])
Definition: wam2ma.c:647
Definition: wam_parser.h:54
void F_directive(ArgVal arg[])
Definition: wam2ma.c:596
FILE* file_in
ParseInf inst[]
PlLong int_val
jmp_buf jumper
int keep_source_lines
char str_val[MAX_STR_LEN]