Ignore:
Timestamp:
May 4, 2008, 2:00:36 AM (16 years ago)
Author:
dai_9181
Message:

・GetConstInfo関数を廃止し、LexicalAnalyzer::CollectConstsメソッドを追加。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Const.cpp

    r523 r543  
    1111}
    1212
    13 void AddConst( const NamespaceScopes &namespaceScopes, char *buffer ){
    14     int i;
    15 
    16     //名前を取得
    17     char name[VN_SIZE];
    18     for(i=0;;i++){
    19         if(buffer[i]=='\0'){
    20             compiler.errorMessenger.Output(10,"Const",cp);
    21             return;
    22         }
    23         if(buffer[i]=='='||buffer[i]=='('){
    24             name[i]=0;
    25             break;
    26         }
    27         name[i]=buffer[i];
    28     }
    29 
    30     //重複チェック
    31     if( compiler.GetObjectModule().meta.GetGlobalConstMacros().IsExist( name )
    32         || compiler.GetObjectModule().meta.GetGlobalConsts().IsExist( name ) )
    33     {
    34         compiler.errorMessenger.Output(15,name,cp);
    35         return;
    36     }
    37 
    38     if(buffer[i] == '('){
    39         //定数マクロ
    40 
    41         compiler.GetObjectModule().meta.GetGlobalConstMacros().Add( namespaceScopes, name, buffer + i );
    42     }
    43     else{
    44         //一般の定数
    45         char *expression = buffer + i + 1;
    46 
    47         compiler.GetObjectModule().meta.GetGlobalConsts().Add( namespaceScopes, name, expression );
    48     }
    49 }
    50 
    51 void Consts::Add( const NamespaceScopes &namespaceScopes, const std::string &name , char *Expression)
     13void Consts::Add( const NamespaceScopes &namespaceScopes, const std::string &name , const char *Expression)
    5214{
    5315    _int64 i64data;
Note: See TracChangeset for help on using the changeset viewer.