//{------------------------
//[2005.08.24.수][생성!!!]
//}------------------------

//[해석 종류 구분]
//{
    //[2012.04.01.일][완료!!!]
    void _ParserMode(int  pMode);

    //[2012.05.26.토][완료!!!]
    int _ParserMode_Read(void);


    //[2012.05.26.토][추가!!!]{----------------------------------------------------
    //[중복처리] 방지를 위하여 처리하지 않을때는 항상 <d_ParserMode_NULL> 로 설정.
    //}----------------------------------------------------------------------------

    #define  d_ParserMode_NULL    0x00

    //전체를 모두 해석(기본값).
    #define  d_ParserMode_All     0x01
    //선언정보만 해석.
    #define  d_ParserMode_Def     0x02

//}

//[BASIC]-----------------------------------------------------------------------
                                    
//[2012.04.07.토][완료!!!]
void __fastcall Get_NextWord(class  DATABASE   *pDATABASE,
                             struct PARSERINFO *pPARSERinfo);
//[2006.05.09.화][완료!!!]
void __fastcall Check_NextWord(class  DATABASE   *pDATABASE,
                               struct PARSERINFO *pPARSERinfo,
                               char              *pCHECKword);

//[2011.05.01.일][완료!!!]
void __fastcall Check_NextWordLineNumber(class  DATABASE   *pDATABASE,
                                         struct PARSERINFO *pPARSERinfo,
                                         int               *rLineNumber,
                                         //[2011.05.01.일][추가!!!]
                                         //<rLineNumber> 행의 시작 위치.
                                         int               *rLineStartIndex);

//[2012.06.24.일][완료!!!]
bool __fastcall Get_IndexWord(int    pIndex,
                              //지정 위치 이전 단어.
                              char  *rBfWord_,
                              //지정 위치 이전 단어 위치.
                              int   *rBfWordIndex_);

//[DIRECTIVE]-------------------------------------------------------------------

//[완료!!!]
int __fastcall TREE_Directive(class  DATABASE   *pDATABASE,
                              struct PARSERINFO *pPARSERinfo);
//[2007.08.08.수][완료!!!]
//[2011.10.01.토][완료!!!]
int __fastcall TREE_StructTypeDefinition(class  DATABASE   *pDATABASE,
                                         struct PARSERINFO *pPARSERinfo);
//[2007.08.08.수][완료!!!]
//[2011.10.01.토][완료!!!]
int __fastcall TREE_UnionTypeDefinition(class  DATABASE   *pDATABASE,
                                        struct PARSERINFO *pPARSERinfo);

//[FUNCTION]--------------------------------------------------------------------
//[2006.01.31.화][완료!!!]
int __fastcall TREE_FunctionPtrDefinition(class  DATABASE   *pDATABASE,
                                          struct PARSERINFO *pPARSERinfo);

//[2012.05.13.일][완료!!!]
int __fastcall TREE_FunctionDefinition(class  DATABASE   *pDATABASE,
                                       struct PARSERINFO *pPARSERinfo);

//[2009.02.05.목][완료!!!]
int __fastcall FunctionDefinition_RegularFunctionCheck(class  DATABASE    *pDatabase,
                                                       struct PARSERINFO  *pParserInfo,
                                                       //검사할 함수의 recindex.
                                                       int                 pRecIndex,
                                                       //검사할 [함수이름] 이 존재하는 행.
                                                       int                 pFuncNameLine);

//[완료!!!]
int __fastcall FUNC_Check_InHeaderFile(class  DATABASE   *pDATABASE,
                                       struct PARSERINFO *pPARSERinfo,
                                       int                pFILELISTindex);

//[2010.12.27.월][완료!!!]
int __fastcall TREE_Param(class  DATABASE   *pDATABASE,
                          struct PARSERINFO *pPARSERinfo);

//[2012.06.24.일][완료!!!]
int __fastcall TREE_FunctionBody(class  DATABASE   *pDATABASE,
                                 struct PARSERINFO *pPARSERinfo,
                                 //[2008.11.06.목][추가!!!]
                                 //안에서 구한 [지역변수(인수포함)] 총 크기를 반환한다.
                                 long long         *rLocalTotal);

//[2009.12.22.화][중요수정완료!!!]
int __fastcall TREE_StatementBlock(class  DATABASE   *pDATABASE,
                                   struct PARSERINFO *pPARSERinfo,
                                   //사용하지 않은 경우는 NULL 을 할당.
                                   struct SWITCHINFO *pSwitchInfo);

