Cface__CDerivedTypeNode.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Tue, 09 Sep 2008 21:17:04 +0000
changeset 9 03c7a764d2be
parent 6 ae25dce94003
child 11 a77f44d45a27
permissions -rw-r--r--
- changed struct field accessor generation - no "prim" prefix. - struct size is extracted from XML

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

"{ NameSpace: Cface }"

CTypeNode subclass:#CDerivedTypeNode
	instanceVariableNames:'smalltalkNamespace smalltalkPackage smalltalkCategory foreign'
	classVariableNames:''
	poolDictionaries:''
	category:'Cface-C AST'
!


!CDerivedTypeNode methodsFor:'accessing'!

foreign
    ^ foreign

    "Created: / 04-07-2008 / 11:46:03 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

foreign:something
    foreign := something.

    "Created: / 04-07-2008 / 11:46:03 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

smalltalkCategory
    ^ smalltalkCategory ifNil:
        [self smalltalkNamespace , ' - C Types']

    "Created: / 03-07-2008 / 21:10:35 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

smalltalkCategory:aString
    smalltalkCategory := aString.

    "Created: / 03-07-2008 / 21:10:35 / Jan Vrany <vranyj1@fel.cvut.cz>"
    "Modified: / 10-07-2008 / 07:54:11 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

smalltalkClassName
    ^ self smalltalkName asSymbol

    "Created: / 10-07-2008 / 08:01:16 / Jan Vrany <vranyj1@fel.cvut.cz>"
    "Modified: / 09-09-2008 / 20:15:46 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

smalltalkClassName:className 
    self smalltalkName:className

    "Created: / 10-07-2008 / 08:01:27 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

smalltalkClassNameWithNamespace
    ^ self smalltalkNamespace isNilOrEmptyCollection 
        ifTrue:[ self smalltalkClassName asSymbol ]
        ifFalse:[ (self smalltalkNamespace , '::' , self smalltalkClassName) asSymbol ]

    "Created: / 03-07-2008 / 20:29:41 / Jan Vrany <vranyj1@fel.cvut.cz>"
    "Modified: / 09-09-2008 / 20:16:03 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

smalltalkNamespace
    ^ smalltalkNamespace

    "Created: / 17-02-2008 / 20:47:13 / janfrog"
!

smalltalkNamespace:something
    smalltalkNamespace := something.

    "Created: / 17-02-2008 / 20:47:13 / janfrog"
!

smalltalkPackage
    ^ smalltalkPackage

    "Created: / 03-07-2008 / 21:10:29 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

smalltalkPackage:something
    smalltalkPackage := something.

    "Created: / 03-07-2008 / 21:10:29 / Jan Vrany <vranyj1@fel.cvut.cz>"
! !

!CDerivedTypeNode methodsFor:'printing'!

printOn:stream indent:level 

    self printLineOn: stream indent: level.
    self smalltalkNamespace 
        ifNotNil:[
            stream
                nextPutAll:';; Namespace: ';
                nextPutAll:self smalltalkNamespace;
                cr;
                next:level put:Character tab
        ].
    self smalltalkClassName 
        ifNotNil:[
            stream
                nextPutAll:';; Class: ';
                nextPutAll:self smalltalkClassName;
                cr;
                next:level put:Character tab
        ].

    "Created: / 18-02-2008 / 14:33:01 / janfrog"
    "Modified: / 10-07-2008 / 20:05:30 / Jan Vrany <vranyj1@fel.cvut.cz>"
! !

!CDerivedTypeNode methodsFor:'testing'!

isForeign

    ^foreign ? false

    "Created: / 04-07-2008 / 11:46:39 / Jan Vrany <vranyj1@fel.cvut.cz>"
! !

!CDerivedTypeNode class methodsFor:'documentation'!

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