FFI: FFI-Tools-mt.17.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

FFI: FFI-Tools-mt.17.mcz

commits-2
Marcel Taeumel uploaded a new version of FFI-Tools to project FFI:
http://source.squeak.org/FFI/FFI-Tools-mt.17.mcz

==================== Summary ====================

Name: FFI-Tools-mt.17
Author: mt
Time: 14 June 2020, 8:07:05.461471 am
UUID: 7f14b4b0-9bff-214b-8b8c-4e5d611f9200
Ancestors: FFI-Tools-mt.16

Complements ShoutCore-mt.79

=============== Diff against FFI-Tools-mt.16 ===============

Item was added:
+ ----- Method: SHParserST80>>apicall (in category '*FFI-Tools') -----
+ apicall
+ <pragmaParser>
+ self parseExternalCall.!

Item was added:
+ ----- Method: SHParserST80>>cdecl (in category '*FFI-Tools') -----
+ cdecl
+ <pragmaParser>
+ self parseExternalCall.!

Item was added:
+ ----- Method: SHParserST80>>isTokenExternalFunctionCallingConvention (in category '*FFI-Tools') -----
+ isTokenExternalFunctionCallingConvention
+
+ currentToken ifNil: [ ^false ].
+ ^(Smalltalk classNamed: #ExternalFunction)
+ ifNil: [ false ]
+ ifNotNil: [ :descriptorClass |
+ (descriptorClass callingConventionFor: currentToken) notNil ]!

Item was added:
+ ----- Method: SHParserST80>>parseExternalCall (in category '*FFI-Tools') -----
+ parseExternalCall
+
+ self addRangeType: #externalFunctionCallingConvention.
+
+ [self scanNext.
+ ((Smalltalk at: #ExternalFunction) callingConventionModifierFor: currentToken) notNil]
+ whileTrue.
+ self failUnless: currentToken notNil.
+ self scanPast: #externalCallType.
+ currentToken = '*'
+ ifTrue: [self scanPast: #externalCallTypePointerIndicator].
+ currentTokenFirst isDigit
+ ifTrue: [self scanPast: #integer]
+ ifFalse: [
+ self failUnless: currentTokenFirst == $'.
+ self parseString].
+ self failUnless: currentTokenFirst == $(.
+ self scanPast: #leftParenthesis.
+ [currentTokenFirst ~= $)]
+ whileTrue: [
+ self failUnless: currentToken notNil.
+ self scanPast: #externalCallType.
+ currentToken = '*'
+ ifTrue: [self scanPast: #externalCallTypePointerIndicator]].
+ self scanPast: #rightParenthesis.
+ currentToken = 'module:'
+ ifTrue: [
+ self scanPast: #module.
+ self parseStringOrSymbol ].
+ currentToken = 'error:' ifTrue: [
+ self scanPast: #primitive. "there's no rangeType for error"
+ self currentTokenType == #name
+ ifTrue: [ self parseTemporary: #patternTempVar ]
+ ifFalse: [ self parseStringOrSymbol ] ].
+ self failUnless: currentToken = '>'.
+ self scanPast: #primitiveOrExternalCallEnd!