Changeset 681 in dev


Ignore:
Timestamp:
Jul 12, 2008, 9:23:52 PM (13 years ago)
Author:
dai_9181
Message:

・TinyXMLをabdevプロジェクトで使えるようにした。
・コードハイライターを汎用的に実装しなおした。syntaxファイルを読み込む仕様とした。

Location:
trunk/ab5.0/abdev/abdev
Files:
4 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/abdev/abdev/Common.h

    r661 r681  
    677677BOOL CheckParenthesis(char *buffer);
    678678DWORD GetValue(char *value);
    679 BOOL IsManagementCommand(int ComNum);
    680 int IsBasicReservedWord(char *str);
    681679HBITMAP CreateGradationBitmap(SIZE *pSize,COLORREF color1,COLORREF color2);
    682680HBITMAP CreateVertGradationBitmap(SIZE *pSize,COLORREF color1,COLORREF color2);
  • trunk/ab5.0/abdev/abdev/DrawBuffer.cpp

    r655 r681  
    410410
    411411            //複数行に渡るコメントを考慮
    412             if(pBuf[i]=='/'&&pBuf[i+1]=='*'&&IsStr==0&&dwComment==0){
     412            if( memicmp( pBuf+i, ActiveBasic::IDE::Program::ablang->GetSyntax().commentMultiBegin.c_str(), ActiveBasic::IDE::Program::ablang->GetSyntax().commentMultiBegin.size() ) == 0
     413                && IsStr == 0
     414                && dwComment == 0 )
     415            {
     416                // /*
    413417                dwComment=12;
    414418                bMultiLineComment=1;
    415419            }
    416             if(pBuf[i]=='*'&&pBuf[i+1]=='/'&&
    417                 dwComment==10&&bMultiLineComment){
     420            if( memicmp( pBuf+i, ActiveBasic::IDE::Program::ablang->GetSyntax().commentMultiEnd.c_str(), ActiveBasic::IDE::Program::ablang->GetSyntax().commentMultiEnd.size() ) == 0
     421                && dwComment == 10
     422                && bMultiLineComment )
     423            {
     424                // */
    418425                dwComment=3;
    419426            }
    420427
    421428            //単行コメント
    422             if(pBuf[i]=='\''&&dwComment==0&&IsStr==0){
     429            if( memicmp( pBuf+i, ActiveBasic::IDE::Program::ablang->GetSyntax().commentSingle.c_str(), ActiveBasic::IDE::Program::ablang->GetSyntax().commentSingle.size() ) == 0
     430                && dwComment == 0
     431                && IsStr == 0 )
     432            {
     433                // '
    423434                dwComment=10;
    424435                bMultiLineComment=0;
  • trunk/ab5.0/abdev/abdev/ParameterHint.cpp

    r655 r681  
    7272    int CmdValue;
    7373
    74     CmdValue=IsBasicReservedWord(Command);
    75     if(CmdValue==COM_ABSTRACT)          lstrcpy(MethodCheckInfo.msg,"Abstract Sub/Function ([arglist]) [As type]]");
    76     else if(CmdValue==COM_BEEP)         lstrcpy(MethodCheckInfo.msg,"Beep");
    77     else if(CmdValue==COM_CHDIR)        lstrcpy(MethodCheckInfo.msg,"ChDir directory$");
    78     else if(CmdValue==COM_CIRCLE)       lstrcpy(MethodCheckInfo.msg,"Circle (x, y), radius, [color], [start], [end], [aspect], [f], [brushcolor]");
    79     else if(CmdValue==COM_CLOSE)        lstrcpy(MethodCheckInfo.msg,"Close [filenumber]");
    80     else if(CmdValue==COM_CLASS)        lstrcpy(MethodCheckInfo.msg,"Class name");
    81     else if(CmdValue==COM_CLS)          lstrcpy(MethodCheckInfo.msg,"Cls [number]");
    82     else if(CmdValue==COM_COLOR)        lstrcpy(MethodCheckInfo.msg,"Color color, [backcolor]");
    83     else if(CmdValue==COM_CONST)        lstrcpy(MethodCheckInfo.msg,"Const constname = expression");
    84     else if(CmdValue==COM_DEBUG)        lstrcpy(MethodCheckInfo.msg,"Debug");
    85     else if(CmdValue==COM_DECLARE)      lstrcpy(MethodCheckInfo.msg,"Declare Sub/Function name Lib \"libname\" [Alias \"aliasname\"] ([arglist]) [As type]]");
    86     else if(CmdValue==COM_DEF)          lstrcpy(MethodCheckInfo.msg,"Def func([parms] [,parms2])=expression");
    87     else if(CmdValue==COM_DIM)          lstrcpy(MethodCheckInfo.msg,"Dim variable [(subscripts)] As type, ...");
    88     else if(CmdValue==COM_END)          lstrcpy(MethodCheckInfo.msg,"End [type]");
    89     else if(CmdValue==COM_ENUM)         lstrcpy(MethodCheckInfo.msg,"Enum name");
    90     else if(CmdValue==COM_FIELD)        lstrcpy(MethodCheckInfo.msg,"Field #filenumber, fieldbyte");
    91     else if(CmdValue==COM_FOR)          lstrcpy(MethodCheckInfo.msg,"For variable=start To end [Step step]");
    92     else if(CmdValue==COM_FUNCTION)     lstrcpy(MethodCheckInfo.msg,"Function name ([arglist]) [As type]");
    93     else if(CmdValue==COM_GET)          lstrcpy(MethodCheckInfo.msg,"Get #filenumber, recode, StrBuffer");
    94     else if(CmdValue==COM_GOSUB)        lstrcpy(MethodCheckInfo.msg,"GoSub label");
    95     else if(CmdValue==COM_GOTO)         lstrcpy(MethodCheckInfo.msg,"Goto label");
    96     else if(CmdValue==COM_IF)           lstrcpy(MethodCheckInfo.msg,"If judgment Then truecommand [Else falsecommand]");
    97     else if(CmdValue==COM_INHERITS)     lstrcpy(MethodCheckInfo.msg,"Inherits BaseClass");
    98     else if(CmdValue==COM_INPUT)        lstrcpy(MethodCheckInfo.msg,"Input [# filenumber, ] variable, [...]");
    99     else if(CmdValue==COM_INTERFACE)    lstrcpy(MethodCheckInfo.msg,"Interface name");
    100     else if(CmdValue==COM_KILL)         lstrcpy(MethodCheckInfo.msg,"Kill filename$");
    101     else if(CmdValue==COM_LET)          lstrcpy(MethodCheckInfo.msg,"[Let] variable = expression");
    102     else if(CmdValue==COM_LINE)         lstrcpy(MethodCheckInfo.msg,"Line [(sx, sy)] -[Step] (ex, ey), [color], [B/Bf], [color2]");
    103     else if(CmdValue==COM_LOCATE)       lstrcpy(MethodCheckInfo.msg,"Locate x, y");
    104     else if(CmdValue==COM_LOOP)         lstrcpy(MethodCheckInfo.msg,"Loop while/until judgment");
    105     else if(CmdValue==COM_MKDIR)        lstrcpy(MethodCheckInfo.msg,"MkDir directory$");
    106     else if(CmdValue==COM_MSGBOX)       lstrcpy(MethodCheckInfo.msg,"MsgBox hWnd, String$, [Title$], [BoxType], [retAns]");
    107     else if(CmdValue==COM_NAMESPACE)    lstrcpy(MethodCheckInfo.msg,"Namespace namespaceStr");
    108     else if(CmdValue==COM_NEXT)         lstrcpy(MethodCheckInfo.msg,"Next");
    109     else if(CmdValue==COM_OPEN)         lstrcpy(MethodCheckInfo.msg,"Open filename$ [For Input/Output/Append] As number");
    110     else if(CmdValue==COM_PAINT)        lstrcpy(MethodCheckInfo.msg,"Paint (x, y), brushcolor, [linecolor]");
    111     else if(CmdValue==COM_PRINT)        lstrcpy(MethodCheckInfo.msg,"Print outdata, [...]");
    112     else if(CmdValue==COM_PRIVATE)      lstrcpy(MethodCheckInfo.msg,"Private");
    113     else if(CmdValue==COM_PROTECTED)    lstrcpy(MethodCheckInfo.msg,"Protected");
    114     else if(CmdValue==COM_PSET)         lstrcpy(MethodCheckInfo.msg,"PSet (x, y), [color]");
    115     else if(CmdValue==COM_PUBLIC)       lstrcpy(MethodCheckInfo.msg,"Public");
    116     else if(CmdValue==COM_PUT)          lstrcpy(MethodCheckInfo.msg,"Put #filenumber, recode, StrBuffer");
    117     else if(CmdValue==COM_RANDOMIZE)    lstrcpy(MethodCheckInfo.msg,"Randomize [number]");
    118     else if(CmdValue==COM_REM)          lstrcpy(MethodCheckInfo.msg,"Rem [comment]");
    119     else if(CmdValue==COM_RETURN)       lstrcpy(MethodCheckInfo.msg,"Return");
    120     else if(CmdValue==COM_SELECT)       lstrcpy(MethodCheckInfo.msg,"Select Case testexpression");
    121     else if(CmdValue==COM_SUB)          lstrcpy(MethodCheckInfo.msg,"Sub name ([arglist])");
    122     else if(CmdValue==COM_TYPE)         lstrcpy(MethodCheckInfo.msg,"Type name");
    123     else if(CmdValue==COM_TYPEDEF)      lstrcpy(MethodCheckInfo.msg,"TypeDef newtype = basetype");
    124     else if(CmdValue==COM_VIRTUAL)      lstrcpy(MethodCheckInfo.msg,"Virtual Sub/Function ([arglist]) [As type]]");
    125     else if(CmdValue==COM_OVERRIDE)     lstrcpy(MethodCheckInfo.msg,"Override Sub/Function ([arglist]) [As type]]");
    126     else if(CmdValue==COM_WEND)         lstrcpy(MethodCheckInfo.msg,"Wend");
    127     else if(CmdValue==COM_WHILE)        lstrcpy(MethodCheckInfo.msg,"While judgment");
    128     else if(CmdValue==COM_WINDOW)       lstrcpy(MethodCheckInfo.msg,"Window hWnd, OwnerWnd, x, y, width, height, title$, style, [class$], [ID], [callbackfunction], [ExStyle]");
    129     else if(CmdValue==COM_WITH)         lstrcpy(MethodCheckInfo.msg,"With object");
    130     else if(CmdValue==COM_WRITE)        lstrcpy(MethodCheckInfo.msg,"Write [data, ...]");
    131     else return 0;
    132     return 1;
     74    if( ActiveBasic::IDE::Program::ablang->IsExistReservedKeywordWithQuickHelp( Command ) )
     75    {
     76        lstrcpy( MethodCheckInfo.msg, ActiveBasic::IDE::Program::ablang->GetReservedKeywordWithQuickHelp( Command ).c_str() );
     77        return 1;
     78    }
     79
     80    return 0;
    13381}
    13482
  • trunk/ab5.0/abdev/abdev/Replace.cpp

    r655 r681  
    5151
    5252            //予約語(青色)
    53             BOOL bResult=0;
    54             if(DocType==WNDTYPE_BASIC){
    55                 i2=IsBasicReservedWord(pTemp);
    56                 bResult=IsManagementCommand(i2);
    57             }
    58             else if(DocType==WNDTYPE_HTML) bResult=IsHtmlReservedWord(pTemp);
    59 
    60             if(bResult){
     53            bool result = false;
     54            if(DocType==WNDTYPE_BASIC)
     55            {
     56                result = ActiveBasic::IDE::Program::ablang->IsExistKeyword( pTemp );
     57            }
     58            else if(DocType==WNDTYPE_HTML) result=IsHtmlReservedWord(pTemp);
     59
     60            if(result){
    6161                for(i2=cr2.cpMin;i2<cr2.cpMax;i2++){
    6262                    MdiInfo[WndNum]->pMdiTextEdit->pColorRef[i2]=tci.rgbStatement;
     
    6464            }
    6565        }
    66         if(IsStr||pBuf[i]=='\"'&&IsStr==0){
     66        if(IsStr||ActiveBasic::IDE::Program::ablang->IsQuoteMark( pBuf[i] )&&IsStr==0){
    6767            //文字列カラー(""で囲まれる範囲)
    6868            MdiInfo[WndNum]->pMdiTextEdit->pColorRef[i]=tci.rgbString;
    6969        }
    7070        if(pBuf[i]=='\0') break;
    71         if(pBuf[i]=='\"') IsStr^=1;
     71        if( ActiveBasic::IDE::Program::ablang->IsQuoteMark( pBuf[i] ) )
     72        {
     73            IsStr^=1;
     74        }
    7275        if(pBuf[i]=='\r'&&pBuf[i+1]=='\n'){
    7376            i++;
  • trunk/ab5.0/abdev/abdev/SubOperation.cpp

    r655 r681  
    413413    return ans;
    414414}
    415 BOOL IsManagementCommand(int ComNum){
    416     switch(ComNum){
    417         case -1:
    418         case COM_ABSTRACT:
    419         case COM_CLASS:
    420         case COM_CONST:
    421         case COM_DEBUG:
    422         case COM_DECLARE:
    423         case COM_DEF:
    424         case COM_DIM:
    425         case COM_DO:
    426         case COM_END:
    427         case COM_ENUM:
    428         case COM_FOR:
    429         case COM_FUNCTION:
    430         case COM_GOSUB:
    431         case COM_GOTO:
    432         case COM_IF:
    433         case COM_INHERITS:
    434         case COM_INTERFACE:
    435         case COM_LOOP:
    436         case COM_NAMESPACE:
    437         case COM_NEXT:
    438         case COM_PRIVATE:
    439         case COM_PROTECTED:
    440         case COM_PUBLIC:
    441         case COM_RETURN:
    442         case COM_SELECT:
    443         case COM_SUB:
    444         case COM_TRY:
    445         case COM_TYPE:
    446         case COM_TYPEDEF:
    447         case COM_VIRTUAL:
    448         case COM_OVERRIDE:
    449         case COM_WEND:
    450         case COM_WHILE:
    451         case COM_WITH:
    452             return 1;
    453         default:
    454             break;
    455     }
    456     return 0;
    457 }
    458 int IsBasicReservedWord(char *str){
    459     if(str[0]=='a'||str[0]=='A'){
    460         if(lstrcmpi(str,"Abstract")==0) return COM_ABSTRACT;
    461         if(lstrcmpi(str,"As")==0) return -1;
    462     }
    463     else if(str[0]=='b'||str[0]=='B'){
    464         if(lstrcmpi(str,"Beep")==0) return COM_BEEP;
    465         if(lstrcmp(str,"Boolean")==0) return -1;
    466         if(lstrcmpi(str,"ByRef")==0) return -1;
    467         if(lstrcmpi(str,"ByVal")==0) return -1;
    468         if(lstrcmp(str,"Byte")==0) return -1;
    469     }
    470     else if(str[0]=='c'||str[0]=='C'){
    471         if(lstrcmpi(str,"Catch")==0) return -1;
    472         if(lstrcmpi(str,"Case")==0) return -1;
    473         if(lstrcmp(str,"Char")==0) return -1;
    474         if(lstrcmpi(str,"ChDir")==0) return COM_CHDIR;
    475         if(lstrcmpi(str,"Circle")==0) return COM_CIRCLE;
    476         if(lstrcmpi(str,"Class")==0) return COM_CLASS;
    477         if(lstrcmpi(str,"Close")==0) return COM_CLOSE;
    478         if(lstrcmpi(str,"Cls")==0) return COM_CLS;
    479         if(lstrcmpi(str,"Color")==0) return COM_COLOR;
    480         if(lstrcmpi(str,"Const")==0) return COM_CONST;
    481         if(lstrcmpi(str,"Continue")==0) return -1;
    482     }
    483     else if(str[0]=='d'||str[0]=='D'){
    484         if(lstrcmpi(str,"Debug")==0) return COM_DEBUG;
    485         if(lstrcmpi(str,"Declare")==0) return COM_DECLARE;
    486         if(lstrcmpi(str,"Def")==0) return COM_DEF;
    487         if(lstrcmpi(str,"Delegate")==0) return -1;
    488         if(lstrcmpi(str,"Delete")==0) return -1;
    489         if(lstrcmpi(str,"DelWnd")==0) return COM_DELWND;
    490         if(lstrcmpi(str,"Dim")==0) return COM_DIM;
    491         if(lstrcmpi(str,"Do")==0) return COM_DO;
    492         if(lstrcmp(str,"Double")==0) return -1;
    493         if(lstrcmp(str,"DWord")==0) return -1;
    494     }
    495     else if(str[0]=='e'||str[0]=='E'){
    496         if(lstrcmpi(str,"Else")==0) return -1;
    497         if(lstrcmpi(str,"ElseIf")==0) return -1;
    498         if(lstrcmpi(str,"End")==0) return COM_END;
    499         if(lstrcmpi(str,"EndIf")==0) return -1;
    500         if(lstrcmpi(str,"EndFunction")==0) return -1;
    501         if(lstrcmpi(str,"EndSub")==0) return -1;
    502         if(lstrcmpi(str,"EndType")==0) return -1;
    503         if(lstrcmpi(str,"EndSelect")==0) return -1;
    504         if(lstrcmpi(str,"EndWith")==0) return -1;
    505         if(lstrcmpi(str,"Enum")==0) return COM_ENUM;
    506         if(lstrcmpi(str,"Exit")==0) return -1;
    507         if(lstrcmpi(str,"ExitDo")==0) return -1;
    508         if(lstrcmpi(str,"ExitFor")==0) return -1;
    509         if(lstrcmpi(str,"ExitFunction")==0) return -1;
    510         if(lstrcmpi(str,"ExitSub")==0) return -1;
    511         if(lstrcmpi(str,"ExitWhile")==0) return -1;
    512     }
    513     else if(str[0]=='f'||str[0]=='F'){
    514         if(lstrcmp(str,"False")==0) return -1;
    515         if(lstrcmpi(str,"Field")==0) return COM_FIELD;
    516         if(lstrcmpi(str,"Finally")==0) return -1;
    517         if(lstrcmpi(str,"For")==0) return COM_FOR;
    518         if(lstrcmpi(str,"Foreach")==0) return -1;
    519         if(lstrcmpi(str,"Function")==0) return COM_FUNCTION;
    520     }
    521     else if(str[0]=='g'||str[0]=='G'){
    522         if(lstrcmpi(str,"Get")==0) return COM_GET;
    523         if(lstrcmpi(str,"GoSub")==0) return COM_GOSUB;
    524         if(lstrcmpi(str,"Goto")==0) return COM_GOTO;
    525     }
    526     else if(str[0]=='i'||str[0]=='I'){
    527         if(lstrcmpi(str,"If")==0) return COM_IF;
    528         if(lstrcmpi(str,"Imports")==0) return -1;
    529         if(lstrcmpi(str,"Implements")==0) return -1;
    530         if(lstrcmpi(str,"In")==0) return -1;
    531         if(lstrcmpi(str,"Inherits")==0) return COM_INHERITS;
    532         if(lstrcmpi(str,"Input")==0) return COM_INPUT;
    533         if(lstrcmp(str,"Int64")==0) return -1;
    534         if(lstrcmp(str,"Integer")==0) return -1;
    535         if(lstrcmpi(str,"Interface")==0) return COM_INTERFACE;
    536     }
    537     else if(str[0]=='k'||str[0]=='K'){
    538         if(lstrcmpi(str,"Kill")==0) return COM_KILL;
    539     }
    540     else if(str[0]=='l'||str[0]=='L'){
    541         if(lstrcmpi(str,"Let")==0) return COM_LET;
    542         if(lstrcmpi(str,"Line")==0) return COM_LINE;
    543         if(lstrcmpi(str,"Locate")==0) return COM_LOCATE;
    544         if(lstrcmp(str,"Long")==0) return -1;
    545         if(lstrcmpi(str,"Loop")==0) return COM_LOOP;
    546     }
    547     else if(str[0]=='m'||str[0]=='M'){
    548         if(lstrcmpi(str,"MkDir")==0) return COM_MKDIR;
    549         if(lstrcmpi(str,"MsgBox")==0) return COM_MSGBOX;
    550     }
    551     else if(str[0]=='n'||str[0]=='N'){
    552         if(lstrcmpi(str,"Namespace")==0) return COM_NAMESPACE;
    553         if(lstrcmpi(str,"Next")==0) return COM_NEXT;
    554         if(lstrcmpi(str,"New")==0) return -1;
    555         if(lstrcmpi(str,"Nothing")==0) return -1;
    556     }
    557     else if(str[0]=='o'||str[0]=='O'){
    558         if(lstrcmp(str,"Object")==0) return -1;
    559         if(lstrcmpi(str,"Open")==0) return COM_OPEN;
    560         if(lstrcmpi(str,"Operator")==0) return -1;
    561         if(lstrcmpi(str,"Override")==0) return COM_OVERRIDE;
    562     }
    563     else if(str[0]=='p'||str[0]=='P'){
    564         if(lstrcmpi(str,"Paint")==0) return COM_PAINT;
    565         if(lstrcmpi(str,"Print")==0) return COM_PRINT;
    566         if(lstrcmpi(str,"Private")==0) return COM_PRIVATE;
    567         if(lstrcmpi(str,"Protected")==0) return COM_PROTECTED;
    568         if(lstrcmpi(str,"PSet")==0) return COM_PSET;
    569         if(lstrcmpi(str,"Put")==0) return COM_PUT;
    570         if(lstrcmpi(str,"Public")==0) return COM_PUBLIC;
    571     }
    572     else if(str[0]=='q'||str[0]=='Q'){
    573         if(lstrcmp(str,"QWord")==0) return -1;
    574     }
    575     else if(str[0]=='r'||str[0]=='R'){
    576         if(lstrcmpi(str,"Randomize")==0) return COM_RANDOMIZE;
    577         if(lstrcmpi(str,"Rem")==0) return COM_REM;
    578         if(lstrcmpi(str,"Return")==0) return COM_RETURN;
    579     }
    580     else if(str[0]=='s'||str[0]=='S'){
    581         if(lstrcmp(str,"SByte")==0) return -1;
    582         if(lstrcmpi(str,"Select")==0) return COM_SELECT;
    583         if(lstrcmpi(str,"SelectCase")==0) return COM_SELECT;
    584         if(lstrcmp(str,"Single")==0) return -1;
    585         if(lstrcmpi(str,"Sleep")==0) return COM_SLEEP;
    586         if(lstrcmp(str,"Static")==0) return -1;
    587         if(lstrcmpi(str,"Step")==0) return -1;
    588         if(lstrcmp(str,"String")==0) return -1;
    589         if(lstrcmpi(str,"Sub")==0) return COM_SUB;
    590         if(lstrcmpi(str,"Super")==0) return -1;
    591     }
    592     else if(str[0]=='t'||str[0]=='T'){
    593         if(lstrcmpi(str,"Then")==0) return -1;
    594         if(lstrcmpi(str,"This")==0) return -1;
    595         if(lstrcmpi(str,"Throw")==0) return -1;
    596         if(lstrcmpi(str,"To")==0) return -1;
    597         if(lstrcmp(str,"True")==0) return -1;
    598         if(lstrcmp(str,"Try")==0) return COM_TRY;
    599         if(lstrcmpi(str,"Type")==0) return COM_TYPE;
    600         if(lstrcmpi(str,"TypeDef")==0) return COM_TYPEDEF;
    601     }
    602     else if(str[0]=='u'||str[0]=='U'){
    603         if(lstrcmpi(str,"Until")==0) return -1;
    604     }
    605     else if(str[0]=='v'||str[0]=='V'){
    606         if(lstrcmpi(str,"Virtual")==0) return COM_VIRTUAL;
    607     }
    608     else if(str[0]=='w'||str[0]=='W'){
    609         if(lstrcmpi(str,"Wend")==0) return COM_WEND;
    610         if(lstrcmpi(str,"While")==0) return COM_WHILE;
    611         if(lstrcmpi(str,"Window")==0) return COM_WINDOW;
    612         if(lstrcmpi(str,"With")==0) return COM_WITH;
    613         if(lstrcmp(str,"Word")==0) return -1;
    614         if(lstrcmpi(str,"Write")==0) return COM_WRITE;
    615     }
    616     else if(str[0]=='#'){
    617         if(lstrcmpi(str,"#include")==0) return -1;
    618         if(lstrcmpi(str,"#strict")==0) return -1;
    619         if(lstrcmpi(str,"#console")==0) return -1;
    620         if(lstrcmpi(str,"#prompt")==0) return -1;
    621         if(lstrcmpi(str,"#N88BASIC")==0) return -1;
    622         if(lstrcmpi(str,"#define")==0) return -1;
    623         if(lstrcmpi(str,"#ifdef")==0) return -1;
    624         if(lstrcmpi(str,"#ifndef")==0) return -1;
    625         if(lstrcmpi(str,"#else")==0) return -1;
    626         if(lstrcmpi(str,"#endif")==0) return -1;
    627     }
    628     return 0;
    629 }
    630 
    631415HBITMAP CreateGradationBitmap(SIZE *pSize,COLORREF color1,COLORREF color2){
    632416    //グラデーションビットマップを生成
  • trunk/ab5.0/abdev/abdev/TextEditor.cpp

    r629 r681  
    109109            }
    110110
    111             BOOL bResult=0;
    112             if(MdiInfo[WndNum]->DocType==WNDTYPE_BASIC){
    113                 i3=IsBasicReservedWord(str);
    114                 bResult=IsManagementCommand(i3);
     111            bool result = false;
     112            if(MdiInfo[WndNum]->DocType==WNDTYPE_BASIC)
     113            {
     114                result = ActiveBasic::IDE::Program::ablang->IsExistKeyword( str );
    115115            }
    116116            else if(MdiInfo[WndNum]->DocType==WNDTYPE_HTML){
    117                 bResult=IsHtmlReservedWord(str);
    118             }
    119 
    120             if(bResult){
     117                result=IsHtmlReservedWord(str);
     118            }
     119
     120            if(result){
    121121                for(i3=i-i2;i3<i;i3++){
    122122                    MdiInfo[WndNum]->pMdiTextEdit->pColorRef[i3]=tci.rgbStatement;
     
    132132        }
    133133        else{
    134             if(IsStr||pBuf[i]=='\"'&&IsStr==0){
     134            if( IsStr || ActiveBasic::IDE::Program::ablang->IsQuoteMark( pBuf[i] ) && IsStr == 0 )
     135            {
    135136                //文字列カラー(""で囲まれる範囲)
    136137                MdiInfo[WndNum]->pMdiTextEdit->pColorRef[i]=tci.rgbString;
     
    142143        }
    143144
    144         if(pBuf[i]=='\"') IsStr^=1;
     145        if( ActiveBasic::IDE::Program::ablang->IsQuoteMark( pBuf[i] ) )
     146        {
     147            IsStr^=1;
     148        }
    145149
    146150        if(pBuf[i]=='\r'&&pBuf[i+1]=='\n'){
  • trunk/ab5.0/abdev/abdev/abdev.vcproj

    r655 r681  
    5151                InlineFunctionExpansion="1"
    5252                AdditionalIncludeDirectories="..\..\;..\..\cpplibs\boost;..\..\cpplibs\WTL80\include;.\include"
    53                 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;JPN;THETEXT;WINVER=0x0501;_WIN32_WINNT=0x0501"
     53                PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;JPN;THETEXT;WINVER=0x0501;_WIN32_WINNT=0x0501;TIXML_USE_STL"
    5454                StringPooling="false"
    5555                RuntimeLibrary="0"
     
    7878            <Tool
    7979                Name="VCLinkerTool"
    80                 AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib imm32.lib htmlhelp.lib rpcrt4.lib imagehlp.lib"
     80                AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib imm32.lib htmlhelp.lib rpcrt4.lib imagehlp.lib tinyxml_STL.lib"
    8181                OutputFile="../TheText/TheText.exe"
    8282                LinkIncremental="1"
     
    150150                Optimization="0"
    151151                AdditionalIncludeDirectories="..\..\;..\..\cpplibs\boost;..\..\cpplibs\WTL80\include;.\include"
    152                 PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;JPN;WINVER=0x0501;_WIN32_WINNT=0x0501"
     152                PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;JPN;WINVER=0x0501;_WIN32_WINNT=0x0501;TIXML_USE_STL"
    153153                MinimalRebuild="true"
    154154                BasicRuntimeChecks="3"
     
    177177            <Tool
    178178                Name="VCLinkerTool"
    179                 AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib imm32.lib htmlhelp.lib rpcrt4.lib imagehlp.lib"
     179                AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib imm32.lib htmlhelp.lib rpcrt4.lib imagehlp.lib tinyxmld_STL.lib"
    180180                OutputFile="$(OutDir)\abdev.exe"
    181181                LinkIncremental="2"
     
    251251                InlineFunctionExpansion="1"
    252252                AdditionalIncludeDirectories="..\..\;..\..\cpplibs\boost;..\..\cpplibs\WTL80\include;.\include"
    253                 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;JPN;WINVER=0x0501;_WIN32_WINNT=0x0501"
     253                PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;JPN;WINVER=0x0501;_WIN32_WINNT=0x0501;TIXML_USE_STL"
    254254                StringPooling="true"
    255255                RuntimeLibrary="0"
     
    277277            <Tool
    278278                Name="VCLinkerTool"
    279                 AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib imm32.lib htmlhelp.lib rpcrt4.lib imagehlp.lib"
     279                AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib imm32.lib htmlhelp.lib rpcrt4.lib imagehlp.lib tinyxml_STL.lib"
    280280                OutputFile="$(OutDir)\abdev.exe"
    281281                LinkIncremental="1"
     
    349349                Optimization="0"
    350350                AdditionalIncludeDirectories="..\..\;..\..\cpplibs\boost;..\..\cpplibs\WTL80\include;.\include"
    351                 PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;JPN;THETEXT;WINVER=0x0501;_WIN32_WINNT=0x0501"
     351                PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;JPN;THETEXT;WINVER=0x0501;_WIN32_WINNT=0x0501;TIXML_USE_STL"
    352352                MinimalRebuild="true"
    353353                BasicRuntimeChecks="3"
     
    376376            <Tool
    377377                Name="VCLinkerTool"
    378                 AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib imm32.lib htmlhelp.lib rpcrt4.lib imagehlp.lib"
     378                AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib imm32.lib htmlhelp.lib rpcrt4.lib imagehlp.lib tinyxmld_STL.lib"
    379379                OutputFile="../TheText/TheText.exe"
    380380                LinkIncremental="2"
     
    438438                    <File
    439439                        RelativePath=".\src\WindowComponents\PartialManager\TextEditPartialManager.cpp"
     440                        >
     441                    </File>
     442                </Filter>
     443                <Filter
     444                    Name="CodeEditor"
     445                    >
     446                    <File
     447                        RelativePath=".\src\WindowComponents\CodeEditor\Syntax.cpp"
    440448                        >
    441449                    </File>
     
    27812789                    Name="MdiChildFrame"
    27822790                    >
     2791                </Filter>
     2792                <Filter
     2793                    Name="CodeEditor"
     2794                    >
     2795                    <File
     2796                        RelativePath=".\include\WindowComponents\CodeEditor\Syntax.h"
     2797                        >
     2798                    </File>
    27832799                </Filter>
    27842800            </Filter>
  • trunk/ab5.0/abdev/abdev/include/Program.h

    r629 r681  
    99    static void InitializeWindow();
    1010public:
     11    static CAppModule _Module;
    1112    static MainFrame mainFrame;
    12     static CAppModule _Module;
     13    static WindowComponents::CodeEditor::Languages languages;
     14
     15    // 一時的な対処
     16    static const WindowComponents::CodeEditor::Language *ablang;
    1317
    1418    static void Main();
  • trunk/ab5.0/abdev/abdev/src/Program.cpp

    r629 r681  
    77
    88MainFrame ActiveBasic::IDE::Program::mainFrame;
     9WindowComponents::CodeEditor::Languages ActiveBasic::IDE::Program::languages;
     10const WindowComponents::CodeEditor::Language *ActiveBasic::IDE::Program::ablang;
    911
    1012#include "../Common.h"
     
    3234    _Module.AddMessageLoop( &loop );
    3335
     36    // syntaxを読み込む
     37    languages.LoadFiles( ActiveBasic::Common::Environment::GetAbdevSystemDirPath() + "\\ide\\syntax" );
     38    ablang = &languages["ab"];
     39
    3440    // ウィンドウを初期化
    3541    InitializeWindow();
  • trunk/ab5.0/abdev/abdev/stdafx.h

    r655 r681  
    3535#include <boost/thread/thread.hpp>
    3636
     37// tinyxml
     38#include <tinyxml/tinyxml.h>
     39
    3740#include <jenga/include/jenga.h>
    3841
     
    4548#endif
    4649
     50#include <WindowComponents/CodeEditor/Syntax.h>
    4751#include <WindowComponents/BaseWindow.h>
    4852#include <WindowComponents/MdiChild.h>
Note: See TracChangeset for help on using the changeset viewer.