added more compiler code

This commit is contained in:
hyunghwan.chung 2015-05-27 17:16:50 +00:00
parent 008c74666d
commit bb3b6c4270
4 changed files with 407 additions and 312 deletions

File diff suppressed because it is too large Load Diff

View File

@ -232,8 +232,6 @@ static char* syntax_error_msg[] =
"integer expected",
"primitive: expected",
"wrong directive",
"wrong class modifier",
"duplicate class modifier",
"undefined class",
"duplicate class",
"#dcl not allowed",

View File

@ -277,12 +277,10 @@ enum stix_synerrnum_t
STIX_SYNERR_INTEGER, /* integer expected */
STIX_SYNERR_PRIMITIVE, /* primitive: expected */
STIX_SYNERR_DIRECTIVE, /* wrong directive */
STIX_SYNERR_CLASSMOD, /* wrong class modifier */
STIX_SYNERR_CLASSMODDUP, /* duplicate class modifier */
STIX_SYNERR_CLASSUNDEF, /* undefined class */
STIX_SYNERR_CLASSDUP, /* duplicate class */
STIX_SYNERR_DCLBANNED, /* #dcl not allowed */
STIX_SYNERR_FUNNAME, /* wrong function name */
STIX_SYNERR_MTHNAME, /* wrong function name */
STIX_SYNERR_ARGNAMEDUP, /* duplicate argument name */
STIX_SYNERR_TMPRNAMEDUP, /* duplicate temporary variable name */
STIX_SYNERR_VARNAMEDUP /* duplicate variable name */
@ -526,9 +524,12 @@ struct stix_compiler_t
stix_ucs_t vars[3];
stix_size_t vars_capa[3];
/* var_count, unlike vars above, includes superclass counts as well.*/
/* var_count, unlike vars above, includes superclass counts as well.
* var_count[0] - number of named instance variables
* var_count[1] - number of class variables
* var_count[2] - number of class instance variables */
stix_size_t var_count[3];
} _class;
} cls;
/* information about a function being comipled */
struct
@ -552,7 +553,7 @@ struct stix_compiler_t
stix_code_t code;
stix_size_t code_capa;
} fun;
} mth;
};
#endif

View File

@ -503,9 +503,12 @@ struct stix_class_t
stix_oop_t subclasses; /* Array of subclasses */
stix_oop_char_t name; /* Symbol */
/* == NEVER CHANGE THIS ORDER OF 3 ITEMS BELOW == */
stix_oop_char_t instvars; /* String */
stix_oop_char_t classvars; /* String */
stix_oop_char_t classinstvars; /* String */
/* == NEVER CHANGE THE ORDER OF 3 ITEMS ABOVE == */
stix_oop_oop_t instfuns; /* instance methods, MethodDictionary */
stix_oop_oop_t classfuns; /* class methods, MethodDictionary */