Rebol [ Name: "Yuml Robot" Description: "Generate Yuml Syntax" Version: 1.0.0 Change: "" ] ROBOT: make object! [ output: copy "" note-rule: [(color: "beige") some [ 'note [ copy note-string to 'fond thru 'fond copy color to end (append output rejoin ["note: " note-string "{" "bg:" color "}"]) | copy note-string to end (append output rejoin ["note: " note-string "{" "bg:" color "}"]) ] ] | copy note-string to 'fond thru 'fond copy color to end (append output rejoin ["note: " note-string "{" "bg:" color "}"]) | copy note-string to end (append output rejoin ["note: " note-string "{" "bg:" color "}"]) ] actor-rule: [some [ [copy Actor to 'is thru 'is 'a 'Actor (append output rejoin ["[" Actor "]"])] | [copy Actor to 'is thru 'is 'a copy Actor2 to end (append output rejoin ["[" Actor "]^[" Actor2 "]"])] ] ] extend-rule: [some [copy UseCase2 to 'Extend thru 'Extend copy UseCase1 to end (append output rejoin ["(" UseCase1 ")<(" UseCase2 ")"])] ] include-rule: [some [copy UseCase2 to 'Include thru 'Include copy UseCase1 to end (append output rejoin ["(" UseCase2 ")>(" UseCase1 ")"])] ] use-rule: [some [copy Actor to 'Manage thru 'Manage copy UseCase to end (append output rejoin ["[" Actor "]-(" "Manage " UseCase ")"])] ] yuml-rule: [(Actor: copy [] Actor2: copy []) actor-rule | extend-rule | include-rule | use-rule | note-rule ] ;task1 function Generate: func [yuml-orders][ output: copy "" block-orders-draft: parse/all yuml-orders "^/" block-orders: copy [] foreach order block-orders-draft [ if (length? (order: trim/head/tail order)) > 0 [ append block-orders order ] ] foreach order block-orders [ order-block: to-block order parse order-block yuml-rule append output newline ] ] ;task2 function list: func [][ foreach Task Tasks-List [ print Task ] ] ;core engine run: func [code][ Tasks-List: copy [] ; reset the list output: copy "" do bind code 'self ] ] Worker: Make Robot[] Yuml-Orders-list: [ { Wordpress Profiles Blogger is a User Admin is a Blogger Author is a Blogger Subscriber is a User } { Blogger Role Blogger Manage Posts } { Admin Roles Admin Manage Site Manage Site Include Manage Users Manage Site Include Manage Themes Manage Site Include Manage Plugins } ] Robot-Orders: [ Yuml-Output-List: copy [] foreach Yuml-Orders Yuml-Orders-list [ Print ["Yuml-Orders: " Yuml-Orders " started ..." newline] generate Yuml-Orders Print output Append Yuml-Output-List copy output Print ["Yuml-Orders: " Yuml-Orders " done! " newline] Print Newline ] Probe Yuml-Output-List write clipboard:// mold Yuml-Output-List Print "Copied to clipboard..." ] Worker/Run Robot-Orders INPUT