Chinaunix首页 | 论坛 | 博客
  • 博客访问: 72972
  • 博文数量: 21
  • 博客积分: 1478
  • 博客等级: 上尉
  • 技术积分: 220
  • 用 户 组: 普通用户
  • 注册时间: 2007-08-22 20:41
文章分类

全部博文(21)

文章存档

2011年(1)

2010年(2)

2009年(18)

我的朋友

分类: LINUX

2009-03-16 17:42:01

    ANTLR, ANother Tool for Language Recognition, is a language tool that provides a framework for constructing recognizers, interpreters, compilers, and translators from grammatical descriptions containing actions in a variety of target language.(see  for more information).   It was writen in Java and requires JDK to compile java sources. You can download jdk from sun website.
   
    Download and install JDK and ANTLR is not difficult. For JDK, just download it from sun web site, run the bin file and it will begin to install automatically. As to ANTLR, just download the tar.gz file, and unpack it to the location you prefered to. 
     But it was not ENOUGH. They must be configured to work normally. The configurations here means to set the coresponding envirement varibles, such as $PATH and $CLASSPATH.

1. JDK Path

     I installed JDK in the location: /home/yyc/tools/, so the .bash_profile in my home directory was modified, with following path added: 

PATH=$PATH:$HOME/bin:\

/$HOME/tools/bin:\

/home/yyc/tools/bin:\

/home/yyc/tools/jdk1.6.0_12/jre/bin


2. CALSSPATH setting

    .bashrc in my home director was moddified to add required CLASSPATH, as follows:

exportCLASSPATH=$CLASSPATH:\

.\

:/home/yyc/ANTLR/antlr-3.1.2/lib/antlr-2.7.7.jar:\

/home/yyc/ANTLR/antlr-3.1.2/lib/antlr-3.1.2.jar:\

/home/yyc/ANTLR/antlr-3.1.2/lib/antlr-runtime-3.1.2.jar:\

/home/yyc/ANTLR/antlr-3.1.2/lib/stringtemplate-3.2.jar:\

/home/yyc/tools/jdk1.6.0_12/lib:\

/home/yyc/tools/jdk1.6.0_12/lib/tools.jar



    This is easy indeed, BUT notice there is a "." after the formar $CALSSPAH.
    DO NOT FORGET IT. Or, you will receive some error. (Which wasted me 1 hour to resolve this god damn problem).
阅读(665) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~