Why did my ANTLR build Ant task fail "Could not determine the generated class"?

I try to use the ANTLR3 task for Ant , but I get the error message "Could not determine the generated class."

A quick study shows that many people had the same problem without providing a solution (see links below).

Can someone suggest a solution that does not resort to using the usual Java Ant task?

External links:

+4
source share
1 answer

The antlr task included in Ant 1.8.2 (latest version) seems to depend on ANTLR 2.7.2 (defined in $ANT_HOME/lib/ant-antlr.pom and uses $ANT_HOME/lib/ant-antlr.jar .

The task is to scan the target file for the line matching ^class (.*) extends .* , Where the first group of matches will be used as the name of the generated file. All this bit of syntax seems to have been dropped in ANTLR 3.x, or at least made optional, because I can generate parsers without it using the normal java task environment you were talking about.

On the main page http://antlr.org/ under the heading "File Sharing" there is a link to ANTLR v3 task for Ant , but, unfortunately, this does not look like the replacement I was hoping for. This actually seems rather confusing, so I'm stuck with using a simple Java task.

+1
source

Source: https://habr.com/ru/post/1276426/


All Articles