mwdmlsyn.pas
来自「本人买的<<VC++项目开发实例>>源代码配套光盘.」· PAS 代码 · 共 1,866 行 · 第 1/4 页
PAS
1,866 行
fIdentFuncTable[182] := Func182;
fIdentFuncTable[183] := Func183;
fIdentFuncTable[184] := Func184;
fIdentFuncTable[185] := Func185;
fIdentFuncTable[187] := Func187;
fIdentFuncTable[188] := Func188;
fIdentFuncTable[203] := Func203;
fIdentFuncTable[206] := Func206;
fIdentFuncTable[216] := Func216;
fIdentFuncTable[219] := Func219;
fIdentFuncTable[221] := Func221;
fIdentFuncTable[232] := Func232;
fIdentFuncTable[234] := Func234;
fIdentFuncTable[235] := Func235;
fIdentFuncTable[243] := Func243;
fIdentFuncTable[244] := Func244;
fIdentFuncTable[255] := Func255;
fIdentFuncTable[313] := Func313;
fIdentFuncTable[327] := Func327;
end;
function TmwDmlSyn.IsQuali: boolean;
begin
Result:= False;
if Run > 0 then
if fLine[Run-1]= '/' then Result:= True;
end;
function TmwDmlSyn.IsSpecial: boolean;
begin
Result:= False;
if Run > 0 then
if fLine[Run-1]= '%' then Result:= True;
end;
function TmwDmlSyn.KeyHash(ToHash: PChar): Integer;
begin
Result := 0;
while ToHash^ in ['a'..'z', 'A'..'Z', '_'] do
begin
inc(Result, mHashTable[ToHash^]);
inc(ToHash);
end;
if ToHash^ in ['_', '0'..'9'] then inc(ToHash);
fStringLen := ToHash - fToIdent;
end; { KeyHash }
function TmwDmlSyn.KeyComp(const aKey: String): Boolean;
var
I: Integer;
begin
Temp := fToIdent;
if Length(aKey) = fStringLen then
begin
Result := True;
for i := 1 to fStringLen do
begin
if mHashTable[Temp^] <> mHashTable[aKey[i]] then
begin
Result := False;
break;
end;
inc(Temp);
end;
end else Result := False;
end; { KeyComp }
function TmwDmlSyn.Func9: TtkTokenKind;
begin
if KeyComp('Add') then
begin
if IsSpecial then Result := tkSpecial
else begin
Result := tkKey;
fRange := rsAdd;
end;
end else
Result := tkIdentifier;
end;
function TmwDmlSyn.Func15: TtkTokenKind;
begin
if KeyComp('If') then Result := tkKey else Result := tkIdentifier;
end;
function TmwDmlSyn.Func17: TtkTokenKind;
begin
if KeyComp('Back') and IsQuali then Result := tkQualifier else
Result := tkIdentifier;
end;
function TmwDmlSyn.Func19: TtkTokenKind;
begin
if KeyComp('Dcl') then Result := tkKey else Result := tkIdentifier;
end;
function TmwDmlSyn.Func22: TtkTokenKind;
begin
if KeyComp('Abs') then Result := tkFunction else Result := tkIdentifier;
end;
function TmwDmlSyn.Func23: TtkTokenKind;
begin
if KeyComp('In') and (fRange = rsFind) then
begin
Result := tkKey;
fRange:= rsUnKnown;
end else Result := tkIdentifier;
end;
function TmwDmlSyn.Func24: TtkTokenKind;
begin
if KeyComp('Cli') then Result := tkKey else Result := tkIdentifier;
end;
function TmwDmlSyn.Func26: TtkTokenKind;
begin
if KeyComp('Mid') then Result := tkFunction else Result := tkIdentifier;
end;
function TmwDmlSyn.Func27: TtkTokenKind;
begin
if KeyComp('Base') and IsQuali then Result := tkQualifier else
Result := tkIdentifier;
end;
function TmwDmlSyn.Func28: TtkTokenKind;
begin
if KeyComp('Tag') and IsQuali then Result := tkQualifier else
if KeyComp('Case') then Result := tkKey else
if KeyComp('Call') then Result := tkKey else Result := tkIdentifier;
end;
function TmwDmlSyn.Func29: TtkTokenKind;
begin
if KeyComp('Chr') then Result := tkFunction else
if KeyComp('Ceil') then Result := tkFunction else Result := tkIdentifier;
end;
function TmwDmlSyn.Func30: TtkTokenKind;
begin
if KeyComp('Check') and IsQuali then Result := tkQualifier else
if KeyComp('Col') then begin
if IsQuali then Result := tkQualifier else
if IsSpecial then Result := tkSpecial else Result := tkIdentifier;
end else
if KeyComp('Date') then Result := tkFunction else Result := tkIdentifier;
end;
function TmwDmlSyn.Func31: TtkTokenKind;
begin
if KeyComp('Len') then begin
if IsQuali then Result := tkQualifier else Result := tkFunction;
end else
if KeyComp('Dir') then Result := tkKey else
if KeyComp('Bell') and IsQuali then Result := tkQualifier else
Result := tkIdentifier;
end;
function TmwDmlSyn.Func32: TtkTokenKind;
begin
if KeyComp('Mod') then Result := tkFunction else
if KeyComp('Load') then Result := tkKey else Result := tkIdentifier;
end;
function TmwDmlSyn.Func33: TtkTokenKind;
begin
if KeyComp('Find') then
begin
Result := tkKey;
fRange := rsFind;
end else Result := tkIdentifier;
end;
function TmwDmlSyn.Func34: TtkTokenKind;
begin
if KeyComp('Log') then begin
if IsQuali then Result := tkQualifier else Result := tkFunction;
end else if KeyComp('Batch') and IsQuali then Result := tkQualifier else
if KeyComp('Log10') then Result := tkFunction else
Result := tkIdentifier;
end;
function TmwDmlSyn.Func35: TtkTokenKind;
begin
if KeyComp('Tan') then Result := tkFunction else
if KeyComp('To') and (fRange=rsAdd) then
begin
Result := tkKey;
fRange := rsUnKnown;
end else
if KeyComp('Mail') then Result := tkKey else Result := tkIdentifier;
end;
function TmwDmlSyn.Func36: TtkTokenKind;
begin
if KeyComp('Atan2') then Result := tkFunction else
if KeyComp('Atan') then Result := tkFunction else Result := tkIdentifier;
end;
function TmwDmlSyn.Func37: TtkTokenKind;
begin
if KeyComp('Break') and IsQuali then Result := tkQualifier else
if KeyComp('Break0') and IsQuali then Result := tkQualifier else
if KeyComp('Cos') then Result := tkFunction else Result := tkIdentifier;
end;
function TmwDmlSyn.Func38: TtkTokenKind;
begin
if KeyComp('Acos') then Result := tkFunction else
if KeyComp('Edit') then Result := tkKey else Result := tkIdentifier;
end;
function TmwDmlSyn.Func40: TtkTokenKind;
begin
if KeyComp('Line') then Result := tkKey else
if KeyComp('Table') and IsQuali then Result := tkQualifier else
Result := tkIdentifier;
end;
function TmwDmlSyn.Func41: TtkTokenKind;
begin
if KeyComp('Else') then Result := tkKey else
if KeyComp('Lock') and IsQuali then Result := tkQualifier else
if KeyComp('Ascii') then Result := tkFunction else Result := tkIdentifier;
end;
function TmwDmlSyn.Func42: TtkTokenKind;
begin
if KeyComp('Send') then Result := tkKey else
if KeyComp('Sin') then Result := tkFunction else
if KeyComp('New') and IsQuali then Result := tkQualifier else
if KeyComp('Fetch') then Result := tkKey else Result := tkIdentifier;
end;
function TmwDmlSyn.Func43: TtkTokenKind;
begin
if KeyComp('Asin') then Result := tkFunction else
if KeyComp('Int') then Result := tkFunction else
if KeyComp('Left') then Result := tkFunction else
if KeyComp('Tanh') then Result := tkFunction else
Result := tkIdentifier;
end;
function TmwDmlSyn.Func45: TtkTokenKind;
begin
if KeyComp('Cosh') then Result := tkFunction else Result := tkIdentifier;
end;
function TmwDmlSyn.Func47: TtkTokenKind;
begin
if KeyComp('Item') and IsQuali then Result := tkQualifier else
Result := tkIdentifier;
end;
function TmwDmlSyn.Func48: TtkTokenKind;
begin
if KeyComp('Heading') and IsQuali then Result := tkQualifier else
if KeyComp('Erase') then Result := tkKey else Result := tkIdentifier;
end;
function TmwDmlSyn.Func49: TtkTokenKind;
begin
if KeyComp('Days') then Result := tkFunction else
if KeyComp('Lov') and IsQuali then Result := tkQualifier else
Result := tkIdentifier;
end;
function TmwDmlSyn.Func50: TtkTokenKind;
begin
if KeyComp('Pos') and IsQuali then Result := tkQualifier else
if KeyComp('Sinh') then Result := tkFunction else
if KeyComp('Open') then Result := tkKey else Result := tkIdentifier;
end;
function TmwDmlSyn.Func51: TtkTokenKind;
begin
if KeyComp('Files') then Result := tkKey else
if KeyComp('Opt') and IsQuali then Result := tkQualifier else
if KeyComp('Delete') then Result := tkKey else Result := tkIdentifier;
end;
function TmwDmlSyn.Func52: TtkTokenKind;
begin
if KeyComp('Form') then begin
if IsSpecial then Result := tkSpecial else Result := tkForm;
end else
Result := tkIdentifier;
end;
function TmwDmlSyn.Func53: TtkTokenKind;
begin
if KeyComp('Wait') and IsQuali then Result := tkQualifier else
if KeyComp('Menu') then Result := tkKey else Result := tkIdentifier;
end;
function TmwDmlSyn.Func54: TtkTokenKind;
begin
if KeyComp('Close') then Result := tkKey else
if KeyComp('Search') then Result := tkKey else Result := tkIdentifier;
end;
function TmwDmlSyn.Func56: TtkTokenKind;
begin
if KeyComp('Domain') and IsQuali then Result := tkQualifier else
if KeyComp('Row') and IsQuali then Result := tkQualifier else
if KeyComp('Row') and IsSpecial then Result := tkSpecial else
Result := tkIdentifier;
end;
function TmwDmlSyn.Func57: TtkTokenKind;
begin
if KeyComp('While') then Result := tkKey else
if KeyComp('Height') and IsQuali then Result := tkQualifier else
if KeyComp('Goto') then Result := tkKey else Result := tkIdentifier;
end;
function TmwDmlSyn.Func58: TtkTokenKind;
begin
if KeyComp('Exit') and IsQuali then Result := tkQualifier else
if KeyComp('Exit') then Result := tkKey else Result := tkIdentifier;
end;
function TmwDmlSyn.Func60: TtkTokenKind;
begin
if KeyComp('List') then Result := tkKey else
if KeyComp('With') and IsQuali then Result := tkQualifier else
if KeyComp('Trim') then Result := tkFunction else
if KeyComp('Nobell') and IsQuali then Result := tkFunction else
if KeyComp('Lheading') and IsQuali then Result := tkQualifier else
if KeyComp('Remain') and IsQuali then Result := tkQualifier else
Result := tkIdentifier;
end;
function TmwDmlSyn.Func62: TtkTokenKind;
begin
if KeyComp('Right') then Result := tkFunction else
if KeyComp('Pause') and IsQuali then Result := tkQualifier else
Result := tkIdentifier;
end;
function TmwDmlSyn.Func64: TtkTokenKind;
begin
if KeyComp('Width') and IsQuali then Result := tkQualifier else
if KeyComp('Expand') then Result := tkFunction else Result := tkIdentifier;
end;
function TmwDmlSyn.Func65: TtkTokenKind;
begin
if KeyComp('Finish') then Result := tkKey else
if KeyComp('Release') then Result := tkKey else
if KeyComp('Random') then Result := tkKey else
if KeyComp('Repeat') then begin
if IsQuali then Result := tkQualifier else Result := tkKey;
end else
Result := tkIdentifier;
end;
function TmwDmlSyn.Func66: TtkTokenKind;
begin
if KeyComp('Rheading') and IsQuali then Result := tkQualifier else
if KeyComp('Floor') then Result := tkKey else
if KeyComp('Title') then begin
if IsQuali then Result := tkQualifier else Result := tkKey;
end else
Result := tkIdentifier;
end;
function TmwDmlSyn.Func67: TtkTokenKind;
begin
if KeyComp('Unload') then Result := tkKey else
if KeyComp('Receive') then Result := tkKey else Result := tkIdentifier;
end;
function TmwDmlSyn.Func68: TtkTokenKind;
begin
if KeyComp('Total') and IsQuali then Result := tkQualifier else
Result := tkIdentifier;
end;
function TmwDmlSyn.Func69: TtkTokenKind;
begin
if KeyComp('Message') then Result := tkKey else
if KeyComp('End_if') then Result := tkKey else
if KeyComp('Text') then begin
if IsSpecial then Result := tkSpecial else Result := tkKey;
end else if KeyComp('End_if') then Result := tkKey else
Result := tkIdentifier;
end;
function TmwDmlSyn.Func70: TtkTokenKind;
begin
if KeyComp('Using') and IsQuali then Result := tkQualifier else
Result := tkIdentifier;
end;
function TmwDmlSyn.Func71: TtkTokenKind;
begin
if KeyComp('Target') and IsQuali then Result := tkQualifier else
Result := tkIdentifier;
end;
function TmwDmlSyn.Func72: TtkTokenKind;
begin
if KeyComp('First') and IsQuali then Result := tkQualifier else
if KeyComp('Failure') then begin
if IsQuali then Result := tkQualifier else
if IsSpecial then Result := tkSpecial else Result := tkIdentifier;
end else
if KeyComp('Ltrim') then Result := tkFunction else
if KeyComp('Round') then Result := tkFunction else
Result := tkIdentifier;
end;
function TmwDmlSyn.Func73: TtkTokenKind;
begin
if KeyComp('Commit') then Result := tkKey else
if KeyComp('Compile') then Result := tkKey else Result := tkIdentifier;
end;
function TmwDmlSyn.Func74: TtkTokenKind;
begin
if KeyComp('Sqrt') then Result := tkFunction else
if KeyComp('Error') then begin
if IsQuali then Result := tkQualifier else Result := tkKey;
end else
if KeyComp('Rollback') then Result := tkKey else
if KeyComp('Connect') then Result := tkKey else Result := tkIdentifier;
end;
function TmwDmlSyn.Func75: TtkTokenKind;
begin
if KeyComp('Generate') then Result := tkKey else
if KeyComp('Write') then Result := tkKey else Result := tkIdentifier;
end;
function TmwDmlSyn.Func76: TtkTokenKind;
begin
if KeyComp('Invoke') then Result := tkKey else Result := tkIdentifier;
end;
function TmwDmlSyn.Func77: TtkTokenKind;
begin
if KeyComp('Noerase') and IsQuali then Result := tkQualifier else
if KeyComp('Noheading') and IsQuali then Result := tkQualifier else
if KeyComp('Account') and IsSpecial then Result := tkSpecial else
if KeyComp('Print') then Result := tkKey else Result := tkIdentifier;
end;
function TmwDmlSyn.Func78: TtkTokenKind;
begin
if KeyComp('Confirm') then Result := tkKey else Result := tkIdentifier;
end;
function TmwDmlSyn.Func79: TtkTokenKind;
begin
if KeyComp('Seconds') then Result := tkFunction else Result := tkIdentifier;
end;
function TmwDmlSyn.Func81: TtkTokenKind;
begin
if KeyComp('Source') and IsQuali then Result := tkQualifier else
Result := tkIdentifier;
end;
function TmwDmlSyn.Func82: TtkTokenKind;
begin
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?