Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

lex_util.h

Go to the documentation of this file.
00001 /*
00002 www.sourceforge.net/projects/tinyxpath
00003 Copyright (c) 2002-2004 Yves Berquin (yvesb@users.sourceforge.net)
00004 
00005 This software is provided 'as-is', without any express or implied
00006 warranty. In no event will the authors be held liable for any
00007 damages arising from the use of this software.
00008 
00009 Permission is granted to anyone to use this software for any
00010 purpose, including commercial applications, and to alter it and
00011 redistribute it freely, subject to the following restrictions:
00012 
00013 1. The origin of this software must not be misrepresented; you must
00014 not claim that you wrote the original software. If you use this
00015 software in a product, an acknowledgment in the product documentation
00016 would be appreciated but is not required.
00017 
00018 2. Altered source versions must be plainly marked as such, and
00019 must not be misrepresented as being the original software.
00020 
00021 3. This notice may not be removed or altered from any source
00022 distribution.
00023 */
00024 
00031 #ifndef __TINYUTIL_H
00032 #define __TINYUTIL_H
00033 
00034 #include "tinyxpath_conf.h"
00035 #include "tinyxml.h"
00036 
00037 #ifdef _MSC_VER
00038    #pragma warning (disable : 4514)  
00039 #endif
00040 
00041 namespace TinyXPath
00042 {
00043 
00044 typedef unsigned char _byte_;
00045 
00047 enum lexico {
00048             // single chars
00049 
00050             lex_null, lex_none, lex_space, lex_digit, lex_bchar, lex_extend, lex_slash, lex_at,
00051             lex_dot, lex_minus, lex_under, lex_colon, lex_scolon, lex_2_quote, lex_1_quote, 
00052             lex_dollar, lex_oparen, lex_cparen, lex_star, lex_plus, lex_comma, lex_lt,
00053             lex_gt, lex_equal, lex_obrack, lex_cbrack, lex_orchar, lex_exclam,
00054             
00055             // constructions
00056             
00057             lex_ncname, lex_number, lex_literal, lex_2_colon, lex_2_slash, lex_2_dot, lex_not_equal,
00058             lex_lt_equal, lex_gt_equal,
00059 
00060             // keywords
00061 
00062             lex_start_keyword,
00063             lex_or = lex_start_keyword, lex_and, lex_mod, lex_div,
00064 
00065             lex_start_axis_name,
00066             lex_ancestor = lex_start_axis_name, lex_ancestor_or_self, lex_attribute, lex_child, lex_descendant, 
00067             lex_descendant_or_self, lex_following, lex_following_sibling, lex_namespace, 
00068             lex_parent, lex_preceding, lex_preceding_sibling, lex_self, 
00069             lex_end_axis_name = lex_self,
00070 
00071             lex_processing_instruction,
00072             lex_comment, lex_node, lex_text,
00073             lex_end_keyword = lex_text
00074 
00075              };
00076 
00078 enum xpath_construct {
00079    xpath_unknown = 0,
00080    xpath_location_path = 1,
00081    xpath_absolute_location_path = 2,
00082    xpath_relative_location_path = 3,
00083    xpath_step = 4,
00084    xpath_axis_specifier = 5,
00085    xpath_axis_name = 6,
00086    xpath_node_test = 7,
00087    xpath_predicate = 8,
00088    xpath_predicate_expr = 9,
00089    xpath_abbreviated_absolute_location_path = 10,
00090    xpath_abbrieviated_step = 12,
00091    xpath_abbreviated_axis_specifier = 13,
00092    xpath_expr = 14,
00093    xpath_primary_expr = 15,
00094    xpath_function_call = 16,
00095    xpath_argument = 17,
00096    xpath_union_expr = 18,
00097    xpath_path_expr = 19,
00098    xpath_filter_expr = 20,
00099    xpath_or_expr = 21,
00100    xpath_and_expr = 22,
00101    xpath_equality_expr = 23,
00102    xpath_relational_expr = 24,
00103    xpath_additive_expr = 25,
00104    xpath_multiplicative_expr = 26,
00105    xpath_unary_expr = 27,
00106    xpath_multiply_operator = 34,
00107    xpath_variable_reference = 36,
00108    xpath_name_test = 37,
00109    xpath_xml_q_name = 206,
00110    xpath_xml_prefix = 207,
00111    xpath_xml_local_part = 208};
00112 
00113 enum xpath_sub {
00114    xpath_absolute_location_path_slash_rel,
00115    xpath_absolute_location_path_slash,
00116    xpath_absolute_location_path_abbrev,
00117    xpath_relative_location_path_rel_step,
00118    xpath_relative_location_path_rel_double_slash_step,
00119    xpath_relative_location_path_step,
00120    xpath_step_abbrev,
00121    xpath_step_full,
00122    xpath_primary_expr_variable,
00123    xpath_primary_expr_paren_expr,
00124    xpath_primary_expr_literal,
00125    xpath_primary_expr_number,
00126    xpath_primary_expr_function_call,
00127    xpath_name_test_star,
00128    xpath_name_test_ncname,
00129    xpath_name_test_qname,
00130    xpath_xml_q_name_colon,
00131    xpath_xml_q_name_simple,
00132    xpath_axis_specifier_at,
00133    xpath_axis_specifier_axis_name,
00134    xpath_axis_specifier_empty,
00135    xpath_path_expr_location_path,
00136    xpath_path_expr_filter,
00137    xpath_path_expr_slash,
00138    xpath_path_expr_2_slash,
00139    xpath_filter_expr_primary,
00140    xpath_filter_expr_predicate,
00141    xpath_location_path_rel,
00142    xpath_location_path_abs,
00143    xpath_node_test_reserved_keyword,
00144    xpath_node_test_pi,
00145    xpath_node_test_pi_lit,
00146    xpath_node_test_name_test,
00147    xpath_equality_expr_equal,
00148    xpath_equality_expr_not_equal,
00149    xpath_equality_expr_simple,
00150    xpath_union_expr_simple,
00151    xpath_union_expr_union,
00152    xpath_additive_expr_simple,
00153    xpath_additive_expr_plus,
00154    xpath_additive_expr_minus,
00155    xpath_additive_expr_more_plus,
00156    xpath_additive_expr_more_minus,
00157    xpath_or_expr_simple,
00158    xpath_or_expr_or,
00159    xpath_and_expr_simple,
00160    xpath_and_expr_and,
00161    xpath_relational_expr_simple,
00162    xpath_relational_expr_lt,
00163    xpath_relational_expr_gt,
00164    xpath_relational_expr_lte,
00165    xpath_relational_expr_gte,
00166    xpath_unary_expr_simple,
00167    xpath_unary_expr_minus,
00168    xpath_multiplicative_expr_simple,
00169    xpath_multiplicative_expr_star,
00170    xpath_multiplicative_expr_div,
00171    xpath_multiplicative_expr_mod,
00172    dummy
00173    } ;
00174 
00175 extern const char * cp_disp_class_lex (lexico lex_in);
00176 extern bool o_is_axis_name (lexico lex_test);
00177 extern lexico lex_get_class (_byte_ b_in);
00178 extern lexico lex_test_id (const _byte_ * bp_str, unsigned u_size, lexico);
00179 extern TIXML_STRING S_remove_lead_trail (const char * cp_in);
00180 extern void v_assign_int_to_string (TIXML_STRING & S_string, int i_val);
00181 extern void v_assign_double_to_string (TIXML_STRING & S_string, double d_val);
00182 #ifdef TINYXPATH_DEBUG
00183    extern const char * cp_disp_construct (xpath_construct xc);
00184    extern void v_generate_ascii_htm ();
00185    extern const char * cp_disp_class (_byte_ b_in);
00186 #endif
00187 }
00188 
00189 #endif

Generated for TinyXPath by doxygen SourceForge Logo