commandbox.system.util

Class REPLParser

lucee.Component
    extended by commandbox.system.util.REPLParser

Copyright Since 2014 CommandBox by Ortus Solutions, Corp www.coldbox.org | www.ortussolutions.com I contain helpful methods for REPL parsing.

Class Attributes:
  • singleton
  •  
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
  • author : Grant Copley
  •  
    Property Summary
    type property default serializable required
    any JSONService


    • access = public
    • returntype = any
    • inject = JSONService
    true false
    any formatterUtil


    • access = public
    • returntype = any
    • inject = Formatter
    true false
    Constructor Summary
    init()
          Constructor.
    Method Summary
    any addCommandLine([string command])
         Adds an additional line for the command we are parsing.
    any addCommandLines([string command])
         Adds one or more lines at once.
    any evaluateCommand(any executor, any directory)
         Returns serialized evaluation of command if possible.
    any getCommandAsString()
         Returns all commands lines as a single string.
    any getCommandLines()
         Returns an array with each line of the command seperated.
    any getCommandPreparedForEvaluation()
         Returns command as string with certain charaters removed that prevent evaluation.
    string getFormatterUtil()
    string getJSONService()
    any isCommandComplete()
         Returns true if the command is complete and is ready to be executed.
    any serializeOutput([any result])
         Serializes output.
    any setFormatterUtil(any formatterUtil)
    any setJSONService(any JSONService)
    any startCommand()
         Clears existing command lines and signal we are starting a new command.
    any stripComments([string command])
         Removes comments from command.
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init()

    Constructor


    Property Detail

    JSONService

    property any JSONService

    Attributes:
    access - public
    required - false
    returntype - any
    inject - JSONService
    serializable - true

    formatterUtil

    property any formatterUtil

    Attributes:
    access - public
    required - false
    returntype - any
    inject - Formatter
    serializable - true

    Method Detail

    addCommandLine

    public any addCommandLine([string command])

    Adds an additional line for the command we are parsing.

    Parameters:
    command

    addCommandLines

    public any addCommandLines([string command])

    Adds one or more lines at once

    Parameters:
    command

    evaluateCommand

    public any evaluateCommand(any executor, any directory)

    Returns serialized evaluation of command if possible.

    Parameters:
    executor - the executor context to attempt evaluation
    directory

    getCommandAsString

    public any getCommandAsString()

    Returns all commands lines as a single string.


    getCommandLines

    public any getCommandLines()

    Returns an array with each line of the command seperated


    getCommandPreparedForEvaluation

    public any getCommandPreparedForEvaluation()

    Returns command as string with certain charaters removed that prevent evaluation.


    getFormatterUtil

    public string getFormatterUtil()


    getJSONService

    public string getJSONService()


    isCommandComplete

    public any isCommandComplete()

    Returns true if the command is complete and is ready to be executed.


    serializeOutput

    public any serializeOutput([any result])

    Serializes output

    Parameters:
    result

    setFormatterUtil

    public any setFormatterUtil(any formatterUtil)

    Parameters:
    formatterUtil

    setJSONService

    public any setJSONService(any JSONService)

    Parameters:
    JSONService

    startCommand

    public any startCommand()

    Clears existing command lines and signal we are starting a new command.


    stripComments

    public any stripComments([string command])

    Removes comments from command

    Parameters:
    command