Class ArgsParserImpl

java.lang.Object
org.refcodes.cli.ArgsParserImpl
All Implemented Interfaces:
ArgsParser, ArgsParserMixin<ArgsParser>, ArgsSyntaxAccessor, ArgumentEscapeCodeAccessor, ArgumentEscapeCodeAccessor.ArgumentEscapeCodeBuilder<ArgsParser>, ArgumentEscapeCodeAccessor.ArgumentEscapeCodeMutator, ArgumentEscapeCodeAccessor.ArgumentEscapeCodeProperty, CliMetrics, LongOptionPrefixAccessor, LongOptionPrefixAccessor.LongOptionPrefixBuilder<ArgsParser>, LongOptionPrefixAccessor.LongOptionPrefixMutator, LongOptionPrefixAccessor.LongOptionPrefixProperty, Optionable, OptionEscapeCodeAccessor, OptionEscapeCodeAccessor.OptionEscapeCodeBuilder<ArgsParser>, OptionEscapeCodeAccessor.OptionEscapeCodeMutator, OptionEscapeCodeAccessor.OptionEscapeCodeProperty, ShortOptionPrefixAccessor, ShortOptionPrefixAccessor.ShortOptionPrefixBuilder<ArgsParser>, ShortOptionPrefixAccessor.ShortOptionPrefixMutator, ShortOptionPrefixAccessor.ShortOptionPrefixProperty, SyntaxMetricsAccessor, SyntaxMetricsAccessor.SyntaxMetricsBuilder<ArgsParser>, SyntaxMetricsAccessor.SyntaxMetricsMutator, SyntaxMetricsAccessor.SyntaxMetricsProperty, org.refcodes.mixin.DescriptionAccessor, org.refcodes.mixin.DescriptionAccessor.DescriptionBuilder<ArgsParser>, org.refcodes.mixin.DescriptionAccessor.DescriptionMutator, org.refcodes.mixin.DescriptionAccessor.DescriptionProperty, org.refcodes.mixin.EscapeCodesStatusAccessor, org.refcodes.mixin.EscapeCodesStatusAccessor.EscapeCodeStatusBuilder<ArgsParser>, org.refcodes.mixin.EscapeCodesStatusAccessor.EscapeCodeStatusMutator, org.refcodes.mixin.EscapeCodesStatusAccessor.EscapeCodeStatusProperty, org.refcodes.mixin.NameAccessor, org.refcodes.mixin.NameAccessor.NameBuilder<ArgsParser>, org.refcodes.mixin.NameAccessor.NameMutator, org.refcodes.mixin.NameAccessor.NameProperty, org.refcodes.mixin.Resetable, org.refcodes.mixin.ResetEscapeCodeAccessor, org.refcodes.mixin.ResetEscapeCodeAccessor.ResetEscapeCodeBuilder<ArgsParser>, org.refcodes.mixin.ResetEscapeCodeAccessor.ResetEscapeCodeMutator, org.refcodes.mixin.ResetEscapeCodeAccessor.ResetEscapeCodeProperty, org.refcodes.mixin.TitleAccessor, org.refcodes.mixin.TitleAccessor.TitleBuilder<ArgsParser>, org.refcodes.mixin.TitleAccessor.TitleMutator, org.refcodes.mixin.TitleAccessor.TitleProperty, org.refcodes.textual.TextBoxGridAccessor, org.refcodes.textual.TextBoxGridAccessor.TextBoxGridBuilder<ArgsParser>, org.refcodes.textual.TextBoxGridAccessor.TextBoxGridMutator, org.refcodes.textual.TextBoxGridAccessor.TextBoxGridProperty

public class ArgsParserImpl extends Object implements ArgsParser
A straightforward implementation of the ArgsParser interface. The constructor only provides means to set the required attributes as the attributes to be adjusted optionally are already sufficiently preconfigured. For adjusting them, a flavor of the Builder-Pattern is provided with which you can easily chain the configuration of this instance; as them methods return the instance of this class being configured. This helps to prevent the telescoping constructor anti-pattern.

The SyntaxNotation is pre-set with the SyntaxNotation.LOGICAL notation.

The console width id preconfigured with the console's width as determined by the SystemUtility.getTerminalWidth().

The standard out PrintStream is preconfigured with the System.out PrintStream.

