类 Antlr3Mojo

  • 所有已实现的接口:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

    public class Antlr3Mojo
    extends org.apache.maven.plugin.AbstractMojo
    Parses ANTLR grammar files *.g and transforms them into Java source files.
    作者:
    Jim Idle
    • 字段概要

      字段 
      修饰符和类型 字段 说明
      protected boolean debug
      If set to true, then the code generated by the ANTLR code generator will be set to debug mode.
      protected boolean dfa
      If set to true, then the ANTLR tool will generate a description of the DFA for each decision in the grammar in Dot format.
      protected java.util.Set<java.lang.String> excludes
      A set of Ant-like exclusion patterns used to prevent certain files from being processed.
      protected java.util.Set<java.lang.String> includes
      Provides an explicit list of all the grammars that should be included in the generate phase of the plugin.
      protected java.lang.String messageFormat
      If this parameter is set, it indicates that any warning or error messages returned by ANLTR, should be formatted in the specified way.
      protected boolean nfa
      If set to true, then the ANTLR tool will generate a description of the NFA for each rule in Dot format
      protected boolean printGrammar
      If set to true, then the ANTLR tool will print a version of the input grammar(s) which are stripped of any embedded actions.
      protected boolean profile
      If set to true, then the generated parser will compute and report profile information at runtime.
      protected org.apache.maven.project.MavenProject project
      The current Maven project.
      protected boolean report
      If set to true, then after the tool has processed an input grammar file it will report various statistics about the parser, such as information on cyclic DFAs, which rules may use backtracking, and so on.
      protected Tool tool
      An instance of the ANTLR tool build.
      protected boolean trace
      If set to true, the generated parser code will log rule entry and exit points to stdout (System.out for the Java target) as an aid to debugging.
      protected boolean verbose
      If set to true, then ANTLR will report verbose messages during the code generation process.
      • 从接口继承的字段 org.apache.maven.plugin.Mojo

        ROLE
    • 构造器概要

      构造器 
      构造器 说明
      Antlr3Mojo()  
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      void execute()
      The main entry point for this Mojo, it is responsible for converting ANTLR 3.x grammars into the target language specified by the grammar.
      java.util.Set<java.lang.String> getIncludesPatterns()  
      java.io.File getLibDirectory()  
      java.io.File getOutputDirectory()  
      java.io.File getSourceDirectory()  
      • 从类继承的方法 org.apache.maven.plugin.AbstractMojo

        getLog, getPluginContext, setLog, setPluginContext
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 字段详细资料

      • report

        protected boolean report
        If set to true, then after the tool has processed an input grammar file it will report various statistics about the parser, such as information on cyclic DFAs, which rules may use backtracking, and so on.
      • printGrammar

        protected boolean printGrammar
        If set to true, then the ANTLR tool will print a version of the input grammar(s) which are stripped of any embedded actions.
      • debug

        protected boolean debug
        If set to true, then the code generated by the ANTLR code generator will be set to debug mode. This means that when run, the code will 'hang' and wait for a debug connection on a TCP port (49100 by default).
      • profile

        protected boolean profile
        If set to true, then the generated parser will compute and report profile information at runtime.
      • nfa

        protected boolean nfa
        If set to true, then the ANTLR tool will generate a description of the NFA for each rule in Dot format
      • dfa

        protected boolean dfa
        If set to true, then the ANTLR tool will generate a description of the DFA for each decision in the grammar in Dot format.
      • trace

        protected boolean trace
        If set to true, the generated parser code will log rule entry and exit points to stdout (System.out for the Java target) as an aid to debugging.
      • messageFormat

        protected java.lang.String messageFormat
        If this parameter is set, it indicates that any warning or error messages returned by ANLTR, should be formatted in the specified way. Currently, ANTLR supports the built-in formats antlr, gnu and vs2005.
      • verbose

        protected boolean verbose
        If set to true, then ANTLR will report verbose messages during the code generation process. This includes the names of files, the version of ANTLR, and more.
      • includes

        protected java.util.Set<java.lang.String> 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 **/*.g is used to select grammar files.

      • excludes

        protected java.util.Set<java.lang.String> 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.
      • project

        protected org.apache.maven.project.MavenProject project
        The current Maven project.
      • tool

        protected Tool tool
        An instance of the ANTLR tool build.
    • 构造器详细资料

      • Antlr3Mojo

        public Antlr3Mojo()
    • 方法详细资料

      • getSourceDirectory

        public java.io.File getSourceDirectory()
      • getOutputDirectory

        public java.io.File getOutputDirectory()
      • getLibDirectory

        public java.io.File getLibDirectory()
      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException,
                            org.apache.maven.plugin.MojoFailureException
        The main entry point for this Mojo, it is responsible for converting ANTLR 3.x grammars into the target language specified by the grammar.
        抛出:
        org.apache.maven.plugin.MojoExecutionException - if a configuration or grammar error causes the code generation process to fail
        org.apache.maven.plugin.MojoFailureException - if an instance of the ANTLR 3 Tool cannot be created
      • getIncludesPatterns

        public java.util.Set<java.lang.String> getIncludesPatterns()