source: XIOS3/trunk/extern/src_netcdf4/dceparselex.h @ 2538

Last change on this file since 2538 was 409, checked in by ymipsl, 12 years ago

Add improved nectdf internal library src

YM

  • Property svn:eol-style set to native
File size: 3.4 KB
Line 
1/* Copyright 2009, UCAR/Unidata and OPeNDAP, Inc.
2   See the COPYRIGHT file for more information. */
3
4#ifndef DCEPARSELEX_H
5#define DCEPARSELEX_H
6
7#include "config.h"
8#include "dcetab.h"
9
10#ifdef WIN32
11#define strcasecmp stricmp
12#define snprintf _snprintf
13#endif
14
15/* For consistency with Java parser */
16#ifndef null
17#define null NULL
18#endif
19
20typedef void* Object;
21
22#define YYSTYPE Object
23
24#define MAX_TOKEN_LENGTH 1024
25
26/*! Specifies DCElexstate. */
27typedef struct DCElexstate {
28    char* input;
29    char* next; /* next char in uri.query */
30    NCbytes* yytext;
31    /*! Specifies the Lasttoken. */
32    int lasttoken;
33    char lasttokentext[MAX_TOKEN_LENGTH+1]; /* leave room for trailing null */
34    NClist* reclaim; /* reclaim SCAN_WORD instances */
35} DCElexstate;
36
37/*! Specifies DCEparsestate. */
38typedef struct DCEparsestate {
39    DCEconstraint* constraint;
40    char errorbuf[1024];
41    int errorcode;
42    DCElexstate* lexstate;
43} DCEparsestate;
44
45/* Define a generic object carrier; this serves
46   essentially the same role as the typical bison %union
47   declaration
48*/
49   
50
51extern int ceerror(DCEparsestate*,char*);
52extern void ce_parse_error(DCEparsestate*,const char *fmt, ...);
53
54/* bison parse entry point */
55extern int dceparse(DCEparsestate*);
56
57extern int dceerror(DCEparsestate* state, char* msg);
58extern void projections(DCEparsestate* state, Object list0);
59extern void selections(DCEparsestate* state, Object list0);
60extern Object projectionlist(DCEparsestate* state, Object list0, Object decl);
61extern Object projection(DCEparsestate* state, Object segmentlist);
62extern Object segmentlist(DCEparsestate* state, Object list0, Object decl);
63extern Object segment(DCEparsestate* state, Object name, Object slices0);
64extern Object array_indices(DCEparsestate* state, Object list0, Object decl);
65extern Object range(DCEparsestate* state, Object, Object, Object);
66extern Object selectionlist(DCEparsestate* state, Object list0, Object decl);
67extern Object sel_clause(DCEparsestate* state, int selcase, Object path0, Object relop0, Object values);
68extern Object selectionpath(DCEparsestate* state, Object list0, Object text);
69extern Object arrayelement(DCEparsestate* state, Object name, Object index);
70extern Object function(DCEparsestate* state, Object fcnname, Object args);
71extern Object arg_list(DCEparsestate* state, Object list0, Object decl);
72extern Object value_list(DCEparsestate* state, Object list0, Object decl);
73extern Object value(DCEparsestate* state, Object value);
74extern Object makeselectiontag(CEsort);
75extern Object indexer(DCEparsestate* state, Object name, Object indices);
76extern Object indexpath(DCEparsestate* state, Object list0, Object index);
77extern Object var(DCEparsestate* state, Object indexpath);
78extern Object constant(DCEparsestate* state, Object val, int tag);
79extern Object clauselist(DCEparsestate* state, Object list0, Object decl);
80extern Object range1(DCEparsestate* state, Object rangenumber);
81extern Object rangelist(DCEparsestate* state, Object list0, Object decl);
82
83/* lexer interface */
84extern int dcelex(YYSTYPE*, DCEparsestate*);
85extern void dcelexinit(char* input, DCElexstate** lexstatep);
86extern void dcelexcleanup(DCElexstate** lexstatep);
87
88extern int dcedebug;
89
90#ifdef PARSEDEBUG
91extern Object debugobject(Object);
92#define checkobject(x) debugobject(x)
93#else
94#define checkobject(x) (x)
95#endif
96
97extern int dapceparse(char* input, DCEconstraint*, char**);
98
99#endif /*DCEPARSELEX_H*/
100
Note: See TracBrowser for help on using the repository browser.