summaryrefslogtreecommitdiff
path: root/lib/command_parse.y
AgeCommit message (Collapse)Author
2016-09-21lib: Update copyright headersQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-20Merge remote-tracking branch 'origin/cmaster-next' into vtysh-grammarDonald Sharp
2016-09-19lib: Initial refactor pass on CLI backendQuentin Young
Shotgun commit: * Remove shim sources from Makefile.am * Move new types to command.c / command.h * Rewrite command.c / command.h * Refactor shim types to real types in matcher and parser * Initial refactor pass on vty.c Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-18lib: Allow nesting options in selectorsQuentin Young
Options may now be nested in selectors as long as they are not the first token in sequence. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-14lib: Add support for selectors inside optionsQuentin Young
Selectors may be nested inside options [<like|so>]. Removed the ability to make multipart options [like|so]. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-13lib: Fix various matching bugsQuentin Young
Missed a copy, disambigs forgot to walkback Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-08lib: Fix uninitialized pointer segfaultQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-08lib: Add <cr> text for end nodesQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-07lib: Fix deduplication bug, reinstate graph printQuentin Young
Comparing the wrong nodes led to duplication during graph construction, fixed. Also update graph pretty print to use new graph struct. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-07lib: Continue matching system refactorQuentin Young
Most things back to working, all CLI units refactored to use improved graph implementation. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-02lib: Refactor command_parse.y for graph dsQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-08-11lib: Refactor CLI interface function namesQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-08-10lib: Add completion string convenience functionsQuentin Young
And set END_GN default text to <cr>, and scrub a coupld of extraneous files Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-08-09lib: Remove unnecessary node pointerQuentin Young
Selector and option heads had pointers to their ends, but this turned out to be unnecessary Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-08-09lib: Revert breaking change to cmp_nodeQuentin Young
Bad conditional refactor broke graph deduplication and thus disambiguation precedence Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-08-09lib: Fix use after free in lexerQuentin Young
Fix occasional bug where deleting flex's input buffer happens earlier than flex expects Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-08-09lib: Fix various minor bugsQuentin Young
- cmd_make_strvec returns null pointer if str begins with a '#' - disallow options nested options - NULL out state variable in parser - flip backwards comparison - fix memory leak in lexer Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-08-08lib: Code cleanup, formatting, & headersQuentin Young
Gnu-style code, add copyright headers, cleanup some random style issues, shuffle around code into relevant units, add docs. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-08-05lib: Major parser refactorQuentin Young
Lots of cleanup, code consolidation, organizational improvements. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-08-05lib: Add docstring supportQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-08-04lib: Unrefactor to signed long long for rangesQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-08-04lib: Allow optional whitespace in rangesQuentin Young
Makes ranges where both endpoints are negative somewhat more readable. Also validate ranges. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-08-04lib: Add support for negative rangesQuentin Young
And convert range delimiters to signed int Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-08-04lib: Refactor format parserQuentin Young
Also fix a bug where selector elements beginning with the same word are only parsed once Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-08-02lib: Add vararg supportQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-08-01lib: Fix OOB range parses, variable matchesQuentin Young
Variables now allow strings beginning with numbers to match, ranges and numbers are now long long to fix OOB parses resulting in integer wraparounds. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-08-01lib: Fixed bad node copy, modified token regexQuentin Young
When building argv for matched command, only the last node was being copied to argv; the rest were added by reference. Additionally the regex for certain tokens was too restrictive and disallowed characters allowed by the old parser; these have been reinstated. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-07-29lib: Cleanup some memory issues in CLIQuentin Young
Various memory leaks have been fixed and the quagga memory macros are in use. Also consolidated the argv and matching code into one graph traversal. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-07-27lib: Cleanup parser memory managementQuentin Young
Free as appropriate. Additionally add new type of node to demark graph head (START_GN). Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-07-27lib: Add matching and argv supportQuentin Young
Queries may be run against DFA's to find matching cmd_element, and argument lists may be constructed. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-07-26lib: Incremental matching improvementQuentin Young
Shotgun changes to matching system Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-07-22lib: Reorganize some matching stuffQuentin Young
Introduce new node type, END_GN, and remove is_leaf flags. Reorganize command_match.c & remove internal functions from command_match.h. Start rewriting command.h in command_new.h with changes for new backend. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-07-21lib: Mostly complete matcherQuentin Young
Input matching and completions works. Still some rough edges. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-07-19lib: Break up functions, begin matcherQuentin Young
Moved test hook out of command.c into vtysh.c, renamed graph modules, added matching code Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-07-19lib: Implement node comparison functionQuentin Young
Implement comparator for nodes, some miscellaneous cleanup. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-07-18lib: Fix some DFA construction bugsQuentin Young
Options get null paths, parser state is properly cleaned up, caller passes start node Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-07-17lib: Finish implementing grammar, DFA constructionQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-07-12lib: Change some includesQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>