JavaCC : Java Glossary
Formerly known as Jack. JavaCC is a parser, like YACC (Yet Another Compiler Compiler),
except that is it written in Java and generates Java code. It started out handled by Sun, then by Metamata, then bought out by Webgain, who went
belly up. It is now an open source project. The current version is 5.0 Last
revised/verified: 2011-02-06. It is still the most popular parser written in Java. JavaCC
is similar to PCCTS. JavaCC is a LL(k) (top down) parser, whereas YACC is a LALR(1) (Look Ahead Left-to-Right
parse, single token look-ahead) (bottom up) parser, so the grammars look quite different. The documentation is quite readable, unlike most of its competition. The parser has some parsing speedup tricks like lookahead and custom code for the tricky bits.
JavaCC has stagnated. Most new parsers are written in ANTLR.
JavaCC is more intuitive, and better fit for getting your feet with with parsers.
It blew my mind when a little parser I wrote worked first time. It is much simpler than it first looks. The easiest way to learn is to study the *.jj example
grammar descriptions and to google for example source code for javacc code for grammars similar to what you want to tackle.
download JavaCC
4.0 free. Last revised/verified: 2007-04-20 The
download zip includes documentation, Jjtree and a number of simple *.jj example
grammar descriptions. Just unzip everything with embedded folder names into a Program Files directory.
It does not have an explicit installer. You will want to tweak javacc-4.0\bin\javacc.bat,
(the script that compiles your grammar descriptor into Java source code) and put
You write little methods that describe the various phrases of your grammar. They are a mixture of Java code and JavaCC grammatical BNF (Backus-Naur Form).
JavaCC then merges them and converts the whole thing into pure Java source code, with methods that will recognise the various phrases. When you compile that, you can parse text. In addition there are commands to describe the tokens of your language tokens
— the basic units/words.
Grammars
Dongwon Lee used to maintain a list of JavaCC grammars but abandoned the project. I wrote him, but he did not write back. I used the Wayback
Machine to recover some of his list from http://www.cobase.cs.ucla.edu/pub/javacc/ snapshoted
in 2007. Much of this material is quite
old, and perhaps Dongwon Lee intended for it to be discarded. Please pass on new submissions and updates.
The email addresses displayed below have been munged with Masker to
discourage spam harvesters. They are not copy/pastable or extractable from the HTML (HypertextMarkup Language),
so you will have to retype them into your email program, because they are *.png images
images, not text.
| JavaCC Grammars | |||||
|---|---|---|---|---|---|
| Grammar | Download | Author | Released | Version | Description |
| Ada | John R. Callahan | 1998-06-04 | Rudimentary Ada9x grammar. | ||
| ASN.1 | Helena Sarin | 1998-03-20 | ASN.1 grammar ITU Recommendation X.208. | ||
| C++ |
Theodore Norvell ![]() |
Javacc parser. Coming soon. | |||
| C++ | download | Sreenivasa Viswanadha | 1997-03-20 | 1.1 | Part of JavaCC package |
| C++ to HTML | download |
Theodore Norvell ![]() |
2001-01-01 | Applet to convert C++ code to HTML code, with syntax highlighting | |
| Curl | download | Doug South | 1997-03-21 | Part of JavaCC package | |
| DCL | Pat Martin | 2001-07-24 | 2.0 |
DCL - Dynamic Content Language: Welcome to the DCL homepage. DCL was a project born in frustration. Dealing with HTML pages within java programs can be quite tedious. Most of that which you are presenting doesn't change, only small regions of the content tend to need dynamic output. In addition, it’s difficult to come up with one solution to every problem without resorting to a full fledged language, and so DCL came to be… |
|
| DTD | download |
Theodore Norvell ![]() |
2011-02-09 | A JavaCC parser for content models as found in XML’s DTD files. It doesn’t parse the whole DTD file, because SAX can do that, but SAX doesn’t parse the content models. It may be out of date. | |
| DTD | download | John Gebbie | 2001-03-27 | Almost-complete grammar file to parse XML DTD 1.0. | |
| DU |
download download |
John D. Ramsdell | 1997-01-20 |
Part of JavaCC package. Parses the output from du (disk usage summarization program on UNIX) into nested parenthesized lists. The parser was developed for an old version of the Disk Usage Tree Map Viewer. The latest version does not run du as an inferior process, so the parser is no longer used. |
|
| EcmaScript | Jean-Marc Lugrin | 1998-10-17 | 1.0 |
FESI (pronounced fezz-y rhymes with fuzzy) is a full implementation of the EcmaScript language (defined in the standard ECMA 262 available at http://www.ecma.ch/ (edition of 1997-06). EcmaScript is largely equivalent to the JavaScript language version 1.1 or to the core part of JScript, but without the navigator specific extensions. |
|
| Express | download | Jason A. Goodman | 1998-10-26 | Grammar for the EXPRESS product representation language as defined in IS0 10303-1 which covers industrial automation systems and integration, product data representation and exchange. | |
| GDMO | download | Dermot Dwyer | 1999-04-19 | ISO/CCITT Guidelines for Definition of Managed Objects (GDMO) into UML. | |
| HEL |
Fabien Azavant Arnaud Sahuguet |
Part of World Wide Web Wrapper Factory (W4F) package. HEL (HTML Extraction Language) relies on the Document Object Model from W3C. An HTML document is a tree with a hierarchy of tags, with html as the root. HEL permits to describe extraction rules in terms of path-expressions along this tree. In addition, HEL has some regular expression capabilities to capture finer details of the document (like dates, numerical format, etc.) |
|||
| HTML | download | Part of JavaCC package. Covers HTML 3.2 specification. | |||
| HTML |
Brian Goetz ![]() |
1999-11-03 | 1.0 |
This is a JavaCC grammar for parsing HTML documents. It does not enforce the DTD, but instead builds a simple parse tree which can be used to validate, reformat, display, analyze, or edit the HTML document. The goal was to produce a parse tree which threw away very little information contained in the source file, so that by dumping the parse tree, an almost identical copy of the input document would result. The only source information discarded by the parser is whitespace inside of tags (i.e., the spaces or newlines between the attributes of a tag.) It is not confused by things that look like tags inside of quoted strings. |
|
| IDL | download | 0.1 | Part of JavaCC package. A grammar for the IDL (Interface Definition Language) of OMG CORBA 2.0 specification. | ||
| InfoSapient |
download download |
Michael McConnell | 2002-01-19 | 1.1 | InfoSapient Business rules engine. InfoSapient is a business rules engine used for the expression of policy or operation rules within a business. |
| Java |
Sriram Sankar ![]() |
Part of JavaCC package. Sriram Sankar is the original author of JavaCC and continues to maintain it. | |||
| Java 1.4 | download | Andrea Gini | 2002-02-24 |
A grammar for parsing java 1.4 sources. It is a modified version of the grammar written by Sriram Sankar for Java 1.1 and modified by David Williamns for Java 1.2. It has been modified to accept Java sources for Java 1.4. The grammar have been modified in four parts: 1) assert has been included to the keyword list 2) AssertStatement() production has been added 3) the production Statement() has been modified in order to support AssertStatement() 4) in the main the string for Java1.2 code has been changed with for Java1.4 code |
|
| Java 1.4 |
Theodore Norvell ![]() |
JJTree parser. Coming soon. | |||
| Java 1.4 | download | Marco Savard | 2002-03-28 |
I used the latest version of grammar for Java 1.4 (written by Andrea Gini). It works well, but I found two constructs that were not supported by this grammar, although it is valid in Java (according Sun’s documentation). I have fixed the problem, and I send you the modified grammar so it can be useful for some users… |
|
| Java 1.4 | download | Andrea Gini | 2002-05-05 | This is a bugfix of the grammar written by Sriram Sankar for Java 1.1, modified by David Williamns for Java 1.2, by Andrea Gini for Java 1.4 and finally by Marco Savard to include a missing construct… | |
| Java to HTML | download |
Theodore Norvell ![]() |
2001-01-01 | Applet to convert Java code to HTML code, with syntax highlighting | |
| Java to HTML | download | Paul Cager | 2001-12-19 | 1.0 | JavaCC grammar to convert Java or JavaCC code to HTML. |
| JavaScript | download | Roland Paterson-Jones | 1997-04-01 | rloand.javascript package. A .jj grammar for Javascript, from the specification document, plus an expression tree generator, and (incomplete) interpreter. | |
| JEP | download | Nathan Funk | 2001-04-15 | JEP is a Java package for parsing and evaluating mathematical expressions. It currently supports user defined variables, constants, and functions. A number of common mathematical functions and constants are included. | |
| Oberon |
download download |
James Power | 1998-11-17 |
A parser for the programming language Oberon-2. Oberon is the latest generation in the Wirth family of languages, an heir to the Pascal and Modula tradition. |
|
| ODL | download | Vladimir Rubanov | 1999-07-23 | 0.1 | ODMG Object Definition Language (ODL). The language is based on IDL and is specified in ODMG 2.0 standard. Production numeration corresponds to this standard. The grammar is tested and used at the Institute for System programming of Russian Academy of Science. |
| OGNL | Drew Davidson | 2002-04-05 | OGNL stands for Object-Graph Navigation Language; it is an expression language for getting and setting properties of Java objects. You use the same expression for both getting and setting the value of a property. | ||
| OQL | download | Koen Hendrickx | 1997-09-25 | (Unfinished Version) Object Query Language (OQL) defined in ODMG 2.0 specification. | |
| PGN | download | Martin Rademacher | 2001-08-28 | 6.5 |
PGN is Portable Game Notation. For more information see theWikipedia PGN entry. |
| PHP | download | Satyam | 0.1 | Parses PHP 5.0 grammar. Tested with the PHP 5 test suite, except for exceptions noted in the TODO list contained in the source. | |
| Python | download | Jim Hugunin | 2.0 |
Part of JPython package. Python is an interpreted, interactive, object-oriented, extensible programming language. |
|
| Quilt | download |
Henry Chiu Dongwon Lee |
2000-08-17 | 0.9 |
QuiltParser is a parser for the Quilt XML query language written with JavaCC as a part of XPRESS project at UCLA / CSD. This small, implementable language has been recently proposed by Robie, Chamberlin, and Florescu; it integrates the advantages of various languages while meeting the W3C’s XML Query Requirements. |
| Rational Rose | download | Markus Dahm | 2001-06-18 | 1.11 |
A JavaCC grammar for models created by Rational Rose. The Homepage of the CrazyBeans project. |
| RMAIL | download | Part of JavaCC package. Processes RMAIL files that are created by the GNU emacs editor. | |||
| RPC | download | Adelene W. Ng | 2001-06-26 | 0.1 | RPC (Remote Procedure Call) Specification grammar; tested on JavaCC 2.0. |
| RTF | download | David Rosenstrauch | 2001-10-11 | 1.0 | A grammar for RTF (Rich Text Format) documents (frequently used with the Microsoft Word word processor, as well as several others). |
| RTF | download | Eric Friedman | 2001-10-31 |
JavaCC grammar for parsing RTF files. This parser handles unicode RTF as well as double byte RTF files used to represent Asian character sets. Jar file includes the RTFParser.jj grammar, source for a parser delegate interface for applications to implement when they need to respond to RTF events, and a copy of the LGPL license. |
|
| Scheme |
download download |
Håkan L. Younes | 1999-04-03 | 1.0 | Full grammar for Revised5 Report on the Algorithmic Language Scheme - R5RS (including quasiquotations). |
| Simkin | download | Simon Whiteside | 2001-01-02 | 1.1 | Simkin is a high-level lightweight embeddable scripting language which works with Java or C++ and XML. |
| SpecC | download |
H. Chen Rukhsana Alam |
2001-06-15 |
The SpecC is a system-leve design and specification language developed in University of California, Irvine. Since SpecC is a superset of C, we built this grammar file based on the C grammar file contributed by Mr.Doug South. |
|
| SPL | download | Ken Beesley | 2001-02-21 |
A modification of one of the example grammars that is part of the standard JavaCC download. The original example is /examples/Interpreter/ which implements a small language called SPL (stupid programming language). The original example parses, gets an AST tree, and then interprets the tree by calling the interpret() method in the root node, which in turn calls interpret() methods in the daughter nodes. The hand-written interpreter code is therefore spread out through all the various AST class files. |
|
| SQL | download | Ramanathane | 1997-04-09 | 0.5 | Grammar for PL/SQL inside Oracle*Forms 4.5(i.e. PlSql 1.x). |
| SQL | download | Kevin | Parser for Oracle SQL. | ||
| STEP | download | Singva Ma | 1999-08-18 | STEP Clear Text Encoding syntax is used along with the EXPRESS language to exchange neutral files between CAD systems. The description of the syntax can be found in ISO 10303-21. | |
| StruQL |
Mary Fernandez Dana Florescu Alon Levy Dan Suciu |
0.4 |
Strudel is a web-site management system developed at AT&T Labs — Research. Its query language, StruQL, specifies how a Web site is constructed from the source data modeled by a data graph. No longer supported. |
||
| VHDL | download | Christoph Grimm | 1998-12-06 | The parser covers the complete IEEE 1076 - Standard including the extensions proposed as IEEE 1076.1. | |
| Visual Basic | download | Paul Cager | 2002-03-13 | 3.0 | UPDATED: A JavaCC parser for Visual Basic, using JJTree to generate an AST. The grammar supports most VB constructs and could be used as a starting point for an ASP grammar. |
| VRML | download | Koen Hendrickx | Covers most of VRML 1.0 specification proposed as IEEE 1076.1. | ||
| VRML |
Satoshi Konno ![]() |
1.1 beta |
CyberVRML97 for Java is a development library of VRML97/2.0 applications. Using the library, you can easily read and write the VRML files, set and get the scenegraph infomations, draw the geometries, run the behaviors. Everyone can use the library free for commerce or an individual purpose. Now called CyberX3D and ported to Xerces. |
||
| XML | Patrice Bonhomme | 1998-07-13 | 0.5 |
XSilfide is a client/server based environment for distributing language resources. Part of the XSilfide components is SXP (Silfide XML Parser — a parser and a complete XML API in Java). More in detail, it supports XML 1.0 (REC 1998-02-10), XML NameSpace (WD1998-03-27), Document Object Model Level 1 (DOM Core and XML, WD 1998-04-16), XLink (WD 1998-03-03), and XPointer (WD 1998-03-03). From their project home page, followTechnology and SXP to download the package. |
|
| XML | Norbert H. Mikula | 1997-05-08 | 0.97 |
NXP is a (validating) XML (eXtensible Markup Language) parser. (It appears that NXP is no longer public software — commercial product was available at www.datachannel.com, but this does not include JavaCC source code. The above link has the last-known public distribution version.) Norbert Mikula co-authored XML For Dummies. He died in 2009. |
|
| XML-QL | download |
Alin Deutsch Mary Fernandez Dana Florescu Alon Levy Dan Suciu Wang-Chiew Tan |
0.9 |
Data extraction, conversion, transformation, and integration are all well-understood database problems. Their solutions rely on a query language, either relational (SQL) or object-oriented (OQL). Unlike relational or object-oriented data, XML is semistructured, i.e., it can have irregular and extensible structure and its attributes, or schema, are stored with the data. XML-QL is a query-language for XML and is suitable for performing the above tasks. No longer supported. |
|
| XPath/XSLT |
download download |
Ingo Macherius | 1999-08-19 | 1.1 |
This distribution contains a JavaCC generated Parser and two frontends for testing. Look at the source code for some configurable options. To change options the frontends need to be recompiled. The grammar is straightforward from the drafts. It is not optimized for speed, and had little to no checking for correctness beside a tiny regression test on all examples from the W3C drafts. The grammar implements XPath/XSLT patterns as of 1999-08-13. |
| XQuery | download | W3C XML Query Working Group | 2001-01-26 | This specification describes a new query language called XQuery (successor of Quilt), which is designed to be broadly applicable across all types of XML data sources. See Appendix G. | |
JavaCC : Java Glossary的更多相关文章
- Java DNS查询内部实现
源码分析 在Java中,DNS相关的操作都是通过通过InetAddress提供的API实现的.比如查询域名对应的IP地址: String dottedQuadIpAddress = InetAddre ...
- Java工程师成神之路
学习Java的同学注意了!!! 学习过程中遇到什么问题或者想获取学习资源的话,欢迎加入Java学习交流群,群号码:279558494 我们一起学Java! 一.基础篇 1.1 JVM 1.1.1. J ...
- Java监控工具介绍,VisualVm ,JProfiler,Perfino,Yourkit,Perf4J,JProbe,Java微基准测试
本文是本人前一段时间做一个简单Java监控工具调研总结,主要包括VisualVm ,JProfiler,Perfino,Yourkit,Perf4J,JProbe,以及对Java微基准测试的简单介绍, ...
- Java中的字符串常量池
ava中字符串对象创建有两种形式,一种为字面量形式,如String str = "droid";,另一种就是使用new这种标准的构造对象的方法,如String str = new ...
- java 学习之路
一.基础篇 1.1 JVM 1.1.1. Java内存模型,Java内存管理,Java堆和栈,垃圾回收 http://www.jcp.org/en/jsr/detail?id=133 http://i ...
- [转]java工程师成神之路
转载http://www.hollischuang.com/archives/489https://linux.cn/article-6739-1.html 一.基础篇 1.1 JVM 1.1.1. ...
- 如何成为一个牛掰的Java大神?
一.基础篇 1.1 JVM 1.1.1. Java内存模型,Java内存管理,Java堆和栈,垃圾回收 http://www.jcp.org/en/jsr/detail?id=133http://if ...
- Java 的 Class Path 和 Package
前言: 由于这两个问题新手问得较多, 且回答比较零散, 很难统一整理, 所以就直接写了一篇, 还请大家见谅. 正文:一, 类路径 (class path) 当你满怀着希望安装好了 java, ...
- JAVACC详解
JavaCC(Java Compiler Compiler)是一个用JAVA开发的最受欢迎的语法分析生成器.这个分析生成器工具可以读取上下文无关且有着特殊意义的语法并把它转换成可以识别且匹配该语法的J ...
- 【推荐】Java工程师如何从普通成为大神值得一读
本文源自 http://www.hollischuang.com/archives/489 一点感悟 java作为一门编程语言,在各类编程语言中作为弄潮儿始终排在前三的位置,这充分肯定了java语言的 ...
随机推荐
- 给网站添加Let's Encrypt的免费ssl证书
概要 目前很多浏览器默认都会标记http访问的网站为不安全,https部署已经称为大趋势,我之前利用业余时间搭建了一个网站,本文就以这个域名为基础说明如何给网站加上证书.本文使用的操作系统centos ...
- 【YashanDB数据库】Mybatis-plus分页框架识别不到Yashandb
问题描述 Mybatis-plus 无法识别Yashandb数据库,应用有如下报错. 问题分析 从Mybatis-plus源码里面看到,getDBtype函数是没有Yashandb的方言. 当Yash ...
- RuleLinKClient - 再也不担心表达引擎宕机了
原来有这么多时间 六月的那么一天,天气比以往时候都更凉爽,媳妇边收拾桌子,边漫不经心的对我说:你最近好像都没怎么阅读了. 正刷着新闻我,如同被一记响亮的晴空霹雳击中一般,不知所措.是了,最近几月诸事凑 ...
- 题解:AT_arc116_b [ARC116B] Products of Min-Max
在题库里面乱翻,就翻到了. 因为在这道题里面子序列不需要考虑元素顺序,所以原序列无论是什么顺序都不会影响答案. 所以先把元素按照从大到小的顺序排列,然后考虑每个元素的贡献. 在当前序列中,对于元素 \ ...
- VS2019 查看源码,使用F12查看源码
前几天在微软社区看到VS的功能演示时,偶然看到此功能,对于开发人员来说太有用了,特此记录分享出来希望可以帮助到家. 具体设置步骤,打开vs2019,在工具>选项>文本编辑器>c#&g ...
- sql server high cpu 排查
refer: https://techcommunity.microsoft.com/t5/azure-sql/monitor-cpu-usage-on-sql-server-and-azure-sq ...
- 交通网络分析性能再升级,SuperMap iServer新增开启SSC分析模型
导语 SSC分析模型,全名SuperMap Short Cut,底层采用Contraction Hierarchies(简称CH)算法,该算法旨在通过对图形进行预处理和优化来降低最佳路径分析的时间复杂 ...
- urb中几个函数的使用
usb_buffer_alloc(free) 说是为了更好的从名字看出这个函数真实做的事情:DMA coherency linux提供两种方式,来保证使用dma时,内存和硬件cache的一致性: us ...
- nodejs 和 npm 版本对应关系
一.nodejs 和 npm 的版本是有适配的 首先看下官网列明的大概匹配关系: 官网链接地址:https://nodejs.org/zh-cn/about/previous-releases 可以查 ...
- 妙用编辑器:把EverEdit变成计算器
妙用编辑器:把EverEdit变成计算器 应用场景 日常工作过程中,会存在需要计算一些数据的场景,调用系统的计算器当然可以完成这项工作,但是需要来回切换,且系统自带的计算器没有表达式计算功能,真是不方 ...



