/* Validating XML processor for skin.dtd.
 * Generated 2004/01/03 15:23:36.
 *
 * This program was generated with the FleXML XML processor generator,
 * (Id: flexml.pl,v 1.24 1999/12/13 16:18:30 krisrose Exp).
 * Copyright © 1999 Kristoffer Rose.  All rights reserved.
 *
 * You can redistribute and/or modify this program provided the following
 * two conditions hold:
 *
 * 1. The program is distributed WITHOUT ANY WARRANTY from the author of
 *    FleXML; without even the implied warranty of MERCHANTABILITY or
 *    FITNESS FOR A PARTICULAR PURPOSE.
 *
 * 2. The program distribution conditions do not in any way affect the
 *    distribution conditions of the FleXML system used to generate this
 *    file or any version of FleXML derived from that system.
 *
 * Notice that these are explicit rights granted to you for files
 * generated by the FleXML system.  For your rights in connection with
 * the FleXML system itself please consult the GNU General Public License.
 */

%{

/* Version strings. */
const char rcs_flexml_skeleton[] =
 "$" "Id: skel,v 1.16 1999/12/09 04:01:51 krisrose Exp $";
const char rcs_flexml[] =
 "$" "Id: flexml.pl,v 1.24 1999/12/13 16:18:30 krisrose Exp $";

/* ANSI headers. */
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <stdarg.h>
#include <ctype.h>

/* Generated definitions. */
#define FLEXML_BUFFERSTACKSIZE 100000

/* XML processor api. */
#include "skin.h"

/* FleXML-provided data. */
char* pcdata;
AT_Text_id A_Text_id;
AT_ThemeInfo_author A_ThemeInfo_author;
AT_Playlist_fgcolor A_Playlist_fgcolor;
AT_CheckBox_down2 A_CheckBox_down2;
AT_Image_lefttop A_Image_lefttop;
AT_Slider_visible A_Slider_visible;
AT_CheckBox_down1 A_CheckBox_down1;
AT_Image_rightbottom A_Image_rightbottom;
AT_Event_id A_Event_id;
AT_Rectangle_h A_Rectangle_h;
AT_Slider_lefttop A_Slider_lefttop;
AT_Slider_over A_Slider_over;
AT_Window_id A_Window_id;
AT_Theme_alpha A_Theme_alpha;
AT_Text_text A_Text_text;
AT_Playlist_rightbottom A_Playlist_rightbottom;
AT_Event_event A_Event_event;
AT_Slider_value A_Slider_value;
AT_Font_underline A_Font_underline;
AT_Image_onclick A_Image_onclick;
AT_Anchor_priority A_Anchor_priority;
AT_Font_italic A_Font_italic;
AT_Button_y A_Button_y;
AT_RadialSlider_sequence A_RadialSlider_sequence;
AT_Playlist_var A_Playlist_var;
AT_CheckBox_y A_CheckBox_y;
AT_Window_playondrop A_Window_playondrop;
AT_RadialSlider_minangle A_RadialSlider_minangle;
AT_RadialSlider_visible A_RadialSlider_visible;
AT_Playlist_playcolor A_Playlist_playcolor;
AT_Anchor_range A_Anchor_range;
AT_Theme_fadetime A_Theme_fadetime;
AT_CheckBox_x A_CheckBox_x;
AT_Bitmap_file A_Bitmap_file;
AT_Slider_down A_Slider_down;
AT_CheckBox_over2 A_CheckBox_over2;
AT_Slider_y A_Slider_y;
AT_Slider_id A_Slider_id;
AT_Window_dragdrop A_Window_dragdrop;
AT_Text_x A_Text_x;
AT_Image_y A_Image_y;
AT_Font_color A_Font_color;
AT_Slider_rightbottom A_Slider_rightbottom;
AT_Group_y A_Group_y;
AT_Text_font A_Text_font;
AT_Button_over A_Button_over;
AT_Theme_version A_Theme_version;
AT_Image_id A_Image_id;
AT_CheckBox_lefttop A_CheckBox_lefttop;
AT_Text_scrollspace A_Text_scrollspace;
AT_Button_action A_Button_action;
AT_Button_lefttop A_Button_lefttop;
AT_Button_id A_Button_id;
AT_Rectangle_visible A_Rectangle_visible;
AT_Rectangle_color A_Rectangle_color;
AT_Playlist_width A_Playlist_width;
AT_RadialSlider_maxangle A_RadialSlider_maxangle;
AT_Window_y A_Window_y;
AT_Slider_help A_Slider_help;
AT_Text_width A_Text_width;
AT_Slider_points A_Slider_points;
AT_CheckBox_up1 A_CheckBox_up1;
AT_Theme_magnet A_Theme_magnet;
AT_Theme_movealpha A_Theme_movealpha;
AT_RadialSlider_lefttop A_RadialSlider_lefttop;
AT_Button_up A_Button_up;
AT_RadialSlider_y A_RadialSlider_y;
AT_CheckBox_action1 A_CheckBox_action1;
AT_Playlist_id A_Playlist_id;
AT_Text_align A_Text_align;
AT_CheckBox_tooltiptext1 A_CheckBox_tooltiptext1;
AT_Group_x A_Group_x;
AT_Text_display A_Text_display;
AT_Bitmap_id A_Bitmap_id;
AT_Playlist_y A_Playlist_y;
AT_Text_scroll A_Text_scroll;
AT_Playlist_lefttop A_Playlist_lefttop;
AT_Rectangle_x A_Rectangle_x;
AT_Layout_minheight A_Layout_minheight;
AT_Button_rightbottom A_Button_rightbottom;
AT_Slider_thickness A_Slider_thickness;
AT_RadialSlider_tooltiptext A_RadialSlider_tooltiptext;
AT_RadialSlider_value A_RadialSlider_value;
AT_Text_visible A_Text_visible;
AT_Slider_tooltiptext A_Slider_tooltiptext;
AT_Rectangle_onclick A_Rectangle_onclick;
AT_Layout_width A_Layout_width;
AT_Rectangle_help A_Rectangle_help;
AT_CheckBox_tooltiptext2 A_CheckBox_tooltiptext2;
AT_Layout_maxheight A_Layout_maxheight;
AT_RadialSlider_help A_RadialSlider_help;
AT_Playlist_font A_Playlist_font;
AT_Rectangle_id A_Rectangle_id;
AT_CheckBox_help A_CheckBox_help;
AT_Image_help A_Image_help;
AT_Playlist_bgcolor1 A_Playlist_bgcolor1;
AT_Bitmap_alphacolor A_Bitmap_alphacolor;
AT_Image_image A_Image_image;
AT_Font_id A_Font_id;
AT_Button_x A_Button_x;
AT_CheckBox_id A_CheckBox_id;
AT_Layout_id A_Layout_id;
AT_Event_key A_Event_key;
AT_CheckBox_over1 A_CheckBox_over1;
AT_Slider_up A_Slider_up;
AT_Layout_minwidth A_Layout_minwidth;
AT_CheckBox_rightbottom A_CheckBox_rightbottom;
AT_Anchor_x A_Anchor_x;
AT_Font_font A_Font_font;
AT_Layout_maxwidth A_Layout_maxwidth;
AT_Playlist_help A_Playlist_help;
AT_Playlist_visible A_Playlist_visible;
AT_Slider_x A_Slider_x;
AT_CheckBox_up2 A_CheckBox_up2;
AT_Text_help A_Text_help;
AT_CheckBox_action2 A_CheckBox_action2;
AT_CheckBox_state A_CheckBox_state;
AT_Font_size A_Font_size;
AT_ThemeInfo_webpage A_ThemeInfo_webpage;
AT_RadialSlider_x A_RadialSlider_x;
AT_Button_tooltiptext A_Button_tooltiptext;
AT_Image_visible A_Image_visible;
AT_Window_visible A_Window_visible;
AT_RadialSlider_id A_RadialSlider_id;
AT_Anchor_y A_Anchor_y;
AT_RadialSlider_nbimages A_RadialSlider_nbimages;
AT_Playlist_bgcolor2 A_Playlist_bgcolor2;
AT_Playlist_x A_Playlist_x;
AT_ThemeInfo_email A_ThemeInfo_email;
AT_Window_x A_Window_x;
AT_Button_down A_Button_down;
AT_Playlist_height A_Playlist_height;
AT_Layout_height A_Layout_height;
AT_ThemeInfo_name A_ThemeInfo_name;
AT_Button_help A_Button_help;
AT_Text_y A_Text_y;
AT_Rectangle_w A_Rectangle_w;
AT_Image_x A_Image_x;
AT_Rectangle_y A_Rectangle_y;
AT_Playlist_selcolor A_Playlist_selcolor;
AT_RadialSlider_rightbottom A_RadialSlider_rightbottom;

/* XML state. */
#ifdef FLEX_DEBUG
# define ENTER(state)	debug_enter(state,#state)
# define LEAVE		debug_leave()
# define SET(state)	debug_set(state,#state)
  static void debug_enter(int, char*);
  static void debug_leave(void);
  static void debug_set(int, char*);
#else
# define ENTER(state)	(yy_push_state(state))
# define LEAVE		(yy_pop_state())
# define SET(state)	BEGIN(state)
#endif

/* Generic actions. */
#define SKIP	/*skip*/
#define SUCCEED	return 0

#define FAIL	return fail
static int fail(const char*, ...);

/* Text buffer stack handling. */
char bufferstack[FLEXML_BUFFERSTACKSIZE];
char* limit = bufferstack + FLEXML_BUFFERSTACKSIZE;
typedef struct BufferLast_s {
  struct BufferLast_s *old; char* saved; char new[1];
} BufferLast;
BufferLast* last = (BufferLast*)0;
char* next = bufferstack;

#define BUFFERSET(P)  (P = next)
#define BUFFERPUTC(C) (assert(next<limit), *(next++) = (C))
#define BUFFERDONE    (BUFFERPUTC('\0'))

#define BUFFERLITERAL(C,P) bufferliteral(C,&(P),yytext)
static void bufferliteral(char c, char** pp, char* text)
{
  char *s = strchr(text,c), *e = strrchr(text,c);
  assert(s <= e); BUFFERSET(*pp);
  while (++s<e) {
    if (isspace(*s)) { BUFFERPUTC(' '); while (isspace(*s)) ++s; }
    else BUFFERPUTC(*s);
  } 
  BUFFERDONE;
}

#ifdef FLEXML_HasMixed
static void pushbuffer(char* p)
{
  BufferLast* l = (BufferLast*)next;
  assert(next < limit);
  l->old = last;
  l->saved = p;
  next = l->new;
  last = l;
}

static char* popbuffer(void)
{
  BufferLast* l = last;
  assert(last != (BufferLast*)0);
  last = l->old;
  next = (char*)l;
  return l->saved;
}
#endif

/* General internal entities are `unput' back onto the input stream... */
#define ENTITYTEXT(T) \
  { char *s = (T), *e = s+strlen(s);\
    while (--e >= s) { unput(*e); }}
%}

