KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SemanticIO.h
Go to the documentation of this file.
1 /* $Id: SemanticIO.h 17350 2014-08-21 20:30:43Z cdawson $ */
2 
3 #ifndef SEMANTIC_IO_H_
4 #define SEMANTIC_IO_H_
5 
14 #include "l_cpp/l_exception.h"
16 #include <boost/array.hpp>
17 #include <boost/bind.hpp>
18 #include <string>
19 #include <iostream>
20 #include <numeric>
21 
22 namespace semantics
23 {
24  template<typename Enum_type>
25  std::string enum_to_string(Enum_type)
26  {
27  return "<Unknown enum type>";
28  }
29 
30 
31 /* /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ */
32 
33  template<typename Enum_type>
34  Enum_type string_to_enum(std::string)
35  {
36  return static_cast<Enum_type>(0);
37  }
38 
39 // /* /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ */
40 
41 // enum Attribute_type
42 // {
43 // COLOR, //0
44 // SIZE, //1
45 // NUM_ATTRIBUTES, //2
46 // NULL_ATTRIBUTE //3
47 // };
48 
49 
50 /* /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ */
51 
52  namespace Step_code
53  {
54  enum Code
55  {
56  NULL_STEP, //0
57  IDENTITY, //1
58  HEAD, //2
59  LEFT_ARG, //3
60  RIGHT_ARG, //4
61  ATT0, //5
62  ATT1, //6
64  };
65 
67  typedef boost::array<Code, NUM_STEPS> Val_array;
69 
70  const Val_array codes =
72 
73  };
74 
76 
77  // template<> std::string enum_to_string<Attribute_type>(Attribute_type);
78  template<> std::string enum_to_string<Step_code_t>(Step_code_t);
79 
80  // template<> Attribute_type string_to_enum<Attribute_type>(std::string);
81 };
82 
83 #endif
Definition: SemanticIO.h:62
kjb::Weight_array< NUM_STEPS > Weights
Definition: SemanticIO.h:66
Definition: SemanticIO.h:60
Definition: SemanticIO.h:63
boost::array< bool, D > Filter
Definition: prob_weight_array.h:45
boost::array< Code, NUM_STEPS > Val_array
Definition: SemanticIO.h:67
std::string enum_to_string(Enum_type)
Definition: SemanticIO.h:25
string enum_to_string< Step_code_t >(Step_code_t value)
Definition: SemanticIO.cpp:55
Weights::Filter Filter_array
Definition: SemanticIO.h:68
Definition: SemanticIO.h:57
Enum_type string_to_enum(std::string)
Definition: SemanticIO.h:34
Step_code::Code Step_code_t
Definition: SemanticIO.h:73
Definition: SemanticIO.h:56
Definition: SemanticIO.h:61
Definition: SemanticIO.h:58
Forward declarations.
Definition: prob_weight_array.h:28
Definition: SemanticIO.h:59
const Val_array codes
Definition: SemanticIO.h:70
Support for error handling exception classes in libKJB.
Code
Definition: SemanticIO.h:54