Debian Codegraph @

cmd/tools/gmlparse.y

raw
1 /*************************************************************************
2 * Copyright (c) 2011 AT&T Intellectual Property
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * https://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors: Details at https://graphviz.org
9 *************************************************************************/
10
11 %require "3.0"
12
13 /* By default, Bison emits a parser using symbols prefixed with "yy". Graphviz
14 * contains multiple Bison-generated parsers, so we alter this prefix to avoid
15 * symbol clashes.
16 */
17 %define api.prefix {gml}
18
19 %{
20 #include <stdlib.h>
21 #include <string.h>
22 #include <arith.h>
23 #include <gml2gv.h>
24 #include <assert.h>
25 #include <util/agxbuf.h>
26 #include <util/alloc.h>
27 #include <util/exit.h>
28 #include <util/list.h>
29
30 static gmlgraph* G;
31 static gmlnode* N;
32 static gmledge* E;
33
34 static attrs_t *L;
35
36 static void free_attrs(attrs_t *a) {
37 LIST_FREE(a);
38 free(a);
39 }
40
41 static LIST(attrs_t *) liststk = {.dtor = free_attrs};
42
43 static char *sortToStr(unsigned short sort);
44
45 static void free_node(gmlnode *p) {
46 if (!p) return;
47 LIST_FREE(&p->attrlist);
48 free(p->id);
49 free (p);
50 }
51
52 static void free_edge(gmledge *p) {
53 if (!p) return;
54 LIST_FREE(&p->attrlist);
55 free (p);
56 }
57
58 static void free_graph(gmlgraph *p) {
59 if (!p) return;
60 LIST_FREE(&p->nodelist);
61 LIST_FREE(&p->edgelist);
62 LIST_FREE(&p->attrlist);
63 LIST_FREE(&p->graphlist);
64 free (p);
65 }
66
67 static void
68 cleanup (void)
69 {
70 LIST_CLEAR(&liststk);
71 if (L) {
72 free_attrs(L);
73 L = NULL;
74 }
75 if (N) {
76 free_node(N);
77 N = NULL;
78 }
79 if (E) {
80 free_edge(E);
81 E = NULL;
82 }
83 if (G) {
84 free_graph(G);
85 G = NULL;
86 }
87 }
88
89 static void free_attr(gmlattr *p);
90
91 static void
92 pushAlist (void)
93 {
94 attrs_t *const lp = gv_alloc(sizeof(attrs_t));
95 lp->dtor = free_attr;
96
97 if (L) {
98 LIST_PUSH_BACK(&liststk, L);
99 }
100 L = lp;
101 }
102
103 static attrs_t *popAlist(void) {
104 attrs_t *lp = L;
105
106 if (!LIST_IS_EMPTY(&liststk))
107 L = LIST_POP_BACK(&liststk);
108 else
109 L = NULL;
110
111 return lp;
112 }
113
114 static void
115 popG (void)
116 {
117 G = G->parent;
118 }
119
120 static void
121 pushG (void)
122 {
123 gmlgraph* g = gv_alloc(sizeof(gmlgraph));
124
125 g->attrlist.dtor = free_attr;
126 g->nodelist.dtor = free_node;
127 g->edgelist.dtor = free_edge;
128 g->graphlist.dtor = free_graph;
129 g->parent = G;
130 g->directed = -1;
131
132 if (G)
133 LIST_APPEND(&G->graphlist, g);
134
135 G = g;
136 }
137
138 static gmlnode*
139 mkNode (void)
140 {
141 gmlnode *const n = gv_alloc(sizeof(gmlnode));
142 n->attrlist.dtor = free_attr;
143 return n;
144 }
145
146 static gmledge*
147 mkEdge (void)
148 {
149 gmledge* ep = gv_alloc(sizeof(gmledge));
150 ep->attrlist.dtor = free_attr;
151 return ep;
152 }
153
154 static gmlattr *mkAttr(char* name, unsigned short sort, unsigned short kind,
155 char* str, attrs_t* list) {
156 gmlattr* gp = gv_alloc(sizeof(gmlattr));
157
158 assert (name || sort);
159 if (!name)
160 name = gv_strdup (sortToStr (sort));
161 gp->sort = sort;
162 gp->kind = kind;
163 gp->name = name;
164 if (str)
165 gp->u.value = str;
166 else {
167 if (list != NULL && LIST_IS_EMPTY(list)) {
168 free_attrs(list);
169 list = 0;
170 }
171 gp->u.lp = list;
172 }
173 return gp;
174 }
175
176 static int
177 setDir (char* d)
178 {
179 gmlgraph* g;
180 int dir = atoi (d);
181
182 free (d);
183 if (dir < 0) dir = -1;
184 else if (dir > 0) dir = 1;
185 else dir = 0;
186 G->directed = dir;
187
188 if (dir >= 0) {
189 for (g = G->parent; g; g = g->parent) {
190 if (g->directed < 0)
191 g->directed = dir;
192 else if (g->directed != dir)
193 return 1;
194 }
195 }
196
197 return 0;
198 }
199
200 %}
201 %union {
202 int i;
203 char *str;
204 gmlnode* np;
205 gmledge* ep;
206 gmlattr* ap;
207 attrs_t *list;
208 }
209
210 %token GRAPH NODE EDGE DIRECTED SOURCE TARGET
211 %token XVAL YVAL WVAL HVAL LABEL GRAPHICS LABELGRAPHICS TYPE FILL
212 %token OUTLINE OUTLINESTYLE OUTLINEWIDTH WIDTH
213 %token STYLE LINE POINT
214 %token TEXT FONTSIZE FONTNAME COLOR
215 %token <str> INTEGER REAL STRING ID NAME
216 %token <list> GML_LIST
217
218 %type <np> node
219 %type <ep> edge
220 %type <list> attrlist
221 %type <ap> alistitem
222
223 %%
224 graph : optalist hdr body {gmllexeof(); if (G->parent) popG(); }
225 | error { cleanup(); YYABORT; }
226 |
227 ;
228
229 hdr : GRAPH { pushG(); }
230 ;
231
232 body : '[' optglist ']'
233 ;
234
235 optglist : glist
236 | /* empty */
237 ;
238
239 glist : glist glistitem
240 | glistitem
241 ;
242
243 glistitem : node { LIST_APPEND(&G->nodelist, $1); }
244 | edge { LIST_APPEND(&G->edgelist, $1); }
245 | hdr body
246 | DIRECTED INTEGER {
247 if (setDir($2)) {
248 yyerror("mixed directed and undirected graphs");
249 cleanup ();
250 YYABORT;
251 }
252 }
253 | ID INTEGER { LIST_APPEND(&G->attrlist, mkAttr(gv_strdup("id"), 0, INTEGER, $2, 0)); }
254 | alistitem { LIST_APPEND(&G->attrlist, $1); }
255 ;
256
257 node : NODE { N = mkNode(); } '[' nlist ']' { $$ = N; N = NULL; }
258 ;
259
260 nlist : nlist nlistitem
261 | nlistitem
262 ;
263
264 nlistitem : ID INTEGER { N->id = $2; }
265 | alistitem { LIST_APPEND(&N->attrlist, $1); }
266 ;
267
268 edge : EDGE { E = mkEdge(); } '[' elist ']' { $$ = E; E = NULL; }
269 ;
270
271 elist : elist elistitem
272 | elistitem
273 ;
274
275 elistitem : SOURCE INTEGER { E->source = $2; }
276 | TARGET INTEGER { E->target = $2; }
277 | ID INTEGER { LIST_APPEND(&E->attrlist, mkAttr(gv_strdup("id"), 0, INTEGER, $2, 0)); }
278 | alistitem { LIST_APPEND(&E->attrlist, $1); }
279 ;
280
281 attrlist : '[' {pushAlist(); } optalist ']' { $$ = popAlist(); }
282 ;
283
284 optalist : alist
285 | /* empty */
286 ;
287
288 alist : alist alistitem { LIST_APPEND(L, $2); }
289 | alistitem { LIST_APPEND(L, $1); }
290 ;
291
292 alistitem : NAME INTEGER { $$ = mkAttr ($1, 0, INTEGER, $2, 0); }
293 | NAME REAL { $$ = mkAttr ($1, 0, REAL, $2, 0); }
294 | NAME STRING { $$ = mkAttr ($1, 0, STRING, $2, 0); }
295 | NAME attrlist { $$ = mkAttr ($1, 0, GML_LIST, 0, $2); }
296 | XVAL REAL { $$ = mkAttr (0, XVAL, REAL, $2, 0); }
297 | XVAL INTEGER { $$ = mkAttr (0, XVAL, REAL, $2, 0); }
298 | YVAL REAL { $$ = mkAttr (0, YVAL, REAL, $2, 0); }
299 | WVAL REAL { $$ = mkAttr (0, WVAL, REAL, $2, 0); }
300 | HVAL REAL { $$ = mkAttr (0, HVAL, REAL, $2, 0); }
301 | LABEL STRING { $$ = mkAttr (0, LABEL, STRING, $2, 0); }
302 | GRAPHICS attrlist { $$ = mkAttr (0, GRAPHICS, GML_LIST, 0, $2); }
303 | LABELGRAPHICS attrlist { $$ = mkAttr (0, LABELGRAPHICS, GML_LIST, 0, $2); }
304 | TYPE STRING { $$ = mkAttr (0, TYPE, STRING, $2, 0); }
305 | FILL STRING { $$ = mkAttr (0, FILL, STRING, $2, 0); }
306 | OUTLINE STRING { $$ = mkAttr (0, OUTLINE, STRING, $2, 0); }
307 | OUTLINESTYLE STRING { $$ = mkAttr (0, OUTLINESTYLE, STRING, $2, 0); }
308 | OUTLINEWIDTH INTEGER { $$ = mkAttr (0, OUTLINEWIDTH, INTEGER, $2, 0); }
309 | WIDTH REAL { $$ = mkAttr (0, WIDTH, REAL, $2, 0); }
310 | WIDTH INTEGER { $$ = mkAttr (0, WIDTH, INTEGER, $2, 0); }
311 | STYLE STRING { $$ = mkAttr (0, STYLE, STRING, $2, 0); }
312 | STYLE attrlist { $$ = mkAttr (0, STYLE, GML_LIST, 0, $2); }
313 | LINE attrlist { $$ = mkAttr (0, LINE, GML_LIST, 0, $2); }
314 | POINT attrlist { $$ = mkAttr (0, POINT, GML_LIST, 0, $2); }
315 | TEXT STRING { $$ = mkAttr (0, TEXT, STRING, $2, 0); }
316 | FONTNAME STRING { $$ = mkAttr (0, FONTNAME, STRING, $2, 0); }
317 | FONTSIZE INTEGER { $$ = mkAttr (0, FONTNAME, INTEGER, $2, 0); }
318 | COLOR STRING { $$ = mkAttr (0, COLOR, STRING, $2, 0); }
319 ;
320
321 %%
322
323 static void free_attr(gmlattr *p) {
324 if (!p) return;
325 if (p->kind == GML_LIST && p->u.lp)
326 free_attrs(p->u.lp);
327 else
328 free (p->u.value);
329 free (p->name);
330 free (p);
331 }
332
333 static void deparseList(attrs_t *alist, agxbuf *xb);
334
335 static void
336 deparseAttr (gmlattr* ap, agxbuf* xb)
337 {
338 if (ap->kind == GML_LIST) {
339 agxbprint (xb, "%s ", ap->name);
340 deparseList (ap->u.lp, xb);
341 }
342 else if (ap->kind == STRING) {
343 agxbprint (xb, "%s \"%s\"", ap->name, ap->u.value);
344 }
345 else {
346 agxbprint (xb, "%s %s", ap->name, ap->u.value);
347 }
348 }
349
350 static void deparseList(attrs_t *alist, agxbuf *xb) {
351 agxbput (xb, "[ ");
352 for (size_t i = 0; alist != NULL && i < LIST_SIZE(alist); ++i) {
353 gmlattr *const ap = LIST_GET(alist, i);
354 deparseAttr (ap, xb);
355 agxbputc (xb, ' ');
356 }
357 agxbput (xb, "]");
358
359 }
360
361 static void
362 unknown (Agobj_t* obj, gmlattr* ap, agxbuf* xb)
363 {
364 char* str;
365
366 if (ap->kind == GML_LIST) {
367 deparseList (ap->u.lp, xb);
368 str = agxbuse (xb);
369 }
370 else
371 str = ap->u.value;
372
373 agsafeset (obj, ap->name, str, "");
374 }
375
376 static void addNodeLabelGraphics(Agnode_t *np, attrs_t *alist, agxbuf *unk) {
377 int cnt = 0;
378
379 if (!alist)
380 return;
381
382 for (size_t i = 0; i < LIST_SIZE(alist); ++i) {
383 gmlattr *const ap = LIST_GET(alist, i);
384 if (ap->sort == TEXT) {
385 agsafeset (np, "label", ap->u.value, "");
386 }
387 else if (ap->sort == COLOR) {
388 agsafeset (np, "fontcolor", ap->u.value, "");
389 }
390 else if (ap->sort == FONTSIZE) {
391 agsafeset (np, "fontsize", ap->u.value, "");
392 }
393 else if (ap->sort == FONTNAME) {
394 agsafeset (np, "fontname", ap->u.value, "");
395 }
396 else {
397 if (cnt)
398 agxbputc (unk, ' ');
399 else {
400 agxbput (unk, "[ ");
401 }
402 deparseAttr (ap, unk);
403 cnt++;
404 }
405 }
406
407 if (cnt) {
408 agxbput (unk, " ]");
409 agsafeset (np, "LabelGraphics", agxbuse (unk), "");
410 }
411 else
412 agxbclear (unk);
413 }
414
415 static void addEdgeLabelGraphics(Agedge_t *ep, attrs_t *alist, agxbuf *xb,
416 agxbuf *unk) {
417 char* x = "0";
418 char* y = "0";
419 int cnt = 0;
420
421 if (!alist)
422 return;
423
424 for (size_t i = 0; i < LIST_SIZE(alist); ++i) {
425 gmlattr *const ap = LIST_GET(alist, i);
426 if (ap->sort == TEXT) {
427 agsafeset (ep, "label", ap->u.value, "");
428 }
429 else if (ap->sort == COLOR) {
430 agsafeset (ep, "fontcolor", ap->u.value, "");
431 }
432 else if (ap->sort == FONTSIZE) {
433 agsafeset (ep, "fontsize", ap->u.value, "");
434 }
435 else if (ap->sort == FONTNAME) {
436 agsafeset (ep, "fontname", ap->u.value, "");
437 }
438 else if (ap->sort == XVAL) {
439 x = ap->u.value;
440 }
441 else if (ap->sort == YVAL) {
442 y = ap->u.value;
443 }
444 else {
445 if (cnt)
446 agxbputc (unk, ' ');
447 else {
448 agxbput (unk, "[ ");
449 }
450 deparseAttr (ap, unk);
451 cnt++;
452 }
453 }
454
455 agxbprint (xb, "%s,%s", x, y);
456 agsafeset (ep, "lp", agxbuse (xb), "");
457
458 if (cnt) {
459 agxbput (unk, " ]");
460 agsafeset (ep, "LabelGraphics", agxbuse (unk), "");
461 }
462 else
463 agxbclear (unk);
464 }
465
466 static void addNodeGraphics(Agnode_t *np, attrs_t *alist, agxbuf *xb,
467 agxbuf *unk) {
468 char* x = "0";
469 char* y = "0";
470 char buf[BUFSIZ];
471 double d;
472 int cnt = 0;
473
474 for (size_t i = 0; alist != NULL && i < LIST_SIZE(alist); ++i) {
475 gmlattr *const ap = LIST_GET(alist, i);
476 if (ap->sort == XVAL) {
477 x = ap->u.value;
478 }
479 else if (ap->sort == YVAL) {
480 y = ap->u.value;
481 }
482 else if (ap->sort == WVAL) {
483 d = atof (ap->u.value);
484 snprintf(buf, sizeof(buf), "%.04f", d/72.0);
485 agsafeset (np, "width", buf, "");
486 }
487 else if (ap->sort == HVAL) {
488 d = atof (ap->u.value);
489 snprintf(buf, sizeof(buf), "%.04f", d/72.0);
490 agsafeset (np, "height", buf, "");
491 }
492 else if (ap->sort == TYPE) {
493 agsafeset (np, "shape", ap->u.value, "");
494 }
495 else if (ap->sort == FILL) {
496 agsafeset (np, "color", ap->u.value, "");
497 }
498 else if (ap->sort == OUTLINE) {
499 agsafeset (np, "pencolor", ap->u.value, "");
500 }
501 else if (ap->sort == WIDTH || ap->sort == OUTLINEWIDTH) {
502 agsafeset (np, "penwidth", ap->u.value, "");
503 }
504 else if (ap->sort == STYLE || ap->sort == OUTLINESTYLE) {
505 agsafeset (np, "style", ap->u.value, "");
506 }
507 else {
508 if (cnt)
509 agxbputc (unk, ' ');
510 else {
511 agxbput (unk, "[ ");
512 }
513 deparseAttr (ap, unk);
514 cnt++;
515 }
516 }
517
518 agxbprint (xb, "%s,%s", x, y);
519 agsafeset (np, "pos", agxbuse (xb), "");
520
521 if (cnt) {
522 agxbput (unk, " ]");
523 agsafeset (np, "graphics", agxbuse (unk), "");
524 }
525 else
526 agxbclear (unk);
527 }
528
529 static void addEdgePoint(Agedge_t *ep, attrs_t *alist, agxbuf *xb) {
530 char* x = "0";
531 char* y = "0";
532
533 for (size_t i = 0; alist != NULL && i < LIST_SIZE(alist); ++i) {
534 gmlattr *const ap = LIST_GET(alist, i);
535 if (ap->sort == XVAL) {
536 x = ap->u.value;
537 }
538 else if (ap->sort == YVAL) {
539 y = ap->u.value;
540 }
541 else {
542 fprintf (stderr, "non-X/Y field in point attribute");
543 unknown ((Agobj_t*)ep, ap, xb);
544 }
545 }
546
547 if (agxblen(xb)) agxbputc (xb, ' ');
548 agxbprint (xb, "%s,%s", x, y);
549 }
550
551 static void addEdgePos(Agedge_t *ep, attrs_t *alist, agxbuf *xb) {
552 if (!alist) return;
553 for (size_t i = 0; i < LIST_SIZE(alist); ++i) {
554 gmlattr *const ap = LIST_GET(alist, i);
555 if (ap->sort == POINT) {
556 addEdgePoint (ep, ap->u.lp, xb);
557 }
558 else {
559 fprintf (stderr, "non-point field in line attribute");
560 unknown(&ep->base, ap, xb);
561 }
562 }
563 agsafeset (ep, "pos", agxbuse (xb), "");
564 }
565
566 static void addEdgeGraphics(Agedge_t *ep, attrs_t *alist, agxbuf *xb,
567 agxbuf *unk) {
568 int cnt = 0;
569
570 for (size_t i = 0; alist != NULL && i < LIST_SIZE(alist); ++i) {
571 gmlattr *const ap = LIST_GET(alist, i);
572 if (ap->sort == WIDTH) {
573 agsafeset (ep, "penwidth", ap->u.value, "");
574 }
575 else if (ap->sort == STYLE) {
576 agsafeset (ep, "style", ap->u.value, "");
577 }
578 else if (ap->sort == FILL) {
579 agsafeset (ep, "color", ap->u.value, "");
580 }
581 else if (ap->sort == LINE) {
582 addEdgePos (ep, ap->u.lp, xb);
583 }
584 else {
585 if (cnt)
586 agxbputc (unk, ' ');
587 else {
588 agxbput (unk, "[ ");
589 }
590 deparseAttr (ap, unk);
591 cnt++;
592 }
593 }
594
595 if (cnt) {
596 agxbput (unk, " ]");
597 agsafeset (ep, "graphics", agxbuse (unk), "");
598 }
599 else
600 agxbclear(unk);
601 }
602
603 static void addAttrs(Agobj_t *obj, attrs_t *alist, agxbuf *xb, agxbuf *unk) {
604 for (size_t i = 0; i < LIST_SIZE(alist); ++i) {
605 gmlattr *const ap = LIST_GET(alist, i);
606 if (ap->sort == GRAPHICS) {
607 if (AGTYPE(obj) == AGNODE)
608 addNodeGraphics ((Agnode_t*)obj, ap->u.lp, xb, unk);
609 else if (AGTYPE(obj) == AGEDGE)
610 addEdgeGraphics ((Agedge_t*)obj, ap->u.lp, xb, unk);
611 else
612 unknown (obj, ap, xb);
613 }
614 else if (ap->sort == LABELGRAPHICS) {
615 if (AGTYPE(obj) == AGNODE)
616 addNodeLabelGraphics ((Agnode_t*)obj, ap->u.lp, unk);
617 else if (AGTYPE(obj) == AGEDGE)
618 addEdgeLabelGraphics ((Agedge_t*)obj, ap->u.lp, xb, unk);
619 else
620 unknown (obj, ap, xb);
621 }
622 else
623 unknown (obj, ap, xb);
624 }
625 }
626
627 static Agraph_t *mkGraph(gmlgraph *graph, Agraph_t *parent, char *name,
628 agxbuf *xb, agxbuf *unk) {
629 Agraph_t* g;
630 Agnode_t* n;
631 Agnode_t* h;
632 Agedge_t* e;
633
634 if (parent) {
635 g = agsubg (parent, NULL, 1);
636 }
637 else if (graph->directed >= 1)
638 g = agopen (name, Agdirected, 0);
639 else
640 g = agopen (name, Agundirected, 0);
641
642 if (!parent && L) {
643 addAttrs(&g->base, L, xb, unk);
644 }
645 for (size_t i = 0; i < LIST_SIZE(&graph->nodelist); ++i) {
646 gmlnode *const np = LIST_GET(&graph->nodelist, i);
647 if (!np->id) {
648 fprintf (stderr, "node without an id attribute");
649 graphviz_exit (1);
650 }
651 n = agnode (g, np->id, 1);
652 addAttrs(&n->base, &np->attrlist, xb, unk);
653 }
654
655 for (size_t i = 0; i < LIST_SIZE(&graph->edgelist); ++i) {
656 gmledge *ep = LIST_GET(&graph->edgelist, i);
657 if (!ep->source) {
658 fprintf (stderr, "edge without an source attribute");
659 graphviz_exit (1);
660 }
661 if (!ep->target) {
662 fprintf (stderr, "node without an target attribute");
663 graphviz_exit (1);
664 }
665 n = agnode (g, ep->source, 1);
666 h = agnode (g, ep->target, 1);
667 e = agedge (g, n, h, NULL, 1);
668 addAttrs(&e->base, &ep->attrlist, xb, unk);
669 }
670 for (size_t i = 0; i < LIST_SIZE(&graph->graphlist); ++i) {
671 gmlgraph *const gp = LIST_GET(&graph->graphlist, i);
672 mkGraph (gp, g, NULL, xb, unk);
673 }
674
675 addAttrs(&g->base, &graph->attrlist, xb, unk);
676
677 return g;
678 }
679
680 Agraph_t*
681 gml_to_gv (char* name, FILE* fp, int cnt, int* errors)
682 {
683 Agraph_t* g;
684 int error;
685
686 if (cnt == 0)
687 initgmlscan(fp);
688 else
689 initgmlscan(0);
690
691 L = NULL;
692 pushAlist ();
693 gmlparse ();
694
695 error = gmlerrors();
696 *errors |= error;
697 if (!G || error)
698 g = NULL;
699 else {
700 agxbuf xb = {0};
701 agxbuf unk = {0};
702 g = mkGraph (G, NULL, name, &xb, &unk);
703 agxbfree (&xb);
704 agxbfree(&unk);
705 }
706
707 cleanup ();
708
709 return g;
710 }
711
712 static char *sortToStr(unsigned short sort) {
713 char* s;
714
715 switch (sort) {
716 case GRAPH :
717 s = "graph"; break;
718 case NODE :
719 s = "node"; break;
720 case EDGE :
721 s = "edge"; break;
722 case DIRECTED :
723 s = "directed"; break;
724 case ID :
725 s = "id"; break;
726 case SOURCE :
727 s = "source"; break;
728 case TARGET :
729 s = "target"; break;
730 case XVAL :
731 s = "xval"; break;
732 case YVAL :
733 s = "yval"; break;
734 case WVAL :
735 s = "wval"; break;
736 case HVAL :
737 s = "hval"; break;
738 case LABEL :
739 s = "label"; break;
740 case GRAPHICS :
741 s = "graphics"; break;
742 case LABELGRAPHICS :
743 s = "labelGraphics"; break;
744 case TYPE :
745 s = "type"; break;
746 case FILL :
747 s = "fill"; break;
748 case OUTLINE :
749 s = "outline"; break;
750 case OUTLINESTYLE :
751 s = "outlineStyle"; break;
752 case OUTLINEWIDTH :
753 s = "outlineWidth"; break;
754 case WIDTH :
755 s = "width"; break;
756 case STYLE :
757 s = "style"; break;
758 case LINE :
759 s = "line"; break;
760 case POINT :
761 s = "point"; break;
762 case TEXT :
763 s = "text"; break;
764 case FONTSIZE :
765 s = "fontSize"; break;
766 case FONTNAME :
767 s = "fontName"; break;
768 case COLOR :
769 s = "color"; break;
770 case INTEGER :
771 s = "integer"; break;
772 case REAL :
773 s = "real"; break;
774 case STRING :
775 s = "string"; break;
776 case NAME :
777 s = "name"; break;
778 case GML_LIST :
779 s = "list"; break;
780 case '[' :
781 s = "["; break;
782 case ']' :
783 s = "]"; break;
784 default :
785 s = NULL;break;
786 }
787
788 return s;
789 }