The newline characters to be used for line breaks is "\r\n" on Windows machines and "\"n" on all other machines as of the SystemUtility.getLineBreak().

See Also:
  • "http://en.wikipedia.org/wiki/Builder_pattern"
  • Field Details

  • Constructor Details

    • ArgsParserImpl

      public ArgsParserImpl()
      Constructs the ArgsParser instance without any restrictions to the parsed arguments. The constructor only provides means to set the required attributes as the attributes to be adjusted optionally are already sufficiently preconfigured. For adjusting them, a flavor of the Builder-Pattern is provided with which you can easily chain the configuration of this instance; as them methods return the instance of this class being configured.
    • ArgsParserImpl

      public ArgsParserImpl(Constituent aArgsSyntax)
      Constructs the ArgsParser instance with the given root Condition and the default SyntaxNotation.LOGICAL. The constructor only provides means to set the required attributes as the attributes to be adjusted optionally are already sufficiently preconfigured. For adjusting them, a flavor of the Builder-Pattern is provided with which you can easily chain the configuration of this instance; as them methods return the instance of this class being configured.
      Parameters:
      aArgsSyntax - The args syntax root Constituent node being the node from which parsing the command line arguments starts.
    • ArgsParserImpl

      public ArgsParserImpl(CliContext aCliCtx)
      Constructs the ArgsParser instance without any restrictions to the parsed arguments. The constructor only provides means to set the required attributes as the attributes to be adjusted optionally are already sufficiently preconfigured. For adjusting them, a flavor of the Builder-Pattern is provided with which you can easily chain the configuration of this instance; as them methods return the instance of this class being configured.
      Parameters:
      aCliCtx - The CliContext to be used for initializing.
    • ArgsParserImpl

      public ArgsParserImpl(Constituent aArgsSyntax, CliContext aCliCtx)
      Constructs the ArgsParser instance with the given root Condition and the default SyntaxNotation.LOGICAL. The constructor only provides means to set the required attributes as the attributes to be adjusted optionally are already sufficiently preconfigured. For adjusting them, a flavor of the Builder-Pattern is provided with which you can easily chain the configuration of this instance; as them methods return the instance of this class being configured.
      Parameters:
      aArgsSyntax - The args syntax root Constituent node being the node from which parsing the command line arguments starts.
      aCliCtx - The CliContext to be used for initializing.
  • Method Details

    • addExample

      public void addExample(Example aExampleUsage)
      Adds a usage example by providing a description of the example and the command line arguments required by the example.
      Specified by:
      addExample in interface ArgsParser
      Parameters:
      aExampleUsage - The description as well as the command line arguments used by the example.
    • errorLn

      public void errorLn(String aLine)
      Prints the given line to standard error with regards to the console width as specified by the ArgsParser.withConsoleWidth(int) method.
      Specified by:
      errorLn in interface ArgsParser
      Parameters:
      aLine - The line to be printed.
    • evalArgs

      public List<? extends Operand<?>> evalArgs(String[] aArgs) throws ArgsSyntaxException
      Evaluates the provided command line arguments and determines the according values by evaluating the root Condition. In case of parsing failure, an according exception is thrown. ATTENTION: This method tests(!) for superfluous command line arguments being passed; e.g. command line arguments not being evaluated by any of the Constituent instance being traversed starting at the root Condition will be reported. Business logic therefore should invoke this root node's ArgsParser.evalArgs(String[]) method instead of a Condition's Constituent.parseArgs(String[], String[], CliContext) method; as ignoring superfluous command line arguments will cause unexpected behavior from the point of view of the invoker.
      Specified by:
      evalArgs in interface ArgsParser
      Parameters:
      aArgs - The command line arguments to be evaluated.
      Returns:
      The list of evaluated command line arguments being instances of the Operand interfaces or its sub-types.
      Throws:
      ArgsSyntaxException - thrown in case of a command line arguments mismatch regarding provided and expected args.
    • getArgsSyntax

      public Constituent getArgsSyntax()
      The root condition is the starting point node of a Constituent hierarchy to be traversed when determining the syntax for command line arguments or when evaluating the command line arguments. Retrieves the root condition from the root condition property.
      Specified by:
      getArgsSyntax in interface ArgsParser
      Specified by:
      getArgsSyntax in interface ArgsSyntaxAccessor
      Returns:
      The root Condition in which's syntax this parser is based.
    • getBannerBorderEscapeCode

      public String getBannerBorderEscapeCode()
      Retrieves the banner's border Escape-Code from the banner border Escape-Code property.
      Specified by:
      getBannerBorderEscapeCode in interface ArgsParser
      Returns:
      The banner border Escape-Code stored by the banner border Escape-Code property.
    • getBannerEscapeCode

      public String getBannerEscapeCode()
      Retrieves the banner's content Escape-Code from the banner Escape-Code property.
      Specified by:
      getBannerEscapeCode in interface ArgsParser
      Returns:
      The banner Escape-Code stored by the banner Escape-Code property.
    • getCommandEscapeCode

      public String getCommandEscapeCode()
      Retrieves the command name's (CLI executable) Escape-Code from the command name Escape-Code property.
      Specified by:
      getCommandEscapeCode in interface ArgsParser
      Returns:
      The command name's Escape-Code stored by the command name Escape-Code property.
    • getCopyrightNote

      public String getCopyrightNote()
      Retrieves the copyright.
      Specified by:
      getCopyrightNote in interface ArgsParser
      Returns:
      The copyright note.
    • getDescription

      public String getDescription()
      Retrieves the description.
      Specified by:
      getDescription in interface ArgsParser
      Specified by:
      getDescription in interface org.refcodes.mixin.DescriptionAccessor
      Returns:
      The description.
    • getDescriptionEscapeCode

      public String getDescriptionEscapeCode()
      Retrieves the parameter's description Escape-Code from the parameter's description Escape-Code property.
      Specified by:
      getDescriptionEscapeCode in interface ArgsParser
      Returns:
      The description Escape-Code stored by the description Escape-Code property.
    • getExamples

      public List<Example> getExamples()
      Retrieves the Example instances as added using ArgsParser.addExample(String, Operand...).
      Specified by:
      getExamples in interface ArgsParser
      Returns:
      The according Example elements.
    • getLicenseNote

      public String getLicenseNote()
      Retrieves the license.
      Specified by:
      getLicenseNote in interface ArgsParser
      Returns:
      The license note.
    • getLineSeparatorEscapeCode

      public String getLineSeparatorEscapeCode()
      Retrieves the line separator Escape-Code from the line separator Escape-Code property.
      Specified by:
      getLineSeparatorEscapeCode in interface ArgsParser
      Returns:
      The line separator Escape-Code stored by the line separator Escape-Code property.
    • getLongOptionPrefix

      public String getLongOptionPrefix()
      Retrieves the long option prefix from the long option prefix property.
      Specified by:
      getLongOptionPrefix in interface LongOptionPrefixAccessor
      Returns:
      The long option prefix stored by the long option prefix property.
    • getName

      public String getName()
      Specified by:
      getName in interface org.refcodes.mixin.NameAccessor
    • getOptionEscapeCode

      public String getOptionEscapeCode()
      Retrieves the option Escape-Code from the option Escape-Code property.
      Specified by:
      getOptionEscapeCode in interface ArgsParser
      Specified by:
      getOptionEscapeCode in interface OptionEscapeCodeAccessor
      Returns:
      The option Escape-Code stored by the option Escape-Code property.
    • getArgumentEscapeCode

      public String getArgumentEscapeCode()
      Retrieves the parameter Escape-Code from the parameter Escape-Code property.
      Specified by:
      getArgumentEscapeCode in interface ArgsParser
      Specified by:
      getArgumentEscapeCode in interface ArgumentEscapeCodeAccessor
      Returns:
      The parameter Escape-Code stored by the parameter Escape-Code property.
    • getResetEscapeCode

      public String getResetEscapeCode()
      Specified by:
      getResetEscapeCode in interface org.refcodes.mixin.ResetEscapeCodeAccessor
    • getSeparatorLnChar

      public char getSeparatorLnChar()
      Gets the character to be used when printing a separator line with the ArgsParser.printSeparatorLn() method.
      Specified by:
      getSeparatorLnChar in interface ArgsParser
      Returns:
      aSeparatorChar The character used by the ArgsParser.printSeparatorLn() method when printing out the line of characters..
    • getShortOptionPrefix

      public Character getShortOptionPrefix()
      Retrieves the short option prefix from the short option prefix property.
      Specified by:
      getShortOptionPrefix in interface ShortOptionPrefixAccessor
      Returns:
      The short option prefix stored by the short option prefix property.
    • getSyntaxMetrics

      public SyntaxMetrics getSyntaxMetrics()
      Retrieves the SyntaxMetrics from the SyntaxMetrics property.
      Specified by:
      getSyntaxMetrics in interface SyntaxMetricsAccessor
      Returns:
      The SyntaxMetrics stored by the decorator (enabled) tags property.
    • getTextBoxGrid

      public org.refcodes.textual.TextBoxGrid getTextBoxGrid()
      Specified by:
      getTextBoxGrid in interface org.refcodes.textual.TextBoxGridAccessor
    • getTitle

      public String getTitle()
      Specified by:
      getTitle in interface org.refcodes.mixin.TitleAccessor
    • isEscapeCodesEnabled

      public boolean isEscapeCodesEnabled()
      Specified by:
      isEscapeCodesEnabled in interface org.refcodes.mixin.EscapeCodesStatusAccessor
    • printBanner

      public void printBanner()
      Prints the banner; the banner most probably is an ASCII_HEADER_ASCII_BODY art text block which's look depends strongly on the taste of the author implementing this interface.
      Specified by:
      printBanner in interface ArgsParser
    • printCopyrightNote

      public void printCopyrightNote()
      Prints the copyright note as specified by the ArgsParser.withCopyrightNote(String) method; with regards to the console width as specified by the ArgsParser.withConsoleWidth(int) method.
      Specified by:
      printCopyrightNote in interface ArgsParser
    • printDescription

      public void printDescription()
      Prints the description as set by the ArgsParser.withDescription(String) method with regards to the console width as specified by the ArgsParser.withConsoleWidth(int) method.
      Specified by:
      printDescription in interface ArgsParser
    • printExamples

      public void printExamples()
      Prints example usages as as added by the ArgsParser.addExample(String, Operand...) method with regards to the console width as specified by the ArgsParser.withConsoleWidth(int) method.
      Specified by:
      printExamples in interface ArgsParser
    • printHeader

      public void printHeader()
      Prints the header, which might be a simplified banner: Can be used when overriding methods such as ArgsParser.printHelp() or ArgsParser.printBanner().
      Specified by:
      printHeader in interface ArgsParser
    • printLicenseNote

      public void printLicenseNote()
      Prints the license note as specified by the ArgsParser.withLicenseNote(String) method; with regards to the console width as specified by the ArgsParser.withConsoleWidth(int) method.
      Specified by:
      printLicenseNote in interface ArgsParser
    • printLn

      public void printLn()
      Prints an empty line / a line break.
      Specified by:
      printLn in interface ArgsParser
    • printLn

      public void printLn(String aLine)
      Prints the given line to standard out with regards to the console width as specified by the ArgsParser.withConsoleWidth(int) method.
      Specified by:
      printLn in interface ArgsParser
      Parameters:
      aLine - The line to be printed.
    • printOptions

      public void printOptions()
      Prints the Options (short- and the long-options), the Flages and the Operand and their description with regards to the console width as specified by the ArgsParser.withConsoleWidth(int) method.
      Specified by:
      printOptions in interface ArgsParser
    • printSeparatorLn

      public void printSeparatorLn()
      Prints a separator line using the separator character as specified by the ArgsParser.withSeparatorLnChar(char) method; with regards to the console width as specified by the ArgsParser.withConsoleWidth(int) method.
      Specified by:
      printSeparatorLn in interface ArgsParser
    • printSynopsis

      public void printSynopsis()
      Prints the syntax as retrieved by the root Condition element as of Synopsisable.toSynopsis(SyntaxNotation) with regards to the SyntaxNotation set by the ArgsParser.withSyntaxMetrics(SyntaxMetrics) method.
      Specified by:
      printSynopsis in interface ArgsParser
    • reset

      public void reset()
      Specified by:
      reset in interface org.refcodes.mixin.Resetable
    • setBannerBorderEscapeCode

      public void setBannerBorderEscapeCode(String aBannerBorderEscapeCode)
      Sets the banner's border Escape-Code for the banner border Escape-Code property.
      Specified by:
      setBannerBorderEscapeCode in interface ArgsParser
      Parameters:
      aBannerBorderEscapeCode - The banner border Escape-Code to be stored by the banner border Escape-Code property.
    • setBannerEscapeCode

      public void setBannerEscapeCode(String aBannerEscapeCode)
      Sets the banner's content Escape-Code for the banner Escape-Code property.
      Specified by:
      setBannerEscapeCode in interface ArgsParser
      Parameters:
      aBannerEscapeCode - The banner Escape-Code to be stored by the banner Escape-Code property.
    • setBannerFont

      public void setBannerFont(org.refcodes.textual.Font aBannerFont)
      Sets the banner font.
      Specified by:
      setBannerFont in interface ArgsParser
      Parameters:
      aBannerFont - the new banner font
    • setBannerFontPalette

      public void setBannerFontPalette(char[] aColorPalette)
      Sets the banner font palette.
      Specified by:
      setBannerFontPalette in interface ArgsParser
      Parameters:
      aColorPalette - the new banner font palette
    • setCommandEscapeCode

      public void setCommandEscapeCode(String aCommandEscapeCode)
      Sets the command name's (CLI executable) Escape-Code for the command name Escape-Code property.
      Specified by:
      setCommandEscapeCode in interface ArgsParser
      Parameters:
      aCommandEscapeCode - The command name's Escape-Code to stored by the command name Escape-Code property.
    • setConsoleWidth

      public void setConsoleWidth(int aConsoleWidth)
      Set the console with. A setting of "-1" makes the instance use the SystemUtility.getTerminalWidth() value, i.e. the console width is set automatically to be the width of your terminal.
      Specified by:
      setConsoleWidth in interface ArgsParser
      Parameters:
      aConsoleWidth - The width to set or -1 to let the parser automatically determine the console width.
    • setCopyrightNote

      public void setCopyrightNote(String aCopyrightNote)
      Set the copyright note used by the ArgsParser.printHelp() method when writing out the copyright claim and make other adjustments with the result (with regards to the Builder-Pattern).
      Specified by:
      setCopyrightNote in interface ArgsParser
      Parameters:
      aCopyrightNote - The license note printed out by the ArgsParser.printHelp() method.
    • setDescription

      public void setDescription(String aDescription)
      Specified by:
      setDescription in interface org.refcodes.mixin.DescriptionAccessor.DescriptionMutator
    • setDescriptionEscapeCode

      public void setDescriptionEscapeCode(String aDescriptionEscapeCode)
      Sets the description Escape-Code for the description Escape-Code property.
      Specified by:
      setDescriptionEscapeCode in interface ArgsParser
      Parameters:
      aDescriptionEscapeCode - The description Escape-Code to be stored by the description Escape-Code property.
    • setErrorOut

      public void setErrorOut(PrintStream aErrorOut)
      Set the error out PrintStream and make other adjustments with the result (with regards to the Builder-Pattern).
      Specified by:
      setErrorOut in interface ArgsParser
      Parameters:
      aErrorOut - The error out PrintStream to set.
    • setEscapeCodesEnabled

      public void setEscapeCodesEnabled(boolean isEscapeCodesEnabled)
      Specified by:
      setEscapeCodesEnabled in interface org.refcodes.mixin.EscapeCodesStatusAccessor.EscapeCodeStatusMutator
    • setLicenseNote

      public void setLicenseNote(String aLicenseNote)
      Set the license note used by the ArgsParser.printHelp() method when writing out the licensing conditions.
      Specified by:
      setLicenseNote in interface ArgsParser
      Parameters:
      aLicenseNote - The license note printed out by the ArgsParser.printHelp() method.
    • setLineBreak

      public void setLineBreak(String aLineBreak)
      Set the console's line break. A setting of null makes the instance use the SystemUtility.getLineBreak() value.
      Specified by:
      setLineBreak in interface ArgsParser
      Parameters:
      aLineBreak - the new line break
    • setLineSeparatorEscapeCode

      public void setLineSeparatorEscapeCode(String aLineSeparatorEscapeCode)
      Sets the line separator Escape-Code for the line separator Escape-Code property.
      Specified by:
      setLineSeparatorEscapeCode in interface ArgsParser
      Parameters:
      aLineSeparatorEscapeCode - The line separator Escape-Code to be stored by the line separator Escape-Code property.
    • setLongOptionPrefix

      public void setLongOptionPrefix(String aLongOptionPrefix)
      Sets the long option prefix for the long option prefix property.
      Specified by:
      setLongOptionPrefix in interface LongOptionPrefixAccessor.LongOptionPrefixMutator
      Parameters:
      aLongOptionPrefix - The long option prefix to be stored by the long option prefix property.
    • setMaxConsoleWidth

      public void setMaxConsoleWidth(int aMaxConsoleWidth)
      Set the maximum console width to use in case the console width is greater than the maximum you want. This is most useful when the console width is determined automatically to be the width of your terminal.
      Specified by:
      setMaxConsoleWidth in interface ArgsParser
      Parameters:
      aMaxConsoleWidth - the new max console width
    • setName

      public void setName(String aName)
      Specified by:
      setName in interface org.refcodes.mixin.NameAccessor.NameMutator
    • setOptionEscapeCode

      public void setOptionEscapeCode(String aOptEscapeCode)
      Sets the option Escape-Code for the option Escape-Code property.
      Specified by:
      setOptionEscapeCode in interface ArgsParser
      Specified by:
      setOptionEscapeCode in interface OptionEscapeCodeAccessor.OptionEscapeCodeMutator
      Parameters:
      aOptEscapeCode - The option Escape-Code to be stored by the option Escape-Code property.
    • setArgumentEscapeCode

      public void setArgumentEscapeCode(String aParamEscapeCode)
      Sets the parameter Escape-Code for the parameter Escape-Code property.
      Specified by:
      setArgumentEscapeCode in interface ArgsParser
      Specified by:
      setArgumentEscapeCode in interface ArgumentEscapeCodeAccessor.ArgumentEscapeCodeMutator
      Parameters:
      aParamEscapeCode - The parameter Escape-Code to be stored by the parameter Escape-Code property.
    • setResetEscapeCode

      public void setResetEscapeCode(String aResetEscapeCode)
      Specified by:
      setResetEscapeCode in interface org.refcodes.mixin.ResetEscapeCodeAccessor.ResetEscapeCodeMutator
    • setSeparatorLnChar

      public void setSeparatorLnChar(char aSeparatorLnChar)
      Set the character to be used when printing a separator line with the ArgsParser.printSeparatorLn() method.
      Specified by:
      setSeparatorLnChar in interface ArgsParser
      Parameters:
      aSeparatorLnChar - The character used by the ArgsParser.printSeparatorLn() method when printing out the line of characters..
    • setShortOptionPrefix

      public void setShortOptionPrefix(Character aShortOptionPrefix)
      Sets the short option prefix for the short option prefix property.
      Specified by:
      setShortOptionPrefix in interface ShortOptionPrefixAccessor.ShortOptionPrefixMutator
      Parameters:
      aShortOptionPrefix - The short option prefix to be stored by the short option prefix property.
    • setStandardOut

      public void setStandardOut(PrintStream aStandardOut)
      Set the standard out PrintStream and make other adjustments with the result (with regards to the Builder-Pattern).
      Specified by:
      setStandardOut in interface ArgsParser
      Parameters:
      aStandardOut - The standard out PrintStream to set.
    • setSyntaxMetrics

      public void setSyntaxMetrics(SyntaxMetrics aSyntaxMetrics)
      Specified by:
      setSyntaxMetrics in interface ArgsParser
      Specified by:
      setSyntaxMetrics in interface SyntaxMetricsAccessor.SyntaxMetricsMutator
      Parameters:
      aSyntaxMetrics - The SyntaxNotation to set.
    • setTextBoxGrid

      public void setTextBoxGrid(org.refcodes.textual.TextBoxGrid aTextBoxGrid)
      Specified by:
      setTextBoxGrid in interface org.refcodes.textual.TextBoxGridAccessor.TextBoxGridMutator
    • setTitle

      public void setTitle(String aTitle)
      Specified by:
      setTitle in interface org.refcodes.mixin.TitleAccessor.TitleMutator
    • getDelimiter

      protected char getDelimiter()
      Returns the delimiter to be used by colliding command line args when creating non colliding arg's aliases (keys for key/value-pairs).
      Returns:
      The according delimiter.
    • fromArgs

      protected static List<? extends Operand<?>> fromArgs(String[] aArgs, char aDelimiter)
      Heuristically loads the arguments without any syntax required, e.g. without any root Condition to be set.
      Parameters:
      aArgs - The arguments to be loaded.
      aDelimiter - The delimiter to resolve name clashes.
      Returns:
      A list of heuristically determined Flag and StringOperand instances.