Changeset 186 in dev


Ignore:
Timestamp:
Jun 25, 2007, 4:22:39 AM (17 years ago)
Author:
dai_9181
Message:
 
Location:
trunk/jenga
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/jenga/include/smoothie/SmoothieException.h

    r181 r186  
    33#include <string>
    44#include <vector>
     5
     6void SetError(int ErrorNum,const std::string &keyWord,int pos);
     7void SetError(int num,const char *KeyWord,int pos);
     8void SetError();
    59
    610class SmoothieException
     
    913    std::string keyword;
    1014    int nowLine;
     15    static void Throwing()
     16    {
     17        //ここでブレークポイント
     18        int dummy=0;
     19    }
    1120public:
     21    static void Throw( int errorCode, const std::string &keyword, int nowLine )
     22    {
     23        Throwing();
     24        SetError( errorCode, keyword, nowLine );
     25    }
     26    static void Throw( int errorCode, const std::string &keyword )
     27    {
     28        Throwing();
     29        SetError( errorCode, keyword,-1 );
     30    }
     31    static void Throw( int errorCode )
     32    {
     33        Throwing();
     34        SetError( errorCode,"",-1 );
     35    }
     36    static void Throw()
     37    {
     38        Throwing();
     39        SetError();
     40    }
     41
    1242    SmoothieException( int errorCode, const std::string &keyword, int nowLine )
    1343        : errorCode( errorCode )
  • trunk/jenga/src/smoothie/Class.cpp

    r181 r186  
    1010    , Prototype( namespaceScopes, name )
    1111    , importedNamespaces( importedNamespaces )
    12     , ConstructorMemberSubIndex( 0 )
    13     , DestructorMemberSubIndex( 0 )
     12    , ConstructorMemberSubIndex( -1 )
     13    , DestructorMemberSubIndex( -1 )
    1414    , classType( Class )
    1515    , pobj_InheritsClass( NULL )
     
    450450            if( pobj_c2->IsEqualSymbol( namespaceScopes, name ) ){
    451451                //名前空間及びクラス名が重複した場合
    452                 throw SmoothieException(15,name,nowLine);
     452                SmoothieException::Throw(15,name,nowLine);
    453453                return 0;
    454454            }
     
    471471{
    472472    if( !pStringClass ){
    473         throw SmoothieException();
     473        SmoothieException::Throw();
    474474        return NULL;
    475475    }
     
    479479{
    480480    if( !pObjectClass ){
    481         throw SmoothieException();
     481        SmoothieException::Throw();
    482482        return NULL;
    483483    }
     
    494494            pCompilingMethod = pCompilingClass->GetStaticMethods().GetMethodPtr( pUserProc );
    495495            if( !pCompilingMethod ){
    496                 throw SmoothieException(300);
     496                SmoothieException::Throw(300);
    497497            }
    498498        }
  • trunk/jenga/src/smoothie/LexicalScoping.cpp

    r174 r186  
    5656void CLexicalScopes::End(){
    5757    if( level <= 0 ){
    58         throw SmoothieException();
     58        SmoothieException::Throw();
    5959        return;
    6060    }
  • trunk/jenga/src/smoothie/Namespace.cpp

    r181 r186  
    145145        else if( source[i] == 1 && source[i+1] == ESC_ENDNAMESPACE ){
    146146            if( namespaceScopes.size() <= 0 ){
    147                 throw SmoothieException( 12, "End Namespace", i );
     147                SmoothieException::Throw( 12, "End Namespace", i );
    148148                isSuccessful = false;
    149149            }
     
    158158
    159159    if( namespaceScopes.size() > 0 ){
    160         throw SmoothieException( 63 );
     160        SmoothieException::Throw( 63 );
    161161        isSuccessful = false;
    162162    }
  • trunk/jenga/src/smoothie/Procedure.cpp

    r181 r186  
    2020{
    2121    if( !pParentClass ){
    22         throw SmoothieException();
     22        SmoothieException::Throw();
    2323    }
    2424    return pParentClass->GetNamespaceScopes();
     
    2727{
    2828    if( !pParentClass ){
    29         throw SmoothieException();
     29        SmoothieException::Throw();
    3030    }
    3131    return pParentClass->GetImportedNamespaces();
     
    3333bool UserProc::IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const
    3434{
    35     throw SmoothieException();
     35    SmoothieException::Throw();
    3636    return false;
    3737}
  • trunk/jenga/src/smoothie/Source.cpp

    r181 r186  
    650650                if( !source.ReadFile_InIncludeDirective( temporary ) ){
    651651                    sprintf(temp2,"インクルードファイル \"%s\" をオープンできません",temporary);
    652                     throw SmoothieException(-1,temp2,i);
     652                    SmoothieException::Throw(-1,temp2,i);
    653653                    break;
    654654                }
  • trunk/jenga/src/smoothie/Type.cpp

    r181 r186  
    169169    }
    170170
    171     throw SmoothieException();
     171    SmoothieException::Throw();
    172172
    173173    return 0;
     
    241241    if( basicType == DEF_STRUCT ){
    242242        if( !pClass ){
    243             throw SmoothieException();
     243            SmoothieException::Throw();
    244244            return 0;
    245245        }
     
    257257    }
    258258
    259     throw SmoothieException();
     259    SmoothieException::Throw();
    260260    return 0;
    261261}
     
    533533    }
    534534
    535     throw SmoothieException( 1 );
     535    SmoothieException::Throw( 1 );
    536536
    537537    return (string)"(null)";
  • trunk/jenga/src/smoothie/TypeDef.cpp

    r181 r186  
    1010{
    1111    if( !Type::StringToType( baseName, baseType ) ){
    12         throw SmoothieException(3, baseName, nowLine );
     12        SmoothieException::Throw(3, baseName, nowLine );
    1313        return;
    1414    }
     
    8989
    9090    if(expression[i]!='='){
    91         throw SmoothieException(10,"TypeDef",nowLine);
     91        SmoothieException::Throw(10,"TypeDef",nowLine);
    9292        return;
    9393    }
     
    100100        if(temporary[i]=='\0') break;
    101101        if(!IsVariableChar(temporary[i])){
    102             throw SmoothieException(10,"TypeDef",nowLine);
     102            SmoothieException::Throw(10,"TypeDef",nowLine);
    103103            return;
    104104        }
     
    109109        //関数ポインタ
    110110        if(pTemp[3]!='('){
    111             throw SmoothieException(10,"TypeDef",nowLine);
     111            SmoothieException::Throw(10,"TypeDef",nowLine);
    112112            return;
    113113        }
     
    119119            if(pTemp[i]=='\0') break;
    120120            if(!IsVariableChar(pTemp[i])){
    121                 throw SmoothieException(10,"TypeDef",nowLine);
     121                SmoothieException::Throw(10,"TypeDef",nowLine);
    122122                return;
    123123            }
     
    127127    //識別子が重複している場合はエラーにする
    128128    if(lstrcmp(temporary,pTemp)==0){
    129         throw SmoothieException(1,NULL,nowLine);
     129        SmoothieException::Throw(1,NULL,nowLine);
    130130        return;
    131131    }
     
    173173        else if( basbuf[i] == 1 && basbuf[i+1] == ESC_ENDNAMESPACE ){
    174174            if( namespaceScopes.size() <= 0 ){
    175                 throw SmoothieException(12, "End Namespace", i );
     175                SmoothieException::Throw(12, "End Namespace", i );
    176176            }
    177177            else{
     
    192192            if( !importedNamespaces.Imports( temporary ) )
    193193            {
    194                 throw SmoothieException(64,temporary,i );
     194                SmoothieException::Throw(64,temporary,i );
    195195            }
    196196
Note: See TracChangeset for help on using the changeset viewer.