/* Flex standard options. */
%option stack
%option noyy_top_state
%option noinput
%option noreject
%option noyymore
%option noyywrap

/* Flex user-requested options. */
%option nounput

/* XML character classes (currently restricted to ASCII). */

/* "Common syntactic structures." */
S		[ \t\n\r\f]+
s		[ \t\n\r\f]*

/* "Names and Tokens." */
NameChar	[A-Za-z0-9.:_-]
Name		[A-Za-z_:]{NameChar}*
Names 		{Name}({S}{Name})*
Nmtoken		({NameChar})+
Nmtokens 	{Nmtoken}({S}{Nmtoken})*

/* Miscellaneous. */
VersionNum	[a-zA-Z0-9_.:-]+
Eq		{s}"="{s}
Literal		\'[^'']*\'|\"[^""]*\"

/* Parser states (flex `exclusive start conditions'):
 *
 * PROLOG	the XML prolog of the document before <?xml...>
 * DOCTYPE	the XML prolog of the document after <?xml...>
 * EPILOG	after the root element
 * INCOMMENT	inside an XML comment <!--....-->
 * INPI		inside an XML PI <?...?>
 * VALUE1	inside a '...'-delimited literal
 * VALUE2	inside a "..."-delimited literal
 * CDATA	inside a <![CDATA[...]]> section.
 * ROOT_<tag>	expect root element <tag>
 * AL_<tag>	inside the attribute list for <tag>
 * IN_<tag>	inside a <tag> with element contents (ready for end tag)
 * IMPOSSIBLE	dummy to permit disabling rules; must be last
 */
%x PROLOG DOCTYPE EPILOG INCOMMENT INPI VALUE1 VALUE2 CDATA
%x ROOT_Theme AL_Theme S_Theme S_Theme_1 S_Theme_2 S_Theme_3 E_Theme
%x ROOT_Bitmap AL_Bitmap E_Bitmap
%x ROOT_Event AL_Event E_Event
%x ROOT_Font AL_Font E_Font
%x ROOT_ThemeInfo AL_ThemeInfo E_ThemeInfo
%x ROOT_Window AL_Window S_Window S_Window_1 S_Window_2 E_Window
%x ROOT_Layout AL_Layout S_Layout E_Layout
%x ROOT_Group AL_Group S_Group S_Group_1 S_Group_2 E_Group
%x ROOT_Anchor AL_Anchor E_Anchor
%x ROOT_Image AL_Image E_Image
%x ROOT_Rectangle AL_Rectangle E_Rectangle
%x ROOT_Button AL_Button E_Button
%x ROOT_CheckBox AL_CheckBox E_CheckBox
%x ROOT_Slider AL_Slider E_Slider
%x ROOT_RadialSlider AL_RadialSlider E_RadialSlider
%x ROOT_Text AL_Text E_Text
%x ROOT_Playlist AL_Playlist S_Playlist E_Playlist
%x IMPOSSIBLE

%{
/* State names. */
char* statenames[IMPOSSIBLE];

void FleXML_init(void)
{
  statenames[PROLOG] = NULL;
  statenames[DOCTYPE] = NULL;
  statenames[EPILOG] = NULL;
  statenames[INCOMMENT] = NULL;
  statenames[INPI] = NULL;
  statenames[VALUE1] = NULL;
  statenames[VALUE2] = NULL;
  statenames[CDATA] = NULL;
  statenames[ROOT_Theme] = NULL;
  statenames[AL_Theme] = NULL;
  statenames[S_Theme] = "Theme";
  statenames[S_Theme_1] = "Theme";
  statenames[S_Theme_2] = "Theme";
  statenames[S_Theme_3] = "Theme";
  statenames[E_Theme] = "Theme";
  statenames[ROOT_Bitmap] = NULL;
  statenames[AL_Bitmap] = NULL;
  statenames[E_Bitmap] = "Bitmap";
  statenames[ROOT_Event] = NULL;
  statenames[AL_Event] = NULL;
  statenames[E_Event] = "Event";
  statenames[ROOT_Font] = NULL;
  statenames[AL_Font] = NULL;
  statenames[E_Font] = "Font";
  statenames[ROOT_ThemeInfo] = NULL;
  statenames[AL_ThemeInfo] = NULL;
  statenames[E_ThemeInfo] = "ThemeInfo";
  statenames[ROOT_Window] = NULL;
  statenames[AL_Window] = NULL;
  statenames[S_Window] = "Window";
  statenames[S_Window_1] = "Window";
  statenames[S_Window_2] = "Window";
  statenames[E_Window] = "Window";
  statenames[ROOT_Layout] = NULL;
  statenames[AL_Layout] = NULL;
  statenames[S_Layout] = "Layout";
  statenames[E_Layout] = "Layout";
  statenames[ROOT_Group] = NULL;
  statenames[AL_Group] = NULL;
  statenames[S_Group] = "Group";
  statenames[S_Group_1] = "Group";
  statenames[S_Group_2] = "Group";
  statenames[E_Group] = "Group";
  statenames[ROOT_Anchor] = NULL;
  statenames[AL_Anchor] = NULL;
  statenames[E_Anchor] = "Anchor";
  statenames[ROOT_Image] = NULL;
  statenames[AL_Image] = NULL;
  statenames[E_Image] = "Image";
  statenames[ROOT_Rectangle] = NULL;
  statenames[AL_Rectangle] = NULL;
  statenames[E_Rectangle] = "Rectangle";
  statenames[ROOT_Button] = NULL;
  statenames[AL_Button] = NULL;
  statenames[E_Button] = "Button";
  statenames[ROOT_CheckBox] = NULL;
  statenames[AL_CheckBox] = NULL;
  statenames[E_CheckBox] = "CheckBox";
  statenames[ROOT_Slider] = NULL;
  statenames[AL_Slider] = NULL;
  statenames[E_Slider] = "Slider";
  statenames[ROOT_RadialSlider] = NULL;
  statenames[AL_RadialSlider] = NULL;
  statenames[E_RadialSlider] = "RadialSlider";
  statenames[ROOT_Text] = NULL;
  statenames[AL_Text] = NULL;
  statenames[E_Text] = "Text";
  statenames[ROOT_Playlist] = NULL;
  statenames[AL_Playlist] = NULL;
  statenames[S_Playlist] = "Playlist";
  statenames[E_Playlist] = "Playlist";
}
%}

%%

 /* Bypass Flex's default INITIAL state and begin by parsing the XML prolog. */
 SET(PROLOG); FleXML_init();

 /* COMMENTS and PIs: handled uniformly for efficiency. */

<ROOT_Theme,AL_Theme,S_Theme,S_Theme_1,S_Theme_2,S_Theme_3,E_Theme,ROOT_Bitmap,AL_Bitmap,E_Bitmap,ROOT_Event,AL_Event,E_Event,ROOT_Font,AL_Font,E_Font,ROOT_ThemeInfo,AL_ThemeInfo,E_ThemeInfo,ROOT_Window,AL_Window,S_Window,S_Window_1,S_Window_2,E_Window,ROOT_Layout,AL_Layout,S_Layout,E_Layout,ROOT_Group,AL_Group,S_Group,S_Group_1,S_Group_2,E_Group,ROOT_Anchor,AL_Anchor,E_Anchor,ROOT_Image,AL_Image,E_Image,ROOT_Rectangle,AL_Rectangle,E_Rectangle,ROOT_Button,AL_Button,E_Button,ROOT_CheckBox,AL_CheckBox,E_CheckBox,ROOT_Slider,AL_Slider,E_Slider,ROOT_RadialSlider,AL_RadialSlider,E_RadialSlider,ROOT_Text,AL_Text,E_Text,ROOT_Playlist,AL_Playlist,S_Playlist,E_Playlist,PROLOG,DOCTYPE,EPILOG>{
 "<!--" ENTER(INCOMMENT);
 "<?" ENTER(INPI);
}
<INCOMMENT>{
 "-->"		LEAVE;
 "--"		|
 .		|
 \n		SKIP;
 <<EOF>>	FAIL("EOF in comment.");
}
<INPI>{
 "?>"		LEAVE;
 .		|
 \n		SKIP;
 <<EOF>>	FAIL("EOF in PI (processing instruction).");
}

 /* SPACES: skipped uniformly */

<ROOT_Theme,AL_Theme,S_Theme,S_Theme_1,S_Theme_2,S_Theme_3,E_Theme,ROOT_Bitmap,AL_Bitmap,E_Bitmap,ROOT_Event,AL_Event,E_Event,ROOT_Font,AL_Font,E_Font,ROOT_ThemeInfo,AL_ThemeInfo,E_ThemeInfo,ROOT_Window,AL_Window,S_Window,S_Window_1,S_Window_2,E_Window,ROOT_Layout,AL_Layout,S_Layout,E_Layout,ROOT_Group,AL_Group,S_Group,S_Group_1,S_Group_2,E_Group,ROOT_Anchor,AL_Anchor,E_Anchor,ROOT_Image,AL_Image,E_Image,ROOT_Rectangle,AL_Rectangle,E_Rectangle,ROOT_Button,AL_Button,E_Button,ROOT_CheckBox,AL_CheckBox,E_CheckBox,ROOT_Slider,AL_Slider,E_Slider,ROOT_RadialSlider,AL_RadialSlider,E_RadialSlider,ROOT_Text,AL_Text,E_Text,ROOT_Playlist,AL_Playlist,S_Playlist,E_Playlist,PROLOG,DOCTYPE,EPILOG>{S} SKIP;

 /* PROLOG: determine root element and process it. */

