#include <cparser.h>
Inheritance diagram for CommandParser:
Public Methods | |
bool | GetCommand () |
read one command from the buffer | |
bool | FlushArg () |
flush command buffer | |
wxString | GetErrorMes () |
get the error message if parsing went wrong | |
bool | GetEnv (const wxString &envname, wxString &envstring) |
get environment variable | |
DL_List< const wxString * > * | GetArgList () |
list of command arguments found | |
DL_Iter< const wxString * > * | GetArgIter () |
iterator to traverse the list of command arguments found | |
wxString | GetCommandParsed () |
get the parses command |
strings according to the BNF below.
Below you can see the Bachus Naur representation of the enhanced parser: <commands> ::= [<blanks>] { { <command> }* } <command> ::= [<blanks>] {<comment> | {<word> {<blanks> | <endcommand}}* }* <endcommand> ::= {';' | '\n' | '\0' } <word> ::= { <quotedstring> | <bracedstring> | <multipartword> } <quotedstring> ::= ('"') {CHAR | '\"' | '\\n' | aliasref | envref }* ('"') <bracedstring> ::= ('{') {CHAR | '\{' | '\}' | '\\n'}* ('}') <multipartword> ::= { <aliasref> | <envref> | {CHAR | '\\n'}* }* <aliasref> ::= ('%') { <name> <blank> | ('{') <name> ('}') } <envref> ::= ('$') { <name> <blank> | ('{') <name> ('}') } <name> ::= { LETTER | DIGIT | UNDERSCORE | MINUS }* <blanks> ::= { TAB | SPACE | '\\n'}* <comment> ::= # {CHAR}* ('\0') note: [ ] entity CAN occur zero or more times ( ) entity MUST occur { } pick one of the entities within the braces { }* entities within the braces CAN occur zero ore more times { }+ entities within the braces MUST occur one ore more times | OR