You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nutch.apache.org by Teruhiko Kurosaka <Ku...@basistech.com> on 2006/10/19 02:41:44 UTC

What javacc options should I use to compile NutchAnalysis.jj?

I am trying to modify the java CC rules in NutchAnalysis.jj.
As a preparation, I ran javacc (ver 3.2) to "compile" 
NutchAnalysis.jj of Nutch 0.8 but the generated
Java files are little bit different than those
found in the src/java directory.  Am I supposed to use 
some javacc command line options? 

BTW, shouldn't build.xml have rules that can build
the .java files from the .jj file, to be complete?


Below are the diffs:

$ diff -bw CharStream.java
/c/opt/nutch-0.8/src/java/org/apache/nutch/analysis
19c19
< public interface CharStream {
---
> interface CharStream {

$ diff -bw NutchAnalysis.java
/c/opt/nutch-0.8/src/java/org/apache/nutch/analysis
911a912
>     try {
923a925
>       } catch(LookaheadSuccess ls) { }

$ diff -bw NutchAnalysisTokenManager.java
/c/opt/nutch-0.8/src/java/org/apache/nutch/analysis
319,320c319
< public NutchAnalysisTokenManager(CharStream stream)
< {
---
> public NutchAnalysisTokenManager(CharStream stream){
323,324c322
< public NutchAnalysisTokenManager(CharStream stream, int lexState)
< {
---
> public NutchAnalysisTokenManager(CharStream stream, int lexState){
442,443c440
<             image = new StringBuffer(new
String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos
+ 1))));
<          else
---
>             image = new StringBuffer();
449,450c446
<             image = new StringBuffer(new
String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos
+ 1))));
<          else
---
>             image = new StringBuffer();

$ diff -bw ParseException.java
/c/opt/nutch-0.8/src/java/org/apache/nutch/analysis
13c13
< public class ParseException extends Exception {
---
> class ParseException extends java.io.IOException  {

$ diff -bw Token.java
/c/opt/nutch-0.8/src/java/org/apache/nutch/analysis
8c8
< public class Token {
---
> class Token {


$ diff -bw TokenMgrError.java
/c/opt/nutch-0.8/src/java/org/apache/nutch/analysis
4c4
< public class TokenMgrError extends Error
---
> class TokenMgrError extends Error



-kuro

RE: What javacc options should I use to compile NutchAnalysis.jj?

Posted by Teruhiko Kurosaka <Ku...@basistech.com>.
Please disregard this posting.  It was my oversight.  build.xml does
have a javacc rule.
So this is just a version difference of javacc? 
-kuro

> -----Original Message-----
> From: Teruhiko Kurosaka 
> Sent: 2006-10-18 17:42
> To: nutch-dev@lucene.apache.org
> Cc: Teruhiko Kurosaka
> Subject: What javacc options should I use to compile NutchAnalysis.jj?
> 
> I am trying to modify the java CC rules in NutchAnalysis.jj.
> As a preparation, I ran javacc (ver 3.2) to "compile" 
> NutchAnalysis.jj of Nutch 0.8 but the generated
> Java files are little bit different than those
> found in the src/java directory.  Am I supposed to use 
> some javacc command line options? 
> 
> BTW, shouldn't build.xml have rules that can build
> the .java files from the .jj file, to be complete?
> 
> 
> Below are the diffs:
> 
> $ diff -bw CharStream.java
> /c/opt/nutch-0.8/src/java/org/apache/nutch/analysis
> 19c19
> < public interface CharStream {
> ---
> > interface CharStream {
> 
> $ diff -bw NutchAnalysis.java
> /c/opt/nutch-0.8/src/java/org/apache/nutch/analysis
> 911a912
> >     try {
> 923a925
> >       } catch(LookaheadSuccess ls) { }
> 
> $ diff -bw NutchAnalysisTokenManager.java
> /c/opt/nutch-0.8/src/java/org/apache/nutch/analysis
> 319,320c319
> < public NutchAnalysisTokenManager(CharStream stream)
> < {
> ---
> > public NutchAnalysisTokenManager(CharStream stream){
> 323,324c322
> < public NutchAnalysisTokenManager(CharStream stream, int lexState)
> < {
> ---
> > public NutchAnalysisTokenManager(CharStream stream, int lexState){
> 442,443c440
> <             image = new StringBuffer(new
> String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = 
> jjmatchedPos
> + 1))));
> <          else
> ---
> >             image = new StringBuffer();
> 449,450c446
> <             image = new StringBuffer(new
> String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = 
> jjmatchedPos
> + 1))));
> <          else
> ---
> >             image = new StringBuffer();
> 
> $ diff -bw ParseException.java
> /c/opt/nutch-0.8/src/java/org/apache/nutch/analysis
> 13c13
> < public class ParseException extends Exception {
> ---
> > class ParseException extends java.io.IOException  {
> 
> $ diff -bw Token.java
> /c/opt/nutch-0.8/src/java/org/apache/nutch/analysis
> 8c8
> < public class Token {
> ---
> > class Token {
> 
> 
> $ diff -bw TokenMgrError.java
> /c/opt/nutch-0.8/src/java/org/apache/nutch/analysis
> 4c4
> < public class TokenMgrError extends Error
> ---
> > class TokenMgrError extends Error
> 
> 
> 
> -kuro
>