Comandos SLOGO


SLogoScript::= Sentence+ Sentence ::= (Attrib!)* Object Remarks? | Defs | Remarks Defs ::= Template=(Attr-CSS+)* Attr-CSS! ; Macros=Any Attrib Remarks ::= % Char+ Attrib ::= Attr-CSS | Attr-Trx | Attr-Var | Attr-Adv | Template Attr-CSS ::= Attr-Basic | Attr-Font | Attr-Tag Attr-Basic ::= Color | Border | Opacity Attr-Font ::= bold | italic | Font-Size | Align | Font | Txt-Rotate Attr-Tag ::= CSS-based | SVG-based Attr-Trx ::= Translate | Rotate | Scale | Animate Attr-Var ::= (p|piv|pivot)=Point ; Rotate-Pivot Point Attr-Adv ::= (save|@) | @G | @L Template ::= m(Char+) | k(Char+) Object ::= [ SlogoScript ] | Text! | Figure! Figure ::= Line | Rect | Circ | Path | Image | File Text ::= Point,Char+(http://Char+)? Line ::= (L|A) Point, Point ; Line or Arrow Rect ::= R(3D)? Point, Dim(, N99)? Circ ::= C(3D)? Point, Dim ; Circle or Ellipse Path ::= (P|Q)(3D)? SVG_Path ; SLOGO Path = SVG_Path Image ::= I Point, Dim, http://Char+ File ::= (F|file)(=)?(http://)?Char+ Color ::= c|c=none|c(=)?CVal Border ::= b|b=none|b(=)?CVal(,Digit+)? Opacity ::= o(=)?N100 CSS-based ::= s(=)?Char+ ; e.g. s=font-family:Arial; SVG-based ::= S(=)?Char+ ; e.g. S=fill=’none’; Translate ::= t(=)?Point Rotate ::= (r|rot|rotate)(=)?(Angle|Repeat-Rot)(,Point)? Scale ::= z(=)?(Scale|Scale2) ; e.g. z=2! z=0.25:1.5! Animate ::= aAnim-Attr=Anim-Range,(Init|Anim-Time) Txt-Rotate ::= tr|trot Font-Size ::= 8..99(pt|px) Align ::= lf|left| rg|right| ct|center Font ::= mono | sans | serif | script | fantasy | f(=)?Char+ Anim-Attr ::= x1|x2|y1|y2| ; Line w|width|h|height| ; Rect x|y|r|rx|ry| ; Circ and Rect c|color| ; A-Range ::= CVal @ CVal o|opacity| ; A-Range ::= N100 @ N100 r|rot|rotate| ; A-Range ::= Angle @ Angle t|trans| ; A-Range ::= Point @ Point s|scale|z| ; A-Range ::= Scale2 @ Scale2 sx|zx| ; A-Range ::= Scale @ Scale sy|sy ; A-Range ::= Scale @ Scale Anim-Range ::= Value@Value ; Range: from @ to Anim-Time ::= Init@Dur(@Repeat)? ; Time: begin @ dur Init | Dur ::= Digit+(.Digit+)? Repeat ::= -1|Digit+ ; Indefinite = -1 Repeat-Rot ::= Angle@Angle(@Angle)? ; Rotate: from @ to @ step Value ::= Dim | CVal | N100 | Point | Angle | Number | Scale | Scale2 CVal ::= Char+ | Hex-Dig | Hex-Dig{3} | Hex-Dig{6} Point ::= Number | Number:Number Dim ::= Digit+ | Digit+:Digit+ N99 ::= 1..99 | 1..99:1..99 ; Compact or Expanded form Scale2 ::= Scale:Scale Scale ::= 0.01..1.0 | 1.0..99 Number ::= -?Digit+ N100 ::= 0.0..1.0 | 0..100 Angle ::= -359..359 SVG_Path ::= Char+(Char|Digit|,)+ ; Same as SVG_Path Grammar Hex-Dig ::= Digit | A..F Digit ::= 0..9 Char ::= a..z


By Alberto Pacheco, alberto@acm.org (c) 2009