Cface__CShortNode.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Thu, 10 Jul 2008 07:31:14 +0000
changeset 5 c110eef5b9ef
parent 1 b6c0180314d1
child 9 03c7a764d2be
permissions -rw-r--r--
- externalization of libraryName (now supports unix & win32 simultaneously) - basi support for accessing structure fields

"{ Package: 'cvut:fel/cface' }"

"{ NameSpace: Cface }"

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


!CShortNode methodsFor:'accessing'!

cByteSize

    self isCShortIntNode 
        ifTrue:[^self cShortIntByteSize].

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

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

cShortIntByteSize

    "
        Cface::CShortNode new cShortIntByteSize        
    "

    %{
        return __MKSMALLINT(sizeof(short int));
    %}.
    ^2

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

smalltalkxValueExtractionSelector

    self isCShortIntNode ifTrue:[^#shortAt:].
    ^type smalltalkxValueExtractionSelector

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

!CShortNode methodsFor:'printing'!

printOn: stream indent: indent

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

    type printOn: stream indent: indent + 1.

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

!CShortNode methodsFor:'testing'!

isCShortIntNode

    ^type isCIntNode

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

isCShortNode
    ^ true

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

!CShortNode 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 visitCShortNode:self

    "Created: / 12-02-2008 / 23:19:46 / janfrog"
! !

!CShortNode class methodsFor:'documentation'!

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