2
* Motif Tools Library, Version 3.1
5
* Written by David Flanagan.
6
* Copyright (c) 1992-2001 by David Flanagan.
7
* All Rights Reserved. See the file COPYRIGHT for details.
8
* This is open source software. See the file LICENSE for details.
9
* There is no warranty for this software. See NO_WARRANTY for details.
12
* Revision 1.1.1.1 2001/07/18 11:06:02 root
15
* Revision 1.2 2001/06/12 16:25:28 andre
16
* *** empty log message ***
22
#include <Xmt/ConvertersP.h>
23
#include <Xmt/Lexer.h>
24
#include <Xmt/LayoutP.h>
27
* we use this structure to accumulate information about rows, columns,
28
* and other things that we'll be creating while parsing the layout
29
* string. This info never has to leave the parser.
36
XmtLayoutSpaceType space_type;
42
/* tokens for the parser */
101
static String keywords[] = {
159
#define GetToken() XmtLexerGetToken(lw->layout.lexer)
160
#define NextToken() XmtLexerNextToken(lw->layout.lexer)
161
#define ConsumeToken() XmtLexerConsumeToken(lw->layout.lexer)
162
#define GetIntValue() XmtLexerIntValue(lw->layout.lexer)
163
#define GetKeyword() XmtLexerKeyValue(lw->layout.lexer)
164
#define GetStrValue() XmtLexerStrValue(lw->layout.lexer)
165
#define GetStrLength() XmtLexerStrLength(lw->layout.lexer)
167
#if NeedFunctionPrototypes
168
static int ParsePixelSize(XmtLayoutWidget lw)
170
static int ParsePixelSize(lw)
174
XmtLexerToken tok = GetToken();
175
double total, fraction;
177
/* parse optional integer part */
178
if (tok == XmtLexerInteger) {
179
total = (double) GetIntValue();
185
/* parse optional fractional part */
186
if (GetToken() == XmtLexerPeriod) {
188
if (GetToken() == XmtLexerInteger) {
189
fraction = (double) GetIntValue();
191
while(fraction > 1.0) fraction = fraction / 10.0;
196
/* parse optional units */
197
if (GetToken() == XmtLexerKeyword) {
198
XmtLayoutUnitType units;
200
switch(GetKeyword()) {
201
case INCHES: units = XmtLayoutInches; break;
202
case MILLIMETERS: units = XmtLayoutMillimeters; break;
203
case POINTS: units = XmtLayoutPoints; break;
204
case EMS: units = XmtLayoutEms; break;
205
case ENS: units = XmtLayoutEns; break;
206
default: return (int) total;
210
return XmtLayoutConvertSizeToPixels((Widget)lw, total, units);
216
#if NeedFunctionPrototypes
217
static void ParseSpace(XmtLayoutWidget lw, XmtLayoutLocalInfo *li)
219
static void ParseSpace(lw, li)
221
XmtLayoutLocalInfo *li;
224
switch(GetKeyword()) {
227
li->space_type = XmtLayoutSpaceEven;
230
li->space_type = XmtLayoutSpaceLREven;
233
li->space_type = XmtLayoutSpaceInterval;
236
li->space_type = XmtLayoutSpaceLCR;
239
li->space_type = XmtLayoutSpaceLTabbed;
242
li->space_type = XmtLayoutSpaceCTabbed;
245
li->space_type = XmtLayoutSpaceRTabbed;
249
if (NextToken() == XmtLexerInteger)
250
li->space = ParsePixelSize(lw);
252
if (GetToken() == XmtLexerPlus) {
253
if (NextToken() != XmtLexerInteger)
254
XmtWarningMsg("XmtLayout", "space0",
255
"Widget '%s':\n\tinteger expected following '+' in space specification",
258
li->space_stretch = GetIntValue();
260
if (NextToken() == XmtLexerSlash) {
261
if (NextToken() != XmtLexerInteger)
262
XmtWarningMsg("XmtLayout", "space1",
263
"Widget '%s':\n\tinteger expected following '/' in space specification",
266
li->item_stretch = GetIntValue();
274
#if NeedFunctionPrototypes
275
static void ParseCaption(XmtLayoutWidget lw, XmtLayoutInfo *i)
277
static void ParseCaption(lw, i)
285
if (GetToken() == XmtLexerIdent) {
286
args = GetStrValue();
289
i->dummy_constraints.caption_position = 1;
292
i->constraints.caption_position = XmtLayoutLeft;
295
i->constraints.caption_position = XmtLayoutRight;
298
i->constraints.caption_position = XmtLayoutTop;
301
i->constraints.caption_position = XmtLayoutBottom;
304
XmtWarningMsg("XmtLayout", "caption0",
305
"Widget '%s':Unknown caption position '%c' in layout string.\n\tl, r, t, or b expected.",
306
XtName((Widget)lw), args[0]);
307
i->dummy_constraints.caption_position = 0;
312
if (args[0] && args[1]) {
313
i->dummy_constraints.caption_justification = 1;
317
i->constraints.caption_justification=XmtLayoutFlushLeft;
321
i->constraints.caption_justification=XmtLayoutFlushRight;
324
i->constraints.caption_justification=XmtLayoutCentered;
327
XmtWarningMsg("XmtLayout", "caption1",
328
"Widget '%s':Unknown caption justification '%c' in layout string.\n\tl, r, t, b, or c expected.",
329
XtName((Widget)lw), args[1]);
330
i->dummy_constraints.caption_justification = 0;
335
if (args[0] && args[1] && args[2]) {
336
i->dummy_constraints.caption_alignment = 1;
339
i->constraints.caption_alignment = XmALIGNMENT_BEGINNING;
342
i->constraints.caption_alignment = XmALIGNMENT_END;
345
i->constraints.caption_alignment = XmALIGNMENT_CENTER;
348
XmtWarningMsg("XmtLayout", "caption2",
349
"Widget '%s': Unknown caption alignment '%c' in layout string.\n\tl, r, or c expected.",
350
XtName((Widget)lw), args[2]);
351
i->dummy_constraints.caption_alignment = 0;
360
if (GetToken() == XmtLexerInteger) {
361
i->dummy_constraints.caption_margin = 1;
362
i->constraints.caption_margin = GetIntValue();
366
if (GetToken() == XmtLexerString) {
367
i->dummy_constraints.caption = (XmString)1;
368
i->constraints.caption = XmtCreateLocalizedXmString((Widget) lw, GetStrValue());
369
i->constraints.dont_copy_caption = 1;
370
XtFree(GetStrValue());
374
XmtWarningMsg("XmtLayout", "caption3",
375
"Widget '%s': string expected following 'Caption' keyword.",
379
#if NeedFunctionPrototypes
380
static void ParseMargin(XmtLayoutWidget lw, XmtLayoutInfo *i)
382
static void ParseMargin(lw, i)
387
Boolean width = True;
388
Boolean height = True;
391
if (GetToken() == XmtLexerKeyword){
392
if (GetKeyword() == WIDTH) height = False;
393
else if (GetKeyword() == HEIGHT) width = False;
398
if (GetToken() == XmtLexerInteger) {
400
i->dummy_constraints.margin_width = 1;
401
i->constraints.margin_width = GetIntValue();
404
i->dummy_constraints.margin_height = 1;
405
i->constraints.margin_height = GetIntValue();
415
XmtWarningMsg("XmtLayout", "margin",
416
"Widget '%s':\n\t'Width', 'Height', or integer expected following 'Margin' keyword.",
420
#if NeedFunctionPrototypes
421
static void ParseFrame(XmtLayoutWidget lw, XmtLayoutInfo *i)
423
static void ParseFrame(lw, i)
430
i->dummy_constraints.frame_line_type = 1;
431
i->dummy_constraints.frame_type = 1;
432
type = XmtLayoutFrameBox;
434
switch(GetKeyword()) {
435
case SHADOWED: linetype = XmtLayoutFrameShadowIn; break;
437
case ETCHED: linetype = XmtLayoutFrameEtchedIn; break;
439
case BOXED: linetype = XmtLayoutFrameSingleLine; break;
441
case DOUBLEBOXED: linetype = XmtLayoutFrameDoubleLine; break;
445
if (GetToken() == XmtLexerKeyword) {
446
if (GetKeyword() == OUT) {
447
if (linetype == XmtLayoutFrameShadowIn)
448
linetype = XmtLayoutFrameShadowOut;
449
else if (linetype == XmtLayoutFrameEtchedIn)
450
linetype = XmtLayoutFrameEtchedOut;
453
else if (GetKeyword() == IN) ConsumeToken();
455
i->constraints.frame_line_type = linetype;
457
if (GetToken() == XmtLexerKeyword) {
458
switch(GetKeyword()) {
460
type = XmtLayoutFrameLeft; break;
462
type = XmtLayoutFrameRight; break;
464
type = XmtLayoutFrameTop; break;
466
type = XmtLayoutFrameBottom; break;
468
if (type != XmtLayoutFrameBox) ConsumeToken();
471
i->constraints.frame_type = type;
473
if (GetToken() == XmtLexerKeyword) {
474
i->dummy_constraints.frame_position = 1;
475
if (GetKeyword() == INSIDE)
476
i->constraints.frame_position = XmtLayoutFrameInside;
477
else if (GetKeyword() == OUTSIDE)
478
i->constraints.frame_position = XmtLayoutFrameOutside;
479
else if (GetKeyword() == THROUGH)
480
i->constraints.frame_position = XmtLayoutFrameThrough;
482
i->dummy_constraints.frame_position = 0;
484
if (i->dummy_constraints.frame_position) ConsumeToken();
487
if (GetToken() == XmtLexerInteger) {
488
i->dummy_constraints.frame_margin = 1;
489
i->constraints.frame_margin = GetIntValue();
491
if (GetToken() == XmtLexerInteger) {
492
i->dummy_constraints.frame_thickness = 1;
493
i->constraints.frame_thickness = GetIntValue();
500
#if NeedFunctionPrototypes
501
static void ParseModifiers(XmtLayoutWidget lw,
502
XmtLayoutInfo *i, XmtLayoutLocalInfo *li)
504
static void ParseModifiers(lw, i, li)
507
XmtLayoutLocalInfo *li;
515
if ((tok == XmtLexerInteger) || (tok == XmtLexerPeriod)) {
516
size = ParsePixelSize(lw);
518
if ((GetToken() == XmtLexerKeyword) &&
519
((GetKeyword() == WIDE) || (GetKeyword() == HIGH))) {
520
if (GetKeyword() == WIDE) {
521
i->dummy_constraints.width = 1;
522
i->constraints.width = size;
525
else if (GetKeyword() == HIGH) {
526
i->dummy_constraints.height = 1;
527
i->constraints.height = size;
531
else if (GetToken() == XmtLexerPercent) {
532
i->dummy_constraints.width = 1;
533
i->constraints.width = size;
535
if (GetToken() == XmtLexerInteger) {
536
i->dummy_constraints.height = 1;
537
i->constraints.height = ParsePixelSize(lw);
539
else XmtWarningMsg("XmtLayout", "size",
540
"%s: number must follow '%%' in layout string.",
543
else { /* a size alone is always assumed to be a width */
544
i->dummy_constraints.width = 1;
545
i->constraints.width = size;
548
else if (tok == XmtLexerPlus) {
550
if ((GetToken() == XmtLexerInteger) ||
551
(GetToken() == XmtLexerPeriod)) {
552
i->dummy_constraints.stretchability = 1;
553
i->constraints.stretchability = ParsePixelSize(lw);
555
else XmtWarningMsg("XmtLayout", "stretch",
556
"%s: number must follow '+' in layout string.",
559
else if (tok == XmtLexerMinus) {
561
if ((GetToken() == XmtLexerInteger) ||
562
(GetToken() == XmtLexerPeriod)) {
563
i->dummy_constraints.shrinkability = 1;
564
i->constraints.shrinkability = ParsePixelSize(lw);
566
else XmtWarningMsg("XmtLayout", "shrink",
567
"%s: number must follow '-' in layout string.",
570
else if (tok == XmtLexerKeyword) {
571
Boolean dont_consume = False;
572
switch(GetKeyword()) {
574
i->dummy_constraints.stretchability = 1;
575
i->dummy_constraints.shrinkability = 1;
576
i->constraints.stretchability = 0;
577
i->constraints.shrinkability = 0;
580
i->dummy_constraints.stretchability = 1;
581
i->dummy_constraints.shrinkability = 1;
582
i->constraints.stretchability = INFINITY;
583
i->constraints.shrinkability = INFINITY;
617
li->unmanaged = True;
620
i->dummy_constraints.justification = 1;
621
i->constraints.justification = XmtLayoutFilled;
624
i->dummy_constraints.justification = 1;
625
i->constraints.justification = XmtLayoutCentered;
629
i->dummy_constraints.justification = 1;
630
i->constraints.justification = XmtLayoutFlushLeft;
634
i->dummy_constraints.justification = 1;
635
i->constraints.justification = XmtLayoutFlushRight;
638
i->dummy_constraints.allow_resize = 1;
639
i->constraints.allow_resize = False;
643
if (GetToken() != XmtLexerString) {
644
XmtWarningMsg("XmtLayout", "color",
645
"%s: color name expected after Color keyword.",
650
from.addr = GetStrValue();
651
from.size = GetStrLength()+1;
652
to.addr = (XPointer) &li->color;
653
to.size = sizeof(Pixel);
654
if (XtConvertAndStore((Widget)lw,
655
XtRString, &from, XtRPixel, &to))
656
li->color_set = True;
657
XtFree(GetStrValue());
665
if (!dont_consume) ConsumeToken();
672
#if NeedFunctionPrototypes
673
static void GetArgList(XmtLayoutInfo *i, XmtLayoutLocalInfo *li,
674
WidgetClass wclass, ArgList al, Cardinal *count)
676
static void GetArgList(i, li, wclass, al, count)
678
XmtLayoutLocalInfo *li;
684
Cardinal ac = *count;
686
#define SetArg(resource, field)\
687
if (i->dummy_constraints.field) {\
688
XtSetArg(al[ac], resource, i->constraints.field);\
692
SetArg(XmtNlayoutWidth, width);
693
SetArg(XmtNlayoutHeight, height);
694
SetArg(XmtNlayoutStretchability, stretchability);
695
SetArg(XmtNlayoutShrinkability, shrinkability);
696
SetArg(XmtNlayoutAllowResize, allow_resize);
697
SetArg(XmtNlayoutJustification, justification);
698
SetArg(XmtNlayoutMarginWidth, margin_width);
699
SetArg(XmtNlayoutMarginHeight, margin_height);
700
SetArg(XmtNlayoutFrameType, frame_type);
701
SetArg(XmtNlayoutFrameLineType, frame_line_type);
702
SetArg(XmtNlayoutFramePosition, frame_position);
703
SetArg(XmtNlayoutFrameMargin, frame_margin);
704
SetArg(XmtNlayoutFrameThickness, frame_thickness);
705
SetArg(XmtNlayoutCaption, caption);
706
SetArg(XmtNlayoutCaptionPosition, caption_position);
707
SetArg(XmtNlayoutCaptionJustification, caption_justification);
708
SetArg(XmtNlayoutCaptionAlignment, caption_alignment);
709
SetArg(XmtNlayoutCaptionMargin, caption_margin);
712
if (wclass == xmtLayoutBoxGadgetClass) {
714
XtSetArg(al[ac], XmtNequal, True); ac++;
717
if (li->space_type != XmtLayoutSpaceNone) {
718
XtSetArg(al[ac], XmtNspaceType, li->space_type); ac++;
721
if (li->space != 0) {
722
XtSetArg(al[ac], XmtNspace, li->space); ac++;
725
if (li->space_stretch != 1) {
726
XtSetArg(al[ac], XmtNspaceStretch, li->space_stretch); ac++;
729
if (li->item_stretch != 1) {
730
XtSetArg(al[ac], XmtNitemStretch, li->item_stretch);
737
if (wclass == xmtLayoutBoxGadgetClass)
738
XtSetArg(al[ac], XmtNbackground, li->color);
740
XtSetArg(al[ac], XmtNforeground, li->color);
747
#if NeedFunctionPrototypes
748
static void ParseName(XmtLayoutWidget lw, XmtLayoutInfo *i)
750
static void ParseName(lw, i)
755
if (GetToken() == XmtLexerIdent) {
756
i->name = XrmStringToQuark(GetStrValue());
757
XtFree(GetStrValue());
762
#if NeedFunctionPrototypes
763
static Boolean ParseItem(XmtLayoutWidget lw, Widget container)
765
static Boolean ParseItem(lw, container)
770
XmtLexerToken tok = GetToken();
772
XmtLayoutLocalInfo li;
777
Boolean named_child = False;
778
XtPointer child_type = NULL;
779
String child_name = NULL;
783
if ((tok == XmtLexerEndOfString) || (tok == XmtLexerError)) return False;
785
i = (XmtLayoutInfo *) XtCalloc(1, sizeof(XmtLayoutInfo));
787
/* set "local info" field to their defaults */
788
li.unmanaged = False;
790
li.color_set = False;
791
li.space_type = XmtLayoutSpaceNone;
793
li.space_stretch = 1;
797
* any item can have any modifiers, though some are overridden or ignored
799
ParseModifiers(lw, i, &li);
808
wclass = xmtLayoutSeparatorGadgetClass;
809
XtSetArg(al[ac], XmtNorientation, XmVERTICAL); ac++;
814
wclass = xmtLayoutSeparatorGadgetClass;
815
XtSetArg(al[ac], XmtNorientation, XmHORIZONTAL); ac++;
819
wclass = xmtLayoutStringGadgetClass;
820
label = GetStrValue();
821
XtSetArg(al[ac], XmtNlabel, label); ac++;
825
wclass = xmtLayoutSpaceGadgetClass;
827
for(j=1; GetToken() == XmtLexerSharp; j++) ConsumeToken();
828
i->constraints.width = i->constraints.height =
829
j*lw->layout.default_spacing;
830
i->constraints.stretchability = 0;
831
i->constraints.shrinkability = 0;
832
i->dummy_constraints.width = i->dummy_constraints.height = 1;
833
i->dummy_constraints.stretchability = 1;
834
i->dummy_constraints.shrinkability = 1;
836
case XmtLexerTwiddle:
837
wclass = xmtLayoutSpaceGadgetClass;
839
for(j=1; GetToken() == XmtLexerTwiddle; j++) ConsumeToken();
840
i->constraints.width = 0;
841
i->constraints.height = 0;
842
i->constraints.stretchability = j*XmtLAYOUT_DEFAULT_STRETCHABILITY;
843
i->constraints.shrinkability = 0;
844
i->dummy_constraints.width = i->dummy_constraints.height = 1;
845
i->dummy_constraints.stretchability = 1;
846
i->dummy_constraints.shrinkability = 1;
850
for(j=1; GetToken() == XmtLexerMinus; j++) ConsumeToken();
851
if (GetToken() != XmtLexerGreater)
852
XmtWarningMsg("XmtLayout", "greater",
853
"%s: '>' expected after '<' in layout string.",
857
wclass = xmtLayoutSpaceGadgetClass;
858
i->constraints.width = 0;
859
i->constraints.height = 0;
860
i->constraints.stretchability = j*INFINITY;
861
i->constraints.shrinkability = 0;
862
i->dummy_constraints.width = i->dummy_constraints.height = 1;
863
i->dummy_constraints.stretchability = 1;
864
i->dummy_constraints.shrinkability = 1;
867
/* get type and name to create, or just a name */
868
if ((xmtLayoutClassRec.layout_class.lookup_type_proc) &&
869
(child_type = (*xmtLayoutClassRec.layout_class.lookup_type_proc)
871
XtFree(GetStrValue());
873
if (GetToken() != XmtLexerIdent) {
874
XmtWarningMsg("XmtLayout", "create",
875
"Widget '%s':\n\twidget name expected following widget type in layout string.",
880
child_name = GetStrValue();
885
named_child = True; /* a child that will be created later */
886
i->name = XrmStringToQuark(GetStrValue());
887
XtFree(GetStrValue());
891
case XmtLexerKeyword:
892
switch (GetKeyword()) {
894
wclass = xmtLayoutBoxGadgetClass;
897
XtSetArg(al[ac], XmtNorientation, XmHORIZONTAL); ac++;
900
wclass = xmtLayoutBoxGadgetClass;
903
XtSetArg(al[ac], XmtNorientation, XmVERTICAL); ac++;
906
wclass = xmtLayoutSpaceGadgetClass;
913
case STRING: /* string keyword, not XmtLexerString token */
916
if (GetToken() != XmtLexerString) {
917
XmtWarningMsg("XmtLayout", "string",
918
"%s: string must follow String keyword",
926
if (GetKeyword() == PIXMAP) is_bitmap = False;
927
else is_bitmap = True;
928
wclass = xmtLayoutPixmapGadgetClass;
931
if (GetToken() != XmtLexerString) {
932
XmtWarningMsg("XmtLayout", "pixmap",
933
"%s: string must follow Pixmap or Bitmap keyword.",
938
from.addr = GetStrValue();
939
from.size = GetStrLength()+1;
940
al[ac].name = (is_bitmap)?XmtNbitmap:XmtNpixmap;
941
to.addr = (XPointer) &al[ac].value;
942
to.size = sizeof(Pixel);
943
if (XtConvertAndStore((Widget)lw,
945
(is_bitmap)?XtRBitmap:XtRPixmap,
948
XtFree(GetStrValue());
952
* Now, look for ` , "mask_name"' to set the XmtNbitmask
955
if (GetToken() == XmtLexerComma) {
956
if (NextToken() != XmtLexerString) {
957
XmtWarningMsg("XmtLayout", "pixmap",
958
"%s: mask name must follow comma in Pixmap or Bitmap specification.",
963
from.addr = GetStrValue();
964
from.size = GetStrLength()+1;
965
al[ac].name = XmtNbitmask;
966
to.addr = (XPointer) &al[ac].value;
967
to.size = sizeof(Pixel);
968
if (XtConvertAndStore((Widget)lw,
973
XtFree(GetStrValue());
980
XmtWarningMsg("XmtLayout", "keyword",
981
"Widget %s:\n\tunexpected keyword '%s' in layout string.",
982
XtName((Widget)lw), GetStrValue());
987
case XmtLexerEndOfString:
988
XmtWarningMsg("XmtLayout", "end",
989
"%s: unexpected end of layout string.",
993
XmtWarningMsg("XmtLayout", "syntax",
994
"%s: syntax error in layout string.",XtName((Widget)lw));
999
if (named_child) { /* a widget to be created later */
1002
/* create a gadget to mark the position of the widget */
1003
marker = XtVaCreateWidget("", xmtLayoutSpaceGadgetClass, (Widget)lw,
1004
XmtNlayoutIn, container, NULL);
1006
/* store the constraint info away for later lookup */
1007
/* this is special; we don't set dummy_constraints */
1008
i->constraints.after = marker;
1009
i->next = lw->layout.widget_info;
1010
lw->layout.widget_info = i;
1012
else { /* a typed widget or a layout gadget to create now */
1015
/* set position arg, get constraint args, and create the child */
1016
XtSetArg(al[ac], XmtNlayoutIn, container); ac++;
1017
GetArgList(i, &li, wclass, al, &ac);
1019
w = (*xmtLayoutClassRec.layout_class.create_proc)
1020
(child_name, child_type, (Widget)lw, al, ac);
1023
else if (wclass != NULL)
1024
w = XtCreateWidget((i->name)?XrmQuarkToString(i->name):"",
1025
wclass, (Widget)lw, al, ac);
1027
/* if it is a row or column, parse its children */
1028
if (wclass == xmtLayoutBoxGadgetClass) { /* a row or column */
1029
if (GetToken() != XmtLexerLBrace) {
1030
XmtWarningMsg("XmtLayout", "open",
1031
"%s: '{' expected at beginning of row.",
1032
XtName((Widget)lw));
1036
while ((tok = GetToken())) {
1037
if ((tok == XmtLexerRBrace) || (tok == XmtLexerError) ||
1038
(tok == XmtLexerEndOfString)) break;
1039
if (!ParseItem(lw, w)) {
1040
/* error recovery: read till '}' or end of string */
1041
while(tok != XmtLexerEndOfString &&
1042
tok != XmtLexerRBrace)
1049
if (GetToken() != XmtLexerRBrace) {
1050
XmtWarningMsg("XmtLayout", "close",
1051
"%s: '}' expected at end of row.",
1052
XtName((Widget)lw));
1054
else ConsumeToken();
1057
/* manage it unless specified otherwise */
1058
if (w && !li.unmanaged) XtManageChild(w);
1060
/* free our info structure */
1063
if (label) XtFree(label);
1067
if (i->constraints.caption) XmStringFree(i->constraints.caption);
1069
if (label) XtFree(label);
1073
#if NeedFunctionPrototypes
1074
static void XmtLayoutParse(XmtLayoutWidget lw, String str)
1076
static void XmtLayoutParse(lw, str)
1083
lw->layout.lexer = XmtLexerCreate(keywords, XtNumber(keywords));
1084
XmtLexerInit(lw->layout.lexer, str);
1088
if ((tok == XmtLexerEndOfString) || (tok == XmtLexerError)) break;
1089
/* NULL means place items in the toplevel container */
1090
if (!ParseItem(lw, NULL)) break;
1093
if (tok == XmtLexerError)
1094
XmtWarningMsg("XmtLayout", "syntax", "%s: syntax error.",
1095
XtName((Widget)lw));
1097
XmtLexerDestroy(lw->layout.lexer);
1100
#if NeedFunctionPrototypes
1101
void XmtRegisterLayoutParser(void)
1103
void XmtRegisterLayoutParser()
1106
xmtLayoutClassRec.layout_class.parser = XmtLayoutParse;