Cface__CEnumNode.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Fri, 08 Jan 2010 13:25:11 +0000
changeset 14 1f730d82496e
parent 9 03c7a764d2be
child 18 2f55519f3d0b
permissions -rw-r--r--
Added version_SVN methods

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

"{ NameSpace: Cface }"

CDerivedTypeNode subclass:#CEnumNode
	instanceVariableNames:'typedef values'
	classVariableNames:''
	poolDictionaries:''
	category:'Cface-C AST'
!

!CEnumNode class methodsFor:'documentation'!

history

    "Created: / 25-10-2007 / 17:13:30 / haja"
    "Created: #local / 25-10-2007 / 17:13:34 / haja"
    "Created: #local: / 25-10-2007 / 17:13:34 / 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 / 18:15:45 / haja"
    "Deleted: #local / 25-10-2007 / 18:16:02 / haja"
    "Deleted: #local: / 25-10-2007 / 18:16:04 / haja"
    "Created: #name:fields: / 25-10-2007 / 18:16:40 / haja"
    "Deleted: #local:name:fields: / 25-10-2007 / 18:16:43 / haja"
    "Created: #acceptVisitor: / 02-11-2007 / 10:43:33 / haja"
    "Created: #foreign / 19-11-2007 / 09:40:11 / haja"
    "Created: #foreign: / 19-11-2007 / 09:40:11 / haja"
    "Created: #name:fields:foreign: / 19-11-2007 / 09:40:37 / haja"
    "Deleted: #name:fields: / 19-11-2007 / 09:40:40 / haja"
    "Created: #typedef / 05-12-2007 / 19:39:04 / haja"
    "Created: #typedef: / 05-12-2007 / 19:39:04 / haja"
    "Created: #name:fields:foreign:typedef: / 05-12-2007 / 19:39:37 / haja"
    "Deleted: #name:fields:foreign: / 05-12-2007 / 21:00:50 / haja"
! !

!CEnumNode methodsFor:'accessing'!

cByteSize

    ^CIntNode new cByteSize

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

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

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

stxStructFieldGetterSelector
    ^ #doubleWordAt:

    "Created: / 09-09-2008 / 21:32:39 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

typedef
    ^ typedef

    "Created: / 05-12-2007 / 19:39:04 / haja"
!

typedef:something
    typedef := something.

    "Created: / 05-12-2007 / 19:39:04 / haja"
!

values
    ^ values

    "Created: / 12-02-2008 / 22:36:22 / janfrog"
!

values:something
    values := something.

    "Created: / 12-02-2008 / 22:36:22 / janfrog"
! !

!CEnumNode methodsFor:'printing'!

printOn: stream indent: level

    super printOn: stream indent: level.
    stream 
        nextPutAll:'(enum '; nextPutAll: cName.
    values do:
        [:enumValue|
        stream cr; next: level + 1 put: Character tab.
        enumValue printOn: stream indent: level + 1].
    stream space; nextPut: $)

    "Created: / 17-02-2008 / 18:08:02 / janfrog"
    "Modified: / 18-02-2008 / 14:33:30 / janfrog"
! !

!CEnumNode methodsFor:'testing'!

isCEnumNode
    ^ true

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

!CEnumNode 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 visitCEnumNode:self

    "Created: / 02-11-2007 / 10:43:33 / haja"
    "Modified: / 10-02-2008 / 10:44:59 / janfrog"
! !

!CEnumNode class methodsFor:'documentation'!

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

version_SVN
    ^ '$Id$'
! !