Hunter的大杂烩 技术学习笔记

2005-10-29

some tips

Filed under: Linux — hunter @ 8:04 pm

Libraries have been installed in:
/usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR’
flag during linking and do at least one of the following:
– add LIBDIR to the `LD_LIBRARY_PATH’ environment variable
during execution
– add LIBDIR to the `LD_RUN_PATH’ environment variable
during linking
– use the `-Wl,–rpath -Wl,LIBDIR’ linker flag
– have your system administrator add LIBDIR to `/etc/ld.so.conf’

安装axis c++版心得

Filed under: C++ — hunter @ 7:49 pm

先要准备好
Xerces C++ (2.2.0) XML parser
Apache ANT
Available from http://ant.apache.org
These scripts have been developed and tested using version 1.6.x
Java SDK – required for running of ANT scripts, and the compilation of WSDL2Ws tool
Require version 1.4+
Ant-Contrib – provide numerous extensions to ANT, including the compilation of C/C++.
Available from http://ant-contrib.sourceforge.net
Place JARs into [ANT INSTALL DIR]/lib.
Require both ant-contrib (v0.6) and cpptasks (v1.0beta3)
Doxygen – Used for generating API documentation
Available from http://www.doxygen.org
Compiler / Linker
gcc 2.95.3

以上软件的安装都比较简单,在axis文档中都描述,不多说了

以下是在编译axis之前必须设置的一些环境变量

#axis source的解压目录
export AXISCPP_HOME=/usr/local/src/axis-c-1.5.0-linux-src/
#axis binary 安装目录
export AXISCPP_DEPLOY=/usr/obj
export LD_LIBRARY_PATH=/usr/local/xerces/lib:$AXISCPP_DEPLOY/bin:$LD_LIBRARY_PATH
export ANT_HOME =/usr/local/ant/
export JAVA_HOME=/usr/local/java/
export XERCES_HOME=/usr/local/xerces/
export APACHE2_HOME=/usr/local/apache/
export AXISJAVA_LIB=/usr/local/src/axis-c-1.5.0-linux-src/lib/axisjava/
export AXIS_JARS_HOME=”$AXISCPP_HOME/lib/axisjava”
export AXIS_JARS=”$AXIS_JARS_HOME/axis-ant.jar:$AXIS_JARS_HOME/axis.jar:$AXIS_JARS_HOME/commons-discovery.jar:$AXIS_JARS_HOME/commons-logging.jar:$AXIS_JARS_HOME/jaxrpc.jar:$AXIS_JARS_HOME/log4j-1.2.4.jar:$AXIS_JARS_HOME/saaj.jar:$AXIS_JARS_HOME/wsdl4j.jar”
export CLASSPATH=”$CLASSPATH:./:$JAVA_HOME/lib:$AXIS_JARS:”

#以下是一些需要调整的编译选项,如果没有使用apache 1.3,就需要将apache13设置为false
Vi build/build.Linux.properties
server.apache13 = false
server.apache20 = true

#以下是编译失败的文件,需要做一些修改
src/transport/SOAPTransport.h
src/soap/xsd/IAnySimpleType.hpp
src/soap/xsd/DateTime.cpp
src/soap/xsd/Base64Binary.cpp
src/soap/xsd/NOTATION.cpp
src/wsdd/WSDDHandler.h
#以上文件需要添加 #include

#以下文件需要 change static_cast to (AXIS_PROTOCOL_TYPE)
src/cbindings/client/StubC.cpp
[cc] /usr/local/src/axis-c-1.5.0-linux-src/src/cbindings/client/StubC.cpp:41: static_cast from `AXISC_PROTOCOL_TYPE’ to `axiscpp::AXIS_PROTOCOL_TYPE’
[cc] /usr/local/src/axis-c-1.5.0-linux-src/src/cbindings/client/StubC.cpp: In function `void axiscSetTransportProtocol(void *, AXISC_PROTOCOL_TYPE)’:
[cc] /usr/local/src/axis-c-1.5.0-linux-src/src/cbindings/client/StubC.cpp:158: static_cast from `AXISC_PROTOCOL_TYPE’ to `axiscpp::AXIS_PROTOCOL_TYPE’
————————–>

2005-10-06

hhte road map

Filed under: HHTE — hunter @ 5:49 pm

1. 支持buffer
2. 支持if .. else .. fi
3. 支持内嵌函数
4. 支持最终结果 cache
5. 支持中间语法树cache
6. 优化binary size
7. 优化速度

hhte v1.0发布

Filed under: C++,Linux — hunter @ 5:44 pm

在原有的html template engine基础上,改写了语法分析功能,使用yacc/flex作为语法分析,以便提供更好的语法分析功能,并改名为“hunter’s html template engine” (hhte)
现在的功能类似一个script language(其实语法分析那块就是从PHP里面偷师回来的),跟原来最主要的区别就是,由于可以生成一个语法树,所以在output的时候,可以根据变量的替换顺序,自动把已经替换好的模板直接输出,以提高用户感,比如有一个html文件:
字符串A
变量A
字符串B
变量B

如果按以前的分析方法,需要把a,b都替换完之后,才一次性的output出去,但是使用了hhte之后,只要替换了变量a之后,程序会判断变量a之前是否还存在其他变量,如果没有,就将字符串a,变量a,字符串b一起输出
那用户的感觉就会页面显示速度很快了。
下载地址

2005-09-15

html模板引擎之yacc语法分析

Filed under: HHTE — hunter @ 11:51 am

%{
/*
* Copyright (c) 2005 Hunter
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the Hunter nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
* CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/*!
* \file hhte_template.l
* \brief H html template engine’s yacc parser, some code from php3.
* \author HunterLiu
* \date 2005-9-15
* \version 1.1
*/

#include “hhte_struct.h”
#include “hhte_template.tab.h”
#include “h_html_template.h”
#include
#include

#define YYDEBUG 1
extern CTemplate g_cHTemplate;
extern void end_hhte();
//void yyerror(const char *s);
void yyerror(const char *s)
{
fprintf(stderr, “%s\n”, s);
}

%}

%union {
char *sval;
}

%token HHTE_LOOP
%token HHTE_ECHO
%token HHTE_DONE
%token END_HHTE
%token INLINE_HTML
%token HHTE_STRING

%type label
%type var

%error-verbose
%%

statement_list:
statement_list statement
| /* empty */
;
statement:
‘{‘ statement_list ‘}’
| INLINE_HTML {
boost::shared_ptr cSymbol(new CStringSymbol($1));
g_cHTemplate.getSymbolManager()->addSymbol(cSymbol);
free($1);
}
| HHTE_LOOP label {
boost::shared_ptr cSymbol(new CLoopSymbol($2));
g_cHTemplate.getSymbolManager()->addSymbol(cSymbol);
free($2);
}
statement_list HHTE_DONE { g_cHTemplate.getSymbolManager()->setState(SYMBOL_DONE); }
| HHTE_ECHO var end_statement {
boost::shared_ptr cSymbol(new CTagSymbol($2));
g_cHTemplate.getSymbolManager()->addSymbol(cSymbol);
free($2);
}
| END_HHTE { end_hhte(); }
;

end_statement:
‘;’
| END_HHTE { end_hhte(); }
;

var:
‘$’ HHTE_STRING { $$=$2; }
;

label: ‘:’HHTE_STRING {
$$=$2;
}
;

%%

« Newer PostsOlder Posts »

Powered by WordPress