1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772
|
/*
* 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.
*/
/* (C) Marcin Kwadrans <quarter@users.sourceforge.net> */
#include <cstring>
#include "include/support.h"
#include "include/program.h"
#include "include/environment.h"
#include "include/paritycommand.h"
#include "include/variable.h"
#include "include/parser.h"
static gboolean unset_command (GNode *node)
{
LWPiece *piece = (LWPiece *) node->data;
if (piece == NULL)
return FALSE;
LWSymbol *symbol = piece->getSymbol();
if (symbol != NULL)
if (TRUE == symbol->isCommand()) {
LWCommand *cmd = (LWCommand *) symbol;
cmd->reset();
}
return FALSE;
}
static gboolean unset_variable (LWVariable *variable)
{
variable->clear();
return FALSE;
}
static GtkWidget *copy_piece_widget (LWPiece *piece)
{
const GdkColor markcolor = {0, 0xcc00, 0xcc00, 0xcc00};
guint size = piece->getRow()->getBoard()->getPieceSize();
GtkWidget *widget = gtk_event_box_new();
gtk_widget_set_size_request (widget, size, size);
gtk_widget_modify_bg (widget, GTK_STATE_NORMAL, &markcolor);
gtk_widget_show (widget);
LWPixmap *pixmap = piece->getBackgroundPixmap ();
if (pixmap != NULL) {
GtkWidget *image = gtk_image_new_from_pixbuf (pixmap->getPixbuf());
gtk_container_add (GTK_CONTAINER (widget), image);
gtk_widget_show (image);
}
return widget;
}
static GtkWidget *widget_tree (GNode *node)
{
GtkWidget *vbox = gtk_vbox_new (FALSE, 0);
if (node == NULL) return vbox;
if (node->data != NULL)
gtk_box_pack_start (GTK_BOX (vbox), copy_piece_widget ((LWPiece *) node->data), FALSE, FALSE, 0);
GtkWidget *hbox = gtk_hbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);
for (GNode *n = node->children; n != NULL; n=n->next)
gtk_box_pack_start (GTK_BOX(hbox), widget_tree (n), TRUE, TRUE, 5);
return vbox;
}
/*! \brief Destructor
*/
LWProgramData::~LWProgramData ()
{
LWParser::unrefData();
if (tree_piece != NULL) {
g_node_traverse (tree_piece, G_POST_ORDER, G_TRAVERSE_ALL,
-1, (GNodeTraverseFunc) unset_command, NULL);
g_node_destroy (tree_piece);
}
if (list_vars != NULL) {
g_slist_foreach (list_vars, (GFunc) unset_variable, NULL);
g_slist_free (list_vars);
}
}
void LWProgramData::registerVariable (LWVariable *variable)
{
if (NULL == g_slist_find (list_vars, variable))
list_vars = g_slist_prepend (list_vars, (gpointer) variable);
}
void LWProgramData::setTree (GNode *a_tree)
{
tree_piece = a_tree;
}
GNode *LWProgramData::getTree ()
{
return tree_piece;
}
/*! \brief Debug syntax tree
Draw the syntax tree in new window. Method only useful in analasis and testing
of algorithms used for creating syntax tree.
*/
void LWProgramData::debugTree ()
{
GtkWidget *w = widget_tree (tree_piece);
GtkWidget *sw = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (sw), w);
GtkWidget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_container_add (GTK_CONTAINER (window), sw);
gtk_widget_show_all (window);
g_signal_connect (G_OBJECT (window), "delete_event", G_CALLBACK(gtk_widget_destroy), NULL);
}
//-------------------------------------------------
guint LWParser::ref_data = 0;
LWPiece *LWParser::begin_piece = NULL;
LWParser::LWParser (LWProgram *a_program): program (a_program), enable_debug(FALSE)
{
if (begin_piece == NULL) {
LWBoard *board = new LWBoard (LW_TYPE_PROGRAM);
LWRow *row = new LWRow (board);
board->addRow (row);
begin_piece = new LWPiece (row);
row->addPiece(begin_piece);
begin_piece->setSymbol ("begin");
}
}
LWParser::~LWParser ()
{
if (ref_data == 0)
delete program;
}
void LWParser::unrefData ()
{
if (--ref_data == 0) {
delete begin_piece->getRow()->getBoard();
begin_piece = NULL;
}
}
void LWParser::matchWith (LWCommandSegment*pcmd, LWCommand *cmd, LWPiece *piece)
{
try {
pcmd->matchWith(cmd);
} catch (LWMessage *msg) {
msg->setPiece(piece);
throw msg;
}
}
/* False - continue the loop */
void LWParser::compareParity (gboolean **r,
LWCommand *cmd_a, LWPiece *piece_a,
LWCommand *cmd_b, LWPiece *piece_b)
{
/* cmd_a = ")" , cmd_b = "("*/
LWCommandSegment *scmd_a=NULL;
LWCommandSegment *scmd_b=NULL;
if (cmd_a != NULL)
if (TRUE == cmd_a->isSegment())
scmd_a = dynamic_cast <LWCommandSegment*> (cmd_a);
if (cmd_b != NULL)
if (TRUE == cmd_b->isSegment())
scmd_b = dynamic_cast <LWCommandSegment*> (cmd_b);
if ((scmd_a != NULL) && (scmd_b != NULL))
if (FALSE == scmd_b->isAlreadyMatched())
if (TRUE == scmd_a->matchPrevCondition(cmd_b) &&
TRUE == scmd_b->matchNextCondition(cmd_a)) {
matchWith (scmd_b, cmd_a, piece_b);
matchWith (scmd_a, cmd_b, piece_a);
**r = TRUE;
return;
}
if (scmd_b != NULL)
if (FALSE == scmd_b->isAlreadyMatched())
if (TRUE == scmd_b->matchNextCondition(cmd_a)) {
**r = TRUE;
return;
}
if (scmd_a != NULL)
if (TRUE == scmd_a->matchPrevCondition(cmd_b)) {
**r = FALSE;
return;
}
*r = NULL;
}
gboolean LWParser::comparePriority (LWPiece *a, LWPiece *b)
{
const guint maxprio = 16;
LWSymbol *sym_a = a->getSymbol();
LWSymbol *sym_b = b->getSymbol();
LWCommand *cmd_a = NULL;
LWCommand *cmd_b = NULL;
guint prio_a = maxprio;
guint prio_b = maxprio;
LWLink link = LW_LINK_RIGHT;
if (sym_a != NULL)
if (TRUE == sym_a->isCommand()) {
cmd_a = (LWCommand *) sym_a;
prio_a = cmd_a->getPriority();
}
if (sym_b != NULL)
if (TRUE == sym_b->isCommand()) {
cmd_b = (LWCommand *) sym_b;
prio_b = cmd_b->getPriority();
link = cmd_b->getLinkType();
}
gboolean bo;
gboolean *r = &bo;
if (prio_a > 1 && prio_b > 1) {
compareParity (&r, cmd_a, a, cmd_b, b);
if (r != NULL)
return bo;
}
switch (link) {
case LW_LINK_LEFT:
return (prio_a > prio_b) ? TRUE : FALSE;
case LW_LINK_RIGHT:
return (prio_a >= prio_b) ? TRUE : FALSE;
}
g_return_val_if_reached (FALSE);
}
/* \brief Change the symbol assigned to piece
It changes the symbol assigned to piece
\param piece The piece
\param symbolname Name of the symbol, that should be assigned to piece
*/
void LWParser::toggleToSymbol (LWPiece *piece, const gchar *symbolname)
{
if (g_ascii_strcasecmp(piece->getSymbol()->getName(), symbolname)) {
piece->setSymbol (symbolname);
}
}
void LWParser::lexScan (LWPiece *prev, LWPiece *piece)
{
if (prev == NULL) return;
g_return_if_fail (piece != NULL);
LWSymbol *psymbol = prev->getSymbol();
LWSymbol *symbol = piece->getSymbol();
if (symbol == NULL)
return;
if (TRUE == symbol->isValue())
return;
if (!g_ascii_strcasecmp (symbol->getName(), "opp") || !g_ascii_strcasecmp (symbol->getName(), "sub")) {
//digit or just icon without meaning
if (psymbol == NULL) {
toggleToSymbol (piece, "sub");
return;
}
//other value (variable,world, etc)
if (TRUE == psymbol->isValue()) {
toggleToSymbol (piece, "sub");
return;
}
// ) or ]
if (TRUE == psymbol->isCommand())
if (TRUE == ((LWCommand *) psymbol)->isSegment() &&
1 < ((LWCommand *) psymbol)->getPriority() &&
TRUE == ((LWCommand *) psymbol)->canBeSkiped()) {
toggleToSymbol (piece, "sub");
return;
}
}
if (!g_ascii_strcasecmp (symbol->getName(), "sub")) {
toggleToSymbol (piece, "opp");
}
}
LWCommand *LWParser::getNodeCommand (GNode *node)
{
g_return_val_if_fail (node != NULL, NULL);
LWPiece *piece = (LWPiece *) node->data;
g_return_val_if_fail (piece != NULL, NULL);
LWSymbol *symbol = piece->getSymbol();
g_return_val_if_fail (symbol != NULL, NULL);
g_return_val_if_fail (TRUE == symbol->isCommand(), NULL);
return (LWCommand *) symbol;
}
/* \brief Single iteration of creating syntax tree.
Find proper place basing on previous element and insert
piece into syntax tree. It produces syntax tree using
so called operators method (at least is very similar)
\param prev Previously inserted piece
\param piece Piece to insert, which can contain the command
*/
GNode *LWParser::parseIteration (GNode *prev, LWPiece *piece)
{
GNode *node;
if (TRUE == comparePriority (piece, (LWPiece *) prev->data))
return g_node_append_data (prev, (gpointer) piece);
g_return_val_if_fail (NULL != piece->getSymbol(), NULL);
g_return_val_if_fail (TRUE == piece->getSymbol()->isCommand(), NULL);
do {
prev = prev->parent;
} while (FALSE == comparePriority (piece, (LWPiece *) prev->data));
LWCommand *cmd = (LWCommand *) piece->getSymbol();
if (TRUE == cmd->canBeSkiped()) {
if (TRUE == cmd->isSegment())
((LWCommandSegment*) cmd)->matchWith(getNodeCommand(prev));
cmd->reset();
return prev;
}
/* Inserting closing part of multipart operator for example brace */
if (TRUE == cmd->isSegment())
if (TRUE == ((LWCommandSegment*) cmd)->matchPrevCondition(getNodeCommand(prev)))
return g_node_append_data (prev->parent, (gpointer) piece);
/* Insert piece between prev and last child of prev */
node = g_node_last_child (prev);
g_node_unlink (node);
GNode *t = g_node_append_data (prev, (gpointer) piece);
g_node_append (t, node);
return t;
}
/*! \brief Przetwarzanie wartości
Ze zbioru klocków reprezuntujących cyfry, zmienne, obrazki
tworzy obiekt wartości, który może być przekazany do polecenia
\param node Węzeł drzewa z klockami
\return Stworzona wartość
*/
LWValue *LWParser::LWParser::computeValue (LWProgramData *pd, GNode *node)
{
LWValue *value;
LWPiece *piece = (LWPiece *) node->data;
g_return_val_if_fail (piece != NULL, NULL);
LWSymbol *symbol = piece->getSymbol();
if (symbol != NULL) {
g_return_val_if_fail (TRUE == symbol->isValue(), NULL);
value = dynamic_cast <LWValue *> (symbol);
if (TRUE == value->isVariable()) {
if (node->children == NULL) {
pd->registerVariable ((LWVariable *) value);
return value;
} else {
LWMessage *m = new LWMessage (LW_ERROR_BadString);
m->setPiece (piece);
throw m;
}
} else
value = new LWValue (value);
} else {
LWPixmap *pixmap = piece->getBackgroundPixmap();
value = new LWValue (pixmap);
}
for (GNode *n=node->children; n != NULL; n = n->children) {
piece = (LWPiece *) n->data;
g_return_val_if_fail (piece != NULL, NULL);
symbol = piece->getSymbol();
if (symbol != NULL) {
g_return_val_if_fail (TRUE == symbol->isValue(), NULL);
LWValue *v = dynamic_cast <LWValue *> (symbol);
if (TRUE == v->isVariable()) {
delete value;
LWMessage *m = new LWMessage (LW_ERROR_BadString);
m->setPiece (piece);
throw m;
}
value->concat (v);
continue;
}
LWPixmap *pixmap = piece->getBackgroundPixmap();
value->append (pixmap);
}
return value;
}
/*! \brief Set argument for a command
It sets the argument for a command
\param cmd The command
\param node The node, which is will be used for computing value of the argument
*/
void LWParser::setArguments (LWProgramData *pd, LWCommand *cmd, GNode *node)
{
gint args=0;
GSList *destroy_list=NULL;
for (GNode *n = node; n != NULL; n = n->next) {
LWPiece *piece = (LWPiece *) n->data;
g_return_if_fail (piece != NULL);
LWSymbol *symbol = piece->getSymbol();
LWCommand *cmd2 = NULL;
if (symbol != NULL)
if (TRUE == symbol->isCommand())
cmd2 = (LWCommand *) symbol;
if (cmd2 != NULL) {
if (TRUE == cmd2->hasReturn())
cmd->setArgument (args++, NULL);
} else {
cmd->setArgument (args++, computeValue (pd, n));
destroy_list = g_slist_prepend (destroy_list, n);
}
}
cmd->setArgc (args);
g_slist_foreach (destroy_list, (GFunc) g_node_destroy, NULL);
g_slist_free (destroy_list);
}
/*! \brief Sprawdzanie poprawności stworzonego węzła
Sprawdza poprawność poleceń, na które wskazuje węzeł.
W przypadku wystąpień błędów, będą żucane wyjątki.
Dodatkowo poleceniu zawartemu w węźle, przydzialane są
argumenty (te, które mogą być ustalone na etapie analizy
programu, czyli nie będące rezulatatem wykonania innych poleceń).
\param node Sprawdzany węzeł
*/
void LWParser::checkNode (LWProgramData *pd, GNode *node)
{
for (GNode *n = node; n != NULL; n = n->next) {
LWPiece *piece = (LWPiece *) n->data;
g_return_if_fail (piece != NULL);
if (piece != begin_piece) {
LWSymbol *symbol = piece->getSymbol();
if (symbol == NULL)
continue;
if (FALSE == symbol->isCommand())
continue;
LWCommand *cmd = (LWCommand *) symbol;
try {
if (TRUE == cmd->isSegment()) {
LWCommandSegment *scmd = (LWCommandSegment *) cmd;
if (FALSE == scmd->isAlreadyMatched())
scmd->matchWith (NULL);
}
setArguments (pd, cmd, n->children);
} catch (LWMessage *msg) {
if (piece != begin_piece)
msg->setPiece (piece);
throw msg;
}
}
checkNode (pd, n->children);
}
}
gboolean LWParser::parseIterCmd (GNode **nodeptr, GNode **nodeptr2, LWPiece *piece)
{
g_return_val_if_fail (nodeptr != NULL, TRUE);
g_return_val_if_fail (nodeptr2 != NULL, TRUE);
g_return_val_if_fail (piece != NULL, TRUE);
LWSymbol *symbol = piece->getSymbol();
if (symbol == NULL)
return FALSE;
if (FALSE == symbol->isCommand())
return FALSE;
LWCommand *cmd_b = (LWCommand *) symbol;
if (cmd_b->getPriority() != 1)
return FALSE;
gboolean handled = FALSE;
if (cmd_b->isSegment()) {
LWCommandSegment *scmd_b = (LWCommandSegment *) cmd_b;
for (GNode *n = *nodeptr; !G_NODE_IS_ROOT (n); n = n->parent)
{
if ((LWPiece *) n->data == begin_piece) {
if (n->prev != NULL)
n = n->prev;
else
continue;
}
LWCommand *cmd_a = getNodeCommand (n);
if (cmd_a->isSegment() == FALSE)
continue;
LWCommandSegment *scmd_a = (LWCommandSegment *) cmd_a;
if (TRUE == scmd_a->matchNextCondition(cmd_b) &&
TRUE == scmd_b->matchPrevCondition(cmd_a)) {
if (FALSE == scmd_b->matchWith (cmd_a))
continue;
if (FALSE == scmd_a->matchWith (cmd_b))
continue;
handled = TRUE;
if (FALSE == cmd_b->canBeSkiped()) {
*nodeptr2 = g_node_append_data (n->parent, (gpointer) piece);
*nodeptr = n->parent;
} else {
cmd_b->reset();
*nodeptr2 = n;
//Remember, in that case arguments will be loaded to previous command, skip command in block
*nodeptr = (TRUE == cmd_a->requiresLogicBlock()) ? n->next : n->parent;
}
break;
}
}
}
if (handled == FALSE) {
if ((*nodeptr)->children != NULL) {
// "back from: "if if", "while while", "if while", "while if" "for to if", "for to for to", etc
for (GNode *n = *nodeptr; !G_NODE_IS_ROOT (n); n = n->parent)
{
if ((LWPiece *) n->data == begin_piece)
*nodeptr = n->parent;
else
break;
}
}
if (FALSE == cmd_b->canBeSkiped())
*nodeptr2 = g_node_append_data (*nodeptr, (gpointer) piece);
else {
// if (cmd_b->isSegment())
// ((LWCommandSegment *) cmd_b)->matchWith (NULL);
*nodeptr2 = *nodeptr;
}
if (FALSE == cmd_b->requiresLogicBlock() && TRUE == cmd_b->isSegment())
*nodeptr = *nodeptr2;
}
// "if" "else" "while" "to" "downto"
if (TRUE == cmd_b->requiresLogicBlock () ) {
*nodeptr = g_node_append_data (*nodeptr, (gpointer) begin_piece);
return TRUE;
}
return TRUE;
}
/*! \brief Analiza programu
Przeprowadza analizę planszy z programem,
tworząc drzewo składniowe. W razie błędów
metoda tworzy okno z błędem i zaznacza ikonę
w związku z którą wystąpił
\param program Plansza z programem
\return Prawda jęśli analiza zakończyła się sukcesem
w przeciwnym wypadku fałsz.
*/
LWProgramData *LWParser::parse (LWBoard *program_board)
{
g_return_val_if_fail (program_board != NULL, NULL);
LWProgramData *pd = new LWProgramData();
ref_data++;
/* Pobranie listy klocków z poleceniami*/
GSList *list_piece = program_board->getPieceList();
if (list_piece != NULL) {
LWPiece *piece = (LWPiece *) list_piece->data;
LWSymbol *symbol = piece->getSymbol();
/* check if we have some non command pieces
at the begining of the program */
if (symbol == NULL ||
FALSE == symbol->isCommand() ||
1 != ((LWCommand *) symbol)->getPriority()) {
LWMessage *msg = new LWMessage (LW_ERROR_BeginProgramWithCommand);
msg->setPiece ( piece);
program->showMessage(msg);
g_slist_free (list_piece);
delete pd;
return NULL;
}
}
GNode *node = g_node_new ((gpointer) begin_piece);
GNode *node2 = node;
LWPiece *prev = NULL;
for (GSList *l = list_piece; l != NULL; l = l->next) {
lexScan (prev, (LWPiece *) l->data);
prev = (LWPiece *) l->data;
try {
if (FALSE == parseIterCmd (&node, &node2, (LWPiece *) l->data))
node2 = parseIteration (node2, (LWPiece *) l->data);
} catch (LWMessage *msg) {
if (enable_debug == TRUE) {
pd->setTree (g_node_get_root (node));
pd->debugTree ();
}
msg->setPiece ( (LWPiece *) l->data);
program->showMessage(msg);
g_slist_free (list_piece);
delete pd;
return NULL;
}
}
/*
LWPiece *end_piece = new LWPiece (begin_piece->getRow());
end_piece->setSymbol ("end");
try {
parseIterCmd (&node, &node2, end_piece);
} catch (LWMessage *msg) {
program->showMessage(msg);
g_slist_free (list_piece);
delete end_piece;
delete pd;
return NULL;
}
delete end_piece;
*/
g_slist_free (list_piece);
pd->setTree(g_node_get_root (node));
if (enable_debug) {
pd->debugTree ();
}
try {
checkNode (pd, pd->getTree());
} catch (LWMessage *msg) {
program->showMessage(msg);
delete pd;
return NULL;
}
#if 0
pd->debugTree ();
#endif
return pd;
}
void LWParser::enableDebug (gboolean enable)
{
enable_debug = enable;
}
|