<PROLOG>{
 "<?xml"({S}version{Eq}(\'{VersionNum}\'|\"{VersionNum}\"))?"?>" SET(DOCTYPE);
 "<?xml"[^>]*">" FAIL("Bad declaration %s.",yytext);
}

<PROLOG,DOCTYPE>{
 "<!DOCTYPE"{S}"Layout"{S}SYSTEM{S}("'skin.dtd'"|"\"skin.dtd\""){s}">" SET(ROOT_Layout);
 "<!DOCTYPE"{S}"Event"{S}SYSTEM{S}("'skin.dtd'"|"\"skin.dtd\""){s}">" SET(ROOT_Event);
 "<!DOCTYPE"{S}"Image"{S}SYSTEM{S}("'skin.dtd'"|"\"skin.dtd\""){s}">" SET(ROOT_Image);
 "<!DOCTYPE"{S}"Playlist"{S}SYSTEM{S}("'skin.dtd'"|"\"skin.dtd\""){s}">" SET(ROOT_Playlist);
 "<!DOCTYPE"{S}"Text"{S}SYSTEM{S}("'skin.dtd'"|"\"skin.dtd\""){s}">" SET(ROOT_Text);
 "<!DOCTYPE"{S}"Rectangle"{S}SYSTEM{S}("'skin.dtd'"|"\"skin.dtd\""){s}">" SET(ROOT_Rectangle);
 "<!DOCTYPE"{S}"Anchor"{S}SYSTEM{S}("'skin.dtd'"|"\"skin.dtd\""){s}">" SET(ROOT_Anchor);
 "<!DOCTYPE"{S}"Group"{S}SYSTEM{S}("'skin.dtd'"|"\"skin.dtd\""){s}">" SET(ROOT_Group);
 "<!DOCTYPE"{S}"Theme"{S}SYSTEM{S}("'skin.dtd'"|"\"skin.dtd\""){s}">" SET(ROOT_Theme);
 "<!DOCTYPE"{S}"Font"{S}SYSTEM{S}("'skin.dtd'"|"\"skin.dtd\""){s}">" SET(ROOT_Font);
 "<!DOCTYPE"{S}"RadialSlider"{S}SYSTEM{S}("'skin.dtd'"|"\"skin.dtd\""){s}">" SET(ROOT_RadialSlider);
 "<!DOCTYPE"{S}"ThemeInfo"{S}SYSTEM{S}("'skin.dtd'"|"\"skin.dtd\""){s}">" SET(ROOT_ThemeInfo);
 "<!DOCTYPE"{S}"Slider"{S}SYSTEM{S}("'skin.dtd'"|"\"skin.dtd\""){s}">" SET(ROOT_Slider);
 "<!DOCTYPE"{S}"CheckBox"{S}SYSTEM{S}("'skin.dtd'"|"\"skin.dtd\""){s}">" SET(ROOT_CheckBox);
 "<!DOCTYPE"{S}"Button"{S}SYSTEM{S}("'skin.dtd'"|"\"skin.dtd\""){s}">" SET(ROOT_Button);
 "<!DOCTYPE"{S}"Bitmap"{S}SYSTEM{S}("'skin.dtd'"|"\"skin.dtd\""){s}">" SET(ROOT_Bitmap);
 "<!DOCTYPE"{S}"Window"{S}SYSTEM{S}("'skin.dtd'"|"\"skin.dtd\""){s}">" SET(ROOT_Window);
 "<!"[^>-][^>]*">" FAIL("Bad declaration %s.",yytext);
 . 		FAIL("Unexpected character `%c' in prolog.", yytext[0]);
 <<EOF>> 	FAIL("EOF in prolog.");
}

 /* RULES DERIVED FROM DTD. */

 /* <!--
  * -->  */

 /*         version     CDATA   "1.0"
  *         magnet      CDATA   "15"
  *         alpha       CDATA   "255"
  *         movealpha   CDATA   "255"
  *         fadetime    CDATA   "400"
  *     >  */

<ROOT_Theme>"<Theme"{s} {
  A_Theme_version = "1.0";
  A_Theme_magnet = "15";
  A_Theme_alpha = "255";
  A_Theme_movealpha = "255";
  A_Theme_fadetime = "400";
  ENTER(AL_Theme);
}

<AL_Theme>{
 "version"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Theme_version);
 "version"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Theme_version);

 "magnet"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Theme_magnet);
 "magnet"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Theme_magnet);

 "alpha"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Theme_alpha);
 "alpha"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Theme_alpha);

 "movealpha"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Theme_movealpha);
 "movealpha"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Theme_movealpha);

 "fadetime"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Theme_fadetime);
 "fadetime"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Theme_fadetime);

 ">" {
  LEAVE; STag_Theme(); pcdata = NULL; ENTER(S_Theme);
 }
 "/>" FAIL("`Theme' element cannot be empty.");
 .       FAIL("Unexpected character `%c' in attribute list of Theme element.", yytext[0]);
 {Name} FAIL("Bad attribute `%s' in `Theme' element start tag.",yytext);
 <<EOF>> FAIL("EOF in attribute list of `Theme' element.");
}

<E_Theme,S_Theme_1,S_Theme_3>{
 "</Theme"{s}">" {
  LEAVE;
  ETag_Theme();
  switch (YY_START) {
   case ROOT_Theme: SET(EPILOG); break;
  }
 }
 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</Theme>' expected.",yytext);
 .       FAIL("Unexpected character `%c': `</Theme>' expected.",yytext[0]);
 <<EOF>> FAIL("Premature EOF: `</Theme>' expected.");
}

 /* <!-- main elements -->  */

 /*         id          CDATA   #REQUIRED
  *         file        CDATA   #REQUIRED
  *         alphacolor  CDATA   #REQUIRED
  *     >  */

<ROOT_Bitmap,S_Theme_2,S_Theme_1,S_Theme_3>"<Bitmap"{s} {
  A_Bitmap_id = NULL;
  A_Bitmap_file = NULL;
  A_Bitmap_alphacolor = NULL;
  ENTER(AL_Bitmap);
}

<AL_Bitmap>{
 "id"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Bitmap_id);
 "id"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Bitmap_id);

 "file"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Bitmap_file);
 "file"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Bitmap_file);

 "alphacolor"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Bitmap_alphacolor);
 "alphacolor"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Bitmap_alphacolor);

 ">" {
  if (!A_Bitmap_id) FAIL("Required attribute `id' not set for `Bitmap' element.");
  if (!A_Bitmap_file) FAIL("Required attribute `file' not set for `Bitmap' element.");
  if (!A_Bitmap_alphacolor) FAIL("Required attribute `alphacolor' not set for `Bitmap' element.");
  LEAVE; STag_Bitmap(); pcdata = NULL; ENTER(E_Bitmap);
 }
 "/>" {
  if (!A_Bitmap_id) FAIL("Required attribute `id' not set for `Bitmap' element.");
  if (!A_Bitmap_file) FAIL("Required attribute `file' not set for `Bitmap' element.");
  if (!A_Bitmap_alphacolor) FAIL("Required attribute `alphacolor' not set for `Bitmap' element.");
  LEAVE; STag_Bitmap(); pcdata = NULL; ETag_Bitmap();
  switch (YY_START) {
   case S_Theme_2: case S_Theme_1: case S_Theme_3: SET(S_Theme_3); break;
   case ROOT_Bitmap: SET(EPILOG); break;
  }
 }
 .       FAIL("Unexpected character `%c' in attribute list of Bitmap element.", yytext[0]);
 {Name} FAIL("Bad attribute `%s' in `Bitmap' element start tag.",yytext);
 <<EOF>> FAIL("EOF in attribute list of `Bitmap' element.");
}

<E_Bitmap>{
 "</Bitmap"{s}">" {
  LEAVE;
  ETag_Bitmap();
  switch (YY_START) {
   case S_Theme_2: case S_Theme_1: case S_Theme_3: SET(S_Theme_3); break;
   case ROOT_Bitmap: SET(EPILOG); break;
  }
 }
 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</Bitmap>' expected.",yytext);
 .       FAIL("Unexpected character `%c': `</Bitmap>' expected.",yytext[0]);
 <<EOF>> FAIL("Premature EOF: `</Bitmap>' expected.");
}

 /*         id          CDATA   #REQUIRED
  *         event       CDATA   #REQUIRED
  *         key         CDATA   "none"
  *     >  */

<ROOT_Event,S_Theme_2,S_Theme_1,S_Theme_3>"<Event"{s} {
  A_Event_id = NULL;
  A_Event_event = NULL;
  A_Event_key = "none";
  ENTER(AL_Event);
}

<AL_Event>{
 "id"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Event_id);
 "id"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Event_id);

 "event"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Event_event);
 "event"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Event_event);

 "key"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Event_key);
 "key"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Event_key);

 ">" {
  if (!A_Event_id) FAIL("Required attribute `id' not set for `Event' element.");
  if (!A_Event_event) FAIL("Required attribute `event' not set for `Event' element.");
  LEAVE; STag_Event(); pcdata = NULL; ENTER(E_Event);
 }
 "/>" {
  if (!A_Event_id) FAIL("Required attribute `id' not set for `Event' element.");
  if (!A_Event_event) FAIL("Required attribute `event' not set for `Event' element.");
  LEAVE; STag_Event(); pcdata = NULL; ETag_Event();
  switch (YY_START) {
   case S_Theme_2: case S_Theme_1: case S_Theme_3: SET(S_Theme_3); break;
   case ROOT_Event: SET(EPILOG); break;
  }
 }
 .       FAIL("Unexpected character `%c' in attribute list of Event element.", yytext[0]);
 {Name} FAIL("Bad attribute `%s' in `Event' element start tag.",yytext);
 <<EOF>> FAIL("EOF in attribute list of `Event' element.");
}

