Package apg

Class Generator


  • public class Generator
    extends java.lang.Object
    The Generator class has a static main() function which is APG, the ABNF Parser Generator.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void main​(java.lang.String[] args)
      The main() function is APG, the ABNF Parser Generator.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
        The main() function is APG, the ABNF Parser Generator. Its command line arguments have two forms, flags and parameters.

        Flags are unary names indicating simple true/false values. They are false by default. If they appear on the command line they are set to true. All flags are optional.

        Parameters are binary with names and values. They are all given default values that may be changed by identifying them on the command line with name/value pairs. The input grammar definition file (/in=) is the only required parameter. All other parameters are optional.

        All flags and parameters are defined below:

         flags
         /da        attributes, display grammar attributes
         /de        errors, display parsing errors
         /dg        grammar, display grammar file with line numbers and character indexes
         ?          help, display this help screen
         /help      help, display this help screen
         /dm        metrics, display grammar metrics (opcode counts)
         /na        no attributes, omit grammar attribute discovery
         /dopcodes  opcodes, display opcodes in human readable format (may generate large amount of output)
         /dstate    state, display the state of the grammar parser
         /dstats    statistics, display the grammar parsing statistics
         /doptions  values, display all option values
         /dv        verbose, display all (except opcodes)
         /dw        warnings, display parsing warnings
        
         parameters
         /java=     if not null, generate a Grammar class at value.java (default: null)
         /javadoc=  if not null, generate a Grammar class with Javadoc documentation at value.java (default: null)
         /in=       (required)the SABNF grammar definition file (default: null)
         Files from multiple /in= parameters will be concatenated.
         /log=      name of log file, if null print log file to console (default: null)
         /package=  package name for the generated grammar (default: package.name)
         /dir=      working directory for input and output files (default: ./)
        
         All flags are false by default. Specifying a flag sets it to true.
         Multiple occurrences of a given flag are allowed but redundant. Resulting flag is true.
         Parameters are of the form parameter value. eg. /in=value.
         Parameter values may not be empty.
         Parameter values containing spaces must be quoted.
         Multiple occurrences of a given parameter are allowed.
         Files from multiple /in= parameters will be concatenated.
         For all other parameters, only the last value will be used.
         All flags and parameter names and values are case sensitive.
         
        Parameters:
        args - The command line arguments that provision APG.