source: XIOS/dev/dev_ym/XIOS_SERVICES/extern/src_netcdf4/dapparselex.h @ 2325

Last change on this file since 2325 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.1 KB
Line 
1/* Copyright 2009, UCAR/Unidata and OPeNDAP, Inc.
2   See the COPYRIGHT file for more information. */
3
4#ifndef DAPPARSELEX_H
5#define DAPPARSELEX_H 1
6
7#include "ocinternal.h"
8#include "ocdebug.h"
9#ifdef USE_DAP
10/* To avoid "make distclean" wiping out dap.tab.h */
11#include "daptab.h"
12#else
13#include "daptab.h"
14#endif
15
16#ifdef WIN32
17#define strcasecmp stricmp
18#define snprintf _snprintf
19#endif
20
21/* For consistency with Java parser */
22#define null NULL
23
24typedef void* Object;
25
26#define YYSTYPE Object
27
28#define MAX_TOKEN_LENGTH 1024
29
30/*! Specifies the Lexstate. */
31typedef struct DAPlexstate {
32    char* input;
33    char* next; /* next char in uri.query*/
34    OCbytes* yytext;
35    int lineno;
36    /*! Specifies the Lasttoken. */
37    int lasttoken;
38    char lasttokentext[MAX_TOKEN_LENGTH+1];
39    char* wordchars1;
40    char* wordcharsn;
41    char* worddelims;
42    OClist* reclaim; /* reclaim WORD_WORD instances */
43} DAPlexstate;
44
45/*! Specifies the DAPparsestate. */
46typedef struct DAPparsestate {
47    struct OCnode* root;
48    DAPlexstate* lexstate;
49    OClist* ocnodes;
50    struct OCstate* conn;
51    /* For error returns from the server */
52    int svcerror; /* 1 => we had an error from the server */
53    char* code;
54    char* message;
55    char* progtype;
56    char* progname;
57    /* State for constraint expressions */
58    struct CEstate* cestate;
59} DAPparsestate;
60
61extern int daperror(DAPparsestate* state, const char* msg);
62extern void dap_parse_error(DAPparsestate*,const char *fmt, ...);
63/* bison parse entry point */
64extern int dapparse(DAPparsestate*);
65
66extern Object dap_datasetbody(DAPparsestate*,Object decls, Object name);
67extern Object dap_declarations(DAPparsestate*,Object decls, Object decl);
68extern Object dap_arraydecls(DAPparsestate*,Object arraydecls, Object arraydecl);
69extern Object dap_arraydecl(DAPparsestate*,Object name, Object size);
70
71extern void dap_dassetup(DAPparsestate*);
72extern Object dap_attributebody(DAPparsestate*,Object attrlist);
73extern Object dap_attrlist(DAPparsestate*,Object attrlist, Object attrtuple);
74extern Object dap_attribute(DAPparsestate*,Object name, Object value, Object etype);
75extern Object dap_attrset(DAPparsestate*,Object name, Object attributes);
76extern Object dap_attrvalue(DAPparsestate*,Object valuelist, Object value, Object etype);
77
78extern Object dap_makebase(DAPparsestate*,Object name, Object etype, Object dimensions);
79extern Object dap_makestructure(DAPparsestate*,Object name, Object dimensions, Object fields);
80extern Object dap_makesequence(DAPparsestate*,Object name, Object members);
81extern Object dap_makegrid(DAPparsestate*,Object name, Object arraydecl, Object mapdecls);
82
83extern void dap_errorbody(DAPparsestate*, Object, Object, Object, Object);
84extern void dap_unrecognizedresponse(DAPparsestate*);
85
86extern void dap_tagparse(DAPparsestate*,int);
87
88/* Lexer entry points */
89extern int daplex(YYSTYPE*, DAPparsestate*);
90extern void daplexinit(char* input, DAPlexstate** lexstatep);
91extern void daplexcleanup(DAPlexstate** lexstatep);
92extern void dapsetwordchars(DAPlexstate* lexstate, int kind);
93extern char* dapdecode(DAPlexstate*,char*);
94
95#endif /*DAPPARSELEX_H*/
Note: See TracBrowser for help on using the repository browser.