diff options
author | Adrian Thurston <thurston@complang.org> | 2013-03-27 20:32:21 -0400 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2013-03-27 20:32:21 -0400 |
commit | e804dd3a29d9ebcc187aad49dfb3c972b94e2c8b (patch) | |
tree | 3612aee5939ba2c9d302776ca0fa5302996ae526 | |
parent | 294b4ad138bf1749a6b9996b3021c5f3c7f652ff (diff) | |
download | colm-e804dd3a29d9ebcc187aad49dfb3c972b94e2c8b.tar.gz |
removed loc and star from ReItem, neither are used
-rw-r--r-- | colm/load.cc | 4 | ||||
-rw-r--r-- | colm/parsetree.cc | 10 | ||||
-rw-r--r-- | colm/parsetree.h | 14 |
3 files changed, 5 insertions, 23 deletions
diff --git a/colm/load.cc b/colm/load.cc index f8955f86..3683eb56 100644 --- a/colm/load.cc +++ b/colm/load.cc @@ -134,11 +134,11 @@ struct LoadSource } else if ( LexFactorTree.PosData() != 0 ) { ReOrBlock *block = walkRegOrData( LexFactorTree.PosData() ); - factor = LexFactor::cons( ReItem::cons( internal, block, ReItem::OrBlock ) ); + factor = LexFactor::cons( ReItem::cons( block, ReItem::OrBlock ) ); } else if ( LexFactorTree.NegData() != 0 ) { ReOrBlock *block = walkRegOrData( LexFactorTree.NegData() ); - factor = LexFactor::cons( ReItem::cons( internal, block, ReItem::NegOrBlock ) ); + factor = LexFactor::cons( ReItem::cons( block, ReItem::NegOrBlock ) ); } else if ( LexFactorTree.Number() != 0 ) { String number = LexFactorTree.Number().text().c_str(); diff --git a/colm/parsetree.cc b/colm/parsetree.cc index b6be6c4a..14c774a5 100644 --- a/colm/parsetree.cc +++ b/colm/parsetree.cc @@ -1379,16 +1379,6 @@ FsmGraph *ReItem::walk( Compiler *pd, RegExpr *rootRegex ) } } - /* If the item is followed by a star, then apply the star op. */ - if ( star ) { - if ( rtnVal->startState->isFinState() ) { - warning(loc) << "applying kleene star to a machine that " - "accpets zero length word" << endl; - } - - rtnVal->starOp(); - rtnVal->minimizePartition2(); - } return rtnVal; } diff --git a/colm/parsetree.h b/colm/parsetree.h index f75d7193..c310c501 100644 --- a/colm/parsetree.h +++ b/colm/parsetree.h @@ -1268,31 +1268,25 @@ struct ReItem { enum ReItemType { Data, Dot, OrBlock, NegOrBlock }; - static ReItem *cons( const InputLoc &loc, const String &data ) + static ReItem *cons( const String &data ) { ReItem *r = new ReItem; - r->loc = loc; r->data = data; - r->star = false; r->type = Data; return r; } - static ReItem *cons( const InputLoc &loc, ReItemType type ) + static ReItem *cons( ReItemType type ) { ReItem *r = new ReItem; - r->loc = loc; - r->star = false; r->type = type; return r; } - static ReItem *cons( const InputLoc &loc, ReOrBlock *orBlock, ReItemType type ) + static ReItem *cons( ReOrBlock *orBlock, ReItemType type ) { ReItem *r = new ReItem; - r->loc = loc; r->orBlock = orBlock; - r->star = false; r->type = type; return r; } @@ -1300,10 +1294,8 @@ struct ReItem ~ReItem(); FsmGraph *walk( Compiler *pd, RegExpr *rootRegex ); - InputLoc loc; String data; ReOrBlock *orBlock; - bool star; ReItemType type; }; |