//[선언정보 처리용]
//{
    //[2012.06.24.일][완료!!!]
    int __fastcall Tree_Info_StatementBlock(class  DATABASE   *pDatabase,
                                            struct PARSERINFO *pParserInfo);

    //[2012.04.04.수][완료!!!]
    int __fastcall Tree_Info_String(class  DATABASE   *pDatabase,
                                    struct PARSERINFO *pParserInfo);

    //[2012.04.04.수][완료!!!]
    int __fastcall Tree_Info_CharConstant(class  DATABASE   *pDatabase,
                                          struct PARSERINFO *pParserInfo);

//}




//[2006.02.07.화][완료!!!]
int __fastcall TREE_LabelDefinition(class  DATABASE   *pDATABASE,
                                    struct PARSERINFO *pPARSERinfo);

//[2012.06.07.목][완료!!!]
int __fastcall TREE_Statement(class  DATABASE   *pDATABASE,
                              struct PARSERINFO *pPARSERinfo,
                              //사용하지 않은 경우는 NULL 을 할당.
                              struct SWITCHINFO *pSwitchInfo);

//------------------------------------------------------------------------------
//[STATEMENT]-------------------------------------------------------------------
//------------------------------------------------------------------------------

//[2011.05.01.일][완료!!!]
int __fastcall TREE_If(class  DATABASE   *pDATABASE,
                       struct PARSERINFO *pPARSERinfo);

//[2011.05.01.일][완료!!!]
int __fastcall TREE_For(class  DATABASE   *pDATABASE,
                        struct PARSERINFO *pPARSERinfo);

//[2011.05.01.일][완료!!!]
int __fastcall TREE_While(class  DATABASE   *pDATABASE,
                          struct PARSERINFO *pPARSERinfo);

//[2011.05.01.일][완료!!!]
int __fastcall TREE_Do(class  DATABASE   *pDATABASE,
                       struct PARSERINFO *pPARSERinfo);

//[2011.05.01.일][완료!!!]
int __fastcall TREE_Switch(class  DATABASE   *pDATABASE,
                           struct PARSERINFO *pPARSERinfo);

//[2006.02.23.목][완료!!!]
int __fastcall SWITCH_Check_NativeIntegerType(class  DATABASE   *pDATABASE,
                                              struct PARSERINFO *pPARSERinfo,
                                              struct EXPRECORD  *pTYPEinfo);

//[2010.12.27.월][완료!!!]
int __fastcall TREE_Case(class  DATABASE   *pDATABASE,
                         struct PARSERINFO *pPARSERinfo,
                         //사용하지 않은 경우는 NULL 을 할당.
                         struct SWITCHINFO *pSwitchInfo);

//[2008.10.29.수][완료!!!]
int __fastcall TREE_Default(class  DATABASE   *pDATABASE,
                            struct PARSERINFO *pPARSERinfo,
                            //사용하지 않은 경우는 NULL 을 할당.
                            struct SWITCHINFO *pSwitchInfo);

//[2011.05.01.일][완료!!!]
int __fastcall TREE_Goto(class  DATABASE   *pDATABASE,
                         struct PARSERINFO *pPARSERinfo);

//[2006.02.15.수][완료!!!]
int __fastcall GOTO_Check_DefLabel(class  DATABASE   *pDATABASE,
                                   struct PARSERINFO *pPARSERinfo,
                                   char              *pWORD,
                                   int                pAREA);

//[2011.05.01.일][완료!!!]
int __fastcall TREE_Break(class  DATABASE   *pDATABASE,
                          struct PARSERINFO *pPARSERinfo);

//[2011.05.01.일][완료!!!]
int __fastcall TREE_Continue(class  DATABASE   *pDATABASE,
                             struct PARSERINFO *pPARSERinfo);

//[2011.05.01.일][완료!!!]
int __fastcall TREE_Return(class  DATABASE   *pDATABASE,
                           struct PARSERINFO *pPARSERinfo);

//[2008.10.19.일][완료!!!]
int __fastcall RETURN_Assign_Match(class  DATABASE    *pDATABASE,
                                   int                 pFUNCrecindex,
                                   struct EXPRECORD    pRIGHTexprecord,
                                   //[2008.10.18.토][추가!!!]
                                   //조합한 [함수반환] 의 exprecord 정보를 반환한다.
                                   struct EXPRECORD   *rReturnExprecord);

