[antlr-interest] Re: JAVA Cross Reference

bob kennelly bob_kennelly at yahoo.com
Fri Jul 9 15:05:19 PDT 2004


Hi Jim!

I wanted to show you a (javac) error message that i'm 
getting, 'cannot resolve symbol'! Just wanted to see if it's 
something pretty obvious, if not no problem! I'm planning on 
restarting from the beginning as it's probably something i missed in 
the setup! 

Thanks again Jim, appreciate any help on this!

BobK

C:\antlr.xref\src\org\antlr\java\crossref>javac *.java

LocationAST.java:83: cannot resolve symbol
symbol  : method getFilename ()
location: class antlr.Token
                setFilename(t.getFilename());
                             ^
JavaLexer.java:48: cannot resolve symbol
symbol  : method setFilename (java.lang.String)
location: class antlr.Token
        result.setFilename(getFilename());
              ^
LocationToken.java:38: cannot resolve symbol
symbol  : method getFilename ()
location: class antlr.Token
                setFilename(t.getFilename());
                             ^
3 errors

--- In antlr-interest at yahoogroups.com, "Jim O'Connor" 
<Jim.OConnor at m...> wrote:
> From: Jim O'Connor [Jim.O'Connor at m...]
> Sent: Wednesday, January 07, 2004 11:10 AM
> To: Jim.OConnor at M...
> Subject: Alpha release of the Java Cross Referencer
> 
> Introduction
> 
> This is the alpha release of the Java Cross Reference Tool (uses 
ANTLR
> 2.7.2).  It is based on Terence's tool in the file sharing 
section.  To
> review its roots you can take a look at www.antlr.org/share/list.  
There
> have been many improvements and additions.  The goal is to have 
another
> release in the future that improves the code and streamlines 
the "get up and
> running" process.  There might be a few bug fixes, as well. :0) 
> 
>  
> 
> Overview
> 
> Input: *.java files, jar files, or a directory structure
> 
>  
> 
> Output:  An XML document with a hierarchical representation of 
packages,
> classes and references.  The MyOutput class regulates the output 
location of
> the XML file.  The name is controlled in the CodeProject class 
(currently
> "null").  MyOutput has methods to control output when references 
are
> resolved.
> 
>  
> 
> Installation and execution
> 
>  
> 
>  The process will be streamlined.  The manual installation forces 
the user
> to become familiar necessary configuration steps that could be 
overlooked.  
> 
> Assumptions: Java JDK and Antlr 2.7.2 is installed.  An older 
java.g 1.3 is
> used.  Recent patches have not been integrated.
> 
>  
> 
>   1.. Download JavaCrossRef.zip 
>  
> 
>   2.. Unzip to c:\  (this will create the c:\antlr.xref directory 
structure)
> 
>  
> 
>   3.. cd to the c:\antlr.xref\src\org\antlr\java\crossref 
subdirectory 
>  
> 
>   4.. To generate the necessary files run the following commands 
(My path
> includes "c:\j2sdk1.4.2_01\bin"; and my full classpath is
> ".;c:\antlr-2.7.2\antlr.jar") 
> A.      java antlr.Tool java.g
> 
> a.       Creates JavaRecognizer.java, JavaLexer.java, 
JavaTokenTypes.java
> and JavaTokenTypes.txt
> 
> B.      java antlr.Tool javatree.g
> 
> a.       Creates JavaTreeParser.java, 
JavaTreeParserTokenTypes.java and
> JavaTreeParserTokenTypes.txt
> 
> C.      java antlr.Tool -glib javaTree.g defs.g 
> 
> a.       Creates JavaDefsTreeParser.java, 
JavaTreeDefsParserTokenTypes.java
> and JavaTreeDefsParserTokenTypes.txt
> 
> b.       Warnings will result for rule 
JavaDefsTreeParser.packageDefinition
> and Rule 'identifier' returning a value
> 
> D.      java antlr.Tool -glib javaTree.g prerefs.g
> 
> a.       Creates JavaPreRefsTreeParser.java,
> JavaTreePreRefsParserTokenTypes.java and 
JavaTreePreRefsParserTokenTypes.txt
> 
> b.       Warnings result for packageDefinition, typeSpec, 
typeSpecArray,
> type, extendsClasue, implementsClause, parameterDef, 
variableDeclarator,
> methodHead, identifier, newExpression and
> 'identifier'-'parameterDef'-'typeSpecArray'-'typeSpec'-
newExpression'
> returns a value
> 
> E.      java antlr.Tool -glib javaTree.g refs.g
> 
> a.       Creates JavaRefsTreeParser.java, 
JavaTreeRefsParserTokenTypes.java
> and JavaTreeRefsParserTokenTypes.txt
> 
> b.       Lots more warning messages
> 
>  
> 
>   5.. Before compiling the files you should edit a few of the 
files to
> control the output 
> A.      In CodeProject.java, a few fields are "user configurable" 
and can be
> modified
> 
> a.       protected String name = null; null can be changed to name 
the
> current project.  Otherwise the xml file will get the 
name "null.xml".
> 
> b.       static final boolean saveReferences = true;  when set 
to "true" all
> references are saved to the CodeProject hierarchical information 
model by
> methods in the refElement(), refMethod(), and refClass() methods. 
If you
> only want your project structure in the XML file, set to "false".
> 
> c.       static final boolean printDebug = false;  There is a 
large amount
> of debug "System.out.println()" calls in the Scope classes.  The 
printDebug
> flag in CodeProject is a global flag to enable or disable the 
possibility
> for all of these messages.  When printDebug is set to true in the
> CodeProject class, you must go to the individual class files to 
turn on
> messages. Other classes with the printDebug flag are ClassScope,
> CodeBlockScope, DebugStack (commented out in defs.g, prerefs.g, 
and refs.g),
> FileScope, and ParameterScope.
> 
> B.      In MyOutput.java, final static String OUTPUTDIR = "./"; 
set the
> output directory (OUTPUTDIR), or leave as the current directory 
(".\")
> 
>  
> 
>   6.. Compile the *.java files with the following commands 
>   7.. A. javac *.java (or whatever compiler you use) 
>   8.. test run 
> A.      cd c:\antlr.xref\src
> 
> B.      "java org.antlr.java.crossref.Main" should produce usage 
message
> "Usage: Main (directory or filename)"
> 
> C.       
> 
>   9.. Another test with real data 
> A.      "java org.antlr.java.crossref.Main
> org\antlr\java\crossref\location.java"
> 
> B.      This will produce many messages to the console in addition 
to a 70k
> xml file to the current directory named "null.xml"
> 
> C.      I'll go back and set saveReference = false and recompile 
and re-run.
> 
> D.      I still get all the messages but the xml file is now 9k, 
but it
> contains no reference information.  It just contains the
> package/class/field/method structure.  This is good for structure 
analysis
> but not for seeing which classes reference others.
> 
>  
> 
>  
> 
> Credits
> 
>  
> 
> All "borrowed" classes are from the open source community.  I have 
no
> obligation to give credit to these sources.  However, their 
mention will
> give credit where I think it is due.  
> 
>  
> 
> K files
> 
>  
> 
> The "K" files are used to read the input stream from a "*.class" 
file,
> extracting the relevant information.  They are used with minor 
modification,
> mostly to the javadoc section.  These files are the work of 
Kimberley
> Burchett. "Class loading" the files was a short bad idea.  Thanks 
for saving
> me some time, Kimberly!  I kept the class file writer with the 
code for
> those of you who want to do some obfuscation work.
> 
>  
> 
> http://www.kimbly.com/code/classfile/
> 
>  
> 
> Location AST help
> 
>  
> 
> I read the antlraux site to help with the LocationAST work.
> 
>  
> 
> http://antlraux.sourceforge.net/
> 
>  
> 
> Java Cross Reference Tool
> 
>  
> 
> Antlr and the structure for the tool are based on the work of 
Terence Parr.
> You should be versed in Antlr basics to use this tool. 
(www.antlr.org)
> 
>  
> 
>  
> 
>  
> 
> To Do List
> 
> 1. Reduce size of XML document
> 
> 2. Revisit order of imports and "Classpath order".
> 
> 3. Upgrade java.g
> 
> 4.  Streamline installation
> 
> 5. Reorganize the user options
> 
> 6. Redo Location information.  Problem finding files based on XML
> information.
> 
> 7. Bugs
> 
>  
> 
> 
> 
> > -----Original Message-----
> > From: Jim O'Connor [mailto:Jim.OConnor at m...]
> > Sent: Sunday, July 04, 2004 11:38 PM
> > To: 'bob_kennelly '
> > Cc: 'antlr-interest at yahoogroups.com'
> > Subject: RE: [antlr-interest] JAVA Cross Reference
> > 
> >  Hi Bob,
> >   My Java Cross reference tool is in the file sharing section of
> > www.antlr.org.  I will find the "getting started" document, if 
you are
> > interested.
> > Jim
> > 
> > -----Original Message-----
> > From: bob_kennelly
> > To: antlr-interest at yahoogroups.com
> > Sent: 7/2/04 4:32 PM
> > Subject: [antlr-interest] JAVA Cross Reference
> > 
> > Hi there!
> > 
> > Does anyone have a tool that will scan thru the Java source and
> > create a hierarchy of classes, example what class calls what 
class?
> > 
> > Or can any create such a tool?
> > 
> > Thanks!
> > 
> > bk
> > 
> > 
> > 
> > 
> > 
> > Yahoo! Groups Links
> > 
> > 
> > 
> > 
> > 
> > 
> > 
_____________________________________________________________________
___
> > This e-mail has been scanned for viruses by MCI's Internet 
Managed
> > Scanning Services - powered by MessageLabs. For further 
information
> > visit http://www.mci.com
> > 
_____________________________________________________________________
___
> > 
> > 
> > 
> > Yahoo! Groups Links
> > 
> > 
> > 
> > 
> > 
> > 
> > 
_____________________________________________________________________
___
> > This e-mail has been scanned for viruses by MCI's Internet 
Managed
> > Scanning Services - powered by MessageLabs. For further 
information visit
> > http://www.mci.com
> > 
_____________________________________________________________________
___
> > 
> > 
_____________________________________________________________________
___
> > This e-mail has been scanned for viruses by MCI's Internet 
Managed
> > Scanning Services - powered by MessageLabs. For further 
information visit
> > http://www.mci.com
> > 
_____________________________________________________________________
___



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list