00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef EXTENDED_REGULAR_EXPRESSIONERE_BRANCH_H
00021 #define EXTENDED_REGULAR_EXPRESSIONERE_BRANCH_H
00022
00023 namespace extended_regular_expression {
00024
00025 template< typename E > class ere_expression;
00026
00045 template<typename E>
00046 class ere_branch : public ere_base<E>
00047 {
00048 typedef typename grammar_to_parser::basic_parser<E>::parser_list
00049 parser_list;
00050
00051 class ere_expression_ere_branch : public ere_base<E>
00052 {
00053 grammar_to_parser::basic_choice<E, ere_expression<E> > m_ere_expression;
00054 grammar_to_parser::basic_choice<E, ere_branch<E> > m_ere_branch;
00055 public:
00056 ere_expression_ere_branch() : ere_base<E>() {};
00057 ~ere_expression_ere_branch() {};
00058
00059 unsigned long recognize( const E* buf,
00060 const unsigned long buf_length,
00061 const unsigned long buf_offset,
00062 bool try_positions = true );
00063 void push_parsers( parser_list& l );
00064
00065 void assign_matches( matches::match_key parent_address,
00066 unsigned long& branch_pos,
00067 matches& m );
00068 };
00069
00070 grammar_to_parser::basic_choice<E, ere_expression<E> > m_ere;
00071 grammar_to_parser::basic_non_terminal<E,ere_expression_ere_branch>
00072 m_ere_expression_ere_branch;
00073
00074 public:
00075 ere_branch() :
00076 ere_base<E>(),
00077 m_ere_expression_ere_branch() {};
00078 ~ere_branch() {};
00079
00080 unsigned long recognize( const E* buf,
00081 const unsigned long buf_length,
00082 const unsigned long buf_offset,
00083 bool try_positions = true );
00084
00085 void assign_matches( matches::match_key parent_address,
00086 unsigned long& branch_pos,
00087 matches& m );
00088
00089 bool is_right_anchor()
00090 {
00091 return m_ere.is_parsed() && m_ere->is_right_anchor();
00092 }
00093
00094 void push_parsers( parser_list& l );
00095 };
00096
00097 };
00098
00099 #endif