15

antlr4-maven-plugin は、Antlr4 Web サイトのドキュメントではないようです。

4

6 に答える 6

14

私がしたように、それはあなたに何ももたらさないかもしれません。これを試して:

mvn org.antlr:antlr4-maven-plugin:help -Ddetail=true

プロデュース:

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- antlr4-maven-plugin:4.0:help (default-cli) @ standalone-pom ---
[INFO] ANTLR 4 Maven plugin 4.0
Maven plugin for ANTLR 4 grammars

This plugin has 2 goals:

antlr4:antlr4
Parses ANTLR 4 grammar files *.g4 and transforms them into Java source files.

Available parameters:

arguments
  A list of additional command line arguments to pass to the ANTLR tool.

atn
  If set to true then the ANTLR tool will generate a description of the ATN
  for each rule in Dot format.

encoding
  specify grammar file encoding; e.g., euc-jp

excludes
  A set of Ant-like exclusion patterns used to prevent certain files from
  being processed. By default, this set is empty such that no files are
  excluded.

forceATN
  Use the ATN simulator for all predictions.

includes
  Provides an explicit list of all the grammars that should be included in
  the generate phase of the plugin. Note that the plugin is smart enough to
  realize that imported grammars should be included but not acted upon
  directly by the ANTLR Tool. A set of Ant-like inclusion patterns used to
  select files from the source directory for processing. By default, the
  pattern **/*.g4 is used to select grammar files.

libDirectory
  Specify location of imported grammars and tokens files.

listener
  Generate parse tree listener interface and base class.

options
  A list of grammar options to explicitly specify to the tool. These options
  are passed to the tool using the -D<option>=<value> syntax.

outputDirectory
  Specify output directory where the Java files are generated.

sourceDirectory
  The directory where the ANTLR grammar files (*.g4) are located.

treatWarningsAsErrors
  Treat warnings as errors.

visitor
  Generate parse tree visitor interface and base class.

antlr4:help
Display help information on antlr4-maven-plugin.
Call mvn antlr4:help -Ddetail=true -Dgoal=<goal-name> to display parameter
details.

Available parameters:

detail
  If true, display all settable properties for each goal.

goal
  The name of the goal for which to show help. If unspecified, all goals
  will be displayed.

indentSize
  The number of spaces per indentation level, should be positive.

lineLength
  The maximum length of a display line, should be positive.


[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.635s
[INFO] Finished at: Wed Jul 03 14:52:12 EDT 2013
[INFO] Final Memory: 3M/81M
[INFO] ------------------------------------------------------------------------
于 2013-07-03T19:31:02.787 に答える
7

現在役立つ 2 つのリンクを次に示します。

Maven サイトのドキュメントをオンラインでホストできるように取り組んでいます。


文法を Java ファイルと同じフォルダー (生成されたコードを表示するパッケージ内) に配置します。

次のようにトップレベルでソースディレクトリを宣言しているので:

<build>
  <sourceDirectory>src</sourceDirectory>
</build>

ANTLR 4 Maven プラグインには次の構成を使用します。

<plugin>
    <groupId>org.antlr</groupId>
    <artifactId>antlr4-maven-plugin</artifactId>
    <version>4.0</version>
    <configuration>
        <sourceDirectory>${basedir}/src</sourceDirectory>
    </configuration>
    <executions>
        <execution>
            <goals>
                <goal>antlr4</goal>
            </goals>
        </execution>
    </executions>
</plugin>
于 2013-07-08T10:08:39.020 に答える
5

antlr4-maven-plugin には、次のように maven を使用して実行できるヘルプ ゴールがあります。

mvn antlr4:help -Ddetail=true
于 2013-03-10T16:52:42.170 に答える
1

ヘルプは限られていますが、(この質問に対する他の回答に加えて) 次の場所が役立つことがわかりました。

于 2014-01-14T16:40:26.830 に答える
1

また、ANTLR 4 文法を生成およびテストするための両方のプラグインについて説明している次のブログをチェックすることもできます。

于 2015-03-16T07:05:41.697 に答える
0

Maven プラグイン サイトが公開されているようです。

http://www.antlr.org/api/maven-plugin/latest/index.html

于 2014-05-31T16:58:05.533 に答える