Cface__CPointerNode.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Tue, 04 Sep 2012 15:06:32 +0000
changeset 22 57da23a9fbbd
parent 19 1297bf936bfb
child 32 d7464405cbda
permissions -rw-r--r--
- Cface::Libgit2Mapping added:7 methods - Cface::GeneratorCommand added: #generateLibgit - cvut_fel_cface changed: #classNamesAndAttributes #extensionMethodNames #preRequisites - extensions ...

"{ Package: 'cvut:fel/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
!

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
! !

!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$'
! !