//[2006.02.23.목][완료!!!]
int __fastcall RETURN_Check_FuncVoidReturn(class  DATABASE   *pDATABASE,
                                           struct PARSERINFO *pPARSERinfo,
                                           int                pFUNCrecindex);

//[2012.06.21.목][완료!!!]
int __fastcall TREE_Expression(class  DATABASE   *pDATABASE,
                               struct PARSERINFO *pPARSERinfo,
                               bool               pTEMPDATABASEinit,
                               struct EXPRECORD  *rRESULTexprecord,
                               char              *rEXPcode,
                               char              *rSYMBOL,

                               //[2008.11.17.월][추가!!!]
                               int               *rExpStartLineNumber,
                               //[2011.05.01.일][추가!!!]
                               //<rExpStartLineNumber> 행의 시작 위치.
                               int               *rExpStartLineStartIndex,

                               //[2011.06.07.화][수정!!!]
                               //일반적인 수식 형식(일반식/상수식/검증식) 지정.
                               int                pExpKind);
//{
    //[2011.06.07.화][추가!!!]{-----------------------------
    //[식] 을 어떤 식으로 처리할지 정의한다.
    //이는 [상수식] 뿐만 아니라, [검증식] 도 추가되었으므로
    //이를 더 세분화 해주는 것이다.
    //}-----------------------------------------------------
    
    #define  d_ExpKind_Default     1
    #define  d_ExpKind_Constant    2
    #define  d_ExpKind_Debug       3

    //[2012.06.20.수][추가!!!]{---------------------------------------------------
    //[실시간 선언 정보판] 의 "->", "." [연산자] 인 경우 [구성원] 을 찾아서
    //보여주기 위한것.
    //다른 부분은 처리할 필요가 없고 오직 "->", "." [연산자] 앞쪽의 [모체:선언형]
    //정보만 얻어내면 된다.
    #define  d_ExpKind_RtInfo      4
    //}---------------------------------------------------------------------------

//}


//[2010.12.22.수][완료!!!]
bool __fastcall Expression_Is_ConstExp(class  EXPDATABASE *pExpDatabase);

//[2012.06.20.수][완료!!!]
int __fastcall TREE_Expression_1_Level(class  DATABASE    *pDATABASE,
                                       struct PARSERINFO  *pPARSERinfo,
                                       class  EXPDATABASE *pEXPDATABASE,
                                       char                rEXPcode[]);

//[2012.06.20.수][완료!!!]
int __fastcall EXPRESSION_Typecast(class  DATABASE    *pDATABASE,
                                   struct PARSERINFO  *pPARSERinfo,
                                   class  EXPDATABASE *pEXPDATABASE);

//[2012.02.19.일][완료!!!]
int __fastcall Expression_Sizeof(class  DATABASE     *pDatabase,
                                 struct PARSERINFO   *pParserInfo,
                                 class  EXPDATABASE  *pExpDatabase,
                                 //[2012.02.19.일][추가!!!]
                                 //<sizeof(자료형)> 인지 [검사] 만 하는 경우는 <true>.
                                 //이 경우는 <exprecord> 를 처리하지 않는다.
                                 bool                 pCheck);

//[2006.03.20.월][완료!!!]
int __fastcall EXPRESSION_C_DataType(class  DATABASE   *pDATABASE,
                                     struct PARSERINFO *pPARSERinfo,
                                     int               *pTYPELISTindex);

//[2006.04.16.일][완료!!!]
int __fastcall EXPRESSION_Struct_Union_DataType(class  DATABASE   *pDATABASE,
                                                struct PARSERINFO *pPARSERinfo,
                                                int               *pTYPELISTindex);

//[2012.02.18.토][완료!!!]
int __fastcall Expression_Struct_Union_DataType2(class  DATABASE    *pDatabase,
                                                 struct PARSERINFO  *pParserInfo,
                                                 //확인한 <구조체/공용체> 의 <typelistindex> 반환.
                                                 int                *rTypeListIndex);

//[2012.02.19.일][완료!!!]
int __fastcall EXPRESSION_PreOperator(class  DATABASE    *pDATABASE,
                                      struct PARSERINFO  *pPARSERinfo,
                                      class  EXPDATABASE *pEXPDATABASE);

//[2012.02.19.일][완료!!!]
int __fastcall EXPRESSION_Operand(class  DATABASE     *pDATABASE,
                                  struct PARSERINFO   *pPARSERinfo,
                                  class  EXPDATABASE  *pEXPDATABASE,
                                  char                 rEXPcode[]);

