compiler/jv_tea_compiler.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Fri, 25 Sep 2015 21:58:10 +0100
changeset 17 ee807ff2f897
parent 16 17a2d1d9f205
permissions -rw-r--r--
Removed dependency on SUnit

"
    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 }"

LibraryDefinition subclass:#jv_tea_compiler
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'* Projects & Packages *'
!

!jv_tea_compiler 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.
"
! !

!jv_tea_compiler class methodsFor:'description'!

excludedFromPreRequisites
    "list packages which are to be explicitely excluded from the automatic constructed
     prerequisites list. If empty, everything that is found along the inheritance of any of
     my classes is considered to be a prerequisite package."

    ^ #(
    )
!

mandatoryPreRequisites
    "list packages which are mandatory as a prerequisite.
     This are packages containing superclasses of my classes and classes which
     are extended by myself.
     They are mandatory, because we need these packages as a prerequisite for loading and compiling.
     This method is generated automatically,
     by searching along the inheritance chain of all of my classes."

    ^ #(
        #'jv:llvm_s'    "LLVMAtomicOrdering - shared pool used by TLLVMCodeGenerator"
        #'stx:goodies/refactoryBrowser/parser'    "RBAssignmentNode - extended"
        #'stx:goodies/ring'    "RGAbstractContainer - superclass of TCompilationUnitDefinition"
        #'stx:libbasic'    "Error - superclass of TCompilerError"
    )
!

referencedPreRequisites
    "list packages which are a prerequisite, because they contain
     classes which are referenced by my classes.
     We do not need these packages as a prerequisite for compiling or loading,
     however, a class from it may be referenced during execution and having it
     unloaded then may lead to a runtime doesNotUnderstand error, unless the caller
     includes explicit checks for the package being present.
     This method is generated automatically,
     by searching all classes (and their packages) which are referenced by my classes."

    ^ #(
        #'stx:libbasic3'    "ChangeSet - referenced by TSourceReader>>read:"
    )
!

subProjects
    "list packages which are known as subprojects.
     The generated makefile will enter those and make there as well.
     However: they are not forced to be loaded when a package is loaded;
     for those, redefine requiredPrerequisites."

    ^ #(
    )
! !

!jv_tea_compiler class methodsFor:'description - contents'!

classNamesAndAttributes
    "lists the classes which are to be included in the project.
     Each entry in the list may be: a single class-name (symbol),
     or an array-literal consisting of class name and attributes.
     Attributes are: #autoload or #<os> where os is one of win32, unix,..."

    ^ #(
        "<className> or (<className> attributes...) in load order"
        TClassDefinition
        TCompilationUnitDefinition
        TCompiler
        TCompilerError
        TEnvironmentProvider
        TFormatter
        TMetaDefinition
        TMethodDefinition
        TNamespaceDefinition
        TObjectWithProperties
        TParser
        TProgramNodeVisitor
        TSourceReader
        TSpecialFormNode
        TTypeNode
        TTypeSpecNode
        #'jv_tea_compiler'
        TBinding
        TCompilerContext
        TCompilerOptions
        TCompilerPass
        TEnvironment
        TFilesystemProvider
        TScope
        TSimpleTypeNode
        TType
        TAutomaticType
        TBlockType
        TClassBinding
        TFunctionBinding
        TLLVMCodeGenerator
        TNamespaceBinding
        TSemanticAnalyser
        TSimpleType
        TTypechecker
        TValueBinding
        TBlockBinding
        TConstantBinding
        TMethodBinding
        TVariableBinding
        TArgumentBinding
        TLocalBinding
        (TCompilerExamples autoload)
        (TMethodDefinitionTests autoload)
        (TParserTests autoload)
        (TSemanticAnalyserTests autoload)
        (TSourceReaderTests autoload)
        (TTypecheckerTests autoload)
    )
!

extensionMethodNames
    "list class/selector pairs of extensions.
     A correponding method with real names must be present in my concrete subclasses"

    ^ #(
        RBBlockNode returnTypeSpec
        RBBlockNode returnTypeSpec:
        RBMethodNode returnTypeSpec
        RBMethodNode returnTypeSpec:
        RBVariableNode typeSpec
        RBVariableNode typeSpec:
        RBBlockNode scope
        RBBlockNode scope:
        RBMethodNode scope
        RBMethodNode scope:
        RBProgramNode binding
        RBProgramNode binding:
        RBProgramNode scope
        RBReturnNode binding
        RBReturnNode binding:
        RGClassDefinition acceptVisitor:
        RGMetaclassDefinition acceptVisitor:
        RGMethodDefinition acceptVisitor:
        RBProgramNode isInlineAssembly
        RBToken isTInlineAssemblyBegin
        RBToken isTInlineAssemblyEnd
        RGDefinition isCompilationUnit
        RBProgramNode isSpecialFormNode
        RBAssignmentNode binding
        RBAssignmentNode binding:
        RBBlockNode parameterTypes
        RBBlockNode returnType
        RBMethodNode parameterTypes
        RBMethodNode returnType
        RBVariableNode type
    )
! !

!jv_tea_compiler class methodsFor:'description - project information'!

companyName
    "Returns a company string which will appear in <lib>.rc.
     Under win32, this is placed into the dlls file-info"

    ^ 'Jan Vrany'

    "Modified: / 25-09-2015 / 03:42:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

description
    "Returns a description string which will appear in nt.def / bc.def"

    ^ 'Tea Language Compiler Library'

    "Modified: / 25-09-2015 / 03:43:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

legalCopyright
    "Returns a copyright string which will appear in <lib>.rc.
     Under win32, this is placed into the dlls file-info"

    ^ '(C) 2015 Jan Vrany'

    "Modified: / 25-09-2015 / 03:43:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

productName
    "Returns a product name which will appear in <lib>.rc.
     Under win32, this is placed into the dlls file-info.
     This method is usually redefined in a concrete application definition"

    ^ 'TeaCompilerLibrary'

    "Modified: / 25-09-2015 / 03:43:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!jv_tea_compiler class methodsFor:'documentation'!

version_HG
    ^ '$Changeset: <not expanded> $'
! !