File: dceparselex.h

package info (click to toggle)
netcdf-parallel 1%3A4.7.4-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 105,352 kB
  • sloc: ansic: 229,114; sh: 11,180; yacc: 2,561; makefile: 1,390; lex: 1,173; xml: 173; awk: 2
file content (105 lines) | stat: -rw-r--r-- 3,449 bytes parent folder | download | duplicates (6)
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/* Copyright 2018, UCAR/Unidata and OPeNDAP, Inc.
   See the COPYRIGHT file for more information. */

#ifndef DCEPARSELEX_H
#define DCEPARSELEX_H

#include "config.h"

/* Forward */
struct DCEparsestate;
typedef struct DCEparsestate DCEparsestate;

#include "dcetab.h"

#ifdef _WIN32


#endif

/* For consistency with Java parser */
#ifndef null
#define null NULL
#endif

typedef void* Object;

#define YYSTYPE Object

#define MAX_TOKEN_LENGTH 1024

/*! Specifies DCElexstate. */
typedef struct DCElexstate {
    char* input;
    char* next; /* next char in uri.query */
    NCbytes* yytext;
    /*! Specifies the Lasttoken. */
    int lasttoken;
    char lasttokentext[MAX_TOKEN_LENGTH+1]; /* leave room for trailing null */
    NClist* reclaim; /* reclaim SCAN_WORD instances */
} DCElexstate;

/*! Specifies DCEparsestate. */
struct DCEparsestate {
    DCEconstraint* constraint;
    char errorbuf[1024];
    int errorcode;
    DCElexstate* lexstate;
};

/* Define a generic object carrier; this serves
   essentially the same role as the typical bison %union
   declaration
*/
   

extern int ceerror(DCEparsestate*,char*);
extern void ce_parse_error(DCEparsestate*,const char *fmt, ...);

/* bison parse entry point */
extern int dceparse(DCEparsestate*);

extern int dceerror(DCEparsestate* state, char* msg);
extern void projections(DCEparsestate* state, Object list0);
extern void selections(DCEparsestate* state, Object list0);
extern Object projectionlist(DCEparsestate* state, Object list0, Object decl);
extern Object projection(DCEparsestate* state, Object segmentlist);
extern Object segmentlist(DCEparsestate* state, Object list0, Object decl);
extern Object segment(DCEparsestate* state, Object name, Object slices0);
extern Object array_indices(DCEparsestate* state, Object list0, Object decl);
extern Object range(DCEparsestate* state, Object, Object, Object);
extern Object selectionlist(DCEparsestate* state, Object list0, Object decl);
extern Object sel_clause(DCEparsestate* state, int selcase, Object path0, Object relop0, Object values);
extern Object selectionpath(DCEparsestate* state, Object list0, Object text);
extern Object arrayelement(DCEparsestate* state, Object name, Object index);
extern Object function(DCEparsestate* state, Object fcnname, Object args);
extern Object arg_list(DCEparsestate* state, Object list0, Object decl);
extern Object value_list(DCEparsestate* state, Object list0, Object decl);
extern Object value(DCEparsestate* state, Object value);
extern Object makeselectiontag(CEsort);
extern Object indexer(DCEparsestate* state, Object name, Object indices);
extern Object indexpath(DCEparsestate* state, Object list0, Object index);
extern Object var(DCEparsestate* state, Object indexpath);
extern Object constant(DCEparsestate* state, Object val, int tag);
extern Object clauselist(DCEparsestate* state, Object list0, Object decl);
extern Object range1(DCEparsestate* state, Object rangenumber);
extern Object rangelist(DCEparsestate* state, Object list0, Object decl);

/* lexer interface */
extern int dcelex(YYSTYPE*, DCEparsestate*);
extern void dcelexinit(char* input, DCElexstate** lexstatep);
extern void dcelexcleanup(DCElexstate** lexstatep);

extern int dcedebug;

#ifdef PARSEDEBUG
extern Object debugobject(Object);
#define checkobject(x) debugobject(x)
#else
#define checkobject(x) (x)
#endif

extern int dapceparse(char* input, DCEconstraint*, char**);

#endif /*DCEPARSELEX_H*/