//[2018.07.25.수][완료!!!]
int __fastcall EXPRESSION_DataDefault(class  DATABASE    *pDATABASE,
                                      struct PARSERINFO  *pPARSERinfo,
                                      class  EXPDATABASE *pEXPDATABASE);

//[2006.03.04.토][완료!!!]
int __fastcall EXPRESSION_DataConstant(class  DATABASE    *pDATABASE,
                                       struct PARSERINFO  *pPARSERinfo,
                                       class  EXPDATABASE *pEXPDATABASE);

//[2009.01.07.수][완료!!!]
int __fastcall EXPRESSION_DataString(class  DATABASE    *pDATABASE,
                                     struct PARSERINFO  *pPARSERinfo,
                                     class  EXPDATABASE *pEXPDATABASE);

//[2006.08.11.금][완료!!]
int __fastcall FUNCPARAM_Assign_Match(class  DATABASE    *pDATABASE,
                                      //검사대상 [함수] <record-index>.
                                      int                 pFUNCrecindex,
                                      //검사대상 [인수] 순번. (BASE:0)
                                      int                 pPARAMorder,
                                      //[인수] 에 사용된 [식] 의 최종 결과 <exprecord> 정보.
                                      struct EXPRECORD    pRIGHTexprecord,
                                      //[인수] 자체의 <exprecord> 정보.
                                      struct EXPRECORD   *rPARAMexprecord);

//[2011.10.24.월][완료!!!]
int __fastcall EXPRESSION_DataFunction(class  DATABASE    *pDATABASE,
                                       struct PARSERINFO  *pPARSERinfo,
                                       class  EXPDATABASE *pEXPDATABASE,
                                       char                rEXPcode[]);

//[2024.05.16.목][완료]
int __fastcall EXPRESSION_Optr_Opnd_Match(class  DATABASE    *pDATABASE,
                                          struct PARSERINFO  *pPARSERinfo,
                                          class  EXPDATABASE *pEXPDATABASE,
                                          struct EXPRECORD   *pRESULTexprecord,
                                          char               *pEXPcode,
                                          //[2011.06.07.화][수정!!!]
                                          //일반적인 수식 형식(일반식/상수식/검증식) 지정.
                                          int                 pExpKind);

//[2006.04.29.토][완료!!!]
//[2024.04.21.일][완료]
//v---[2024.04.21.일] 에 [반환형]을 "void -> bool" 로 변경.
bool __fastcall EXPRESSION_Match_Get_MatchInfo_withINDEX(//[2024.04.21.일][추가]{********
                                                         struct PARSERINFO  *pPaserInfo,
                                                         //}*****************************
                                                         class  DATABASE    *pDATABASE,
                                                         class  EXPDATABASE *pEXPDATABASE,
                                                         int                 pEXPRECindex,
                                                         struct MATCHINFO   *pMATCHinfo);

//[2008.11.05.수][완료!!!]
int __fastcall EXPRESSION_MatchDataKind(class  DATABASE    *pDATABASE,
                                        struct EXPRECORD   *pEXPrecord);

//[2006.08.01.화][완료!!!]
void __fastcall EXPRESSION_Get_TypeCastInfo_withSYMBOL(char  *pSYMBOL,
                                                       int   *pTYPELISTindex,
                                                       int   *pPOINTER);

//[2012.08.06.화][완료!!!]
int __fastcall EXPRESSION_MatchOne(class  DATABASE     *pDATABASE,
                                   class  EXPDATABASE  *pEXPDATABASE,
                                   struct MATCHINFO    *pMATCHinfo,
                                   char                 pEXPcode[],
                                   //[2011.06.07.화][수정!!!]
                                   //일반적인 수식 형식(일반식/상수식/검증식) 지정.
                                   int                  pExpKind);

//[2011.10.24.월][완료!!!]
int __fastcall TREE_FunctionUse(class  DATABASE    *pDATABASE,
                                struct PARSERINFO  *pPARSERinfo);
//------------------------------------------------------------------------------
//[완료!!!]
int __fastcall TREE_DataDefinition(class  DATABASE    *pDATABASE,
                                   struct PARSERINFO  *pPARSERinfo);
//[완료!!!]
int __fastcall TREE_DataType(class  DATABASE    *pDATABASE,
                             struct PARSERINFO  *pPARSERinfo,
                             int                *pTYPELISTindex);

