OSDN Git Service

(none)
authorryuz <ryuz>
Tue, 12 Jun 2007 07:03:36 +0000 (07:03 +0000)
committerryuz <ryuz>
Tue, 12 Jun 2007 07:03:36 +0000 (07:03 +0000)
kernel/cfgrtr/source/calcexp.cpp
kernel/cfgrtr/source/h4acfg.cpp
kernel/cfgrtr/source/parser.cpp

index 288abd4..a21902e 100755 (executable)
@@ -85,6 +85,7 @@ static bool Parser(vector<TTerm> &vectTerm, int &iIndex, TTerm &RetVal)
        list<TTerm>           listTerm;
        list<TTerm>::iterator it;
 
+#if 0
        for ( ; ; )
        {
                if ( iIndex >= vectTerm.size() )
index b7dc660..380d87f 100755 (executable)
@@ -13,23 +13,7 @@ int main(int argc, char *argv[])
        CParser     Parser;
        FILE        *fp;
        TSourceInfo SrcInf;
-
-       {
-               list<int>           lst;
-               list<int>::reverse_iterator it;
-               
-               lst.push_back(11);
-               lst.push_back(22);
-               lst.push_back(33);
-               
-               for ( it = lst.rbegin(); it != lst.rend();  it++ )
-               {
-                       printf("%d\n", *it);
-               }
-               
-               return 0;
-       }
-
+       
        // さしあたって適当にテスト
        if ( (fp = fopen("system.i", "r")) == NULL )
        {
@@ -37,8 +21,8 @@ int main(int argc, char *argv[])
        }
 
        SrcInf.strFileName = "system.i";
-       SrcInf.iLineNum   = 1;
-       SrcInf.iColumnNum = 1;
+       SrcInf.iLineNum    = 1;
+       SrcInf.iColumnNum  = 1;
        Parser.Analyze(fp, &SrcInf);
        
        return 0;
index 74e2c2c..031fe99 100755 (executable)
@@ -21,8 +21,8 @@
 #define PARSER_STATE_API_START                                 2000    // API探索中
 #define PARSER_STATE_API_END                                   2001    // APIの終結探索
 #define PARSER_STATE_API_NAME                                  2002    // API名部分解析中
-#define PARSER_STATE_API_S_PARAM                               2003    // 
-#define PARSER_STATE_API_PARAM                                 2004    // 
+#define PARSER_STATE_API_S_PARAM                               2003    // パラメータ部開始待ち
+#define PARSER_STATE_API_PARAM                                 2004    // パラメータ部解析中
 #define PARSER_STATE_API_PARAM_STR                             2005    // パラメータ内の文字列部読み込み中
 #define PARSER_STATE_API_PARAM_STR_ESC                 2006    // パラメータ内の文字列部読み込み中で且つESC
 #define PARSER_STATE_API_PARAM_CHAR                            2007    // パラメータ内の文字列部読み込み中
@@ -366,7 +366,7 @@ bool CParser::AnalyzeParam(CParamBlock *pParam, int cEndChar)
        }
 
        // エラー
-       ParseError(ERRTYPE_FATAL, FATAL_EOF);           // エラー
+       ParseError(ERRTYPE_FATAL, FATAL_EOF);           //致命エラ
        return false;
 }
 
@@ -374,11 +374,27 @@ bool CParser::AnalyzeParam(CParamBlock *pParam, int cEndChar)
 // プリプロセッサ行の処理
 bool CParser::PreProc(void)
 {
+       // debug
        printf("PRI : %s\n", m_strPre.c_str());
+       
+       int  iNum;
+       int  iLine;
+       char szPath[512];
+       iNum = sscanf(m_strPre.c_str(), "# %d %s", &iLine, szPath);
+       if ( iNum >= 1 )
+       {
+               m_SrcInf.iLineNum = iLine;
+       }
+       if ( iNum >= 2 && szPath[0] == '\"' )
+       {
+               m_SrcInf.strFileName = szPath;
+       }
+
        return true;
 }
 
 
+// API部の処理
 bool CParser::ApiProc(void)
 {
        printf("API : %s\n", m_strApiName.c_str());