Cface__CLongNode.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Thu, 17 Sep 2015 07:36:40 +0100
changeset 49 307d55f736ec
parent 43 9327987437ae
permissions -rw-r--r--
LLVM bindings: allow to specify path to llvm-config ..by setting LLVM_CONFIG variable when generating definitions for LLVM bindings. Example: make LVM_CONFIG=~/Projects/LLVM/sources1/build/Debug+Asserts/bin/llvm-config

"{ Package: 'jv:cface' }"

"{ NameSpace: Cface }"

CModifierNode subclass:#CLongNode
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'Cface-C AST'
!


!CLongNode methodsFor:'accessing'!

cByteSize

    self isCLongIntNode 
        ifTrue:[^self cLongIntByteSize].

    self isCLongIntNode 
        ifTrue:[^self cLongLongIntByteSize].

    self error:'Cannot happen...I hope :-)'

    "Created: / 09-07-2008 / 19:43:11 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

cName
    ^ 'long ', super cName

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

ffiPointerTypeSymbol

    ^ (self ffiTypeSymbol , 'Pointer') asSymbol

    "Created: / 18-07-2011 / 16:59:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

ffiTypeSymbol
    type isCIntNode ifTrue:[ 
        ^ #long.
    ].
    type isCLongNode ifTrue:[ 
        type type isCIntNode ifTrue:[ 
            ^ #longlong
        ].
    ].
    self error: 'type invalid or not (yet) supported'

    "Modified: / 12-08-2015 / 07:45:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

stxStructFieldGetterSelector

    type isCIntNode ifTrue:[
        ^#longLongAt:
    ].

    "/self breakPoint: #jv.

    ^ type stxStructFieldGetterSelector

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

!CLongNode methodsFor:'printing'!

printOn: stream indent: indent
    stream nextPutAll:'long '.
    type printOn: stream indent: indent.

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

!CLongNode methodsFor:'testing'!

isCLongNode
    ^ true

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

!CLongNode 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 visitCLongNode:self
! !

!CLongNode class methodsFor:'documentation'!

version_HG

    ^ '$Changeset: <not expanded> $'
!

version_SVN
    ^ '$Id$'
! !