Changeset 12


Ignore:
Timestamp:
Nov 9, 2009, 10:02:35 PM (14 years ago)
Author:
george
Message:
  • Opraveno: Parsování.
Location:
branches/Void
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/Void/Example.void

    r11 r12  
    11var
    22  Text: string;
    3 begin;
     3  A: Integer;
     4begin
    45  Text := 'Hell';
    56  WriteLn('Leave me');
    67  WriteLn(Text);
    78  ReadLn;
    8 end;
     9end.
  • branches/Void/UCompilator.pas

    r11 r12  
    4949  with Model, Module, BeginEnd do begin
    5050    if Parser.TokenType = ttWhiteSpace then begin
     51      Parser.ParseNextToken;
    5152    end else
    5253    if Parser.TokenType = ttIdentifier then begin
     
    6667        ParseBeginEnd;
    6768      end;
    68     end;
     69    end else Parser.ParseNextToken;
    6970  end;
    7071end;
     
    7677  Variable: TVariable;
    7778begin
     79  Parser.ParseNextToken;
     80  if Parser.TokenType <> ttWhiteSpace then DoError('Expected white space');
     81  Parser.ParseNextToken;
     82  if Parser.TokenType <> ttIdentifier then DoError('Expected identifier');
    7883  repeat
    79     Parser.ParseNextToken;
    80     if Parser.TokenType <> ttWhiteSpace then DoError('Expected white space');
    81     Parser.ParseNextToken;
    82     if Parser.TokenType <> ttIdentifier then DoError('Expected identifier');
    8384    VariableName := Parser.TokenValue;
    8485    Parser.ParseNextToken;
     
    133134  Value: string;
    134135begin
    135   with Model, Module, BeginEnd do begin
     136  Parser.ParseNextToken;
     137  with Model, Module, BeginEnd do repeat
    136138    if Parser.TokenType = ttWhiteSpace then begin
    137139    end else
    138140    if Parser.TokenType = ttIdentifier then begin
     141      if Parser.TokenValue = 'end' then Break;
    139142      CommandName := Parser.TokenValue;
    140143      begin
     
    186189      if Parser.TokenType <> ttWhiteSpace then DoError('Expected white space');
    187190    end else DoError('Expected identifier');
    188   end;
     191    Parser.ParseNextToken;
     192  until False;
     193  Parser.ParseNextToken;
    189194end;
    190195
  • branches/Void/project1.lpi

    r11 r12  
    2525      <local>
    2626        <FormatVersion Value="1"/>
    27         <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
     27        <LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
    2828      </local>
    2929    </RunParams>
     
    4040        <CursorPos X="21" Y="16"/>
    4141        <TopLine Value="1"/>
    42         <EditorIndex Value="2"/>
    43         <UsageCount Value="32"/>
    44         <Loaded Value="True"/>
     42        <UsageCount Value="39"/>
    4543      </Unit0>
    4644      <Unit1>
     
    5048        <ResourceBaseClass Value="Form"/>
    5149        <UnitName Value="UMainForm"/>
    52         <CursorPos X="44" Y="91"/>
    53         <TopLine Value="68"/>
     50        <CursorPos X="46" Y="28"/>
     51        <TopLine Value="52"/>
    5452        <EditorIndex Value="0"/>
    55         <UsageCount Value="32"/>
     53        <UsageCount Value="39"/>
    5654        <Loaded Value="True"/>
    5755      </Unit1>
     
    5957        <Filename Value="UCompilator.pas"/>
    6058        <UnitName Value="UCompilator"/>
    61         <CursorPos X="1" Y="60"/>
    62         <TopLine Value="50"/>
     59        <CursorPos X="24" Y="80"/>
     60        <TopLine Value="64"/>
    6361        <EditorIndex Value="1"/>
    64         <UsageCount Value="16"/>
     62        <UsageCount Value="19"/>
    6563        <Loaded Value="True"/>
    6664      </Unit2>
     
    7068        <UnitName Value="UOutputGenerator"/>
    7169        <CursorPos X="12" Y="118"/>
    72         <TopLine Value="112"/>
    73         <EditorIndex Value="4"/>
    74         <UsageCount Value="32"/>
     70        <TopLine Value="106"/>
     71        <EditorIndex Value="3"/>
     72        <UsageCount Value="39"/>
    7573        <Loaded Value="True"/>
    7674      </Unit3>
     
    7876        <Filename Value="Example.void"/>
    7977        <IsPartOfProject Value="True"/>
    80         <CursorPos X="15" Y="4"/>
     78        <CursorPos X="1" Y="1"/>
    8179        <TopLine Value="1"/>
    82         <UsageCount Value="32"/>
     80        <UsageCount Value="39"/>
    8381        <SyntaxHighlighter Value="None"/>
    8482      </Unit4>
     
    8987        <CursorPos X="24" Y="48"/>
    9088        <TopLine Value="25"/>
    91         <EditorIndex Value="5"/>
    92         <UsageCount Value="32"/>
     89        <EditorIndex Value="4"/>
     90        <UsageCount Value="39"/>
    9391        <Loaded Value="True"/>
    9492      </Unit5>
     
    9896        <CursorPos X="7" Y="11"/>
    9997        <TopLine Value="1"/>
    100         <UsageCount Value="19"/>
     98        <UsageCount Value="18"/>
    10199      </Unit6>
    102100      <Unit7>
     
    104102        <CursorPos X="15" Y="743"/>
    105103        <TopLine Value="728"/>
    106         <UsageCount Value="14"/>
     104        <UsageCount Value="13"/>
    107105      </Unit7>
    108106      <Unit8>
     
    110108        <CursorPos X="16" Y="324"/>
    111109        <TopLine Value="322"/>
    112         <UsageCount Value="14"/>
     110        <UsageCount Value="13"/>
    113111      </Unit8>
    114112      <Unit9>
     
    116114        <CursorPos X="10" Y="89"/>
    117115        <TopLine Value="70"/>
    118         <UsageCount Value="9"/>
     116        <UsageCount Value="8"/>
    119117      </Unit9>
    120118      <Unit10>
     
    123121        <UnitName Value="UVoidParser"/>
    124122        <CursorPos X="9" Y="69"/>
    125         <TopLine Value="52"/>
    126         <EditorIndex Value="3"/>
    127         <UsageCount Value="32"/>
     123        <TopLine Value="7"/>
     124        <EditorIndex Value="2"/>
     125        <UsageCount Value="39"/>
    128126        <Loaded Value="True"/>
    129127      </Unit10>
     
    132130        <CursorPos X="5" Y="370"/>
    133131        <TopLine Value="365"/>
    134         <UsageCount Value="10"/>
     132        <UsageCount Value="9"/>
    135133      </Unit11>
    136134    </Units>
     
    138136      <Position1>
    139137        <Filename Value="UCompilator.pas"/>
    140         <Caret Line="86" Column="1" TopLine="71"/>
     138        <Caret Line="110" Column="1" TopLine="94"/>
    141139      </Position1>
    142140      <Position2>
    143141        <Filename Value="UCompilator.pas"/>
    144         <Caret Line="88" Column="1" TopLine="73"/>
     142        <Caret Line="111" Column="1" TopLine="95"/>
    145143      </Position2>
    146144      <Position3>
    147145        <Filename Value="UCompilator.pas"/>
    148         <Caret Line="86" Column="22" TopLine="74"/>
     146        <Caret Line="112" Column="1" TopLine="96"/>
    149147      </Position3>
    150148      <Position4>
    151149        <Filename Value="UCompilator.pas"/>
    152         <Caret Line="48" Column="1" TopLine="33"/>
     150        <Caret Line="106" Column="24" TopLine="97"/>
    153151      </Position4>
    154152      <Position5>
    155153        <Filename Value="UCompilator.pas"/>
    156         <Caret Line="83" Column="1" TopLine="68"/>
     154        <Caret Line="80" Column="1" TopLine="64"/>
    157155      </Position5>
    158156      <Position6>
    159157        <Filename Value="UCompilator.pas"/>
    160         <Caret Line="84" Column="1" TopLine="69"/>
     158        <Caret Line="81" Column="1" TopLine="65"/>
    161159      </Position6>
    162160      <Position7>
    163161        <Filename Value="UCompilator.pas"/>
    164         <Caret Line="85" Column="1" TopLine="70"/>
     162        <Caret Line="82" Column="1" TopLine="66"/>
    165163      </Position7>
    166164      <Position8>
    167165        <Filename Value="UCompilator.pas"/>
    168         <Caret Line="86" Column="1" TopLine="71"/>
     166        <Caret Line="83" Column="1" TopLine="67"/>
    169167      </Position8>
    170168      <Position9>
    171169        <Filename Value="UCompilator.pas"/>
    172         <Caret Line="88" Column="1" TopLine="73"/>
     170        <Caret Line="84" Column="1" TopLine="68"/>
    173171      </Position9>
    174172      <Position10>
    175173        <Filename Value="UCompilator.pas"/>
    176         <Caret Line="89" Column="1" TopLine="74"/>
     174        <Caret Line="85" Column="1" TopLine="69"/>
    177175      </Position10>
    178176      <Position11>
    179177        <Filename Value="UCompilator.pas"/>
    180         <Caret Line="90" Column="1" TopLine="75"/>
     178        <Caret Line="86" Column="1" TopLine="70"/>
    181179      </Position11>
    182180      <Position12>
    183181        <Filename Value="UCompilator.pas"/>
    184         <Caret Line="91" Column="1" TopLine="76"/>
     182        <Caret Line="87" Column="1" TopLine="71"/>
    185183      </Position12>
    186184      <Position13>
    187185        <Filename Value="UCompilator.pas"/>
    188         <Caret Line="93" Column="1" TopLine="78"/>
     186        <Caret Line="89" Column="1" TopLine="73"/>
    189187      </Position13>
    190188      <Position14>
    191189        <Filename Value="UCompilator.pas"/>
    192         <Caret Line="94" Column="1" TopLine="79"/>
     190        <Caret Line="90" Column="1" TopLine="74"/>
    193191      </Position14>
    194192      <Position15>
    195193        <Filename Value="UCompilator.pas"/>
    196         <Caret Line="95" Column="1" TopLine="80"/>
     194        <Caret Line="91" Column="1" TopLine="75"/>
    197195      </Position15>
    198196      <Position16>
    199197        <Filename Value="UCompilator.pas"/>
    200         <Caret Line="97" Column="1" TopLine="82"/>
     198        <Caret Line="92" Column="1" TopLine="76"/>
    201199      </Position16>
    202200      <Position17>
    203201        <Filename Value="UCompilator.pas"/>
    204         <Caret Line="99" Column="1" TopLine="84"/>
     202        <Caret Line="94" Column="1" TopLine="78"/>
    205203      </Position17>
    206204      <Position18>
    207205        <Filename Value="UCompilator.pas"/>
    208         <Caret Line="100" Column="1" TopLine="85"/>
     206        <Caret Line="95" Column="1" TopLine="79"/>
    209207      </Position18>
    210208      <Position19>
    211209        <Filename Value="UCompilator.pas"/>
    212         <Caret Line="102" Column="1" TopLine="87"/>
     210        <Caret Line="96" Column="1" TopLine="80"/>
    213211      </Position19>
    214212      <Position20>
    215213        <Filename Value="UCompilator.pas"/>
    216         <Caret Line="106" Column="1" TopLine="91"/>
     214        <Caret Line="98" Column="1" TopLine="82"/>
    217215      </Position20>
    218216      <Position21>
    219217        <Filename Value="UCompilator.pas"/>
    220         <Caret Line="107" Column="1" TopLine="92"/>
     218        <Caret Line="100" Column="1" TopLine="84"/>
    221219      </Position21>
    222220      <Position22>
    223221        <Filename Value="UCompilator.pas"/>
    224         <Caret Line="109" Column="1" TopLine="94"/>
     222        <Caret Line="101" Column="1" TopLine="85"/>
    225223      </Position22>
    226224      <Position23>
    227225        <Filename Value="UCompilator.pas"/>
    228         <Caret Line="110" Column="1" TopLine="95"/>
     226        <Caret Line="103" Column="1" TopLine="87"/>
    229227      </Position23>
    230228      <Position24>
    231229        <Filename Value="UCompilator.pas"/>
    232         <Caret Line="111" Column="1" TopLine="96"/>
     230        <Caret Line="107" Column="1" TopLine="91"/>
    233231      </Position24>
    234232      <Position25>
    235233        <Filename Value="UCompilator.pas"/>
    236         <Caret Line="112" Column="1" TopLine="97"/>
     234        <Caret Line="108" Column="1" TopLine="92"/>
    237235      </Position25>
    238236      <Position26>
    239237        <Filename Value="UCompilator.pas"/>
    240         <Caret Line="114" Column="1" TopLine="99"/>
     238        <Caret Line="110" Column="1" TopLine="94"/>
    241239      </Position26>
    242240      <Position27>
    243241        <Filename Value="UCompilator.pas"/>
    244         <Caret Line="68" Column="1" TopLine="38"/>
     242        <Caret Line="111" Column="1" TopLine="95"/>
    245243      </Position27>
    246244      <Position28>
    247245        <Filename Value="UCompilator.pas"/>
    248         <Caret Line="49" Column="1" TopLine="34"/>
     246        <Caret Line="112" Column="1" TopLine="96"/>
    249247      </Position28>
    250248      <Position29>
    251249        <Filename Value="UCompilator.pas"/>
    252         <Caret Line="50" Column="1" TopLine="35"/>
     250        <Caret Line="113" Column="1" TopLine="97"/>
    253251      </Position29>
    254252      <Position30>
    255253        <Filename Value="UCompilator.pas"/>
    256         <Caret Line="52" Column="1" TopLine="37"/>
     254        <Caret Line="114" Column="1" TopLine="98"/>
    257255      </Position30>
    258256    </JumpHistory>
     
    280278  </CompilerOptions>
    281279  <Debugging>
    282     <BreakPoints Count="2">
     280    <BreakPoints Count="1">
    283281      <Item1>
    284282        <Source Value="UCompilator.pas"/>
    285         <Line Value="47"/>
     283        <Line Value="84"/>
    286284      </Item1>
    287       <Item2>
    288         <Source Value="UCompilator.pas"/>
    289         <Line Value="83"/>
    290       </Item2>
    291285    </BreakPoints>
    292286    <Exceptions Count="3">
Note: See TracChangeset for help on using the changeset viewer.