--- a/compiler/Make.proto Mon Aug 31 18:37:31 2015 +0100
+++ b/compiler/Make.proto Wed Sep 02 09:18:00 2015 +0100
@@ -132,21 +132,26 @@
$(OUTDIR)TCompiler.$(O) TCompiler.$(H): TCompiler.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)TCompilerContext.$(O) TCompilerContext.$(H): TCompilerContext.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)TFormatter.$(O) TFormatter.$(H): TFormatter.st $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBFormatter.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBProgramNodeVisitor.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)TInlineAssemblyBeginToken.$(O) TInlineAssemblyBeginToken.$(H): TInlineAssemblyBeginToken.st $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBToken.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)TInlineAssemblyEndToken.$(O) TInlineAssemblyEndToken.$(H): TInlineAssemblyEndToken.st $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBToken.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)TInlineAssemblyNode.$(O) TInlineAssemblyNode.$(H): TInlineAssemblyNode.st $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBBlockNode.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBProgramNode.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBStatementNode.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBValueNode.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)TMetaDefinition.$(O) TMetaDefinition.$(H): TMetaDefinition.st $(INCLUDE_TOP)/stx/goodies/ring/RGBehaviorDefinition.$(H) $(INCLUDE_TOP)/stx/goodies/ring/RGClassDescriptionDefinition.$(H) $(INCLUDE_TOP)/stx/goodies/ring/RGDefinition.$(H) $(INCLUDE_TOP)/stx/goodies/ring/RGGlobalDefinition.$(H) $(INCLUDE_TOP)/stx/goodies/ring/RGMetaclassDefinition.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)TMethodDefinition.$(O) TMethodDefinition.$(H): TMethodDefinition.st $(INCLUDE_TOP)/stx/goodies/ring/RGDefinition.$(H) $(INCLUDE_TOP)/stx/goodies/ring/RGElementDefinition.$(H) $(INCLUDE_TOP)/stx/goodies/ring/RGMethodDefinition.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)TNamespaceDefinition.$(O) TNamespaceDefinition.$(H): TNamespaceDefinition.st $(INCLUDE_TOP)/stx/goodies/ring/RGAbstractContainer.$(H) $(INCLUDE_TOP)/stx/goodies/ring/RGContainer.$(H) $(INCLUDE_TOP)/stx/goodies/ring/RGDefinition.$(H) $(INCLUDE_TOP)/stx/goodies/ring/RGNamespace.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)TParser.$(O) TParser.$(H): TParser.st $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBParser.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)TProgramNodeVisitor.$(O) TProgramNodeVisitor.$(H): TProgramNodeVisitor.st $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBProgramNodeVisitor.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)TScanner.$(O) TScanner.$(H): TScanner.st $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBScanner.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/Stream.$(H) $(STCHDR)
$(OUTDIR)TScope.$(O) TScope.$(H): TScope.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)TSourceReader.$(O) TSourceReader.$(H): TSourceReader.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)TType.$(O) TType.$(H): TType.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)TTypeNode.$(O) TTypeNode.$(H): TTypeNode.st $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBProgramNode.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)TTypeSpecNode.$(O) TTypeSpecNode.$(H): TTypeSpecNode.st $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBProgramNode.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
-$(OUTDIR)TUniverseDefinition.$(O) TUniverseDefinition.$(H): TUniverseDefinition.st $(INCLUDE_TOP)/stx/goodies/ring/RGAbstractContainer.$(H) $(INCLUDE_TOP)/stx/goodies/ring/RGContainer.$(H) $(INCLUDE_TOP)/stx/goodies/ring/RGDefinition.$(H) $(INCLUDE_TOP)/stx/goodies/ring/RGNamespace.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)jv_tea_compiler.$(O) jv_tea_compiler.$(H): jv_tea_compiler.st $(INCLUDE_TOP)/stx/libbasic/LibraryDefinition.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/ProjectDefinition.$(H) $(STCHDR)
$(OUTDIR)TClassBinding.$(O) TClassBinding.$(H): TClassBinding.st $(INCLUDE_TOP)/jv/tea/compiler/TBinding.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)TCompilerPass.$(O) TCompilerPass.$(H): TCompilerPass.st $(INCLUDE_TOP)/jv/tea/compiler/TProgramNodeVisitor.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBProgramNodeVisitor.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)TFunctionBinding.$(O) TFunctionBinding.$(H): TFunctionBinding.st $(INCLUDE_TOP)/jv/tea/compiler/TBinding.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)TFunctionType.$(O) TFunctionType.$(H): TFunctionType.st $(INCLUDE_TOP)/jv/tea/compiler/TType.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)TNamespaceBinding.$(O) TNamespaceBinding.$(H): TNamespaceBinding.st $(INCLUDE_TOP)/jv/tea/compiler/TBinding.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)TSimpleType.$(O) TSimpleType.$(H): TSimpleType.st $(INCLUDE_TOP)/jv/tea/compiler/TType.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)TSimpleTypeNode.$(O) TSimpleTypeNode.$(H): TSimpleTypeNode.st $(INCLUDE_TOP)/jv/tea/compiler/TTypeNode.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBProgramNode.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)TUnionType.$(O) TUnionType.$(H): TUnionType.st $(INCLUDE_TOP)/jv/tea/compiler/TType.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
@@ -154,16 +159,16 @@
$(OUTDIR)TValueBinding.$(O) TValueBinding.$(H): TValueBinding.st $(INCLUDE_TOP)/jv/tea/compiler/TBinding.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)TBlockBinding.$(O) TBlockBinding.$(H): TBlockBinding.st $(INCLUDE_TOP)/jv/tea/compiler/TBinding.$(H) $(INCLUDE_TOP)/jv/tea/compiler/TFunctionBinding.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)TBlockType.$(O) TBlockType.$(H): TBlockType.st $(INCLUDE_TOP)/jv/tea/compiler/TFunctionType.$(H) $(INCLUDE_TOP)/jv/tea/compiler/TType.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)TCodeGenerator.$(O) TCodeGenerator.$(H): TCodeGenerator.st $(INCLUDE_TOP)/jv/tea/compiler/TCompilerPass.$(H) $(INCLUDE_TOP)/jv/tea/compiler/TProgramNodeVisitor.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBProgramNodeVisitor.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)TConstantBinding.$(O) TConstantBinding.$(H): TConstantBinding.st $(INCLUDE_TOP)/jv/tea/compiler/TBinding.$(H) $(INCLUDE_TOP)/jv/tea/compiler/TValueBinding.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
-$(OUTDIR)TLLVMIREmitPass.$(O) TLLVMIREmitPass.$(H): TLLVMIREmitPass.st $(INCLUDE_TOP)/jv/tea/compiler/TCompilerPass.$(H) $(INCLUDE_TOP)/jv/tea/compiler/TProgramNodeVisitor.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBProgramNodeVisitor.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)TMethodBinding.$(O) TMethodBinding.$(H): TMethodBinding.st $(INCLUDE_TOP)/jv/tea/compiler/TBinding.$(H) $(INCLUDE_TOP)/jv/tea/compiler/TFunctionBinding.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)TMethodType.$(O) TMethodType.$(H): TMethodType.st $(INCLUDE_TOP)/jv/tea/compiler/TFunctionType.$(H) $(INCLUDE_TOP)/jv/tea/compiler/TType.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
-$(OUTDIR)TSemanticAnalysisPass.$(O) TSemanticAnalysisPass.$(H): TSemanticAnalysisPass.st $(INCLUDE_TOP)/jv/tea/compiler/TCompilerPass.$(H) $(INCLUDE_TOP)/jv/tea/compiler/TProgramNodeVisitor.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBProgramNodeVisitor.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
-$(OUTDIR)TTypeAnalysisPass.$(O) TTypeAnalysisPass.$(H): TTypeAnalysisPass.st $(INCLUDE_TOP)/jv/tea/compiler/TCompilerPass.$(H) $(INCLUDE_TOP)/jv/tea/compiler/TProgramNodeVisitor.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBProgramNodeVisitor.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)TSemanticAnalyser.$(O) TSemanticAnalyser.$(H): TSemanticAnalyser.st $(INCLUDE_TOP)/jv/tea/compiler/TCompilerPass.$(H) $(INCLUDE_TOP)/jv/tea/compiler/TProgramNodeVisitor.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBProgramNodeVisitor.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)TTypechecker.$(O) TTypechecker.$(H): TTypechecker.st $(INCLUDE_TOP)/jv/tea/compiler/TCompilerPass.$(H) $(INCLUDE_TOP)/jv/tea/compiler/TProgramNodeVisitor.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBProgramNodeVisitor.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)TVariableBinding.$(O) TVariableBinding.$(H): TVariableBinding.st $(INCLUDE_TOP)/jv/tea/compiler/TBinding.$(H) $(INCLUDE_TOP)/jv/tea/compiler/TValueBinding.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)TArgumentBinding.$(O) TArgumentBinding.$(H): TArgumentBinding.st $(INCLUDE_TOP)/jv/tea/compiler/TBinding.$(H) $(INCLUDE_TOP)/jv/tea/compiler/TValueBinding.$(H) $(INCLUDE_TOP)/jv/tea/compiler/TVariableBinding.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)TLocalBinding.$(O) TLocalBinding.$(H): TLocalBinding.st $(INCLUDE_TOP)/jv/tea/compiler/TBinding.$(H) $(INCLUDE_TOP)/jv/tea/compiler/TValueBinding.$(H) $(INCLUDE_TOP)/jv/tea/compiler/TVariableBinding.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
-$(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBBlockNode.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBMethodNode.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBProgramNode.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBReturnNode.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBStatementNode.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBValueNode.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBVariableNode.$(H) $(INCLUDE_TOP)/stx/goodies/ring/RGBehaviorDefinition.$(H) $(INCLUDE_TOP)/stx/goodies/ring/RGClassDefinition.$(H) $(INCLUDE_TOP)/stx/goodies/ring/RGClassDescriptionDefinition.$(H) $(INCLUDE_TOP)/stx/goodies/ring/RGDefinition.$(H) $(INCLUDE_TOP)/stx/goodies/ring/RGElementDefinition.$(H) $(INCLUDE_TOP)/stx/goodies/ring/RGGlobalDefinition.$(H) $(INCLUDE_TOP)/stx/goodies/ring/RGMetaclassDefinition.$(H) $(INCLUDE_TOP)/stx/goodies/ring/RGMethodDefinition.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBBlockNode.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBMethodNode.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBProgramNode.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBReturnNode.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBStatementNode.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBToken.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBValueNode.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBVariableNode.$(H) $(INCLUDE_TOP)/stx/goodies/ring/RGBehaviorDefinition.$(H) $(INCLUDE_TOP)/stx/goodies/ring/RGClassDefinition.$(H) $(INCLUDE_TOP)/stx/goodies/ring/RGClassDescriptionDefinition.$(H) $(INCLUDE_TOP)/stx/goodies/ring/RGDefinition.$(H) $(INCLUDE_TOP)/stx/goodies/ring/RGElementDefinition.$(H) $(INCLUDE_TOP)/stx/goodies/ring/RGGlobalDefinition.$(H) $(INCLUDE_TOP)/stx/goodies/ring/RGMetaclassDefinition.$(H) $(INCLUDE_TOP)/stx/goodies/ring/RGMethodDefinition.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
# ENDMAKEDEPEND --- do not remove this line
--- a/compiler/Make.spec Mon Aug 31 18:37:31 2015 +0100
+++ b/compiler/Make.spec Wed Sep 02 09:18:00 2015 +0100
@@ -56,21 +56,26 @@
TCompiler \
TCompilerContext \
TFormatter \
+ TInlineAssemblyBeginToken \
+ TInlineAssemblyEndToken \
+ TInlineAssemblyNode \
TMetaDefinition \
TMethodDefinition \
+ TNamespaceDefinition \
TParser \
TProgramNodeVisitor \
+ TScanner \
TScope \
TSourceReader \
TType \
TTypeNode \
TTypeSpecNode \
- TUniverseDefinition \
jv_tea_compiler \
TClassBinding \
TCompilerPass \
TFunctionBinding \
TFunctionType \
+ TNamespaceBinding \
TSimpleType \
TSimpleTypeNode \
TUnionType \
@@ -78,12 +83,12 @@
TValueBinding \
TBlockBinding \
TBlockType \
+ TCodeGenerator \
TConstantBinding \
- TLLVMIREmitPass \
TMethodBinding \
TMethodType \
- TSemanticAnalysisPass \
- TTypeAnalysisPass \
+ TSemanticAnalyser \
+ TTypechecker \
TVariableBinding \
TArgumentBinding \
TLocalBinding \
@@ -97,21 +102,26 @@
$(OUTDIR_SLASH)TCompiler.$(O) \
$(OUTDIR_SLASH)TCompilerContext.$(O) \
$(OUTDIR_SLASH)TFormatter.$(O) \
+ $(OUTDIR_SLASH)TInlineAssemblyBeginToken.$(O) \
+ $(OUTDIR_SLASH)TInlineAssemblyEndToken.$(O) \
+ $(OUTDIR_SLASH)TInlineAssemblyNode.$(O) \
$(OUTDIR_SLASH)TMetaDefinition.$(O) \
$(OUTDIR_SLASH)TMethodDefinition.$(O) \
+ $(OUTDIR_SLASH)TNamespaceDefinition.$(O) \
$(OUTDIR_SLASH)TParser.$(O) \
$(OUTDIR_SLASH)TProgramNodeVisitor.$(O) \
+ $(OUTDIR_SLASH)TScanner.$(O) \
$(OUTDIR_SLASH)TScope.$(O) \
$(OUTDIR_SLASH)TSourceReader.$(O) \
$(OUTDIR_SLASH)TType.$(O) \
$(OUTDIR_SLASH)TTypeNode.$(O) \
$(OUTDIR_SLASH)TTypeSpecNode.$(O) \
- $(OUTDIR_SLASH)TUniverseDefinition.$(O) \
$(OUTDIR_SLASH)jv_tea_compiler.$(O) \
$(OUTDIR_SLASH)TClassBinding.$(O) \
$(OUTDIR_SLASH)TCompilerPass.$(O) \
$(OUTDIR_SLASH)TFunctionBinding.$(O) \
$(OUTDIR_SLASH)TFunctionType.$(O) \
+ $(OUTDIR_SLASH)TNamespaceBinding.$(O) \
$(OUTDIR_SLASH)TSimpleType.$(O) \
$(OUTDIR_SLASH)TSimpleTypeNode.$(O) \
$(OUTDIR_SLASH)TUnionType.$(O) \
@@ -119,12 +129,12 @@
$(OUTDIR_SLASH)TValueBinding.$(O) \
$(OUTDIR_SLASH)TBlockBinding.$(O) \
$(OUTDIR_SLASH)TBlockType.$(O) \
+ $(OUTDIR_SLASH)TCodeGenerator.$(O) \
$(OUTDIR_SLASH)TConstantBinding.$(O) \
- $(OUTDIR_SLASH)TLLVMIREmitPass.$(O) \
$(OUTDIR_SLASH)TMethodBinding.$(O) \
$(OUTDIR_SLASH)TMethodType.$(O) \
- $(OUTDIR_SLASH)TSemanticAnalysisPass.$(O) \
- $(OUTDIR_SLASH)TTypeAnalysisPass.$(O) \
+ $(OUTDIR_SLASH)TSemanticAnalyser.$(O) \
+ $(OUTDIR_SLASH)TTypechecker.$(O) \
$(OUTDIR_SLASH)TVariableBinding.$(O) \
$(OUTDIR_SLASH)TArgumentBinding.$(O) \
$(OUTDIR_SLASH)TLocalBinding.$(O) \
--- a/compiler/TArgumentBinding.st Mon Aug 31 18:37:31 2015 +0100
+++ b/compiler/TArgumentBinding.st Wed Sep 02 09:18:00 2015 +0100
@@ -3,20 +3,40 @@
"{ NameSpace: Smalltalk }"
TVariableBinding subclass:#TArgumentBinding
- instanceVariableNames:''
+ instanceVariableNames:'index'
classVariableNames:''
poolDictionaries:''
category:'Languages-Tea-Compiler-Bindings'
!
+!TArgumentBinding methodsFor:'accessing'!
+
+index
+ ^ index
+! !
+
+!TArgumentBinding methodsFor:'initialization'!
+
+index:something
+ index := something.
+! !
+
!TArgumentBinding methodsFor:'printing & storing'!
printOn:aStream
aStream nextPutAll: '[A] '.
- super printOn: aStream
+ super printOn: aStream.
+ aStream nextPutAll: ' ('.
+ index notNil ifTrue:[
+ index printOn: aStream
+ ] ifFalse:[
+ aStream nextPut: $?
+ ].
+ aStream nextPut: $).
"Created: / 25-08-2015 / 22:54:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 02-09-2015 / 08:28:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!TArgumentBinding methodsFor:'testing'!
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/compiler/TCodeGenerator.st Wed Sep 02 09:18:00 2015 +0100
@@ -0,0 +1,210 @@
+"{ Package: 'jv:tea/compiler' }"
+
+"{ NameSpace: Smalltalk }"
+
+TCompilerPass subclass:#TCodeGenerator
+ instanceVariableNames:'function asm'
+ classVariableNames:'SelectorSpecialCharMappingTable'
+ poolDictionaries:''
+ category:'Languages-Tea-Compiler'
+!
+
+!TCodeGenerator class methodsFor:'initialization'!
+
+initialize
+ "Invoked at system start or when the class is dynamically loaded."
+
+ "/ please change as required (and remove this comment)
+
+ SelectorSpecialCharMappingTable := Dictionary withKeysAndValues:
+ #($+ 'pl'
+ $- 'mi'
+ $* 'mu'
+ $/ 'di'
+ $, 'co'
+ $@ 'at'
+ $< 'le'
+ $> 'gr'
+ $= 'eq'
+ $~ 'ne'
+ $| 'pi'
+ $\ 'mo'
+ $& 'am').
+
+ "Modified: / 11-07-2015 / 09:24:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!TCodeGenerator class methodsFor:'utilities'!
+
+llvmFunctionNameForClass: class selector: selector
+ "For given class name and selector, returns the name
+ used by LLVM"
+
+ ^ String streamContents:[ :s|
+ s nextPutAll: '__M_L_'.
+ s nextPutAll: (class theNonMetaclass name copyReplaceAll: $: with: $_).
+ class isMeta ifTrue:[
+ s nextPutAll: '_class'
+ ].
+ s nextPut: $_.
+ selector isBinarySelector ifTrue:[
+ selector do:[:c |
+ s nextPutAll: (SelectorSpecialCharMappingTable at: c)
+ ].
+ ] ifFalse:[
+ selector do:[:c |
+ c isAlphaNumeric ifTrue:[
+ s nextPut: c
+ ] ifFalse:[
+ s nextPut: $_.
+ c == $: ifFalse:[
+ c codePoint printOn: s.
+ ]
+ ].
+ ]
+ ].
+ ].
+
+ "
+ TLLVMIREmitPass llvmFunctionNameForClass: TLLVMIREmitPass class selector: #llvmFunctionNameForClass:selector:
+ TLLVMIREmitPass llvmFunctionNameForClass: SmallInteger selector: #+
+ TLLVMIREmitPass llvmFunctionNameForClass: Object selector: #~=
+
+ "
+
+ "Created: / 30-08-2015 / 09:23:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 31-08-2015 / 07:04:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!TCodeGenerator methodsFor:'visiting'!
+
+visitArgument: anRBVariableNode
+ | binding |
+
+ binding := anRBVariableNode binding.
+ binding isArgumentBinding ifTrue:[
+ (function parameterAt: binding index) name: anRBVariableNode name.
+ ] ifFalse:[
+ self notYetImplemented.
+ ].
+
+ "Created: / 02-09-2015 / 08:43:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!TCodeGenerator methodsFor:'visitor-double dispatching'!
+
+acceptArrayNode: anArrayNode
+ self notYetImplemented
+
+ "Created: / 31-08-2015 / 10:14:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+acceptAssignmentNode: anAssignmentNode
+ self notYetImplemented
+
+ "Created: / 31-08-2015 / 10:14:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+acceptBlockNode: aBlockNode
+ self notYetImplemented
+
+ "Created: / 31-08-2015 / 10:14:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+acceptCascadeNode: aCascadeNode
+ self notYetImplemented
+
+ "Created: / 31-08-2015 / 10:14:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+acceptInlineAssemblyNode: aTInlineAssemblyNode
+ | emitMethodNode emitMethod|
+
+ emitMethodNode := RBMethodNode new.
+ emitMethodNode arguments: aTInlineAssemblyNode arguments , { RBVariableNode named: 'zelf' } , aTInlineAssemblyNode topNode arguments.
+ emitMethodNode body: aTInlineAssemblyNode body copy.
+ emitMethodNode variableNodesDo:[ :variableNode |
+ variableNode name = 'self' ifTrue:[
+ variableNode name: 'zelf'.
+ ].
+ ].
+ emitMethodNode selector:(String streamContents: [ :s | emitMethodNode arguments size timesRepeat:[s nextPutAll:'_:'] ]).
+ emitMethod := Compiler compile: emitMethodNode formattedCode forClass: UndefinedObject install: false.
+ emitMethod
+ valueWithReceiver: nil
+ arguments: { asm } , ((1 to: function numArgs) collect: [ :i | function parameterAt: i ])
+
+ "Created: / 02-09-2015 / 06:53:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 02-09-2015 / 09:14:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+acceptLiteralNode: aLiteralNode
+ ^ aLiteralNode binding asLLVMValueInModule: context module.
+
+ "Created: / 31-08-2015 / 10:13:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 31-08-2015 / 12:20:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+acceptMessageNode: aMessageNode
+ self notYetImplemented
+
+ "Created: / 31-08-2015 / 10:13:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+acceptMethodNode: aMethodNode
+ | binding |
+
+ binding := aMethodNode binding.
+ function := context module
+ addFunctionNamed: (self class llvmFunctionNameForClass: currentClass selector: currentMethod selector)
+ type: (binding type asLLVMTypeInModule: context module).
+ asm := function builder.
+ (function parameterAt: 1) name: 'self'.
+ super acceptMethodNode: aMethodNode
+
+ "Created: / 31-08-2015 / 09:42:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 02-09-2015 / 08:59:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+acceptOptimizedNode: anOptimizedNode
+ self notYetImplemented
+
+ "Created: / 31-08-2015 / 10:13:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+acceptPragmaNode: aPragmaNode
+ self notYetImplemented
+
+ "Created: / 31-08-2015 / 10:13:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+acceptReturnNode: aReturnNode
+ | value |
+
+ value := self visitNode: aReturnNode value.
+ asm ret: value.
+
+ "Created: / 31-08-2015 / 10:13:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 31-08-2015 / 12:17:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+acceptSTXPrimitiveCCodeNode: aPrimitiveCCodeNode
+ self notYetImplemented
+
+ "Created: / 31-08-2015 / 10:13:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+acceptSTXPrimitiveValueCCodeNode: aPrimitiveValueCCodeNode
+ self notYetImplemented
+
+ "Created: / 31-08-2015 / 10:13:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+acceptVariableNode: aVariableNode
+ self notYetImplemented
+
+ "Created: / 31-08-2015 / 10:13:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+
+TCodeGenerator initialize!
--- a/compiler/TCompiler.st Mon Aug 31 18:37:31 2015 +0100
+++ b/compiler/TCompiler.st Wed Sep 02 09:18:00 2015 +0100
@@ -33,11 +33,11 @@
| unit |
unit := context unit.
- self assert:(unit isRingObject and:[ unit isClass and:[ unit isMeta not ] ]).
-
- self runPass:TSemanticAnalysisPass.
- self runPass:TTypeAnalysisPass.
- self runPass:TLLVMIREmitPass.
+ self
+ assert:(unit isRingObject and:[ unit isClass and:[ unit isMeta not ] ]).
+ self runPass:TSemanticAnalyser.
+ self runPass:TTypechecker.
+ self runPass:TCodeGenerator.
"Created: / 29-08-2015 / 14:22:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
"Modified (format): / 31-08-2015 / 10:51:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
--- a/compiler/TCompilerContext.st Mon Aug 31 18:37:31 2015 +0100
+++ b/compiler/TCompilerContext.st Wed Sep 02 09:18:00 2015 +0100
@@ -15,8 +15,8 @@
^ environment
!
-environment:something
- environment := something.
+environment:aTNamespaceDefinition
+ environment := aTNamespaceDefinition.
!
module
--- a/compiler/TCompilerPass.st Mon Aug 31 18:37:31 2015 +0100
+++ b/compiler/TCompilerPass.st Wed Sep 02 09:18:00 2015 +0100
@@ -3,7 +3,7 @@
"{ NameSpace: Smalltalk }"
TProgramNodeVisitor subclass:#TCompilerPass
- instanceVariableNames:'context currentClass currentMethod'
+ instanceVariableNames:'context currentClass currentMethod currentScope'
classVariableNames:''
poolDictionaries:''
category:'Languages-Tea-Compiler'
@@ -45,6 +45,13 @@
!TCompilerPass methodsFor:'visitor-double dispatching'!
+acceptBlockNode: aBlockNode
+ currentScope := aBlockNode scope.
+ super acceptBlockNode: aBlockNode
+
+ "Created: / 02-09-2015 / 07:20:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
acceptClassDefinition: aTClassDefinition
self visitDefinition: aTClassDefinition theMetaclass.
@@ -58,6 +65,11 @@
"Modified: / 31-08-2015 / 11:03:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
+acceptInlineAssemblyNode: aMethodNode
+
+ "Created: / 02-09-2015 / 07:03:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
acceptMetaclassDefinition: aTClassDefinition
currentClass := aTClassDefinition.
aTClassDefinition methodDictionary do:[:each |
@@ -76,5 +88,21 @@
"Created: / 29-08-2015 / 21:55:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
"Modified: / 31-08-2015 / 11:03:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+acceptMethodNode: aMethodNode
+
+ currentScope := aMethodNode scope.
+ self visitArguments: aMethodNode arguments.
+ self visitNode: aMethodNode returnTypeSpec.
+ "/ If method node contains inline assembly, then visit that inline assembly
+ "/ node but nothing else!!
+ aMethodNode body statements first isInlineAssembly ifTrue:[
+ self visitNode: aMethodNode body statements first
+ ] ifFalse:[
+ self visitNode: aMethodNode body
+ ].
+
+ "Created: / 02-09-2015 / 07:16:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
--- a/compiler/TCompilerTests.st Mon Aug 31 18:37:31 2015 +0100
+++ b/compiler/TCompilerTests.st Wed Sep 02 09:18:00 2015 +0100
@@ -15,21 +15,45 @@
| class method compiler |
class := TClassDefinition newClass.
- class name: 'iptr'.
+ class name: 'tSmallInteger'.
method := TMethodDefinition class: class theMetaclass.
- method source: 'one <^ iptr> ^ 1'.
+ method source: 'one <^ tSmallInteger> ^ 1'.
class addMethod: method.
compiler := TCompiler new.
compiler compile: class in: nil.
self halt.
-
"
compiler context module
"
"Created: / 29-08-2015 / 21:15:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified (comment): / 31-08-2015 / 12:26:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 01-09-2015 / 21:55:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_02
+ | class method compiler |
+
+ class := TClassDefinition newClass.
+ class name: 'tSmallInteger'.
+
+ method := TMethodDefinition class: class.
+ method source: '+ another <tSmallInteger> <^ tSmallInteger>
+ %[:asm |
+ asm ret: (asm add: self _: another)
+ %].
+ ^ self + another
+ '.
+ class addMethod: method.
+
+ compiler := TCompiler new.
+ compiler compile: class in: nil.
+ self halt.
+ "
+ compiler context module
+ "
+
+ "Created: / 02-09-2015 / 07:00:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
--- a/compiler/TConstantBinding.st Mon Aug 31 18:37:31 2015 +0100
+++ b/compiler/TConstantBinding.st Wed Sep 02 09:18:00 2015 +0100
@@ -24,29 +24,18 @@
^ value
! !
-!TConstantBinding methodsFor:'conversion'!
-
-asLLVMValueInModule: anLLVMModule
- value isInteger ifTrue:[
- ^ LLVMConstant sint: value type: (type asLLVMTypeInModule: anLLVMModule)
- ].
- self notYetImplemented
-
- "Created: / 31-08-2015 / 12:22:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
!TConstantBinding methodsFor:'initialization'!
initializeWithValue: anObject
value := anObject.
value class == SmallInteger ifTrue:[
- type := TSimpleType named: 'SmallInteger'.
+ type := TSimpleType named: 'tSmallInteger'.
^ self.
].
self error: 'Unsupported constant'
"Created: / 25-08-2015 / 23:15:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 31-08-2015 / 12:24:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 01-09-2015 / 21:55:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!TConstantBinding methodsFor:'testing'!
--- a/compiler/TFormatter.st Mon Aug 31 18:37:31 2015 +0100
+++ b/compiler/TFormatter.st Wed Sep 02 09:18:00 2015 +0100
@@ -11,6 +11,106 @@
!TFormatter methodsFor:'visitor-double dispatching'!
+acceptInlineAssemblyNode:aBlockNode
+ |seqNode multiline formattedBody formatter parent parentSelector|
+
+ (CStyleBlocks
+ and:[ (parent := aBlockNode parent) notNil and:[ parent isMessage ] ])
+ ifTrue:
+ [ parent receiver == aBlockNode
+ ifTrue:
+ [ " I am the receiver of a message (i.e. typically a control structure) "
+ ^ self acceptInlineAssemblyNodeCStyle:aBlockNode ].
+ parentSelector := parent selector.
+ parentSelector == #timesRepeat:
+ ifTrue:
+ [ " I am the receiver of a message (i.e. typically a control structure) "
+ self indent:-2 while:[ ^ self acceptInlineAssemblyNodeCStyle:aBlockNode ] ] ].
+ seqNode := aBlockNode body.
+ formatter := (self copy)
+ lineStart:0;
+ yourself.
+ seqNode isNil ifTrue:[
+ formattedBody := ''
+ ] ifFalse:[
+ formattedBody := formatter format:seqNode
+ ].
+ multiline := (self lineLength + formattedBody size > self maxLineSize)
+ or:[ formatter isMultiLine ].
+ (CStyleBlocks and:[ multiline ])
+ ifTrue:
+ [ self indent:-1 while:[ self acceptInlineAssemblyNodeCStyle:aBlockNode ].
+ ^ self ].
+ multiline ifTrue:[ self indent ].
+ codeStream nextPutAll:'%['.
+ SpaceAfterBlockStart
+ ifTrue:
+ [ (formattedBody notEmpty and:[ aBlockNode arguments isEmptyOrNil ])
+ ifTrue:[ codeStream space. ] ].
+ self formatBlockArguments:aBlockNode.
+ aBlockNode arguments isEmpty
+ ifFalse:
+ [ codeStream nextPutAll:'| '.
+ multiline ifTrue:[ self indent ] ].
+ codeStream nextPutAll:formattedBody.
+ SpaceBeforeBlockEnd
+ ifTrue:[ formattedBody notEmpty ifTrue:[ codeStream space. ] ].
+ codeStream nextPutAll:'%]'
+
+ "Created: / 02-09-2015 / 06:49:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+acceptInlineAssemblyNodeCStyle: aBlockNode
+ | seqNode l multiline formattedBody formatter |
+
+ seqNode := aBlockNode body.
+
+ formatter := (self copy) lineStart: 0; yourself.
+ formatter indentWhile:[
+ formattedBody := formatter format: seqNode.
+formattedBody asCollectionOfLines last isBlank ifTrue:[
+ formattedBody := (formattedBody asCollectionOfLines copyButLast:1) asStringWith:Character cr.
+].
+ ].
+ multiline := (l := self lineLength + formattedBody size) > self maxLineSize
+ or: [formatter isMultiLine].
+ multiline := multiline or:[l > (MaxLengthForSingleLineBlocks ? 60)].
+
+ codeStream nextPutAll:'%['.
+ multiline ifFalse:[
+ SpaceAfterBlockStart
+ ifTrue:[
+ (formattedBody notEmpty and:[aBlockNode hasArguments not])
+ ifTrue:[
+ codeStream space.]].
+ ].
+ self indentWhile:[
+ (BlockArgumentsOnNewLine or:[aBlockNode hasArguments not]) ifTrue:[
+ multiline ifTrue:[
+ self indent.
+ ].
+ ].
+
+ self formatBlockArguments:aBlockNode.
+ aBlockNode arguments isEmpty
+ ifFalse:[
+ codeStream nextPutAll: '| '.
+ multiline ifTrue: [self indent]].
+ ].
+ codeStream nextPutAll: formattedBody.
+ multiline
+ ifTrue: [self indent]
+ ifFalse:[
+ SpaceBeforeBlockEnd
+ ifTrue:[
+ formattedBody notEmpty
+ ifTrue:[
+ codeStream space.]]].
+ codeStream nextPutAll:'%]'.
+
+ "Created: / 02-09-2015 / 06:48:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
acceptSimpleTypeNode: aTSimpleTypeNode
codeStream nextPutAll: aTSimpleTypeNode name
@@ -18,11 +118,14 @@
!
acceptTypeSpecNode: aTTypeSpecNode
- codeStream nextPut:$<; space.
- self visitNode: aTTypeSpecNode type.
- codeStream space; nextPut:$>.
+ aTTypeSpecNode type notNil ifTrue:[
+ codeStream nextPut:$<; space.
+ self visitNode: aTTypeSpecNode type.
+ codeStream space; nextPut:$>.
+ ]
"Created: / 21-08-2015 / 22:18:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 01-09-2015 / 19:08:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
acceptUnionTypeNode: aTUnionTypeNode
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/compiler/TInlineAssemblyBeginToken.st Wed Sep 02 09:18:00 2015 +0100
@@ -0,0 +1,19 @@
+"{ Package: 'jv:tea/compiler' }"
+
+"{ NameSpace: Smalltalk }"
+
+RBToken subclass:#TInlineAssemblyBeginToken
+ instanceVariableNames:''
+ classVariableNames:''
+ poolDictionaries:''
+ category:'Languages-Tea-Compiler-AST'
+!
+
+!TInlineAssemblyBeginToken methodsFor:'testing'!
+
+isTInlineAssemblyBegin
+ ^ true
+
+ "Created: / 02-09-2015 / 06:20:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/compiler/TInlineAssemblyEndToken.st Wed Sep 02 09:18:00 2015 +0100
@@ -0,0 +1,19 @@
+"{ Package: 'jv:tea/compiler' }"
+
+"{ NameSpace: Smalltalk }"
+
+RBToken subclass:#TInlineAssemblyEndToken
+ instanceVariableNames:''
+ classVariableNames:''
+ poolDictionaries:''
+ category:'Languages-Tea-Compiler-AST'
+!
+
+!TInlineAssemblyEndToken methodsFor:'testing'!
+
+isTInlineAssemblyEnd
+ ^ true
+
+ "Created: / 02-09-2015 / 06:20:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/compiler/TInlineAssemblyNode.st Wed Sep 02 09:18:00 2015 +0100
@@ -0,0 +1,33 @@
+"{ Package: 'jv:tea/compiler' }"
+
+"{ NameSpace: Smalltalk }"
+
+RBBlockNode subclass:#TInlineAssemblyNode
+ instanceVariableNames:''
+ classVariableNames:''
+ poolDictionaries:''
+ category:'Languages-Tea-Compiler-AST'
+!
+
+!TInlineAssemblyNode methodsFor:'testing'!
+
+isBlock
+ ^false
+
+ "Created: / 02-09-2015 / 06:29:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+isInlineAssembly
+ ^true
+
+ "Created: / 02-09-2015 / 06:29:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!TInlineAssemblyNode methodsFor:'visitor'!
+
+acceptVisitor: aProgramNodeVisitor
+ ^aProgramNodeVisitor acceptInlineAssemblyNode: self
+
+ "Created: / 02-09-2015 / 06:30:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
--- a/compiler/TLLVMIREmitPass.st Mon Aug 31 18:37:31 2015 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,172 +0,0 @@
-"{ Package: 'jv:tea/compiler' }"
-
-"{ NameSpace: Smalltalk }"
-
-TCompilerPass subclass:#TLLVMIREmitPass
- instanceVariableNames:'function asm'
- classVariableNames:'SelectorSpecialCharMappingTable'
- poolDictionaries:''
- category:'Languages-Tea-Compiler'
-!
-
-!TLLVMIREmitPass class methodsFor:'initialization'!
-
-initialize
- "Invoked at system start or when the class is dynamically loaded."
-
- "/ please change as required (and remove this comment)
-
- SelectorSpecialCharMappingTable := Dictionary withKeysAndValues:
- #($+ 'pl'
- $- 'mi'
- $* 'mu'
- $/ 'di'
- $, 'co'
- $@ 'at'
- $< 'le'
- $> 'gr'
- $= 'eq'
- $~ 'ne'
- $| 'pi'
- $\ 'mo'
- $& 'am').
-
- "Modified: / 11-07-2015 / 09:24:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!TLLVMIREmitPass class methodsFor:'utilities'!
-
-llvmFunctionNameForClass: class selector: selector
- "For given class name and selector, returns the name
- used by LLVM"
-
- ^ String streamContents:[ :s|
- s nextPutAll: '__M_L_'.
- s nextPutAll: (class theNonMetaclass name copyReplaceAll: $: with: $_).
- class isMeta ifTrue:[
- s nextPutAll: '_class'
- ].
- s nextPut: $_.
- selector isBinarySelector ifTrue:[
- selector do:[:c |
- s nextPutAll: (SelectorSpecialCharMappingTable at: c)
- ].
- ] ifFalse:[
- selector do:[:c |
- c isAlphaNumeric ifTrue:[
- s nextPut: c
- ] ifFalse:[
- s nextPut: $_.
- c == $: ifFalse:[
- c codePoint printOn: s.
- ]
- ].
- ]
- ].
- ].
-
- "
- TLLVMIREmitPass llvmFunctionNameForClass: TLLVMIREmitPass class selector: #llvmFunctionNameForClass:selector:
- TLLVMIREmitPass llvmFunctionNameForClass: SmallInteger selector: #+
- TLLVMIREmitPass llvmFunctionNameForClass: Object selector: #~=
-
- "
-
- "Created: / 30-08-2015 / 09:23:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 31-08-2015 / 07:04:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!TLLVMIREmitPass methodsFor:'visitor-double dispatching'!
-
-acceptArrayNode: anArrayNode
- self notYetImplemented
-
- "Created: / 31-08-2015 / 10:14:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-acceptAssignmentNode: anAssignmentNode
- self notYetImplemented
-
- "Created: / 31-08-2015 / 10:14:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-acceptBlockNode: aBlockNode
- self notYetImplemented
-
- "Created: / 31-08-2015 / 10:14:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-acceptCascadeNode: aCascadeNode
- self notYetImplemented
-
- "Created: / 31-08-2015 / 10:14:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-acceptLiteralNode: aLiteralNode
- ^ aLiteralNode binding asLLVMValueInModule: context module.
-
- "Created: / 31-08-2015 / 10:13:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 31-08-2015 / 12:20:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-acceptMessageNode: aMessageNode
- self notYetImplemented
-
- "Created: / 31-08-2015 / 10:13:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-acceptMethodNode: aMethodNode
- | binding |
-
- binding := aMethodNode binding.
- function := context module
- addFunctionNamed: (self class llvmFunctionNameForClass: currentClass selector: currentMethod selector)
- type: (binding type asLLVMTypeInModule: context module).
- asm := function builder.
- super acceptMethodNode: aMethodNode
-
- "Created: / 31-08-2015 / 09:42:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-acceptOptimizedNode: anOptimizedNode
- self notYetImplemented
-
- "Created: / 31-08-2015 / 10:13:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-acceptPragmaNode: aPragmaNode
- self notYetImplemented
-
- "Created: / 31-08-2015 / 10:13:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-acceptReturnNode: aReturnNode
- | value |
-
- value := self visitNode: aReturnNode value.
- asm ret: value.
-
- "Created: / 31-08-2015 / 10:13:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 31-08-2015 / 12:17:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-acceptSTXPrimitiveCCodeNode: aPrimitiveCCodeNode
- self notYetImplemented
-
- "Created: / 31-08-2015 / 10:13:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-acceptSTXPrimitiveValueCCodeNode: aPrimitiveValueCCodeNode
- self notYetImplemented
-
- "Created: / 31-08-2015 / 10:13:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-acceptVariableNode: aVariableNode
- self notYetImplemented
-
- "Created: / 31-08-2015 / 10:13:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-
-TLLVMIREmitPass initialize!
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/compiler/TNamespaceBinding.st Wed Sep 02 09:18:00 2015 +0100
@@ -0,0 +1,19 @@
+"{ Package: 'jv:tea/compiler' }"
+
+"{ NameSpace: Smalltalk }"
+
+TBinding subclass:#TNamespaceBinding
+ instanceVariableNames:'elements'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'Languages-Tea-Compiler-Bindings'
+!
+
+!TNamespaceBinding methodsFor:'conversion'!
+
+asLLVMValueInModule: anLLVMModule
+ ^ self shouldNotImplement
+
+ "Created: / 02-09-2015 / 08:34:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/compiler/TNamespaceDefinition.st Wed Sep 02 09:18:00 2015 +0100
@@ -0,0 +1,42 @@
+"{ Package: 'jv:tea/compiler' }"
+
+"{ NameSpace: Smalltalk }"
+
+RGNamespace subclass:#TNamespaceDefinition
+ instanceVariableNames:'binding'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'Languages-Tea-Compiler-Model'
+!
+
+!TNamespaceDefinition methodsFor:'accessing'!
+
+binding
+ ^ binding
+!
+
+binding:aTNamespaceBinding
+ binding := aTNamespaceBinding.
+! !
+
+!TNamespaceDefinition methodsFor:'adding elements'!
+
+addMethod: method
+ | mclassName mclassIsMeta mclass |
+
+ mclassName := method className.
+ (mclassName endsWith: ' class') ifTrue:[
+ mclassName := mclassName copyTo: mclassName size - 6.
+ mclassIsMeta := true.
+ ] ifFalse:[
+ mclassIsMeta := false.
+ ].
+ mclass := self classNamed: mclassName.
+ mclassIsMeta ifTrue:[
+ mclass := mclass theMetaclass.
+ ].
+ mclass addMethod: method.
+
+ "Created: / 31-08-2015 / 17:10:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
--- a/compiler/TParser.st Mon Aug 31 18:37:31 2015 +0100
+++ b/compiler/TParser.st Wed Sep 02 09:18:00 2015 +0100
@@ -3,7 +3,7 @@
"{ NameSpace: Smalltalk }"
RBParser subclass:#TParser
- instanceVariableNames:''
+ instanceVariableNames:'parsingInlineAssembly'
classVariableNames:''
poolDictionaries:''
category:'Languages-Tea-Compiler-AST'
@@ -17,6 +17,30 @@
"Created: / 20-08-2015 / 17:04:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
+!TParser methodsFor:'accessing'!
+
+initializeParserWith: aString type: aSymbol
+ |stream|
+
+ stream := ReadStream on: aString.
+ source := aString.
+ self scanner: (TScanner
+ perform: aSymbol
+ with: stream
+ with: self errorBlock)
+
+ "Created: / 02-09-2015 / 05:57:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!TParser methodsFor:'initialization & release'!
+
+scanner: aScanner
+ parsingInlineAssembly := false.
+ super scanner: aScanner.
+
+ "Created: / 02-09-2015 / 06:34:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
!TParser methodsFor:'private-parsing'!
parseArgOrLocal
@@ -42,6 +66,42 @@
"Created: / 21-08-2015 / 22:55:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
+parseInlineAssembly
+ | position blockNode firstLine prevScope|
+
+ position := currentToken start.
+ firstLine := currentToken lineNumber.
+ parsingInlineAssembly := true.
+ self step. "/ To eat %[ token
+ blockNode := self parseBlockArgsInto: TInlineAssemblyNode new.
+"/ node arguments do:[:eachArg | eachArg parent:self].
+ blockNode left: position.
+ blockNode firstLineNumber:firstLine.
+ prevScope := currentScope.
+ currentScope := blockNode.
+ self rememberLastNode:blockNode.
+ blockNode body: (self parseStatements: false).
+ RBParser isSmalltalkX ifTrue:[
+ self addComments:(scanner getCommentsBeforeToken) afterNode:blockNode body.
+ ].
+ "/ ensure that right is set, even if parse aborted due to an error
+ blockNode right: currentToken start-1.
+
+ (currentToken isTInlineAssemblyEnd )
+ ifFalse: [self parserError: '''$]'' expected'].
+ "/ fix right
+ blockNode right: currentToken start.
+ blockNode lastLineNumber:currentToken lineNumber.
+ parsingInlineAssembly := false.
+
+ self step.
+ self addComments:(scanner getCommentsBeforeToken) afterNode:blockNode.
+ currentScope := prevScope.
+ ^ blockNode
+
+ "Created: / 02-09-2015 / 06:25:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
parseKeywordPattern
| method |
@@ -53,6 +113,100 @@
"Modified: / 21-08-2015 / 22:50:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
+parseStatementList: tagBoolean into: sequenceNode
+ | statements return periods returnPosition returnLineNumber node valueNode|
+ return := false.
+ statements := OrderedCollection new.
+ periods := OrderedCollection new.
+ self addComments:(scanner getCommentsBeforeToken) beforeNode:sequenceNode.
+ tagBoolean ifTrue: [self parseResourceTag].
+
+ [
+ "skip empty statements"
+ emptyStatements ifTrue:
+ [[currentToken isSpecial and: [currentToken value == $.]] whileTrue:
+ [periods add: currentToken start.
+ self step]].
+
+ self atEnd
+ or: [(currentToken isSpecial and: ['])}' includes: currentToken value ])
+ or: [(currentToken isTInlineAssemblyEnd)]]
+ ] whileFalse:[
+ self addComments:(scanner getCommentsBeforeToken) beforeNode:node "value".
+
+ return ifTrue: [
+ self class isSmalltalkX
+ ifTrue:
+ ["could output a warning"]
+ ifFalse:
+ [self
+ parserError: 'End of statement list encounted (statements after return)'
+ lastNode:node]].
+ (currentToken isTInlineAssemblyBegin) ifTrue:[
+ node := self parseInlineAssembly.
+ statements add: node.
+ ] ifFalse:[
+ (currentToken isSTXPrimitiveCode)
+ ifTrue:[
+ " primPosition := currentToken start. "
+ node := RBSTXPrimitiveCCodeNode new codeToken: currentToken.
+ self addComments:(scanner getCommentsBeforeToken) afterNode:node.
+ statements add: node.
+ self step.
+ ] ifFalse:[
+ (currentToken isSpecial and: [currentToken value == $^])
+ ifTrue:
+ [
+ returnPosition := currentToken start.
+ returnLineNumber := currentToken lineNumber.
+ self step.
+
+ valueNode := self parseAssignment.
+ node := RBReturnNode return: returnPosition value: valueNode.
+ node lineNumber:returnLineNumber.
+ scanner atEnd ifFalse:[
+ self addComments:(scanner getCommentsBeforeToken) afterNode:node value.
+ ].
+
+ statements add: node.
+ return := true]
+ ifFalse:
+ [
+ node := self parseAssignment.
+ node notNil ifTrue:[
+ self addComments:(scanner getCommentsAfterTokenIfInLine:node lastLineNumber) afterNode:node.
+ scanner atEnd ifFalse:[
+ self addComments:(scanner getCommentsAfterToken) afterNode:node.
+ self addComments:(scanner getCommentsBeforeToken) afterNode:node.
+ ].
+
+ statements add: node
+ ]].
+ ].
+ ].
+
+ (currentToken isSpecial and: [currentToken value == $.])
+ ifTrue:
+ [periods add: currentToken start.
+ self step]
+ ifFalse:
+ [return := true].
+ emptyStatements
+ ifTrue:
+ [[currentToken isSpecial and: [currentToken value == $.]] whileTrue:
+ [periods add: currentToken start.
+ self step]]].
+
+ sequenceNode
+ statements: statements;
+ periods: periods.
+
+ self addComments:(scanner getCommentsBeforeToken) afterNode:node "value".
+ ^sequenceNode
+
+ "Created: / 02-09-2015 / 06:23:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
parseType
"
type ::= type_simple ( '|' type )*
@@ -99,6 +253,8 @@
!
parseTypeSpec: forReturn
+ parsingInlineAssembly ifTrue:[ ^ nil ].
+
(currentToken isBinary and: [currentToken value == #<]) ifTrue: [
| start stop type |
start := currentToken start.
@@ -121,11 +277,11 @@
start: start;
stop: stop.
] ifFalse:[
- self parserError: 'type specification expected'
+ self parserError: 'type annotation expected'
].
"Created: / 20-08-2015 / 17:13:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 21-08-2015 / 21:18:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 02-09-2015 / 07:01:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
parseUnaryPattern
--- a/compiler/TParserTests.st Mon Aug 31 18:37:31 2015 +0100
+++ b/compiler/TParserTests.st Wed Sep 02 09:18:00 2015 +0100
@@ -20,6 +20,17 @@
"Modified: / 21-08-2015 / 23:04:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
+test_inline_assembly
+ | method |
+
+ method := TParser parseMethod: 'foo < ^ Integer > %[ :asm | asm ret: 1 %].'.
+ self assert: method body statements size == 1.
+ self assert: method body statements first isInlineAssembly.
+ self halt.
+
+ "Created: / 02-09-2015 / 06:31:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
test_locals
| method |
--- a/compiler/TProgramNodeVisitor.st Mon Aug 31 18:37:31 2015 +0100
+++ b/compiler/TProgramNodeVisitor.st Wed Sep 02 09:18:00 2015 +0100
@@ -13,14 +13,24 @@
!TProgramNodeVisitor methodsFor:'visiting'!
visitArgument: anRBVariableNode
+ | typeSpec |
+
super visitArgument: anRBVariableNode.
- self visitNode: anRBVariableNode typeSpec
+ 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'!
+acceptInlineAssemblyNode: aMethodNode
+ self acceptBlockNode: aMethodNode.
+
+ "Created: / 02-09-2015 / 06:52:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
acceptMethodNode: aMethodNode
super acceptMethodNode: aMethodNode.
self visitNode: aMethodNode returnTypeSpec
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/compiler/TScanner.st Wed Sep 02 09:18:00 2015 +0100
@@ -0,0 +1,66 @@
+"{ Package: 'jv:tea/compiler' }"
+
+"{ NameSpace: Smalltalk }"
+
+RBScanner subclass:#TScanner
+ instanceVariableNames:''
+ classVariableNames:''
+ poolDictionaries:''
+ category:'Languages-Tea-Compiler-AST'
+!
+
+
+!TScanner methodsFor:'private-scanning'!
+
+scanSpecialCharacter
+ | character |
+
+ currentCharacter == $: ifTrue:
+ [self step.
+ currentCharacter == $=
+ ifTrue:
+ [self step.
+ ^ RBAssignmentToken start: tokenStart]
+ ifFalse: [^ RBSpecialCharacterToken value: $: start: tokenStart]].
+
+ currentCharacter == $% ifTrue:[
+ RBParser isSmalltalkX ifTrue:[
+ self step.
+ currentCharacter == ${ ifTrue:[
+ self step.
+ ^ self scanSTXPrimitiveCode.
+ ].
+ currentCharacter == $[ ifTrue:[
+ self step.
+ ^ TInlineAssemblyBeginToken new
+ lineNumber: tokenLineNumber;
+ start: tokenStart;
+ yourself.
+ ].
+ currentCharacter == $] ifTrue:[
+ self step.
+ ^ TInlineAssemblyEndToken new
+ lineNumber: tokenLineNumber;
+ start: tokenStart;
+ yourself.
+ ].
+ characterType := #binary.
+ ^ self scanBinary:RBBinarySelectorToken alreadyRead:$%.
+ ].
+ ^ self scanBinary: RBBinarySelectorToken
+ ].
+
+ character := currentCharacter.
+ self step.
+ ^RBSpecialCharacterToken value: character start: tokenStart lineNumber: tokenLineNumber
+
+ "Created: / 02-09-2015 / 06:00:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!TScanner class methodsFor:'documentation'!
+
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+! !
+
--- a/compiler/TScope.st Mon Aug 31 18:37:31 2015 +0100
+++ b/compiler/TScope.st Wed Sep 02 09:18:00 2015 +0100
@@ -78,3 +78,17 @@
"Created: / 25-08-2015 / 22:58:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
+!TScope methodsFor:'testing'!
+
+isBlockScope
+ ^ node isBlock
+
+ "Created: / 02-09-2015 / 08:57:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+isMethodScope
+ ^ node isMethod
+
+ "Created: / 02-09-2015 / 08:58:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/compiler/TSemanticAnalyser.st Wed Sep 02 09:18:00 2015 +0100
@@ -0,0 +1,112 @@
+"{ Package: 'jv:tea/compiler' }"
+
+"{ NameSpace: Smalltalk }"
+
+TCompilerPass subclass:#TSemanticAnalyser
+ instanceVariableNames:''
+ classVariableNames:''
+ poolDictionaries:''
+ category:'Languages-Tea-Compiler'
+!
+
+!TSemanticAnalyser class methodsFor:'documentation'!
+
+documentation
+"
+ This pass analyzes the tree, creates scopes and
+ initializes variable bindings.
+
+ [author:]
+ Jan Vrany <jan.vrany@fit.cvut.cz>
+
+ [instance variables:]
+
+ [class variables:]
+
+ [see also:]
+
+"
+! !
+
+!TSemanticAnalyser methodsFor:'visitor-double dispatching'!
+
+acceptBlockNode: aBlockNode
+ aBlockNode scope: (currentScope subScope: aBlockNode).
+ super acceptBlockNode: aBlockNode
+
+ "Created: / 25-08-2015 / 22:30:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 02-09-2015 / 07:20:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+acceptClassDefinition: aTClassDefinition
+ aTClassDefinition binding: (TClassBinding name: aTClassDefinition name).
+ super acceptClassDefinition: aTClassDefinition
+
+ "Created: / 31-08-2015 / 11:46:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+acceptLiteralNode: aRBLiteralNode
+ aRBLiteralNode binding: (TConstantBinding value: aRBLiteralNode value).
+ super acceptLiteralNode: aRBLiteralNode
+
+ "Created: / 25-08-2015 / 23:17:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+acceptMetaclassDefinition: aTClassDefinition
+ aTClassDefinition binding: (TClassBinding name: aTClassDefinition name).
+ super acceptMetaclassDefinition: aTClassDefinition
+
+ "Created: / 31-08-2015 / 11:47:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+acceptMethodNode: aMethodNode
+ | binding scope bindingSelf |
+
+ binding := TMethodBinding class: currentClass binding selector: aMethodNode selector.
+ scope := TScope node: aMethodNode.
+ bindingSelf := TArgumentBinding name:'self'.
+ bindingSelf index: self.
+ scope addVariable: bindingSelf.
+ aMethodNode binding: binding.
+ aMethodNode scope: scope.
+
+ super acceptMethodNode: aMethodNode
+
+ "Created: / 25-08-2015 / 22:29:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 02-09-2015 / 08:44:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+acceptVariableNode: aVariableNode
+ aVariableNode binding: (aVariableNode scope lookupVariable: aVariableNode name).
+ super acceptVariableNode: aVariableNode
+
+ "Created: / 25-08-2015 / 23:00:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+visitArgument: anRBVariableNode
+ | binding |
+
+ anRBVariableNode parent isSequence ifTrue:[
+ binding := TLocalBinding name:anRBVariableNode name.
+ ] ifFalse:[
+ binding := TArgumentBinding name:anRBVariableNode name.
+ binding index: (anRBVariableNode parent arguments indexOf: anRBVariableNode)
+ + (currentScope isMethodScope ifTrue:[1] ifFalse:[0])
+ ].
+ anRBVariableNode parent scope addVariable: binding.
+ super visitArgument: anRBVariableNode.
+
+ "Created: / 25-08-2015 / 22:51:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 02-09-2015 / 08:58:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!TSemanticAnalyser class methodsFor:'documentation'!
+
+version
+ ^ 'Path: jv/tea/compiler/TSemanticAnalyzer.st, Version: 1.0, User: jv, Time: 2015-08-31T13:47:58.729+01'
+!
+
+version_HG
+ ^ 'Path: jv/tea/compiler/TSemanticAnalyzer.st, Version: 1.0, User: jv, Time: 2015-08-31T13:47:58.729+01'
+! !
+
--- a/compiler/TSemanticAnalysisPass.st Mon Aug 31 18:37:31 2015 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,104 +0,0 @@
-"{ Package: 'jv:tea/compiler' }"
-
-"{ NameSpace: Smalltalk }"
-
-TCompilerPass subclass:#TSemanticAnalysisPass
- instanceVariableNames:''
- classVariableNames:''
- poolDictionaries:''
- category:'Languages-Tea-Compiler'
-!
-
-!TSemanticAnalysisPass class methodsFor:'documentation'!
-
-documentation
-"
- This pass analyzes the tree, creates scopes and
- initializes variable bindings.
-
- [author:]
- Jan Vrany <jan.vrany@fit.cvut.cz>
-
- [instance variables:]
-
- [class variables:]
-
- [see also:]
-
-"
-! !
-
-!TSemanticAnalysisPass methodsFor:'visiting'!
-
-visitArgument: anRBVariableNode
- | binding |
-
- anRBVariableNode parent isSequence ifTrue:[
- binding := TLocalBinding type:anRBVariableNode typeSpec asType
- name:anRBVariableNode name.
- ] ifFalse:[
- binding := TArgumentBinding type:anRBVariableNode typeSpec asType
- name:anRBVariableNode name.
- ].
- anRBVariableNode parent scope addVariable: binding.
- super visitArgument: anRBVariableNode.
-
- "Created: / 25-08-2015 / 22:51:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!TSemanticAnalysisPass methodsFor:'visitor-double dispatching'!
-
-acceptBlockNode: aBlockNode
- aBlockNode scope: (aBlockNode parent scope subScope: aBlockNode).
- super acceptBlockNode: aBlockNode
-
- "Created: / 25-08-2015 / 22:30:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-acceptClassDefinition: aTClassDefinition
- aTClassDefinition binding: (TClassBinding name: aTClassDefinition name).
- super acceptClassDefinition: aTClassDefinition
-
- "Created: / 31-08-2015 / 11:46:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-acceptLiteralNode: aRBLiteralNode
- aRBLiteralNode binding: (TConstantBinding value: aRBLiteralNode value).
- super acceptLiteralNode: aRBLiteralNode
-
- "Created: / 25-08-2015 / 23:17:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-acceptMetaclassDefinition: aTClassDefinition
- aTClassDefinition binding: (TClassBinding name: aTClassDefinition name).
- super acceptMetaclassDefinition: aTClassDefinition
-
- "Created: / 31-08-2015 / 11:47:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-acceptMethodNode: aMethodNode
- aMethodNode binding: (TMethodBinding class: currentClass binding selector: aMethodNode selector).
- aMethodNode scope: (TScope node: aMethodNode).
- super acceptMethodNode: aMethodNode
-
- "Created: / 25-08-2015 / 22:29:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 31-08-2015 / 11:47:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-acceptVariableNode: aVariableNode
- aVariableNode binding: (aVariableNode scope lookupVariable: aVariableNode name).
- super acceptVariableNode: aVariableNode
-
- "Created: / 25-08-2015 / 23:00:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!TSemanticAnalysisPass class methodsFor:'documentation'!
-
-version
- ^ 'Path: jv/tea/compiler/TSemanticAnalyzer.st, Version: 1.0, User: jv, Time: 2015-08-31T13:47:58.729+01'
-!
-
-version_HG
- ^ 'Path: jv/tea/compiler/TSemanticAnalyzer.st, Version: 1.0, User: jv, Time: 2015-08-31T13:47:58.729+01'
-! !
-
--- a/compiler/TSimpleType.st Mon Aug 31 18:37:31 2015 +0100
+++ b/compiler/TSimpleType.st Wed Sep 02 09:18:00 2015 +0100
@@ -58,12 +58,13 @@
name = 'iptr' ifTrue:[
^ LLVMType intptr
].
- name = 'SmallInteger' ifTrue:[
+ name = 'tSmallInteger' ifTrue:[
^ LLVMType intptr
].
self notYetImplemented
"Created: / 31-08-2015 / 09:06:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 01-09-2015 / 21:53:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!TSimpleType methodsFor:'initialization'!
--- a/compiler/TTypeAnalysisPass.st Mon Aug 31 18:37:31 2015 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-"{ Package: 'jv:tea/compiler' }"
-
-"{ NameSpace: Smalltalk }"
-
-TCompilerPass subclass:#TTypeAnalysisPass
- instanceVariableNames:''
- classVariableNames:''
- poolDictionaries:''
- category:'Languages-Tea-Compiler'
-!
-
-!TTypeAnalysisPass methodsFor:'visiting'!
-
-visitArgument: anRBVariableNode
- super visitArgument: anRBVariableNode.
- anRBVariableNode binding type: anRBVariableNode typeSpec asType
-
- "Created: / 31-08-2015 / 11:51:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!TTypeAnalysisPass methodsFor:'visitor-double dispatching'!
-
-acceptMethodNode: aMethodNode
- super acceptMethodNode: aMethodNode.
- aMethodNode binding type:
- (TMethodType receiver: currentMethod binding mclass type
- parameters: (aMethodNode arguments collect: [ :arg | arg binding type ])
- returning: aMethodNode returnTypeSpec asType)
-
- "Created: / 31-08-2015 / 12:13:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/compiler/TTypechecker.st Wed Sep 02 09:18:00 2015 +0100
@@ -0,0 +1,32 @@
+"{ Package: 'jv:tea/compiler' }"
+
+"{ NameSpace: Smalltalk }"
+
+TCompilerPass subclass:#TTypechecker
+ instanceVariableNames:''
+ classVariableNames:''
+ poolDictionaries:''
+ category:'Languages-Tea-Compiler'
+!
+
+!TTypechecker methodsFor:'visiting'!
+
+visitArgument: anRBVariableNode
+ super visitArgument: anRBVariableNode.
+ anRBVariableNode binding type: anRBVariableNode typeSpec asType
+
+ "Created: / 31-08-2015 / 11:51:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!TTypechecker methodsFor:'visitor-double dispatching'!
+
+acceptMethodNode: aMethodNode
+ super acceptMethodNode: aMethodNode.
+ aMethodNode binding type:
+ (TMethodType receiver: currentMethod binding mclass type
+ parameters: (aMethodNode arguments collect: [ :arg | arg binding type ])
+ returning: aMethodNode returnTypeSpec asType)
+
+ "Created: / 31-08-2015 / 12:13:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
--- a/compiler/TUniverseDefinition.st Mon Aug 31 18:37:31 2015 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-"{ Package: 'jv:tea/compiler' }"
-
-"{ NameSpace: Smalltalk }"
-
-RGNamespace subclass:#TUniverseDefinition
- instanceVariableNames:''
- classVariableNames:''
- poolDictionaries:''
- category:'Languages-Tea-Compiler-Model'
-!
-
-!TUniverseDefinition methodsFor:'adding elements'!
-
-addMethod: method
- | mclassName mclassIsMeta mclass |
-
- mclassName := method className.
- (mclassName endsWith: ' class') ifTrue:[
- mclassName := mclassName copyTo: mclassName size - 6.
- mclassIsMeta := true.
- ] ifFalse:[
- mclassIsMeta := false.
- ].
- mclass := self classNamed: mclassName.
- mclassIsMeta ifTrue:[
- mclass := mclass theMetaclass.
- ].
- mclass addMethod: method.
-
- "Created: / 31-08-2015 / 17:10:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
--- a/compiler/TVariableBinding.st Mon Aug 31 18:37:31 2015 +0100
+++ b/compiler/TVariableBinding.st Wed Sep 02 09:18:00 2015 +0100
@@ -33,6 +33,13 @@
^ name
! !
+!TVariableBinding methodsFor:'conversion'!
+
+asLLVMValueInModule: aLLVMModule
+
+ "Created: / 02-09-2015 / 08:34:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
!TVariableBinding methodsFor:'initialization'!
initializeWithName:aString
--- a/compiler/abbrev.stc Mon Aug 31 18:37:31 2015 +0100
+++ b/compiler/abbrev.stc Wed Sep 02 09:18:00 2015 +0100
@@ -7,23 +7,28 @@
TCompilerContext TCompilerContext jv:tea/compiler 'Languages-Tea-Compiler' 0
TCompilerTests TCompilerTests jv:tea/compiler 'Languages-Tea-Compiler-Tests' 1
TFormatter TFormatter jv:tea/compiler 'Languages-Tea-Compiler-AST' 0
+TInlineAssemblyBeginToken TInlineAssemblyBeginToken jv:tea/compiler 'Languages-Tea-Compiler-AST' 0
+TInlineAssemblyEndToken TInlineAssemblyEndToken jv:tea/compiler 'Languages-Tea-Compiler-AST' 0
+TInlineAssemblyNode TInlineAssemblyNode jv:tea/compiler 'Languages-Tea-Compiler-AST' 0
TMetaDefinition TMetaDefinition jv:tea/compiler 'Languages-Tea-Compiler-Model' 0
TMethodDefinition TMethodDefinition jv:tea/compiler 'Languages-Tea-Compiler-Model' 0
-TMethodDefinitionTests TMethodDefinitionTests jv:tea/compiler 'Languages-Tea-Compiler-Model-Tests' 1
+TNamespaceDefinition TNamespaceDefinition jv:tea/compiler 'Languages-Tea-Compiler-Model' 0
TParser TParser jv:tea/compiler 'Languages-Tea-Compiler-AST' 0
+TParserTests TParserTests jv:tea/compiler 'Languages-Tea-Compiler-AST-Tests' 1
TProgramNodeVisitor TProgramNodeVisitor jv:tea/compiler 'Languages-Tea-Compiler-AST' 0
+TScanner TScanner jv:tea/compiler 'Languages-Tea-Compiler-AST' 0
TScope TScope jv:tea/compiler 'Languages-Tea-Compiler-Bindings' 0
+TSemanticAnalysisPassTests TSemanticAnalysisPassTests jv:tea/compiler 'Languages-Tea-Compiler-Tests' 1
TSourceReader TSourceReader jv:tea/compiler 'Languages-Tea-Compiler-Model' 0
-TSourceReaderTests TSourceReaderTests jv:tea/compiler 'Languages-Tea-Compiler-Model-Tests' 1
TType TType jv:tea/compiler 'Languages-Tea-Compiler-Types' 0
TTypeNode TTypeNode jv:tea/compiler 'Languages-Tea-Compiler-AST' 0
TTypeSpecNode TTypeSpecNode jv:tea/compiler 'Languages-Tea-Compiler-AST' 0
-TUniverseDefinition TUniverseDefinition jv:tea/compiler 'Languages-Tea-Compiler-Model' 0
jv_tea_compiler jv_tea_compiler jv:tea/compiler '* Projects & Packages *' 3
TClassBinding TClassBinding jv:tea/compiler 'Languages-Tea-Compiler-Bindings' 0
TCompilerPass TCompilerPass jv:tea/compiler 'Languages-Tea-Compiler' 0
TFunctionBinding TFunctionBinding jv:tea/compiler 'Languages-Tea-Compiler-Bindings' 0
TFunctionType TFunctionType jv:tea/compiler 'Languages-Tea-Compiler-Types' 0
+TNamespaceBinding TNamespaceBinding jv:tea/compiler 'Languages-Tea-Compiler-Bindings' 0
TSimpleType TSimpleType jv:tea/compiler 'Languages-Tea-Compiler-Types' 0
TSimpleTypeNode TSimpleTypeNode jv:tea/compiler 'Languages-Tea-Compiler-AST' 0
TUnionType TUnionType jv:tea/compiler 'Languages-Tea-Compiler-Types' 0
@@ -31,14 +36,14 @@
TValueBinding TValueBinding jv:tea/compiler 'Languages-Tea-Compiler-Bindings' 0
TBlockBinding TBlockBinding jv:tea/compiler 'Languages-Tea-Compiler-Bindings' 0
TBlockType TBlockType jv:tea/compiler 'Languages-Tea-Compiler-Types' 0
+TCodeGenerator TCodeGenerator jv:tea/compiler 'Languages-Tea-Compiler' 0
TConstantBinding TConstantBinding jv:tea/compiler 'Languages-Tea-Compiler-Bindings' 0
-TLLVMIREmitPass TLLVMIREmitPass jv:tea/compiler 'Languages-Tea-Compiler' 0
TMethodBinding TMethodBinding jv:tea/compiler 'Languages-Tea-Compiler-Bindings' 0
TMethodType TMethodType jv:tea/compiler 'Languages-Tea-Compiler-Types' 0
-TSemanticAnalysisPass TSemanticAnalysisPass jv:tea/compiler 'Languages-Tea-Compiler' 0
-TTypeAnalysisPass TTypeAnalysisPass jv:tea/compiler 'Languages-Tea-Compiler' 0
+TSemanticAnalyser TSemanticAnalyser jv:tea/compiler 'Languages-Tea-Compiler' 0
+TTypechecker TTypechecker jv:tea/compiler 'Languages-Tea-Compiler' 0
TVariableBinding TVariableBinding jv:tea/compiler 'Languages-Tea-Compiler-Bindings' 0
TArgumentBinding TArgumentBinding jv:tea/compiler 'Languages-Tea-Compiler-Bindings' 0
TLocalBinding TLocalBinding jv:tea/compiler 'Languages-Tea-Compiler-Bindings' 0
-TParserTests TParserTests jv:tea/compiler 'Languages-Tea-Compiler-AST-Tests' 1
-TSemanticAnalysisPassTests TSemanticAnalysisPassTests jv:tea/compiler 'Languages-Tea-Compiler-Tests' 1
+TMethodDefinitionTests TMethodDefinitionTests jv:tea/compiler 'Languages-Tea-Compiler-Model-Tests' 1
+TSourceReaderTests TSourceReaderTests jv:tea/compiler 'Languages-Tea-Compiler-Model-Tests' 1
--- a/compiler/bc.mak Mon Aug 31 18:37:31 2015 +0100
+++ b/compiler/bc.mak Wed Sep 02 09:18:00 2015 +0100
@@ -79,21 +79,26 @@
$(OUTDIR)TCompiler.$(O) TCompiler.$(H): TCompiler.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)TCompilerContext.$(O) TCompilerContext.$(H): TCompilerContext.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)TFormatter.$(O) TFormatter.$(H): TFormatter.st $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBFormatter.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBProgramNodeVisitor.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)TInlineAssemblyBeginToken.$(O) TInlineAssemblyBeginToken.$(H): TInlineAssemblyBeginToken.st $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBToken.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)TInlineAssemblyEndToken.$(O) TInlineAssemblyEndToken.$(H): TInlineAssemblyEndToken.st $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBToken.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)TInlineAssemblyNode.$(O) TInlineAssemblyNode.$(H): TInlineAssemblyNode.st $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBBlockNode.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBProgramNode.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBStatementNode.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBValueNode.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)TMetaDefinition.$(O) TMetaDefinition.$(H): TMetaDefinition.st $(INCLUDE_TOP)\stx\goodies\ring\RGBehaviorDefinition.$(H) $(INCLUDE_TOP)\stx\goodies\ring\RGClassDescriptionDefinition.$(H) $(INCLUDE_TOP)\stx\goodies\ring\RGDefinition.$(H) $(INCLUDE_TOP)\stx\goodies\ring\RGGlobalDefinition.$(H) $(INCLUDE_TOP)\stx\goodies\ring\RGMetaclassDefinition.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)TMethodDefinition.$(O) TMethodDefinition.$(H): TMethodDefinition.st $(INCLUDE_TOP)\stx\goodies\ring\RGDefinition.$(H) $(INCLUDE_TOP)\stx\goodies\ring\RGElementDefinition.$(H) $(INCLUDE_TOP)\stx\goodies\ring\RGMethodDefinition.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)TNamespaceDefinition.$(O) TNamespaceDefinition.$(H): TNamespaceDefinition.st $(INCLUDE_TOP)\stx\goodies\ring\RGAbstractContainer.$(H) $(INCLUDE_TOP)\stx\goodies\ring\RGContainer.$(H) $(INCLUDE_TOP)\stx\goodies\ring\RGDefinition.$(H) $(INCLUDE_TOP)\stx\goodies\ring\RGNamespace.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)TParser.$(O) TParser.$(H): TParser.st $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBParser.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)TProgramNodeVisitor.$(O) TProgramNodeVisitor.$(H): TProgramNodeVisitor.st $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBProgramNodeVisitor.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)TScanner.$(O) TScanner.$(H): TScanner.st $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBScanner.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\Stream.$(H) $(STCHDR)
$(OUTDIR)TScope.$(O) TScope.$(H): TScope.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)TSourceReader.$(O) TSourceReader.$(H): TSourceReader.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)TType.$(O) TType.$(H): TType.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)TTypeNode.$(O) TTypeNode.$(H): TTypeNode.st $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBProgramNode.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)TTypeSpecNode.$(O) TTypeSpecNode.$(H): TTypeSpecNode.st $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBProgramNode.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
-$(OUTDIR)TUniverseDefinition.$(O) TUniverseDefinition.$(H): TUniverseDefinition.st $(INCLUDE_TOP)\stx\goodies\ring\RGAbstractContainer.$(H) $(INCLUDE_TOP)\stx\goodies\ring\RGContainer.$(H) $(INCLUDE_TOP)\stx\goodies\ring\RGDefinition.$(H) $(INCLUDE_TOP)\stx\goodies\ring\RGNamespace.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)jv_tea_compiler.$(O) jv_tea_compiler.$(H): jv_tea_compiler.st $(INCLUDE_TOP)\stx\libbasic\LibraryDefinition.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\ProjectDefinition.$(H) $(STCHDR)
$(OUTDIR)TClassBinding.$(O) TClassBinding.$(H): TClassBinding.st $(INCLUDE_TOP)\jv\tea\compiler\TBinding.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)TCompilerPass.$(O) TCompilerPass.$(H): TCompilerPass.st $(INCLUDE_TOP)\jv\tea\compiler\TProgramNodeVisitor.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBProgramNodeVisitor.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)TFunctionBinding.$(O) TFunctionBinding.$(H): TFunctionBinding.st $(INCLUDE_TOP)\jv\tea\compiler\TBinding.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)TFunctionType.$(O) TFunctionType.$(H): TFunctionType.st $(INCLUDE_TOP)\jv\tea\compiler\TType.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)TNamespaceBinding.$(O) TNamespaceBinding.$(H): TNamespaceBinding.st $(INCLUDE_TOP)\jv\tea\compiler\TBinding.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)TSimpleType.$(O) TSimpleType.$(H): TSimpleType.st $(INCLUDE_TOP)\jv\tea\compiler\TType.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)TSimpleTypeNode.$(O) TSimpleTypeNode.$(H): TSimpleTypeNode.st $(INCLUDE_TOP)\jv\tea\compiler\TTypeNode.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBProgramNode.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)TUnionType.$(O) TUnionType.$(H): TUnionType.st $(INCLUDE_TOP)\jv\tea\compiler\TType.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
@@ -101,16 +106,16 @@
$(OUTDIR)TValueBinding.$(O) TValueBinding.$(H): TValueBinding.st $(INCLUDE_TOP)\jv\tea\compiler\TBinding.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)TBlockBinding.$(O) TBlockBinding.$(H): TBlockBinding.st $(INCLUDE_TOP)\jv\tea\compiler\TBinding.$(H) $(INCLUDE_TOP)\jv\tea\compiler\TFunctionBinding.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)TBlockType.$(O) TBlockType.$(H): TBlockType.st $(INCLUDE_TOP)\jv\tea\compiler\TFunctionType.$(H) $(INCLUDE_TOP)\jv\tea\compiler\TType.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)TCodeGenerator.$(O) TCodeGenerator.$(H): TCodeGenerator.st $(INCLUDE_TOP)\jv\tea\compiler\TCompilerPass.$(H) $(INCLUDE_TOP)\jv\tea\compiler\TProgramNodeVisitor.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBProgramNodeVisitor.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)TConstantBinding.$(O) TConstantBinding.$(H): TConstantBinding.st $(INCLUDE_TOP)\jv\tea\compiler\TBinding.$(H) $(INCLUDE_TOP)\jv\tea\compiler\TValueBinding.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
-$(OUTDIR)TLLVMIREmitPass.$(O) TLLVMIREmitPass.$(H): TLLVMIREmitPass.st $(INCLUDE_TOP)\jv\tea\compiler\TCompilerPass.$(H) $(INCLUDE_TOP)\jv\tea\compiler\TProgramNodeVisitor.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBProgramNodeVisitor.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)TMethodBinding.$(O) TMethodBinding.$(H): TMethodBinding.st $(INCLUDE_TOP)\jv\tea\compiler\TBinding.$(H) $(INCLUDE_TOP)\jv\tea\compiler\TFunctionBinding.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)TMethodType.$(O) TMethodType.$(H): TMethodType.st $(INCLUDE_TOP)\jv\tea\compiler\TFunctionType.$(H) $(INCLUDE_TOP)\jv\tea\compiler\TType.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
-$(OUTDIR)TSemanticAnalysisPass.$(O) TSemanticAnalysisPass.$(H): TSemanticAnalysisPass.st $(INCLUDE_TOP)\jv\tea\compiler\TCompilerPass.$(H) $(INCLUDE_TOP)\jv\tea\compiler\TProgramNodeVisitor.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBProgramNodeVisitor.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
-$(OUTDIR)TTypeAnalysisPass.$(O) TTypeAnalysisPass.$(H): TTypeAnalysisPass.st $(INCLUDE_TOP)\jv\tea\compiler\TCompilerPass.$(H) $(INCLUDE_TOP)\jv\tea\compiler\TProgramNodeVisitor.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBProgramNodeVisitor.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)TSemanticAnalyser.$(O) TSemanticAnalyser.$(H): TSemanticAnalyser.st $(INCLUDE_TOP)\jv\tea\compiler\TCompilerPass.$(H) $(INCLUDE_TOP)\jv\tea\compiler\TProgramNodeVisitor.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBProgramNodeVisitor.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)TTypechecker.$(O) TTypechecker.$(H): TTypechecker.st $(INCLUDE_TOP)\jv\tea\compiler\TCompilerPass.$(H) $(INCLUDE_TOP)\jv\tea\compiler\TProgramNodeVisitor.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBProgramNodeVisitor.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)TVariableBinding.$(O) TVariableBinding.$(H): TVariableBinding.st $(INCLUDE_TOP)\jv\tea\compiler\TBinding.$(H) $(INCLUDE_TOP)\jv\tea\compiler\TValueBinding.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)TArgumentBinding.$(O) TArgumentBinding.$(H): TArgumentBinding.st $(INCLUDE_TOP)\jv\tea\compiler\TBinding.$(H) $(INCLUDE_TOP)\jv\tea\compiler\TValueBinding.$(H) $(INCLUDE_TOP)\jv\tea\compiler\TVariableBinding.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)TLocalBinding.$(O) TLocalBinding.$(H): TLocalBinding.st $(INCLUDE_TOP)\jv\tea\compiler\TBinding.$(H) $(INCLUDE_TOP)\jv\tea\compiler\TValueBinding.$(H) $(INCLUDE_TOP)\jv\tea\compiler\TVariableBinding.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
-$(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBBlockNode.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBMethodNode.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBProgramNode.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBReturnNode.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBStatementNode.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBValueNode.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBVariableNode.$(H) $(INCLUDE_TOP)\stx\goodies\ring\RGBehaviorDefinition.$(H) $(INCLUDE_TOP)\stx\goodies\ring\RGClassDefinition.$(H) $(INCLUDE_TOP)\stx\goodies\ring\RGClassDescriptionDefinition.$(H) $(INCLUDE_TOP)\stx\goodies\ring\RGDefinition.$(H) $(INCLUDE_TOP)\stx\goodies\ring\RGElementDefinition.$(H) $(INCLUDE_TOP)\stx\goodies\ring\RGGlobalDefinition.$(H) $(INCLUDE_TOP)\stx\goodies\ring\RGMetaclassDefinition.$(H) $(INCLUDE_TOP)\stx\goodies\ring\RGMethodDefinition.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBBlockNode.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBMethodNode.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBProgramNode.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBReturnNode.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBStatementNode.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBToken.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBValueNode.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBVariableNode.$(H) $(INCLUDE_TOP)\stx\goodies\ring\RGBehaviorDefinition.$(H) $(INCLUDE_TOP)\stx\goodies\ring\RGClassDefinition.$(H) $(INCLUDE_TOP)\stx\goodies\ring\RGClassDescriptionDefinition.$(H) $(INCLUDE_TOP)\stx\goodies\ring\RGDefinition.$(H) $(INCLUDE_TOP)\stx\goodies\ring\RGElementDefinition.$(H) $(INCLUDE_TOP)\stx\goodies\ring\RGGlobalDefinition.$(H) $(INCLUDE_TOP)\stx\goodies\ring\RGMetaclassDefinition.$(H) $(INCLUDE_TOP)\stx\goodies\ring\RGMethodDefinition.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
# ENDMAKEDEPEND --- do not remove this line
--- a/compiler/extensions.st Mon Aug 31 18:37:31 2015 +0100
+++ b/compiler/extensions.st Wed Sep 02 09:18:00 2015 +0100
@@ -90,6 +90,14 @@
"Created: / 25-08-2015 / 22:15:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
+!RBProgramNode methodsFor:'testing'!
+
+isInlineAssembly
+ ^false
+
+ "Created: / 02-09-2015 / 06:30:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
!RBProgramNode methodsFor:'accessing'!
scope
@@ -114,6 +122,22 @@
"Created: / 25-08-2015 / 23:39:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
+!RBToken methodsFor:'testing'!
+
+isTInlineAssemblyBegin
+ ^ false
+
+ "Created: / 02-09-2015 / 06:19:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!RBToken methodsFor:'testing'!
+
+isTInlineAssemblyEnd
+ ^ false
+
+ "Created: / 02-09-2015 / 06:19:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
!RBVariableNode methodsFor:'accessing'!
typeSpec
--- a/compiler/jv_tea_compiler.st Mon Aug 31 18:37:31 2015 +0100
+++ b/compiler/jv_tea_compiler.st Wed Sep 02 09:18:00 2015 +0100
@@ -31,9 +31,9 @@
^ #(
#'stx:goodies/refactoryBrowser/parser' "RBBlockNode - extended"
- #'stx:goodies/ring' "RGAbstractContainer - superclass of TUniverseDefinition"
+ #'stx:goodies/ring' "RGAbstractContainer - superclass of TNamespaceDefinition"
#'stx:goodies/sunit' "TestAsserter - superclass of TCompilerTests"
- #'stx:libbasic' "Autoload - superclass of TParserTests"
+ #'stx:libbasic' "Autoload - superclass of TMethodDefinitionTests"
)
!
@@ -48,7 +48,7 @@
by searching all classes (and their packages) which are referenced by my classes."
^ #(
- #'jv:llvm_s' "LLVMConstant - referenced by TConstantBinding>>asLLVMValueInModule:"
+ #'jv:llvm_s' "LLVMModule - referenced by TCompilerContext>>module"
#'stx:libbasic3' "ChangeSet - referenced by TSourceReader>>read:"
)
!
@@ -79,23 +79,28 @@
TCompilerContext
(TCompilerTests autoload)
TFormatter
+ TInlineAssemblyBeginToken
+ TInlineAssemblyEndToken
+ TInlineAssemblyNode
TMetaDefinition
TMethodDefinition
- (TMethodDefinitionTests autoload)
+ TNamespaceDefinition
TParser
+ (TParserTests autoload)
TProgramNodeVisitor
+ TScanner
TScope
+ (TSemanticAnalysisPassTests autoload)
TSourceReader
- (TSourceReaderTests autoload)
TType
TTypeNode
TTypeSpecNode
- TUniverseDefinition
#'jv_tea_compiler'
TClassBinding
TCompilerPass
TFunctionBinding
TFunctionType
+ TNamespaceBinding
TSimpleType
TSimpleTypeNode
TUnionType
@@ -103,17 +108,17 @@
TValueBinding
TBlockBinding
TBlockType
+ TCodeGenerator
TConstantBinding
- TLLVMIREmitPass
TMethodBinding
TMethodType
- TSemanticAnalysisPass
- TTypeAnalysisPass
+ TSemanticAnalyser
+ TTypechecker
TVariableBinding
TArgumentBinding
TLocalBinding
- (TParserTests autoload)
- (TSemanticAnalysisPassTests autoload)
+ (TMethodDefinitionTests autoload)
+ (TSourceReaderTests autoload)
)
!
@@ -140,6 +145,9 @@
RGClassDefinition acceptVisitor:
RGMetaclassDefinition acceptVisitor:
RGMethodDefinition acceptVisitor:
+ RBProgramNode isInlineAssembly
+ RBToken isTInlineAssemblyBegin
+ RBToken isTInlineAssemblyEnd
)
! !
--- a/compiler/libInit.cc Mon Aug 31 18:37:31 2015 +0100
+++ b/compiler/libInit.cc Wed Sep 02 09:18:00 2015 +0100
@@ -32,21 +32,26 @@
_TCompiler_Init(pass,__pRT__,snd);
_TCompilerContext_Init(pass,__pRT__,snd);
_TFormatter_Init(pass,__pRT__,snd);
+_TInlineAssemblyBeginToken_Init(pass,__pRT__,snd);
+_TInlineAssemblyEndToken_Init(pass,__pRT__,snd);
+_TInlineAssemblyNode_Init(pass,__pRT__,snd);
_TMetaDefinition_Init(pass,__pRT__,snd);
_TMethodDefinition_Init(pass,__pRT__,snd);
+_TNamespaceDefinition_Init(pass,__pRT__,snd);
_TParser_Init(pass,__pRT__,snd);
_TProgramNodeVisitor_Init(pass,__pRT__,snd);
+_TScanner_Init(pass,__pRT__,snd);
_TScope_Init(pass,__pRT__,snd);
_TSourceReader_Init(pass,__pRT__,snd);
_TType_Init(pass,__pRT__,snd);
_TTypeNode_Init(pass,__pRT__,snd);
_TTypeSpecNode_Init(pass,__pRT__,snd);
-_TUniverseDefinition_Init(pass,__pRT__,snd);
_jv_137tea_137compiler_Init(pass,__pRT__,snd);
_TClassBinding_Init(pass,__pRT__,snd);
_TCompilerPass_Init(pass,__pRT__,snd);
_TFunctionBinding_Init(pass,__pRT__,snd);
_TFunctionType_Init(pass,__pRT__,snd);
+_TNamespaceBinding_Init(pass,__pRT__,snd);
_TSimpleType_Init(pass,__pRT__,snd);
_TSimpleTypeNode_Init(pass,__pRT__,snd);
_TUnionType_Init(pass,__pRT__,snd);
@@ -54,12 +59,12 @@
_TValueBinding_Init(pass,__pRT__,snd);
_TBlockBinding_Init(pass,__pRT__,snd);
_TBlockType_Init(pass,__pRT__,snd);
+_TCodeGenerator_Init(pass,__pRT__,snd);
_TConstantBinding_Init(pass,__pRT__,snd);
-_TLLVMIREmitPass_Init(pass,__pRT__,snd);
_TMethodBinding_Init(pass,__pRT__,snd);
_TMethodType_Init(pass,__pRT__,snd);
-_TSemanticAnalysisPass_Init(pass,__pRT__,snd);
-_TTypeAnalysisPass_Init(pass,__pRT__,snd);
+_TSemanticAnalyser_Init(pass,__pRT__,snd);
+_TTypechecker_Init(pass,__pRT__,snd);
_TVariableBinding_Init(pass,__pRT__,snd);
_TArgumentBinding_Init(pass,__pRT__,snd);
_TLocalBinding_Init(pass,__pRT__,snd);