|
@@ -1523,73 +1523,77 @@ begin
|
|
Tok:=UpperCase(CurTokenString);
|
|
Tok:=UpperCase(CurTokenString);
|
|
If (Tok='CDECL') then
|
|
If (Tok='CDECL') then
|
|
begin
|
|
begin
|
|
- { El['calling-conv'] := 'cdecl';}
|
|
|
|
|
|
+ TPasProcedure(Parent).CallingConvention:=ccCDecl;
|
|
|
|
+ ExpectToken(tkSemicolon);
|
|
|
|
+ end
|
|
|
|
+ else If (Tok='EXPORT') then
|
|
|
|
+ begin
|
|
|
|
+ TPasProcedure(Parent).AddModifier(pmExported);
|
|
ExpectToken(tkSemicolon);
|
|
ExpectToken(tkSemicolon);
|
|
end
|
|
end
|
|
else if (Tok='PASCAL') then
|
|
else if (Tok='PASCAL') then
|
|
begin
|
|
begin
|
|
-{ El['calling-conv'] := 'pascal';}
|
|
|
|
|
|
+ TPasProcedure(Parent).CallingConvention:=ccPascal;
|
|
ExpectToken(tkSemicolon);
|
|
ExpectToken(tkSemicolon);
|
|
end
|
|
end
|
|
else if (Tok='STDCALL') then
|
|
else if (Tok='STDCALL') then
|
|
begin
|
|
begin
|
|
-{ El['calling-conv'] := 'stdcall';}
|
|
|
|
|
|
+ TPasProcedure(Parent).CallingConvention:=ccStdCall;
|
|
ExpectToken(tkSemicolon);
|
|
ExpectToken(tkSemicolon);
|
|
end
|
|
end
|
|
else if (Tok='OLDFPCCALL') then
|
|
else if (Tok='OLDFPCCALL') then
|
|
begin
|
|
begin
|
|
-{ El['calling-conv'] := 'oldfpccall';}
|
|
|
|
|
|
+ TPasProcedure(Parent).CallingConvention:=ccOldFPCCall;
|
|
ExpectToken(tkSemicolon);
|
|
ExpectToken(tkSemicolon);
|
|
end
|
|
end
|
|
else if (Tok='EXTDECL') then
|
|
else if (Tok='EXTDECL') then
|
|
begin
|
|
begin
|
|
-{ El['calling-conv'] := 'extdecl';}
|
|
|
|
|
|
+ TPasProcedure(Parent).AddModifier(pmExternal);
|
|
ExpectToken(tkSemicolon);
|
|
ExpectToken(tkSemicolon);
|
|
end
|
|
end
|
|
else if (Tok='REGISTER') then
|
|
else if (Tok='REGISTER') then
|
|
begin
|
|
begin
|
|
-{ El['calling-conv'] := 'register';}
|
|
|
|
|
|
+ TPasProcedure(Parent).CallingConvention:=ccRegister;
|
|
ExpectToken(tkSemicolon);
|
|
ExpectToken(tkSemicolon);
|
|
end
|
|
end
|
|
else if (Tok='COMPILERPROC') then
|
|
else if (Tok='COMPILERPROC') then
|
|
begin
|
|
begin
|
|
-{ El['calling-conv'] := 'compilerproc';}
|
|
|
|
|
|
+ TPasProcedure(Parent).AddModifier(pmCompilerProc);
|
|
ExpectToken(tkSemicolon);
|
|
ExpectToken(tkSemicolon);
|
|
end
|
|
end
|
|
else if (Tok='VARARGS') then
|
|
else if (Tok='VARARGS') then
|
|
begin
|
|
begin
|
|
-{ 'varargs': needs CDECL & EXTERNAL }
|
|
|
|
|
|
+ TPasProcedure(Parent).AddModifier(pmVarArgs);
|
|
ExpectToken(tkSemicolon);
|
|
ExpectToken(tkSemicolon);
|
|
end
|
|
end
|
|
else if (tok='DEPRECATED') then
|
|
else if (tok='DEPRECATED') then
|
|
begin
|
|
begin
|
|
-{ El['calling-conv'] := 'deprecated';}
|
|
|
|
element.hints:=element.hints+[hDeprecated];
|
|
element.hints:=element.hints+[hDeprecated];
|
|
ExpectToken(tkSemicolon);
|
|
ExpectToken(tkSemicolon);
|
|
end
|
|
end
|
|
else if (tok='PLATFORM') then
|
|
else if (tok='PLATFORM') then
|
|
begin
|
|
begin
|
|
-{ El['calling-conv'] := 'deprecated';}
|
|
|
|
element.hints:=element.hints+[hPlatform];
|
|
element.hints:=element.hints+[hPlatform];
|
|
ExpectToken(tkSemicolon);
|
|
ExpectToken(tkSemicolon);
|
|
end
|
|
end
|
|
else if (tok='LIBRARY') then
|
|
else if (tok='LIBRARY') then
|
|
begin
|
|
begin
|
|
-{ El['calling-conv'] := 'deprecated';}
|
|
|
|
element.hints:=element.hints+[hLibrary];
|
|
element.hints:=element.hints+[hLibrary];
|
|
ExpectToken(tkSemicolon);
|
|
ExpectToken(tkSemicolon);
|
|
end
|
|
end
|
|
else if (tok='OVERLOAD') then
|
|
else if (tok='OVERLOAD') then
|
|
begin
|
|
begin
|
|
- TPasProcedure(Parent).IsOverload := True;
|
|
|
|
|
|
+ TPasProcedure(Parent).AddModifier(pmOverload);
|
|
ExpectToken(tkSemicolon);
|
|
ExpectToken(tkSemicolon);
|
|
end
|
|
end
|
|
else if (tok='INLINE') then
|
|
else if (tok='INLINE') then
|
|
begin
|
|
begin
|
|
|
|
+ TPasProcedure(Parent).AddModifier(pmInline);
|
|
ExpectToken(tkSemicolon);
|
|
ExpectToken(tkSemicolon);
|
|
end
|
|
end
|
|
else if (tok='ASSEMBLER') then
|
|
else if (tok='ASSEMBLER') then
|
|
begin
|
|
begin
|
|
|
|
+ TPasProcedure(Parent).AddModifier(pmAssembler);
|
|
ExpectToken(tkSemicolon);
|
|
ExpectToken(tkSemicolon);
|
|
end
|
|
end
|
|
else if (tok = 'EXTERNAL') then
|
|
else if (tok = 'EXTERNAL') then
|
|
@@ -1621,7 +1625,8 @@ begin
|
|
end
|
|
end
|
|
else if (CurToken = tkInline) then
|
|
else if (CurToken = tkInline) then
|
|
begin
|
|
begin
|
|
-{ TPasProcedure(Parent).IsInline := True;}
|
|
|
|
|
|
+ if Parent is TPasProcedure then
|
|
|
|
+ TPasProcedure(Parent).AddModifier(pmInline);
|
|
ExpectToken(tkSemicolon);
|
|
ExpectToken(tkSemicolon);
|
|
end
|
|
end
|
|
else if (CurToken = tkSquaredBraceOpen) then
|
|
else if (CurToken = tkSquaredBraceOpen) then
|
|
@@ -2018,38 +2023,46 @@ var
|
|
begin
|
|
begin
|
|
s := UpperCase(CurTokenString);
|
|
s := UpperCase(CurTokenString);
|
|
if s = 'VIRTUAL' then
|
|
if s = 'VIRTUAL' then
|
|
- Proc.IsVirtual := True
|
|
|
|
|
|
+ Proc.AddModifier(pmVirtual)
|
|
else if s = 'DYNAMIC' then
|
|
else if s = 'DYNAMIC' then
|
|
- Proc.IsDynamic := True
|
|
|
|
|
|
+ Proc.AddModifier(pmDynamic)
|
|
else if s = 'ABSTRACT' then
|
|
else if s = 'ABSTRACT' then
|
|
- Proc.IsAbstract := True
|
|
|
|
|
|
+ Proc.AddModifier(pmAbstract)
|
|
else if s = 'OVERRIDE' then
|
|
else if s = 'OVERRIDE' then
|
|
- Proc.IsOverride := True
|
|
|
|
|
|
+ Proc.AddModifier(pmOverride)
|
|
else if s = 'REINTRODUCE' then
|
|
else if s = 'REINTRODUCE' then
|
|
- Proc.IsReintroduced := True
|
|
|
|
|
|
+ Proc.AddModifier(pmReintroduce)
|
|
else if s = 'OVERLOAD' then
|
|
else if s = 'OVERLOAD' then
|
|
- Proc.IsOverload := True
|
|
|
|
|
|
+ Proc.AddModifier(pmOverload)
|
|
else if s = 'STATIC' then
|
|
else if s = 'STATIC' then
|
|
- Proc.IsStatic := True
|
|
|
|
|
|
+ Proc.AddModifier(pmStatic)
|
|
else if s = 'MESSAGE' then begin
|
|
else if s = 'MESSAGE' then begin
|
|
- Proc.IsMessage := True;
|
|
|
|
|
|
+ Proc.AddModifier(pmMessage);
|
|
repeat
|
|
repeat
|
|
NextToken;
|
|
NextToken;
|
|
|
|
+ If CurToken<>tkSemicolon then
|
|
|
|
+ begin
|
|
|
|
+ Proc.MessageName:=CurtokenString;
|
|
|
|
+ If (CurToken=tkString) then
|
|
|
|
+ Proc.Messagetype:=pmtString;
|
|
|
|
+ end;
|
|
until CurToken = tkSemicolon;
|
|
until CurToken = tkSemicolon;
|
|
UngetToken;
|
|
UngetToken;
|
|
end
|
|
end
|
|
else if s = 'CDECL' then
|
|
else if s = 'CDECL' then
|
|
-{ El['calling-conv'] := 'cdecl';}
|
|
|
|
|
|
+ Proc.CallingConvention:=ccCDecl
|
|
else if s = 'PASCAL' then
|
|
else if s = 'PASCAL' then
|
|
-{ El['calling-conv'] := 'cdecl';}
|
|
|
|
|
|
+ Proc.CallingConvention:=ccPascal
|
|
else if s = 'STDCALL' then
|
|
else if s = 'STDCALL' then
|
|
-{ El['calling-conv'] := 'stdcall';}
|
|
|
|
|
|
+ Proc.CallingConvention:=ccStdCall
|
|
else if s = 'OLDFPCCALL' then
|
|
else if s = 'OLDFPCCALL' then
|
|
-{ El['calling-conv'] := 'oldfpccall';}
|
|
|
|
|
|
+ Proc.CallingConvention:=ccOldFPCCall
|
|
else if s = 'EXTDECL' then
|
|
else if s = 'EXTDECL' then
|
|
-{ El['calling-conv'] := 'extdecl';}
|
|
|
|
|
|
+ Proc.AddModifier(pmExtdecl)
|
|
else if s = 'DEPRECATED' then
|
|
else if s = 'DEPRECATED' then
|
|
-{ El['calling-conv'] := 'deprecated';}
|
|
|
|
|
|
+ Proc.Hints:=Proc.Hints+[hDeprecated]
|
|
|
|
+ else if s = 'EXPORT' then
|
|
|
|
+ Proc.AddModifier(pmExported)
|
|
else
|
|
else
|
|
begin
|
|
begin
|
|
UngetToken;
|
|
UngetToken;
|