<E_Event>{
 "</Event"{s}">" {
  LEAVE;
  ETag_Event();
  switch (YY_START) {
   case S_Theme_2: case S_Theme_1: case S_Theme_3: SET(S_Theme_3); break;
   case ROOT_Event: SET(EPILOG); break;
  }
 }
 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</Event>' expected.",yytext);
 .       FAIL("Unexpected character `%c': `</Event>' expected.",yytext[0]);
 <<EOF>> FAIL("Premature EOF: `</Event>' expected.");
}

 /*         id          CDATA   #REQUIRED
  *         font        CDATA   "arial"
  *         size        CDATA   "12"
  *         color       CDATA   "#000000"
  *         italic      CDATA   "false"
  *         underline   CDATA   "false"
  *     >  */

<ROOT_Font,S_Theme_2,S_Theme_1,S_Theme_3>"<Font"{s} {
  A_Font_id = NULL;
  A_Font_font = "arial";
  A_Font_size = "12";
  A_Font_color = "#000000";
  A_Font_italic = "false";
  A_Font_underline = "false";
  ENTER(AL_Font);
}

<AL_Font>{
 "id"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Font_id);
 "id"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Font_id);

 "font"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Font_font);
 "font"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Font_font);

 "size"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Font_size);
 "size"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Font_size);

 "color"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Font_color);
 "color"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Font_color);

 "italic"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Font_italic);
 "italic"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Font_italic);

 "underline"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Font_underline);
 "underline"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Font_underline);

 ">" {
  if (!A_Font_id) FAIL("Required attribute `id' not set for `Font' element.");
  LEAVE; STag_Font(); pcdata = NULL; ENTER(E_Font);
 }
 "/>" {
  if (!A_Font_id) FAIL("Required attribute `id' not set for `Font' element.");
  LEAVE; STag_Font(); pcdata = NULL; ETag_Font();
  switch (YY_START) {
   case ROOT_Font: SET(EPILOG); break;
   case S_Theme_2: case S_Theme_1: case S_Theme_3: SET(S_Theme_3); break;
  }
 }
 .       FAIL("Unexpected character `%c' in attribute list of Font element.", yytext[0]);
 {Name} FAIL("Bad attribute `%s' in `Font' element start tag.",yytext);
 <<EOF>> FAIL("EOF in attribute list of `Font' element.");
}

<E_Font>{
 "</Font"{s}">" {
  LEAVE;
  ETag_Font();
  switch (YY_START) {
   case ROOT_Font: SET(EPILOG); break;
   case S_Theme_2: case S_Theme_1: case S_Theme_3: SET(S_Theme_3); break;
  }
 }
 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</Font>' expected.",yytext);
 .       FAIL("Unexpected character `%c': `</Font>' expected.",yytext[0]);
 <<EOF>> FAIL("Premature EOF: `</Font>' expected.");
}

 /*         name        CDATA   #IMPLIED
  *         author      CDATA   #IMPLIED
  *         email       CDATA   #IMPLIED
  *         webpage     CDATA   #IMPLIED
  *     >  */

<ROOT_ThemeInfo,S_Theme>"<ThemeInfo"{s} {
  A_ThemeInfo_name = NULL;
  A_ThemeInfo_author = NULL;
  A_ThemeInfo_email = NULL;
  A_ThemeInfo_webpage = NULL;
  ENTER(AL_ThemeInfo);
}

<AL_ThemeInfo>{
 "name"{Eq}\' ENTER(VALUE1); BUFFERSET(A_ThemeInfo_name);
 "name"{Eq}\" ENTER(VALUE2); BUFFERSET(A_ThemeInfo_name);

 "author"{Eq}\' ENTER(VALUE1); BUFFERSET(A_ThemeInfo_author);
 "author"{Eq}\" ENTER(VALUE2); BUFFERSET(A_ThemeInfo_author);

 "email"{Eq}\' ENTER(VALUE1); BUFFERSET(A_ThemeInfo_email);
 "email"{Eq}\" ENTER(VALUE2); BUFFERSET(A_ThemeInfo_email);

 "webpage"{Eq}\' ENTER(VALUE1); BUFFERSET(A_ThemeInfo_webpage);
 "webpage"{Eq}\" ENTER(VALUE2); BUFFERSET(A_ThemeInfo_webpage);

 ">" {
  LEAVE; STag_ThemeInfo(); pcdata = NULL; ENTER(E_ThemeInfo);
 }
 "/>" {
  LEAVE; STag_ThemeInfo(); pcdata = NULL; ETag_ThemeInfo();
  switch (YY_START) {
   case S_Theme: SET(S_Theme_1); break;
   case ROOT_ThemeInfo: SET(EPILOG); break;
  }
 }
 .       FAIL("Unexpected character `%c' in attribute list of ThemeInfo element.", yytext[0]);
 {Name} FAIL("Bad attribute `%s' in `ThemeInfo' element start tag.",yytext);
 <<EOF>> FAIL("EOF in attribute list of `ThemeInfo' element.");
}

<E_ThemeInfo>{
 "</ThemeInfo"{s}">" {
  LEAVE;
  ETag_ThemeInfo();
  switch (YY_START) {
   case S_Theme: SET(S_Theme_1); break;
   case ROOT_ThemeInfo: SET(EPILOG); break;
  }
 }
 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</ThemeInfo>' expected.",yytext);
 .       FAIL("Unexpected character `%c': `</ThemeInfo>' expected.",yytext[0]);
 <<EOF>> FAIL("Premature EOF: `</ThemeInfo>' expected.");
}

 /*         id          CDATA   #REQUIRED
  *         visible     CDATA   "true"
  *         x           CDATA   "\0"
  *         y           CDATA   "\0"
  *         dragdrop    CDATA   "true"
  *         playondrop  CDATA   "true"
  *     >  */

<ROOT_Window,S_Theme_2,S_Theme_1,S_Theme_3>"<Window"{s} {
  A_Window_id = NULL;
  A_Window_visible = "true";
  A_Window_x = "\0";
  A_Window_y = "\0";
  A_Window_dragdrop = "true";
  A_Window_playondrop = "true";
  ENTER(AL_Window);
}

<AL_Window>{
 "id"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Window_id);
 "id"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Window_id);

 "visible"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Window_visible);
 "visible"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Window_visible);

 "x"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Window_x);
 "x"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Window_x);

 "y"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Window_y);
 "y"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Window_y);

 "dragdrop"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Window_dragdrop);
 "dragdrop"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Window_dragdrop);

 "playondrop"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Window_playondrop);
 "playondrop"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Window_playondrop);

 ">" {
  if (!A_Window_id) FAIL("Required attribute `id' not set for `Window' element.");
  LEAVE; STag_Window(); pcdata = NULL; ENTER(S_Window);
 }
 "/>" FAIL("`Window' element cannot be empty.");
 .       FAIL("Unexpected character `%c' in attribute list of Window element.", yytext[0]);
 {Name} FAIL("Bad attribute `%s' in `Window' element start tag.",yytext);
 <<EOF>> FAIL("EOF in attribute list of `Window' element.");
}

<S_Window_2,E_Window>{
 "</Window"{s}">" {
  LEAVE;
  ETag_Window();
  switch (YY_START) {
   case ROOT_Window: SET(EPILOG); break;
   case S_Theme_2: case S_Theme_1: case S_Theme_3: SET(S_Theme_3); break;
  }
 }
 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</Window>' expected.",yytext);
 .       FAIL("Unexpected character `%c': `</Window>' expected.",yytext[0]);
 <<EOF>> FAIL("Premature EOF: `</Window>' expected.");
}

 /*         id          CDATA   "none"
  *         width       CDATA   #REQUIRED
  *         height      CDATA   #REQUIRED
  *         minwidth    CDATA   "-1"
  *         maxwidth    CDATA   "-1"
  *         minheight   CDATA   "-1"
  *         maxheight   CDATA   "-1"
  *     >  */

<ROOT_Layout,S_Window,S_Window_1,S_Window_2>"<Layout"{s} {
  A_Layout_id = "none";
  A_Layout_width = NULL;
  A_Layout_height = NULL;
  A_Layout_minwidth = "-1";
  A_Layout_maxwidth = "-1";
  A_Layout_minheight = "-1";
  A_Layout_maxheight = "-1";
  ENTER(AL_Layout);
}

<AL_Layout>{
 "id"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Layout_id);
 "id"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Layout_id);

 "width"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Layout_width);
 "width"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Layout_width);

 "height"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Layout_height);
 "height"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Layout_height);

 "minwidth"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Layout_minwidth);
 "minwidth"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Layout_minwidth);

 "maxwidth"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Layout_maxwidth);
 "maxwidth"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Layout_maxwidth);

 "minheight"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Layout_minheight);
 "minheight"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Layout_minheight);

 "maxheight"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Layout_maxheight);
 "maxheight"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Layout_maxheight);

 ">" {
  if (!A_Layout_width) FAIL("Required attribute `width' not set for `Layout' element.");
  if (!A_Layout_height) FAIL("Required attribute `height' not set for `Layout' element.");
  LEAVE; STag_Layout(); pcdata = NULL; ENTER(S_Layout);
 }
 "/>" FAIL("`Layout' element cannot be empty.");
 .       FAIL("Unexpected character `%c' in attribute list of Layout element.", yytext[0]);
 {Name} FAIL("Bad attribute `%s' in `Layout' element start tag.",yytext);
 <<EOF>> FAIL("EOF in attribute list of `Layout' element.");
}

<E_Layout>{
 "</Layout"{s}">" {
  LEAVE;
  ETag_Layout();
  switch (YY_START) {
   case S_Window: case S_Window_1: case S_Window_2: SET(S_Window_2); break;
   case ROOT_Layout: SET(EPILOG); break;
  }
 }
 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</Layout>' expected.",yytext);
 .       FAIL("Unexpected character `%c': `</Layout>' expected.",yytext[0]);
 <<EOF>> FAIL("Premature EOF: `</Layout>' expected.");
}

 /*                  Rectangle|Anchor)+>  */

 /*         x           CDATA   "\0"
  *         y           CDATA   "\0"
  *     >  */

