Questions tagged [javacc]

JavaCC - the Java Compiler Compiler - is a popular parser generator and lexical analyzer generator for Java and C++.

JavaCC (Java Compiler Compiler) is an open source parser generator and lexical analyzer generator written in . It produces either or . Both and the parsers generated by have been successfully run on a variety of platforms.

generates top-down parsers. JavaCC can resolve choices based on the next k input tokens, and so can handle LL(k) grammars automatically; by use of "lookahead specifications", it can also resolve choices requiring unbounded look ahead. also generates lexical analyzers in a fashion similar to lex. The tree builder that accompanies it, JJTree, constructs its trees from the bottom up.

is licensed under a BSD license.

Homepage: http://javacc.org/

486 questions
78
votes
1 answer

Why is 019 not a JavaScript syntax error? Or why is 019 > 020

If I type 019 > 020 in the JavaScript console (tested in both Chrome and Firefox), I get the answer true. This is due to 020 being interpreted as an OctalIntegerLiteral (equals 16) whereas 019 is apparently being interpreted as DecimalLiteral (and…
lexicore
  • 42,748
  • 17
  • 132
  • 221
47
votes
8 answers

What's better, ANTLR or JavaCC?

Concerns are documentation/learnability, eclipse integration, tooling, community support and performance (in roughly that order).
Jason
  • 2,025
  • 2
  • 21
  • 13
19
votes
4 answers

Parsing Objective-C code for static analysis

I love static analysis and compile-time checks, almost to a fault, but most of my day job is in Objective-C. To resolve this tension, I'd like to be able to write my own analysis tools that I can run on my Objective-C projects. But googling around…
Bill
  • 44,502
  • 24
  • 122
  • 213
18
votes
3 answers

Setting javacc to work with command prompt

I've been trying to set up javacc but am having problems. When I type javacc adder.jj (in the directory where adder.jj is) I am getting "'javacc' is not recognized as an internal or external command, operable program or batch file". To my…
HBeel
  • 475
  • 2
  • 5
  • 12
17
votes
5 answers

Anybody has some links to javacc tutorials?

It's very difficult to find this kind of document online. I found one in JAVAWORLD, but this one does not cover the jjTree and visitor one. Does anybody happen to have some links to the tutorials?
Winston Chen
  • 6,799
  • 12
  • 52
  • 81
15
votes
2 answers

How to implement JJTree on grammar

I have an assignment to use JavaCC to make a Top-Down Parser with Semantic Analysis for a language supplied by the lecturer. I have the production rules written out and no errors. I'm completely stuck on how to use JJTree for my code and my hours of…
10
votes
3 answers

How do i set up javacc in intellij IDEA

I searched through the plugin repo and downloaded the javacc plugin. Now that I have the plugin how do I use it in IntelliJ. My project looks like this .
stringRay2014
  • 636
  • 1
  • 11
  • 29
9
votes
3 answers

Javacc parser option LOOKAHEAD, Java

I've recently started to play around with grammatical analyzers using javacc and one of the fields is the options one...I have a code like the folowing: options { LOOKAHEAD=1; } PARSER_BEGIN(Calculator) public class Calculator { …
out_sider
  • 101
  • 1
  • 2
  • 4
8
votes
2 answers

Parsing RTF Documents with Java/JavaCC

Is anybody familiar with the the RTF document format and parsing using any Java libaries. The standard way people have done this is by using the RTFEditorKit in the JDK Swing API: Swing RTFEditorKit API but it isn't that accurate when it comes to…
Jonathan Holloway
  • 62,090
  • 32
  • 125
  • 150
7
votes
3 answers

Which is the best counterpart to ANTLR to create parsers in ruby?

I've used antlr and javacc/freecc for a while. Now I need to write a bunch of parsers using antlr grammars but such parsers need to be written in ruby lang. I googled but nothing found. Is there any ruby parser generator that takes antlr grammars…
Paolo Perego
  • 393
  • 3
  • 9
7
votes
1 answer

How to integrate generated sources in IntelliJ IDEA when using Gradle?

I'm currently using JavaCC (with the JavaCC gradle plugin from here) to generate some of my source code. The rest of the project does depend on that code. If I import the project into IDEA or clean the project, then I will get errors because classes…
TenPlusFive
  • 431
  • 4
  • 9
7
votes
2 answers

Java, JavaCC: How to parse characters outside the BMP?

I am referring to the XML 1.1 spec. Look at the definition of NameStartChar: NameStartChar ::= ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] |…
java.is.for.desktop
  • 10,748
  • 12
  • 69
  • 103
7
votes
6 answers

Getting started with JavaCC

I am new to JavaCC and cannot figure out how to get it running. I am using Mac OS X and I installed javacc-6.0.zip and unzipped it. I am unable to make the javacc script accessible from my path as on typing javacc on the terminal I get the following…
Rishabh Garg
  • 296
  • 3
  • 12
6
votes
2 answers

Can JavaCC distinguish token by its context?

Basic requirement is use keyword as identifier, so I want to distinguish the token from it's context.(e.g.class is a keyword, but we allowed a variable named class). In java, this is possible, but it's so hard, here is how I do it TOKEN : { …
wener
  • 7,191
  • 6
  • 54
  • 78
6
votes
4 answers

JavaCC: Please give me links to "real" examples

I know that there are many examples of JavaCC parsers here, but they all do nothing. They just accept a string, or produce parsing errors. What I need is a few examples of real parsers, which actually do something during parsing. (Such as building a…
java.is.for.desktop
  • 10,748
  • 12
  • 69
  • 103
1
2 3
32 33