ddc
xpath_syntax.h
Go to the documentation of this file.
1 /*
2 www.sourceforge.net/projects/tinyxpath
3 Copyright (c) 2002-2004 Yves Berquin (yvesb@users.sourceforge.net)
4 
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any
7 damages arising from the use of this software.
8 
9 Permission is granted to anyone to use this software for any
10 purpose, including commercial applications, and to alter it and
11 redistribute it freely, subject to the following restrictions:
12 
13 1. The origin of this software must not be misrepresented; you must
14 not claim that you wrote the original software. If you use this
15 software in a product, an acknowledgment in the product documentation
16 would be appreciated but is not required.
17 
18 2. Altered source versions must be plainly marked as such, and
19 must not be misrepresented as being the original software.
20 
21 3. This notice may not be removed or altered from any source
22 distribution.
23 */
24 
31 #ifndef __TINYSYNTAX_H
32 #define __TINYSYNTAX_H
33 
34 #include <assert.h>
35 #include <stdio.h>
36 #include "tokenlist.h"
37 
38 namespace TinyXPath
39 {
40 
43 {
44 public :
45  syntax_error (const char * cp_mess = NULL)
46  {
47  if (cp_mess && strlen (cp_mess) < sizeof (ca_mess) - 1)
48  strcpy (ca_mess, cp_mess);
49  else
50  ca_mess [0] = 0;
51  }
52  char ca_mess [200];
53 } ;
54 
56 class syntax_overflow {} ;
57 
61 {
62 protected :
64  unsigned u_nb_recurs;
65  bool o_recognize (xpath_construct xc_current, bool o_final);
66 public :
68  virtual ~ token_syntax_decoder () {}
69  void v_syntax_decode ();
71  virtual void v_action (xpath_construct xc_rule, unsigned u_sub,
72  unsigned u_variable = 0, const char * cp_literal = "") = 0;
73  virtual int i_get_action_counter () = 0;
74 } ;
75 
76 }
77 
78 #endif
79 
80 /*--- emacs style variables ---
81  * Local Variables:
82  * mode: C++
83  * c-file-style: "ellemtel"
84  * c-basic-offset: 4
85  * tab-width: 8
86  * indent-tabs-mode: nil
87  * End:
88  */
Exception class for a syntax error.
Definition: xpath_syntax.h:42
Definition: tokenlist.h:45
virtual ~ token_syntax_decoder()
Definition: xpath_syntax.h:68
xpath_construct
XPath constructions. The ordinals are rules of XPath or XML definitions in w3c.
Definition: lex_util.h:78
syntax_error(const char *cp_mess=NULL)
Definition: xpath_syntax.h:45
Definition: action_store.cpp:32
char ca_mess[200]
Definition: xpath_syntax.h:52
token_syntax_decoder()
Definition: xpath_syntax.h:67
unsigned u_nb_recurs
Nb of recursions.
Definition: xpath_syntax.h:64
Exception class for an overflow in syntax decoding.
Definition: xpath_syntax.h:56
Definition: xpath_syntax.h:60