<ROOT_Group,S_Group_2,S_Layout,S_Group_1,S_Group>"<Group"{s} {
  A_Group_x = "\0";
  A_Group_y = "\0";
  ENTER(AL_Group);
}

<AL_Group>{
 "x"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Group_x);
 "x"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Group_x);

 "y"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Group_y);
 "y"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Group_y);

 ">" {
  LEAVE; STag_Group(); pcdata = NULL; ENTER(S_Group);
 }
 "/>" FAIL("`Group' element cannot be empty.");
 .       FAIL("Unexpected character `%c' in attribute list of Group element.", yytext[0]);
 {Name} FAIL("Bad attribute `%s' in `Group' element start tag.",yytext);
 <<EOF>> FAIL("EOF in attribute list of `Group' element.");
}

<S_Group_2,E_Group>{
 "</Group"{s}">" {
  LEAVE;
  ETag_Group();
  switch (YY_START) {
   case S_Group_2: case S_Group_1: case S_Group: SET(S_Group_2); break;
   case S_Layout: SET(E_Layout); break;
   case ROOT_Group: SET(EPILOG); break;
  }
 }
 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</Group>' expected.",yytext);
 .       FAIL("Unexpected character `%c': `</Group>' expected.",yytext[0]);
 <<EOF>> FAIL("Premature EOF: `</Group>' expected.");
}

 /* <!-- Anchors -->  */

 /*         x           CDATA   "\0"
  *         y           CDATA   "\0"
  *         priority    CDATA   #REQUIRED
  *         range       CDATA   "10"
  *     >  */

<ROOT_Anchor,S_Group_2,S_Group_1,S_Group>"<Anchor"{s} {
  A_Anchor_x = "\0";
  A_Anchor_y = "\0";
  A_Anchor_priority = NULL;
  A_Anchor_range = "10";
  ENTER(AL_Anchor);
}

<AL_Anchor>{
 "x"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Anchor_x);
 "x"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Anchor_x);

 "y"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Anchor_y);
 "y"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Anchor_y);

 "priority"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Anchor_priority);
 "priority"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Anchor_priority);

 "range"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Anchor_range);
 "range"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Anchor_range);

 ">" {
  if (!A_Anchor_priority) FAIL("Required attribute `priority' not set for `Anchor' element.");
  LEAVE; STag_Anchor(); pcdata = NULL; ENTER(E_Anchor);
 }
 "/>" {
  if (!A_Anchor_priority) FAIL("Required attribute `priority' not set for `Anchor' element.");
  LEAVE; STag_Anchor(); pcdata = NULL; ETag_Anchor();
  switch (YY_START) {
   case S_Group_2: case S_Group_1: case S_Group: SET(S_Group_2); break;
   case ROOT_Anchor: SET(EPILOG); break;
  }
 }
 .       FAIL("Unexpected character `%c' in attribute list of Anchor element.", yytext[0]);
 {Name} FAIL("Bad attribute `%s' in `Anchor' element start tag.",yytext);
 <<EOF>> FAIL("EOF in attribute list of `Anchor' element.");
}

<E_Anchor>{
 "</Anchor"{s}">" {
  LEAVE;
  ETag_Anchor();
  switch (YY_START) {
   case S_Group_2: case S_Group_1: case S_Group: SET(S_Group_2); break;
   case ROOT_Anchor: SET(EPILOG); break;
  }
 }
 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</Anchor>' expected.",yytext);
 .       FAIL("Unexpected character `%c': `</Anchor>' expected.",yytext[0]);
 <<EOF>> FAIL("Premature EOF: `</Anchor>' expected.");
}

 /* <!-- Controls -->  */

 /*         id          CDATA   "none"
  *         visible     CDATA   "true"
  *         x           CDATA   "\0"
  *         y           CDATA   "\0"
  *         lefttop     CDATA   "lefttop"
  *         rightbottom CDATA   "lefttop"
  *         image       CDATA   #REQUIRED
  *         onclick     CDATA   "none"
  *         help        CDATA   "\0"
  *     >  */

<ROOT_Image,S_Group_2,S_Group_1,S_Group>"<Image"{s} {
  A_Image_id = "none";
  A_Image_visible = "true";
  A_Image_x = "\0";
  A_Image_y = "\0";
  A_Image_lefttop = "lefttop";
  A_Image_rightbottom = "lefttop";
  A_Image_image = NULL;
  A_Image_onclick = "none";
  A_Image_help = "\0";
  ENTER(AL_Image);
}

<AL_Image>{
 "id"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Image_id);
 "id"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Image_id);

 "visible"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Image_visible);
 "visible"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Image_visible);

 "x"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Image_x);
 "x"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Image_x);

 "y"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Image_y);
 "y"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Image_y);

 "lefttop"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Image_lefttop);
 "lefttop"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Image_lefttop);

 "rightbottom"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Image_rightbottom);
 "rightbottom"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Image_rightbottom);

 "image"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Image_image);
 "image"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Image_image);

 "onclick"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Image_onclick);
 "onclick"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Image_onclick);

 "help"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Image_help);
 "help"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Image_help);

 ">" {
  if (!A_Image_image) FAIL("Required attribute `image' not set for `Image' element.");
  LEAVE; STag_Image(); pcdata = NULL; ENTER(E_Image);
 }
 "/>" {
  if (!A_Image_image) FAIL("Required attribute `image' not set for `Image' element.");
  LEAVE; STag_Image(); pcdata = NULL; ETag_Image();
  switch (YY_START) {
   case S_Group_2: case S_Group_1: case S_Group: SET(S_Group_2); break;
   case ROOT_Image: SET(EPILOG); break;
  }
 }
 .       FAIL("Unexpected character `%c' in attribute list of Image element.", yytext[0]);
 {Name} FAIL("Bad attribute `%s' in `Image' element start tag.",yytext);
 <<EOF>> FAIL("EOF in attribute list of `Image' element.");
}

<E_Image>{
 "</Image"{s}">" {
  LEAVE;
  ETag_Image();
  switch (YY_START) {
   case S_Group_2: case S_Group_1: case S_Group: SET(S_Group_2); break;
   case ROOT_Image: SET(EPILOG); break;
  }
 }
 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</Image>' expected.",yytext);
 .       FAIL("Unexpected character `%c': `</Image>' expected.",yytext[0]);
 <<EOF>> FAIL("Premature EOF: `</Image>' expected.");
}

 /*         id          CDATA   "none"
  *         visible     CDATA   "true"
  *         x           CDATA   "\0"
  *         y           CDATA   "\0"
  *         w           CDATA   "50"
  *         h           CDATA   "50"
  *         color       CDATA   "#C0C0C0"
  *         onclick     CDATA   "none"
  *         help        CDATA   "\0"
  *     >  */

<ROOT_Rectangle,S_Group_2,S_Group_1,S_Group>"<Rectangle"{s} {
  A_Rectangle_id = "none";
  A_Rectangle_visible = "true";
  A_Rectangle_x = "\0";
  A_Rectangle_y = "\0";
  A_Rectangle_w = "50";
  A_Rectangle_h = "50";
  A_Rectangle_color = "#C0C0C0";
  A_Rectangle_onclick = "none";
  A_Rectangle_help = "\0";
  ENTER(AL_Rectangle);
}

<AL_Rectangle>{
 "id"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Rectangle_id);
 "id"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Rectangle_id);

 "visible"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Rectangle_visible);
 "visible"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Rectangle_visible);

 "x"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Rectangle_x);
 "x"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Rectangle_x);

 "y"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Rectangle_y);
 "y"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Rectangle_y);

 "w"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Rectangle_w);
 "w"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Rectangle_w);

 "h"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Rectangle_h);
 "h"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Rectangle_h);

 "color"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Rectangle_color);
 "color"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Rectangle_color);

 "onclick"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Rectangle_onclick);
 "onclick"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Rectangle_onclick);

 "help"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Rectangle_help);
 "help"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Rectangle_help);

 ">" {
  LEAVE; STag_Rectangle(); pcdata = NULL; ENTER(E_Rectangle);
 }
 "/>" {
  LEAVE; STag_Rectangle(); pcdata = NULL; ETag_Rectangle();
  switch (YY_START) {
   case S_Group_2: case S_Group_1: case S_Group: SET(S_Group_2); break;
   case ROOT_Rectangle: SET(EPILOG); break;
  }
 }
 .       FAIL("Unexpected character `%c' in attribute list of Rectangle element.", yytext[0]);
 {Name} FAIL("Bad attribute `%s' in `Rectangle' element start tag.",yytext);
 <<EOF>> FAIL("EOF in attribute list of `Rectangle' element.");
}

<E_Rectangle>{
 "</Rectangle"{s}">" {
  LEAVE;
  ETag_Rectangle();
  switch (YY_START) {
   case S_Group_2: case S_Group_1: case S_Group: SET(S_Group_2); break;
   case ROOT_Rectangle: SET(EPILOG); break;
  }
 }
 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</Rectangle>' expected.",yytext);
 .       FAIL("Unexpected character `%c': `</Rectangle>' expected.",yytext[0]);
 <<EOF>> FAIL("Premature EOF: `</Rectangle>' expected.");
}

 /*         id          CDATA   "none"
  *         x           CDATA   "\0"
  *         y           CDATA   "\0"
  *         lefttop     CDATA   "lefttop"
  *         rightbottom CDATA   "lefttop"
  *         up          CDATA   #REQUIRED
  *         down        CDATA   "none"
  *         over        CDATA   "none"
  *         action      CDATA   "none"
  *         tooltiptext CDATA   "\0"
  *         help        CDATA   "\0"
  *     >  */

<ROOT_Button,S_Group_2,S_Group_1,S_Group>"<Button"{s} {
  A_Button_id = "none";
  A_Button_x = "\0";
  A_Button_y = "\0";
  A_Button_lefttop = "lefttop";
  A_Button_rightbottom = "lefttop";
  A_Button_up = NULL;
  A_Button_down = "none";
  A_Button_over = "none";
  A_Button_action = "none";
  A_Button_tooltiptext = "\0";
  A_Button_help = "\0";
  ENTER(AL_Button);
}

