compiler/TProgramNodeVisitor.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Fri, 25 Sep 2015 03:51:15 +0100
changeset 16 17a2d1d9f205
parent 14 fa42d3f1a578
permissions -rw-r--r--
Added standalone Tea compiler - teak It allows for compilation of .tea files from the command line.

"
    Copyright (C) 2015-now Jan Vrany

    This code is not an open-source (yet). You may use this code
    for your own experiments and projects, given that:

    * all modification to the code will be sent to the
      original author for inclusion in future releases
    * this is not used in any commercial software

    This license is provisional and may (will) change in
    a future.
"
"{ Package: 'jv:tea/compiler' }"

"{ NameSpace: Smalltalk }"

RBProgramNodeVisitor subclass:#TProgramNodeVisitor
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'Languages-Tea-Compiler-AST'
!

!TProgramNodeVisitor class methodsFor:'documentation'!

copyright
"
    Copyright (C) 2015-now Jan Vrany

    This code is not an open-source (yet). You may use this code
    for your own experiments and projects, given that:

    * all modification to the code will be sent to the
      original author for inclusion in future releases
    * this is not used in any commercial software

    This license is provisional and may (will) change in
    a future.
"
! !

!TProgramNodeVisitor methodsFor:'visiting'!

visitArgument: anRBVariableNode
    | typeSpec |

    super visitArgument: anRBVariableNode.
    typeSpec := anRBVariableNode typeSpec.
    typeSpec notNil ifTrue:[ self visitNode: typeSpec ]

    "Created: / 25-08-2015 / 19:51:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 02-09-2015 / 06:53:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!TProgramNodeVisitor methodsFor:'visitor-double dispatching'!

acceptMethodNode: aMethodNode 
    super acceptMethodNode: aMethodNode.
    self visitNode: aMethodNode returnTypeSpec

    "Created: / 25-08-2015 / 19:53:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

acceptSimpleTypeNode: aTSimpleTypeNode

    "Created: / 21-08-2015 / 22:20:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 25-08-2015 / 19:54:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

acceptSpecialFormNode: aTSpecialFormNode
    self acceptMessageNode: aTSpecialFormNode

    "Created: / 14-09-2015 / 12:10:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

acceptTypeSpecNode: aTTypeSpecNode
    self visitNode: aTTypeSpecNode type.

    "Created: / 21-08-2015 / 22:18:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 25-08-2015 / 19:54:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

acceptUnionTypeNode: aTUnionTypeNode
    aTUnionTypeNode types do:[:type | self visitNode: type ]

    "Created: / 21-08-2015 / 22:21:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified (format): / 25-08-2015 / 19:54:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!TProgramNodeVisitor class methodsFor:'documentation'!

version
    ^ 'Path: jv/tea/compiler/TProgramNodeVisitor.st, Version: 1.0, User: jv, Time: 2015-08-25T19:55:02.763+01'
!

version_HG
    ^ 'Path: jv/tea/compiler/TProgramNodeVisitor.st, Version: 1.0, User: jv, Time: 2015-08-25T19:55:02.763+01'
! !