Changeset 32 for branches/Analyzátor gramatiky/UGrammer.pas
- Timestamp:
- Nov 11, 2009, 2:14:44 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Analyzátor gramatiky/UGrammer.pas
r31 r32 6 6 7 7 uses 8 Classes, ComCtrls, SysUtils, Math, UGrammerRules, fgl;8 Classes, ComCtrls, SysUtils, fgl, UParser; 9 9 10 10 type … … 30 30 end; 31 31 32 { TPossibleCharacter }33 34 32 TPossibleCharacter = class 35 33 Character: Char; … … 41 39 42 40 TPossibleCharacterList = specialize TFPGObjectList<TPossibleCharacter>; 43 44 { TPossibleCharacters }45 41 46 42 TPossibleCharacters = class … … 60 56 public 61 57 ItemType: TRuleItemType; 62 Character: Char;58 Text: string; 63 59 Rule: TGrammerRule; 64 60 RuleName: string; 65 61 Optional: Boolean; 66 62 Repetition: Boolean; 67 procedure GetPossibleCharacters(Path: TGrammerPath; var Characters: TPossibleCharacters);63 // procedure GetPossibleCharacters(Path: TGrammerPath; var Characters: TPossibleCharacters); 68 64 constructor Create; 69 65 end; 70 66 71 67 TGrammerItemList = specialize TFPGObjectList<TGrammerItem>; 68 69 { TGrammerRule } 72 70 73 71 TGrammerRule = class … … 81 79 procedure ClearProcessed; 82 80 function Add: TGrammerItem; 83 procedure AddTerminal(A Character: Char; AOptional, ARepetition: Boolean);81 procedure AddTerminal(AText: string; AOptional, ARepetition: Boolean); 84 82 procedure AddTerminalText(Text: string); 85 83 procedure AddRule(ARule: TGrammerRule; AOptional, ARepetition: Boolean); 86 84 procedure ProcessCharacter(Character: Char); 87 procedure GetPossibleCharacters(Path: TGrammerPath; 88 var Characters: TPossibleCharacters; UseIndex: Integer = 0; UseCharIndex: Integer = -1); 85 // procedure GetPossibleCharacters(Path: TGrammerPath; 86 // var Characters: TPossibleCharacters; UseIndex: Integer = 0; UseCharIndex: Integer = -1); 87 function Check(Path: TGrammerPath; Token: string; 88 UseIndex: Integer = 0; UseCharIndex: Integer = -1): Boolean; 89 89 constructor Create; 90 90 destructor Destroy; override; … … 127 127 end; 128 128 129 procedure TGrammerRule.AddTerminal(A Character: Char; AOptional, ARepetition: Boolean);129 procedure TGrammerRule.AddTerminal(AText: string; AOptional, ARepetition: Boolean); 130 130 begin 131 131 with Add do begin 132 132 ItemType := itTerminal; 133 Character := ACharacter;133 Text := AText; 134 134 Optional := AOptional; 135 135 Repetition := ARepetition; … … 166 166 end; 167 167 168 (* 168 169 procedure TGrammerRule.GetPossibleCharacters(Path: TGrammerPath; 169 170 var Characters: TPossibleCharacters; UseIndex: Integer = 0; UseCharIndex: Integer = -1); … … 229 230 TempPath.Destroy; 230 231 end; 232 *) 231 233 232 234 procedure TGrammerRule.ProcessCharacter(Character: Char); 233 235 begin 236 end; 237 238 function TGrammerRule.Check(Path: TGrammerPath; Token: string; 239 UseIndex: Integer; UseCharIndex: Integer): Boolean; 240 begin 241 234 242 end; 235 243 … … 281 289 end; 282 290 291 (* 283 292 procedure TGrammerItem.GetPossibleCharacters(Path: TGrammerPath; 284 293 var Characters: TPossibleCharacters); 285 294 var 286 295 Found: Boolean; 287 PathIndex: Integer;288 296 NextItemIndex, NextCharIndex: Integer; 289 297 NextRule: TGrammerRule; … … 315 323 end; 316 324 end; 325 *) 317 326 318 327 { TGrammerPath }
Note:
See TracChangeset
for help on using the changeset viewer.