blob: f876b1906edb95c90abb5d544ce765bcb5824299 [file] [log] [blame]
Robert Biebera089fcc2010-05-25 22:39:07 +00001/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2010 Robert Bieber
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
Robert Bieber8ea056d2010-05-27 19:57:15 +000022extern "C"
Robert Bieber0769fc52010-05-25 22:24:08 +000023{
Robert Bieber0769fc52010-05-25 22:24:08 +000024#include "skin_parser.h"
25#include "skin_debug.h"
Robert Bieber0769fc52010-05-25 22:24:08 +000026}
27
28#include <cstdlib>
29#include <cstdio>
Robert Bieber6980c1e2010-05-29 00:04:04 +000030#include <iostream>
Robert Bieber0769fc52010-05-25 22:24:08 +000031
32#include <QtGui/QApplication>
Robert Bieber0769fc52010-05-25 22:24:08 +000033#include <QTreeView>
34
Robert Bieber565cd002010-05-26 21:13:14 +000035#include "parsetreemodel.h"
36
Robert Bieber0769fc52010-05-25 22:24:08 +000037int main(int argc, char* argv[])
38{
Robert Bieber9f2e1b12010-05-30 01:47:35 +000039 QApplication app(argc, argv);
Robert Bieber0769fc52010-05-25 22:24:08 +000040
Robert Bieber6980c1e2010-05-29 00:04:04 +000041 char doc[] = "#Comment\n%Vd(U);Hey\n%?bl(test,3,5,2,1)<param2|param3>";
Robert Bieber0769fc52010-05-25 22:24:08 +000042
Robert Bieber9f2e1b12010-05-30 01:47:35 +000043 ParseTreeModel tree(doc);
44
45 QTreeView view;
46 view.setModel(&tree);
47 view.show();
48
49 return app.exec();
50
51 /*
Robert Bieber8ea056d2010-05-27 19:57:15 +000052 struct skin_element* test = skin_parse(doc);
Robert Bieber0769fc52010-05-25 22:24:08 +000053
Robert Bieber9f2e1b12010-05-30 01:47:35 +000054 ParseTreeModel tree(doc);
Robert Bieber6980c1e2010-05-29 00:04:04 +000055 std::cout << "----" << std::endl;
56 if(std::string(doc) == tree.genCode().toStdString())
57 std::cout << "Code in/out matches" << std::endl;
58 else
59 std::cout << "Match error" << std::endl;
60
Robert Bieber0769fc52010-05-25 22:24:08 +000061
Robert Bieber8ea056d2010-05-27 19:57:15 +000062 skin_free_tree(test);
Robert Bieber9f2e1b12010-05-30 01:47:35 +000063 */
Robert Bieber8ea056d2010-05-27 19:57:15 +000064
Robert Bieber0769fc52010-05-25 22:24:08 +000065}
66