CpgCompileError

CpgCompileError — Compile error message container

Synopsis

#define             CPG_COMPILE_ERROR_CONST             (obj)
struct              CpgCompileError;
struct              CpgCompileErrorClass;
#define             CPG_COMPILE_ERROR_TYPE
enum                CpgCompileErrorCode;
CpgCompileError *   cpg_compile_error_new               (void);
GQuark              cpg_compile_error_type_quark        (void);
void                cpg_compile_error_set               (CpgCompileError *error,
                                                         GError *gerror,
                                                         CpgObject *object,
                                                         CpgProperty *property,
                                                         CpgLinkAction *action,
                                                         gint pos);
GError *            cpg_compile_error_get_error         (CpgCompileError *error);
CpgObject *         cpg_compile_error_get_object        (CpgCompileError *error);
CpgProperty *       cpg_compile_error_get_property      (CpgCompileError *error);
CpgLinkAction *     cpg_compile_error_get_link_action   (CpgCompileError *error);
const gchar *       cpg_compile_error_string            (CpgCompileError *error);
const gchar *       cpg_compile_error_code_string       (gint code);
gint                cpg_compile_error_get_code          (CpgCompileError *error);
const gchar *       cpg_compile_error_get_message       (CpgCompileError *error);
gint                cpg_compile_error_get_pos           (CpgCompileError *error);
gchar *             cpg_compile_error_get_formatted_string
                                                        (CpgCompileError *error);
                    CpgCompileErrorPrivate;

Object Hierarchy

  GObject
   +----CpgCompileError
  GEnum
   +----CpgCompileErrorCode

Description

Object used to store information on expression compile errors.

Details

CPG_COMPILE_ERROR_CONST()

#define CPG_COMPILE_ERROR_CONST(obj)		(G_TYPE_CHECK_INSTANCE_CAST ((obj), CPG_TYPE_COMPILE_ERROR, CpgCompileError const))


struct CpgCompileError

struct CpgCompileError;


struct CpgCompileErrorClass

struct CpgCompileErrorClass {
	GObjectClass parent_class;
};


CPG_COMPILE_ERROR_TYPE

#define CPG_COMPILE_ERROR_TYPE (cpg_compile_error_type_quark ())


enum CpgCompileErrorCode

typedef enum
{
	CPG_COMPILE_ERROR_PROPERTY_NOT_FOUND,
	CPG_COMPILE_ERROR_FUNCTION_NOT_FOUND,
	CPG_COMPILE_ERROR_OPERATOR_NOT_FOUND,
	CPG_COMPILE_ERROR_INVALID_TOKEN,
	CPG_COMPILE_ERROR_MAXARG,
	CPG_COMPILE_ERROR_INVALID_STACK,
	CPG_COMPILE_ERROR_PROPERTY_RECURSE,
	CPG_COMPILE_ERROR_NUM_ERRORS
} CpgCompileErrorCode;

Enum used to indicate the type of compile error

CPG_COMPILE_ERROR_PROPERTY_NOT_FOUND

property not found

CPG_COMPILE_ERROR_FUNCTION_NOT_FOUND

function not found

CPG_COMPILE_ERROR_OPERATOR_NOT_FOUND

operator not found

CPG_COMPILE_ERROR_INVALID_TOKEN

invalid token

CPG_COMPILE_ERROR_MAXARG

maximum number of arguments exceeded

CPG_COMPILE_ERROR_INVALID_STACK

invalid stack produced

CPG_COMPILE_ERROR_PROPERTY_RECURSE

property recurses on itself

CPG_COMPILE_ERROR_NUM_ERRORS

num errors

cpg_compile_error_new ()

CpgCompileError *   cpg_compile_error_new               (void);

Create new empty compile error

Returns :

a new CpgCompileError

cpg_compile_error_type_quark ()

GQuark              cpg_compile_error_type_quark        (void);


cpg_compile_error_set ()

void                cpg_compile_error_set               (CpgCompileError *error,
                                                         GError *gerror,
                                                         CpgObject *object,
                                                         CpgProperty *property,
                                                         CpgLinkAction *action,
                                                         gint pos);

Set compile error information.

error :

A CpgCompileError

gerror :

A GError

object :

A CpgObject

property :

A CpgProperty

action :

A CpgLinkAction

cpg_compile_error_get_error ()

GError *            cpg_compile_error_get_error         (CpgCompileError *error);

Get the associated GError

error :

a CpgCompileError

Returns :

the associated GError. [transfer none]

cpg_compile_error_get_object ()

CpgObject *         cpg_compile_error_get_object        (CpgCompileError *error);

Get the associated CpgObject

error :

a CpgCompileError

Returns :

the associated CpgObject. [transfer none]

cpg_compile_error_get_property ()

CpgProperty *       cpg_compile_error_get_property      (CpgCompileError *error);

Get the associated CpgProperty

error :

a CpgCompileError

Returns :

the associated CpgProperty. [transfer none]

cpg_compile_error_get_link_action ()

CpgLinkAction *     cpg_compile_error_get_link_action   (CpgCompileError *error);

Get the associated CpgLinkAction

error :

a CpgCompileError

Returns :

the associated CpgLinkAction. [transfer none]

cpg_compile_error_string ()

const gchar *       cpg_compile_error_string            (CpgCompileError *error);

Get the string describing error

error :

a CpgCompileError

Returns :

the error string message

cpg_compile_error_code_string ()

const gchar *       cpg_compile_error_code_string       (gint code);

Get the string describing an error with error code error

code :

the error code

Returns :

the error string message

cpg_compile_error_get_code ()

gint                cpg_compile_error_get_code          (CpgCompileError *error);

Get the error code

error :

a CpgCompileError

Returns :

the error code

cpg_compile_error_get_message ()

const gchar *       cpg_compile_error_get_message       (CpgCompileError *error);

Get the error message

error :

a CpgCompileError

Returns :

the error message

cpg_compile_error_get_pos ()

gint                cpg_compile_error_get_pos           (CpgCompileError *error);

Get the character position of the compile error in the expression.

error :

A CpgCompileError

Returns :

The character position of the compile error in the expression

cpg_compile_error_get_formatted_string ()

gchar *             cpg_compile_error_get_formatted_string
                                                        (CpgCompileError *error);


CpgCompileErrorPrivate

typedef struct _CpgCompileErrorPrivate CpgCompileErrorPrivate;