Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2019-10

fcl-passrc with Objective-c

5 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Ryan Joseph

How well can the parser handle the objective-c mode? At my first attempt it seemed to fail pretty early on so I’m not sure it’s even supported.

EParserError: Expected ";" at token "Identifier external" in file /Developer/ObjectivePascal/MacOS_10_10/appkit/NSAccessibilityProtocols.inc at line 31 column 49

type
  NSAccessibilityElementProtocol = objcprotocol external name 'NSAccessibilityElement' (NSObjectProtocol)
  required
    function accessibilityFrame: NSRect; message 'accessibilityFrame';
    function accessibilityParent: id; message 'accessibilityParent';
  optional
    function isAccessibilityFocused: boolean; message 'isAccessibilityFocused';
    function accessibilityIdentifier: NSString; message 'accessibilityIdentifier';
  end;

Regards,
Ryan Joseph

Reply by email

Michael Van Canneyt
to Ryan Joseph
Ryan Joseph wrote
How well can the parser handle the objective-c mode? At my first attempt it seemed to fail pretty early on so I’m not sure it’s even supported.

Correct, it is not supported.

I don't even know what the allowed syntax is. From your example I see 'required' and 'Optional' - definitely things that are not supported.

AFAIK "objcprotocol" is also not supported, so my guess is that it thinks this is a type alias, which explains the error message.

Michael.

Reply by email

Sven Barth
to Michael Van Canneyt

Michael Van Canneyt schrieb am Mi., 2. Okt. 2019, 16:37:

Show quoted text 15 lines
On Wed, 2 Oct 2019, Ryan Joseph wrote: > How well can the parser handle the objective-c mode? At my first attempt it seemed to fail pretty early on so I’m not sure it’s even supported. Correct, it is not supported. I don't even know what the allowed syntax is. From your example I see 'required' and 'Optional' - definitely things that are not supported. AFAIK "objcprotocol" is also not supported, so my guess is that it thinks this is a type alias, which explains the error message.

I suppose that the documentation is still rather up to date regarding that: https://www.freepascal.org/docs-html/current/ref/refch11.html#x128-15000011

Regards,
Sven

Reply by email

Michael Van Canneyt
to Ryan Joseph
Ryan Joseph wrote 7 lines
> On Oct 2, 2019, at 10:37 AM, Michael Van Canneyt wrote: > > Correct, it is not supported. I’ll try to implement this then if I can figure out the parser. It’s really not that much extra syntax actually.

No it is not, but you'll have to introduce a new class kind and possibly 2 keywords.

Michael.

Reply by email