summaryrefslogtreecommitdiff
path: root/colm/colm.h
blob: f5183be2168bb813ffe180a9f8f95fc77ffc1510 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef __COLM_COLM_H
#define __COLM_COLM_H

#ifdef __cplusplus
extern "C" {
#endif

struct ColmTree;
struct ColmKid;
struct ColmProgram;
struct ColmRuntimeData;
struct ColmTree;
struct ColmLocation;

struct ColmProgram *colmNewProgram( struct ColmRuntimeData *rtd, long debugRealm );
void colmRunProgram( struct ColmProgram *prg, int argc, const char **argv );
struct ColmTree *colmRunFunc( struct ColmProgram *prg, int frameId, const char **params, int paramCount );
int colmDeleteProgram( struct ColmProgram *prg );

struct ColmPrintArgs
{
	void *arg;
	int comm;
	int attr;
	int trim;
	void (*out)( struct ColmPrintArgs *args, const char *data, int length );
	void (*openTree)( struct ColmProgram *prg, struct ColmTree **sp, 
		struct ColmPrintArgs *args, struct ColmKid *parent, struct ColmKid *kid );
	void (*printTerm)( struct ColmProgram *prg, struct ColmTree **sp, 
		struct ColmPrintArgs *args, struct ColmKid *kid );
	void (*closeTree)( struct ColmProgram *prg, struct ColmTree **sp, 
		struct ColmPrintArgs *args, struct ColmKid *parent, struct ColmKid *kid );
};

void printNull( struct ColmProgram *prg, struct ColmTree **sp,
		struct ColmPrintArgs *args, struct ColmKid *parent, struct ColmKid *kid );
void printTermTree( struct ColmProgram *prg, struct ColmTree **sp,
		struct ColmPrintArgs *printArgs, struct ColmKid *kid );

struct ColmTree **vm_root( struct ColmProgram *prg );
struct ColmTree *returnVal( struct ColmProgram *prg );
void printTreeArgs( struct ColmProgram *prg, struct ColmTree **sp,
		struct ColmPrintArgs *printArgs, struct ColmTree *tree );

int repeatEnd( struct ColmTree *tree );
int listLast( struct ColmTree *tree );
struct ColmTree *getRhsVal( struct ColmProgram *prg, struct ColmTree *tree, int *a );
struct ColmTree *getAttr( struct ColmTree *tree, long pos );
struct ColmTree *getGlobal( struct ColmProgram *prg, long pos );
struct ColmTree *getRepeatNext( struct ColmTree *tree );
struct ColmTree *getRepeatVal( struct ColmTree *tree );
struct ColmLocation *findLocation( struct ColmProgram *prg, struct ColmTree *tree );

#ifdef __cplusplus
}
#endif

#endif