Changeset 113 for branches/generator
- Timestamp:
- Aug 9, 2017, 10:14:31 PM (7 years ago)
- Location:
- branches/generator
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/generator/Forms/UFormRule.lfm
r112 r113 114 114 Action = ARemove 115 115 end 116 object ToolButton4: TToolButton 117 Left = 70 118 Top = 2 119 Action = AMoveUp 120 end 121 object ToolButton5: TToolButton 122 Left = 93 123 Top = 2 124 Action = AMoveDown 125 end 116 126 end 117 127 object ActionList1: TActionList … … 134 144 OnExecute = ARemoveExecute 135 145 end 146 object AMoveUp: TAction 147 Caption = 'Move up' 148 ImageIndex = 7 149 OnExecute = AMoveUpExecute 150 end 151 object AMoveDown: TAction 152 Caption = 'Move down' 153 ImageIndex = 6 154 OnExecute = AMoveDownExecute 155 end 136 156 end 137 157 object PopupMenu1: TPopupMenu 138 158 Images = Core.ImageList1 139 159 left = 118 140 top = 18 5160 top = 187 141 161 object MenuItem1: TMenuItem 142 162 Action = AAdd … … 148 168 Action = ARemove 149 169 end 170 object MenuItem4: TMenuItem 171 Action = AMoveUp 172 end 173 object MenuItem5: TMenuItem 174 Action = AMoveDown 175 end 150 176 end 151 177 end -
branches/generator/Forms/UFormRule.pas
r112 r113 15 15 TFormRule = class(TForm) 16 16 AAdd: TAction; 17 AMoveUp: TAction; 18 AMoveDown: TAction; 17 19 AModify: TAction; 18 20 ARemove: TAction; … … 28 30 MenuItem2: TMenuItem; 29 31 MenuItem3: TMenuItem; 32 MenuItem4: TMenuItem; 33 MenuItem5: TMenuItem; 30 34 PopupMenu1: TPopupMenu; 31 35 ToolBar1: TToolBar; … … 33 37 ToolButton2: TToolButton; 34 38 ToolButton3: TToolButton; 39 ToolButton4: TToolButton; 40 ToolButton5: TToolButton; 35 41 procedure AAddExecute(Sender: TObject); 36 42 procedure AModifyExecute(Sender: TObject); 43 procedure AMoveDownExecute(Sender: TObject); 44 procedure AMoveUpExecute(Sender: TObject); 37 45 procedure ARemoveExecute(Sender: TObject); 38 46 procedure FormShow(Sender: TObject); … … 123 131 end; 124 132 133 procedure TFormRule.AMoveDownExecute(Sender: TObject); 134 begin 135 Rule.Items.Move(ListView.Selected.Index, ListView.Selected.Index + 1); 136 // ShowMessage(IntToStr(ListView.ItemIndex)); 137 ListView.ItemIndex := ListView.Selected.Index + 1; 138 // ShowMessage(IntToStr(ListView.ItemIndex)); 139 ReloadList; 140 end; 141 142 procedure TFormRule.AMoveUpExecute(Sender: TObject); 143 begin 144 Rule.Items.Move(ListView.Selected.Index, ListView.Selected.Index - 1); 145 ListView.ItemIndex := ListView.Selected.Index - 1; 146 ReloadList; 147 end; 148 125 149 procedure TFormRule.ARemoveExecute(Sender: TObject); 126 150 var … … 137 161 AModify.Enabled := Assigned(ListView.Selected); 138 162 ARemove.Enabled := Assigned(ListView.Selected); 163 AMoveUp.Enabled := Assigned(ListView.Selected) and (ListView.Selected.Index > 0); 164 AMoveDown.Enabled := Assigned(ListView.Selected) and (ListView.Selected.Index < (ListView.Items.Count - 1)); 139 165 end; 140 166 -
branches/generator/UCore.lfm
r112 r113 11 11 top = 243 12 12 Bitmap = { 13 4C690 6000000100000001000000000000000000000000000000000000000000013 4C69080000001000000010000000000000000000000000000000000000000000 14 14 000070A970FF006400FF006200FF70A670FF0000000000000000000000000000 15 15 0000000000000000000000000000000000000000000000000000000000000000 … … 203 203 00FF000000FF000000FF00000000000000000000000000000000000000000000 204 204 0000000000000000000000000000000000000000000000000000000000000000 205 0000000000000000000000000000000000000000000000000000000000000000 206 0000000000000000000000000000000000000000000000000000000000000000 207 0000000000000000000000000000000000000000000000000000000000000000 208 00FF000000FF000000FF000000FF000000FF000000FF000000FF000000000000 209 0000000000000000000000000000000000000000000000000000000000000000 210 00FFFF2619FFFF2E1EFFFF3522FFFF3C28FFFF442CFF000000FF000000000000 211 0000000000000000000000000000000000000000000000000000000000000000 212 00FFFF3623FFFF3C28FFFF442CFFFF4C32FFFF5337FF000000FF000000000000 213 0000000000000000000000000000000000000000000000000000000000000000 214 00FFFF442CFFFF4C32FFFF5437FFFF5C3BFFFF6341FF000000FF000000000000 215 0000000000000000000000000000000000000000000000000000000000000000 216 00FFFF5437FFFF5D3CFFFF6441FFFF6B46FFFF724AFF000000FF000000000000 217 0000000000000000000000000000000000000000000000000000000000000000 218 00FFFF6441FFFF6C46FFFF744BFFFF7A4FFFFF8255FF000000FF000000000000 219 0000000000000000000000000000000000000000000000000000000000000000 220 00FFFF744CFFFF7C51FFFF8255FFFF8A5AFFFF915FFF000000FF000000000000 221 0000000000000000000000000000000000FF000000FF000000FF000000FF0000 222 00FFFF8456FFFF8A5AFFFF9360FFFF9A65FFFFA169FF000000FF000000FF0000 223 00FF000000FF000000FF0000000000000000000000FFFF7C51FFFF8456FFFF8C 224 5BFFFF9360FFFF9A65FFFFA269FFFFAA6EFFFFB073FFFFB878FFFFBF7DFFFFC6 225 81FF000000FF00000000000000000000000000000000000000FFFF9461FFFF9A 226 65FFFFA269FFFFAA6EFFFFB174FFFFB878FFFFC17DFFFFC882FFFFCF87FF0000 227 00FF000000000000000000000000000000000000000000000000000000FFFFAA 228 6EFFFFB374FFFFBA79FFFFC17DFFFFC882FFFFD088FFFFD78CFF000000FF0000 229 0000000000000000000000000000000000000000000000000000000000000000 230 00FFFFC27EFFFFC882FFFFD088FFFFD88CFFFFE092FF000000FF000000000000 231 0000000000000000000000000000000000000000000000000000000000000000 232 0000000000FFFFD88CFFFFE092FFFFE797FF000000FF00000000000000000000 233 0000000000000000000000000000000000000000000000000000000000000000 234 000000000000000000FFFFF09CFF000000FF0000000000000000000000000000 235 0000000000000000000000000000000000000000000000000000000000000000 236 00000000000000000000000000FF000000000000000000000000000000000000 237 0000000000000000000000000000000000000000000000000000000000000000 238 0000000000000000000000000000000000FF0000000000000000000000000000 239 0000000000000000000000000000000000000000000000000000000000000000 240 00000000000000000000000000FFFFF09CFF000000FF00000000000000000000 241 0000000000000000000000000000000000000000000000000000000000000000 242 000000000000000000FFFFE797FFFFE092FFFFD88CFF000000FF000000000000 243 0000000000000000000000000000000000000000000000000000000000000000 244 0000000000FFFFE092FFFFD88CFFFFD088FFFFC882FFFFC27EFF000000FF0000 245 0000000000000000000000000000000000000000000000000000000000000000 246 00FFFFD78CFFFFD088FFFFC882FFFFC17DFFFFBA79FFFFB374FFFFAA6EFF0000 247 00FF000000000000000000000000000000000000000000000000000000FFFFCF 248 87FFFFC882FFFFC17DFFFFB878FFFFB174FFFFAA6EFFFFA269FFFF9A65FFFF94 249 61FF000000FF00000000000000000000000000000000000000FFFFC681FFFFBF 250 7DFFFFB878FFFFB073FFFFAA6EFFFFA269FFFF9A65FFFF9360FFFF8C5BFFFF84 251 56FFFF7C51FF000000FF0000000000000000000000FF000000FF000000FF0000 252 00FF000000FFFFA169FFFF9A65FFFF9360FFFF8A5AFFFF8456FF000000FF0000 253 00FF000000FF000000FF000000FF000000000000000000000000000000000000 254 0000000000FFFF915FFFFF8A5AFFFF8255FFFF7C51FFFF744CFF000000FF0000 255 0000000000000000000000000000000000000000000000000000000000000000 256 0000000000FFFF8255FFFF7A4FFFFF744BFFFF6C46FFFF6441FF000000FF0000 257 0000000000000000000000000000000000000000000000000000000000000000 258 0000000000FFFF724AFFFF6B46FFFF6441FFFF5D3CFFFF5437FF000000FF0000 259 0000000000000000000000000000000000000000000000000000000000000000 260 0000000000FFFF6341FFFF5C3BFFFF5437FFFF4C32FFFF442CFF000000FF0000 261 0000000000000000000000000000000000000000000000000000000000000000 262 0000000000FFFF5337FFFF4C32FFFF442CFFFF3C28FFFF3623FF000000FF0000 263 0000000000000000000000000000000000000000000000000000000000000000 264 0000000000FFFF442CFFFF3C28FFFF3522FFFF2E1EFFFF2619FF000000FF0000 265 0000000000000000000000000000000000000000000000000000000000000000 266 0000000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000 267 0000000000000000000000000000000000000000000000000000000000000000 268 0000000000000000000000000000000000000000000000000000000000000000 205 269 0000000000000000000000000000 206 270 } -
branches/generator/URules.pas
r112 r113 229 229 begin 230 230 WriteString(Node, 'Name', Name); 231 WriteInteger(Node, 'Type', Integer(RuleType)); 231 232 232 233 RuleItemsNode := Node.OwnerDocument.CreateElement('RuleItems'); … … 266 267 begin 267 268 Name := ReadString(Node, 'Name', ''); 269 RuleType := TRuleType(ReadInteger(Node, 'Type', Integer(rtAnd))); 268 270 269 271 ItemsNode := Node.FindNode('RuleItems'); -
branches/generator/pascal.grm
r111 r113 4 4 <Rule> 5 5 <Name>BeginEnd</Name> 6 <Type>0</Type> 6 7 <RuleItems> 7 8 <RuleItem> … … 11 12 <RuleItem> 12 13 <Type>1</Type> 13 <NonTerminal> Command</NonTerminal>14 <NonTerminal>Statement</NonTerminal> 14 15 </RuleItem> 15 16 <RuleItem> … … 21 22 <Rule> 22 23 <Name>IfThenElse</Name> 24 <Type>0</Type> 23 25 <RuleItems> 24 26 <RuleItem> … … 36 38 <RuleItem> 37 39 <Type>1</Type> 38 <NonTerminal> Command</NonTerminal>40 <NonTerminal>Statement</NonTerminal> 39 41 </RuleItem> 40 42 <RuleItem> … … 44 46 <RuleItem> 45 47 <Type>1</Type> 46 <NonTerminal> Command</NonTerminal>48 <NonTerminal>Statement</NonTerminal> 47 49 </RuleItem> 48 50 <RuleItem> … … 54 56 <Rule> 55 57 <Name>WhileDo</Name> 58 <Type>0</Type> 56 59 <RuleItems> 57 60 <RuleItem> … … 69 72 <RuleItem> 70 73 <Type>1</Type> 71 <NonTerminal> Command</NonTerminal>74 <NonTerminal>Statement</NonTerminal> 72 75 </RuleItem> 73 76 </RuleItems> … … 75 78 <Rule> 76 79 <Name>RepeatUntil</Name> 80 <Type>0</Type> 77 81 <RuleItems> 78 82 <RuleItem> … … 82 86 <RuleItem> 83 87 <Type>1</Type> 84 <NonTerminal> Command</NonTerminal>88 <NonTerminal>Statement</NonTerminal> 85 89 </RuleItem> 86 90 <RuleItem> … … 96 100 <Rule> 97 101 <Name>ForToDo</Name> 102 <Type>0</Type> 103 <RuleItems> 104 <RuleItem> 105 <Type>0</Type> 106 <Terminal>for</Terminal> 107 </RuleItem> 108 <RuleItem> 109 <Type>1</Type> 110 <NonTerminal>VariableRef</NonTerminal> 111 </RuleItem> 112 <RuleItem> 113 <Type>0</Type> 114 <Terminal>:=</Terminal> 115 </RuleItem> 116 <RuleItem> 117 <Type>1</Type> 118 <NonTerminal>Expression</NonTerminal> 119 </RuleItem> 120 <RuleItem> 121 <Type>0</Type> 122 <Terminal>to</Terminal> 123 </RuleItem> 124 <RuleItem> 125 <Type>1</Type> 126 <NonTerminal>Expression</NonTerminal> 127 </RuleItem> 128 <RuleItem> 129 <Type>0</Type> 130 <Terminal>do</Terminal> 131 </RuleItem> 132 <RuleItem> 133 <Type>1</Type> 134 <NonTerminal>Statement</NonTerminal> 135 </RuleItem> 136 </RuleItems> 137 </Rule> 138 <Rule> 139 <Name>WithDo</Name> 140 <Type>0</Type> 141 <RuleItems> 142 <RuleItem> 143 <Type>0</Type> 144 <Terminal>with</Terminal> 145 </RuleItem> 146 <RuleItem> 147 <Type>1</Type> 148 <NonTerminal>VariableRef</NonTerminal> 149 </RuleItem> 150 <RuleItem> 151 <Type>0</Type> 152 <Terminal>do</Terminal> 153 </RuleItem> 154 <RuleItem> 155 <Type>1</Type> 156 <NonTerminal>Statement</NonTerminal> 157 </RuleItem> 158 </RuleItems> 159 </Rule> 160 <Rule> 161 <Name>CaseOf</Name> 162 <Type>0</Type> 163 <RuleItems> 164 <RuleItem> 165 <Type>0</Type> 166 <Terminal>case</Terminal> 167 </RuleItem> 168 <RuleItem> 169 <Type>1</Type> 170 <NonTerminal>Expression</NonTerminal> 171 </RuleItem> 172 <RuleItem> 173 <Type>0</Type> 174 <Terminal>of</Terminal> 175 </RuleItem> 176 <RuleItem> 177 <Type>0</Type> 178 <Terminal>end</Terminal> 179 </RuleItem> 180 </RuleItems> 181 </Rule> 182 <Rule> 183 <Name>Assignment</Name> 184 <Type>0</Type> 185 <RuleItems> 186 <RuleItem> 187 <Type>1</Type> 188 <NonTerminal>VariableRef</NonTerminal> 189 </RuleItem> 190 <RuleItem> 191 <Type>0</Type> 192 <Terminal>:=</Terminal> 193 </RuleItem> 194 <RuleItem> 195 <Type>1</Type> 196 <NonTerminal>Expression</NonTerminal> 197 </RuleItem> 198 </RuleItems> 199 </Rule> 200 <Rule> 201 <Name>Statement</Name> 202 <Type>1</Type> 203 <RuleItems> 204 <RuleItem> 205 <Type>1</Type> 206 <NonTerminal>BeginEnd</NonTerminal> 207 </RuleItem> 208 <RuleItem> 209 <Type>1</Type> 210 <NonTerminal>IfThenElse</NonTerminal> 211 </RuleItem> 212 <RuleItem> 213 <Type>1</Type> 214 <NonTerminal>WhileDo</NonTerminal> 215 </RuleItem> 216 <RuleItem> 217 <Type>1</Type> 218 <NonTerminal>RepeatUntil</NonTerminal> 219 </RuleItem> 220 <RuleItem> 221 <Type>1</Type> 222 <NonTerminal>ForToDo</NonTerminal> 223 </RuleItem> 224 <RuleItem> 225 <Type>1</Type> 226 <NonTerminal>WithDo</NonTerminal> 227 </RuleItem> 228 <RuleItem> 229 <Type>1</Type> 230 <NonTerminal>CaseOf</NonTerminal> 231 </RuleItem> 232 <RuleItem> 233 <Type>1</Type> 234 <NonTerminal>Assignment</NonTerminal> 235 </RuleItem> 236 </RuleItems> 237 </Rule> 238 <Rule> 239 <Name>Expression</Name> 240 <Type>0</Type> 98 241 <RuleItems/> 99 242 </Rule> 100 243 <Rule> 101 <Name>WithDo</Name> 244 <Name>VariableRef</Name> 245 <Type>0</Type> 102 246 <RuleItems/> 103 247 </Rule> 104 248 <Rule> 105 <Name>CaseOf</Name> 249 <Name>Program</Name> 250 <Type>0</Type> 251 <RuleItems> 252 <RuleItem> 253 <Type>1</Type> 254 <NonTerminal>BeginEnd</NonTerminal> 255 </RuleItem> 256 <RuleItem> 257 <Type>0</Type> 258 <Terminal>.</Terminal> 259 </RuleItem> 260 </RuleItems> 261 </Rule> 262 <Rule> 263 <Name>Uses</Name> 264 <Type>0</Type> 265 <RuleItems> 266 <RuleItem> 267 <Type>0</Type> 268 <Terminal>uses</Terminal> 269 </RuleItem> 270 <RuleItem> 271 <Type>1</Type> 272 <NonTerminal>UnitName</NonTerminal> 273 </RuleItem> 274 <RuleItem> 275 <Type>0</Type> 276 <Terminal>,</Terminal> 277 </RuleItem> 278 </RuleItems> 279 </Rule> 280 <Rule> 281 <Name>UnitName</Name> 282 <Type>0</Type> 106 283 <RuleItems/> 107 284 </Rule> 108 285 <Rule> 109 <Name>Assignment</Name> 110 <RuleItems> 111 <RuleItem> 112 <Type>1</Type> 113 <NonTerminal>Variable</NonTerminal> 114 </RuleItem> 115 <RuleItem> 116 <Type>0</Type> 117 <Terminal>:=</Terminal> 118 </RuleItem> 119 <RuleItem> 120 <Type>1</Type> 121 <NonTerminal>Expression</NonTerminal> 122 </RuleItem> 123 </RuleItems> 124 </Rule> 125 <Rule> 126 <Name>Command</Name> 286 <Name>Function</Name> 287 <Type>0</Type> 288 <RuleItems> 289 <RuleItem> 290 <Type>0</Type> 291 <Terminal>function</Terminal> 292 </RuleItem> 293 <RuleItem> 294 <Type>1</Type> 295 <NonTerminal>Identifier</NonTerminal> 296 </RuleItem> 297 <RuleItem> 298 <Type>0</Type> 299 <Terminal>;</Terminal> 300 </RuleItem> 301 <RuleItem> 302 <Type>1</Type> 303 <NonTerminal>BeginEnd</NonTerminal> 304 </RuleItem> 305 <RuleItem> 306 <Type>0</Type> 307 <Terminal>;</Terminal> 308 </RuleItem> 309 </RuleItems> 310 </Rule> 311 <Rule> 312 <Name>Identifier</Name> 313 <Type>0</Type> 127 314 <RuleItems/> 128 315 </Rule> 129 316 <Rule> 130 <Name>Expression</Name> 131 <RuleItems/> 132 </Rule> 133 <Rule> 134 <Name>Variable</Name> 135 <RuleItems/> 317 <Name>VarSection</Name> 318 <Type>0</Type> 319 <RuleItems> 320 <RuleItem> 321 <Type>0</Type> 322 <Terminal>var</Terminal> 323 </RuleItem> 324 </RuleItems> 136 325 </Rule> 137 326 </Rules>
Note:
See TracChangeset
for help on using the changeset viewer.