Cface__CStructNode.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Thu, 03 Jul 2008 22:00:07 +0000
changeset 2 cfd2c393abfe
parent 1 b6c0180314d1
child 4 fc74bd43a3eb
permissions -rw-r--r--
Smalltalk/X generator improvements: - generate C enums as SharedPools with accessors - generate externa function calls using FFI. Not yet finished! - CairoMappings improved.

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

"{ NameSpace: Cface }"

CDerivedTypeNode subclass:#CStructNode
	instanceVariableNames:'fields local foreign typedef'
	classVariableNames:''
	poolDictionaries:''
	category:'Cface-C AST'
!

!CStructNode class methodsFor:'documentation'!

history

    "Created: / 25-10-2007 / 17:13:30 / haja"
    "Created: #name / 25-10-2007 / 17:13:34 / haja"
    "Created: #name: / 25-10-2007 / 17:13:34 / haja"
    "Created: #fields / 25-10-2007 / 17:13:34 / haja"
    "Created: #fields: / 25-10-2007 / 17:13:34 / haja"
    "Created: #local:name:fields: / 25-10-2007 / 17:15:30 / haja"
    "Deleted: #local / 29-10-2007 / 20:51:43 / haja"
    "Deleted: #local: / 29-10-2007 / 20:51:43 / haja"
    "Created: #name:fields: / 29-10-2007 / 20:51:53 / haja"
    "Deleted: #local:name:fields: / 29-10-2007 / 20:51:56 / haja"
    "Created: #acceptVisitor: / 02-11-2007 / 10:45:38 / haja"
    "Created: #localReference / 15-11-2007 / 14:31:51 / haja"
    "Created: #localReference: / 15-11-2007 / 14:31:51 / haja"
    "Deleted: #localReference / 15-11-2007 / 14:44:47 / haja"
    "Deleted: #localReference: / 15-11-2007 / 14:44:47 / haja"
    "Created: #local / 15-11-2007 / 14:50:46 / haja"
    "Created: #local: / 15-11-2007 / 14:50:46 / haja"
    "Deleted: #name:fields:local: / 15-11-2007 / 14:51:31 / haja"
    "Created: #name:fields:local: / 15-11-2007 / 14:54:24 / haja"
    "Deleted: #name:fields: / 15-11-2007 / 14:54:26 / haja"
    "Created: #foreign / 19-11-2007 / 09:41:09 / haja"
    "Created: #foreign: / 19-11-2007 / 09:41:09 / haja"
    "Created: #name:fields:local:foreign: / 19-11-2007 / 09:41:20 / haja"
    "Deleted: #name:fields:local: / 19-11-2007 / 09:41:23 / haja"
    "Created: #typedef / 05-12-2007 / 21:01:16 / haja"
    "Created: #typedef: / 05-12-2007 / 21:01:16 / haja"
    "Created: #name:fields:local:foreign:typedef: / 05-12-2007 / 21:01:43 / haja"
    "Deleted: #name:fields:local:foreign: / 05-12-2007 / 21:01:46 / haja"
    "Created: #buildTypeDescriptionOn: / 20-12-2007 / 12:14:53 / haja"
! !

!CStructNode methodsFor:'accessing'!

ffiTypeSymbol
    "Superclass Cface::CTypeNode says that I am responsible to implement this method"
    
    ^ #struct

    "Created: / 03-07-2008 / 22:54:39 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

fields
    ^ fields

    "Created: / 25-10-2007 / 17:13:34 / haja"
!

fields:something
    fields := something.

    "Created: / 25-10-2007 / 17:13:34 / haja"
!

foreign
    ^ foreign

    "Created: / 19-11-2007 / 09:41:09 / haja"
!

foreign:something
    foreign := something.

    "Created: / 19-11-2007 / 09:41:09 / haja"
!

local
    ^ local

    "Created: / 15-11-2007 / 14:50:46 / haja"
!

local:something
    local := something.

    "Created: / 15-11-2007 / 14:50:46 / haja"
!

typedef
    ^ typedef

    "Created: / 05-12-2007 / 21:01:16 / haja"
!

typedef:something
    typedef := something.

    "Created: / 05-12-2007 / 21:01:16 / haja"
! !

!CStructNode methodsFor:'builder'!

buildTypeDescriptionOn:aBuilder

   aBuilder buildStructNode:name with:fields.

    "Created: / 20-12-2007 / 12:14:53 / haja"
! !

!CStructNode methodsFor:'testing'!

isCStructNode
    ^ true

    "Modified: / 17-02-2008 / 21:52:13 / janfrog"
! !

!CStructNode 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 visitCStructNode:self

    "Created: / 02-11-2007 / 10:45:38 / haja"
    "Modified: / 10-02-2008 / 10:45:43 / janfrog"
! !

!CStructNode class methodsFor:'documentation'!

version
    ^ '$Header: /opt/data/cvs/cvut-fel/cface/Cface__CStructNode.st,v 1.1 2008/02/26 16:00:14 vranyj1 Exp $'
! !