<AL_Button>{
 "id"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Button_id);
 "id"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Button_id);

 "x"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Button_x);
 "x"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Button_x);

 "y"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Button_y);
 "y"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Button_y);

 "lefttop"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Button_lefttop);
 "lefttop"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Button_lefttop);

 "rightbottom"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Button_rightbottom);
 "rightbottom"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Button_rightbottom);

 "up"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Button_up);
 "up"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Button_up);

 "down"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Button_down);
 "down"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Button_down);

 "over"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Button_over);
 "over"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Button_over);

 "action"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Button_action);
 "action"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Button_action);

 "tooltiptext"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Button_tooltiptext);
 "tooltiptext"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Button_tooltiptext);

 "help"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Button_help);
 "help"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Button_help);

 ">" {
  if (!A_Button_up) FAIL("Required attribute `up' not set for `Button' element.");
  LEAVE; STag_Button(); pcdata = NULL; ENTER(E_Button);
 }
 "/>" {
  if (!A_Button_up) FAIL("Required attribute `up' not set for `Button' element.");
  LEAVE; STag_Button(); pcdata = NULL; ETag_Button();
  switch (YY_START) {
   case S_Group_2: case S_Group_1: case S_Group: SET(S_Group_2); break;
   case ROOT_Button: SET(EPILOG); break;
  }
 }
 .       FAIL("Unexpected character `%c' in attribute list of Button element.", yytext[0]);
 {Name} FAIL("Bad attribute `%s' in `Button' element start tag.",yytext);
 <<EOF>> FAIL("EOF in attribute list of `Button' element.");
}

<E_Button>{
 "</Button"{s}">" {
  LEAVE;
  ETag_Button();
  switch (YY_START) {
   case S_Group_2: case S_Group_1: case S_Group: SET(S_Group_2); break;
   case ROOT_Button: SET(EPILOG); break;
  }
 }
 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</Button>' expected.",yytext);
 .       FAIL("Unexpected character `%c': `</Button>' expected.",yytext[0]);
 <<EOF>> FAIL("Premature EOF: `</Button>' expected.");
}

 /*         id           CDATA   "none"
  *         x            CDATA   "\0"
  *         y            CDATA   "\0"
  *         lefttop      CDATA   "lefttop"
  *         rightbottom  CDATA   "lefttop"
  *         up1          CDATA   #REQUIRED
  *         down1        CDATA   "none"
  *         over1        CDATA   "none"
  *         up2          CDATA   #REQUIRED
  *         down2        CDATA   "none"
  *         over2        CDATA   "none"
  *         state        CDATA   #REQUIRED
  *         action1      CDATA   "none"
  *         action2      CDATA   "none"
  *         tooltiptext1 CDATA   "\0"
  *         tooltiptext2 CDATA   "\0"
  *         help         CDATA   "\0"
  *     >  */

<ROOT_CheckBox,S_Group_2,S_Group_1,S_Group>"<CheckBox"{s} {
  A_CheckBox_id = "none";
  A_CheckBox_x = "\0";
  A_CheckBox_y = "\0";
  A_CheckBox_lefttop = "lefttop";
  A_CheckBox_rightbottom = "lefttop";
  A_CheckBox_up1 = NULL;
  A_CheckBox_down1 = "none";
  A_CheckBox_over1 = "none";
  A_CheckBox_up2 = NULL;
  A_CheckBox_down2 = "none";
  A_CheckBox_over2 = "none";
  A_CheckBox_state = NULL;
  A_CheckBox_action1 = "none";
  A_CheckBox_action2 = "none";
  A_CheckBox_tooltiptext1 = "\0";
  A_CheckBox_tooltiptext2 = "\0";
  A_CheckBox_help = "\0";
  ENTER(AL_CheckBox);
}

<AL_CheckBox>{
 "id"{Eq}\' ENTER(VALUE1); BUFFERSET(A_CheckBox_id);
 "id"{Eq}\" ENTER(VALUE2); BUFFERSET(A_CheckBox_id);

 "x"{Eq}\' ENTER(VALUE1); BUFFERSET(A_CheckBox_x);
 "x"{Eq}\" ENTER(VALUE2); BUFFERSET(A_CheckBox_x);

 "y"{Eq}\' ENTER(VALUE1); BUFFERSET(A_CheckBox_y);
 "y"{Eq}\" ENTER(VALUE2); BUFFERSET(A_CheckBox_y);

 "lefttop"{Eq}\' ENTER(VALUE1); BUFFERSET(A_CheckBox_lefttop);
 "lefttop"{Eq}\" ENTER(VALUE2); BUFFERSET(A_CheckBox_lefttop);

 "rightbottom"{Eq}\' ENTER(VALUE1); BUFFERSET(A_CheckBox_rightbottom);
 "rightbottom"{Eq}\" ENTER(VALUE2); BUFFERSET(A_CheckBox_rightbottom);

 "up1"{Eq}\' ENTER(VALUE1); BUFFERSET(A_CheckBox_up1);
 "up1"{Eq}\" ENTER(VALUE2); BUFFERSET(A_CheckBox_up1);

 "down1"{Eq}\' ENTER(VALUE1); BUFFERSET(A_CheckBox_down1);
 "down1"{Eq}\" ENTER(VALUE2); BUFFERSET(A_CheckBox_down1);

 "over1"{Eq}\' ENTER(VALUE1); BUFFERSET(A_CheckBox_over1);
 "over1"{Eq}\" ENTER(VALUE2); BUFFERSET(A_CheckBox_over1);

 "up2"{Eq}\' ENTER(VALUE1); BUFFERSET(A_CheckBox_up2);
 "up2"{Eq}\" ENTER(VALUE2); BUFFERSET(A_CheckBox_up2);

 "down2"{Eq}\' ENTER(VALUE1); BUFFERSET(A_CheckBox_down2);
 "down2"{Eq}\" ENTER(VALUE2); BUFFERSET(A_CheckBox_down2);

 "over2"{Eq}\' ENTER(VALUE1); BUFFERSET(A_CheckBox_over2);
 "over2"{Eq}\" ENTER(VALUE2); BUFFERSET(A_CheckBox_over2);

 "state"{Eq}\' ENTER(VALUE1); BUFFERSET(A_CheckBox_state);
 "state"{Eq}\" ENTER(VALUE2); BUFFERSET(A_CheckBox_state);

 "action1"{Eq}\' ENTER(VALUE1); BUFFERSET(A_CheckBox_action1);
 "action1"{Eq}\" ENTER(VALUE2); BUFFERSET(A_CheckBox_action1);

 "action2"{Eq}\' ENTER(VALUE1); BUFFERSET(A_CheckBox_action2);
 "action2"{Eq}\" ENTER(VALUE2); BUFFERSET(A_CheckBox_action2);

 "tooltiptext1"{Eq}\' ENTER(VALUE1); BUFFERSET(A_CheckBox_tooltiptext1);
 "tooltiptext1"{Eq}\" ENTER(VALUE2); BUFFERSET(A_CheckBox_tooltiptext1);

 "tooltiptext2"{Eq}\' ENTER(VALUE1); BUFFERSET(A_CheckBox_tooltiptext2);
 "tooltiptext2"{Eq}\" ENTER(VALUE2); BUFFERSET(A_CheckBox_tooltiptext2);

 "help"{Eq}\' ENTER(VALUE1); BUFFERSET(A_CheckBox_help);
 "help"{Eq}\" ENTER(VALUE2); BUFFERSET(A_CheckBox_help);

 ">" {
  if (!A_CheckBox_up1) FAIL("Required attribute `up1' not set for `CheckBox' element.");
  if (!A_CheckBox_up2) FAIL("Required attribute `up2' not set for `CheckBox' element.");
  if (!A_CheckBox_state) FAIL("Required attribute `state' not set for `CheckBox' element.");
  LEAVE; STag_CheckBox(); pcdata = NULL; ENTER(E_CheckBox);
 }
 "/>" {
  if (!A_CheckBox_up1) FAIL("Required attribute `up1' not set for `CheckBox' element.");
  if (!A_CheckBox_up2) FAIL("Required attribute `up2' not set for `CheckBox' element.");
  if (!A_CheckBox_state) FAIL("Required attribute `state' not set for `CheckBox' element.");
  LEAVE; STag_CheckBox(); pcdata = NULL; ETag_CheckBox();
  switch (YY_START) {
   case S_Group_2: case S_Group_1: case S_Group: SET(S_Group_2); break;
   case ROOT_CheckBox: SET(EPILOG); break;
  }
 }
 .       FAIL("Unexpected character `%c' in attribute list of CheckBox element.", yytext[0]);
 {Name} FAIL("Bad attribute `%s' in `CheckBox' element start tag.",yytext);
 <<EOF>> FAIL("EOF in attribute list of `CheckBox' element.");
}

<E_CheckBox>{
 "</CheckBox"{s}">" {
  LEAVE;
  ETag_CheckBox();
  switch (YY_START) {
   case S_Group_2: case S_Group_1: case S_Group: SET(S_Group_2); break;
   case ROOT_CheckBox: SET(EPILOG); break;
  }
 }
 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</CheckBox>' expected.",yytext);
 .       FAIL("Unexpected character `%c': `</CheckBox>' expected.",yytext[0]);
 <<EOF>> FAIL("Premature EOF: `</CheckBox>' expected.");
}

 /*         id          CDATA   "none"
  *         visible     CDATA   "true"
  *         x           CDATA   "\0"
  *         y           CDATA   "\0"
  *         lefttop     CDATA   "lefttop"
  *         rightbottom CDATA   "lefttop"
  *         up          CDATA   #REQUIRED
  *         down        CDATA   "none"
  *         over        CDATA   "none"
  *         points      CDATA   #REQUIRED
  *         thickness   CDATA   "10"
  *         value       CDATA   "none"
  *         tooltiptext CDATA   "\0"
  *         help        CDATA   "\0"
  *     >  */

