diff options
author | Adrian Thurston <thurston@complang.org> | 2015-04-05 12:15:40 -0400 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2015-04-05 12:15:40 -0400 |
commit | 54a7d0ec8bed21f2a9dfd8c3fc6631a48122fda3 (patch) | |
tree | 59d590588290c700e223ae55792b1afc1ed19ac2 /src/declare.cc | |
parent | c8b421d4412cf96f2408b63cc7a5497884e5e672 (diff) | |
download | colm-54a7d0ec8bed21f2a9dfd8c3fc6631a48122fda3.tar.gz |
warning elim, and impl of vlist files _R only
Diffstat (limited to 'src/declare.cc')
-rw-r--r-- | src/declare.cc | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/src/declare.cc b/src/declare.cc index 676631d3..7f38a643 100644 --- a/src/declare.cc +++ b/src/declare.cc @@ -1302,11 +1302,36 @@ void Compiler::initListFields( GenericType *gen ) initListField( gen, "top", 0 ); } +void Compiler::initValueListField( GenericType *gen, const char *name, int offset ) +{ + /* Make the type ref and create the field. */ + ObjectField *el = ObjectField::cons( internal, + ObjectField::InbuiltOffType, gen->valueTr, name ); + + el->inGetR = IN_GET_VLIST_MEM_R; + el->inGetWC = IN_GET_VLIST_MEM_WC; + el->inGetWV = IN_GET_VLIST_MEM_WV; +// el->inSetWC = IN_SET_VLIST_MEM_WC; +// el->inSetWV = IN_SET_VLIST_MEM_WV; + + el->inGetValR = IN_GET_VLIST_MEM_R; + el->inGetValWC = IN_GET_VLIST_MEM_WC; + el->inGetValWV = IN_GET_VLIST_MEM_WV; + + gen->objDef->rootScope->insertField( el->name, el ); + + el->useGenericId = true; + el->generic = gen; + + /* Zero for head, One for tail. */ + el->offset = offset; +} + void Compiler::initValueListFields( GenericType *gen ) { - initListField( gen, "head", 0 ); - initListField( gen, "tail", 1 ); - initListField( gen, "top", 0 ); + initValueListField( gen, "head", 0 ); + initValueListField( gen, "tail", 1 ); + initValueListField( gen, "top", 0 ); } void Compiler::initParserFunctions( GenericType *gen ) |