diff options
author | Adrian Thurston <thurston@complang.org> | 2015-01-04 09:32:08 -0500 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2015-01-04 09:32:08 -0500 |
commit | 650b70f4a55af12ee1ebb22a9afdd9fba7a3b626 (patch) | |
tree | 6bdcebe0091aed9936964cf37b4670ba21a7ef3c /src/pdabuild.cc | |
parent | e682fbd4a5f83142ada2aa92d7a642035c010348 (diff) | |
download | colm-650b70f4a55af12ee1ebb22a9afdd9fba7a3b626.tar.gz |
no longer allocating a langEl to generics
enerics are now structs. Also added the TYPE_GERERIC unique type.
Diffstat (limited to 'src/pdabuild.cc')
-rw-r--r-- | src/pdabuild.cc | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/src/pdabuild.cc b/src/pdabuild.cc index 51757e57..c8db886b 100644 --- a/src/pdabuild.cc +++ b/src/pdabuild.cc @@ -1564,7 +1564,7 @@ void Compiler::makeRuntimeData() runtimeData->genericInfo[gen->id].keyType = gen->keyUT != 0 ? gen->keyUT->typeId : 0; runtimeData->genericInfo[gen->id].keyOffset = 0; - runtimeData->genericInfo[gen->id].langElId = gen->langEl->id; + runtimeData->genericInfo[gen->id].langElId = -1; // gen->langEl->id; runtimeData->genericInfo[gen->id].parserId = gen->utArg->langEl->parserId; runtimeData->genericInfo[gen->id].elOffset = gen->elOffset; } @@ -1810,9 +1810,11 @@ void Compiler::fillInPatterns( Program *prg ) } for ( ConsList::Iter repl = replList; repl.lte(); repl++ ) { - countNodes( prg, count, - repl->pdaRun->stackTop->next, - repl->pdaRun->stackTop->next->shadow ); + if ( repl->langEl != 0 ) { + countNodes( prg, count, + repl->pdaRun->stackTop->next, + repl->pdaRun->stackTop->next->shadow ); + } } runtimeData->patReplNodes = new PatConsNode[count]; @@ -1838,19 +1840,21 @@ void Compiler::fillInPatterns( Program *prg ) } for ( ConsList::Iter repl = replList; repl.lte(); repl++ ) { - int ind = nextAvail++; - runtimeData->patReplInfo[repl->patRepId].offset = ind; + if ( repl->langEl != 0 ) { + int ind = nextAvail++; + runtimeData->patReplInfo[repl->patRepId].offset = ind; - /* BindIds are indexed base one. */ - runtimeData->patReplInfo[repl->patRepId].numBindings = - repl->pdaRun->bindings->length() - 1; + /* BindIds are indexed base one. */ + runtimeData->patReplInfo[repl->patRepId].numBindings = + repl->pdaRun->bindings->length() - 1; - long bindId = 1; - fillNodes( prg, nextAvail, repl->pdaRun->bindings, bindId, - runtimeData->patReplNodes, - repl->pdaRun->stackTop->next, - repl->pdaRun->stackTop->next->shadow, - ind ); + long bindId = 1; + fillNodes( prg, nextAvail, repl->pdaRun->bindings, bindId, + runtimeData->patReplNodes, + repl->pdaRun->stackTop->next, + repl->pdaRun->stackTop->next->shadow, + ind ); + } } assert( nextAvail == count ); |