Cface__CLongNode.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Thu, 10 Jul 2008 20:56:08 +0000
changeset 6 ae25dce94003
parent 5 c110eef5b9ef
child 9 03c7a764d2be
permissions -rw-r--r--
Added SVNMapping. Now it is able to parse libsvn.def

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

cLongIntByteSize

    "
        Cface::CLongNode new cLongIntByteSize       
    "

    %{
        return __MKSMALLINT(sizeof(long int));
    %}.
    ^4

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

cLongLongIntByteSize

    "
        Cface::CLongNode new cLongLongIntByteSize         
    "

    %{
        return __MKSMALLINT(sizeof(long long int));
    %}.
    ^8

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

ffiTypeSymbol
    "Superclass Cface::CModifierNode says that I am responsible to implement this method"

    ^#int32

    "Created: / 03-07-2008 / 23:02:09 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

smalltalkxValueExtractionSelector

    self isCLongIntNode ifTrue:[^#longAt:].
    self isCLongLongIntNode ifTrue:[^#longLongAt:].
    ^type smalltalkxValueExtractionSelector

    "Created: / 09-07-2008 / 22:23:32 / Jan Vrany <vranyj1@fel.cvut.cz>"
! !

!CLongNode methodsFor:'printing'!

printOn: stream indent: indent

    stream 
        nextPutAll:'long '; 
        cr;
        next: indent + 1 put: Character tab.

    type printOn: stream indent: indent + 1.

    "Created: / 04-03-2008 / 10:57:12 / janfrog"
! !

!CLongNode methodsFor:'testing'!

isCLongIntNode

    ^type isCIntNode

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

isCLongLongIntNode

    ^type isCLongIntNode

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

isCLongNode
    ^ true

    "Created: / 17-02-2008 / 21:52:38 / janfrog"
! !

!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

    "Created: / 12-02-2008 / 22:14:55 / janfrog"
! !

!CLongNode class methodsFor:'documentation'!

version
    ^ '$Header: /opt/data/cvs/cvut-fel/cface/Cface__CLongNode.st,v 1.1 2008/02/26 15:58:50 vranyj1 Exp $'
! !