20 #ifndef UCOMMON_UCOMMON_H_
21 #include <ucommon/ucommon.h>
94 static bool find(
Script *img,
header *scr,
const char *
id);
95 static void createVar(
Script *img,
header *scr,
const char *
id);
96 static void createSym(
Script *img,
header *scr,
const char *
id);
97 static void createAny(
Script *img,
header *scr,
const char *
id);
98 static void createGlobal(
Script *img,
const char *
id);
100 void put(FILE *fp,
const char *
header);
113 __DELETE_DEFAULTS(
symbol);
130 __DELETE_DEFAULTS(
event);
153 __DELETE_DEFAULTS(
header);
182 __DELETE_DEFAULTS(
checks);
185 static bool isValue(
const char *text);
186 static bool isText(
const char *text);
256 typedef char num_t[16];
276 bool attach(
Script *image,
const char *entry = NULL);
288 void initialize(
void);
294 bool error(
const char *text);
300 unsigned getResource(
void);
306 const char *getFilename(
void);
309 symbol *find(
const char *
id);
312 bool trylabel(
const char *
id);
314 void pullScope(
void);
327 bool scriptEvent(
const char *name);
334 event *scriptMethod(
const char *name);
342 bool setConst(
const char *
id,
const char *value);
343 symbol *createSymbol(
const char *
id);
344 symbol *getVar(
const char *
id,
const char *value = NULL);
345 const char *getValue(
void);
346 const char *getContent(
void);
347 const char *getContent(
const char *text);
348 const char *getKeyword(
const char *
id);
349 method_t getLooping(
void);
350 bool isConditional(
unsigned index);
351 void setRef(
header *scope,
const char *
id,
char *data,
unsigned size);
353 void startScript(
header *scr);
355 virtual unsigned getTypesize(
const char *type_id);
356 virtual const char *getTypeinit(
const char *type_id);
357 virtual const char *getFormat(
symbol *sym,
const char *
id,
char *temp);
358 virtual bool getCondition(
const char *test,
const char *value);
359 const char *getIndex(
void);
364 bool getExpression(
unsigned index);
382 __DELETE_DEFAULTS(
error);
416 bool scrExpand(
void);
418 bool scrReturn(
void);
420 bool scrRestart(
void);
428 bool scrContinue(
void);
429 bool scrForeach(
void);
430 bool scrPrevious(
void);
431 bool scrRepeat(
void);
434 bool scrEndcase(
void);
435 bool scrOtherwise(
void);
440 bool scrDefine(
void);
441 bool scrInvoke(
void);
444 bool scrIgnore(
void);
488 static void init(
void);
490 static unsigned offset(
const char *list,
unsigned index);
491 static void copy(
const char *list,
char *item,
unsigned size);
492 static unsigned count(
const char *list);
493 static const char *
get(
const char *list,
unsigned offset);
494 static char *
get(
char *list,
unsigned offset);
496 static bool isEvent(
header *scr,
const char *
id);
503 method_t looping(
void);
509 {
return errlist.begin();}
515 {
return global != NULL;}
531 void errlog(
unsigned line,
const char *fmt, ...);
533 unsigned long instance;
540 OrderedIndex errlist;
541 object_pointer<Script> shared;
542 const char *filename;
header * scr
executing script for stack
static size_t paging
default heap paging
LinkedObject * getListing(void)
line_t * ignore
ignored events
LinkedObject * scheduler
scheduler list
A class to collect compile-time errors.
static unsigned stepping
default stepping increment
static unsigned indexing
default symbol indexing
event event_t
Convenience typedef to allow use of event name.
const char * name
name of command
NAMESPACE_UCOMMON A structure to introduce new core commands to the runtime engine.
char * data
content of symbol
line_t * line
executing line at stack level
const char * name
name of symbol
const char * getFilename(void)
unsigned short index
index marker for loops
Basic compiled statement.
static unsigned stacking
stack frames in script runtime
Contains instance of a runtime symbol.
object_pointer< Script > image
Contains defined variables found by scope when strict is used.
header * scope
scope of symbol definition
static unsigned decimals
default decimal places
header * scope
effective symbol scope
struct keyword * next
linked list set by assign()
A container class for compile-time check methods.
Compiled script container.
check_t check
compile-time check routine
An instance of the runtime interpreter.
method_t method
runtime method or NULL if c-t only
unsigned short base
base stack of "@section"
An event block for a script.
Runtime methods collection class.
event_t * event
so we don't redo our event
unsigned size
size of data buffer or 0 if const
Runtime stack for each interpreter instance.
static unsigned sizing
default symbol size
unsigned short resmask
effective dsp resource mask