<ROOT_Slider,S_Playlist,S_Group_2,S_Group_1,S_Group>"<Slider"{s} {
  A_Slider_id = "none";
  A_Slider_visible = "true";
  A_Slider_x = "\0";
  A_Slider_y = "\0";
  A_Slider_lefttop = "lefttop";
  A_Slider_rightbottom = "lefttop";
  A_Slider_up = NULL;
  A_Slider_down = "none";
  A_Slider_over = "none";
  A_Slider_points = NULL;
  A_Slider_thickness = "10";
  A_Slider_value = "none";
  A_Slider_tooltiptext = "\0";
  A_Slider_help = "\0";
  ENTER(AL_Slider);
}

<AL_Slider>{
 "id"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Slider_id);
 "id"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Slider_id);

 "visible"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Slider_visible);
 "visible"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Slider_visible);

 "x"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Slider_x);
 "x"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Slider_x);

 "y"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Slider_y);
 "y"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Slider_y);

 "lefttop"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Slider_lefttop);
 "lefttop"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Slider_lefttop);

 "rightbottom"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Slider_rightbottom);
 "rightbottom"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Slider_rightbottom);

 "up"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Slider_up);
 "up"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Slider_up);

 "down"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Slider_down);
 "down"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Slider_down);

 "over"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Slider_over);
 "over"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Slider_over);

 "points"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Slider_points);
 "points"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Slider_points);

 "thickness"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Slider_thickness);
 "thickness"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Slider_thickness);

 "value"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Slider_value);
 "value"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Slider_value);

 "tooltiptext"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Slider_tooltiptext);
 "tooltiptext"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Slider_tooltiptext);

 "help"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Slider_help);
 "help"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Slider_help);

 ">" {
  if (!A_Slider_up) FAIL("Required attribute `up' not set for `Slider' element.");
  if (!A_Slider_points) FAIL("Required attribute `points' not set for `Slider' element.");
  LEAVE; STag_Slider(); pcdata = NULL; ENTER(E_Slider);
 }
 "/>" {
  if (!A_Slider_up) FAIL("Required attribute `up' not set for `Slider' element.");
  if (!A_Slider_points) FAIL("Required attribute `points' not set for `Slider' element.");
  LEAVE; STag_Slider(); pcdata = NULL; ETag_Slider();
  switch (YY_START) {
   case S_Playlist: SET(E_Playlist); break;
   case S_Group_2: case S_Group_1: case S_Group: SET(S_Group_2); break;
   case ROOT_Slider: SET(EPILOG); break;
  }
 }
 .       FAIL("Unexpected character `%c' in attribute list of Slider element.", yytext[0]);
 {Name} FAIL("Bad attribute `%s' in `Slider' element start tag.",yytext);
 <<EOF>> FAIL("EOF in attribute list of `Slider' element.");
}

<E_Slider>{
 "</Slider"{s}">" {
  LEAVE;
  ETag_Slider();
  switch (YY_START) {
   case S_Playlist: SET(E_Playlist); break;
   case S_Group_2: case S_Group_1: case S_Group: SET(S_Group_2); break;
   case ROOT_Slider: SET(EPILOG); break;
  }
 }
 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</Slider>' expected.",yytext);
 .       FAIL("Unexpected character `%c': `</Slider>' expected.",yytext[0]);
 <<EOF>> FAIL("Premature EOF: `</Slider>' expected.");
}

 /*         id          CDATA   "none"
  *         visible     CDATA   "true"
  *         x           CDATA   "\0"
  *         y           CDATA   "\0"
  *         lefttop     CDATA   "lefttop"
  *         rightbottom CDATA   "lefttop"
  *         sequence    CDATA   #REQUIRED
  *         nbimages    CDATA   #REQUIRED
  *         minangle    CDATA   "\0"
  *         maxangle    CDATA   "360"
  *         value       CDATA   "none"
  *         tooltiptext CDATA   "\0"
  *         help        CDATA   "\0"
  *     >  */

<ROOT_RadialSlider,S_Group_2,S_Group_1,S_Group>"<RadialSlider"{s} {
  A_RadialSlider_id = "none";
  A_RadialSlider_visible = "true";
  A_RadialSlider_x = "\0";
  A_RadialSlider_y = "\0";
  A_RadialSlider_lefttop = "lefttop";
  A_RadialSlider_rightbottom = "lefttop";
  A_RadialSlider_sequence = NULL;
  A_RadialSlider_nbimages = NULL;
  A_RadialSlider_minangle = "\0";
  A_RadialSlider_maxangle = "360";
  A_RadialSlider_value = "none";
  A_RadialSlider_tooltiptext = "\0";
  A_RadialSlider_help = "\0";
  ENTER(AL_RadialSlider);
}

<AL_RadialSlider>{
 "id"{Eq}\' ENTER(VALUE1); BUFFERSET(A_RadialSlider_id);
 "id"{Eq}\" ENTER(VALUE2); BUFFERSET(A_RadialSlider_id);

 "visible"{Eq}\' ENTER(VALUE1); BUFFERSET(A_RadialSlider_visible);
 "visible"{Eq}\" ENTER(VALUE2); BUFFERSET(A_RadialSlider_visible);

 "x"{Eq}\' ENTER(VALUE1); BUFFERSET(A_RadialSlider_x);
 "x"{Eq}\" ENTER(VALUE2); BUFFERSET(A_RadialSlider_x);

 "y"{Eq}\' ENTER(VALUE1); BUFFERSET(A_RadialSlider_y);
 "y"{Eq}\" ENTER(VALUE2); BUFFERSET(A_RadialSlider_y);

 "lefttop"{Eq}\' ENTER(VALUE1); BUFFERSET(A_RadialSlider_lefttop);
 "lefttop"{Eq}\" ENTER(VALUE2); BUFFERSET(A_RadialSlider_lefttop);

 "rightbottom"{Eq}\' ENTER(VALUE1); BUFFERSET(A_RadialSlider_rightbottom);
 "rightbottom"{Eq}\" ENTER(VALUE2); BUFFERSET(A_RadialSlider_rightbottom);

 "sequence"{Eq}\' ENTER(VALUE1); BUFFERSET(A_RadialSlider_sequence);
 "sequence"{Eq}\" ENTER(VALUE2); BUFFERSET(A_RadialSlider_sequence);

 "nbimages"{Eq}\' ENTER(VALUE1); BUFFERSET(A_RadialSlider_nbimages);
 "nbimages"{Eq}\" ENTER(VALUE2); BUFFERSET(A_RadialSlider_nbimages);

 "minangle"{Eq}\' ENTER(VALUE1); BUFFERSET(A_RadialSlider_minangle);
 "minangle"{Eq}\" ENTER(VALUE2); BUFFERSET(A_RadialSlider_minangle);

 "maxangle"{Eq}\' ENTER(VALUE1); BUFFERSET(A_RadialSlider_maxangle);
 "maxangle"{Eq}\" ENTER(VALUE2); BUFFERSET(A_RadialSlider_maxangle);

 "value"{Eq}\' ENTER(VALUE1); BUFFERSET(A_RadialSlider_value);
 "value"{Eq}\" ENTER(VALUE2); BUFFERSET(A_RadialSlider_value);

 "tooltiptext"{Eq}\' ENTER(VALUE1); BUFFERSET(A_RadialSlider_tooltiptext);
 "tooltiptext"{Eq}\" ENTER(VALUE2); BUFFERSET(A_RadialSlider_tooltiptext);

 "help"{Eq}\' ENTER(VALUE1); BUFFERSET(A_RadialSlider_help);
 "help"{Eq}\" ENTER(VALUE2); BUFFERSET(A_RadialSlider_help);

 ">" {
  if (!A_RadialSlider_sequence) FAIL("Required attribute `sequence' not set for `RadialSlider' element.");
  if (!A_RadialSlider_nbimages) FAIL("Required attribute `nbimages' not set for `RadialSlider' element.");
  LEAVE; STag_RadialSlider(); pcdata = NULL; ENTER(E_RadialSlider);
 }
 "/>" {
  if (!A_RadialSlider_sequence) FAIL("Required attribute `sequence' not set for `RadialSlider' element.");
  if (!A_RadialSlider_nbimages) FAIL("Required attribute `nbimages' not set for `RadialSlider' element.");
  LEAVE; STag_RadialSlider(); pcdata = NULL; ETag_RadialSlider();
  switch (YY_START) {
   case S_Group_2: case S_Group_1: case S_Group: SET(S_Group_2); break;
   case ROOT_RadialSlider: SET(EPILOG); break;
  }
 }
 .       FAIL("Unexpected character `%c' in attribute list of RadialSlider element.", yytext[0]);
 {Name} FAIL("Bad attribute `%s' in `RadialSlider' element start tag.",yytext);
 <<EOF>> FAIL("EOF in attribute list of `RadialSlider' element.");
}

<E_RadialSlider>{
 "</RadialSlider"{s}">" {
  LEAVE;
  ETag_RadialSlider();
  switch (YY_START) {
   case S_Group_2: case S_Group_1: case S_Group: SET(S_Group_2); break;
   case ROOT_RadialSlider: SET(EPILOG); break;
  }
 }
 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</RadialSlider>' expected.",yytext);
 .       FAIL("Unexpected character `%c': `</RadialSlider>' expected.",yytext[0]);
 <<EOF>> FAIL("Premature EOF: `</RadialSlider>' expected.");
}

 /*         id          CDATA   "none"
  *         visible     CDATA   "true"
  *         x           CDATA   "\0"
  *         y           CDATA   "\0"
  *         text        CDATA   ""
  *         font        CDATA   #REQUIRED
  *         align       CDATA   "left"
  *         width       CDATA   "\0"
  *         display     CDATA   "none"
  *         scroll      CDATA   "true"
  *         scrollspace CDATA   "20"
  *         help        CDATA   "\0"
  *     >  */

<ROOT_Text,S_Group_2,S_Group_1,S_Group>"<Text"{s} {
  A_Text_id = "none";
  A_Text_visible = "true";
  A_Text_x = "\0";
  A_Text_y = "\0";
  A_Text_text = NULL;
  A_Text_font = NULL;
  A_Text_align = "left";
  A_Text_width = "\0";
  A_Text_display = "none";
  A_Text_scroll = "true";
  A_Text_scrollspace = "20";
  A_Text_help = "\0";
  ENTER(AL_Text);
}

