CpgCompileContext

CpgCompileContext — The expression compile context

Synopsis


#include <cpg-network/cpg-compile-context.h>

                    CpgCompileContext;
CpgCompileContext * cpg_compile_context_new             (void);
void                cpg_compile_context_prepend_object  (CpgCompileContext *context,
                                                         CpgObject *object);
void                cpg_compile_context_save            (CpgCompileContext *context);
void                cpg_compile_context_restore         (CpgCompileContext *context);
void                cpg_compile_context_append_object   (CpgCompileContext *context,
                                                         CpgObject *object);
void                cpg_compile_context_set_functions   (CpgCompileContext *context,
                                                         GSList *functions);
GSList *            cpg_compile_context_get_objects     (CpgCompileContext *context);
GSList *            cpg_compile_context_get_functions   (CpgCompileContext *context);

Description

The compile context provides information for compiling expressions such as the available user defined functions and the objects that can be used to lookup properties used in the expression.

Details

CpgCompileContext

typedef struct _CpgCompileContext CpgCompileContext;


cpg_compile_context_new ()

CpgCompileContext * cpg_compile_context_new             (void);

Create a new compile context.

Returns :

A CpgCompileContext

cpg_compile_context_prepend_object ()

void                cpg_compile_context_prepend_object  (CpgCompileContext *context,
                                                         CpgObject *object);

Prepend a context object to the list of context objects.

context :

A CpgCompileContext

object :

A CpgObject

cpg_compile_context_save ()

void                cpg_compile_context_save            (CpgCompileContext *context);

Save the current state of the compile context. You can use this to alter the context and restore it to its previous state later. Calls to this function can be nested, but care should be taken to match each call with cpg_compile_context_restore.

context :

A CpgCompileContext

cpg_compile_context_restore ()

void                cpg_compile_context_restore         (CpgCompileContext *context);

Restore the previous state of the compile context. Each call to restore must be matched by a previous call to cpg_compile_context_save.

context :

A CpgCompileContext

cpg_compile_context_append_object ()

void                cpg_compile_context_append_object   (CpgCompileContext *context,
                                                         CpgObject *object);

Append a context object to the list of context objects.

context :

A CpgCompileContext

object :

A CpgObject

cpg_compile_context_set_functions ()

void                cpg_compile_context_set_functions   (CpgCompileContext *context,
                                                         GSList *functions);

Set the list of user functions available in the compile context. This function makes a copy of the list but not of its members.

context :

A CpgCompileContext

functions :

A GSList of CpgFunction

cpg_compile_context_get_objects ()

GSList *            cpg_compile_context_get_objects     (CpgCompileContext *context);

Get the list of objects to be considered as context for compiling expressions. This returns the internally used list which should not be modified or freed.

context :

A CpgCompileContext

Returns :

A GSList of CpgObject

cpg_compile_context_get_functions ()

GSList *            cpg_compile_context_get_functions   (CpgCompileContext *context);

Get the list of custom user functions. This returns the internally used list which should not be modified or freed.

context :

A CpgCompileContext

Returns :

A GSList of CpgFunction