www.pudn.com > xvoice-0.8.1.rar > ParseEventStream.h


// -*- C++ -*-

/**
 * ParseEventStream.h
 *
 * Description: parse an event stream from XML
 *
 * Copyright (c) 1999, David Z. Creemer.
 * See the LICENSE file. All rights not granted therein are reserved.
 *
 * @author David Z. Creemer
 * @version 1.0
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 */

#ifndef _PARSEEVENTSTREAM_H_
#define _PARSEEVENTSTREAM_H_

#include "EventStream.h"

/*namedEventStream: just a combo of a spoken-form string 
  and an Xevent stream which should be sent when the 
  spoken form string is spoken*/

class namedEventStream{
    public:
    EventStream* eventStream;
    char* name;
    namedEventStream(const char* n){
	name=new char[strlen(n)+1];
	strcpy(name,n);
	eventStream=new EventStream(); 
    }
};

typedef list namedEventStreamList;
class application{
    public:
        char* name;
        char* expr;
        application(const char* n, const char* e){
            name=new char[strlen(n)+1];
            strcpy(name,n);
            expr=new char[strlen(e)+1];
            strcpy(expr,e);
        }
        ~application() {
            delete name;
            delete expr;
        }

};
typedef list applicationList;

applicationList* parseFile( const char* filename, const char* grammardir );
EventStream* parseBuff( const char* bytes);

#endif // _PARSEEVENTSTREAM_H_