Changeset 122 for branches/generator/URules.pas
- Timestamp:
- Nov 29, 2017, 2:03:17 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/generator/URules.pas
r120 r122 14 14 TRuleItems = class; 15 15 16 TRuleItemType = (ritTerminal, ritNonTerminal, ritSubItems );16 TRuleItemType = (ritTerminal, ritNonTerminal, ritSubItems, ritTerminalRange); 17 17 18 18 { TRuleItem } … … 29 29 RuleItemType: TRuleItemType; 30 30 Terminal: string; 31 TerminalFrom: string; 32 TerminalTo: string; 31 33 NonTerminalName: string; 32 34 NonTerminal: TRule; … … 342 344 SubItems.SaveToXmlNode(SubItemsNode); 343 345 end; 346 ritTerminalRange: begin 347 WriteString(Node, 'TerminalFrom', TerminalFrom); 348 WriteString(Node, 'TerminalTo', TerminalTo); 349 end; 344 350 end; 345 351 end; … … 351 357 ritNonTerminal: Result := NonTerminal.Name; 352 358 ritSubItems: Result := '(' + SubItems.GetString + ')'; 359 ritTerminalRange: Result := '(' + TerminalFrom + ' .. ' + TerminalTo + ')'; 353 360 end; 354 361 if Optional then Result := '+' + Result; … … 381 388 ritNonTerminal: Result := Length(NonTerminal.Name); 382 389 ritSubItems: Result := SubItems.GetCharLength; 390 ritTerminalRange: Result := Max(Length(TerminalFrom), Length(TerminalTo)) 383 391 end; 384 392 end; … … 405 413 if Assigned(SubItemsNode) then SubItems.LoadFromXmlNode(SubItemsNode); 406 414 end; 415 ritTerminalRange: begin 416 TerminalFrom := ReadString(Node, 'TerminalFrom', ''); 417 TerminalTo := ReadString(Node, 'TerminalTo', ''); 418 end; 407 419 end; 408 420 end;
Note:
See TracChangeset
for help on using the changeset viewer.