source: icGREP/icgrep-devel/icgrep/re_alt.cpp @ 4122

Last change on this file since 4122 was 3914, checked in by cameron, 5 years ago

Updates for icgrep-0.9: re simplifications, re names, replimit mods, debugged while loops

File size: 896 bytes
Line 
1/*
2 *  Copyright (c) 2014 International Characters.
3 *  This software is licensed to the public under the Open Software License 3.0.
4 *  icgrep is a trademark of International Characters.
5 */
6
7#include "re_alt.h"
8
9Alt::Alt()
10{
11    mList = new std::list<RE*>();
12}
13
14Alt::Alt(std::list<RE*>* lst)
15{
16    mList = new std::list<RE*>();
17    std::list<RE*>::iterator it;
18    it=lst->begin();
19    mList->assign(it, lst->end());
20    std::reverse(mList->begin(), mList->end());
21}
22
23Alt::Alt(std::list<RE*> lst)
24{
25    mList = new std::list<RE*>();
26    std::list<RE*>::iterator it;
27    it=lst.begin();
28    mList->assign(it, lst.end());
29    std::reverse(mList->begin(), mList->end());
30}
31
32Alt::~Alt()
33{
34    while(!mList->empty()) delete mList->back(), mList->pop_back();
35    delete mList;
36}
37
38std::list<RE*>* Alt::GetREList()
39{
40    return mList;
41}
42
43void Alt::AddREListItem(RE* re)
44{
45    mList->push_back(re);
46}
47
48
Note: See TracBrowser for help on using the repository browser.