Cface__CPointerNode.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Fri, 14 Aug 2015 11:28:29 +0100
changeset 46 cc6b765ad420
parent 41 edb5e4849b79
permissions -rw-r--r--
Fix in LLVM C API and C API Extensions mappings: map LLVMBool to #bool FFI type. Correctly map LLVMModuleRef to LLVMModule.

"{ Package: 'jv:cface' }"

"{ NameSpace: Cface }"

CTypeNode subclass:#CPointerNode
	instanceVariableNames:'type'
	classVariableNames:''
	poolDictionaries:''
	category:'Cface-C AST'
!

!CPointerNode class methodsFor:'documentation'!

history

    "Created: / 25-10-2007 / 16:58:14 / haja"
    "Created: #id / 25-10-2007 / 16:58:17 / haja"
    "Created: #id: / 25-10-2007 / 16:58:44 / haja"
    "Created: #acceptVisitor: / 02-11-2007 / 10:44:49 / haja"
    "Created: #acceptVisitorName: / 05-11-2007 / 17:30:59 / haja"
    "Created: #acceptNameVisitor: / 05-11-2007 / 17:32:41 / haja"
    "Deleted: #acceptVisitorName: / 05-11-2007 / 17:32:44 / haja"
    "Deleted: #acceptNameVisitor: / 12-11-2007 / 09:47:00 / haja"
    "Created: #buildTypeCheckFor:on: / 19-12-2007 / 15:06:43 / haja"
    "Created: #buildObjectCreationOn: / 19-12-2007 / 16:21:13 / haja"
    "Created: #buildValueExtractionFor:on: / 19-12-2007 / 17:08:44 / haja"
    "Created: #buildObjectCreationFor:on: / 19-12-2007 / 17:44:34 / haja"
    "Deleted: #buildObjectCreationOn: / 19-12-2007 / 17:44:36 / haja"
    "Created: #buildCTypeOn: / 19-12-2007 / 18:18:04 / haja"
    "Created: #buildTypeDEscriptionOn: / 20-12-2007 / 12:06:45 / haja"
    "Created: #buildTypeDescriptionOn: / 20-12-2007 / 12:06:49 / haja"
    "Deleted: #buildTypeDEscriptionOn: / 20-12-2007 / 12:06:51 / haja"
! !

!CPointerNode class methodsFor:'instance creation'!

id:anId

    | defPointerNode |

    defPointerNode := self new.
    defPointerNode id:anId.

    ^defPointerNode

    "Created: / 25-10-2007 / 16:58:44 / haja"
! !

!CPointerNode methodsFor:'accessing'!

cByteSize
    "superclass Cface::CTypeNode says that I am responsible to implement this method"

    ^ self shouldImplement
!

cName
    ^ '*', type cName

    "Created: / 06-07-2015 / 07:34:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

ffiTypeSymbol

    ^type isCPointerNode 
        ifTrue:[#pointer]
        ifFalse:[type ffiPointerTypeSymbol]

    "Created: / 12-07-2011 / 16:23:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

stxStructFieldGetterSelector
    ^ #pointerAt:

    "Created: / 30-05-2012 / 21:36:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

type
    ^ type
!

type:aCTypeNode
    type := aCTypeNode.
! !

!CPointerNode methodsFor:'printing'!

printOn: stream indent: level

    stream next: level put: Character tab.
    stream nextPutAll:'(pointer-to '.
    type printOn: stream indent: 0.
    stream nextPut:$)

    "Created: / 17-02-2008 / 18:10:30 / janfrog"
    "Modified: / 10-07-2008 / 20:05:18 / Jan Vrany <vranyj1@fel.cvut.cz>"
    "Created: / 18-07-2011 / 16:49:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!CPointerNode methodsFor:'testing'!

isCPointerNode
    ^ true
!

isCPointerToCStructure
    ^ type isCStructuredNode

    "Created: / 06-07-2015 / 23:01:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

isCPointerToChar
    ^ type isCCharNode

    "Created: / 06-07-2015 / 23:01:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!CPointerNode methodsFor:'visiting'!

acceptVisitor:aVisitor 
    "Double dispatch back to the visitor, passing my type encoded in
     the selector (visitor pattern)"

    "stub code automatically generated - please change if required"

    ^ aVisitor visitCPointerNode:self
! !

!CPointerNode class methodsFor:'documentation'!

version_SVN
    ^ '$Id$'
! !