|
@@ -864,7 +864,6 @@ begin
|
|
TypeName := CurTokenString;
|
|
TypeName := CurTokenString;
|
|
ExpectToken(tkEqual);
|
|
ExpectToken(tkEqual);
|
|
NextToken;
|
|
NextToken;
|
|
- // 12/04/04 - Dave - allow PACKED for ARRAYs, OBJECTs, CLASSes and RECORDs
|
|
|
|
HadPackedModifier := False; { Assume not present }
|
|
HadPackedModifier := False; { Assume not present }
|
|
if CurToken = tkPacked then { If PACKED modifier }
|
|
if CurToken = tkPacked then { If PACKED modifier }
|
|
begin { Handle PACKED modifier for all situations }
|
|
begin { Handle PACKED modifier for all situations }
|
|
@@ -874,7 +873,6 @@ begin
|
|
else { otherwise, syntax error }
|
|
else { otherwise, syntax error }
|
|
ParseExc(Format(SParserExpectTokenError,['ARRAY, RECORD, OBJECT or CLASS']))
|
|
ParseExc(Format(SParserExpectTokenError,['ARRAY, RECORD, OBJECT or CLASS']))
|
|
end;
|
|
end;
|
|
- // 12/04/04 - Dave - End of added code
|
|
|
|
case CurToken of
|
|
case CurToken of
|
|
tkRecord:
|
|
tkRecord:
|
|
begin
|
|
begin
|
|
@@ -888,30 +886,16 @@ begin
|
|
raise;
|
|
raise;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
- { 12/04/04 - Dave - cannot happen. Handled above. Unnecessary code removed by commenting
|
|
|
|
- tkPacked:
|
|
|
|
- begin
|
|
|
|
- Result := TPasRecordType(CreateElement(TPasRecordType, TypeName,
|
|
|
|
- Parent));
|
|
|
|
- try
|
|
|
|
- TPasRecordType(Result).IsPacked := True;
|
|
|
|
- ExpectToken(tkRecord);
|
|
|
|
- ParseRecordDecl(TPasRecordType(Result));
|
|
|
|
- except
|
|
|
|
- Result.Free;
|
|
|
|
- raise;
|
|
|
|
- end;
|
|
|
|
- end; End of removed code - Dave - 12/04/04 }
|
|
|
|
tkObject:
|
|
tkObject:
|
|
- begin // 12/04/04 - Dave - Added
|
|
|
|
|
|
+ begin
|
|
Result := ParseClassDecl(Parent, TypeName, okObject);
|
|
Result := ParseClassDecl(Parent, TypeName, okObject);
|
|
- TPasClassType(Result).IsPacked := HadPackedModifier; // 12/04/04 - Dave - Added
|
|
|
|
- end; // 12/04/04 - Dave - Added
|
|
|
|
|
|
+ TPasClassType(Result).IsPacked := HadPackedModifier;
|
|
|
|
+ end;
|
|
tkClass:
|
|
tkClass:
|
|
- begin // 12/04/04 - Dave - Added
|
|
|
|
|
|
+ begin
|
|
Result := ParseClassDecl(Parent, TypeName, okClass);
|
|
Result := ParseClassDecl(Parent, TypeName, okClass);
|
|
- TPasClassType(Result).IsPacked := HadPackedModifier; // 12/04/04 - Dave - Added
|
|
|
|
- end; // 12/04/04 - Dave - Added
|
|
|
|
|
|
+ TPasClassType(Result).IsPacked := HadPackedModifier;
|
|
|
|
+ end;
|
|
tkInterface:
|
|
tkInterface:
|
|
Result := ParseClassDecl(Parent, TypeName, okInterface);
|
|
Result := ParseClassDecl(Parent, TypeName, okInterface);
|
|
tkCaret:
|
|
tkCaret:
|
|
@@ -984,7 +968,7 @@ begin
|
|
Result := TPasArrayType(CreateElement(TPasArrayType, TypeName, Parent));
|
|
Result := TPasArrayType(CreateElement(TPasArrayType, TypeName, Parent));
|
|
try
|
|
try
|
|
ParseArrayType(TPasArrayType(Result));
|
|
ParseArrayType(TPasArrayType(Result));
|
|
- TPasArrayType(Result).IsPacked := HadPackedModifier; // 12/04/04 - Dave - Added
|
|
|
|
|
|
+ TPasArrayType(Result).IsPacked := HadPackedModifier;
|
|
ExpectToken(tkSemicolon);
|
|
ExpectToken(tkSemicolon);
|
|
except
|
|
except
|
|
Result.Free;
|
|
Result.Free;
|
|
@@ -1167,29 +1151,30 @@ begin
|
|
begin
|
|
begin
|
|
NextToken;
|
|
NextToken;
|
|
if CurToken = tkIdentifier then
|
|
if CurToken = tkIdentifier then
|
|
- begin
|
|
|
|
|
|
+ begin
|
|
s := UpperCase(CurTokenText);
|
|
s := UpperCase(CurTokenText);
|
|
if s = 'CVAR' then
|
|
if s = 'CVAR' then
|
|
- begin
|
|
|
|
|
|
+ begin
|
|
M := M + '; cvar';
|
|
M := M + '; cvar';
|
|
ExpectToken(tkSemicolon);
|
|
ExpectToken(tkSemicolon);
|
|
- end else if (s = 'EXTERNAL') or (s = 'PUBLIC') or (s = 'EXPORT') then
|
|
|
|
- begin
|
|
|
|
|
|
+ end
|
|
|
|
+ else if (s = 'EXTERNAL') or (s = 'PUBLIC') or (s = 'EXPORT') then
|
|
|
|
+ begin
|
|
M := M + ';' + CurTokenText;
|
|
M := M + ';' + CurTokenText;
|
|
if s = 'EXTERNAL' then
|
|
if s = 'EXTERNAL' then
|
|
- begin
|
|
|
|
- NextToken;
|
|
|
|
- if (CurToken = tkString) or (CurToken = tkIdentifier) then
|
|
|
|
begin
|
|
begin
|
|
|
|
+ NextToken;
|
|
|
|
+ if ((CurToken = tkString) or (CurToken = tkIdentifier)) and (UpperCase(CurTokenText)<> 'NAME') then
|
|
|
|
+ begin
|
|
// !!!: Is this really correct for tkString?
|
|
// !!!: Is this really correct for tkString?
|
|
M := M + ' ' + CurTokenText;
|
|
M := M + ' ' + CurTokenText;
|
|
NextToken;
|
|
NextToken;
|
|
- end;
|
|
|
|
- end else
|
|
|
|
|
|
+ end;
|
|
|
|
+ end
|
|
|
|
+ else
|
|
NextToken;
|
|
NextToken;
|
|
-
|
|
|
|
if (CurToken = tkIdentifier) and (UpperCase(CurTokenText) = 'NAME') then
|
|
if (CurToken = tkIdentifier) and (UpperCase(CurTokenText) = 'NAME') then
|
|
- begin
|
|
|
|
|
|
+ begin
|
|
M := M + ' name ';
|
|
M := M + ' name ';
|
|
NextToken;
|
|
NextToken;
|
|
if (CurToken = tkString) or (CurToken = tkIdentifier) then
|
|
if (CurToken = tkString) or (CurToken = tkIdentifier) then
|
|
@@ -1198,7 +1183,8 @@ begin
|
|
else
|
|
else
|
|
ParseExc(SParserSyntaxError);
|
|
ParseExc(SParserSyntaxError);
|
|
ExpectToken(tkSemicolon);
|
|
ExpectToken(tkSemicolon);
|
|
- end else if CurToken <> tkSemicolon then
|
|
|
|
|
|
+ end
|
|
|
|
+ else if CurToken <> tkSemicolon then
|
|
ParseExc(SParserSyntaxError);
|
|
ParseExc(SParserSyntaxError);
|
|
end else
|
|
end else
|
|
begin
|
|
begin
|
|
@@ -1855,7 +1841,10 @@ end.
|
|
|
|
|
|
{
|
|
{
|
|
$Log$
|
|
$Log$
|
|
- Revision 1.10 2004-12-06 08:53:47 michael
|
|
|
|
|
|
+ Revision 1.11 2004-12-06 19:16:38 michael
|
|
|
|
+ + Some cleanup, removed some keywords which are not keywords
|
|
|
|
+
|
|
|
|
+ Revision 1.10 2004/12/06 08:53:47 michael
|
|
+ Fix from Dave Strodtman to properly support packed
|
|
+ Fix from Dave Strodtman to properly support packed
|
|
|
|
|
|
Revision 1.9 2004/10/16 18:55:31 michael
|
|
Revision 1.9 2004/10/16 18:55:31 michael
|