444 |
| ECHO SP boolean { $$ = LSCPSERVER->SetEcho((yyparse_param_t*) yyparse_param, $3); } |
| ECHO SP boolean { $$ = LSCPSERVER->SetEcho((yyparse_param_t*) yyparse_param, $3); } |
445 |
| SHELL SP INTERACT SP boolean { $$ = LSCPSERVER->SetShellInteract((yyparse_param_t*) yyparse_param, $5); } |
| SHELL SP INTERACT SP boolean { $$ = LSCPSERVER->SetShellInteract((yyparse_param_t*) yyparse_param, $5); } |
446 |
| SHELL SP AUTO_CORRECT SP boolean { $$ = LSCPSERVER->SetShellAutoCorrect((yyparse_param_t*) yyparse_param, $5); } |
| SHELL SP AUTO_CORRECT SP boolean { $$ = LSCPSERVER->SetShellAutoCorrect((yyparse_param_t*) yyparse_param, $5); } |
447 |
|
| SHELL SP DOC SP boolean { $$ = LSCPSERVER->SetShellDoc((yyparse_param_t*) yyparse_param, $5); } |
448 |
| VOLUME SP volume_value { $$ = LSCPSERVER->SetGlobalVolume($3); } |
| VOLUME SP volume_value { $$ = LSCPSERVER->SetGlobalVolume($3); } |
449 |
| VOICES SP number { $$ = LSCPSERVER->SetGlobalMaxVoices($3); } |
| VOICES SP number { $$ = LSCPSERVER->SetGlobalMaxVoices($3); } |
450 |
| STREAMS SP number { $$ = LSCPSERVER->SetGlobalMaxStreams($3); } |
| STREAMS SP number { $$ = LSCPSERVER->SetGlobalMaxStreams($3); } |
1282 |
ECHO : 'E''C''H''O' |
ECHO : 'E''C''H''O' |
1283 |
; |
; |
1284 |
|
|
1285 |
|
DOC : 'D''O''C' |
1286 |
|
; |
1287 |
|
|
1288 |
QUIT : 'Q''U''I''T' |
QUIT : 'Q''U''I''T' |
1289 |
; |
; |
1290 |
|
|
1494 |
* @param expectedSymbols - will be filled with next expected grammar symbols |
* @param expectedSymbols - will be filled with next expected grammar symbols |
1495 |
* @param nextExpectedChars - just for internal purpose, due to the recursive |
* @param nextExpectedChars - just for internal purpose, due to the recursive |
1496 |
* implementation of this function, do supply an |
* implementation of this function, do supply an |
1497 |
* empty character for this argument |
* empty string for this argument |
1498 |
* @param history - only for internal purpose, keeps a history of all previous |
* @param history - only for internal purpose, keeps a history of all previous |
1499 |
* parser symbol stacks (just for avoiding endless recursion in |
* parser symbol stacks (just for avoiding endless recursion in |
1500 |
* this recursive algorithm) |
* this recursive algorithm), do supply an empty history |
1501 |
* @param depth - just for internal debugging purposes |
* @param depth - just for internal debugging purposes, do not supply it |
1502 |
*/ |
*/ |
1503 |
static void walkAndFillExpectedSymbols( |
static void walkAndFillExpectedSymbols( |
1504 |
std::vector<YYTYPE_INT16>& stack, |
std::vector<YYTYPE_INT16>& stack, |
1723 |
#define DEBUG_PUSH_PARSE 0 |
#define DEBUG_PUSH_PARSE 0 |
1724 |
|
|
1725 |
/** |
/** |
1726 |
* Implements parsing exactly one character (given by @a c), continueing at the |
* Implements parsing exactly one character (given by @a ch), continueing at the |
1727 |
* parser position reflected by @a stack. The @a stack will hold the new parser |
* parser position reflected by @a stack. The @a stack will hold the new parser |
1728 |
* state after this call. |
* state after this call. |
1729 |
* |
* |
1793 |
* The @a stack will reflect the new parser state after this call. |
* The @a stack will reflect the new parser state after this call. |
1794 |
* |
* |
1795 |
* This is just a wrapper ontop of yyPushParse() which converts parser |
* This is just a wrapper ontop of yyPushParse() which converts parser |
1796 |
* exceptions thrown by yyPushParse() into negative return value. |
* exceptions thrown by yyPushParse() into @c false return value. |
1797 |
*/ |
*/ |
1798 |
static bool yyValid(std::vector<YYTYPE_INT16>& stack, char ch) { |
static bool yyValid(std::vector<YYTYPE_INT16>& stack, char ch) { |
1799 |
try { |
try { |
1900 |
* @param stack - current Bison (yacc) symbol stack to create auto completion for |
* @param stack - current Bison (yacc) symbol stack to create auto completion for |
1901 |
* @param history - only for internal purpose, keeps a history of all previous |
* @param history - only for internal purpose, keeps a history of all previous |
1902 |
* parser symbol stacks (just for avoiding endless recursion in |
* parser symbol stacks (just for avoiding endless recursion in |
1903 |
* this auto completion algorithm) |
* this auto completion algorithm), do supply an empty history |
1904 |
* @param depth - just for internal debugging purposes |
* @param depth - just for internal debugging purposes, do not supply anything |
1905 |
* @returns auto completion for current, given parser state |
* @returns auto completion for current, given parser state |
1906 |
*/ |
*/ |
1907 |
static String yyAutoComplete(std::vector<YYTYPE_INT16>& stack, YYStackHistory& history, int depth = 0) { |
static String yyAutoComplete(std::vector<YYTYPE_INT16>& stack, YYStackHistory& history, int depth = 0) { |
2009 |
|
|
2010 |
/** |
/** |
2011 |
* Just a convenience wrapper on top of the actual yyAutoComplete() |
* Just a convenience wrapper on top of the actual yyAutoComplete() |
2012 |
* implementation. See description above for details. |
* implementation. See its description above for details. |
2013 |
*/ |
*/ |
2014 |
static String yyAutoComplete(std::vector<YYTYPE_INT16>& stack) { |
static String yyAutoComplete(std::vector<YYTYPE_INT16>& stack) { |
2015 |
YYStackHistory history; |
YYStackHistory history; |
2086 |
String sSuggestion = yyAutoComplete(stackCopy); |
String sSuggestion = yyAutoComplete(stackCopy); |
2087 |
if (!sSuggestion.empty()) result += LSCP_SHK_SUGGEST_BACK + sSuggestion; |
if (!sSuggestion.empty()) result += LSCP_SHK_SUGGEST_BACK + sSuggestion; |
2088 |
|
|
2089 |
if (!possibilities) return result; |
if (possibilities) { |
2090 |
|
// append all possible terminals and non-terminals according to |
2091 |
|
// current parser state |
2092 |
|
std::map<String,BisonSymbolInfo> expectedSymbols; |
2093 |
|
walkAndFillExpectedSymbols(stack, expectedSymbols); |
2094 |
|
|
|
// finally append all possible terminals and non-terminals according to |
|
|
// current parser state |
|
|
std::map<String,BisonSymbolInfo> expectedSymbols; |
|
|
walkAndFillExpectedSymbols(stack, expectedSymbols); |
|
|
{ |
|
2095 |
// pretend to LSCP shell that the following terminal symbols were |
// pretend to LSCP shell that the following terminal symbols were |
2096 |
// non-terminal symbols (since they are not human visible for auto |
// non-terminal symbols (since they are not human visible for auto |
2097 |
// completion on the shell's screen) |
// completion on the shell's screen) |