質問

By following How do I install this damn thing? on www.antlr.org I have got ANTLR 3.5 to work:

$ java -version    # I have Oracle`s Java JDK installed
java version "1.7.0_11"
Java(TM) SE Runtime Environment (build 1.7.0_11-b21)
Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)
$ ls
antlrworks-1.5.jar
$ export CLASSPATH=./antlrworks-1.5.jar:$CLASSPATH
$ java org.antlr.Tool -version
ANTLR Parser Generator  Version 3.5

But according to ANTLRWorks: The ANTLR GUI Development Environment, ANTLRWorks should also be included in the above JAR file. How do I start it?


If I type java a and double tab it first completes it to java antlr. indicating that there is no antlrworks package on the classpath. I don't know if there should be one. If I keep double tabbing I get:

antlr.ANTLRException                     antlr.CharStreamIOException              antlr.debug.ListenerBase                 antlr.debug.TraceListener                antlr.SemanticException
antlr.ANTLRHashString                    antlr.collections.AST                    antlr.debug.MessageEvent                 antlr.DefaultFileLineFormatter           antlr.StringUtils
antlr.ANTLRStringBuffer                  antlr.collections.ASTEnumeration         antlr.debug.MessageListener              antlr.FileLineFormatter                  antlr.Token
antlr.ASTFactory                         antlr.collections.impl.ASTArray          antlr.debug.ParserListener               antlr.InputBuffer                        antlr.TokenBuffer
antlr.ASTNULLType                        antlr.collections.impl.ASTEnumerator     antlr.debug.ParserMatchEvent             antlr.LexerSharedInputState              antlr.TokenQueue
antlr.ASTPair                            antlr.collections.impl.BitSet            antlr.debug.ParserMatchListener          antlr.LLkParser                          antlr.TokenStream
antlr.BaseAST                            antlr.collections.impl.IntRange          antlr.debug.ParserTokenEvent             antlr.MismatchedCharException            antlr.TokenStreamException
antlr.ByteBuffer                         antlr.collections.impl.Vector            antlr.debug.ParserTokenListener          antlr.MismatchedTokenException           antlr.TokenStreamIOException
antlr.CharBuffer                         antlr.collections.impl.VectorEnumerator  antlr.debug.SemanticPredicateEvent       antlr.NoViableAltException               antlr.TokenStreamRecognitionException
antlr.CharFormatter                      antlr.CommonAST                          antlr.debug.SemanticPredicateListener    antlr.NoViableAltForCharException        antlr.TreeParser
antlr.CharQueue                          antlr.CommonToken                        antlr.debug.SyntacticPredicateEvent      antlr.Parser                             antlr.TreeParserSharedInputState
antlr.CharScanner                        antlr.debug.Event                        antlr.debug.SyntacticPredicateListener   antlr.ParserSharedInputState             antlr.Utils
antlr.CharStreamException                antlr.debug.GuessingEvent                antlr.debug.TraceEvent                   antlr.RecognitionException               

I downloaded antlrworks-1.5.jar by visiting http://www.antlr.org/download.html and clicking Version 1.5 - for Windows, Linux and Mac OS X. The JAR's file size is 2684608 bytes.

役に立ちましたか?

解決

Sorry if this answer is too simple

1) Go to the antlrworks site and download the antlrworks file

2) cd to your download folder, and: java -jar antlrworks-1.5.jar

他のヒント

Try using http://www.antlr3.org/download/ instead of http://www.antlr3.org/download.html
Notice no html on the end.

Now you can see the actual sizes of the files.

The AntlrWorks jar includes Antlr, but the Antlr jar does not include AntlrWorks.

Once you have the Antlrworks jar on your system and Sun Java installed.

See: http://www.antlr3.org/works/help/tutorial/howtorun.html

Run on Linux

To run ANTLRWorks, use the command-line: •$ java -jar antlrworks-1.2.1.jar •

Note: On Linux, make sure the Sun JDK is installed. Any other JDK is not supported as many of them simply crashes when Swing is invoked.

Yes the documenation is out of date. Just use the correct name for the jar file.

Remember that this is all free software and maintained by people on their own time so the older stuff does not get updated as much as it should. :)

New url to get antlrworks-1.5 (antlr 3.0 with gui) : http://www.antlr3.org/download/antlrworks-1.5.jar (antlr.org is now dedicated to antlr 4.0....)

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top