Minsky
RESTMinsky.cc
Go to the documentation of this file.
1 /*
2  @copyright Steve Keen 2021
3  @author Russell Standish
4  This file is part of Minsky.
5 
6  Minsky is free software: you can redistribute it and/or modify it
7  under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  Minsky is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with Minsky. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #include "RESTMinsky.h"
21 #include "cairoItems.h"
22 #include "RESTProcess_base.h"
23 #include "signature.h"
24 #include "minsky_epilogue.h"
25 using namespace std;
26 
27 namespace minsky
28 {
29  Minsky::CmdData RESTMinsky::getCommandData(const string& dottedCommand) const
30  {
31  switch (registry.count(dottedCommand))
32  {
33  case 0:
34  return no_command;
35  case 1:
36  {
37  auto& cmd=*registry.find(dottedCommand)->second;
38  return cmd.isConst()? is_const: cmd.isObject()? is_setterGetter: generic;
39  }
40  case 2:
41  {
42  auto firstCmd=registry.find(dottedCommand), secondCmd=firstCmd;
43  ++secondCmd;
44  if (firstCmd->second->arity()+secondCmd->second->arity() == 1)
45  return is_setterGetter;
46  return generic;
47  }
48  default:
49  return generic;
50  }
51 
52  }
53 }
STL namespace.
Creation and access to the minskyTCL_obj object, which has code to record whenever Minsky&#39;s state cha...
Definition: constMap.h:22
cmd_data * getCommandData(const string &name)
Definition: minskyTCL.cc:62