rshell  1.2
Parse_Command_Sets Class Reference

Contains several various parsing techinques to manage bash input. More...

#include <Parse.h>

Public Member Functions

 Parse_Command_Sets (string cmd)
 
Command_Elementparse ()
 Parses the string 'cmds' into a Command_Element* which can be executed. More...
 
Command_Elementparse (string str)
 Parses the string 'cmds' into a Command_Element* which can be executed. More...
 
Command_Elementsingle (string str)
 called when no connectors are passed indicating a single command More...
 
Command_Elementdual (vector< string > str)
 Called when one connector connects exactly two commands. More...
 
Command_Elementmulti (vector< string > str)
 Called when many connectors (2+) are in the submitted command. More...
 

Protected Attributes

string input
 
Command_Elementcmds
 

Detailed Description

Contains several various parsing techinques to manage bash input.

Constructor & Destructor Documentation

Parse_Command_Sets::Parse_Command_Sets ( string  cmd)

Constructor stores the string passed in. The user typically does not instantiate this class, but can for debugging purposes.

Member Function Documentation

Command_Element * Parse_Command_Sets::dual ( vector< string >  str)

Called when one connector connects exactly two commands.

Returns
Returns a pointer to the Command_Element which can be executed
Command_Element * Parse_Command_Sets::multi ( vector< string >  str)

Called when many connectors (2+) are in the submitted command.

Returns
Returns a pointer to the Command_Element which can be executed
Command_Element * Parse_Command_Sets::parse ( )

Parses the string 'cmds' into a Command_Element* which can be executed.

Returns
Returns a pointer to the Command_Element which can be executed
Command_Element * Parse_Command_Sets::parse ( string  input)

Parses the string 'cmds' into a Command_Element* which can be executed.

Returns
Returns a pointer to the Command_Element which can be executed

This parsing class is the gateway between Command_Element and all other parsing classes. First the main string is ensured it isn't empty and is passed to Parse_Multiple_Commands. Based on the size of the returning vector the class sends the vector to single(), dual() or multi() which organize and create a single root command. Calling execute on this root recursively calls all other commands to emulate Bash

Command_Element * Parse_Command_Sets::single ( string  str)

called when no connectors are passed indicating a single command

Returns
Returns a pointer to the Command_Element which can be executed

The documentation for this class was generated from the following files: