-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLIgen code stuck in recursion at the time of parsing #23
Comments
@ashuagarwal01
Second, the [] is the optional operator and they are arranged in a sequence. I.e [aa][ab][ac] etc. It is implemented to expand all possibilities, and when a large of number of these are arranged in a sequence you get a state explosion . For every [] you add you double the number of states. So To see this, you can use the -p command-line to cligen_file. If you run the syntax above as you can see how it expand to the eight basic sequences:
If you have 32 options, there will be 4M of these. This will consume memory (quadratically), I dont think CPU is a problem. See for example for some 20 entries:
Finally I wouldlike to know if you really want this sequence of options? Is it not just option between these alternatives you need? |
Hi, Thanks for the prompt reply. Okay, understood. And yes for my case if a given container has say 50 leaves then all those are optional. Also looking at the expanded tree, it seems they also need to be in order. A user can pass in any number of leaves and very much possibly in any random order. Regards. |
New "sets" feature added, see: |
Hi,
I am trying to parse following sample input file and cligen code hangs at the time of parsing. I enabled debug flag and screen is flooded with following message.
cgy_list_push
The cligen file I am using is as below:
`#CLIgen input file
treename="main";
@config_command;
treename="config_command";
show("Retrieve yang object data") @show, show_cb();
treename="container_inventory_list_show";
list(""), fn_cb();{
("list key name"), fn_cb();
{
[aa ("des")]
[ab ("des")]
[ac ("des")]
[ad ("des")]
[ae ("des")]
[af ("des")]
[ag ("des")]
[ah ("des")]
[ai ("des")]
[aj ("des")]
[ak ("des")]
[al ("des")]
[am ("des")]
[an ("des")]
[ao ("des")]
[ap ("des")]
[aq ("des")]
[ar ("des")]
[as ("des")]
[at ("des")]
[au ("des")]
[av ("des")]
[aw ("des")]
[ax ("des")]
[ay ("des")]
[az ("des")]
[ba ("des")]
[bb ("des")]
[bc ("des")]
[bd ("des")]
[be ("des")]
[bf ("des")], fn_cb();
}
}
treename="container_inventory_show";
inventory(""), fn_cb();
{
[@container_inventory_list_show], fn_cb();
}
treename="container_show";
container(""), fn_cb();
{
<string length[1:32]>("The name of the container."), fn_cb();
{
[@container_inventory_show], fn_cb();
}
}
treename="show";
@container_show;
`
The text was updated successfully, but these errors were encountered: