Changeset 820 in dev


Ignore:
Timestamp:
Aug 7, 2011, 4:30:08 PM (13 years ago)
Author:
イグトランス (egtra)
Message:

Typeクラスを単体テスト可能な状態へ

Location:
branches/egtra/ab5.0/abdev
Files:
2 added
28 edited

Legend:

Unmodified
Added
Removed
  • branches/egtra/ab5.0/abdev/BasicCompiler_Common/BasicCompiler.cpp

    r808 r820  
    325325        //生成するファイルの相対パスを取得
    326326        char relationalPath[MAX_PATH];
    327         lstrcpy( relationalPath, program.GetOutputFilePath().c_str() );
     327        strcpy( relationalPath, program.GetOutputFilePath().c_str() );
    328328        GetRelationalPath( relationalPath, BasicCurDir );
    329329
  • branches/egtra/ab5.0/abdev/BasicCompiler_Common/Diagnose.cpp

    r803 r820  
    7878            // 静的メソッド
    7979            foreach( const CMethod *pMethod, objClass.GetStaticMethods() ){
    80                     codeSizeOfClass += pMethod->GetUserProc().GetCodeSize();
     80                codeSizeOfClass += pMethod->GetUserProc().GetCodeSize();
    8181            }
    8282
     
    110110            // 静的メソッド
    111111            foreach( const CMethod *pMethod, objClass.GetStaticMethods() ){
    112                     codeSizeOfClass += pMethod->GetUserProc().GetCodeSize();
     112                codeSizeOfClass += pMethod->GetUserProc().GetCodeSize();
    113113            }
    114114
    115             if( codeSizeOfClass ){
    116                 temporary[0]=0;
    117                 lstrcat( temporary, "------------------------------------------------------------------\n" );
    118                 sprintf( temporary + lstrlen(temporary), "【 %s クラスのコード情報】\n", objClass.GetName().c_str() );
    119                 sprintf( temporary + lstrlen(temporary), "class code size: %d bytes\n", codeSizeOfClass );
    120                 lstrcat( temporary, "------------------------------------------------------------------\n" );
    121                 lstrcat( temporary, "\n" );
     115            if( codeSizeOfClass )
     116            {
     117                sprintf(temporary,
     118                    "------------------------------------------------------------------\n"
     119                    "【 %s クラスのコード情報】\n"
     120                    "class code size: %d bytes\n"
     121                    "------------------------------------------------------------------\n"
     122                    "\n",
     123                    objClass.GetName().c_str(), codeSizeOfClass);
    122124                trace_for_size( temporary );
    123125            }
  • branches/egtra/ab5.0/abdev/BasicCompiler_Common/MakeExe.cpp

    r750 r820  
    2626}
    2727
    28 void AddSourceCode(const char *buffer){
    29     char *temp=(char *)HeapAlloc(hHeap,0,lstrlen(buffer)+8192);
    30     lstrcpy(temp,buffer);
    31 
    32     MakeMiddleCode( temp );
     28void AddSourceCode(const char *buffer)
     29{
     30    std::size_t size = std::strlen(buffer) + 8192;
     31    std::unique_ptr<char[]> temp(new char[size]);
     32    strcpy_s(temp.get(), size, buffer);
     33
     34    MakeMiddleCode(temp.get());
    3335
    3436    //最後尾に貼り付け
    35     compiler.GetObjectModule().GetSource().Addition( temp );
    36 
    37     HeapDefaultFree(temp);
     37    compiler.GetObjectModule().GetSource().Addition(temp.get());
    3838}
    3939
  • branches/egtra/ab5.0/abdev/BasicCompiler_Common/StrOperation.cpp

    r736 r820  
    11#include "stdafx.h"
    22
    3 void KillSpaces(char *str1,char *str2){
     3void KillSpaces(char const *str1,char *str2){
    44    int i,i2,i3,IsStr;
    55    for(i=0,i2=0,IsStr=0;;i++,i2++){
     
    3030    }
    3131}
    32 void KillStringSpaces(char *str){
    33     char *s2;
    34 
    35     extern HANDLE hHeap;
    36     s2=(char *)HeapAlloc(hHeap,0,lstrlen(str)+1);
    37     lstrcpy(s2,str);
    38     KillSpaces(s2,str);
    39     HeapDefaultFree(s2);
    40     return;
     32void KillStringSpaces(char *str)
     33{
     34    std::string s2(str);
     35    KillSpaces(s2.c_str(), str);
    4136}
    4237BOOL RemoveStringQuotes(char *str){
     
    362357    }
    363358}
    364 const std::string &FormatEscapeSequenceStringToDefaultString( const std::string &source )
     359std::string FormatEscapeSequenceStringToDefaultString( const std::string &source )
    365360{
    366361    int maxLength = (int)source.size();
  • branches/egtra/ab5.0/abdev/BasicCompiler_Common/common.h

    r808 r820  
    3535#define MAX_PARMS       64
    3636#define MAX_ARRAYDIM    16
    37 #define MAX_HASH        32761
    3837
    3938
     
    297296
    298297// StrOperation.cpp
    299 void KillSpaces(char *str1,char *str2);
     298void KillSpaces(const char *str1,char *str2);
    300299void KillStringSpaces(char *str);
    301300BOOL RemoveStringQuotes(char *str);
     
    310309char GetEndXXXCommand(char es);
    311310void GetDefaultNameFromES(char es,char *name);
    312 const std::string &FormatEscapeSequenceStringToDefaultString( const std::string &source );
     311std::string FormatEscapeSequenceStringToDefaultString( const std::string &source );
    313312bool IsFileExist(const char *path);
    314313BOOL ShortPathToLongPath(char ShortPath[MAX_PATH],char *LongPath);
     
    364363void SplitGenericClassInstance( const char *fullName, char *className, Jenga::Common::Strings &typeParameters, bool isDefiningClass = false, Jenga::Common::Strings *pTypeParameterBaseClassNames = NULL );
    365364int JumpStatement(const char *source, int &pos);
     365
     366//MakePeHdr.cpp
    366367void MakeExe();
    367368
  • branches/egtra/ab5.0/abdev/BasicCompiler_Common/stdafx.h

    r809 r820  
    3030#include <boost/format.hpp>
    3131#include <boost/optional.hpp>
     32#include <boost/numeric/conversion/cast.hpp>
     33#include <boost/range.hpp>
     34#include <boost/range/algorithm.hpp>
    3235#include <boost/serialization/serialization.hpp>
    3336#include <boost/serialization/nvp.hpp>
  • branches/egtra/ab5.0/abdev/ab-common.props

    r818 r820  
    1111  <ItemDefinitionGroup>
    1212    <ClCompile>
    13       <AdditionalIncludeDirectories>$(SolutionDir)ab_common\include;$(SolutionDir)..;$(SolutionDir)..\cpplibs;$(SolutionDir)..\cpplibs\boost;$(SolutionDir)..\cpplibs\WTL80\include;$(SolutionDir)abdev-impl;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     13      <AdditionalIncludeDirectories>$(SolutionDir)ab_common\include;$(SolutionDir)..;$(SolutionDir)..\cpplibs;$(SolutionDir)..\cpplibs\boost;$(SolutionDir)..\cpplibs\WTL80\include;$(SolutionDir)abdev-impl;$(SolutionDir);$(SolutionDir)BasicCompiler_Common\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
    1414    </ClCompile>
    1515  </ItemDefinitionGroup>
  • branches/egtra/ab5.0/abdev/ab-test/ab-test.vcxproj

    r818 r820  
    158158      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
    159159    </ClCompile>
     160    <ClCompile Include="Type.cpp" />
    160161  </ItemGroup>
    161162  <ItemGroup>
  • branches/egtra/ab5.0/abdev/ab-test/ab-test.vcxproj.filters

    r818 r820  
    3636      <Filter>Source Files</Filter>
    3737    </ClCompile>
     38    <ClCompile Include="Type.cpp">
     39      <Filter>Source Files</Filter>
     40    </ClCompile>
    3841  </ItemGroup>
    3942</Project>
  • branches/egtra/ab5.0/abdev/ab_common/ab_common.vcxproj

    r807 r820  
    160160      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
    161161    </ClCompile>
    162     <ClCompile Include="src\Lexical\Class.cpp" />
    163162    <ClCompile Include="src\Lexical\Const.cpp" />
    164163    <ClCompile Include="src\Lexical\DataTable.cpp" />
    165164    <ClCompile Include="src\Lexical\Delegate.cpp" />
    166     <ClCompile Include="src\Lexical\Interface.cpp" />
    167     <ClCompile Include="src\Lexical\Member.cpp" />
    168165    <ClCompile Include="src\Lexical\Meta.cpp" />
    169     <ClCompile Include="src\Lexical\Method.cpp" />
    170     <ClCompile Include="src\Lexical\Namespace.cpp" />
    171     <ClCompile Include="src\Lexical\NamespaceSupporter.cpp" />
    172     <ClCompile Include="src\Lexical\NativeCode.cpp" />
    173166    <ClCompile Include="src\Lexical\ObjectModule.cpp">
    174167      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     
    183176      </PrecompiledHeader>
    184177    </ClCompile>
    185     <ClCompile Include="src\Lexical\Parameter.cpp" />
    186     <ClCompile Include="src\Lexical\Procedure.cpp" />
    187178    <ClCompile Include="src\Lexical\Source.cpp" />
    188     <ClCompile Include="src\Lexical\Symbol.cpp" />
    189     <ClCompile Include="src\Lexical\Template.cpp" />
    190     <ClCompile Include="src\Lexical\Type.cpp" />
    191179    <ClCompile Include="src\Lexical\TypeDef.cpp" />
    192180    <ClCompile Include="src\Lexical\Variable.cpp" />
  • branches/egtra/ab5.0/abdev/ab_common/ab_common.vcxproj.filters

    r807 r820  
    3737      <Filter>Source Files</Filter>
    3838    </ClCompile>
    39     <ClCompile Include="src\Lexical\Class.cpp">
    40       <Filter>Source Files\Lexical</Filter>
    41     </ClCompile>
    4239    <ClCompile Include="src\Lexical\Const.cpp">
    4340      <Filter>Source Files\Lexical</Filter>
     
    4946      <Filter>Source Files\Lexical</Filter>
    5047    </ClCompile>
    51     <ClCompile Include="src\Lexical\Interface.cpp">
    52       <Filter>Source Files\Lexical</Filter>
    53     </ClCompile>
    54     <ClCompile Include="src\Lexical\Member.cpp">
    55       <Filter>Source Files\Lexical</Filter>
    56     </ClCompile>
    5748    <ClCompile Include="src\Lexical\Meta.cpp">
    58       <Filter>Source Files\Lexical</Filter>
    59     </ClCompile>
    60     <ClCompile Include="src\Lexical\Method.cpp">
    61       <Filter>Source Files\Lexical</Filter>
    62     </ClCompile>
    63     <ClCompile Include="src\Lexical\Namespace.cpp">
    64       <Filter>Source Files\Lexical</Filter>
    65     </ClCompile>
    66     <ClCompile Include="src\Lexical\NamespaceSupporter.cpp">
    67       <Filter>Source Files\Lexical</Filter>
    68     </ClCompile>
    69     <ClCompile Include="src\Lexical\NativeCode.cpp">
    7049      <Filter>Source Files\Lexical</Filter>
    7150    </ClCompile>
     
    7352      <Filter>Source Files\Lexical</Filter>
    7453    </ClCompile>
    75     <ClCompile Include="src\Lexical\Parameter.cpp">
    76       <Filter>Source Files\Lexical</Filter>
    77     </ClCompile>
    78     <ClCompile Include="src\Lexical\Procedure.cpp">
    79       <Filter>Source Files\Lexical</Filter>
    80     </ClCompile>
    8154    <ClCompile Include="src\Lexical\Source.cpp">
    82       <Filter>Source Files\Lexical</Filter>
    83     </ClCompile>
    84     <ClCompile Include="src\Lexical\Symbol.cpp">
    85       <Filter>Source Files\Lexical</Filter>
    86     </ClCompile>
    87     <ClCompile Include="src\Lexical\Template.cpp">
    88       <Filter>Source Files\Lexical</Filter>
    89     </ClCompile>
    90     <ClCompile Include="src\Lexical\Type.cpp">
    9155      <Filter>Source Files\Lexical</Filter>
    9256    </ClCompile>
  • branches/egtra/ab5.0/abdev/ab_common/include/Lexical/Type.h

    r816 r820  
     1#include <boost/foreach.hpp>
    12#pragma once
    23
     
    101102    }
    102103
    103     inline int GetBasicType() const
     104    int GetBasicType() const
    104105    {
    105106        return basicType;
  • branches/egtra/ab5.0/abdev/ab_common/src/Lexical/Class.cpp

    r803 r820  
    11#include "stdafx.h"
     2#include <jenga/include/jenga.h>
     3#include <abdev/ab_common/include/ab_common.h>
    24#include <algorithm>
    35#include <boost/checked_delete.hpp>
  • branches/egtra/ab5.0/abdev/ab_common/src/Lexical/Interface.cpp

    r750 r820  
    11#include "stdafx.h"
     2#include <jenga/include/jenga.h>
     3#include <abdev/ab_common/include/ab_common.h>
    24
    35Interface::Interface( const CClass *pInterfaceClass, const Types &actualTypeParameters )
  • branches/egtra/ab5.0/abdev/ab_common/src/Lexical/Member.cpp

    r640 r820  
    11#include "stdafx.h"
     2#include <jenga/include/jenga.h>
     3#include <abdev/ab_common/include/ab_common.h>
    24
    35
  • branches/egtra/ab5.0/abdev/ab_common/src/Lexical/Meta.cpp

    r803 r820  
    3737{
    3838    // 名前空間
    39     BOOST_FOREACH( NamespaceScopes &namespaceScopes, meta.namespaceScopesCollection )
     39    foreach (NamespaceScopes const &namespaceScopes, meta.namespaceScopesCollection)
    4040    {
    4141        if( !this->namespaceScopesCollection.IsExist( namespaceScopes ) )
  • branches/egtra/ab5.0/abdev/ab_common/src/Lexical/Method.cpp

    r816 r820  
    11#include "stdafx.h"
     2#include <jenga/include/jenga.h>
     3#include <abdev/ab_common/include/ab_common.h>
    24#include <stdexcept>
    35
  • branches/egtra/ab5.0/abdev/ab_common/src/Lexical/Namespace.cpp

    r810 r820  
    11#include "stdafx.h"
     2#include <jenga/include/jenga.h>
     3#include <abdev/ab_common/include/ab_common.h>
    24#include <algorithm>
    35
  • branches/egtra/ab5.0/abdev/ab_common/src/Lexical/NamespaceSupporter.cpp

    r750 r820  
    11#include "stdafx.h"
     2#include <jenga/include/jenga.h>
     3#include <abdev/ab_common/include/ab_common.h>
    24
    35using namespace ActiveBasic::Common::Lexical;
  • branches/egtra/ab5.0/abdev/ab_common/src/Lexical/NativeCode.cpp

    r750 r820  
    11#include "stdafx.h"
     2#include <jenga/include/jenga.h>
     3#include <abdev/ab_common/include/ab_common.h>
    24
    35#define BREAK_EIP(checkEip)  (obp+0x00401000>=checkEip)
  • branches/egtra/ab5.0/abdev/ab_common/src/Lexical/Parameter.cpp

    r708 r820  
    11#include "stdafx.h"
     2#include <jenga/include/jenga.h>
     3#include <abdev/ab_common/include/ab_common.h>
    24
    35Parameter::Parameter( const std::string &varName, const Type &type, bool isRef, const std::string initValue )
  • branches/egtra/ab5.0/abdev/ab_common/src/Lexical/Procedure.cpp

    r803 r820  
    11#include "stdafx.h"
     2#include <jenga/include/jenga.h>
     3#include <abdev/ab_common/include/ab_common.h>
    24
    35
  • branches/egtra/ab5.0/abdev/ab_common/src/Lexical/Source.cpp

    r769 r820  
    945945    return true;
    946946}
    947 
    948 int SourceCodePosition::GetRelationalObjectModuleIndex() const
    949 {
    950     if( this->IsNothing() )
    951     {
    952         _ASSERTE( false );
    953         throw;
    954     }
    955 
    956     return relationalObjectModuleIndex;
    957 }
    958 bool SourceCodePosition::IsNothing() const
    959 {
    960     if( this->relationalObjectModuleIndex == -1 && this->pos == -1 )
    961     {
    962         return true;
    963     }
    964 
    965     if( this->relationalObjectModuleIndex == -1 || this->pos == -1 )
    966     {
    967         _ASSERTE( false );
    968         throw;
    969     }
    970 
    971     return false;
    972 }
  • branches/egtra/ab5.0/abdev/ab_common/src/Lexical/Symbol.cpp

    r752 r820  
    11#include "stdafx.h"
     2#include <jenga/include/jenga.h>
     3#include <abdev/ab_common/include/ab_common.h>
    24
    35using namespace ActiveBasic::Common::Lexical;
  • branches/egtra/ab5.0/abdev/ab_common/src/Lexical/Template.cpp

    r640 r820  
    11#include "stdafx.h"
     2#include <jenga/include/jenga.h>
     3#include <abdev/ab_common/include/ab_common.h>
    24
    35ExpandedTemplateClass::~ExpandedTemplateClass()
  • branches/egtra/ab5.0/abdev/ab_common/src/Lexical/Type.cpp

    r750 r820  
    11#include "stdafx.h"
     2#include <jenga/include/jenga.h>
     3#include <abdev/ab_common/include/ab_common.h>
     4#include "Lexical/Type.h"
    25
    36const int Type::basicTypeList[] = {
  • branches/egtra/ab5.0/abdev/compiler-impl/compiler-impl.vcxproj

    r812 r820  
    123123  </ItemGroup>
    124124  <ItemGroup>
     125    <ClCompile Include="..\ab_common\src\Lexical\Class.cpp" />
     126    <ClCompile Include="..\ab_common\src\Lexical\Interface.cpp" />
     127    <ClCompile Include="..\ab_common\src\Lexical\Member.cpp" />
     128    <ClCompile Include="..\ab_common\src\Lexical\Method.cpp" />
     129    <ClCompile Include="..\ab_common\src\Lexical\Namespace.cpp" />
     130    <ClCompile Include="..\ab_common\src\Lexical\NamespaceSupporter.cpp" />
     131    <ClCompile Include="..\ab_common\src\Lexical\NativeCode.cpp" />
     132    <ClCompile Include="..\ab_common\src\Lexical\Parameter.cpp" />
     133    <ClCompile Include="..\ab_common\src\Lexical\Procedure.cpp" />
     134    <ClCompile Include="..\ab_common\src\Lexical\SourceCodePosition.cpp" />
     135    <ClCompile Include="..\ab_common\src\Lexical\Symbol.cpp" />
     136    <ClCompile Include="..\ab_common\src\Lexical\Template.cpp" />
     137    <ClCompile Include="..\ab_common\src\Lexical\Type.cpp" />
    125138    <ClCompile Include="..\BasicCompiler_Common\src\LexicalAnalyzer_TypeDef.cpp" />
    126139    <ClCompile Include="stdafx.cpp">
  • branches/egtra/ab5.0/abdev/compiler-impl/compiler-impl.vcxproj.filters

    r812 r820  
    1414      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
    1515    </Filter>
     16    <Filter Include="ab-common">
     17      <UniqueIdentifier>{c6cc4c5f-347b-412e-9ece-ea2fb71478fd}</UniqueIdentifier>
     18    </Filter>
     19    <Filter Include="ab-common\Lexical">
     20      <UniqueIdentifier>{4e746032-dca6-4ee9-bd86-92987085f55b}</UniqueIdentifier>
     21    </Filter>
    1622  </ItemGroup>
    1723  <ItemGroup>
     
    2733      <Filter>Source Files</Filter>
    2834    </ClCompile>
     35    <ClCompile Include="..\ab_common\src\Lexical\Type.cpp">
     36      <Filter>ab-common\Lexical</Filter>
     37    </ClCompile>
     38    <ClCompile Include="..\ab_common\src\Lexical\Class.cpp">
     39      <Filter>ab-common\Lexical</Filter>
     40    </ClCompile>
     41    <ClCompile Include="..\ab_common\src\Lexical\Method.cpp">
     42      <Filter>ab-common\Lexical</Filter>
     43    </ClCompile>
     44    <ClCompile Include="..\ab_common\src\Lexical\Symbol.cpp">
     45      <Filter>ab-common\Lexical</Filter>
     46    </ClCompile>
     47    <ClCompile Include="..\ab_common\src\Lexical\Interface.cpp">
     48      <Filter>ab-common\Lexical</Filter>
     49    </ClCompile>
     50    <ClCompile Include="..\ab_common\src\Lexical\Namespace.cpp">
     51      <Filter>ab-common\Lexical</Filter>
     52    </ClCompile>
     53    <ClCompile Include="..\ab_common\src\Lexical\Member.cpp">
     54      <Filter>ab-common\Lexical</Filter>
     55    </ClCompile>
     56    <ClCompile Include="..\ab_common\src\Lexical\Template.cpp">
     57      <Filter>ab-common\Lexical</Filter>
     58    </ClCompile>
     59    <ClCompile Include="..\ab_common\src\Lexical\NamespaceSupporter.cpp">
     60      <Filter>ab-common\Lexical</Filter>
     61    </ClCompile>
     62    <ClCompile Include="..\ab_common\src\Lexical\Procedure.cpp">
     63      <Filter>ab-common\Lexical</Filter>
     64    </ClCompile>
     65    <ClCompile Include="..\ab_common\src\Lexical\Parameter.cpp">
     66      <Filter>ab-common\Lexical</Filter>
     67    </ClCompile>
     68    <ClCompile Include="..\ab_common\src\Lexical\NativeCode.cpp">
     69      <Filter>ab-common\Lexical</Filter>
     70    </ClCompile>
     71    <ClCompile Include="..\ab_common\src\Lexical\SourceCodePosition.cpp">
     72      <Filter>ab-common\Lexical</Filter>
     73    </ClCompile>
    2974  </ItemGroup>
    3075</Project>
Note: See TracChangeset for help on using the changeset viewer.