Rework path parsing

Right now, there are two types of path parsing I want to do: either I
want parse a data path (which could possibly be one ending with a list
with no keys; this patch doesn't handle that), or, I want to parse any
path. All of the commands that can take a schema path can also take any
other type of path because a data path is just a "subset" of a schema
path. So, I changed the schema path parser to an "any path" parser.
This any path parser can then work more efficiently than a "dataPath |
schemaPath" parser: it will try to parse a data path and on the first
non-data node it will switch and continue parsing schema nodes. This has
the advantage that I don't have to do workarounds for completion. Before
this, if the parser tried to backtrack to the schema path it would
always have to clear ParserContext path and completions and do
everything again, and that would mean trouble, because I didn't really
have much control about where exactly the completions get created.
Example: the data path parser would create the completions I wanted, but
then fail. The parser would then backtrack to schema path, but it
wouldn't parse as much of the input as the other one and that would
create different completions.

There is a small caveat: I do have create my own local variables for
dataPath and schemaPath. Before this I never did have to create a
`dataPath_` or a `schemaPath_` instance. However, I think that the
control that I get over how nodes are parsed (and over the resulting
attribute of the parser) outweighs that.

Also, there was another attempt on this, which just used Spirit
backtracking. As was said before, more control over this backtracking is
better. Also, not having Spirit backtracking will hopefully allow me to
transition to new Boost version more easily.

Change-Id: I3c8a1ac2ddad83a3da6c654557b36634596a5e8d
3 files changed
tree: 3551ac1e2b03172d3b3c846f216a6145489d2fd5
  1. .clang-format
  2. .gitmodules
  3. .zuul.yaml
  4. CMakeLists.txt
  5. Doxyfile.in
  6. LICENSE
  7. LICENSE.md
  8. README.md
  9. ci/
  10. cmake/
  11. docs/
  12. src/
  13. submodules/
  14. tests/
README.md

Console interface to NETCONF servers

This program provides an interactive console for working with YANG data. It can connect to NETCONF servers, and also talk to sysrepo locally.

Installation

For building, one needs:

Use an exact commit of any dependencies as specified in submodules/dependencies/*.

The build process uses CMake. A quick-and-dirty build with no fancy options can be as simple as mkdir build && cd build && cmake .. && make && make install.

Bug Reporting

Issue reporting and feature requests are welcome via Taiga.io.

Development

We are using Gerrit for patch submission, code review and Continuous Integration (CI). Development roadmap and planning happens over Taiga.io.

Credits

Copyright © CESNET, https://www.cesnet.cz/ . Portions copyright © Faculty of Information Technology, Czech Technical University in Prague, https://fit.cvut.cz/ . Most of the code was written by Václav Kubernát (CESNET, formerly FIT ČVUT) and Jan Kundrát (CESNET). The project is distributed under the terms of the Apache 2.0 license.