Loading new/eeschema_part_sexpr_format_EN.odt −6.23 KiB (20.4 KiB) File changed.No diff preview for this file type. View original file View changed file new/make-dir-lib-source-test-data.sh +18 −3 Original line number Original line Diff line number Diff line Loading @@ -12,7 +12,8 @@ LINE="(line (pts (xy 12 13)(xy 12 20))(line_width 1.5))" RECT="(rectangle (start 4 5)(end 6 8)(line_width 2.3)(fill transparent))" RECT="(rectangle (start 4 5)(end 6 8)(line_width 2.3)(fill transparent))" CIRCLE="(circle (center 1 0)(radius 5)(line_width 2.1)(fill none))" CIRCLE="(circle (center 1 0)(radius 5)(line_width 2.1)(fill none))" ARC="(arc (pos 22 33)(radius 12)(start 2 4)(end 13 33)(line_width 2.3)(fill filled))" ARC="(arc (pos 22 33)(radius 12)(start 2 4)(end 13 33)(line_width 2.3)(fill filled))" BEZIER="(bezier (fill none)(line_width 2.0)(pts (xy 0 1)(xy 2 4)))" TEXT="(text \"This is some text\" (at 23 23 90.0)(justify left bottom)(visible yes)(fill filled))" for C in ${CATEGORIES}; do for C in ${CATEGORIES}; do Loading @@ -20,10 +21,24 @@ for C in ${CATEGORIES}; do for P in ${PARTS}; do for P in ${PARTS}; do for R in ${REVS}; do for R in ${REVS}; do echo "(part $C/$P (value 22)(footprint SM0805)(model Airplane)$LINE$RECT$CIRCLE$ARC)" > $BASEDIR/$C/$P.part.$R echo "(part $C/$P (value 22)(footprint SM0805)(model Airplane) $LINE $RECT $CIRCLE $ARC $BEZIER $TEXT )" > $BASEDIR/$C/$P.part.$R done done # also make the part without a rev: # also make the part without a rev: echo "(part $C/$P (value 22)(footprint SM0805)(model Airplane)$LINE$RECT$CIRCLE$ARC)" > $BASEDIR/$C/$P.part echo "(part $C/$P (value 22)(footprint SM0805)(model Airplane) $LINE $RECT $CIRCLE $ARC $BEZIER $TEXT )" > $BASEDIR/$C/$P.part done done done done new/sch_part.cpp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -53,6 +53,7 @@ void PART::clear() extends = 0; extends = 0; } } // graphics objects I own, and the container will not destroy them: for( GRAPHICS::iterator it = graphics.begin(); it != graphics.end(); ++it ) for( GRAPHICS::iterator it = graphics.begin(); it != graphics.end(); ++it ) delete *it; delete *it; graphics.clear(); graphics.clear(); Loading new/sch_part.h +48 −4 Original line number Original line Diff line number Diff line Loading @@ -10,7 +10,7 @@ typedef wxPoint POINT; typedef wxPoint POINT; #include <wx/gdicmn.h> #include <wx/gdicmn.h> #include <vector> #include <deque> namespace SCH { namespace SCH { Loading @@ -34,7 +34,7 @@ public: virtual ~BASE_GRAPHIC() {} virtual ~BASE_GRAPHIC() {} }; }; typedef std::vector<POINT> POINTS; typedef std::deque<POINT> POINTS; class POLY_LINE : BASE_GRAPHIC class POLY_LINE : BASE_GRAPHIC { { Loading @@ -43,6 +43,7 @@ class POLY_LINE : BASE_GRAPHIC protected: protected: double lineWidth; double lineWidth; int fillType; // T_none, T_filled, or T_transparent POINTS pts; POINTS pts; public: public: Loading @@ -51,6 +52,16 @@ public: {} {} }; }; class BEZIER : POLY_LINE { friend class PART; friend class SWEET_PARSER; public: BEZIER( PART* aOwner ) : POLY_LINE( aOwner ) {} }; class RECTANGLE : BASE_GRAPHIC class RECTANGLE : BASE_GRAPHIC { { Loading Loading @@ -107,6 +118,36 @@ public: {} {} }; }; class GR_TEXT : BASE_GRAPHIC { friend class PART; friend class SWEET_PARSER; protected: POINT pos; float angle; int fillType; // T_none, T_filled, or T_transparent int hjustify; // T_center, T_right, or T_left int vjustify; // T_center, T_top, or T_bottom bool isVisible; wxString text; // FONT font; public: GR_TEXT( PART* aOwner ) : BASE_GRAPHIC( aOwner ) /* , fillType( T_filled ), hjustify( T_left ), vjustify( T_bottom ), angle( 0 ), isVisible( true ) */ {} }; } // namespace SCH } // namespace SCH Loading @@ -115,7 +156,7 @@ public: namespace SCH { namespace SCH { typedef std::vector< BASE_GRAPHIC* > GRAPHICS; typedef std::deque< BASE_GRAPHIC* > GRAPHICS; class LPID; class LPID; class SWEET_PARSER; class SWEET_PARSER; Loading Loading @@ -180,7 +221,10 @@ protected: // not likely to have C++ descendants, but protected none-the-le /// A property list. /// A property list. //PROPERTIES properties; //PROPERTIES properties; /// A drawing list for graphics /** * Member graphics * owns : POLY_LINE, RECTANGLE, CIRCLE, ARC, BEZIER, and GR_TEXT objects. */ GRAPHICS graphics; GRAPHICS graphics; /// A pin list /// A pin list Loading new/sch_sweet_parser.cpp +170 −12 Original line number Original line Diff line number Diff line Loading @@ -180,6 +180,9 @@ void SWEET_PARSER::Parse( PART* me, LIB_TABLE* aTable ) throw( IO_ERROR, PARSE_E if( tok == T_LEFT ) if( tok == T_LEFT ) tok = NextTok(); tok = NextTok(); // because exceptions are thrown, any 'new' allocation has to be stored // somewhere other than on the stack, ASAP. switch( tok ) switch( tok ) { { default: default: Loading Loading @@ -233,6 +236,20 @@ void SWEET_PARSER::Parse( PART* me, LIB_TABLE* aTable ) throw( IO_ERROR, PARSE_E parseArc( arc ); parseArc( arc ); break; break; case T_bezier: BEZIER* bezier; bezier = new BEZIER( me ); me->graphics.push_back( bezier ); parseBezier( bezier ); break; case T_text: GR_TEXT* text; text = new GR_TEXT( me ); me->graphics.push_back( text ); parseText( text ); break; case T_value: case T_value: if( contains & PB(VALUE) ) if( contains & PB(VALUE) ) Duplicate( tok ); Duplicate( tok ); Loading Loading @@ -263,7 +280,6 @@ void SWEET_PARSER::Parse( PART* me, LIB_TABLE* aTable ) throw( IO_ERROR, PARSE_E NeedRIGHT(); NeedRIGHT(); break; break; /* /* case T_keywords: case T_keywords: break; break; Loading Loading @@ -295,11 +311,6 @@ void SWEET_PARSER::Parse( PART* me, LIB_TABLE* aTable ) throw( IO_ERROR, PARSE_E case T_route_pin_swap: case T_route_pin_swap: break; break; case T_bezier: break; case T_text: break; */ */ // Not sure about reference in a PART, comes in at COMPONENT object. // Not sure about reference in a PART, comes in at COMPONENT object. Loading @@ -321,7 +332,9 @@ void SWEET_PARSER::Parse( PART* me, LIB_TABLE* aTable ) throw( IO_ERROR, PARSE_E void SWEET_PARSER::parsePolyLine( POLY_LINE* me ) void SWEET_PARSER::parsePolyLine( POLY_LINE* me ) { { T tok; T tok; int count; int count = 0; bool sawWidth = false; bool sawFill = false; NeedLEFT(); NeedLEFT(); while( ( tok = NextTok() ) != T_RIGHT ) while( ( tok = NextTok() ) != T_RIGHT ) Loading @@ -332,13 +345,18 @@ void SWEET_PARSER::parsePolyLine( POLY_LINE* me ) switch( tok ) switch( tok ) { { case T_line_width: case T_line_width: if( sawWidth ) Duplicate( tok ); NeedNUMBER( "line_width" ); NeedNUMBER( "line_width" ); me->lineWidth = strtod( CurText(), NULL ); me->lineWidth = strtod( CurText(), NULL ); NeedRIGHT(); NeedRIGHT(); sawWidth = true; break; break; case T_pts: case T_pts: for( count=0; ( tok = NextTok() ) != T_RIGHT; ++count ) if( count ) Duplicate( tok ); for( ; ( tok = NextTok() ) != T_RIGHT; ++count ) { { if( tok != T_LEFT ) if( tok != T_LEFT ) Expecting( T_LEFT ); Expecting( T_LEFT ); Loading @@ -357,10 +375,26 @@ void SWEET_PARSER::parsePolyLine( POLY_LINE* me ) NeedRIGHT(); NeedRIGHT(); } } if( count < 2 ) Expecting( ">= 2 pts" ); break; break; case T_fill: case T_fill: // @todo figure this out, maybe spit into polygon if( sawFill ) Duplicate( tok ); tok = NeedSYMBOL(); switch( tok ) { case T_none: case T_filled: case T_transparent: me->fillType = tok; break; default: Expecting( "none|filled|transparent" ); } NeedRIGHT(); sawFill = true; break; break; default: default: Loading @@ -370,6 +404,12 @@ void SWEET_PARSER::parsePolyLine( POLY_LINE* me ) } } void SWEET_PARSER::parseBezier( BEZIER* me ) { parsePolyLine( me ); } void SWEET_PARSER::parseRectangle( RECTANGLE* me ) void SWEET_PARSER::parseRectangle( RECTANGLE* me ) { { T tok; T tok; Loading @@ -391,8 +431,8 @@ void SWEET_PARSER::parseRectangle( RECTANGLE* me ) Duplicate( tok ); Duplicate( tok ); NeedNUMBER( "line_width" ); NeedNUMBER( "line_width" ); me->lineWidth = strtod( CurText(), NULL ); me->lineWidth = strtod( CurText(), NULL ); sawWidth = true; NeedRIGHT(); NeedRIGHT(); sawWidth = true; break; break; case T_fill: case T_fill: Loading Loading @@ -463,8 +503,8 @@ void SWEET_PARSER::parseCircle( CIRCLE* me ) Duplicate( tok ); Duplicate( tok ); NeedNUMBER( "line_width" ); NeedNUMBER( "line_width" ); me->lineWidth = strtod( CurText(), NULL ); me->lineWidth = strtod( CurText(), NULL ); sawWidth = true; NeedRIGHT(); NeedRIGHT(); sawWidth = true; break; break; case T_fill: case T_fill: Loading Loading @@ -535,8 +575,8 @@ void SWEET_PARSER::parseArc( ARC* me ) Duplicate( tok ); Duplicate( tok ); NeedNUMBER( "line_width" ); NeedNUMBER( "line_width" ); me->lineWidth = strtod( CurText(), NULL ); me->lineWidth = strtod( CurText(), NULL ); sawWidth = true; NeedRIGHT(); NeedRIGHT(); sawWidth = true; break; break; case T_fill: case T_fill: Loading Loading @@ -604,3 +644,121 @@ void SWEET_PARSER::parseArc( ARC* me ) } } } } } } void SWEET_PARSER::parseText( GR_TEXT* me ) { T tok; bool sawAt = false; bool sawFill = false; bool sawFont = false; bool sawVis = false; bool sawJust = false; NeedSYMBOLorNUMBER(); me->text = FROM_UTF8( CurText() ); NeedLEFT(); while( ( tok = NextTok() ) != T_RIGHT ) { if( tok == T_LEFT ) tok = NextTok(); switch( tok ) { case T_at: if( sawAt ) Duplicate( tok ); NeedNUMBER( "at x" ); me->pos.x = internal( CurText() ); NeedNUMBER( "at y" ); me->pos.y = internal( CurText() ); tok = NextTok(); if( tok == T_NUMBER ) { me->angle = strtod( CurText(), NULL ); tok = NextTok(); } if( tok != T_RIGHT ) Expecting( T_RIGHT ); sawAt = true; break; case T_fill: if( sawFill ) Duplicate( tok ); tok = NeedSYMBOL(); switch( tok ) { case T_none: case T_filled: case T_transparent: me->fillType = tok; break; default: Expecting( "none|filled|transparent" ); } NeedRIGHT(); sawFill = true; break; case T_justify: if( sawJust ) Duplicate( tok ); tok = NeedSYMBOL(); switch( tok ) { case T_center: case T_right: case T_left: me->hjustify = tok; break; default: Expecting( "center|right|left" ); } tok = NeedSYMBOL(); switch( tok ) { case T_center: case T_top: case T_bottom: me->vjustify = tok; break; default: Expecting( "center|top|bottom" ); } NeedRIGHT(); sawJust = true; break; case T_visible: if( sawVis ) Duplicate( tok ); tok = NeedSYMBOL(); switch( tok ) { case T_yes: case T_no: me->isVisible = (tok == T_yes); break; default: Expecting( "yes|no" ); } NeedRIGHT(); sawVis = true; break; case T_font: // @todo sawFont = true; break; default: Expecting( "at|justify|font|visible|fill" ); } } } Loading
new/eeschema_part_sexpr_format_EN.odt −6.23 KiB (20.4 KiB) File changed.No diff preview for this file type. View original file View changed file
new/make-dir-lib-source-test-data.sh +18 −3 Original line number Original line Diff line number Diff line Loading @@ -12,7 +12,8 @@ LINE="(line (pts (xy 12 13)(xy 12 20))(line_width 1.5))" RECT="(rectangle (start 4 5)(end 6 8)(line_width 2.3)(fill transparent))" RECT="(rectangle (start 4 5)(end 6 8)(line_width 2.3)(fill transparent))" CIRCLE="(circle (center 1 0)(radius 5)(line_width 2.1)(fill none))" CIRCLE="(circle (center 1 0)(radius 5)(line_width 2.1)(fill none))" ARC="(arc (pos 22 33)(radius 12)(start 2 4)(end 13 33)(line_width 2.3)(fill filled))" ARC="(arc (pos 22 33)(radius 12)(start 2 4)(end 13 33)(line_width 2.3)(fill filled))" BEZIER="(bezier (fill none)(line_width 2.0)(pts (xy 0 1)(xy 2 4)))" TEXT="(text \"This is some text\" (at 23 23 90.0)(justify left bottom)(visible yes)(fill filled))" for C in ${CATEGORIES}; do for C in ${CATEGORIES}; do Loading @@ -20,10 +21,24 @@ for C in ${CATEGORIES}; do for P in ${PARTS}; do for P in ${PARTS}; do for R in ${REVS}; do for R in ${REVS}; do echo "(part $C/$P (value 22)(footprint SM0805)(model Airplane)$LINE$RECT$CIRCLE$ARC)" > $BASEDIR/$C/$P.part.$R echo "(part $C/$P (value 22)(footprint SM0805)(model Airplane) $LINE $RECT $CIRCLE $ARC $BEZIER $TEXT )" > $BASEDIR/$C/$P.part.$R done done # also make the part without a rev: # also make the part without a rev: echo "(part $C/$P (value 22)(footprint SM0805)(model Airplane)$LINE$RECT$CIRCLE$ARC)" > $BASEDIR/$C/$P.part echo "(part $C/$P (value 22)(footprint SM0805)(model Airplane) $LINE $RECT $CIRCLE $ARC $BEZIER $TEXT )" > $BASEDIR/$C/$P.part done done done done
new/sch_part.cpp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -53,6 +53,7 @@ void PART::clear() extends = 0; extends = 0; } } // graphics objects I own, and the container will not destroy them: for( GRAPHICS::iterator it = graphics.begin(); it != graphics.end(); ++it ) for( GRAPHICS::iterator it = graphics.begin(); it != graphics.end(); ++it ) delete *it; delete *it; graphics.clear(); graphics.clear(); Loading
new/sch_part.h +48 −4 Original line number Original line Diff line number Diff line Loading @@ -10,7 +10,7 @@ typedef wxPoint POINT; typedef wxPoint POINT; #include <wx/gdicmn.h> #include <wx/gdicmn.h> #include <vector> #include <deque> namespace SCH { namespace SCH { Loading @@ -34,7 +34,7 @@ public: virtual ~BASE_GRAPHIC() {} virtual ~BASE_GRAPHIC() {} }; }; typedef std::vector<POINT> POINTS; typedef std::deque<POINT> POINTS; class POLY_LINE : BASE_GRAPHIC class POLY_LINE : BASE_GRAPHIC { { Loading @@ -43,6 +43,7 @@ class POLY_LINE : BASE_GRAPHIC protected: protected: double lineWidth; double lineWidth; int fillType; // T_none, T_filled, or T_transparent POINTS pts; POINTS pts; public: public: Loading @@ -51,6 +52,16 @@ public: {} {} }; }; class BEZIER : POLY_LINE { friend class PART; friend class SWEET_PARSER; public: BEZIER( PART* aOwner ) : POLY_LINE( aOwner ) {} }; class RECTANGLE : BASE_GRAPHIC class RECTANGLE : BASE_GRAPHIC { { Loading Loading @@ -107,6 +118,36 @@ public: {} {} }; }; class GR_TEXT : BASE_GRAPHIC { friend class PART; friend class SWEET_PARSER; protected: POINT pos; float angle; int fillType; // T_none, T_filled, or T_transparent int hjustify; // T_center, T_right, or T_left int vjustify; // T_center, T_top, or T_bottom bool isVisible; wxString text; // FONT font; public: GR_TEXT( PART* aOwner ) : BASE_GRAPHIC( aOwner ) /* , fillType( T_filled ), hjustify( T_left ), vjustify( T_bottom ), angle( 0 ), isVisible( true ) */ {} }; } // namespace SCH } // namespace SCH Loading @@ -115,7 +156,7 @@ public: namespace SCH { namespace SCH { typedef std::vector< BASE_GRAPHIC* > GRAPHICS; typedef std::deque< BASE_GRAPHIC* > GRAPHICS; class LPID; class LPID; class SWEET_PARSER; class SWEET_PARSER; Loading Loading @@ -180,7 +221,10 @@ protected: // not likely to have C++ descendants, but protected none-the-le /// A property list. /// A property list. //PROPERTIES properties; //PROPERTIES properties; /// A drawing list for graphics /** * Member graphics * owns : POLY_LINE, RECTANGLE, CIRCLE, ARC, BEZIER, and GR_TEXT objects. */ GRAPHICS graphics; GRAPHICS graphics; /// A pin list /// A pin list Loading
new/sch_sweet_parser.cpp +170 −12 Original line number Original line Diff line number Diff line Loading @@ -180,6 +180,9 @@ void SWEET_PARSER::Parse( PART* me, LIB_TABLE* aTable ) throw( IO_ERROR, PARSE_E if( tok == T_LEFT ) if( tok == T_LEFT ) tok = NextTok(); tok = NextTok(); // because exceptions are thrown, any 'new' allocation has to be stored // somewhere other than on the stack, ASAP. switch( tok ) switch( tok ) { { default: default: Loading Loading @@ -233,6 +236,20 @@ void SWEET_PARSER::Parse( PART* me, LIB_TABLE* aTable ) throw( IO_ERROR, PARSE_E parseArc( arc ); parseArc( arc ); break; break; case T_bezier: BEZIER* bezier; bezier = new BEZIER( me ); me->graphics.push_back( bezier ); parseBezier( bezier ); break; case T_text: GR_TEXT* text; text = new GR_TEXT( me ); me->graphics.push_back( text ); parseText( text ); break; case T_value: case T_value: if( contains & PB(VALUE) ) if( contains & PB(VALUE) ) Duplicate( tok ); Duplicate( tok ); Loading Loading @@ -263,7 +280,6 @@ void SWEET_PARSER::Parse( PART* me, LIB_TABLE* aTable ) throw( IO_ERROR, PARSE_E NeedRIGHT(); NeedRIGHT(); break; break; /* /* case T_keywords: case T_keywords: break; break; Loading Loading @@ -295,11 +311,6 @@ void SWEET_PARSER::Parse( PART* me, LIB_TABLE* aTable ) throw( IO_ERROR, PARSE_E case T_route_pin_swap: case T_route_pin_swap: break; break; case T_bezier: break; case T_text: break; */ */ // Not sure about reference in a PART, comes in at COMPONENT object. // Not sure about reference in a PART, comes in at COMPONENT object. Loading @@ -321,7 +332,9 @@ void SWEET_PARSER::Parse( PART* me, LIB_TABLE* aTable ) throw( IO_ERROR, PARSE_E void SWEET_PARSER::parsePolyLine( POLY_LINE* me ) void SWEET_PARSER::parsePolyLine( POLY_LINE* me ) { { T tok; T tok; int count; int count = 0; bool sawWidth = false; bool sawFill = false; NeedLEFT(); NeedLEFT(); while( ( tok = NextTok() ) != T_RIGHT ) while( ( tok = NextTok() ) != T_RIGHT ) Loading @@ -332,13 +345,18 @@ void SWEET_PARSER::parsePolyLine( POLY_LINE* me ) switch( tok ) switch( tok ) { { case T_line_width: case T_line_width: if( sawWidth ) Duplicate( tok ); NeedNUMBER( "line_width" ); NeedNUMBER( "line_width" ); me->lineWidth = strtod( CurText(), NULL ); me->lineWidth = strtod( CurText(), NULL ); NeedRIGHT(); NeedRIGHT(); sawWidth = true; break; break; case T_pts: case T_pts: for( count=0; ( tok = NextTok() ) != T_RIGHT; ++count ) if( count ) Duplicate( tok ); for( ; ( tok = NextTok() ) != T_RIGHT; ++count ) { { if( tok != T_LEFT ) if( tok != T_LEFT ) Expecting( T_LEFT ); Expecting( T_LEFT ); Loading @@ -357,10 +375,26 @@ void SWEET_PARSER::parsePolyLine( POLY_LINE* me ) NeedRIGHT(); NeedRIGHT(); } } if( count < 2 ) Expecting( ">= 2 pts" ); break; break; case T_fill: case T_fill: // @todo figure this out, maybe spit into polygon if( sawFill ) Duplicate( tok ); tok = NeedSYMBOL(); switch( tok ) { case T_none: case T_filled: case T_transparent: me->fillType = tok; break; default: Expecting( "none|filled|transparent" ); } NeedRIGHT(); sawFill = true; break; break; default: default: Loading @@ -370,6 +404,12 @@ void SWEET_PARSER::parsePolyLine( POLY_LINE* me ) } } void SWEET_PARSER::parseBezier( BEZIER* me ) { parsePolyLine( me ); } void SWEET_PARSER::parseRectangle( RECTANGLE* me ) void SWEET_PARSER::parseRectangle( RECTANGLE* me ) { { T tok; T tok; Loading @@ -391,8 +431,8 @@ void SWEET_PARSER::parseRectangle( RECTANGLE* me ) Duplicate( tok ); Duplicate( tok ); NeedNUMBER( "line_width" ); NeedNUMBER( "line_width" ); me->lineWidth = strtod( CurText(), NULL ); me->lineWidth = strtod( CurText(), NULL ); sawWidth = true; NeedRIGHT(); NeedRIGHT(); sawWidth = true; break; break; case T_fill: case T_fill: Loading Loading @@ -463,8 +503,8 @@ void SWEET_PARSER::parseCircle( CIRCLE* me ) Duplicate( tok ); Duplicate( tok ); NeedNUMBER( "line_width" ); NeedNUMBER( "line_width" ); me->lineWidth = strtod( CurText(), NULL ); me->lineWidth = strtod( CurText(), NULL ); sawWidth = true; NeedRIGHT(); NeedRIGHT(); sawWidth = true; break; break; case T_fill: case T_fill: Loading Loading @@ -535,8 +575,8 @@ void SWEET_PARSER::parseArc( ARC* me ) Duplicate( tok ); Duplicate( tok ); NeedNUMBER( "line_width" ); NeedNUMBER( "line_width" ); me->lineWidth = strtod( CurText(), NULL ); me->lineWidth = strtod( CurText(), NULL ); sawWidth = true; NeedRIGHT(); NeedRIGHT(); sawWidth = true; break; break; case T_fill: case T_fill: Loading Loading @@ -604,3 +644,121 @@ void SWEET_PARSER::parseArc( ARC* me ) } } } } } } void SWEET_PARSER::parseText( GR_TEXT* me ) { T tok; bool sawAt = false; bool sawFill = false; bool sawFont = false; bool sawVis = false; bool sawJust = false; NeedSYMBOLorNUMBER(); me->text = FROM_UTF8( CurText() ); NeedLEFT(); while( ( tok = NextTok() ) != T_RIGHT ) { if( tok == T_LEFT ) tok = NextTok(); switch( tok ) { case T_at: if( sawAt ) Duplicate( tok ); NeedNUMBER( "at x" ); me->pos.x = internal( CurText() ); NeedNUMBER( "at y" ); me->pos.y = internal( CurText() ); tok = NextTok(); if( tok == T_NUMBER ) { me->angle = strtod( CurText(), NULL ); tok = NextTok(); } if( tok != T_RIGHT ) Expecting( T_RIGHT ); sawAt = true; break; case T_fill: if( sawFill ) Duplicate( tok ); tok = NeedSYMBOL(); switch( tok ) { case T_none: case T_filled: case T_transparent: me->fillType = tok; break; default: Expecting( "none|filled|transparent" ); } NeedRIGHT(); sawFill = true; break; case T_justify: if( sawJust ) Duplicate( tok ); tok = NeedSYMBOL(); switch( tok ) { case T_center: case T_right: case T_left: me->hjustify = tok; break; default: Expecting( "center|right|left" ); } tok = NeedSYMBOL(); switch( tok ) { case T_center: case T_top: case T_bottom: me->vjustify = tok; break; default: Expecting( "center|top|bottom" ); } NeedRIGHT(); sawJust = true; break; case T_visible: if( sawVis ) Duplicate( tok ); tok = NeedSYMBOL(); switch( tok ) { case T_yes: case T_no: me->isVisible = (tok == T_yes); break; default: Expecting( "yes|no" ); } NeedRIGHT(); sawVis = true; break; case T_font: // @todo sawFont = true; break; default: Expecting( "at|justify|font|visible|fill" ); } } }