Ignore:
Timestamp:
Nov 11, 2009, 2:14:44 PM (15 years ago)
Author:
george
Message:
  • Průběžné uložení.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Analyzátor gramatiky/UGrammer.pas

    r31 r32  
    66
    77uses
    8   Classes, ComCtrls, SysUtils, Math, UGrammerRules, fgl;
     8  Classes, ComCtrls, SysUtils, fgl, UParser;
    99
    1010type
     
    3030  end;
    3131
    32   { TPossibleCharacter }
    33 
    3432  TPossibleCharacter = class
    3533    Character: Char;
     
    4139
    4240  TPossibleCharacterList = specialize TFPGObjectList<TPossibleCharacter>;
    43 
    44   { TPossibleCharacters }
    4541
    4642  TPossibleCharacters = class
     
    6056  public
    6157    ItemType: TRuleItemType;
    62     Character: Char;
     58    Text: string;
    6359    Rule: TGrammerRule;
    6460    RuleName: string;
    6561    Optional: Boolean;
    6662    Repetition: Boolean;
    67     procedure GetPossibleCharacters(Path: TGrammerPath; var Characters: TPossibleCharacters);
     63//    procedure GetPossibleCharacters(Path: TGrammerPath; var Characters: TPossibleCharacters);
    6864    constructor Create;
    6965  end;
    7066
    7167  TGrammerItemList = specialize TFPGObjectList<TGrammerItem>;
     68
     69  { TGrammerRule }
    7270
    7371  TGrammerRule = class
     
    8179    procedure ClearProcessed;
    8280    function Add: TGrammerItem;
    83     procedure AddTerminal(ACharacter: Char; AOptional, ARepetition: Boolean);
     81    procedure AddTerminal(AText: string; AOptional, ARepetition: Boolean);
    8482    procedure AddTerminalText(Text: string);
    8583    procedure AddRule(ARule: TGrammerRule; AOptional, ARepetition: Boolean);
    8684    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;
    8989    constructor Create;
    9090    destructor Destroy; override;
     
    127127end;
    128128
    129 procedure TGrammerRule.AddTerminal(ACharacter: Char; AOptional, ARepetition: Boolean);
     129procedure TGrammerRule.AddTerminal(AText: string; AOptional, ARepetition: Boolean);
    130130begin
    131131  with Add do begin
    132132    ItemType := itTerminal;
    133     Character := ACharacter;
     133    Text := AText;
    134134    Optional := AOptional;
    135135    Repetition := ARepetition;
     
    166166end;
    167167
     168(*
    168169procedure TGrammerRule.GetPossibleCharacters(Path: TGrammerPath;
    169170  var Characters: TPossibleCharacters; UseIndex: Integer = 0; UseCharIndex: Integer = -1);
     
    229230  TempPath.Destroy;
    230231end;
     232*)
    231233
    232234procedure TGrammerRule.ProcessCharacter(Character: Char);
    233235begin
     236end;
     237
     238function TGrammerRule.Check(Path: TGrammerPath; Token: string;
     239  UseIndex: Integer; UseCharIndex: Integer): Boolean;
     240begin
     241
    234242end;
    235243
     
    281289end;
    282290
     291(*
    283292procedure TGrammerItem.GetPossibleCharacters(Path: TGrammerPath;
    284293  var Characters: TPossibleCharacters);
    285294var
    286295  Found: Boolean;
    287   PathIndex: Integer;
    288296  NextItemIndex, NextCharIndex: Integer;
    289297  NextRule: TGrammerRule;
     
    315323  end;
    316324end;
     325*)
    317326
    318327{ TGrammerPath }
Note: See TracChangeset for help on using the changeset viewer.