[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Adonthell-commits] CVS: adonthell/src/tools/dlgedit dlg_arrow.cc,1.6,1.
From: |
Kai Sterker <address@hidden> |
Subject: |
[Adonthell-commits] CVS: adonthell/src/tools/dlgedit dlg_arrow.cc,1.6,1.7 dlg_arrow.h,1.7,1.8 dlg_circle.cc,1.8,1.9 dlg_circle.h,1.6,1.7 dlg_module.cc,1.12,1.13 dlg_module.h,1.12,1.13 dlg_node.h,1.5,1.6 dlg_types.h,1.7,1.8 gui_graph.cc,1.10,1.11 lex.loadlg.cc,1.15,1.16 loadlg.l,1.12,1.13 |
Date: |
Sat, 09 Nov 2002 16:47:05 -0500 |
Update of /cvsroot/adonthell/adonthell/src/tools/dlgedit
In directory subversions:/tmp/cvs-serv18410
Modified Files:
dlg_arrow.cc dlg_arrow.h dlg_circle.cc dlg_circle.h
dlg_module.cc dlg_module.h dlg_node.h dlg_types.h gui_graph.cc
lex.loadlg.cc loadlg.l
Log Message:
ADDED first steps towards loading/saving sub-dialogues (horribly broken right
now)
Index: dlg_arrow.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/dlg_arrow.cc,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** dlg_arrow.cc 2 Nov 2002 18:40:02 -0000 1.6
--- dlg_arrow.cc 9 Nov 2002 21:47:02 -0000 1.7
***************
*** 22,25 ****
--- 22,26 ----
#include <math.h>
#include "dlg_arrow.h"
+ #include "dlg_module.h"
#include "gui_resources.h"
***************
*** 29,32 ****
--- 30,34 ----
type_ = LINK;
mode_ = IDLE;
+ nid_ = 0;
// add the start and end to this arrow
***************
*** 234,239 ****
// load an arrow
! bool DlgArrow::load (std::vector<DlgNode*> &nodes)
{
DlgNode *circle;
std::string str;
--- 236,242 ----
// load an arrow
! bool DlgArrow::load (DlgNode *m)
{
+ DlgModule *owner, *module = (DlgModule *) m;
DlgNode *circle;
std::string str;
***************
*** 260,270 ****
}
- // Type of node
- case LOAD_TYPE:
- {
- if (parse_dlgfile (str, n) == LOAD_NUM) type_ = (node_type) n;
- break;
- }
-
// Node prior to arrow
case LOAD_PREV:
--- 263,266 ----
***************
*** 272,278 ****
if (parse_dlgfile (str, n) == LOAD_NUM)
{
! circle = nodes[n];
prev_.push_back (circle);
}
break;
}
--- 268,291 ----
if (parse_dlgfile (str, n) == LOAD_NUM)
{
! // get the module the node belongs to
! owner = (DlgModule *) module->getModule (n);
!
! // failed
! if (owner == NULL || owner->type () != MODULE)
! return false;
!
! if (parse_dlgfile (str, n) == LOAD_NUM)
! {
! // get the id of the previous circle
! circle = owner->getNode (n);
!
! // failed
! if (circle == NULL) return false;
! }
!
! // everything okay, so add circle
prev_.push_back (circle);
}
+
break;
}
***************
*** 283,287 ****
if (parse_dlgfile (str, n) == LOAD_NUM)
{
! circle = nodes[n];
next_.push_back (circle);
}
--- 296,316 ----
if (parse_dlgfile (str, n) == LOAD_NUM)
{
! // get the module the node belongs to
! owner = (DlgModule *) module->getModule (n);
!
! // failed
! if (owner == NULL || owner->type () != MODULE)
! return false;
!
! if (parse_dlgfile (str, n) == LOAD_NUM)
! {
! // get the id of the previous circle
! circle = owner->getNode (n);
!
! // failed
! if (circle == NULL) return false;
! }
!
! // everything okay, so add circle
next_.push_back (circle);
}
***************
*** 294,300 ****
if (parse_dlgfile (str, n) == LOAD_NUM)
{
! circle = nodes[n];
DlgArrow *arrow = new DlgArrow (circle, next_.front ());
! nodes.push_back (arrow);
}
break;
--- 323,331 ----
if (parse_dlgfile (str, n) == LOAD_NUM)
{
! circle = module->getNode (n);
! if (circle == NULL) break;
!
DlgArrow *arrow = new DlgArrow (circle, next_.front ());
! module->addNode (arrow);
}
break;
***************
*** 315,326 ****
file << "\nArrow\n";
- // arrow's type
- file << " Type " << (int) type_ << "\n";
-
// start circle
! file << " Prev " << prev_.front ()->index () << "\n";
// end circle
! file << " Next " << next_.front ()->index () << "\n";
file << "End\n";
--- 346,356 ----
file << "\nArrow\n";
// start circle
! file << " Prev " << prev_.front ()->module_id () << " "
! << prev_.front ()->node_id () << "\n";
// end circle
! file << " Next " << next_.front ()->module_id () << " "
! << next_.front ()->node_id () << "\n";
file << "End\n";
Index: dlg_arrow.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/dlg_arrow.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** dlg_arrow.h 2 Nov 2002 18:40:02 -0000 1.7
--- dlg_arrow.h 9 Nov 2002 21:47:02 -0000 1.8
***************
*** 23,27 ****
#define DLG_ARROW_H
- #include <vector>
#include "dlg_node.h"
--- 23,26 ----
***************
*** 36,40 ****
* Create a new arrow.
*/
! DlgArrow () { mode_ = IDLE; type_ = LINK; }
/**
* Create a new link between two nodes.
--- 35,39 ----
* Create a new arrow.
*/
! DlgArrow () { mode_ = IDLE; type_ = LINK; nid_ = 0; }
/**
* Create a new link between two nodes.
***************
*** 66,74 ****
* Init the Arrow from a file. The file to load from is a global
* variable, as loading is handled by a scanner generated with flex.
! * @param nodes The rest of the dialogue, to connect this Arrow to
* @return <b>true</b> if loading was successful, <b>false</b>
* otherwise.
*/
! bool load (std::vector<DlgNode*> &nodes);
/**
--- 65,73 ----
* Init the Arrow from a file. The file to load from is a global
* variable, as loading is handled by a scanner generated with flex.
! * @param module The dialogue this arrow belongs to.
* @return <b>true</b> if loading was successful, <b>false</b>
* otherwise.
*/
! bool load (DlgNode *module);
/**
Index: dlg_circle.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/dlg_circle.cc,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** dlg_circle.cc 2 Nov 2002 18:40:02 -0000 1.8
--- dlg_circle.cc 9 Nov 2002 21:47:02 -0000 1.9
***************
*** 24,30 ****
// Constructor
! DlgCircle::DlgCircle (DlgPoint &p, node_type t, DlgCircleEntry *e)
{
type_ = t;
entry_ = (e ? e : new DlgCircleEntry);
--- 24,32 ----
// Constructor
! DlgCircle::DlgCircle (DlgPoint &p, node_type t, int nid, int mid,
DlgCircleEntry *e)
{
type_ = t;
+ nid_ = nid;
+ mid_ = mid;
entry_ = (e ? e : new DlgCircleEntry);
***************
*** 142,145 ****
--- 144,155 ----
}
+ // Module and Node id of Circle
+ case LOAD_ID:
+ {
+ if (parse_dlgfile (str, n) == LOAD_NUM) nid_ = n;
+
+ break;
+ }
+
// Coordinates of Circle
case LOAD_POS:
***************
*** 207,211 ****
// circle's type
file << " Type " << (int) type () << "\n";
!
// circle's position
file << " Pos " << x () << " " << y () << "\n";
--- 217,224 ----
// circle's type
file << " Type " << (int) type () << "\n";
!
! // circle's id
! file << " Id " << nid_ << "\n";
!
// circle's position
file << " Pos " << x () << " " << y () << "\n";
Index: dlg_circle.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/dlg_circle.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** dlg_circle.h 2 Nov 2002 18:40:02 -0000 1.6
--- dlg_circle.h 9 Nov 2002 21:47:02 -0000 1.7
***************
*** 38,43 ****
{
public:
! DlgCircle () { mode_ = IDLE; entry_ = NULL; }
! DlgCircle (DlgPoint &p, node_type t, DlgCircleEntry *e = NULL);
~DlgCircle ();
--- 38,58 ----
{
public:
! /**
! * Create an empty circle. Used when loading a circle.
! * @param id The id of the module the circle belongs to.
! */
! DlgCircle (int id = 0) { mode_ = IDLE; entry_ = NULL; mid_ = id; }
! /**
! * Create a circle with basic information. Used to create a new circle.
! * @param p The point where the circle needs to be created.
! * @param t The type of the circle (PLAYER, NPC or NARRATOR).
! * @param nid The unique id of the newly created circle.
! * @param mid The id of the module the circle belongs to.
! * @param e The actual contents of the circle.
! */
! DlgCircle (DlgPoint &p, node_type t, int nid, int mid, DlgCircleEntry *e
= NULL);
! /**
! * Standard destructor.
! */
~DlgCircle ();
Index: dlg_module.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/dlg_module.cc,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** dlg_module.cc 2 Nov 2002 21:35:55 -0000 1.12
--- dlg_module.cc 9 Nov 2002 21:47:02 -0000 1.13
***************
*** 24,37 ****
#include "dlg_circle.h"
#include "dlg_arrow.h"
#include "gui_resources.h"
// ctor
! DlgModule::DlgModule (std::string p, std::string n, std::string s,
std::string d)
{
entry_.setDescription (d);
! serial_ = s;
path_ = p + "/";
name_ = n;
!
init ();
}
--- 24,38 ----
#include "dlg_circle.h"
#include "dlg_arrow.h"
+ #include "gui_dlgedit.h"
#include "gui_resources.h"
// ctor
! DlgModule::DlgModule (std::string p, std::string n, std::string u,
std::string d)
{
entry_.setDescription (d);
! uid_ = u;
path_ = p + "/";
name_ = n;
!
init ();
}
***************
*** 48,51 ****
--- 49,54 ----
changed_ = false;
displayed_ = false;
+ nid_ = 0;
+ serial_ = 1;
}
***************
*** 64,68 ****
// calculate shape of sub-dialogue
! void DlgModule::initShape (DlgPoint ¢er)
{
// calculate width of the module icon
--- 67,71 ----
// calculate shape of sub-dialogue
! void DlgModule::initShape (const DlgPoint ¢er)
{
// calculate width of the module icon
***************
*** 71,75 ****
// align module to the (imaginary) grid and set shape
! top_left = center.offset (-width/2 - (center.x () % CIRCLE_DIAMETER),
-(center.y () % CIRCLE_DIAMETER));
resize (width, 20);
}
--- 74,79 ----
// align module to the (imaginary) grid and set shape
! top_left = DlgPoint (center.x (), center.y ());
! top_left.move (-width/2 - (center.x () % CIRCLE_DIAMETER), -(center.y ()
% CIRCLE_DIAMETER));
resize (width, 20);
}
***************
*** 131,134 ****
--- 135,182 ----
}
+ // get the node with the given module and node ids
+ DlgNode* DlgModule::getNode (int mid, int nid)
+ {
+ // first, get the module
+ DlgModule *module = getModule (mid);
+
+ // then, get the node
+ if (module) return module->getNode (nid);
+
+ return NULL;
+ }
+
+ // get node with the given node id
+ DlgNode* DlgModule::getNode (int id)
+ {
+ // find the node with the given pos in our array of nodes
+ std::vector<DlgNode*>::iterator i;
+
+ for (i = nodes.begin (); i != nodes.end (); i++)
+ if ((*i)->node_id () == id && (*i)->type () != MODULE)
+ return *i;
+
+ return NULL;
+ }
+
+ // get module with the given module id
+ DlgModule* DlgModule::getModule (int id)
+ {
+ if (id == nid_) return this;
+
+ std::vector<DlgNode*>::iterator i;
+ DlgModule *module;
+
+ for (i = nodes.begin (); i != nodes.end (); i++)
+ if ((*i)->type () == MODULE)
+ {
+ module = getModule (id);
+ if (module) return module;
+ }
+
+ // nothing found
+ return NULL;
+ }
+
// add a node to the dialogue
void DlgModule::addNode (DlgNode *node)
***************
*** 226,229 ****
--- 274,287 ----
}
+ // get toplevel module
+ DlgModule* DlgModule::toplevel ()
+ {
+ DlgModule *toplevel = this;
+
+ while (toplevel->parent () != NULL) toplevel = toplevel->parent ();
+
+ return toplevel;
+ }
+
// Get extension of the graph for proper displaying
void DlgModule::extension (int &min_x, int &max_x, int &y)
***************
*** 256,259 ****
--- 314,370 ----
switch (i = parse_dlgfile (s, n))
{
+ case LOAD_CIRCLE:
+ {
+ circle = new DlgCircle (nid_);
+ circle->load ();
+
+ nodes.push_back (circle);
+
+ break;
+ }
+
+ case LOAD_ARROW:
+ {
+ arrow = new DlgArrow;
+
+ if (arrow->load (this->toplevel ()))
+ nodes.push_back (arrow);
+
+ break;
+ }
+
+ case LOAD_MODULE:
+ {
+ if (parse_dlgfile (s, n) == LOAD_STR)
+ {
+ // get filename of the submodule
+ std::string file = path_ + s;
+
+ // remember position in current file
+ int filepos = ftell (loadlgin);
+
+ // and close it
+ fclose (loadlgin);
+
+ // load the subdialogue from it's own file
+ DlgModule *subdlg = GuiDlgedit::window->loadSubdialogue
(file);
+
+ // re-open our dialogue file
+ loadlgin = fopen (fullName ().c_str (), "rb");
+ if (!loadlgin) return false;
+
+ // restore filepointer
+ fseek (loadlgin, filepos, SEEK_SET);
+
+ // load rest of subdialogue
+ if (subdlg)
+ {
+ subdlg->loadSubdialogue ();
+ nodes.push_back (subdlg);
+ }
+ }
+ break;
+ }
+
case LOAD_PROJECT:
{
***************
*** 310,338 ****
}
! case LOAD_CIRCLE:
{
! circle = new DlgCircle;
! circle->load ();
! nodes.push_back (circle);
break;
}
! case LOAD_ARROW:
{
! arrow = new DlgArrow;
! arrow->load (nodes);
- nodes.push_back (arrow);
break;
}
! default: break;
}
! }
!
! fclose (loadlgin);
! return true;
}
--- 421,476 ----
}
! case LOAD_ID:
{
! if (parse_dlgfile (s, n) == LOAD_NUM) serial_ = n;
! break;
! }
!
! default: break;
! }
! }
!
! fclose (loadlgin);
! return true;
! }
! // load sub-dialogue
! void DlgModule::loadSubdialogue ()
! {
! int i = 1, n;
! std::string s;
+ while (i)
+ {
+ switch (i = parse_dlgfile (s, n))
+ {
+ case LOAD_END:
+ {
+ i = 0;
break;
}
! case LOAD_ID:
{
! if (parse_dlgfile (s, n) == LOAD_NUM) nid_ = n;
break;
}
! case LOAD_POS:
! {
! int x, y;
! GdkFont *font = GuiResources::font ();
! int width = gdk_string_width (font, name ().c_str ()) + 10;
! if (parse_dlgfile (s, n) == LOAD_NUM) x = n;
! if (parse_dlgfile (s, n) == LOAD_NUM) y = n;
!
! top_left = DlgPoint (x, y);
! bottom_right = DlgPoint (x + width, y + 20);
! }
!
! default: break;
}
! }
}
***************
*** 346,356 ****
// open file
std::ofstream out (fullName ().c_str ());
- int index = 0;
// opening failed for some reasons
if (!out) return false;
! // Write Header: Adonthell Dialogue System file version 1
! out << "# Dlgedit File Format 1\n#\n"
<< "# Produced by Adonthell Dlgedit v" << _VERSION_ << "\n"
<< "# (C) 2000/2001/2002 Kai Sterker\n#\n"
--- 484,493 ----
// open file
std::ofstream out (fullName ().c_str ());
// opening failed for some reasons
if (!out) return false;
! // Write Header: Adonthell Dialogue System file version 2
! out << "# Dlgedit File Format 2\n#\n"
<< "# Produced by Adonthell Dlgedit v" << _VERSION_ << "\n"
<< "# (C) 2000/2001/2002 Kai Sterker\n#\n"
***************
*** 359,363 ****
// Node ID
! out << "Id " << nid_ << "\n";
// Save settings and stuff
--- 496,500 ----
// Node ID
! out << "Id " << serial_ << "\n";
// Save settings and stuff
***************
*** 380,387 ****
for (std::vector<DlgNode*>::iterator i = nodes.begin (); i != nodes.end
(); i++)
if ((*i)->type () != LINK)
- {
- (*i)->setIndex (index++);
(*i)->save (out);
- }
// Save Arrows
--- 517,521 ----
***************
*** 394,396 ****
--- 528,590 ----
return true;
+ }
+
+ // save a sub-module
+ void DlgModule::save (std::ofstream &file)
+ {
+ std::string path = relativeName ();
+
+ // the module's relative filename
+ file << "\nModule §" << path << "§\n";
+
+ // module's id
+ file << " Id " << nid_ << "\n";
+
+ // module's position
+ file << " Pos " << x () << " " << y () << "\n";
+
+ file << "End\n";
+ }
+
+ // return the module's path relative to its parent
+ std::string DlgModule::relativeName ()
+ {
+ // no parent -> return absolute Name
+ if (parent_ == NULL) return fullName ();
+
+ std::string p_path = parent_->path (); // parent path
+ std::string m_path = path_; // module path
+ std::string r_path = ""; // module's path relative to
parent
+
+ unsigned int pos = 0;
+
+ // find the part of the filename that matches
+ while (pos < m_path.length () && pos < p_path.length () &&
+ p_path[pos] == m_path[pos]) pos++;
+
+ // complete module path matched
+ if (pos == m_path.length ())
+ {
+ // so either both files are in the same path, or the sub-dialogue
+ // is on a higher level
+ while ((pos = p_path.find ('/', pos)) != p_path.npos) r_path += "../";
+ }
+
+ // complete parent path matched
+ else if (pos == p_path.length ())
+ {
+ // so the sub-dialogue is in a sub-directory
+ r_path = m_path.substr (pos);
+ }
+
+ // none of the paths completely matched
+ else
+ {
+ // sub-dialogue is in a different directory on a higher level
+ unsigned int i = pos;
+ while ((i = p_path.find ('/', i)) != p_path.npos) r_path += "../";
+ r_path += m_path.substr (pos);
+ }
+
+ return r_path + name_ + FILE_EXT;
}
Index: dlg_module.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/dlg_module.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** dlg_module.h 2 Nov 2002 21:35:55 -0000 1.12
--- dlg_module.h 9 Nov 2002 21:47:02 -0000 1.13
***************
*** 39,46 ****
* @param p The full path to the file containing the module.
* @param n The actual name without file extension.
! * @param s Unique id of the module.
* @param d Description of the module.
*/
! DlgModule (std::string p, std::string n, std::string s, std::string d);
/**
--- 39,47 ----
* @param p The full path to the file containing the module.
* @param n The actual name without file extension.
! * @param u Unique id of the module.
* @param d Description of the module.
+ * @param id Serial number of the module.
*/
! DlgModule (std::string p, std::string n, std::string u, std::string d);
/**
***************
*** 51,54 ****
--- 52,70 ----
/**
+ * Set the node id of this module. The toplevel module will always
+ * have the id 0. Sub-modules will get the next unused node id of
+ * the top-level module. That means, sub-modules may end up with the
+ * same id than circles of the same parent module. But this is not as
+ * tragic as it might seem, as circles and modules are treated
+ * differently when searching for a certain node.
+ */
+ void setID ()
+ {
+ int &id = toplevel ()->serial ();
+ nid_ = id;
+ id++;
+ }
+
+ /**
* @name Module drawing
*/
***************
*** 60,64 ****
* @param center The point to center the module shape around.
*/
! void initShape (DlgPoint ¢er);
/**
--- 76,80 ----
* @param center The point to center the module shape around.
*/
! void initShape (const DlgPoint ¢er);
/**
***************
*** 105,109 ****
* Mark the given node as highlighted, to show that is under the cursor.
* @param node the DlgNode to be highlighted
! * @return the the previously highlighted node, or <i>NULL</i> if no
* node has been highlighted
*/
--- 121,125 ----
* Mark the given node as highlighted, to show that is under the cursor.
* @param node the DlgNode to be highlighted
! * @return the the previously highlighted node, or \b NULL if no
* node has been highlighted
*/
***************
*** 118,122 ****
/**
* Deselect a previously selected node.
! * @return the previously selected DlgNode, or <i>NULL</i> if no
* node has been deselected
*/
--- 134,138 ----
/**
* Deselect a previously selected node.
! * @return the previously selected DlgNode, or \b NULL if no
* node has been deselected
*/
***************
*** 125,132 ****
/**
* Get the node at the given position.
! * @return the DlgNode at the positon, or NULL if there is none
*/
DlgNode* getNode (DlgPoint &point);
!
/**
* Get the node that is currently selected.
--- 141,148 ----
/**
* Get the node at the given position.
! * @return the DlgNode at the positon, or \b NULL if there is none.
*/
DlgNode* getNode (DlgPoint &point);
!
/**
* Get the node that is currently selected.
***************
*** 137,140 ****
--- 153,189 ----
/**
+ * @name Node retrieval
+ */
+ //@{
+ /**
+ * Get the node with the given module and node id. First locates
+ * the module with given mid. Then locates the node with the given
+ * nid within this module.
+ * @param mid The node id of the module the node is located in.
+ * @param nid The node id of the node to retrieve.
+ * @return the DlgNode with that id, or \b NULL if there is none.
+ */
+ DlgNode* getNode (int mid, int nid);
+ /**
+ * Get the node with the given node id in the current module.
+ * @param nid The node id of the node to retrieve.
+ * @return the DlgNode with that id, or \b NULL if there is none.
+ */
+ DlgNode* getNode (int id);
+ /**
+ * Get the (sub-)module with the given node id in the current module.
+ * @param nid The node id of the node to retrieve.
+ * @return the DlgNode with that id, or \b NULL if there is none.
+ */
+ DlgModule* getModule (int id);
+ /**
+ * Return the first parent in the chain of parents, i.e. the
+ * toplevel module.
+ * @return the module in the chain of parents with no parent.
+ */
+ DlgModule *toplevel ();
+ //@}
+
+ /**
* Get the extension of the module for centering in view.
*
***************
*** 156,159 ****
--- 205,213 ----
/**
+ * Init a sub-dialogue from a file.
+ */
+ void loadSubdialogue ();
+
+ /**
* Save the Dialogue to a file
* @param path full path of the dialogue.
***************
*** 176,204 ****
* @param file an opened file.
*/
! void save (std::ofstream &file) { }
//@}
/**
! * @name Member access
*/
//@{
/**
- * Get the list of nodes in this dialogue.
- * @return a reference to the list of nodes.
- */
- std::vector<DlgNode*> &getNodes () { return nodes; }
-
- /**
- * Get the current offset of this dialogue.
- * @return a reference to the dialogue's offset.
- */
- DlgPoint &offset () { return offset_; }
-
- /**
* Get the name of this dialogue.
* @return a reference to the dialogue's name.
*/
std::string &name () { return name_; }
-
/**
* Get the name and id of this dialogue. To be used for window
--- 230,245 ----
* @param file an opened file.
*/
! void save (std::ofstream &file);
//@}
/**
! * @name Filename and Path retrieval
*/
//@{
/**
* Get the name of this dialogue.
* @return a reference to the dialogue's name.
*/
std::string &name () { return name_; }
/**
* Get the name and id of this dialogue. To be used for window
***************
*** 206,211 ****
* @return string composed of name and unique id.
*/
! std::string shortName () { return name_ + serial_; }
!
/**
* Get the full path and filename of this dialogue. To be used when
--- 247,251 ----
* @return string composed of name and unique id.
*/
! std::string shortName () { return name_ + uid_; }
/**
* Get the full path and filename of this dialogue. To be used when
***************
*** 214,218 ****
*/
std::string fullName () { return path_ + name_ + FILE_EXT; }
!
/**
* Whether this (sub-)dialogue has been in view before switching
--- 254,294 ----
*/
std::string fullName () { return path_ + name_ + FILE_EXT; }
! /**
! * Return the path and filename of this dialogue relative to its
! * parent.
! * @return location on disk relative to parent.
! */
! std::string relativeName ();
! /**
! * Get the module's path
! * @return the full path of the module
! */
! std::string path () { return path_; }
! //@}
!
! /**
! * @name Member access
! */
! //@{
! /**
! * Get the list of nodes in this dialogue.
! * @return a reference to the list of nodes.
! */
! std::vector<DlgNode*> &getNodes () { return nodes; }
!
! /**
! * Get the current offset of this dialogue.
! * @return a reference to the dialogue's offset.
! */
! DlgPoint &offset () { return offset_; }
!
! /**
! * Get the serial number for the next node that is
! * created. It is up to the caller of this function to
! * increase the number if neccessary.
! * @return Id to use for the next node.
! */
! int &serial () { return serial_; }
!
/**
* Whether this (sub-)dialogue has been in view before switching
***************
*** 289,293 ****
bool displayed_; // Whether that (sub-)dialogue was in view
bool changed_; // Whether there were changes since saving
! int nid_; // Id to use for the next new node
mode_type state_; // one of NONE, HILIGHTED, SELECTED
--- 365,369 ----
bool displayed_; // Whether that (sub-)dialogue was in view
bool changed_; // Whether there were changes since saving
! int serial_; // Id to use for the next new node
mode_type state_; // one of NONE, HILIGHTED, SELECTED
***************
*** 295,299 ****
std::string name_; // Short (file-) name of the dialogue
std::string path_; // Path of the dialogue
! std::string serial_; // Unique number of the dialogue
DlgModuleEntry entry_; // further content of the dialogue
--- 371,375 ----
std::string name_; // Short (file-) name of the dialogue
std::string path_; // Path of the dialogue
! std::string uid_; // Unique number of the dialogue
DlgModuleEntry entry_; // further content of the dialogue
Index: dlg_node.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/dlg_node.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** dlg_node.h 2 Nov 2002 18:40:02 -0000 1.5
--- dlg_node.h 9 Nov 2002 21:47:02 -0000 1.6
***************
*** 144,159 ****
/**
- * Set the node's position in the dlg_module::nodes array.
- * @param i position of the node.
- */
- void setIndex (int i) { index_ = i; }
-
- /**
- * Get the node's position in the dlg_module::nodes array.
- * @return position of the node.
- */
- int index () { return index_; }
-
- /**
* Return the node's unique id. This is given when the node is
* created and will never change from then on. It can be used
--- 144,147 ----
***************
*** 169,179 ****
* @return module id.
*/
! std::string module_id (){ return mid_; }
protected:
node_type type_; // type of the node
! int index_; // position of node in file when
saving
! int nid_; // unique node id
! std::string mid_; // unique module id
std::list<DlgNode*> prev_; // list of node's parents
--- 157,179 ----
* @return module id.
*/
! int module_id () { return mid_; }
!
! /**
! * Get the index of this node. Used by DlgCompile.
! * @return the node's index.
! */
! int index () { return index_; }
!
! /**
! * Set the index of this node. Used by DlgCompile.
! * @param i the index to use for this node.
! */
! void setIndex (int i) { index_ = i; }
protected:
node_type type_; // type of the node
! int index_; // used by DlgCompiler
! int nid_; // unique id of the node
! int mid_; // unique id of module node belongs to
std::list<DlgNode*> prev_; // list of node's parents
Index: dlg_types.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/dlg_types.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** dlg_types.h 26 Oct 2002 22:19:44 -0000 1.7
--- dlg_types.h 9 Nov 2002 21:47:02 -0000 1.8
***************
*** 138,142 ****
LOAD_FILE = 26,
LOAD_BASE_DIR = 27,
! LOAD_UNKNOWN = 28
};
--- 138,144 ----
LOAD_FILE = 26,
LOAD_BASE_DIR = 27,
! LOAD_MODULE = 28,
! LOAD_ID = 29,
! LOAD_UNKNOWN = 30
};
Index: gui_graph.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/gui_graph.cc,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** gui_graph.cc 2 Nov 2002 21:35:55 -0000 1.10
--- gui_graph.cc 9 Nov 2002 21:47:02 -0000 1.11
***************
*** 123,128 ****
if (module == NULL) return false;
// create the new node ...
! DlgCircle *circle = new DlgCircle (point, type);
// ... add it to the module ...
--- 123,131 ----
if (module == NULL) return false;
+ // get the serial number to use for this node
+ int &serial = module->serial ();
+
// create the new node ...
! DlgCircle *circle = new DlgCircle (point, type, serial, module->node_id
());
// ... add it to the module ...
***************
*** 141,144 ****
--- 144,150 ----
}
+ // node created -> increase serial number for next node
+ serial++;
+
return true;
}
***************
*** 225,228 ****
--- 231,237 ----
subdlg->setParent (module);
+ // set id of the sub-dialogue
+ subdlg->setID ();
+
// draw the sub-dialogue
subdlg->initShape (point);
***************
*** 824,831 ****
if (module == NULL) return NULL;
! DlgModule *toplevel = module;
!
! while (toplevel->parent () != NULL) toplevel = toplevel->parent ();
!
! return toplevel;
}
--- 833,836 ----
if (module == NULL) return NULL;
! return module->toplevel ();
}
Index: lex.loadlg.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/lex.loadlg.cc,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** lex.loadlg.cc 25 Jun 2002 16:25:52 -0000 1.15
--- lex.loadlg.cc 9 Nov 2002 21:47:02 -0000 1.16
***************
*** 304,322 ****
yy_c_buf_p = yy_cp;
! #define YY_NUM_RULES 30
! #define YY_END_OF_BUFFER 31
! static yyconst short int yy_accept[100] =
{ 0,
! 0, 0, 0, 0, 31, 29, 28, 28, 1, 29,
! 27, 29, 29, 29, 29, 29, 29, 29, 29, 29,
! 29, 29, 29, 29, 24, 26, 25, 28, 1, 1,
! 27, 0, 0, 0, 0, 0, 0, 0, 0, 0,
! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
! 0, 0, 26, 0, 0, 0, 0, 0, 4, 0,
! 0, 21, 0, 0, 15, 0, 0, 0, 9, 0,
! 0, 0, 0, 0, 0, 0, 0, 12, 23, 22,
! 14, 0, 8, 19, 16, 7, 10, 6, 20, 17,
! 11, 5, 13, 3, 0, 0, 2, 18, 0
} ;
--- 304,323 ----
yy_c_buf_p = yy_cp;
! #define YY_NUM_RULES 32
! #define YY_END_OF_BUFFER 33
! static yyconst short int yy_accept[107] =
{ 0,
! 0, 0, 0, 0, 33, 31, 30, 30, 1, 31,
! 29, 31, 31, 31, 31, 31, 31, 31, 31, 31,
! 31, 31, 31, 31, 31, 26, 28, 27, 30, 1,
! 1, 29, 0, 0, 0, 0, 0, 0, 0, 0,
! 25, 0, 0, 0, 0, 0, 0, 0, 0, 0,
! 0, 0, 0, 0, 0, 28, 0, 0, 0, 0,
! 0, 5, 0, 0, 22, 0, 0, 0, 16, 0,
! 0, 0, 10, 0, 0, 0, 0, 0, 0, 0,
! 0, 13, 24, 23, 15, 0, 9, 20, 0, 17,
! 8, 11, 7, 21, 18, 12, 6, 14, 3, 0,
+ 0, 0, 2, 19, 4, 0
} ;
***************
*** 330,344 ****
6, 6, 6, 6, 6, 6, 6, 1, 1, 1,
1, 1, 1, 1, 7, 1, 8, 9, 10, 11,
! 12, 1, 13, 1, 1, 14, 1, 15, 1, 16,
! 1, 17, 1, 18, 1, 19, 1, 1, 1, 1,
! 1, 1, 1, 1, 1, 1, 20, 1, 21, 22,
!
! 23, 1, 1, 1, 24, 25, 26, 27, 28, 29,
! 30, 31, 1, 32, 33, 34, 35, 36, 37, 38,
! 39, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
! 1, 1, 1, 1, 1, 1, 40, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
--- 331,345 ----
6, 6, 6, 6, 6, 6, 6, 1, 1, 1,
1, 1, 1, 1, 7, 1, 8, 9, 10, 11,
! 12, 1, 13, 1, 1, 14, 15, 16, 1, 17,
! 1, 18, 1, 19, 1, 20, 1, 1, 1, 1,
! 1, 1, 1, 1, 1, 1, 21, 1, 22, 23,
!
! 24, 1, 1, 1, 25, 26, 27, 28, 29, 30,
! 31, 32, 1, 33, 34, 35, 36, 37, 38, 39,
! 40, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
! 1, 1, 1, 1, 1, 1, 41, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
***************
*** 353,419 ****
} ;
! static yyconst int yy_meta[41] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
! 1, 1, 1, 1, 1, 1, 1, 1, 1, 2
} ;
! static yyconst short int yy_base[103] =
{ 0,
! 0, 0, 85, 84, 123, 126, 39, 41, 119, 115,
! 114, 87, 21, 84, 88, 81, 92, 85, 22, 33,
! 18, 93, 31, 92, 126, 0, 126, 55, 108, 126,
! 104, 77, 76, 78, 76, 75, 82, 74, 73, 80,
! 71, 69, 90, 69, 58, 61, 61, 36, 72, 54,
! 60, 58, 0, 59, 67, 65, 54, 53, 126, 63,
! 61, 126, 56, 50, 126, 57, 45, 55, 126, 41,
! 51, 52, 35, 45, 34, 28, 37, 126, 126, 126,
! 126, 39, 126, 126, 126, 126, 126, 126, 126, 126,
! 126, 126, 126, 126, 38, 28, 126, 126, 126, 70,
! 72, 46
} ;
! static yyconst short int yy_def[103] =
{ 0,
! 99, 1, 100, 100, 99, 99, 99, 99, 101, 99,
! 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
! 99, 99, 99, 99, 99, 102, 99, 99, 101, 99,
! 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
! 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
! 99, 99, 102, 99, 99, 99, 99, 99, 99, 99,
! 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
! 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
! 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
! 99, 99, 99, 99, 99, 99, 99, 99, 0, 99,
! 99, 99
} ;
! static yyconst short int yy_nxt[167] =
{ 0,
6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
! 16, 17, 18, 19, 20, 21, 22, 23, 24, 6,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
! 6, 6, 6, 6, 6, 6, 6, 6, 6, 25,
! 28, 28, 28, 28, 33, 41, 53, 47, 43, 48,
! 34, 42, 44, 50, 35, 45, 28, 28, 70, 98,
! 97, 96, 46, 95, 94, 71, 93, 92, 91, 51,
! 26, 26, 29, 29, 90, 89, 88, 87, 86, 85,
! 84, 83, 82, 81, 80, 79, 78, 77, 76, 75,
! 74, 73, 72, 69, 68, 67, 66, 65, 64, 63,
!
! 62, 61, 60, 59, 58, 57, 56, 55, 54, 31,
! 30, 52, 49, 40, 39, 38, 37, 36, 32, 31,
! 31, 30, 99, 27, 27, 5, 99, 99, 99, 99,
! 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
! 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
! 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
! 99, 99, 99, 99, 99, 99
} ;
! static yyconst short int yy_chk[167] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
--- 354,422 ----
} ;
! static yyconst int yy_meta[42] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
! 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
! 2
} ;
! static yyconst short int yy_base[110] =
{ 0,
! 0, 0, 91, 90, 130, 133, 40, 42, 126, 122,
! 121, 93, 21, 90, 94, 87, 98, 24, 24, 90,
! 36, 17, 99, 34, 98, 133, 0, 133, 59, 115,
! 133, 111, 83, 82, 84, 82, 81, 88, 80, 79,
! 133, 86, 77, 75, 82, 96, 74, 63, 66, 66,
! 35, 77, 59, 65, 63, 0, 64, 72, 70, 59,
! 58, 133, 68, 66, 133, 61, 55, 50, 133, 61,
! 49, 59, 133, 45, 55, 56, 44, 49, 38, 33,
! 42, 133, 133, 133, 133, 45, 133, 133, 40, 133,
! 133, 133, 133, 133, 133, 133, 133, 133, 133, 41,
! 31, 39, 133, 133, 133, 133, 74, 76, 50
} ;
! static yyconst short int yy_def[110] =
{ 0,
! 106, 1, 107, 107, 106, 106, 106, 106, 108, 106,
! 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
! 106, 106, 106, 106, 106, 106, 109, 106, 106, 108,
! 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
! 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
! 106, 106, 106, 106, 106, 109, 106, 106, 106, 106,
! 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
! 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
! 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
! 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
! 106, 106, 106, 106, 106, 0, 106, 106, 106
} ;
! static yyconst short int yy_nxt[175] =
{ 0,
6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
! 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
! 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
! 26, 29, 29, 29, 29, 34, 41, 50, 43, 51,
! 56, 35, 46, 42, 44, 36, 47, 53, 74, 48,
! 29, 29, 105, 104, 103, 75, 49, 102, 101, 100,
! 99, 98, 97, 54, 27, 27, 30, 30, 96, 95,
! 94, 93, 92, 91, 90, 89, 88, 87, 86, 85,
! 84, 83, 82, 81, 80, 79, 78, 77, 76, 73,
!
! 72, 71, 70, 69, 68, 67, 66, 65, 64, 63,
! 62, 61, 60, 59, 58, 57, 32, 31, 55, 52,
! 45, 40, 39, 38, 37, 33, 32, 32, 31, 106,
! 28, 28, 5, 106, 106, 106, 106, 106, 106, 106,
! 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
! 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
! 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
! 106, 106, 106, 106
} ;
! static yyconst short int yy_chk[175] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
***************
*** 421,438 ****
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
! 7, 7, 8, 8, 13, 19, 102, 21, 20, 21,
! 13, 19, 20, 23, 13, 20, 28, 28, 48, 96,
! 95, 82, 20, 77, 76, 48, 75, 74, 73, 23,
! 100, 100, 101, 101, 72, 71, 70, 68, 67, 66,
! 64, 63, 61, 60, 58, 57, 56, 55, 54, 52,
! 51, 50, 49, 47, 46, 45, 44, 43, 42, 41,
!
! 40, 39, 38, 37, 36, 35, 34, 33, 32, 31,
! 29, 24, 22, 18, 17, 16, 15, 14, 12, 11,
! 10, 9, 5, 4, 3, 99, 99, 99, 99, 99,
! 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
! 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
! 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
! 99, 99, 99, 99, 99, 99
} ;
--- 424,442 ----
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
! 1, 7, 7, 8, 8, 13, 18, 22, 19, 22,
! 109, 13, 21, 18, 19, 13, 21, 24, 51, 21,
! 29, 29, 102, 101, 100, 51, 21, 89, 86, 81,
! 80, 79, 78, 24, 107, 107, 108, 108, 77, 76,
! 75, 74, 72, 71, 70, 68, 67, 66, 64, 63,
! 61, 60, 59, 58, 57, 55, 54, 53, 52, 50,
!
! 49, 48, 47, 46, 45, 44, 43, 42, 40, 39,
! 38, 37, 36, 35, 34, 33, 32, 30, 25, 23,
! 20, 17, 16, 15, 14, 12, 11, 10, 9, 5,
! 4, 3, 106, 106, 106, 106, 106, 106, 106, 106,
! 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
! 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
! 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
! 106, 106, 106, 106
} ;
***************
*** 474,478 ****
#define YY_NO_UNPUT 1
#define YY_NEVER_INTERACTIVE 1
! #line 477 "lex.loadlg.cc"
/* Macros after this point can all be overridden by user definitions in
--- 478,482 ----
#define YY_NO_UNPUT 1
#define YY_NEVER_INTERACTIVE 1
! #line 481 "lex.loadlg.cc"
/* Macros after this point can all be overridden by user definitions in
***************
*** 628,632 ****
! #line 631 "lex.loadlg.cc"
if ( yy_init )
--- 632,636 ----
! #line 635 "lex.loadlg.cc"
if ( yy_init )
***************
*** 679,683 ****
{
yy_current_state = (int)
yy_def[yy_current_state];
! if ( yy_current_state >= 100 )
yy_c = yy_meta[(unsigned int) yy_c];
}
--- 683,687 ----
{
yy_current_state = (int)
yy_def[yy_current_state];
! if ( yy_current_state >= 107 )
yy_c = yy_meta[(unsigned int) yy_c];
}
***************
*** 685,689 ****
++yy_cp;
}
! while ( yy_base[yy_current_state] != 126 );
yy_find_action:
--- 689,693 ----
++yy_cp;
}
! while ( yy_base[yy_current_state] != 133 );
yy_find_action:
***************
*** 729,865 ****
YY_RULE_SETUP
#line 35 "loadlg.l"
! return LOAD_END;
YY_BREAK
case 5:
YY_RULE_SETUP
#line 36 "loadlg.l"
! return LOAD_TYPE;
YY_BREAK
case 6:
YY_RULE_SETUP
#line 37 "loadlg.l"
! return LOAD_PREV;
YY_BREAK
case 7:
YY_RULE_SETUP
#line 38 "loadlg.l"
! return LOAD_NEXT;
YY_BREAK
case 8:
YY_RULE_SETUP
#line 39 "loadlg.l"
! return LOAD_LINK;
YY_BREAK
case 9:
YY_RULE_SETUP
#line 40 "loadlg.l"
! return LOAD_POS;
YY_BREAK
case 10:
YY_RULE_SETUP
#line 41 "loadlg.l"
! return LOAD_NOTE;
YY_BREAK
case 11:
YY_RULE_SETUP
#line 42 "loadlg.l"
! return LOAD_TEXT;
YY_BREAK
case 12:
YY_RULE_SETUP
#line 43 "loadlg.l"
! return LOAD_COND;
YY_BREAK
case 13:
YY_RULE_SETUP
#line 44 "loadlg.l"
! return LOAD_VARS;
YY_BREAK
case 14:
YY_RULE_SETUP
#line 45 "loadlg.l"
! return LOAD_FUNC;
YY_BREAK
case 15:
YY_RULE_SETUP
#line 46 "loadlg.l"
! return LOAD_NPC;
YY_BREAK
case 16:
YY_RULE_SETUP
#line 47 "loadlg.l"
! return LOAD_NAME;
YY_BREAK
case 17:
YY_RULE_SETUP
#line 48 "loadlg.l"
! return LOAD_RACE;
YY_BREAK
case 18:
YY_RULE_SETUP
#line 49 "loadlg.l"
! return LOAD_GENDER;
YY_BREAK
case 19:
YY_RULE_SETUP
#line 50 "loadlg.l"
! return LOAD_LOOP;
YY_BREAK
case 20:
YY_RULE_SETUP
#line 51 "loadlg.l"
! return LOAD_PROJECT;
YY_BREAK
case 21:
YY_RULE_SETUP
#line 52 "loadlg.l"
! return LOAD_IMPORTS;
YY_BREAK
case 22:
YY_RULE_SETUP
#line 53 "loadlg.l"
! return LOAD_DTOR;
YY_BREAK
case 23:
YY_RULE_SETUP
#line 54 "loadlg.l"
! return LOAD_CTOR;
YY_BREAK
case 24:
YY_RULE_SETUP
! #line 56 "loadlg.l"
! mytext = ""; BEGIN(text);
YY_BREAK
case 25:
YY_RULE_SETUP
! #line 57 "loadlg.l"
! BEGIN(INITIAL); return LOAD_STR;
YY_BREAK
case 26:
YY_RULE_SETUP
#line 58 "loadlg.l"
! mytext += yytext;
YY_BREAK
case 27:
YY_RULE_SETUP
! #line 60 "loadlg.l"
! mynum = atoi (yytext); return LOAD_NUM;
YY_BREAK
case 28:
YY_RULE_SETUP
! #line 62 "loadlg.l"
! ;
YY_BREAK
case 29:
YY_RULE_SETUP
! #line 63 "loadlg.l"
! return LOAD_UNKNOWN;
YY_BREAK
case 30:
YY_RULE_SETUP
#line 64 "loadlg.l"
ECHO;
YY_BREAK
! #line 864 "lex.loadlg.cc"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(text):
--- 733,879 ----
YY_RULE_SETUP
#line 35 "loadlg.l"
! return LOAD_MODULE;
YY_BREAK
case 5:
YY_RULE_SETUP
#line 36 "loadlg.l"
! return LOAD_END;
YY_BREAK
case 6:
YY_RULE_SETUP
#line 37 "loadlg.l"
! return LOAD_TYPE;
YY_BREAK
case 7:
YY_RULE_SETUP
#line 38 "loadlg.l"
! return LOAD_PREV;
YY_BREAK
case 8:
YY_RULE_SETUP
#line 39 "loadlg.l"
! return LOAD_NEXT;
YY_BREAK
case 9:
YY_RULE_SETUP
#line 40 "loadlg.l"
! return LOAD_LINK;
YY_BREAK
case 10:
YY_RULE_SETUP
#line 41 "loadlg.l"
! return LOAD_POS;
YY_BREAK
case 11:
YY_RULE_SETUP
#line 42 "loadlg.l"
! return LOAD_NOTE;
YY_BREAK
case 12:
YY_RULE_SETUP
#line 43 "loadlg.l"
! return LOAD_TEXT;
YY_BREAK
case 13:
YY_RULE_SETUP
#line 44 "loadlg.l"
! return LOAD_COND;
YY_BREAK
case 14:
YY_RULE_SETUP
#line 45 "loadlg.l"
! return LOAD_VARS;
YY_BREAK
case 15:
YY_RULE_SETUP
#line 46 "loadlg.l"
! return LOAD_FUNC;
YY_BREAK
case 16:
YY_RULE_SETUP
#line 47 "loadlg.l"
! return LOAD_NPC;
YY_BREAK
case 17:
YY_RULE_SETUP
#line 48 "loadlg.l"
! return LOAD_NAME;
YY_BREAK
case 18:
YY_RULE_SETUP
#line 49 "loadlg.l"
! return LOAD_RACE;
YY_BREAK
case 19:
YY_RULE_SETUP
#line 50 "loadlg.l"
! return LOAD_GENDER;
YY_BREAK
case 20:
YY_RULE_SETUP
#line 51 "loadlg.l"
! return LOAD_LOOP;
YY_BREAK
case 21:
YY_RULE_SETUP
#line 52 "loadlg.l"
! return LOAD_PROJECT;
YY_BREAK
case 22:
YY_RULE_SETUP
#line 53 "loadlg.l"
! return LOAD_IMPORTS;
YY_BREAK
case 23:
YY_RULE_SETUP
#line 54 "loadlg.l"
! return LOAD_DTOR;
YY_BREAK
case 24:
YY_RULE_SETUP
! #line 55 "loadlg.l"
! return LOAD_CTOR;
YY_BREAK
case 25:
YY_RULE_SETUP
! #line 56 "loadlg.l"
! return LOAD_ID;
YY_BREAK
case 26:
YY_RULE_SETUP
#line 58 "loadlg.l"
! mytext = ""; BEGIN(text);
YY_BREAK
case 27:
YY_RULE_SETUP
! #line 59 "loadlg.l"
! BEGIN(INITIAL); return LOAD_STR;
YY_BREAK
case 28:
YY_RULE_SETUP
! #line 60 "loadlg.l"
! mytext += yytext;
YY_BREAK
case 29:
YY_RULE_SETUP
! #line 62 "loadlg.l"
! mynum = atoi (yytext); return LOAD_NUM;
YY_BREAK
case 30:
YY_RULE_SETUP
#line 64 "loadlg.l"
+ ;
+ YY_BREAK
+ case 31:
+ YY_RULE_SETUP
+ #line 65 "loadlg.l"
+ return LOAD_UNKNOWN;
+ YY_BREAK
+ case 32:
+ YY_RULE_SETUP
+ #line 66 "loadlg.l"
ECHO;
YY_BREAK
! #line 878 "lex.loadlg.cc"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(text):
***************
*** 1154,1158 ****
{
yy_current_state = (int) yy_def[yy_current_state];
! if ( yy_current_state >= 100 )
yy_c = yy_meta[(unsigned int) yy_c];
}
--- 1168,1172 ----
{
yy_current_state = (int) yy_def[yy_current_state];
! if ( yy_current_state >= 107 )
yy_c = yy_meta[(unsigned int) yy_c];
}
***************
*** 1189,1197 ****
{
yy_current_state = (int) yy_def[yy_current_state];
! if ( yy_current_state >= 100 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int)
yy_c];
! yy_is_jam = (yy_current_state == 99);
return yy_is_jam ? 0 : yy_current_state;
--- 1203,1211 ----
{
yy_current_state = (int) yy_def[yy_current_state];
! if ( yy_current_state >= 107 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int)
yy_c];
! yy_is_jam = (yy_current_state == 106);
return yy_is_jam ? 0 : yy_current_state;
***************
*** 1748,1750 ****
}
#endif
! #line 64 "loadlg.l"
--- 1762,1764 ----
}
#endif
! #line 66 "loadlg.l"
Index: loadlg.l
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/loadlg.l,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** loadlg.l 25 Jun 2002 16:25:52 -0000 1.12
--- loadlg.l 9 Nov 2002 21:47:02 -0000 1.13
***************
*** 33,36 ****
--- 33,37 ----
Circle return LOAD_CIRCLE;
Arrow return LOAD_ARROW;
+ Module return LOAD_MODULE;
End return LOAD_END;
Type return LOAD_TYPE;
***************
*** 53,56 ****
--- 54,58 ----
Dtor return LOAD_DTOR;
Ctor return LOAD_CTOR;
+ Id return LOAD_ID;
§ mytext = ""; BEGIN(text);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Adonthell-commits] CVS: adonthell/src/tools/dlgedit dlg_arrow.cc,1.6,1.7 dlg_arrow.h,1.7,1.8 dlg_circle.cc,1.8,1.9 dlg_circle.h,1.6,1.7 dlg_module.cc,1.12,1.13 dlg_module.h,1.12,1.13 dlg_node.h,1.5,1.6 dlg_types.h,1.7,1.8 gui_graph.cc,1.10,1.11 lex.loadlg.cc,1.15,1.16 loadlg.l,1.12,1.13,
Kai Sterker <address@hidden> <=
- Prev by Date:
[Adonthell-commits] CVS: adonthell/src/tools/dlgedit dlg_module.cc,1.11,1.12 dlg_module.h,1.11,1.12 gui_dlgedit.cc,1.11,1.12 gui_graph.cc,1.9,1.10 gui_resources.cc,1.1,1.2 gui_tree.cc,1.2,1.3
- Previous by thread:
[Adonthell-commits] CVS: adonthell/src/tools/dlgedit dlg_module.cc,1.11,1.12 dlg_module.h,1.11,1.12 gui_dlgedit.cc,1.11,1.12 gui_graph.cc,1.9,1.10 gui_resources.cc,1.1,1.2 gui_tree.cc,1.2,1.3
- Index(es):