C:/Users/Dennis/src/lang/bertrand/BERTRAND/bertrand/match.c File Reference

#include "def.h"
#include <string.h>

Go to the source code of this file.

Data Structures

struct  sub_stack

Defines

#define MAXP   32
#define WR   1
#define POP   2
#define HAS_ARG   (UNARY | BINARY)

Typedefs

typedef struct sub_stack SUB_STACK

Functions

void subject_push (NODE *old)
NODEsubject_pop ()
static RULEmatch (NODE *exp)
static int match_types (OP *guard, NODE *exp)
static int match_sub (NODE *head, NODE *exp)
NODEwalk (NODE *subject)
NODEinstantiate (NODE *body)

Variables

NODEparam_val [MAXP]
int learn
int bondage
static SNODEstack
static SUB_STACKsub_top = NULL


Define Documentation

#define HAS_ARG   (UNARY | BINARY)

Definition at line 12 of file match.c.

Referenced by walk().

#define MAXP   32

Definition at line 4 of file match.c.

#define POP   2

Definition at line 11 of file match.c.

Referenced by walk().

#define WR   1

Definition at line 10 of file match.c.

Referenced by walk().


Typedef Documentation

typedef struct sub_stack SUB_STACK


Function Documentation

NODE* instantiate ( NODE body  ) 

Definition at line 280 of file match.c.

References arity_name(), error(), expr_copy(), termnode::label, termnode::left, name_copy(), node_new(), NULL, stringnode::op, numbernode::op, termnode::op, OP_NAME, OP_NUM, OP_STR, OP_TERM, termnode::right, stringnode::value, and numbernode::value.

Referenced by walk().

static RULE* match ( NODE exp  )  [static]

Definition at line 69 of file match.c.

References rule::head, match_sub(), rule::next, NULL, and OP_TERM.

Referenced by walk().

static int match_sub ( NODE head,
NODE exp 
) [static]

Definition at line 107 of file match.c.

References arity_name(), BINARY, error(), FALSE, match_types(), NULLARY, OP_NAME, OP_NUM, OP_STR, POSTFIX, TRUE, UNARY, and untyped_prim.

Referenced by match().

static int match_types ( OP guard,
NODE exp 
) [static]

Definition at line 91 of file match.c.

References FALSE, node::op, op::super, and TRUE.

Referenced by match_sub().

NODE* subject_pop (  ) 

Definition at line 43 of file match.c.

References sub_stack::exp, sub_stack::next, and NULL.

void subject_push ( NODE old  ) 

Definition at line 26 of file match.c.

References sub_stack::exp, and sub_stack::next.

NODE* walk ( NODE subject  ) 

Definition at line 167 of file match.c.

References op::arity, BINARY, rule::body, bondage, error(), op::eval, expr_copy(), expr_free(), expr_print(), expr_update(), FALSE, HAS_ARG, snode::info, instantiate(), learn, match(), name_free(), name_print(), name_space_insert(), snode::next, snode::node, NULL, namenode::op, node::op, OP_NAME, OP_TERM, POP, POSTFIX, primitive_execute(), rule_print(), rule::space, st_free(), st_get(), rule::tag, TRUE, untyped_prim, verbose, rule::verbose, and WR.

Referenced by main().


Variable Documentation

int bondage

Definition at line 7 of file match.c.

Referenced by primitive_execute(), and walk().

int learn

Definition at line 6 of file match.c.

Referenced by main(), and walk().

NODE* param_val[MAXP]

Definition at line 5 of file match.c.

SNODE* stack [static]

Definition at line 8 of file match.c.

SUB_STACK* sub_top = NULL [static]

Definition at line 18 of file match.c.


Generated on Fri Jan 25 09:58:43 2008 for Bertrand by  doxygen 1.5.4