Kiwi Engine
VM for interpreter
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Data Structures | Enumerations | Functions
KEError.h File Reference

Define KEError class. More...

#include <Coconut/Coconut.h>
#include "KEForwarders.h"
#include "KEException.h"
#include "KEValue.h"

Go to the source code of this file.

Data Structures

struct  KEError
 Instruction class. More...
 

Enumerations

enum  KEErrorKind {
  KEParserError, KETooMaryRegisterError, KEInvalidPathDescriptionError, KENonexistentPathError,
  KEInvalidValueTypeError, KEIdentifierRequiredError, KEMergeFailedError, KEExceptionError
}
 

Functions

struct KEErrorKEAllocateParserError (const char *msg, struct KELineInfo *linfo, struct CNResource *resource)
 Allocate parse error object. More...
 
struct KEErrorKEAllocateTooManyRegisterError (unsigned long regnum, struct KELineInfo *linfo, struct CNResource *resource)
 Allocate Too many register error. More...
 
struct KEErrorKEAllocateInvalidPathDescriptionError (struct CNString *pathstr, struct KELineInfo *linfo, struct CNResource *resource)
 Allocate invalid path description error. More...
 
struct KEErrorKEAllocateNonexistentPathError (struct KEPath *path, struct KELineInfo *linfo, struct CNResource *resource)
 Allocate nonexistent path error. More...
 
struct KEErrorKEAllocateInvalidValueTypeError (const char *reqtype, const char *giventype, struct KELineInfo *linfo, struct CNResource *resource)
 Allocate invalid value type error. More...
 
struct KEErrorKEAllocateIdentifierRequiredError (struct KEPath *path, struct KELineInfo *linfo, struct CNResource *resource)
 Allocate identifier required error. More...
 
struct KEErrorKEAllocateMergeFailedError (const struct CNFixedString *ident, struct KELineInfo *linfo, struct CNResource *resource)
 Allocate merge failed error. More...
 
struct KEErrorKEAllocateExceptionError (const struct KEException *except, struct CNResource *resource)
 Allocate exception error. More...
 
void KEPrintError (FILE *outfp, const struct KEError *src)
 Print parse error message to file stream. More...
 

Detailed Description

Define KEError class.

Copyright
Copyright (C) 2014 Steel Wheels Project

Enumeration Type Documentation

Kind of errors

Function Documentation

struct KEError* KEAllocateExceptionError ( const struct KEException except,
struct CNResource *  resource 
)

Allocate exception error.

Returns
Allocated object
Parameters
exceptException information
resourceResource to allocate the object
struct KEError* KEAllocateIdentifierRequiredError ( struct KEPath path,
struct KELineInfo linfo,
struct CNResource *  resource 
)

Allocate identifier required error.

Returns
Allocated object
Parameters
pathGiven path
linfoLine info where the error is occured
resourceResource to allocate the object
struct KEError* KEAllocateInvalidPathDescriptionError ( struct CNString *  pathstr,
struct KELineInfo linfo,
struct CNResource *  resource 
)

Allocate invalid path description error.

Returns
Allocated object
Parameters
pathstrPath string
linfoLine info where the error is occured
resourceResource to allocate the object
struct KEError* KEAllocateInvalidValueTypeError ( const char *  reqtype,
const char *  giventype,
struct KELineInfo linfo,
struct CNResource *  resource 
)

Allocate invalid value type error.

Returns
Allocated object
Parameters
reqtypeName of required data type
giventypeName of given (wrong) type
linfoLine info where the error is occured
resourceResource to allocate the object
struct KEError* KEAllocateMergeFailedError ( const struct CNFixedString *  ident,
struct KELineInfo linfo,
struct CNResource *  resource 
)

Allocate merge failed error.

Returns
Allocated object
Parameters
identMerge failed identifier
linfoLine info where the error is occured
resourceResource to allocate the object
struct KEError* KEAllocateNonexistentPathError ( struct KEPath path,
struct KELineInfo linfo,
struct CNResource *  resource 
)

Allocate nonexistent path error.

Returns
Allocated object
Parameters
pathNonexistent Path
linfoLine info where the error is occured
resourceResource to allocate the object
struct KEError* KEAllocateParserError ( const char *  msg,
struct KELineInfo linfo,
struct CNResource *  resource 
)

Allocate parse error object.

Returns
Allocated object
Parameters
msgError message from parser
linfoLine info where the error is occured
resourceResource to allocate the object
struct KEError* KEAllocateTooManyRegisterError ( unsigned long  regnum,
struct KELineInfo linfo,
struct CNResource *  resource 
)

Allocate Too many register error.

Returns
Allocated object
Parameters
regnumNumber of required registers
linfoLine info where the error is occured
resourceResource to allocate the object
void KEPrintError ( FILE *  outfp,
const struct KEError src 
)

Print parse error message to file stream.

Parameters
outfpOutput file stream
srcSource error