Java Tools Section Index | Page 3
Is ANTLR appropriate for building a line-oriented preprocessor like the C preprocessor or m4?
Greg Lindholm points out:
ANTLR doesn't have a way of specifing start-of-line as part of a rule.
Once you have entered a rule you can use a sematic predicate to check
what column your at, but t...more
What's the difference between a parse tree and an abstract syntax tree (AST)? Why doesn't ANTLR generate trees with nodes for grammar rules like JJTree does?
A parse tree is a record of the rules (and tokens) used to match some input text whereas a syntax tree records the structure of the input and is insensitive to the grammar that produced it. Note ...more
Why do I get the error. org.xml.sax.SAXParseException : Element type "web-app" must be declared. when starting my web application? It has a web-app element already!
Why do I get the error
org.xml.sax.SAXParseException : Element type "web-app" must be declared
when starting my web application? It has a web-app element already!
How are special characters escaped in Ant build files?
Use XML character entity references to escape.
character
reference
<
<
>
>
"
"
&
&
...more
Why does IndexReader's maxDoc() return an 'incorrect' number of documents sometimes?
According to the Javadoc for IndexReader maxDoc() method "returns one greater than the largest possible document number".
In other words, the number returned by maxDoc() does not necessarily matc...more
How do I get <javac> to list each file that it is compiling?
I have now written my own ant logger class to filter out all verbose messages except for the "File(s) to be compiled" message, which lists them all. Here is my code; if anyone wants to use it, fe...more
What is refactoring ? IDEA's feature list mentions 'refactoring'. What is it and where can I learn more about it ?
"Refactoring is the process of changing a software system in such a way that it does not alter the external behavior of the code yet improves its internal structure. It is a disciplined way to cl...more
How can I delete files depending on their age?
Unfortunately at the moment you can't implement this without resorting to using <exec> to a command-line script or some other roundabout way. It appears that in Ant 1.5 that filesets will a...more
How can I test for JVM versions?
If you're using Ant 1.4.1 or greater, the <condition> task works great. Here's an example that ought to give you what you need:
<project basedir="." default="test">
<target nam...more
Associate file types. How can I associate .java or .jsp (or whatever) file types with IDEA in Windows?
Associate file types
How can I associate .java or .jsp (or whatever) file types with IDEA in Windows?
What's the current version of IDEA?
IDEA 2.5.2 is the currently available released version.
IDEA 2.6 will support JDK 1.4 as a target development JDK (IDEA still requires JDK 1.3 to run).
Early Access of IDEA 3.0 is available at h...more
Are Wildcard, Prefix, and Fuzzy queries case sensitive?
Yes, unlike other types of Lucene queries, Wildcard, Prefix, and Fuzzy queries are case sensitive.
That is because those types of queries are not passed through the Analyzer, which is the compone...more
How can I index and search digits and other non-alphabetic characters?
The components responsible for this are various Analyzers.
The demos included in Lucene distribution use StopAnalyzer, which filters out non-alphabetic characters.
To include non-alphabetic chara...more
How do I get <exec> to work for shell commands on Windows platforms?
To <exec> a shell command on Windows, you must execute the command shell followed by the command you want. For example:
<exec executable="cmd">
<arg line="/c dir"/>
</exec...more
How do I pass command-line arguments to my build?
Use 'ant -Dname=val'. Refer to it within the build file as ${name}.