<AL_Text>{
 "id"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Text_id);
 "id"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Text_id);

 "visible"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Text_visible);
 "visible"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Text_visible);

 "x"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Text_x);
 "x"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Text_x);

 "y"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Text_y);
 "y"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Text_y);

 "text"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Text_text);
 "text"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Text_text);

 "font"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Text_font);
 "font"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Text_font);

 "align"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Text_align);
 "align"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Text_align);

 "width"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Text_width);
 "width"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Text_width);

 "display"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Text_display);
 "display"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Text_display);

 "scroll"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Text_scroll);
 "scroll"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Text_scroll);

 "scrollspace"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Text_scrollspace);
 "scrollspace"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Text_scrollspace);

 "help"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Text_help);
 "help"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Text_help);

 ">" {
  if (!A_Text_font) FAIL("Required attribute `font' not set for `Text' element.");
  LEAVE; STag_Text(); pcdata = NULL; ENTER(E_Text);
 }
 "/>" {
  if (!A_Text_font) FAIL("Required attribute `font' not set for `Text' element.");
  LEAVE; STag_Text(); pcdata = NULL; ETag_Text();
  switch (YY_START) {
   case S_Group_2: case S_Group_1: case S_Group: SET(S_Group_2); break;
   case ROOT_Text: SET(EPILOG); break;
  }
 }
 .       FAIL("Unexpected character `%c' in attribute list of Text element.", yytext[0]);
 {Name} FAIL("Bad attribute `%s' in `Text' element start tag.",yytext);
 <<EOF>> FAIL("EOF in attribute list of `Text' element.");
}

<E_Text>{
 "</Text"{s}">" {
  LEAVE;
  ETag_Text();
  switch (YY_START) {
   case S_Group_2: case S_Group_1: case S_Group: SET(S_Group_2); break;
   case ROOT_Text: SET(EPILOG); break;
  }
 }
 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</Text>' expected.",yytext);
 .       FAIL("Unexpected character `%c': `</Text>' expected.",yytext[0]);
 <<EOF>> FAIL("Premature EOF: `</Text>' expected.");
}

 /*         id          CDATA   #REQUIRED
  *         visible     CDATA   "true"
  *         x           CDATA   "\0"
  *         y           CDATA   "\0"
  *         width       CDATA   "\0"
  *         height      CDATA   "\0"
  *         lefttop     CDATA   "lefttop"
  *         rightbottom CDATA   "lefttop"
  *         font        CDATA   #REQUIRED
  *         var         CDATA   "playlist"
  *         fgcolor     CDATA   "#000000"
  *         playcolor   CDATA   "#FF0000"
  *         bgcolor1    CDATA   "#FFFFFF"
  *         bgcolor2    CDATA   "#FFFFFF"
  *         selcolor    CDATA   "#0000FF"
  *         help        CDATA   "\0"
  *     >  */

<ROOT_Playlist,S_Group_2,S_Group_1,S_Group>"<Playlist"{s} {
  A_Playlist_id = NULL;
  A_Playlist_visible = "true";
  A_Playlist_x = "\0";
  A_Playlist_y = "\0";
  A_Playlist_width = "\0";
  A_Playlist_height = "\0";
  A_Playlist_lefttop = "lefttop";
  A_Playlist_rightbottom = "lefttop";
  A_Playlist_font = NULL;
  A_Playlist_var = "playlist";
  A_Playlist_fgcolor = "#000000";
  A_Playlist_playcolor = "#FF0000";
  A_Playlist_bgcolor1 = "#FFFFFF";
  A_Playlist_bgcolor2 = "#FFFFFF";
  A_Playlist_selcolor = "#0000FF";
  A_Playlist_help = "\0";
  ENTER(AL_Playlist);
}

<AL_Playlist>{
 "id"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Playlist_id);
 "id"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Playlist_id);

 "visible"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Playlist_visible);
 "visible"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Playlist_visible);

 "x"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Playlist_x);
 "x"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Playlist_x);

 "y"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Playlist_y);
 "y"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Playlist_y);

 "width"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Playlist_width);
 "width"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Playlist_width);

 "height"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Playlist_height);
 "height"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Playlist_height);

 "lefttop"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Playlist_lefttop);
 "lefttop"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Playlist_lefttop);

 "rightbottom"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Playlist_rightbottom);
 "rightbottom"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Playlist_rightbottom);

 "font"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Playlist_font);
 "font"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Playlist_font);

 "var"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Playlist_var);
 "var"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Playlist_var);

 "fgcolor"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Playlist_fgcolor);
 "fgcolor"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Playlist_fgcolor);

 "playcolor"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Playlist_playcolor);
 "playcolor"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Playlist_playcolor);

 "bgcolor1"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Playlist_bgcolor1);
 "bgcolor1"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Playlist_bgcolor1);

 "bgcolor2"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Playlist_bgcolor2);
 "bgcolor2"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Playlist_bgcolor2);

 "selcolor"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Playlist_selcolor);
 "selcolor"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Playlist_selcolor);

 "help"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Playlist_help);
 "help"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Playlist_help);

 ">" {
  if (!A_Playlist_id) FAIL("Required attribute `id' not set for `Playlist' element.");
  if (!A_Playlist_font) FAIL("Required attribute `font' not set for `Playlist' element.");
  LEAVE; STag_Playlist(); pcdata = NULL; ENTER(S_Playlist);
 }
 "/>" FAIL("`Playlist' element cannot be empty.");
 .       FAIL("Unexpected character `%c' in attribute list of Playlist element.", yytext[0]);
 {Name} FAIL("Bad attribute `%s' in `Playlist' element start tag.",yytext);
 <<EOF>> FAIL("EOF in attribute list of `Playlist' element.");
}

<E_Playlist>{
 "</Playlist"{s}">" {
  LEAVE;
  ETag_Playlist();
  switch (YY_START) {
   case S_Group_2: case S_Group_1: case S_Group: SET(S_Group_2); break;
   case ROOT_Playlist: SET(EPILOG); break;
  }
 }
 "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</Playlist>' expected.",yytext);
 .       FAIL("Unexpected character `%c': `</Playlist>' expected.",yytext[0]);
 <<EOF>> FAIL("Premature EOF: `</Playlist>' expected.");
}

 /* EPILOG: after the root element. */

<EPILOG>{
 . 		FAIL("Unexpected character `%c' after document.", yytext[0]);
 <<EOF>> 	SUCCEED;
}

 /* CHARACTER DATA. */

<IMPOSSIBLE,VALUE1,VALUE2>{
 /* Non-defined standard entities... */
"&amp;"  BUFFERPUTC('&');
"&lt;"   BUFFERPUTC('<');
"&gt;"   BUFFERPUTC('>');
"&apos;" BUFFERPUTC('\'');
"&quot;" BUFFERPUTC('"');

 /* Character entities. */
 "&#"[[:digit:]]+";"	BUFFERPUTC((unsigned char)atoi(yytext+2));
 "&#x"[[:xdigit:]]+";"	BUFFERPUTC((unsigned char)strtol(yytext+3,NULL,16));
}

<IMPOSSIBLE,VALUE1,VALUE2,CDATA>{
 "\n"		|
 "\r"		|
 "\r\n"		|
 "\n\r"		BUFFERPUTC('\n');
}

<IMPOSSIBLE>{
 "<![CDATA["	ENTER(CDATA);
 "]]>"		FAIL("Unexpected `]]>' in character data.");
}

<VALUE1>{
 \'		BUFFERDONE; LEAVE;
 <<EOF>>	FAIL("EOF in literal (\"'\" expected).");
}

<VALUE2>{
 \"		BUFFERDONE; LEAVE;
 <<EOF>>	FAIL("EOF in literal (`\"' expected).");
}

<IMPOSSIBLE,VALUE1,VALUE2>{
 [^<&]		BUFFERPUTC(yytext[0]);
 [<&]		FAIL("Spurious `%c' in character data.",yytext[0]);
}

<CDATA>{
 "]]>"		LEAVE;
 "]]"		BUFFERPUTC(yytext[0]); BUFFERPUTC(yytext[1]);
 .		BUFFERPUTC(yytext[0]);
 <<EOF>>	FAIL("EOF in CDATA section.");
}

 /* Impossible rules to avoid warnings from flex(1). */

<INITIAL,IMPOSSIBLE>{
 .|[\n] FAIL("The Impossible Happened: INITIAL or IMPOSSIBLE state entered?");
}

%%

/* Element context stack lookup. */
int element_context(int i)
{
  return (0<i && i<yy_start_stack_depth
	  ? yy_start_stack[yy_start_stack_ptr - i]
	  : 0);
}

#ifdef FLEX_DEBUG
void print_yy_stack(char* fmt, ...)
{
  int i = 0; va_list ap; va_start(ap, fmt);
  vfprintf(stderr, fmt, ap);
  for (i=1; i<yy_start_stack_ptr; i++)
    fprintf(stderr, "%s/", statenames[yy_start_stack[i]]);
  fprintf(stderr,"%s\n", statenames[YY_START]);
  va_end(ap);
}

static void debug_enter(int state, char* statename) {
  yy_push_state(state);
  if (yy_flex_debug) print_yy_stack("--ENTER(%s) : ",statename);
}

static void debug_leave(void) {
  if (yy_flex_debug) print_yy_stack("--LEAVE : ");
  yy_pop_state();
}

static void debug_set(int state, char* statename) {
  BEGIN(state);
  if (yy_flex_debug) print_yy_stack("--SET(%s) : ",statename);
}
#endif


static int fail(const char* fmt, ...)
{
  va_list ap; va_start(ap, fmt);
#ifdef FLEXML_yylineno
  fprintf(stderr, "Invalid XML (XML input line %d, state %d): ", yylineno, YY_START);
#else
  fprintf(stderr, "Invalid XML (state %d): ",YY_START);
#endif
  vfprintf(stderr, fmt, ap);
  fprintf(stderr, "\n");
  va_end(ap);
  return 1;
}
