YAP 7.1.0
Parser Implementation

As expected for Prolog, this is a recursive top-down parser. More...

Detailed Description

As expected for Prolog, this is a recursive top-down parser.

The algorithm handles ambiguity in the Prolog grammar through setjmp.s


Class Documentation

◆ jmp_buff_struct

struct jmp_buff_struct

Definition at line 57 of file parser.c.

Public Attributes

sigjmp_buf JmpBuff
 

Member Data Documentation

◆ JmpBuff

sigjmp_buf JmpBuff

Definition at line 58 of file parser.c.

Macro Definition Documentation

◆ FAIL

FAIL   siglongjmp(FailBuff->JmpBuff, 1)

Definition at line 124 of file parser.c.

◆ TRY

#define TRY (   S,
 
)
Value:
{ \
Volatile JMPBUFF *saveenv, newenv; \
Volatile TokEntry *saveT = LOCAL_tokptr; \
Volatile CELL *saveH = HR; \
Volatile int savecurprio = curprio; \
saveenv = FailBuff; \
if (!sigsetjmp(newenv.JmpBuff, 0)) { \
FailBuff = &newenv; \
S; \
FailBuff = saveenv; \
P; \
} else { \
FailBuff = saveenv; \
HR = saveH; \
curprio = savecurprio; \
LOCAL_tokptr = saveT; \
} \
}

Definition at line 85 of file parser.c.

◆ TRY3

#define TRY3 (   S,
  P,
 
)
Value:
{ \
Volatile JMPBUFF *saveenv, newenv; \
Volatile TokEntry *saveT = LOCAL_tokptr; \
Volatile CELL *saveH = HR; \
saveenv = FailBuff; \
if (!sigsetjmp(newenv.JmpBuff, 0)) { \
FailBuff = &newenv; \
S; \
FailBuff = saveenv; \
P; \
} else { \
FailBuff = saveenv; \
HR = saveH; \
LOCAL_tokptr = saveT; \
F \
} \
}

Definition at line 105 of file parser.c.

◆ Volatile

#define Volatile

Definition at line 52 of file parser.c.

Function Documentation

◆ Yap_IsInfixOp()

int Yap_IsInfixOp ( Atom  op,
int *  pptr,
int *  lpptr,
int *  rpptr 
)

Definition at line 340 of file parser.c.

◆ Yap_IsPosfixOp()

int Yap_IsPosfixOp ( Atom  op,
int *  pptr,
int *  lpptr 
)

Definition at line 367 of file parser.c.

◆ Yap_IsPrefixOp()

int Yap_IsPrefixOp ( Atom  op,
int *  pptr,
int *  rpptr 
)

Definition at line 310 of file parser.c.

◆ Yap_LookupVar()

VarEntry * Yap_LookupVar ( const char *  var)

Definition at line 126 of file parser.c.

◆ Yap_Parse()

Term Yap_Parse ( UInt  prio,
encoding_t  enc,
Term  cmod 
)

Definition at line 969 of file parser.c.

◆ Yap_Singletons()

Term Yap_Singletons ( VarEntry p,
Term  l 
)

Definition at line 255 of file parser.c.

◆ Yap_tokRep()

Term Yap_tokRep ( void *  tokptr)

convert a token to text

Definition at line 747 of file scanner.c.

◆ Yap_tokText()

const char * Yap_tokText ( void *  tokptr)

Definition at line 792 of file scanner.c.

◆ Yap_Variables()

Term Yap_Variables ( VarEntry p,
Term  l 
)

Definition at line 282 of file parser.c.

◆ Yap_VarNames()

Term Yap_VarNames ( VarEntry p,
Term  l 
)

Definition at line 223 of file parser.c.

Macros

#define Volatile
 
#define TRY(S, P)
 
#define TRY3(S, P, F)
 
#define FAIL   siglongjmp(FailBuff->JmpBuff, 1)
 

Typedefs

typedef struct jmp_buff_struct JMPBUFF
 

Functions

Term Yap_tokRep (void *tokptr)
 convert a token to text More...
 
const char * Yap_tokText (void *tokptr)
 
VarEntryYap_LookupVar (const char *var)
 
Term Yap_VarNames (VarEntry *p, Term l)
 
Term Yap_Singletons (VarEntry *p, Term l)
 
Term Yap_Variables (VarEntry *p, Term l)
 
int Yap_IsPrefixOp (Atom op, int *pptr, int *rpptr)
 
int Yap_IsInfixOp (Atom op, int *pptr, int *lpptr, int *rpptr)
 
int Yap_IsPosfixOp (Atom op, int *pptr, int *lpptr)
 
Term Yap_Parse (UInt prio, encoding_t enc, Term cmod)