add codegen for ?.

This commit is contained in:
ValKmjolnir
2024-06-05 01:13:39 +08:00
parent 4adf9541b9
commit 1436693cd6
8 changed files with 389 additions and 130 deletions

View File

@@ -4,28 +4,94 @@
namespace nasal {
const char* oprand_name_table[] = {
"exit ", "repl ", "intl ", "loadg ",
"loadl ", "loadu ", "pnum ", "pnil ",
"pstr ", "newv ", "newh ", "newf ",
"happ ", "para ", "def ", "dyn ",
"lnot ", "usub ", "bitnot", "bitor ",
"bitxor", "bitand", "add ", "sub ",
"mult ", "div ", "lnk ", "addc ",
"subc ", "multc ", "divc ", "lnkc ",
"addeq ", "subeq ", "muleq ", "diveq ",
"lnkeq ", "bandeq", "boreq ", "bxoreq",
"addeqc", "subeqc", "muleqc", "diveqc",
"lnkeqc", "addecp", "subecp", "mulecp",
"divecp", "lnkecp", "meq ", "eq ",
"neq ", "less ", "leq ", "grt ",
"geq ", "lessc ", "leqc ", "grtc ",
"geqc ", "pop ", "jmp ", "jt ",
"jf ", "cnt ", "findx ", "feach ",
"callg ", "calll ", "upval ", "callv ",
"callvi", "callh ", "callfv", "callfh",
"callb ", "slcbeg", "slcend", "slice ",
"slice2", "mcallg", "mcalll", "mupval",
"mcallv", "mcallh", "ret "
"exit ",
"repl ",
"intl ",
"loadg ",
"loadl ",
"loadu ",
"dup ",
"pnum ",
"pnil ",
"pstr ",
"newv ",
"newh ",
"newf ",
"happ ",
"para ",
"def ",
"dyn ",
"lnot ",
"usub ",
"bitnot",
"bitor ",
"bitxor",
"bitand",
"add ",
"sub ",
"mult ",
"div ",
"lnk ",
"addc ",
"subc ",
"multc ",
"divc ",
"lnkc ",
"addeq ",
"subeq ",
"muleq ",
"diveq ",
"lnkeq ",
"bandeq",
"boreq ",
"bxoreq",
"addeqc",
"subeqc",
"muleqc",
"diveqc",
"lnkeqc",
"addecp",
"subecp",
"mulecp",
"divecp",
"lnkecp",
"meq ",
"eq ",
"neq ",
"less ",
"leq ",
"grt ",
"geq ",
"lessc ",
"leqc ",
"grtc ",
"geqc ",
"pop ",
"jmp ",
"jt ",
"jf ",
"cnt ",
"findx ",
"feach ",
"callg ",
"calll ",
"upval ",
"callv ",
"callvi",
"callh ",
"callfv",
"callfh",
"callb ",
"slcbeg",
"slcend",
"slice ",
"slice2",
"mcallg",
"mcalll",
"mupval",
"mcallv",
"mcallh",
"ret "
};
void codestream::set(const f64* number_list,