Changeset 129


Ignore:
Timestamp:
Dec 19, 2017, 4:56:34 PM (7 years ago)
Author:
chronos
Message:
  • Modified: Generate rules either to tokenizer and parser.
Location:
branches/generator
Files:
1 added
20 edited
1 moved

Legend:

Unmodified
Added
Removed
  • branches/generator/Forms/UFormGrammer.lfm

    r124 r129  
    77  ClientHeight = 346
    88  ClientWidth = 548
     9  DesignTimePPI = 120
    910  OnShow = FormShow
    10   LCLVersion = '1.6.4.0'
     11  LCLVersion = '1.8.0.6'
    1112  object Label1: TLabel
    1213    Left = 15
  • branches/generator/Forms/UFormGrammer.pas

    r126 r129  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   URules;
     9  UGrammer;
    1010
    1111type
  • branches/generator/Forms/UFormMain.lfm

    r128 r129  
    77  ClientHeight = 653
    88  ClientWidth = 1050
     9  DesignTimePPI = 120
    910  Menu = MainMenu1
    1011  OnClose = FormClose
    1112  OnCloseQuery = FormCloseQuery
    1213  OnShow = FormShow
    13   LCLVersion = '1.6.4.0'
     14  LCLVersion = '1.8.0.6'
    1415  object MemoBNF: TMemo
    1516    Left = 0
     
    8081        Height = 22
    8182        Top = 0
    82         Width = 8
    8383        Style = tbsSeparator
    8484      end
  • branches/generator/Forms/UFormMain.pas

    r127 r129  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   Menus, ActnList, ComCtrls, UPersistentForm, URules;
     9  Menus, ActnList, ComCtrls, UPersistentForm, UGrammer;
    1010
    1111type
     
    7777
    7878uses
    79   UFormRules, UCore, UFormGrammer;
     79  UFormRules, UCore, UFormGrammer, UBuilder;
    8080
    8181resourcestring
     
    189189
    190190procedure TFormMain.ABuildCompilerExecute(Sender: TObject);
    191 begin
    192   Core.Grammer.BuildCompiler;
     191var
     192  Builder: TBuilder;
     193begin
     194  Builder := TBuilder.Create;
     195  try
     196    Builder.Grammer := Core.Grammer;
     197    Builder.BuildCompiler;
     198  finally
     199    FreeAndNil(Builder);
     200  end;
    193201end;
    194202
  • branches/generator/Forms/UFormRule.lfm

    r122 r129  
    88  ClientHeight = 514
    99  ClientWidth = 663
     10  DesignTimePPI = 120
    1011  OnCreate = FormCreate
    1112  OnDestroy = FormDestroy
    1213  OnShow = FormShow
    13   LCLVersion = '1.6.4.0'
     14  LCLVersion = '1.8.0.6'
    1415  object ButtonOk: TButton
    1516    Left = 376
     
    9495    TabOrder = 4
    9596  end
     97  object Label2: TLabel
     98    Left = 312
     99    Height = 20
     100    Top = 52
     101    Width = 37
     102    Caption = 'Lavel:'
     103    ParentColor = False
     104  end
     105  object ComboBoxLevel: TComboBox
     106    Left = 376
     107    Height = 28
     108    Top = 48
     109    Width = 125
     110    ItemHeight = 20
     111    Style = csDropDownList
     112    TabOrder = 5
     113  end
    96114end
  • branches/generator/Forms/UFormRule.pas

    r126 r129  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   ComCtrls, ActnList, Menus, URules, UFormRuleItems;
     9  ComCtrls, ActnList, Menus, UGrammer, UFormRuleItems;
    1010
    1111type
     
    1717    ButtonCancel: TButton;
    1818    CheckBoxCreateNode: TCheckBox;
     19    ComboBoxLevel: TComboBox;
    1920    EditName: TEdit;
    2021    Label1: TLabel;
     22    Label2: TLabel;
    2123    ListView1: TListView;
    2224    PageControl1: TPageControl;
     
    7072
    7173procedure TFormRule.FormCreate(Sender: TObject);
     74var
     75  I: TRuleLevel;
    7276begin
    7377  FormRuleItems := TFormRuleItems.Create(nil);
     
    7680  FormRuleItems.Show;
    7781  UsedByRules := TStringList.Create;
     82  ComboBoxLevel.Items.Clear;
     83  for I := Low(TRuleLevel) to High(RuleLevelText) do
     84    ComboBoxLevel.Items.Add(RuleLevelText[I]);
    7885end;
    7986
     
    9198  EditName.Text := Rule.Name;
    9299  CheckBoxCreateNode.Checked := Rule.CreateSourceNode;
     100  ComboBoxLevel.ItemIndex := Integer(Rule.Level);
    93101  FormRuleItems.LoadData(Rule.Items);
    94102end;
     
    99107  Rule.Name := EditName.Text;
    100108  Rule.CreateSourceNode := CheckBoxCreateNode.Checked;
     109  Rule.Level := TRuleLevel(ComboBoxLevel.ItemIndex);
    101110  FormRuleItems.SaveData(Rule.Items);
    102111end;
  • branches/generator/Forms/UFormRuleItem.lfm

    r123 r129  
    77  ClientHeight = 400
    88  ClientWidth = 656
     9  DesignTimePPI = 120
    910  OnClose = FormClose
    1011  OnCreate = FormCreate
    1112  OnDestroy = FormDestroy
    1213  OnShow = FormShow
    13   LCLVersion = '1.6.4.0'
     14  LCLVersion = '1.8.0.6'
    1415  object ButtonCancel: TButton
    1516    Left = 176
  • branches/generator/Forms/UFormRuleItem.pas

    r126 r129  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   ComCtrls, URules;
     9  ComCtrls, UGrammer;
    1010
    1111type
  • branches/generator/Forms/UFormRuleItems.lfm

    r128 r129  
    77  ClientHeight = 467
    88  ClientWidth = 636
     9  DesignTimePPI = 120
    910  OnCreate = FormCreate
    1011  OnShow = FormShow
    11   LCLVersion = '1.6.4.0'
     12  LCLVersion = '1.8.0.6'
    1213  object ListView1: TListView
    1314    Left = 8
     
    9697    object MenuItem1: TMenuItem
    9798      Action = AAdd
    98       Bitmap.Data = {
    99         36040000424D3604000000000000360000002800000010000000100000000100
    100         2000000000000004000064000000640000000000000000000000000000000000
    101         0000000000000000000000000000000000000000000000000000000000000000
    102         0000000000000000000000000000000000000000000000000000000000000000
    103         000000000000000000000000000000000000D4D4D4FFB2B2B2FFB2B2B2FFD4D4
    104         D4FF000000000000000000000000000000000000000000000000000000000000
    105         0000000000000000000000000000709B70FF004A00FF004800FF4E764EFFB2B2
    106         B2FF000000000000000000000000000000000000000000000000000000000000
    107         0000000000000000000000000000004E00FF00C800FF00C400FF004800FFB2B2
    108         B2FF000000000000000000000000000000000000000000000000000000000000
    109         0000000000000000000000000000005000FF00CA00FF00C600FF004A00FFB2B2
    110         B2FF000000000000000000000000000000000000000000000000000000000000
    111         0000000000000000000000000000005300FF00CE00FF00CA00FF004C00FFB2B2
    112         B2FF00000000000000000000000000000000000000000000000000000000D4D4
    113         D4FFB2B2B2FFB2B2B2FFB2B2B2FF005400FF00D200FF00CE00FF004E00FFB2B2
    114         B2FFB2B2B2FFB2B2B2FFB2B2B2FFB2B2B2FFD4D4D4FF0000000070A670FF005E
    115         00FF005C00FF005A00FF005800FF005600FF00D600FF00D000FF005000FF004E
    116         00FF004C00FF004A00FF004A00FF4E764EFFB2B2B2FF00000000006200FF8CFE
    117         8CFF00EA00FF00E600FF00E200FF00DE00FF00DA00FF00D400FF00D000FF00CC
    118         00FF00C800FF00C400FF00C200FF004800FFB2B2B2FF00000000006400FFECFF
    119         ECFF8CFE8CFF8CFE8CFF8CFE8CFF8CFE8CFF00DE00FF00D900FF00D400FF00D0
    120         00FF00CC00FF00C800FF00C400FF004A00FFD4D4D4FF0000000070A970FF0064
    121         00FF006400FF006200FF006000FF006000FF8CFE8CFF00DD00FF005800FF0056
    122         00FF005400FF005300FF005000FF709C70FF0000000000000000000000000000
    123         0000000000000000000000000000006000FF8CFE8CFF00E000FF005A00FFB2B2
    124         B2FF000000000000000000000000000000000000000000000000000000000000
    125         0000000000000000000000000000006200FF8CFE8CFF00E500FF005C00FFB2B2
    126         B2FF000000000000000000000000000000000000000000000000000000000000
    127         0000000000000000000000000000006400FF8CFE8CFF00E800FF005E00FFB2B2
    128         B2FF000000000000000000000000000000000000000000000000000000000000
    129         0000000000000000000000000000006400FFECFFECFF8CFE8CFF006000FFD4D4
    130         D4FF000000000000000000000000000000000000000000000000000000000000
    131         000000000000000000000000000070A970FF006400FF006200FF70A670FF0000
    132         0000000000000000000000000000000000000000000000000000
    133       }
    13499    end
    135100    object MenuItem2: TMenuItem
    136101      Action = AModify
    137       Bitmap.Data = {
    138         36040000424D3604000000000000360000002800000010000000100000000100
    139         2000000000000004000064000000640000000000000000000000986B37FF976A
    140         36FF966935FF966734FF956633FF946532FF946531FF936430FF92622FFF9261
    141         2EFF91602DFF90602CFF905F2BFF8F5D2AFF8E5C29FF8D5B28FF996C38FFF8F7
    142         F6FFF8F7F5FFF7F6F5FFF6F6F4FFF6F5F3FFF5F5F3FFF5F4F2FFF4F3F1FFF4F3
    143         F1FFF3F2F0FFF3F2EFFFF2F1EFFFF2F0EEFFF1F0EDFF8E5D29FF996D3AFFF9F8
    144         F7FF959594FF878787FF9B9A9AFFF7F6F4FFF6F5F3FFF6F5F3FFF5F4F2FFF4F3
    145         F1FFF4F3F1FFF3F2F0FFF3F2EFFFF2F1EFFFF2F1EEFF8F5E2AFF9A6E3BFFF9F9
    146         F8FF7C7C7CFFC4C4C4FF878787FFF7F6F5FF7A7A7AFF787878FF747474FF7171
    147         70FF6D6D6CFF696968FF656565FF616161FFF2F1EFFF905F2BFF9B6F3CFFFAF9
    148         F8FFBEBEBDFF929292FFBCBCBBFFF8F7F6FFF7F7F5FFF7F6F4FFF6F5F4FFF6F5
    149         F3FFF5F4F2FFF5F4F2FFF4F3F1FFF4F2F0FFF3F2F0FF91602DFF9C703DFFFAFA
    150         F9FFFAF9F9FFF9F9F8FFF9F8F7FFF8F8F7FFF8F7F6FFF7F7F5FFF7F6F5FFF6F5
    151         F4FFF6F5F3FFF5F4F3FFF5F4F2FFF4F3F1FFF4F3F0FF92612EFF9D723EFFFBFB
    152         FAFF9F9F9EFF7F7F7FFFAEAEADFFF9F8F7FFF8F8F7FFF8F7F6FFF7F7F5FFF7F6
    153         F5FFF6F6F4FFF6F5F3FFF5F4F3FFF5F4F2FFF4F3F1FF92622FFF9D7340FFFCFB
    154         FBFF818181FFC4C4C4FF8F8F8FFFFAF9F8FF7B7B7AFF797979FF757574FF7271
    155         71FF6D6D6DFF696969FF666665FF626261FFF5F4F2FF936430FF9E7441FFFCFC
    156         FCFFB5B5B5FF848484FFBEBDBDFFFAFAF9FFFAF9F8FFF9F9F7FFF9F8F7FFF8F8
    157         F6FFF8F7F5FFF7F6F5FFF7F6F4FFF6F5F3FFF6F5F3FF946531FF9F7542FFFDFD
    158         FCFFFCFCFCFFFCFCFBFFFBFBFAFFFBFAFAFFFAFAF9FFFAF9F8FFF9F9F8FFF9F8
    159         F7FFF8F8F6FFF8F7F6FFF7F6F5FFF7F6F4FFF6F5F4FF956633FFA07643FFFEFD
    160         FDFF8C8C8CFF525252FFA4A4A4FFFBFBFAFFFBFBFAFFFAFAF9FFFAF9F8FFF9F9
    161         F8FFF9F8F7FFF8F8F6FFF8F7F6FFF7F7F5FFF7F6F4FF966734FFA17844FFFEFE
    162         FEFF5F5F5FFF949494FF535353FFFCFCFBFF7B7B7BFF797979FF757575FF7272
    163         72FF6E6E6EFF6A6A69FF666666FF626262FFF7F7F5FF966935FFA17946FFFFFF
    164         FFFF878787FF5D5D5DFFA0A0A0FFFDFCFCFFFCFCFBFFFCFBFBFFFBFBFAFFFBFA
    165         F9FFFAFAF9FFFAF9F8FFF9F8F7FFF8F8F7FFF8F7F6FF976A36FFA27A47FFFFFF
    166         FFFFFFFFFFFFFEFEFEFFFEFEFEFFFDFDFDFFFDFDFCFFFCFCFBFFFCFBFBFFFBFB
    167         FAFFFBFAF9FFFAFAF9FFFAF9F8FFF9F9F7FFF9F8F7FF986B37FFA37B48FFBEA2
    168         7FFFBEA17EFFBDA17DFFBDA07CFFBD9F7CFFBC9F7BFFBB9E7AFFBB9D7AFFBB9D
    169         79FFBA9C78FFB99B78FFB99A77FFB89A76FFB89975FF996C39FFA37B48FFA37B
    170         48FFA27A47FFA27946FFA17845FFA07744FFA07643FF9F7542FF9E7441FF9E73
    171         40FF9D723FFF9C713EFF9C703DFF9B6F3CFF9A6E3BFF9A6D3AFF
    172       }
    173102    end
    174103    object MenuItem3: TMenuItem
    175104      Action = ARemove
    176       Bitmap.Data = {
    177         36040000424D3604000000000000360000002800000010000000100000000100
    178         2000000000000004000064000000640000000000000000000000000000000000
    179         0000000000000000000000000000000000000000000000000000000000000000
    180         0000000000000000000000000000000000000000000000000000000000000000
    181         0000000000000000000000000000000000000000000000000000000000000000
    182         0000000000000000000000000000000000003A3AE2FFC0C0C0FF000000000000
    183         000000000000000000003A3AE2FFC0C0C0FF0000000000000000000000000000
    184         0000000000000000000000000000000000000000000000000000000000000000
    185         0000000000003A3AE2FF3A3AE2FF3A3AE2FFC0C0C0FF00000000000000000000
    186         00000000000000000000000000003A3AE2FFC0C0C0FF00000000000000000000
    187         0000000000003A3AE2FF3A3AE2FF3A3AE2FFC0C0C0FF00000000000000000000
    188         000000000000000000003A3AE2FFC0C0C0FF0000000000000000000000000000
    189         000000000000000000003838E0FF3838E0FF3838E0FFC0C0C0FF000000000000
    190         0000000000003838E0FF3838E0FFC0C0C0FF0000000000000000000000000000
    191         00000000000000000000000000003535DDFF3535DDFF3535DDFFC0C0C0FF0000
    192         00003535DDFF3535DDFFC0C0C0FF000000000000000000000000000000000000
    193         0000000000000000000000000000000000003232DAFF3232DAFF3232DAFF3232
    194         DAFF3232DAFFC0C0C0FF00000000000000000000000000000000000000000000
    195         000000000000000000000000000000000000000000002F2FD7FF2F2FD7FF2F2F
    196         D7FFC0C0C0FF0000000000000000000000000000000000000000000000000000
    197         0000000000000000000000000000000000002C2CD4FF2C2CD4FF2C2CD4FF2C2C
    198         D4FF2C2CD4FFC0C0C0FF00000000000000000000000000000000000000000000
    199         00000000000000000000000000002929D1FF2929D1FF2929D1FFC0C0C0FF0000
    200         00002929D1FFC0C0C0FF00000000000000000000000000000000000000000000
    201         0000000000002626CEFF2626CEFF2626CEFF2626CEFFC0C0C0FF000000000000
    202         0000000000002626CEFF2626CEFFC0C0C0FF0000000000000000000000000000
    203         00002020C8FF2020C8FF2020C8FF2020C8FFC0C0C0FF00000000000000000000
    204         000000000000000000002020C8FF2020C8FFC0C0C0FF00000000000000000000
    205         00001818C0FF1818C0FFC0C0C0FF000000000000000000000000000000000000
    206         00000000000000000000000000001818C0FF1818C0FFC0C0C0FF000000000000
    207         0000000000000000000000000000000000000000000000000000000000000000
    208         0000000000000000000000000000000000000000000000000000000000000000
    209         0000000000000000000000000000000000000000000000000000000000000000
    210         0000000000000000000000000000000000000000000000000000
    211       }
    212105    end
    213106    object MenuItem4: TMenuItem
    214107      Action = AMoveUp
    215       Bitmap.Data = {
    216         36040000424D3604000000000000360000002800000010000000100000000100
    217         2000000000000004000064000000640000000000000000000000000000000000
    218         0000000000000000000000000000000000000000000000000000000000000000
    219         0000000000000000000000000000000000000000000000000000000000000000
    220         0000000000000000000000000000000000FF000000FF000000FF000000FF0000
    221         00FF000000FF000000FF00000000000000000000000000000000000000000000
    222         0000000000000000000000000000000000FFFF442CFFFF3C28FFFF3522FFFF2E
    223         1EFFFF2619FF000000FF00000000000000000000000000000000000000000000
    224         0000000000000000000000000000000000FFFF5337FFFF4C32FFFF442CFFFF3C
    225         28FFFF3623FF000000FF00000000000000000000000000000000000000000000
    226         0000000000000000000000000000000000FFFF6341FFFF5C3BFFFF5437FFFF4C
    227         32FFFF442CFF000000FF00000000000000000000000000000000000000000000
    228         0000000000000000000000000000000000FFFF724AFFFF6B46FFFF6441FFFF5D
    229         3CFFFF5437FF000000FF00000000000000000000000000000000000000000000
    230         0000000000000000000000000000000000FFFF8255FFFF7A4FFFFF744BFFFF6C
    231         46FFFF6441FF000000FF00000000000000000000000000000000000000000000
    232         0000000000000000000000000000000000FFFF915FFFFF8A5AFFFF8255FFFF7C
    233         51FFFF744CFF000000FF00000000000000000000000000000000000000000000
    234         00FF000000FF000000FF000000FF000000FFFFA169FFFF9A65FFFF9360FFFF8A
    235         5AFFFF8456FF000000FF000000FF000000FF000000FF000000FF000000000000
    236         0000000000FFFFC681FFFFBF7DFFFFB878FFFFB073FFFFAA6EFFFFA269FFFF9A
    237         65FFFF9360FFFF8C5BFFFF8456FFFF7C51FF000000FF00000000000000000000
    238         000000000000000000FFFFCF87FFFFC882FFFFC17DFFFFB878FFFFB174FFFFAA
    239         6EFFFFA269FFFF9A65FFFF9461FF000000FF0000000000000000000000000000
    240         00000000000000000000000000FFFFD78CFFFFD088FFFFC882FFFFC17DFFFFBA
    241         79FFFFB374FFFFAA6EFF000000FF000000000000000000000000000000000000
    242         0000000000000000000000000000000000FFFFE092FFFFD88CFFFFD088FFFFC8
    243         82FFFFC27EFF000000FF00000000000000000000000000000000000000000000
    244         000000000000000000000000000000000000000000FFFFE797FFFFE092FFFFD8
    245         8CFF000000FF0000000000000000000000000000000000000000000000000000
    246         00000000000000000000000000000000000000000000000000FFFFF09CFF0000
    247         00FF000000000000000000000000000000000000000000000000000000000000
    248         0000000000000000000000000000000000000000000000000000000000FF0000
    249         0000000000000000000000000000000000000000000000000000
    250       }
    251108    end
    252109    object MenuItem5: TMenuItem
    253110      Action = AMoveDown
    254       Bitmap.Data = {
    255         36040000424D3604000000000000360000002800000010000000100000000100
    256         2000000000000004000064000000640000000000000000000000000000000000
    257         00000000000000000000000000000000000000000000000000FF000000000000
    258         0000000000000000000000000000000000000000000000000000000000000000
    259         000000000000000000000000000000000000000000FFFFF09CFF000000FF0000
    260         0000000000000000000000000000000000000000000000000000000000000000
    261         0000000000000000000000000000000000FFFFD88CFFFFE092FFFFE797FF0000
    262         00FF000000000000000000000000000000000000000000000000000000000000
    263         00000000000000000000000000FFFFC27EFFFFC882FFFFD088FFFFD88CFFFFE0
    264         92FF000000FF0000000000000000000000000000000000000000000000000000
    265         000000000000000000FFFFAA6EFFFFB374FFFFBA79FFFFC17DFFFFC882FFFFD0
    266         88FFFFD78CFF000000FF00000000000000000000000000000000000000000000
    267         0000000000FFFF9461FFFF9A65FFFFA269FFFFAA6EFFFFB174FFFFB878FFFFC1
    268         7DFFFFC882FFFFCF87FF000000FF000000000000000000000000000000000000
    269         00FFFF7C51FFFF8456FFFF8C5BFFFF9360FFFF9A65FFFFA269FFFFAA6EFFFFB0
    270         73FFFFB878FFFFBF7DFFFFC681FF000000FF0000000000000000000000FF0000
    271         00FF000000FF000000FF000000FFFF8456FFFF8A5AFFFF9360FFFF9A65FFFFA1
    272         69FF000000FF000000FF000000FF000000FF000000FF00000000000000000000
    273         00000000000000000000000000FFFF744CFFFF7C51FFFF8255FFFF8A5AFFFF91
    274         5FFF000000FF0000000000000000000000000000000000000000000000000000
    275         00000000000000000000000000FFFF6441FFFF6C46FFFF744BFFFF7A4FFFFF82
    276         55FF000000FF0000000000000000000000000000000000000000000000000000
    277         00000000000000000000000000FFFF5437FFFF5D3CFFFF6441FFFF6B46FFFF72
    278         4AFF000000FF0000000000000000000000000000000000000000000000000000
    279         00000000000000000000000000FFFF442CFFFF4C32FFFF5437FFFF5C3BFFFF63
    280         41FF000000FF0000000000000000000000000000000000000000000000000000
    281         00000000000000000000000000FFFF3623FFFF3C28FFFF442CFFFF4C32FFFF53
    282         37FF000000FF0000000000000000000000000000000000000000000000000000
    283         00000000000000000000000000FFFF2619FFFF2E1EFFFF3522FFFF3C28FFFF44
    284         2CFF000000FF0000000000000000000000000000000000000000000000000000
    285         00000000000000000000000000FF000000FF000000FF000000FF000000FF0000
    286         00FF000000FF0000000000000000000000000000000000000000000000000000
    287         0000000000000000000000000000000000000000000000000000000000000000
    288         0000000000000000000000000000000000000000000000000000
    289       }
    290111    end
    291112  end
  • branches/generator/Forms/UFormRuleItems.pas

    r128 r129  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
    9   Menus, ActnList, StdCtrls, URules, UFormRuleItem;
     9  Menus, ActnList, StdCtrls, UGrammer, UFormRuleItem;
    1010
    1111type
  • branches/generator/Forms/UFormRules.lfm

    r128 r129  
    77  ClientHeight = 611
    88  ClientWidth = 857
     9  DesignTimePPI = 120
    910  OnClose = FormClose
    1011  OnCreate = FormCreate
    1112  OnShow = FormShow
    12   LCLVersion = '1.6.4.0'
     13  LCLVersion = '1.8.0.6'
    1314  object CoolBar1: TCoolBar
    1415    Left = 0
     
    7677      item
    7778        Caption = 'Items'
    78         Width = 500
     79        Width = 400
    7980      end   
    8081      item
    8182        Caption = 'Char length'
    8283        Width = 80
     84      end   
     85      item
     86        Caption = 'Level'
     87        Width = 70
    8388      end>
    8489    MultiSelect = True
     
    126131    object MenuItem1: TMenuItem
    127132      Action = AAdd
    128       Bitmap.Data = {
    129         36040000424D3604000000000000360000002800000010000000100000000100
    130         2000000000000004000064000000640000000000000000000000000000000000
    131         0000000000000000000000000000000000000000000000000000000000000000
    132         0000000000000000000000000000000000000000000000000000000000000000
    133         000000000000000000000000000000000000D4D4D4FFB2B2B2FFB2B2B2FFD4D4
    134         D4FF000000000000000000000000000000000000000000000000000000000000
    135         0000000000000000000000000000709B70FF004A00FF004800FF4E764EFFB2B2
    136         B2FF000000000000000000000000000000000000000000000000000000000000
    137         0000000000000000000000000000004E00FF00C800FF00C400FF004800FFB2B2
    138         B2FF000000000000000000000000000000000000000000000000000000000000
    139         0000000000000000000000000000005000FF00CA00FF00C600FF004A00FFB2B2
    140         B2FF000000000000000000000000000000000000000000000000000000000000
    141         0000000000000000000000000000005300FF00CE00FF00CA00FF004C00FFB2B2
    142         B2FF00000000000000000000000000000000000000000000000000000000D4D4
    143         D4FFB2B2B2FFB2B2B2FFB2B2B2FF005400FF00D200FF00CE00FF004E00FFB2B2
    144         B2FFB2B2B2FFB2B2B2FFB2B2B2FFB2B2B2FFD4D4D4FF0000000070A670FF005E
    145         00FF005C00FF005A00FF005800FF005600FF00D600FF00D000FF005000FF004E
    146         00FF004C00FF004A00FF004A00FF4E764EFFB2B2B2FF00000000006200FF8CFE
    147         8CFF00EA00FF00E600FF00E200FF00DE00FF00DA00FF00D400FF00D000FF00CC
    148         00FF00C800FF00C400FF00C200FF004800FFB2B2B2FF00000000006400FFECFF
    149         ECFF8CFE8CFF8CFE8CFF8CFE8CFF8CFE8CFF00DE00FF00D900FF00D400FF00D0
    150         00FF00CC00FF00C800FF00C400FF004A00FFD4D4D4FF0000000070A970FF0064
    151         00FF006400FF006200FF006000FF006000FF8CFE8CFF00DD00FF005800FF0056
    152         00FF005400FF005300FF005000FF709C70FF0000000000000000000000000000
    153         0000000000000000000000000000006000FF8CFE8CFF00E000FF005A00FFB2B2
    154         B2FF000000000000000000000000000000000000000000000000000000000000
    155         0000000000000000000000000000006200FF8CFE8CFF00E500FF005C00FFB2B2
    156         B2FF000000000000000000000000000000000000000000000000000000000000
    157         0000000000000000000000000000006400FF8CFE8CFF00E800FF005E00FFB2B2
    158         B2FF000000000000000000000000000000000000000000000000000000000000
    159         0000000000000000000000000000006400FFECFFECFF8CFE8CFF006000FFD4D4
    160         D4FF000000000000000000000000000000000000000000000000000000000000
    161         000000000000000000000000000070A970FF006400FF006200FF70A670FF0000
    162         0000000000000000000000000000000000000000000000000000
    163       }
    164133    end
    165134    object MenuItem2: TMenuItem
    166135      Action = AModify
    167       Bitmap.Data = {
    168         36040000424D3604000000000000360000002800000010000000100000000100
    169         2000000000000004000064000000640000000000000000000000986B37FF976A
    170         36FF966935FF966734FF956633FF946532FF946531FF936430FF92622FFF9261
    171         2EFF91602DFF90602CFF905F2BFF8F5D2AFF8E5C29FF8D5B28FF996C38FFF8F7
    172         F6FFF8F7F5FFF7F6F5FFF6F6F4FFF6F5F3FFF5F5F3FFF5F4F2FFF4F3F1FFF4F3
    173         F1FFF3F2F0FFF3F2EFFFF2F1EFFFF2F0EEFFF1F0EDFF8E5D29FF996D3AFFF9F8
    174         F7FF959594FF878787FF9B9A9AFFF7F6F4FFF6F5F3FFF6F5F3FFF5F4F2FFF4F3
    175         F1FFF4F3F1FFF3F2F0FFF3F2EFFFF2F1EFFFF2F1EEFF8F5E2AFF9A6E3BFFF9F9
    176         F8FF7C7C7CFFC4C4C4FF878787FFF7F6F5FF7A7A7AFF787878FF747474FF7171
    177         70FF6D6D6CFF696968FF656565FF616161FFF2F1EFFF905F2BFF9B6F3CFFFAF9
    178         F8FFBEBEBDFF929292FFBCBCBBFFF8F7F6FFF7F7F5FFF7F6F4FFF6F5F4FFF6F5
    179         F3FFF5F4F2FFF5F4F2FFF4F3F1FFF4F2F0FFF3F2F0FF91602DFF9C703DFFFAFA
    180         F9FFFAF9F9FFF9F9F8FFF9F8F7FFF8F8F7FFF8F7F6FFF7F7F5FFF7F6F5FFF6F5
    181         F4FFF6F5F3FFF5F4F3FFF5F4F2FFF4F3F1FFF4F3F0FF92612EFF9D723EFFFBFB
    182         FAFF9F9F9EFF7F7F7FFFAEAEADFFF9F8F7FFF8F8F7FFF8F7F6FFF7F7F5FFF7F6
    183         F5FFF6F6F4FFF6F5F3FFF5F4F3FFF5F4F2FFF4F3F1FF92622FFF9D7340FFFCFB
    184         FBFF818181FFC4C4C4FF8F8F8FFFFAF9F8FF7B7B7AFF797979FF757574FF7271
    185         71FF6D6D6DFF696969FF666665FF626261FFF5F4F2FF936430FF9E7441FFFCFC
    186         FCFFB5B5B5FF848484FFBEBDBDFFFAFAF9FFFAF9F8FFF9F9F7FFF9F8F7FFF8F8
    187         F6FFF8F7F5FFF7F6F5FFF7F6F4FFF6F5F3FFF6F5F3FF946531FF9F7542FFFDFD
    188         FCFFFCFCFCFFFCFCFBFFFBFBFAFFFBFAFAFFFAFAF9FFFAF9F8FFF9F9F8FFF9F8
    189         F7FFF8F8F6FFF8F7F6FFF7F6F5FFF7F6F4FFF6F5F4FF956633FFA07643FFFEFD
    190         FDFF8C8C8CFF525252FFA4A4A4FFFBFBFAFFFBFBFAFFFAFAF9FFFAF9F8FFF9F9
    191         F8FFF9F8F7FFF8F8F6FFF8F7F6FFF7F7F5FFF7F6F4FF966734FFA17844FFFEFE
    192         FEFF5F5F5FFF949494FF535353FFFCFCFBFF7B7B7BFF797979FF757575FF7272
    193         72FF6E6E6EFF6A6A69FF666666FF626262FFF7F7F5FF966935FFA17946FFFFFF
    194         FFFF878787FF5D5D5DFFA0A0A0FFFDFCFCFFFCFCFBFFFCFBFBFFFBFBFAFFFBFA
    195         F9FFFAFAF9FFFAF9F8FFF9F8F7FFF8F8F7FFF8F7F6FF976A36FFA27A47FFFFFF
    196         FFFFFFFFFFFFFEFEFEFFFEFEFEFFFDFDFDFFFDFDFCFFFCFCFBFFFCFBFBFFFBFB
    197         FAFFFBFAF9FFFAFAF9FFFAF9F8FFF9F9F7FFF9F8F7FF986B37FFA37B48FFBEA2
    198         7FFFBEA17EFFBDA17DFFBDA07CFFBD9F7CFFBC9F7BFFBB9E7AFFBB9D7AFFBB9D
    199         79FFBA9C78FFB99B78FFB99A77FFB89A76FFB89975FF996C39FFA37B48FFA37B
    200         48FFA27A47FFA27946FFA17845FFA07744FFA07643FF9F7542FF9E7441FF9E73
    201         40FF9D723FFF9C713EFF9C703DFF9B6F3CFF9A6E3BFF9A6D3AFF
    202       }
    203136    end
    204137    object MenuItem3: TMenuItem
    205138      Action = ARemove
    206       Bitmap.Data = {
    207         36040000424D3604000000000000360000002800000010000000100000000100
    208         2000000000000004000064000000640000000000000000000000000000000000
    209         0000000000000000000000000000000000000000000000000000000000000000
    210         0000000000000000000000000000000000000000000000000000000000000000
    211         0000000000000000000000000000000000000000000000000000000000000000
    212         0000000000000000000000000000000000003A3AE2FFC0C0C0FF000000000000
    213         000000000000000000003A3AE2FFC0C0C0FF0000000000000000000000000000
    214         0000000000000000000000000000000000000000000000000000000000000000
    215         0000000000003A3AE2FF3A3AE2FF3A3AE2FFC0C0C0FF00000000000000000000
    216         00000000000000000000000000003A3AE2FFC0C0C0FF00000000000000000000
    217         0000000000003A3AE2FF3A3AE2FF3A3AE2FFC0C0C0FF00000000000000000000
    218         000000000000000000003A3AE2FFC0C0C0FF0000000000000000000000000000
    219         000000000000000000003838E0FF3838E0FF3838E0FFC0C0C0FF000000000000
    220         0000000000003838E0FF3838E0FFC0C0C0FF0000000000000000000000000000
    221         00000000000000000000000000003535DDFF3535DDFF3535DDFFC0C0C0FF0000
    222         00003535DDFF3535DDFFC0C0C0FF000000000000000000000000000000000000
    223         0000000000000000000000000000000000003232DAFF3232DAFF3232DAFF3232
    224         DAFF3232DAFFC0C0C0FF00000000000000000000000000000000000000000000
    225         000000000000000000000000000000000000000000002F2FD7FF2F2FD7FF2F2F
    226         D7FFC0C0C0FF0000000000000000000000000000000000000000000000000000
    227         0000000000000000000000000000000000002C2CD4FF2C2CD4FF2C2CD4FF2C2C
    228         D4FF2C2CD4FFC0C0C0FF00000000000000000000000000000000000000000000
    229         00000000000000000000000000002929D1FF2929D1FF2929D1FFC0C0C0FF0000
    230         00002929D1FFC0C0C0FF00000000000000000000000000000000000000000000
    231         0000000000002626CEFF2626CEFF2626CEFF2626CEFFC0C0C0FF000000000000
    232         0000000000002626CEFF2626CEFFC0C0C0FF0000000000000000000000000000
    233         00002020C8FF2020C8FF2020C8FF2020C8FFC0C0C0FF00000000000000000000
    234         000000000000000000002020C8FF2020C8FFC0C0C0FF00000000000000000000
    235         00001818C0FF1818C0FFC0C0C0FF000000000000000000000000000000000000
    236         00000000000000000000000000001818C0FF1818C0FFC0C0C0FF000000000000
    237         0000000000000000000000000000000000000000000000000000000000000000
    238         0000000000000000000000000000000000000000000000000000000000000000
    239         0000000000000000000000000000000000000000000000000000000000000000
    240         0000000000000000000000000000000000000000000000000000
    241       }
    242139    end
    243140  end
  • branches/generator/Forms/UFormRules.pas

    r128 r129  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
    9   ComCtrls, ActnList, Menus, URules, UListViewSort;
     9  ComCtrls, ActnList, Menus, UGrammer, UListViewSort;
    1010
    1111type
     
    147147    Item.SubItems.Add(Items.GetString);
    148148    Item.SubItems.Add(IntToStr(Items.GetCharLength));
     149    Item.SubItems.Add(RuleLevelText[Level]);
    149150  end;
    150151end;
     
    175176      1: Result := CompareString(BooleanText[TRule(Item1).CreateSourceNode], BooleanText[TRule(Item2).CreateSourceNode]);
    176177      2: Result := CompareString(TRule(Item1).GetString, TRule(Item2).GetString);
     178      3: Result := CompareInteger(TRule(Item1).Items.GetCharLength,
     179        TRule(Item2).Items.GetCharLength);
     180      4: Result := CompareString(RuleLevelText[TRule(Item1).Level],
     181        RuleLevelText[TRule(Item2).Level]);
    177182    end;
    178183    if ListViewSort1.Order = soDown then Result := -Result;
  • branches/generator/Languages/generator.cs.po

    r128 r129  
    1212"X-Generator: Poedit 1.8.8\n"
    1313
     14#: tformgrammer.buttoncancel.caption
     15msgctxt "tformgrammer.buttoncancel.caption"
     16msgid "Cancel"
     17msgstr ""
     18
     19#: tformgrammer.buttonok.caption
     20msgid "OK"
     21msgstr ""
     22
     23#: tformgrammer.caption
     24msgid "Grammer settings"
     25msgstr ""
     26
     27#: tformgrammer.label1.caption
     28msgid "Start rule:"
     29msgstr ""
     30
    1431#: tformmain.abuildcompiler.caption
    1532msgid "Build compiler"
     
    84101msgstr "Soubor"
    85102
    86 #: tformmain.menuitem6.caption
    87 msgid "-"
    88 msgstr "-"
    89 
    90103#: tformmain.menuitem8.caption
    91104msgid "Tools"
    92105msgstr "Nástroje"
     106
     107#: tformrule.buttoncancel.caption
     108msgctxt "tformrule.buttoncancel.caption"
     109msgid "Cancel"
     110msgstr ""
     111
     112#: tformrule.buttonok.caption
     113msgctxt "tformrule.buttonok.caption"
     114msgid "Ok"
     115msgstr ""
     116
     117#: tformrule.caption
     118msgid "Rule"
     119msgstr ""
     120
     121#: tformrule.checkboxcreatenode.caption
     122msgid "Create source node"
     123msgstr ""
     124
     125#: tformrule.label1.caption
     126msgid "Name:"
     127msgstr ""
     128
     129#: tformrule.label2.caption
     130msgid "Lavel:"
     131msgstr ""
     132
     133#: tformrule.listview1.columns[0].caption
     134#, fuzzy
     135msgctxt "tformrule.listview1.columns[0].caption"
     136msgid "Name"
     137msgstr "Název"
     138
     139#: tformrule.tabsheet1.caption
     140#, fuzzy
     141msgctxt "tformrule.tabsheet1.caption"
     142msgid "Items"
     143msgstr "PoloÅŸky"
     144
     145#: tformrule.tabsheet2.caption
     146msgid "Links"
     147msgstr ""
     148
     149#: tformrule.tabsheetusedby.caption
     150msgid "Used by"
     151msgstr ""
     152
     153#: tformruleitem.buttoncancel.caption
     154msgctxt "tformruleitem.buttoncancel.caption"
     155msgid "Cancel"
     156msgstr ""
     157
     158#: tformruleitem.buttonok.caption
     159msgctxt "tformruleitem.buttonok.caption"
     160msgid "Ok"
     161msgstr ""
     162
     163#: tformruleitem.caption
     164msgid "Rule item"
     165msgstr ""
     166
     167#: tformruleitem.checkboxanyexcept.caption
     168msgid "Any except"
     169msgstr ""
     170
     171#: tformruleitem.checkboxoptional.caption
     172msgid "Optional"
     173msgstr ""
     174
     175#: tformruleitem.checkboxrepetitive.caption
     176msgid "Repetitive"
     177msgstr ""
     178
     179#: tformruleitem.label2.caption
     180msgid "Type:"
     181msgstr ""
     182
     183#: tformruleitem.labelnonterminal.caption
     184msgid "Non-terminal:"
     185msgstr ""
     186
     187#: tformruleitem.labelterminal.caption
     188msgid "Terminal:"
     189msgstr ""
     190
     191#: tformruleitem.labelterminal1.caption
     192msgid "Terminal from:"
     193msgstr ""
     194
     195#: tformruleitem.labelterminal2.caption
     196msgid "Terminal to:"
     197msgstr ""
     198
     199#: tformruleitem.tabsheetnonterminal.caption
     200msgid "NonTerminal"
     201msgstr ""
     202
     203#: tformruleitem.tabsheetsubitems.caption
     204msgid "SubItems"
     205msgstr ""
     206
     207#: tformruleitem.tabsheetterminal.caption
     208msgid "Terminal"
     209msgstr ""
     210
     211#: tformruleitem.tabsheetterminalrange.caption
     212msgid "TabSheetTerminalRange"
     213msgstr ""
    93214
    94215#: tformruleitems.aadd.caption
     
    173294
    174295#: tformrules.listview1.columns[2].caption
     296msgctxt "tformrules.listview1.columns[2].caption"
    175297msgid "Items"
    176298msgstr "PoloÅŸky"
     
    180302msgstr "Znaková délka"
    181303
     304#: tformrules.listview1.columns[4].caption
     305msgid "Level"
     306msgstr ""
     307
    182308#: uformmain.sdoyouwanttosaveproject
    183309msgid "There are unsaved changes in project. Do you want to save them?"
  • branches/generator/Languages/generator.po

    r128 r129  
    11msgid ""
    22msgstr "Content-Type: text/plain; charset=UTF-8"
     3
     4#: tformgrammer.buttoncancel.caption
     5msgctxt "tformgrammer.buttoncancel.caption"
     6msgid "Cancel"
     7msgstr ""
     8
     9#: tformgrammer.buttonok.caption
     10msgid "OK"
     11msgstr ""
     12
     13#: tformgrammer.caption
     14msgid "Grammer settings"
     15msgstr ""
     16
     17#: tformgrammer.label1.caption
     18msgid "Start rule:"
     19msgstr ""
    320
    421#: tformmain.abuildcompiler.caption
     
    7491msgstr ""
    7592
    76 #: tformmain.menuitem6.caption
    77 msgid "-"
    78 msgstr ""
    79 
    8093#: tformmain.menuitem8.caption
    8194msgid "Tools"
     95msgstr ""
     96
     97#: tformrule.buttoncancel.caption
     98msgctxt "tformrule.buttoncancel.caption"
     99msgid "Cancel"
     100msgstr ""
     101
     102#: tformrule.buttonok.caption
     103msgctxt "tformrule.buttonok.caption"
     104msgid "Ok"
     105msgstr ""
     106
     107#: tformrule.caption
     108msgid "Rule"
     109msgstr ""
     110
     111#: tformrule.checkboxcreatenode.caption
     112msgid "Create source node"
     113msgstr ""
     114
     115#: tformrule.label1.caption
     116msgid "Name:"
     117msgstr ""
     118
     119#: tformrule.label2.caption
     120msgid "Lavel:"
     121msgstr ""
     122
     123#: tformrule.listview1.columns[0].caption
     124msgctxt "tformrule.listview1.columns[0].caption"
     125msgid "Name"
     126msgstr ""
     127
     128#: tformrule.tabsheet1.caption
     129msgctxt "tformrule.tabsheet1.caption"
     130msgid "Items"
     131msgstr ""
     132
     133#: tformrule.tabsheet2.caption
     134msgid "Links"
     135msgstr ""
     136
     137#: tformrule.tabsheetusedby.caption
     138msgid "Used by"
     139msgstr ""
     140
     141#: tformruleitem.buttoncancel.caption
     142msgctxt "tformruleitem.buttoncancel.caption"
     143msgid "Cancel"
     144msgstr ""
     145
     146#: tformruleitem.buttonok.caption
     147msgctxt "tformruleitem.buttonok.caption"
     148msgid "Ok"
     149msgstr ""
     150
     151#: tformruleitem.caption
     152msgid "Rule item"
     153msgstr ""
     154
     155#: tformruleitem.checkboxanyexcept.caption
     156msgid "Any except"
     157msgstr ""
     158
     159#: tformruleitem.checkboxoptional.caption
     160msgid "Optional"
     161msgstr ""
     162
     163#: tformruleitem.checkboxrepetitive.caption
     164msgid "Repetitive"
     165msgstr ""
     166
     167#: tformruleitem.label2.caption
     168msgid "Type:"
     169msgstr ""
     170
     171#: tformruleitem.labelnonterminal.caption
     172msgid "Non-terminal:"
     173msgstr ""
     174
     175#: tformruleitem.labelterminal.caption
     176msgid "Terminal:"
     177msgstr ""
     178
     179#: tformruleitem.labelterminal1.caption
     180msgid "Terminal from:"
     181msgstr ""
     182
     183#: tformruleitem.labelterminal2.caption
     184msgid "Terminal to:"
     185msgstr ""
     186
     187#: tformruleitem.tabsheetnonterminal.caption
     188msgid "NonTerminal"
     189msgstr ""
     190
     191#: tformruleitem.tabsheetsubitems.caption
     192msgid "SubItems"
     193msgstr ""
     194
     195#: tformruleitem.tabsheetterminal.caption
     196msgid "Terminal"
     197msgstr ""
     198
     199#: tformruleitem.tabsheetterminalrange.caption
     200msgid "TabSheetTerminalRange"
    82201msgstr ""
    83202
     
    163282
    164283#: tformrules.listview1.columns[2].caption
     284msgctxt "tformrules.listview1.columns[2].caption"
    165285msgid "Items"
    166286msgstr ""
     
    170290msgstr ""
    171291
     292#: tformrules.listview1.columns[4].caption
     293msgid "Level"
     294msgstr ""
     295
    172296#: uformmain.sdoyouwanttosaveproject
    173297msgid "There are unsaved changes in project. Do you want to save them?"
  • branches/generator/UCore.lfm

    r126 r129  
    33  OnDestroy = DataModuleDestroy
    44  OldCreateOrder = False
    5   Height = 586
    6   HorizontalOffset = 393
    7   VerticalOffset = 264
    8   Width = 944
     5  Height = 733
     6  HorizontalOffset = 491
     7  VerticalOffset = 297
     8  Width = 1180
     9  PPI = 120
    910  object ImageList1: TImageList
    10     left = 432
    11     top = 243
     11    left = 540
     12    top = 304
    1213    Bitmap = {
    1314      4C690B0000001000000010000000000000000000000000000000000000000000
     
    369370    MinVisiblePart = 50
    370371    EntireVisible = False
    371     left = 273
    372     top = 123
     372    left = 341
     373    top = 154
    373374  end
    374375  object XMLConfig1: TXMLConfig
     
    376377    RootName = 'CONFIG'
    377378    ReadOnly = False
    378     left = 201
    379     top = 262
     379    left = 251
     380    top = 328
    380381  end
    381382end
  • branches/generator/UCore.pas

    r126 r129  
    66
    77uses
    8   Classes, SysUtils, XMLConf, FileUtil, Controls, ActnList, URules, DOM,
     8  Classes, SysUtils, XMLConf, FileUtil, Controls, ActnList, UGrammer, DOM,
    99  UPersistentForm;
    1010
  • branches/generator/UGrammer.pas

    r128 r129  
    1 unit URules;
     1unit UGrammer;
    22
    33{$mode delphi}{$H+}
     
    7575  end;
    7676
     77  TRuleLevel = (rlParser, rlTokenizer);
     78
    7779  { TRule }
    7880
     
    8486    Name: string;
    8587    CreateSourceNode: Boolean;
     88    Level: TRuleLevel;
    8689    Items: TRuleItems;
    8790    Links: TRuleLinks;
     
    110113  private
    111114    FModified: Boolean;
    112     function GetItemString(Item: TRuleItem; Required: Boolean): string;
    113115    procedure SetModified(AValue: Boolean);
    114     procedure BuildParser(FileName: string);
    115     procedure BuildMain(FileName: string);
    116     procedure BuildSource(FileName: string);
    117116  public
    118117    FileName: string;
     
    124123    constructor Create;
    125124    destructor Destroy; override;
    126     procedure BuildCompiler;
    127125    procedure GetUsedByRule(RefRule: TRule; UsedByRules: TStrings);
    128126    function GetString: string;
     
    130128  end;
    131129
     130const
     131  RuleLevelText: array[TRuleLevel] of string = ('Parser', 'Tokenizer');
     132  RuleTypeText: array[TRuleType] of string = ('and', 'or');
     133
     134
    132135implementation
    133136
    134 const
    135   BooleanText: array[Boolean] of string = ('False', 'True');
    136 
    137137{ TGrammer }
    138 
    139 function TGrammer.GetItemString(Item: TRuleItem; Required: Boolean): string;
    140 begin
    141   Result := '';
    142   case Item.RuleItemType of
    143     ritTerminal: Result := 'Expect(''' +
    144       StringReplace(Item.Terminal, '''', '''''', [rfReplaceAll]) + ''', ' + BooleanText[Required] + ')';
    145     ritNonTerminal: Result := 'Parse' + Item.NonTerminal.Name + '(' + BooleanText[Required] + ')';
    146     ritTerminalRange: Result := 'ExpectRange(''' +
    147       StringReplace(Item.TerminalFrom, '''', '''''', [rfReplaceAll]) + ''', ''' +
    148       StringReplace(Item.TerminalTo, '''', '''''', [rfReplaceAll]) + ''', ' + BooleanText[Required] + ')';
    149     //ritSubItems: Line := 'Parse +';
    150   end;
    151 end;
    152138
    153139procedure TGrammer.SetModified(AValue: Boolean);
     
    155141  if FModified = AValue then Exit;
    156142  FModified := AValue;
    157 end;
    158 
    159 procedure TGrammer.BuildParser(FileName: string);
    160 var
    161   ParserFile: TStringList;
    162   Rule: TRule;
    163   I: Integer;
    164   Line: string;
    165   Item: TRuleItem;
    166   Required: Boolean;
    167 begin
    168   ParserFile := TStringList.Create;
    169   with ParserFile do begin
    170     Add('unit Parser;');
    171     Add('');
    172     Add('{$MODE Delphi}');
    173     Add('');
    174     Add('interface');
    175     Add('');
    176     Add('uses');
    177     Add('  SysUtils;');
    178     Add('');
    179     Add('type');
    180     Add('  TParser = class');
    181     Add('    Content: string;');
    182     Add('    FileName: string;');
    183     Add('    Position: Integer;');
    184     Add('    procedure Error(Text: string);');
    185     Add('    function Expect(Text: string; Required: Boolean = False): Boolean;');
    186     Add('    function ExpectRange(CharFrom, CharTo: Char; Required: Boolean = False): Boolean;');
    187     for Rule in Rules do
    188       Add('    function Parse' + Rule.Name + '(Required: Boolean = False): Boolean;');
    189     Add('    constructor Create;');
    190     Add('  end;');
    191     Add('');
    192     Add('implementation');
    193     Add('');
    194     Add('constructor TParser.Create;');
    195     Add('begin');
    196     Add('  Position := 1;');
    197     Add('end;');
    198     Add('');
    199     Add('procedure TParser.Error(Text: string);');
    200     Add('begin');
    201     Add('  WriteLn(FileName + ''('' + IntToStr(Position) + '') Error: '' + Text);');
    202     Add('end;');
    203     Add('');
    204     Add('function TParser.Expect(Text: string; Required: Boolean = False): Boolean;');
    205     Add('var');
    206     Add('  ReadText: string;');
    207     Add('  StartPos: Integer;');
    208     Add('begin');
    209     Add('  StartPos := Position;');
    210     Add('  ReadText := Copy(Content, Position, Length(Text));');
    211     Add('  Inc(Position, Length(Text));');
    212     Add('  Result := Text = ReadText;');
    213     Add('  if not Result then begin');
    214     Add('    Position := StartPos;');
    215     Add('    if Required then Error(''Expected "'' + Text + ''" but found "'' + ReadText + ''".'');');
    216     Add('  end;');
    217     Add('end;');
    218     Add('');
    219     Add('function TParser.ExpectRange(CharFrom, CharTo: char; Required: Boolean = False): Boolean;');
    220     Add('var');
    221     Add('  ReadChar: Char;');
    222     Add('  StartPos: Integer;');
    223     Add('begin');
    224     Add('  StartPos := Position;');
    225     Add('  ReadChar := Content[Position];');
    226     Add('  Inc(Position, 1);');
    227     Add('  Result := (ReadChar >= CharFrom) and (ReadChar <= CharTo);');
    228     Add('  if not Result then begin');
    229     Add('    Position := StartPos;');
    230     Add('    if Required then Error(''Expected "'' + CharFrom + ''" to "'' + CharTo + ''" but found "'' + ReadChar + ''".'');');
    231     Add('  end;');
    232     Add('end;');
    233     Add('');
    234     for Rule in Rules do begin
    235       Add('function TParser.Parse' + Rule.Name + '(Required: Boolean = False): Boolean;');
    236       Add('begin');
    237       Add('  Result := True;');
    238       I := 0;
    239       for Item in Rule.Items do begin
    240         Required := not Item.Optional;
    241         Line := '  ';
    242         case Rule.Items.RuleType of
    243           rtOr: begin
    244             if I > 0 then Line := Line + 'else ';
    245             Line := Line + 'if ' + GetItemString(Item, False);
    246             Line := Line + ' then Exit';
    247           end;
    248           rtAnd: begin
    249             Line := Line + 'Result := Result and ';
    250             if Item.Optional then Line := Line + 'True;' + LineEnding;
    251             if Item.Repetitive then begin
    252               if not Item.Optional then
    253                 Line := Line + '  ' + GetItemString(Item, Required) + ';' + LineEnding;
    254               Line := Line + '  repeat' + LineEnding + '    if not ';
    255               Required := False;
    256             end;
    257             Line := Line + GetItemString(Item, Required);
    258             if Item.Repetitive then Line := Line + ' then Break;' + LineEnding + '  until False';
    259             Line := Line + ';' + LineEnding + '  if not Result then Exit;';
    260           end;
    261         end;
    262         Add(Line);
    263         Inc(I);
    264       end;
    265       case Rule.Items.RuleType of
    266         rtOr: begin
    267           Add('  else begin');
    268           Add('    Error(''Unexpected token'');');
    269           Add('    Result := False;');
    270           Add('  end;');
    271         end;
    272         //rtAnd: Add('  if not Result then ShowError('''')');
    273       end;
    274       Add('end;');
    275       Add('');
    276     end;
    277     Add('');
    278     Add('end.');
    279     SaveToFile(FileName);
    280   end;
    281   FreeAndNil(ParserFile);
    282 end;
    283 
    284 procedure TGrammer.BuildMain(FileName: string);
    285 var
    286   ParserFile: TStringList;
    287 begin
    288   ParserFile := TStringList.Create;
    289   with ParserFile do begin
    290     Add('program Compiler;');
    291     Add('');
    292     Add('{$MODE Delphi}');
    293     Add('');
    294     Add('uses');
    295     Add('  Source, Parser, SysUtils;');
    296     Add('');
    297     Add('procedure Compile(FileName: string);');
    298     Add('var');
    299     Add('  SourceFile: file of Char;');
    300     Add('  Parser: TParser;');
    301     Add('  I: Integer;');
    302     Add('begin');
    303     Add('  AssignFile(SourceFile, FileName);');
    304     Add('  Reset(SourceFile);');
    305     Add('  Parser := TParser.Create;');
    306     Add('  Parser.FileName := ExtractFileName(FileName);');
    307     Add('  SetLength(Parser.Content, FileSize(SourceFile));');
    308     Add('  I := 1;');
    309     Add('  while not Eof(SourceFile) do begin');
    310     Add('    Read(SourceFile, Parser.Content[I]);');
    311     Add('    Inc(I);');
    312     Add('  end;');
    313     Add('  CloseFile(SourceFile);');
    314     if Assigned(TopRule) then
    315       Add('  Parser.Parse' + TopRule.Name + ';');
    316     Add('  Parser.Free;');
    317     Add('end;');
    318     Add('');
    319     Add('begin');
    320     Add('  if ParamCount > 0 then');
    321     Add('    Compile(ParamStr(1))');
    322     Add('    else WriteLn(''File name not specified as parameter.'');');
    323     Add('end.');
    324     SaveToFile(FileName);
    325   end;
    326   FreeAndNil(ParserFile);
    327 end;
    328 
    329 procedure TGrammer.BuildSource(FileName: string);
    330 var
    331   Rule: TRule;
    332   Item: TRuleItem;
    333   SourceFile: TStringList;
    334   TypeSectionStarted: Boolean;
    335 begin
    336   SourceFile := TStringList.Create;
    337   with SourceFile do begin
    338     Add('unit Source;');
    339     Add('');
    340     Add('{$MODE Delphi}');
    341     Add('');
    342     Add('interface');
    343     Add('');
    344     Add('uses');
    345     Add('  fgl;');
    346     Add('');
    347     TypeSectionStarted := False;
    348     for Rule in Rules do
    349     if Rule.CreateSourceNode then begin
    350       if not TypeSectionStarted then begin
    351         Add('type');
    352         TypeSectionStarted := True;
    353       end;
    354       Add('  T' + Rule.Name + ' = class;');
    355     end;
    356     Add('');
    357     for Rule in Rules do
    358     if Rule.CreateSourceNode then begin
    359       Add('  T' + Rule.Name + ' = class');
    360       for Item in Rule.Items do begin
    361         if Item.RuleItemType = ritNonTerminal then
    362           if Item.Repetitive then
    363           Add('    ' + Item.NonTerminal.Name + ': TFPGObjectList<T' + Item.NonTerminal.Name + '>;')
    364           else Add('    ' + Item.NonTerminal.Name + ': T' + Item.NonTerminal.Name + ';');
    365       end;
    366       Add('  end;' + LineEnding);
    367     end;
    368     Add('');
    369     Add('implementation');
    370     Add('');
    371 
    372     Add('end.');
    373 
    374     SaveToFile(FileName);
    375   end;
    376   FreeAndNil(SourceFile);
    377143end;
    378144
     
    449215  FreeAndNil(Rules);
    450216  inherited Destroy;
    451 end;
    452 
    453 procedure TGrammer.BuildCompiler;
    454 var
    455   OutputDir: string;
    456 begin
    457   OutputDir := 'Generated';
    458   ForceDirectories(OutputDir);
    459 
    460   BuildMain(OutputDir + DirectorySeparator + 'Compiler.pas');
    461   BuildSource(OutputDir + DirectorySeparator + 'Source.pas');
    462   BuildParser(OutputDir + DirectorySeparator + 'Parser.pas');
    463217end;
    464218
     
    666420  WriteString(Node, 'Name', Name);
    667421  WriteBoolean(Node, 'CreateSourceNode', CreateSourceNode);
     422  WriteInteger(Node, 'Level', Integer(Level));
    668423
    669424  RuleItemsNode := Node.OwnerDocument.CreateElement('RuleItems');
     
    715470  Name := ReadString(Node, 'Name', '');
    716471  CreateSourceNode := ReadBoolean(Node, 'CreateSourceNode', False);
     472  Level := TRuleLevel(ReadInteger(Node, 'Level', 0));
    717473
    718474  ItemsNode := Node.FindNode('RuleItems');
  • branches/generator/generator.lpi

    r127 r129  
    8585      </Item4>
    8686    </RequiredPackages>
    87     <Units Count="9">
     87    <Units Count="10">
    8888      <Unit0>
    8989        <Filename Value="generator.lpr"/>
     
    9898      </Unit1>
    9999      <Unit2>
    100         <Filename Value="URules.pas"/>
     100        <Filename Value="UGrammer.pas"/>
    101101        <IsPartOfProject Value="True"/>
    102102      </Unit2>
     
    143143        <ResourceBaseClass Value="Form"/>
    144144      </Unit8>
     145      <Unit9>
     146        <Filename Value="UBuilder.pas"/>
     147        <IsPartOfProject Value="True"/>
     148      </Unit9>
    145149    </Units>
    146150  </ProjectOptions>
  • branches/generator/generator.lpr

    r126 r129  
    88  {$ENDIF}{$ENDIF}
    99  Interfaces, // this includes the LCL widgetset
    10   Forms, UCore, Common, TemplateGenerics, UFormMain, SysUtils
     10  Forms, UCore, Common, TemplateGenerics, UFormMain, SysUtils, UBuilder
    1111  { you can add units after this };
    1212
  • branches/generator/pascal.grm

    r128 r129  
    55      <Name>BeginEnd</Name>
    66      <CreateSourceNode>-1</CreateSourceNode>
     7      <Level>0</Level>
    78      <RuleItems>
    89        <Type>0</Type>
     
    3334      <Name>IfThenElse</Name>
    3435      <CreateSourceNode>-1</CreateSourceNode>
     36      <Level>0</Level>
    3537      <RuleItems>
    3638        <Type>0</Type>
     
    9193      <Name>WhileDo</Name>
    9294      <CreateSourceNode>-1</CreateSourceNode>
     95      <Level>0</Level>
    9396      <RuleItems>
    9497        <Type>0</Type>
     
    126129      <Name>RepeatUntil</Name>
    127130      <CreateSourceNode>-1</CreateSourceNode>
     131      <Level>0</Level>
    128132      <RuleItems>
    129133        <Type>0</Type>
     
    161165      <Name>ForToDo</Name>
    162166      <CreateSourceNode>-1</CreateSourceNode>
     167      <Level>0</Level>
    163168      <RuleItems>
    164169        <Type>0</Type>
     
    224229      <Name>WithDo</Name>
    225230      <CreateSourceNode>-1</CreateSourceNode>
     231      <Level>0</Level>
    226232      <RuleItems>
    227233        <Type>0</Type>
     
    259265      <Name>CaseOf</Name>
    260266      <CreateSourceNode>-1</CreateSourceNode>
     267      <Level>0</Level>
    261268      <RuleItems>
    262269        <Type>0</Type>
     
    331338      <Name>Assignment</Name>
    332339      <CreateSourceNode>-1</CreateSourceNode>
     340      <Level>0</Level>
    333341      <RuleItems>
    334342        <Type>0</Type>
     
    359367      <Name>Statement</Name>
    360368      <CreateSourceNode>-1</CreateSourceNode>
     369      <Level>0</Level>
    361370      <RuleItems>
    362371        <Type>1</Type>
     
    429438      <Name>Expression</Name>
    430439      <CreateSourceNode>-1</CreateSourceNode>
     440      <Level>0</Level>
    431441      <RuleItems>
    432442        <Type>0</Type>
     
    443453      <Name>VariableReference</Name>
    444454      <CreateSourceNode>0</CreateSourceNode>
     455      <Level>0</Level>
    445456      <RuleItems>
    446457        <Type>0</Type>
     
    457468      <Name>Program</Name>
    458469      <CreateSourceNode>-1</CreateSourceNode>
     470      <Level>0</Level>
    459471      <RuleItems>
    460472        <Type>0</Type>
     
    515527      <Name>Uses</Name>
    516528      <CreateSourceNode>0</CreateSourceNode>
     529      <Level>0</Level>
    517530      <RuleItems>
    518531        <Type>0</Type>
     
    566579      <Name>UnitName</Name>
    567580      <CreateSourceNode>0</CreateSourceNode>
     581      <Level>0</Level>
    568582      <RuleItems>
    569583        <Type>0</Type>
     
    580594      <Name>Function</Name>
    581595      <CreateSourceNode>-1</CreateSourceNode>
     596      <Level>0</Level>
    582597      <RuleItems>
    583598        <Type>0</Type>
     
    643658      <Name>Identifier</Name>
    644659      <CreateSourceNode>0</CreateSourceNode>
     660      <Level>1</Level>
    645661      <RuleItems>
    646662        <Type>0</Type>
     
    687703      <Name>VariableSection</Name>
    688704      <CreateSourceNode>0</CreateSourceNode>
     705      <Level>0</Level>
    689706      <RuleItems>
    690707        <Type>0</Type>
     
    708725      <Name>FunctionParameters</Name>
    709726      <CreateSourceNode>0</CreateSourceNode>
     727      <Level>0</Level>
    710728      <RuleItems>
    711729        <Type>0</Type>
     
    759777      <Name>FunctionParameter</Name>
    760778      <CreateSourceNode>0</CreateSourceNode>
     779      <Level>0</Level>
    761780      <RuleItems>
    762781        <Type>0</Type>
     
    787806      <Name>VariableDefinition</Name>
    788807      <CreateSourceNode>0</CreateSourceNode>
     808      <Level>0</Level>
    789809      <RuleItems>
    790810        <Type>0</Type>
     
    822842      <Name>TypeReference</Name>
    823843      <CreateSourceNode>0</CreateSourceNode>
     844      <Level>0</Level>
    824845      <RuleItems>
    825846        <Type>0</Type>
     
    836857      <Name>VariableName</Name>
    837858      <CreateSourceNode>0</CreateSourceNode>
     859      <Level>0</Level>
    838860      <RuleItems>
    839861        <Type>0</Type>
     
    850872      <Name>Unit</Name>
    851873      <CreateSourceNode>-1</CreateSourceNode>
     874      <Level>0</Level>
    852875      <RuleItems>
    853876        <Type>0</Type>
     
    920943      <Name>UnitReference</Name>
    921944      <CreateSourceNode>0</CreateSourceNode>
     945      <Level>0</Level>
    922946      <RuleItems>
    923947        <Type>0</Type>
     
    934958      <Name>ForInDo</Name>
    935959      <CreateSourceNode>-1</CreateSourceNode>
     960      <Level>0</Level>
    936961      <RuleItems>
    937962        <Type>0</Type>
     
    9831008      <Name>TypeRecord</Name>
    9841009      <CreateSourceNode>-1</CreateSourceNode>
     1010      <Level>0</Level>
    9851011      <RuleItems>
    9861012        <Type>0</Type>
     
    10411067      <Name>ProgramName</Name>
    10421068      <CreateSourceNode>0</CreateSourceNode>
     1069      <Level>0</Level>
    10431070      <RuleItems>
    10441071        <Type>0</Type>
     
    10551082      <Name>FunctionName</Name>
    10561083      <CreateSourceNode>0</CreateSourceNode>
     1084      <Level>0</Level>
    10571085      <RuleItems>
    10581086        <Type>0</Type>
     
    10691097      <Name>Digit</Name>
    10701098      <CreateSourceNode>0</CreateSourceNode>
     1099      <Level>1</Level>
    10711100      <RuleItems>
    10721101        <Type>1</Type>
     
    10841113      <Name>Sign</Name>
    10851114      <CreateSourceNode>0</CreateSourceNode>
     1115      <Level>1</Level>
    10861116      <RuleItems>
    10871117        <Type>1</Type>
     
    11051135      <Name>UnsignedDigitSequence</Name>
    11061136      <CreateSourceNode>0</CreateSourceNode>
     1137      <Level>1</Level>
    11071138      <RuleItems>
    11081139        <Type>0</Type>
     
    11261157      <Name>DigitSequence</Name>
    11271158      <CreateSourceNode>0</CreateSourceNode>
     1159      <Level>1</Level>
    11281160      <RuleItems>
    11291161        <Type>0</Type>
     
    11471179      <Name>RealNumber</Name>
    11481180      <CreateSourceNode>0</CreateSourceNode>
     1181      <Level>1</Level>
    11491182      <RuleItems>
    11501183        <Type>0</Type>
     
    11751208      <Name>IntegerNumber</Name>
    11761209      <CreateSourceNode>0</CreateSourceNode>
     1210      <Level>1</Level>
    11771211      <RuleItems>
    11781212        <Type>0</Type>
     
    11891223      <Name>Number</Name>
    11901224      <CreateSourceNode>0</CreateSourceNode>
     1225      <Level>0</Level>
    11911226      <RuleItems>
    11921227        <Type>1</Type>
     
    12101245      <Name>Letter</Name>
    12111246      <CreateSourceNode>0</CreateSourceNode>
     1247      <Level>1</Level>
    12121248      <RuleItems>
    12131249        <Type>1</Type>
     
    12331269      <Name>ConstantSection</Name>
    12341270      <CreateSourceNode>0</CreateSourceNode>
     1271      <Level>0</Level>
    12351272      <RuleItems>
    12361273        <Type>0</Type>
     
    12541291      <Name>Declaration</Name>
    12551292      <CreateSourceNode>0</CreateSourceNode>
     1293      <Level>0</Level>
    12561294      <RuleItems>
    12571295        <Type>1</Type>
     
    12821320      <Name>TypeSection</Name>
    12831321      <CreateSourceNode>0</CreateSourceNode>
     1322      <Level>0</Level>
    12841323      <RuleItems>
    12851324        <Type>0</Type>
     
    13031342      <Name>DeclarationBlock</Name>
    13041343      <CreateSourceNode>0</CreateSourceNode>
     1344      <Level>0</Level>
    13051345      <RuleItems>
    13061346        <Type>0</Type>
     
    13241364      <Name>ConstantName</Name>
    13251365      <CreateSourceNode>0</CreateSourceNode>
     1366      <Level>0</Level>
    13261367      <RuleItems>
    13271368        <Type>0</Type>
     
    13381379      <Name>Term</Name>
    13391380      <CreateSourceNode>-1</CreateSourceNode>
     1381      <Level>0</Level>
    13401382      <RuleItems>
    13411383        <Type>0</Type>
     
    13751417      <Name>Factor</Name>
    13761418      <CreateSourceNode>0</CreateSourceNode>
     1419      <Level>0</Level>
    13771420      <RuleItems>
    13781421        <Type>1</Type>
     
    14401483      <Name>Operator</Name>
    14411484      <CreateSourceNode>0</CreateSourceNode>
     1485      <Level>1</Level>
    14421486      <RuleItems>
    14431487        <Type>1</Type>
     
    15871631      <Name>ConstantReference</Name>
    15881632      <CreateSourceNode>0</CreateSourceNode>
     1633      <Level>0</Level>
    15891634      <RuleItems>
    15901635        <Type>0</Type>
     
    16011646      <Name>String</Name>
    16021647      <CreateSourceNode>0</CreateSourceNode>
     1648      <Level>1</Level>
    16031649      <RuleItems>
    16041650        <Type>0</Type>
     
    16291675      <Name>StringCharacter</Name>
    16301676      <CreateSourceNode>0</CreateSourceNode>
     1677      <Level>1</Level>
    16311678      <RuleItems>
    16321679        <Type>1</Type>
     
    16501697      <Name>ParameterName</Name>
    16511698      <CreateSourceNode>0</CreateSourceNode>
     1699      <Level>0</Level>
    16521700      <RuleItems>
    16531701        <Type>0</Type>
     
    16641712      <Name>Comment1</Name>
    16651713      <CreateSourceNode>0</CreateSourceNode>
     1714      <Level>0</Level>
    16661715      <RuleItems>
    16671716        <Type>0</Type>
     
    16921741      <Name>Comment2</Name>
    16931742      <CreateSourceNode>0</CreateSourceNode>
     1743      <Level>0</Level>
    16941744      <RuleItems>
    16951745        <Type>0</Type>
     
    17201770      <Name>CommentLine</Name>
    17211771      <CreateSourceNode>0</CreateSourceNode>
     1772      <Level>0</Level>
    17221773      <RuleItems>
    17231774        <Type>0</Type>
     
    17411792      <Name>CompilerDirective</Name>
    17421793      <CreateSourceNode>0</CreateSourceNode>
     1794      <Level>0</Level>
    17431795      <RuleItems>
    17441796        <Type>0</Type>
     
    17691821      <Name>UnitInitialization</Name>
    17701822      <CreateSourceNode>0</CreateSourceNode>
     1823      <Level>0</Level>
    17711824      <RuleItems>
    17721825        <Type>0</Type>
     
    17901843      <Name>UnitFinalization</Name>
    17911844      <CreateSourceNode>0</CreateSourceNode>
     1845      <Level>0</Level>
    17921846      <RuleItems>
    17931847        <Type>0</Type>
     
    18111865      <Name>TypeDefinition</Name>
    18121866      <CreateSourceNode>0</CreateSourceNode>
     1867      <Level>0</Level>
    18131868      <RuleItems>
    18141869        <Type>0</Type>
     
    18461901      <Name>ConstantDefinition</Name>
    18471902      <CreateSourceNode>0</CreateSourceNode>
     1903      <Level>0</Level>
    18481904      <RuleItems>
    18491905        <Type>0</Type>
     
    18951951      <Name>Procedure</Name>
    18961952      <CreateSourceNode>-1</CreateSourceNode>
     1953      <Level>0</Level>
    18971954      <RuleItems>
    18981955        <Type>0</Type>
     
    19442001      <Name>CaseOfState</Name>
    19452002      <CreateSourceNode>0</CreateSourceNode>
     2003      <Level>0</Level>
    19462004      <RuleItems>
    19472005        <Type>0</Type>
     
    19792037      <Name>WhiteSpace</Name>
    19802038      <CreateSourceNode>0</CreateSourceNode>
     2039      <Level>1</Level>
    19812040      <RuleItems>
    19822041        <Type>1</Type>
     
    20142073      <Name>WhiteSpaces</Name>
    20152074      <CreateSourceNode>0</CreateSourceNode>
     2075      <Level>1</Level>
    20162076      <RuleItems>
    20172077        <Type>0</Type>
     
    20282088      <Name>Range</Name>
    20292089      <CreateSourceNode>0</CreateSourceNode>
     2090      <Level>0</Level>
    20302091      <RuleItems>
    20312092        <Type>0</Type>
     
    20562117      <Name>TypeArray</Name>
    20572118      <CreateSourceNode>0</CreateSourceNode>
     2119      <Level>0</Level>
    20582120      <RuleItems>
    20592121        <Type>0</Type>
     
    21212183      <Name>TypeSet</Name>
    21222184      <CreateSourceNode>0</CreateSourceNode>
     2185      <Level>0</Level>
    21232186      <RuleItems>
    21242187        <Type>0</Type>
     
    21492212      <Name>TypeEnumeration</Name>
    21502213      <CreateSourceNode>0</CreateSourceNode>
     2214      <Level>0</Level>
    21512215      <RuleItems>
    21522216        <Type>0</Type>
     
    21772241      <Name>IdentifierList</Name>
    21782242      <CreateSourceNode>0</CreateSourceNode>
     2243      <Level>0</Level>
    21792244      <RuleItems>
    21802245        <Type>0</Type>
     
    22142279      <Name>Type</Name>
    22152280      <CreateSourceNode>0</CreateSourceNode>
     2281      <Level>0</Level>
    22162282      <RuleItems>
    22172283        <Type>1</Type>
     
    22632329      <Name>TypePointer</Name>
    22642330      <CreateSourceNode>0</CreateSourceNode>
     2331      <Level>0</Level>
    22652332      <RuleItems>
    22662333        <Type>0</Type>
     
    22782345          <AnyExcept>0</AnyExcept>
    22792346          <NonTerminal>TypeReference</NonTerminal>
     2347        </RuleItem>
     2348      </RuleItems>
     2349    </Rule>
     2350    <Rule>
     2351      <Name>HexNumber</Name>
     2352      <CreateSourceNode>0</CreateSourceNode>
     2353      <Level>1</Level>
     2354      <RuleItems>
     2355        <Type>0</Type>
     2356        <RuleItem>
     2357          <Type>0</Type>
     2358          <Optional>0</Optional>
     2359          <Repetitive>0</Repetitive>
     2360          <AnyExcept>0</AnyExcept>
     2361          <Terminal>$</Terminal>
     2362        </RuleItem>
     2363        <RuleItem>
     2364          <Type>1</Type>
     2365          <Optional>0</Optional>
     2366          <Repetitive>0</Repetitive>
     2367          <AnyExcept>0</AnyExcept>
     2368          <NonTerminal>UnsignedDigitSequence</NonTerminal>
    22802369        </RuleItem>
    22812370      </RuleItems>
Note: See TracChangeset for help on using the changeset viewer.