[原创] 实用工具 在BBS中高亮显示C/C++中的关键字

[复制链接]
18578|39
 楼主| lxyppc 发表于 2009-9-18 17:52 | 显示全部楼层 |阅读模式
本帖最后由 lxyppc 于 2012-5-25 17:22 编辑

CodePaint 1.1 源代码
CodePaint 1.1 可执行程序

由VS2003编译 2
词法分析部分是由lex编写
文件包中包含lex编译程序"flex.exe"

编译过程
1. 用CFlex.bat调用flex.exe,把Parser.l编译成Parser.cpp
2. 用VS编译工程

功能:
将C/C++中的关键字、字符串、数字以及注释用高亮的方式在论坛中显示出来
可以在代码前面加上行号,方便阅读

使用方法:
将源代码粘贴至上面的文本框中,点击Convert按钮
在下面的文本框中会生成BBS中的代码,同时内容被复制到剪切板中,在论坛中粘贴即可

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
 楼主| lxyppc 发表于 2009-9-18 17:55 | 显示全部楼层
不带行号的效果
// The system calls this function to obtain the cursor to display while the user drags
//  the minimized window.
HCURSOR CUIParserDlg::OnQueryDragIcon()
{
        return static_cast<HCURSOR>(m_hIcon);
}

void CUIParserDlg::OnEnChangeRichedit21()
{
    // TODO:  If this is a RICHEDIT control, the control will not
    // send this notification unless you override the CDialog::OnInitDialog()
    // function and call CRichEditCtrl().SetEventMask()
    // with the ENM_CHANGE flag ORed into the mask.

    // TODO:  Add your control notification handler code here
}
huangqi412 发表于 2009-10-30 18:54 | 显示全部楼层
顶一贴
BitFu 发表于 2009-11-5 08:47 | 显示全部楼层
好东西!
kiton_law 发表于 2009-11-25 13:04 | 显示全部楼层
不错不错,这个要顶。
spydf 发表于 2010-1-3 10:01 | 显示全部楼层
记下来了
linhuaou 发表于 2010-2-1 18:30 | 显示全部楼层
juventus9554 发表于 2010-2-2 22:16 | 显示全部楼层
确实有用
bioe 发表于 2010-3-16 14:23 | 显示全部楼层
/*0001*/  if(GPIO_ReadInputPin(GPIOG, GPIO_PIN_2)==0x04)
john_light 发表于 2010-4-1 15:39 | 显示全部楼层
占首页观望:victory:
xuyiyi 发表于 2010-4-30 04:48 | 显示全部楼层
不错,有用,顶
huangsongyou 发表于 2010-11-24 11:46 | 显示全部楼层
chinadavinci 发表于 2010-12-10 10:28 | 显示全部楼层
:lol



[img]http://www.chinadavinci.com/gd/images/**2.gifwww.chinadavinci.com[/img]
chinadavinci 发表于 2010-12-10 10:29 | 显示全部楼层
adams.gh 发表于 2011-3-24 19:28 | 显示全部楼层
试试 哈

BYTE GetPINInfo(void)
{
    BYTE xdata k[0x20];                 //20101011
    WORD data key_id;
    BYTE data sw;

        if (0 == G_APDU_Ln)
        {
                if (G_APDU_P1)
                return SW6A86;

                key_id = PIN_TYPE_ID | G_APDU_P2;
            sw = Get_Key(k, key_id, 0x10);
            if (sw != SW9000)
                return sw;
                key_id = DFLT_PIN_TYPE_ID | G_APDU_P2;
            sw = Get_Key(G_APDU_Data, key_id, 0x10);
            if (sw != SW9000)
                return sw;

                if (UHL_MemCmp(k + KEY_VALUE_OFFSET, G_APDU_Data + KEY_VALUE_OFFSET, k[0] - 6))//PIN Changed
                        k[6] |= 0x80;

                UHL_MemSet(G_APDU_Data, 0x10, 0);
                G_APDU_Data[0] = k[5];
lixupengIC 发表于 2011-4-1 20:53 | 显示全部楼层
mark!!
wuguoyan 发表于 2011-4-17 17:20 | 显示全部楼层
piaoyrf 发表于 2011-7-15 10:46 | 显示全部楼层
lh0602 发表于 2011-12-6 14:03 | 显示全部楼层
icecut 发表于 2011-12-6 22:59 | 显示全部楼层
这种语法已经是不被推荐使用的了.都是使用style了.lz是最原始的方法,成为程序员噩梦的方法.

我做过更好的.不过不能公开.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

27

主题

2249

帖子

19

粉丝
快速回复 在线客服 返回列表 返回顶部