Cface__CFunctionNode.st
changeset 1 b6c0180314d1
child 2 cfd2c393abfe
equal deleted inserted replaced
0:9bbbbb659d8b 1:b6c0180314d1
       
     1 "{ Package: 'cvut:fel/cface' }"
       
     2 
       
     3 "{ NameSpace: Cface }"
       
     4 
       
     5 CDefinitionNode subclass:#CFunctionNode
       
     6 	instanceVariableNames:'smalltalkClass smalltalkNamespace arguments return kind'
       
     7 	classVariableNames:''
       
     8 	poolDictionaries:''
       
     9 	category:'Cface-C AST'
       
    10 !
       
    11 
       
    12 !CFunctionNode class methodsFor:'documentation'!
       
    13 
       
    14 history
       
    15 
       
    16     "Created: / 25-10-2007 / 14:39:30 / haja"
       
    17     "Created: #name / 25-10-2007 / 14:39:35 / haja"
       
    18     "Created: #name: / 25-10-2007 / 14:39:35 / haja"
       
    19     "Created: #arguments / 25-10-2007 / 14:39:35 / haja"
       
    20     "Created: #arguments: / 25-10-2007 / 14:39:35 / haja"
       
    21     "Created: #return / 25-10-2007 / 14:39:35 / haja"
       
    22     "Created: #return: / 25-10-2007 / 14:39:35 / haja"
       
    23     "Created: #name:arguments:return: / 25-10-2007 / 14:41:52 / haja"
       
    24     "Created: #acceptVisitor: / 02-11-2007 / 10:44:22 / haja"
       
    25     "Created: #acceptNameVisitor: / 05-11-2007 / 17:41:59 / haja"
       
    26     "Deleted: #acceptNameVisitor: / 12-11-2007 / 09:46:47 / haja"
       
    27 ! !
       
    28 
       
    29 !CFunctionNode methodsFor:'accessing'!
       
    30 
       
    31 arguments
       
    32     ^ arguments
       
    33 
       
    34     "Created: / 25-10-2007 / 14:39:35 / haja"
       
    35 !
       
    36 
       
    37 arguments:something
       
    38     arguments := something.
       
    39 
       
    40     "Created: / 25-10-2007 / 14:39:35 / haja"
       
    41 !
       
    42 
       
    43 kind
       
    44     ^ kind ? #static
       
    45 
       
    46     "Created: / 01-03-2008 / 20:30:22 / janfrog"
       
    47     "Modified: / 04-03-2008 / 10:57:12 / janfrog"
       
    48 !
       
    49 
       
    50 kind:aSymbol
       
    51     kind := aSymbol.
       
    52 
       
    53     "Created: / 01-03-2008 / 20:30:22 / janfrog"
       
    54     "Modified: / 04-03-2008 / 10:57:12 / janfrog"
       
    55 !
       
    56 
       
    57 priority
       
    58 
       
    59     ^25
       
    60 
       
    61     "Created: / 17-02-2008 / 18:00:13 / janfrog"
       
    62 !
       
    63 
       
    64 return
       
    65     ^ return
       
    66 
       
    67     "Created: / 25-10-2007 / 14:39:35 / haja"
       
    68 !
       
    69 
       
    70 return:something
       
    71     return := something.
       
    72 
       
    73     "Created: / 25-10-2007 / 14:39:35 / haja"
       
    74 !
       
    75 
       
    76 smalltalkClass
       
    77     ^ smalltalkClass
       
    78 
       
    79     "Created: / 17-02-2008 / 20:54:34 / janfrog"
       
    80 !
       
    81 
       
    82 smalltalkClass:something
       
    83     smalltalkClass := something.
       
    84 
       
    85     "Created: / 17-02-2008 / 20:54:34 / janfrog"
       
    86 !
       
    87 
       
    88 smalltalkNamespace
       
    89     ^ smalltalkNamespace
       
    90 
       
    91     "Created: / 17-02-2008 / 20:54:34 / janfrog"
       
    92 !
       
    93 
       
    94 smalltalkNamespace:something
       
    95     smalltalkNamespace := something.
       
    96 
       
    97     "Created: / 17-02-2008 / 20:54:34 / janfrog"
       
    98 !
       
    99 
       
   100 smalltalkSelector
       
   101 
       
   102     ^smalltalkName
       
   103 
       
   104     "Created: / 17-02-2008 / 22:12:23 / janfrog"
       
   105 !
       
   106 
       
   107 smalltalkSelector:aSymbol
       
   108     smalltalkName := aSymbol
       
   109 
       
   110     "Created: / 17-02-2008 / 22:12:14 / janfrog"
       
   111 ! !
       
   112 
       
   113 !CFunctionNode methodsFor:'printing'!
       
   114 
       
   115 printOn: stream indent: level
       
   116 
       
   117     self smalltalkNamespace ifNotNil:
       
   118         [stream nextPutAll:';; Namespace: '; nextPutAll: self smalltalkNamespace; cr; next: level put: Character tab].
       
   119     self smalltalkClass ifNotNil:
       
   120         [stream nextPutAll:';; Class: '; nextPutAll: self smalltalkClass; cr; next: level put: Character tab].
       
   121     self smalltalkClass ifNotNil:
       
   122         [stream nextPutAll:';; Selector: '; nextPutAll: self smalltalkSelector; cr; next: level put: Character tab].
       
   123 
       
   124     stream 
       
   125         nextPutAll:'(function '; nextPutAll:self cName; cr;
       
   126         next: level + 1 put: Character tab.
       
   127 
       
   128     arguments do:
       
   129         [:argNode|argNode printOn: stream indent: level + 1.
       
   130         stream cr; next: level + 1 put: Character tab].
       
   131 
       
   132     stream
       
   133         next: level + 1 put: Character tab.
       
   134     return printOn: stream indent: level + 1.
       
   135 
       
   136     stream nextPut:$); cr.
       
   137 
       
   138     "Created: / 18-02-2008 / 14:27:37 / janfrog"
       
   139     "Modified: / 04-03-2008 / 10:57:11 / janfrog"
       
   140 ! !
       
   141 
       
   142 !CFunctionNode methodsFor:'testing'!
       
   143 
       
   144 isCFunctionNode
       
   145     ^ true
       
   146 
       
   147     "Created: / 17-02-2008 / 21:49:53 / janfrog"
       
   148 ! !
       
   149 
       
   150 !CFunctionNode methodsFor:'visiting'!
       
   151 
       
   152 acceptVisitor:aVisitor 
       
   153     "Double dispatch back to the visitor, passing my type encoded in
       
   154      the selector (visitor pattern)"
       
   155     "stub code automatically generated - please change if required"
       
   156     
       
   157     ^ aVisitor visitCFunctionNode:self
       
   158 
       
   159     "Created: / 02-11-2007 / 10:44:22 / haja"
       
   160     "Modified: / 10-02-2008 / 10:45:12 / janfrog"
       
   161 ! !
       
   162 
       
   163 !CFunctionNode class methodsFor:'documentation'!
       
   164 
       
   165 version
       
   166     ^ '$Header: /opt/data/cvs/cvut-fel/cface/Cface__CFunctionNode.st,v 1.1 2008/02/26 16:00:50 vranyj1 Exp $'
       
   167 ! !