---
title: "JAVACC安装"
author: "wangdf_jee"
date: "2011-03-12T10:04:18Z"
tags: [".net", "Eclipse", "Java"]
categories: ["企业架构"]
slug: "javacc"
draft: false
lastmod: "2011-03-12T10:14:59Z"
id: 955026
url: "https://wangdf-jee.iteye.com/blog/955026"
---

JAVACC：Java Compiler Compiler 是一个用JAVA开发的最受欢迎的语法分析生成器。这个分析生成器工具可以读取上下文无关且有着特殊意义的语法并把它转换成可以识别且匹配该语法的JAVA程序。它还提供JJTree等工具来帮助我们建立语法树。JavaCC plug-in：一个用于辅助JavaCC应用程序开发的Eclipse插件．
1.如下两种方式来安装JAVACC
注意eclipse的版本一定要在3.5以上
a) use this site as an update site in Eclipse :
add http://eclipse-javacc.sourceforge.net/ to your software update sites and follow the instructions.
b) you can download from the JavaCC Eclipse Plug-in site on Sourceforge the (zipped) update site file,
save it under a local directory, add this directory as a local update site and follow the instructions.
2. 在eclipse中新建一个java project 
3. 右键点src目录新建other  ,找到Javacc Template File 新建.比如 test.jj
4. 右键点test.jj 选中Compile with JavaCC
   此时控制台会输出编译信息
 相关网站：
   http://eclipse-javacc.sourceforge.net/
   http://www.cs.lmu.edu/~ray/notes/javacc/
