File: parser.h

package info (click to toggle)
teg 0.11.2%2Bdebian-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny, squeeze
  • size: 11,484 kB
  • ctags: 7,108
  • sloc: ansic: 16,775; sh: 8,559; python: 1,442; xml: 490; makefile: 385
file content (68 lines) | stat: -rw-r--r-- 1,680 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*	$Id: parser.h,v 1.6 2001/10/01 03:31:42 riq Exp $	*/
/* Tenes Empanadas Graciela
 *
 * Copyright (C) 2000 Ricardo Quesada
 *
 * Author: Ricardo Calixto Quesada <rquesada@core-sdi.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; only version 2 of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
 */
/*
 * Estructura del parser
 */

#ifndef __PARSER_H
#define __PARSER_H

#define PARSER_TOKEN_MAX 1024
#define PARSER_VALUE_MAX 1024

typedef struct _DELIM {
	char a;
	char b;
	char c;
} DELIM, *PDELIM;

#define DELIM_EQ1 {'=','=','='}
#define DELIM_FI1 {';',';',';'}

#define DELIM_EQ2 {':',':',':'}
#define DELIM_FI2 {',',',',','}

#define DELIM_EQ3 {'|','|','|'}
#define DELIM_FI3 {'/','/','/'}

#define DELIM_NULL {'\0','\0','\0'}

typedef struct {
	char *data; 
	int hay_otro;
	char token[PARSER_TOKEN_MAX];
	char value[PARSER_VALUE_MAX];
	PDELIM igualador;
	PDELIM separador;
} PARSER, *PPARSER;

typedef enum {
	PARSER_FIN,
	PARSER_SEPARADOR,
	PARSER_IGUAL,
	PARSER_DATA,
	PARSER_ERROR
} PARSER_VALUE, *PPARSER_VALUE;

/* Unica funcion publica del parser */
int parser_call( PPARSER );

#endif /* __PARSER_H */