diff options
author | Adrian Thurston <thurston@complang.org> | 2009-02-15 23:12:44 +0000 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2009-02-15 23:12:44 +0000 |
commit | 27ad94aba9f211bcdb4b2d1c83d22ce97464a503 (patch) | |
tree | 9c82cc94c5e6594f796670479755ee875feafeb4 | |
parent | 4daa230e86bcf1a126f9a469257302fb0f36bfba (diff) | |
download | colm-27ad94aba9f211bcdb4b2d1c83d22ce97464a503.tar.gz |
Unset action orderings are a reality due to the fact that we are using LALR(1).
They are not a user-level warning. Just ordering last since they result in
parse errors anyways.
-rw-r--r-- | colm/pdabuild.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/colm/pdabuild.cpp b/colm/pdabuild.cpp index 1937b0c3..a18f388f 100644 --- a/colm/pdabuild.cpp +++ b/colm/pdabuild.cpp @@ -699,24 +699,18 @@ void ParseData::pdaActionOrder( PdaGraph *pdaGraph, KlangElSet &parserEls ) } } + /* Some actions may not have an ordering. I believe these to be actions + * that result in a parse error and they arise because the state tables + * are LALR(1) but the action ordering is LR(1). LALR(1) causes some + * reductions that lead nowhere. */ for ( PdaStateList::Iter state = pdaGraph->stateList; state.lte(); state++ ) { assert( CmpDotSet::compare( state->dotSet, state->dotSet2 ) == 0 ); for ( TransMap::Iter tel = state->transMap; tel.lte(); tel++ ) { PdaTrans *trans = tel->value; /* Check every action has an ordering. */ for ( ActDataList::Iter adl = trans->actOrds; adl.lte(); adl++ ) { - if ( *adl == 0 ) { - warning() << "action ordering for " << - trans->actions[adl.pos()] << " is unset, state: " << - state->stateNum << ", trans: "; - - KlangEl *lel = langElIndex[trans->lowKey]; - if ( lel == 0 ) - cerr << (char)trans->lowKey << endl; - else - cerr << lel->name << endl; + if ( *adl == 0 ) *adl = time++; - } } } } |