Source code: edu/iicm/xpg/generator/Generator.java
1 /***********************************************************************
2 * @(#)$RCSfile: Generator.java,v $ $Revision: 1.11 $ $Date: 2002/05/21 16:59:30 $
3 *
4 * Copyright (c) 2001 IICM, Graz University of Technology
5 * Schiesstattgasse 4a, A-8010 Graz, Austria.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License (LGPL)
9 * as published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this program; if not, write to the
19 * Free Software Foundation, Inc.,
20 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 ***********************************************************************/
22
23
24 package edu.iicm.xpg.generator;
25
26 import edu.iicm.xpg.statemachine.Initializer;
27 import edu.iicm.xpg.statemachine.InitParser;
28 import edu.iicm.xpg.statemachine.Parser;
29 import edu.iicm.xpg.statemachine.Const;
30 import org.xml.sax.SAXException;
31
32 import java.io.IOException;
33 import edu.iicm.xpg.util.Debug;
34
35 //----------------------------------------------------------------------
36 /**
37 * @author Klaus Schmaranz
38 * @author Heimo Haub
39 * @author Guenther Brand
40 * @author Stefan Thalauer
41 * @version $revision$
42 */
43
44 public class Generator extends Parser
45 {
46 protected Initializer initializer_;
47
48 //----------------------------------------------------------------------
49 /**
50 * set up a new generator with the configfile
51 * @param configfile the filename of the configfile
52 */
53
54 public Generator(String config_file)
55 throws SAXException,IOException
56 {
57 super();
58 init(config_file);
59 }
60
61 //----------------------------------------------------------------------
62 /**
63 */
64 public Generator(String config_file,String xml_reader)
65 throws SAXException,IOException
66 {
67 super(xml_reader);
68 init(config_file);
69 }
70
71 //----------------------------------------------------------------------
72 /**
73 */
74 protected void init(String config_file)
75 throws SAXException,IOException
76 {
77 if (Debug.DEBUG)
78 Debug.println(Debug.VERBOSE_LEVEL,"Setting up State Machine");
79 initializer_ = new InitParser(config_file);
80 initializer_.initialize(state_machine_);
81 }
82 }
83