//[DATACREATE]------------------------------------------------------------------
//[2010.12.27.월][완료!!!]       
int __fastcall TREE_DataCreate(class  DATABASE    *pDATABASE,
                               struct PARSERINFO  *pPARSERinfo,
                               int                 pTYPELISTindex);

//[완료!!!] [고려할 부분 있음!!!]
int __fastcall DATACREATE_ArraySizeConstant(class     DATABASE    *pDATABASE,
                                            struct    PARSERINFO  *pPARSERinfo,
                                            char                  *pWORD,
                                            long long             *pCONSTANTvalue);

//[INCLUDE]---------------------------------------------------------------------

//[2012.04.08.일][완료!!!]
int __fastcall TREE_Inlcude(class  DATABASE   *pDATABASE,
                            struct PARSERINFO *pPARSERinfo);
                            
//[완료!!!]
void __fastcall INCLUDE_GetFullFilenameStd(class  DATABASE *pDATABASE,
                                           char            *pSTR,
                                           char            *pFULLfilename);
//[2009.01.27.화][완료!!!]
void __fastcall INCLUDE_GetFullFilenamePrj(class  DATABASE    *pDatabase,
                                           struct PARSERINFO  *pParserinfo,
                                           char               *pStr,
                                           char               *rFullFileName); 

//[DEFINE]----------------------------------------------------------------------
//[2010.12.20.월][완료!!!]
int __fastcall TREE_Define(class  DATABASE   *pDATABASE,
                           struct PARSERINFO *pPARSERinfo);

//[2006.01.10.화][완료!!!]
int __fastcall TREE_Undef(class  DATABASE   *pDATABASE,
                          struct PARSERINFO *pPARSERinfo);
//[2006.01.10.화][완료!!!]
int __fastcall UNDEF_Check_DefineName(class  DATABASE   *pDATABASE,
                                      struct PARSERINFO *pPARSERinfo,
                                      char              *pUNDEFname,
                                      int               *pDEFINELISTindex);
//[2006.01.10.화][완료!!!]
int __fastcall UNDEF_Delete_Define(class  DATABASE   *pDATABASE,
                                   struct PARSERINFO *pPARSERinfo,
                                   int                pDELETEindex);

//[문자열관련]------------------------------------------------------------------
//[2009.05.14.목][완료!!!]
int __fastcall TREE_String(class  DATABASE     *pDATABASE,
                           struct PARSERINFO   *pPARSERinfo,
                           int                 *rStringlistIndex,
                           //[2009.01.07.수][추가!!!]
                           unsigned long long  *rStrOfsAdr);
//[2009.05.14.목][완료!!!]
int __fastcall TREE_CharConstant(class  DATABASE    *pDATABASE,
                                 struct PARSERINFO  *pPARSERinfo,
                                 long long          *pVALUE);

//[기타처리관련]----------------------------------------------------------------
//[2006.02.21.화][완료!!!]
int __fastcall TREE_IntegerConstant(class  DATABASE   *pDATABASE,
                                    struct PARSERINFO *pPARSERinfo,
                                    long long         *pVALUE);

//[tempfile]--------------------------------------------------------------------

//[2008.11.26.수][완료!!!]
void __fastcall TEMPFILE_Delete(void);

//[2008.11.26.수][완료!!!]
void __fastcall TEMPFILE_Create(int  pFileSize);

//[2008.11.26.수][완료!!!]
void __fastcall TEMPFILE_ReSize(void);

//[2008.11.26.수][완료!!!]
void __fastcall TEMPFILE_Add(char  *pStr);

//[2008.11.26.수][완료!!!]
void __fastcall TEMPFILE_Insert(int    pInsertIndex,
                                char  *pStr);

//[2008.11.26.수][완료!!!]
void __fastcall TEMPFILE_EndIndex(int  *rEndIndex);

//[2008.11.26.수][완료!!!]
void __fastcall TEMPFILE_Save(void);

//[2008.11.26.수][완료!!!]
void __fastcall TEMPFILE_MakeFileName(char  *pFileName,
                                      //[2008.11.26.수]
                                      //확장자를 지정할수 있게 만든다.
                                      char  *pExtName);

//-----------------------------------------------------------------------
//[부가함수]-------------------------------------------------------------
//-----------------------------------------------------------------------






//-----------------------------------------------------------------------
//[함수]-----------------------------------------------------------------
//-----------------------------------------------------------------------

//[2012.04.28.토][완료!!!]
bool __fastcall Parser(char            *pFILEname,
                       class DATABASE  *pDATABASE);




