#include "ir/ir.h"

using namespace std;
using namespace empathy;
using namespace empathy::util;

int main( int argc, char** argv )
{
    // Just a dumping place for simple test code for now.
    auto gg = TVEC( TSID( foo ) | TSTR( "bar" ) | TVEC( TSID( meh ), TSID( gg ) ), VECOFLENGTH( N ), REPEAT( ANYTERM( U ) ) );
    cout << gg << endl;

    ir::Trie<> testTrie;
    testTrie = Merge( testTrie, gg );
    testTrie = Merge( testTrie, TVEC( TSID( blah ), TSTR( "bar" ) ) );
    testTrie = Merge( testTrie, TVEC( TSID( foo ), TSTR( "bar" ) ) );
    testTrie = Merge( testTrie, TVEC( TSID( blah ), TSTR( "meh" ) ) );
    auto testTrie2 = testTrie;
    testTrie = Merge( testTrie, TSTR( "bar" ) );
    testTrie = Merge( testTrie, TSTR( "foo" ) );
    testTrie = Merge( testTrie, TVEC(
        TSID( foo ) | TSTR( "barrr" ) | TVEC()
        , VECOFLENGTH( M ), REPEAT( ANYTERM( U ) ) ) );
    testTrie = Merge( testTrie, TVEC() );
    testTrie = Merge( testTrie, TVEC( TSID( gg ) ) );

    ir::GraphVizDump( "dump2.dot", testTrie );

    for( auto&& t : Enumerate( testTrie ) )
        cout << t << endl;

    cout << Compare( testTrie, testTrie2 ) << endl;
    cout << Compare( testTrie2, testTrie2 ) << endl;
    cout << Compare( testTrie, testTrie ) << endl;

    return EXIT_SUCCESS;
}
