00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef PARAMS_H
00021 #define PARAMS_H
00022
00023 class params
00024 {
00025 typedef grammar_to_parser::parsers parser_list;
00026 public:
00027 class name
00028 {
00029 public:
00030 grammar_to_parser::pattern_parser m_param;
00031 grammar_to_parser::value_parser<std::string> m_name;
00032
00033 name() : m_param("name:") {};
00034 void push_parsers( parser_list &l )
00035 {
00036 l.push_back(&m_param);
00037 l.push_back(&m_name);
00038 }
00039 operator std::string()
00040 {
00041 return m_name.get_valid();
00042 }
00043 };
00044 class age
00045 {
00046 public:
00047 grammar_to_parser::pattern_parser m_param;
00048 grammar_to_parser::value_parser<unsigned long> m_age;
00049
00050 age() : m_param("age:") {};
00051 void push_parsers( parser_list &l )
00052 {
00053 l.push_back(&m_param);
00054 l.push_back(&m_age);
00055 }
00056 operator unsigned long()
00057 {
00058 return m_age.get_valid();
00059 }
00060 };
00061 class company
00062 {
00063 public:
00064 grammar_to_parser::pattern_parser m_param;
00065 grammar_to_parser::value_parser<std::string> m_company;
00066
00067 company() : m_param("company:") {};
00068 void push_parsers( parser_list &l )
00069 {
00070 l.push_back(&m_param);
00071 l.push_back(&m_company);
00072 }
00073 operator std::string()
00074 {
00075 return m_company.get_valid();
00076 }
00077 };
00078 grammar_to_parser::non_terminal<name> m_name;
00079 grammar_to_parser::non_terminal<age> m_age;
00080 grammar_to_parser::non_terminal<company> m_company;
00081
00082 void push_parsers( parser_list &l )
00083 {
00084 l.push_back(&m_name);
00085 l.push_back(&m_age);
00086 l.push_back(&m_company);
00087 }
00088
00089
00090 };
00091
00092 #endif