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

Define KEReservedWordTable class. More...

#include <Coconut/Coconut.h>

Go to the source code of this file.

Data Structures

struct  KEReservedWord
 
struct  KEReservedWordTable
 Reserved word table. More...
 

Functions

struct KEReservedWordTable KEMakeReservedWordTable (struct CNResource *resource)
 Make empty reserved word table. More...
 
void KEDestroyReservedWordTable (struct KEReservedWordTable *dst)
 Release the resource for reserved word table. More...
 
void KEAddReservedWordsToTable (struct KEReservedWordTable *dst, unsigned int wordnum, const struct KEReservedWord *words)
 Add array of reserved words into table. More...
 
CNBoolean KESearchReservedWordInTable (int *rid, const struct KEReservedWordTable *table, const struct CNFixedString *ident)
 Search reserved word in the table. More...
 
void KEPrintReservedWordTable (FILE *outfp, const struct KEReservedWordTable *src)
 Print reserved words in the reserveed word table. More...
 

Detailed Description

Define KEReservedWordTable class.

Copyright
Copyright (C) 2014 Steel Wheels Project

Function Documentation

void KEAddReservedWordsToTable ( struct KEReservedWordTable dst,
unsigned int  wordnum,
const struct KEReservedWord words 
)

Add array of reserved words into table.

Parameters
dstDestination reserved word table
wordnumNumber of source reserved words
wordsSource array of reserved words
void KEDestroyReservedWordTable ( struct KEReservedWordTable dst)

Release the resource for reserved word table.

Parameters
dstDestination table
struct KEReservedWordTable KEMakeReservedWordTable ( struct CNResource *  resource)

Make empty reserved word table.

Returns
Empty reserved word table
Parameters
resourceResource to allocate the table
void KEPrintReservedWordTable ( FILE *  outfp,
const struct KEReservedWordTable src 
)

Print reserved words in the reserveed word table.

Parameters
outfpOutput file stream
srcSource reserved word table
CNBoolean KESearchReservedWordInTable ( int *  rid,
const struct KEReservedWordTable table,
const struct CNFixedString *  ident 
)

Search reserved word in the table.

Return values
TrueSource word is reserved word
FalseSource word is NOT reserved word
Parameters
ridRegister id for the source word. This value is set when the return value is true.
tableSource reserved word table
identIdentifier to search the table