From c04d65e1d3487abb9e1096299e3e1b0c7918e008 Mon Sep 17 00:00:00 2001 From: Dennis Heimbigner Date: Sun, 17 Apr 2011 18:50:10 +0000 Subject: [PATCH] --- Makefile.am | 7 +- RELEASE_NOTES | 6 + configure.ac | 3 +- include/Makefile.am | 3 +- {libncdap3 => include}/ceconstraints.h | 7 +- libcdmr/Makefile.am | 26 +- libcdmr/ast/src/compiler/Make0 | 2 +- .../ast/src/compiler/ProtobufParser.output | 2409 ------------ libcdmr/ast/src/compiler/foo.c | 3376 ----------------- libcdmr/ast/src/compiler/foo.h | 408 -- libcdmr/ast/src/compiler/t.h | 24 - libcdmr/cce.y | 94 + libcdmr/cceconstraints.c | 844 +++++ libcdmr/cceconstraints.h | 126 + libcdmr/ccelex.c | 223 ++ libcdmr/cceparse.c | 244 ++ libcdmr/cceparselex.h | 89 + libcdmr/ccetab.c | 1679 ++++++++ libcdmr/ccetab.h | 58 + libcdmr/curlwrap.c | 4 +- libcdmr/nccr.c | 36 +- libcdmr/nccr.h | 10 - libcdmr/nccrconstraints.c | 173 - libcdmr/nccrconstraints.h | 108 - libcdmr/nccrproto.c | 45 + liblib/Makefile.am | 9 +- libncdap3/Makefile.am | 3 +- libncdap3/dapodom.h | 6 +- libncdap3/dceconstraints.h | 6 +- 29 files changed, 3455 insertions(+), 6573 deletions(-) rename {libncdap3 => include}/ceconstraints.h (90%) delete mode 100644 libcdmr/ast/src/compiler/ProtobufParser.output delete mode 100644 libcdmr/ast/src/compiler/foo.c delete mode 100644 libcdmr/ast/src/compiler/foo.h delete mode 100644 libcdmr/ast/src/compiler/t.h create mode 100644 libcdmr/cce.y create mode 100644 libcdmr/cceconstraints.c create mode 100644 libcdmr/cceconstraints.h create mode 100644 libcdmr/ccelex.c create mode 100644 libcdmr/cceparse.c create mode 100644 libcdmr/cceparselex.h create mode 100644 libcdmr/ccetab.c create mode 100644 libcdmr/ccetab.h delete mode 100755 libcdmr/nccrconstraints.c delete mode 100644 libcdmr/nccrconstraints.h diff --git a/Makefile.am b/Makefile.am index 40dcceca4..0cf0fb85c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -85,10 +85,11 @@ endif if BUILD_DAP OCLIB=oc NCDAP3=libncdap3 +NCDAP4=libncdap4 +DAP2=libdap2 if BUILD_UTILITIES NCDAPTESTDIR=ncdap_test endif # BUILD_UTILITIES -NCDAP4=libncdap4 endif # Build UDUNITS? @@ -115,13 +116,13 @@ endif # If using dispatch, then the order is different if BUILD_SEPARATE_FORTRAN SUBDIRS = include $(UDUNITS) $(H5_TEST_DIR) $(DISPATCHDIR) $(OCLIB) \ -$(LIBSRC_DIR) $(LIBSRC4_DIR) $(NCDAP3) $(NCDAP4) $(LIBCDMR) \ +$(LIBSRC_DIR) $(LIBSRC4_DIR) $(DAP2) $(LIBCDMR) \ ${ASSEMBLEDIR} $(V2_TEST) $(NC_TEST_DIR) $(F90_DIR) $(F77_DIR) \ $(NCGEN3) $(NCGEN) $(NCDUMP) $(F77_TEST) ${CXX_DIR} $(CXX4) \ $(NC_TEST4) $(NCDAPTESTDIR) man4 $(EXAMPLES) $(LIBCF) else SUBDIRS = include $(UDUNITS) $(H5_TEST_DIR) $(DISPATCHDIR) $(OCLIB) \ -$(F90_DIR) $(F77_DIR) $(LIBSRC_DIR) $(LIBSRC4_DIR) $(NCDAP3) $(NCDAP4) \ +$(F90_DIR) $(F77_DIR) $(LIBSRC_DIR) $(LIBSRC4_DIR) $(DAP2) \ $(LIBCDMR) ${ASSEMBLEDIR} $(V2_TEST) $(NCGEN3) $(NCGEN) $(NCDUMP) \ $(F77_TEST) ${CXX_DIR} $(CXX4) $(NC_TEST4) $(NC_TEST_DIR) \ $(NCDAPTESTDIR) man4 $(EXAMPLES) $(LIBCF) diff --git a/RELEASE_NOTES b/RELEASE_NOTES index e008fdfba..49ae4fec1 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -3,6 +3,12 @@ Entries are in reverse chronological order (most recent first). VERSION COMMENTS ------- -------- +4.X 2011-04-17 + + Merged libncdap3 and libncdap4 into new libdap2 library. + The suffix dap2 now refers to the dap protocol. This is + in prep for adding dap4 protocol support. + 4.1.2-rc1 2011-03-17 Changes in build system to support building dlls on diff --git a/configure.ac b/configure.ac index 65058a222..1e4132a46 100644 --- a/configure.ac +++ b/configure.ac @@ -1515,8 +1515,7 @@ AC_CONFIG_FILES([Makefile examples/F90/Makefile examples/F77/Makefile oc/Makefile - libncdap3/Makefile - libncdap4/Makefile + libdap2/Makefile libcdmr/Makefile libdispatch/Makefile liblib/Makefile diff --git a/include/Makefile.am b/include/Makefile.am index 4ff586430..d73a7b986 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -12,5 +12,4 @@ endif noinst_HEADERS = nc_logging.h nc_tests.h fbits.h nc3dispatch.h nc.h \ ncio.h nclist.h nc_url.h utf8proc.h ncdispatch.h ncdimscale.h \ -netcdf_f.h err_macros.h ncbytes.h nchashmap.h - +netcdf_f.h err_macros.h ncbytes.h nchashmap.h ceconstraints.h diff --git a/libncdap3/ceconstraints.h b/include/ceconstraints.h similarity index 90% rename from libncdap3/ceconstraints.h rename to include/ceconstraints.h index 74fc3a3f4..8ec2c0da2 100644 --- a/libncdap3/ceconstraints.h +++ b/include/ceconstraints.h @@ -4,8 +4,8 @@ *********************************************************************/ /* $Header$ */ -#ifndef NCCONSTRAINTS_H -#define NCCONSTRAINTS_H 1 +#ifndef CECONSTRAINTS_H +#define CECONSTRAINTS_H #ifndef NC_MAX_VAR_DIMS #define NC_MAX_VAR_DIMS 1024 @@ -27,4 +27,5 @@ CES_SEGMENT=16, CES_CONSTRAINT=17, CES_VALUE=18, CES_SLICE=19 } CEsort; -#endif /*NCCONSTRAINTS_H*/ +#endif /*CECONSTRAINTS_H*/ + diff --git a/libcdmr/Makefile.am b/libcdmr/Makefile.am index 376bf01cb..8c30c61c2 100755 --- a/libcdmr/Makefile.am +++ b/libcdmr/Makefile.am @@ -7,6 +7,7 @@ DISTCLEANFILES = CLEANFILES = +EXTRA_DIST = LDADD= AM_CPPFLAGS = -I$(top_srcdir)/include AM_LDFLAGS = @@ -18,7 +19,10 @@ nccrdump.c \ ncStreamx.c curlwrap.c ncaux.c \ ast_byteio.c ast_curl.c ast_internal.c \ ast_runtime.c ast_util.c ast_debug.c \ -crce.c +crce.c \ +cceparse.c cceconstraints.c + +EXTRA_DIST += ccetab.c ccelex.c HDRS=nccrdispatch.h nccr.h nccrmeta.h nccrproto.h \ crdebug.h crutil.h \ @@ -26,7 +30,8 @@ nccrdump.h \ ncStreamx.h curlwrap.h ncaux.h \ ast.h ast_byteio.h ast_curl.h ast_internal.h \ ast_runtime.h ast_util.h ast_debug.h \ -crce.h nccrnode.h +crce.h nccrnode.h \ +ccetab.h cceconstraints.h cceparselex.h if BUILD_CDMREMOTE @@ -62,7 +67,7 @@ CLEANFILES += t_cdmr ################################################## # Generate the augmented ncstream structures -EXTRA_DIST=ncStream.proto ncStream.h ncStreamc +EXTRA_DIST+=ncStream.proto ncStream.h ncStreamc ASTDIR=./ast/src/compiler @@ -74,10 +79,23 @@ ncStreamx.c ncStreamx.h: ncStreamx.proto ${ASTJAR} ncStreamx.proto: ncStream.proto extends.sed sed -f extends.sed ncStreamx.proto -.PHONEY: jar +.PHONEY: jar bison ${ASTJAR}: cd ${ASTDIR}; make -f Make0 jar +# These rule are used if someone wants to rebuild the grammar files. +# Otherwise never invoked, but records how to do it. +# BTW: note that renaming is essential because otherwise +# autoconf will forcibly delete files of the name *.tab.* + +EXTRA_DIST += cce.y + +bison ccetab.c ccetab.h: cce.y + bison -v -d -t -p cce cce.y + rm -f ccetab.c ccetab.h + mv cce.tab.c ccetab.c + mv cce.tab.h ccetab.h + endif # BUILD_CDMREMOTE diff --git a/libcdmr/ast/src/compiler/Make0 b/libcdmr/ast/src/compiler/Make0 index 56a1af4de..26bcb1541 100644 --- a/libcdmr/ast/src/compiler/Make0 +++ b/libcdmr/ast/src/compiler/Make0 @@ -44,7 +44,7 @@ CLASSES=${SRC:%.java=${BUILDDIR}/${ASTPATH}/%.class}\ .PHONEY: compiler gen jar -all: jar gen c +all: jar gen: for t in ${TESTS} ; do java ${D} -jar ${JAR} ${W} $${t} ; done diff --git a/libcdmr/ast/src/compiler/ProtobufParser.output b/libcdmr/ast/src/compiler/ProtobufParser.output deleted file mode 100644 index 456af14fe..000000000 --- a/libcdmr/ast/src/compiler/ProtobufParser.output +++ /dev/null @@ -1,2409 +0,0 @@ -Terminals unused in grammar - - NEGNAN - NEGINF - - -Grammar - - 0 $accept: root $end - - 1 root: protobuffile - - 2 protobuffile: decllist ENDFILE - - 3 packagedecl: PACKAGE packagename ';' - - 4 importstmt: importprefix protobuffile - - 5 importprefix: IMPORT STRINGCONST ';' - - 6 decllist: /* empty */ - 7 | decllist decl - - 8 decl: message - 9 | extend - 10 | enumtype - 11 | optionstmt - 12 | service - 13 | packagedecl - 14 | importstmt - 15 | ';' - - 16 optionstmt: OPTION option ';' - - 17 option: name '=' constant - 18 | '(' name ')' '=' constant - - 19 message: MESSAGE name messagebody - - 20 extend: EXTEND path '{' fieldlist '}' - - 21 fieldlist: /* empty */ - 22 | fieldlist field - 23 | fieldlist ';' - - 24 enumtype: ENUM name '{' enumlist '}' - - 25 enumlist: /* empty */ - 26 | enumlist optionstmt - 27 | enumlist enumvalue - 28 | enumlist ';' - - 29 enumvalue: name '=' intconst - 30 | name '=' intconst '[' enumoptionlist ']' - - 31 enumoptionlist: option - 32 | enumoptionlist ',' option - - 33 service: SERVICE name '{' servicecaselist '}' - - 34 servicecaselist: /* empty */ - 35 | servicecaselist servicecase - - 36 servicecase: optionstmt - 37 | rpc - 38 | ';' - - 39 rpc: RPC name '(' usertype ')' RETURNS '(' usertype ')' ';' - 40 | RPC name '(' usertype ')' RETURNS '(' usertype ')' '{' optionstmtlist '}' - - 41 optionstmtlist: /* empty */ - 42 | optionstmtlist optionstmt - - 43 messagebody: '{' messageelementlist '}' - - 44 messageelementlist: /* empty */ - 45 | messageelementlist messageelement - - 46 messageelement: field - 47 | enumtype - 48 | message - 49 | extend - 50 | extensions - 51 | optionstmt - 52 | ';' - - 53 field: cardinality type name '=' intconst ';' - 54 | cardinality type name '=' intconst '[' fieldoptionlist ']' ';' - 55 | cardinality type name '=' intconst messagebody - - 56 fieldoptionlist: fieldoption - 57 | fieldoptionlist ',' fieldoption - - 58 fieldoption: option - - 59 extensions: EXTENSIONS extensionlist ';' - - 60 extensionlist: extensionrange - 61 | extensionlist ',' extensionrange - - 62 extensionrange: INTCONST - 63 | INTCONST TO INTCONST - 64 | INTCONST TO MAX - - 65 cardinality: REQUIRED - 66 | OPTIONAL - 67 | REPEATED - - 68 type: DOUBLE - 69 | FLOAT - 70 | INT32 - 71 | INT64 - 72 | UINT32 - 73 | UINT64 - 74 | SINT32 - 75 | SINT64 - 76 | FIXED32 - 77 | FIXED64 - 78 | SFIXED32 - 79 | SFIXED64 - 80 | BOOL - 81 | STRING - 82 | BYTES - 83 | usertype - - 84 usertype: path - - 85 packagename: path - - 86 constant: path - 87 | compound - 88 | intconst - 89 | floatconst - 90 | STRINGCONST - 91 | TRUE - 92 | FALSE - 93 | POSNAN - 94 | POSINF - 95 | '-' POSNAN - 96 | '-' POSINF - - 97 intconst: INTCONST - 98 | '+' INTCONST - 99 | '-' INTCONST - - 100 floatconst: FLOATCONST - 101 | '+' FLOATCONST - 102 | '-' FLOATCONST - - 103 path: relpath - 104 | '.' relpath - - 105 relpath: name - 106 | relpath '.' name - - 107 compound: '{' pairlist '}' - - 108 pairlist: pair - 109 | pairlist pair - - 110 pair: name ':' constant - - 111 name: text - - 112 text: NAME - 113 | IMPORT - 114 | PACKAGE - 115 | OPTION - 116 | MESSAGE - 117 | EXTEND - 118 | EXTENSIONS - 119 | ENUM - 120 | SERVICE - 121 | RPC - 122 | RETURNS - 123 | TO - 124 | MAX - 125 | REQUIRED - 126 | OPTIONAL - 127 | REPEATED - - -Terminals, with rules where they appear - -$end (0) 0 -'(' (40) 18 39 40 -')' (41) 18 39 40 -'+' (43) 98 101 -',' (44) 32 57 61 -'-' (45) 95 96 99 102 -'.' (46) 104 106 -':' (58) 110 -';' (59) 3 5 15 16 23 28 38 39 52 53 54 59 -'=' (61) 17 18 29 30 53 54 55 -'[' (91) 30 54 -']' (93) 30 54 -'{' (123) 20 24 33 40 43 107 -'}' (125) 20 24 33 40 43 107 -error (256) -IMPORT (258) 5 113 -PACKAGE (259) 3 114 -OPTION (260) 16 115 -MESSAGE (261) 19 116 -EXTEND (262) 20 117 -EXTENSIONS (263) 59 118 -ENUM (264) 24 119 -SERVICE (265) 33 120 -RPC (266) 39 40 121 -RETURNS (267) 39 40 122 -TO (268) 63 64 123 -MAX (269) 64 124 -REQUIRED (270) 65 125 -OPTIONAL (271) 66 126 -REPEATED (272) 67 127 -DOUBLE (273) 68 -FLOAT (274) 69 -INT32 (275) 70 -INT64 (276) 71 -UINT32 (277) 72 -UINT64 (278) 73 -SINT32 (279) 74 -SINT64 (280) 75 -FIXED32 (281) 76 -FIXED64 (282) 77 -SFIXED32 (283) 78 -SFIXED64 (284) 79 -BOOL (285) 80 -STRING (286) 81 -BYTES (287) 82 -ENDFILE (288) 2 -INTCONST (289) 62 63 64 97 98 99 -FLOATCONST (290) 100 101 102 -STRINGCONST (291) 5 90 -TRUE (292) 91 -FALSE (293) 92 -POSNAN (294) 93 95 -POSINF (295) 94 96 -NEGNAN (296) -NEGINF (297) -NAME (298) 112 - - -Nonterminals, with rules where they appear - -$accept (57) - on left: 0 -root (58) - on left: 1, on right: 0 -protobuffile (59) - on left: 2, on right: 1 4 -packagedecl (60) - on left: 3, on right: 13 -importstmt (61) - on left: 4, on right: 14 -importprefix (62) - on left: 5, on right: 4 -decllist (63) - on left: 6 7, on right: 2 7 -decl (64) - on left: 8 9 10 11 12 13 14 15, on right: 7 -optionstmt (65) - on left: 16, on right: 11 26 36 42 51 -option (66) - on left: 17 18, on right: 16 31 32 58 -message (67) - on left: 19, on right: 8 48 -extend (68) - on left: 20, on right: 9 49 -fieldlist (69) - on left: 21 22 23, on right: 20 22 23 -enumtype (70) - on left: 24, on right: 10 47 -enumlist (71) - on left: 25 26 27 28, on right: 24 26 27 28 -enumvalue (72) - on left: 29 30, on right: 27 -enumoptionlist (73) - on left: 31 32, on right: 30 32 -service (74) - on left: 33, on right: 12 -servicecaselist (75) - on left: 34 35, on right: 33 35 -servicecase (76) - on left: 36 37 38, on right: 35 -rpc (77) - on left: 39 40, on right: 37 -optionstmtlist (78) - on left: 41 42, on right: 40 42 -messagebody (79) - on left: 43, on right: 19 55 -messageelementlist (80) - on left: 44 45, on right: 43 45 -messageelement (81) - on left: 46 47 48 49 50 51 52, on right: 45 -field (82) - on left: 53 54 55, on right: 22 46 -fieldoptionlist (83) - on left: 56 57, on right: 54 57 -fieldoption (84) - on left: 58, on right: 56 57 -extensions (85) - on left: 59, on right: 50 -extensionlist (86) - on left: 60 61, on right: 59 61 -extensionrange (87) - on left: 62 63 64, on right: 60 61 -cardinality (88) - on left: 65 66 67, on right: 53 54 55 -type (89) - on left: 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83, on right: - 53 54 55 -usertype (90) - on left: 84, on right: 39 40 83 -packagename (91) - on left: 85, on right: 3 -constant (92) - on left: 86 87 88 89 90 91 92 93 94 95 96, on right: 17 18 110 -intconst (93) - on left: 97 98 99, on right: 29 30 53 54 55 88 -floatconst (94) - on left: 100 101 102, on right: 89 -path (95) - on left: 103 104, on right: 20 84 85 86 -relpath (96) - on left: 105 106, on right: 103 104 106 -compound (97) - on left: 107, on right: 87 -pairlist (98) - on left: 108 109, on right: 107 109 -pair (99) - on left: 110, on right: 108 109 -name (100) - on left: 111, on right: 17 18 19 24 29 30 33 39 40 53 54 55 105 - 106 110 -text (101) - on left: 112 113 114 115 116 117 118 119 120 121 122 123 124 125 - 126 127, on right: 111 - - -state 0 - - 0 $accept: . root $end - - $default reduce using rule 6 (decllist) - - root go to state 1 - protobuffile go to state 2 - decllist go to state 3 - - -state 1 - - 0 $accept: root . $end - - $end shift, and go to state 4 - - -state 2 - - 1 root: protobuffile . - - $default reduce using rule 1 (root) - - -state 3 - - 2 protobuffile: decllist . ENDFILE - 7 decllist: decllist . decl - - IMPORT shift, and go to state 5 - PACKAGE shift, and go to state 6 - OPTION shift, and go to state 7 - MESSAGE shift, and go to state 8 - EXTEND shift, and go to state 9 - ENUM shift, and go to state 10 - SERVICE shift, and go to state 11 - ENDFILE shift, and go to state 12 - ';' shift, and go to state 13 - - packagedecl go to state 14 - importstmt go to state 15 - importprefix go to state 16 - decl go to state 17 - optionstmt go to state 18 - message go to state 19 - extend go to state 20 - enumtype go to state 21 - service go to state 22 - - -state 4 - - 0 $accept: root $end . - - $default accept - - -state 5 - - 5 importprefix: IMPORT . STRINGCONST ';' - - STRINGCONST shift, and go to state 23 - - -state 6 - - 3 packagedecl: PACKAGE . packagename ';' - - IMPORT shift, and go to state 24 - PACKAGE shift, and go to state 25 - OPTION shift, and go to state 26 - MESSAGE shift, and go to state 27 - EXTEND shift, and go to state 28 - EXTENSIONS shift, and go to state 29 - ENUM shift, and go to state 30 - SERVICE shift, and go to state 31 - RPC shift, and go to state 32 - RETURNS shift, and go to state 33 - TO shift, and go to state 34 - MAX shift, and go to state 35 - REQUIRED shift, and go to state 36 - OPTIONAL shift, and go to state 37 - REPEATED shift, and go to state 38 - NAME shift, and go to state 39 - '.' shift, and go to state 40 - - packagename go to state 41 - path go to state 42 - relpath go to state 43 - name go to state 44 - text go to state 45 - - -state 7 - - 16 optionstmt: OPTION . option ';' - - IMPORT shift, and go to state 24 - PACKAGE shift, and go to state 25 - OPTION shift, and go to state 26 - MESSAGE shift, and go to state 27 - EXTEND shift, and go to state 28 - EXTENSIONS shift, and go to state 29 - ENUM shift, and go to state 30 - SERVICE shift, and go to state 31 - RPC shift, and go to state 32 - RETURNS shift, and go to state 33 - TO shift, and go to state 34 - MAX shift, and go to state 35 - REQUIRED shift, and go to state 36 - OPTIONAL shift, and go to state 37 - REPEATED shift, and go to state 38 - NAME shift, and go to state 39 - '(' shift, and go to state 46 - - option go to state 47 - name go to state 48 - text go to state 45 - - -state 8 - - 19 message: MESSAGE . name messagebody - - IMPORT shift, and go to state 24 - PACKAGE shift, and go to state 25 - OPTION shift, and go to state 26 - MESSAGE shift, and go to state 27 - EXTEND shift, and go to state 28 - EXTENSIONS shift, and go to state 29 - ENUM shift, and go to state 30 - SERVICE shift, and go to state 31 - RPC shift, and go to state 32 - RETURNS shift, and go to state 33 - TO shift, and go to state 34 - MAX shift, and go to state 35 - REQUIRED shift, and go to state 36 - OPTIONAL shift, and go to state 37 - REPEATED shift, and go to state 38 - NAME shift, and go to state 39 - - name go to state 49 - text go to state 45 - - -state 9 - - 20 extend: EXTEND . path '{' fieldlist '}' - - IMPORT shift, and go to state 24 - PACKAGE shift, and go to state 25 - OPTION shift, and go to state 26 - MESSAGE shift, and go to state 27 - EXTEND shift, and go to state 28 - EXTENSIONS shift, and go to state 29 - ENUM shift, and go to state 30 - SERVICE shift, and go to state 31 - RPC shift, and go to state 32 - RETURNS shift, and go to state 33 - TO shift, and go to state 34 - MAX shift, and go to state 35 - REQUIRED shift, and go to state 36 - OPTIONAL shift, and go to state 37 - REPEATED shift, and go to state 38 - NAME shift, and go to state 39 - '.' shift, and go to state 40 - - path go to state 50 - relpath go to state 43 - name go to state 44 - text go to state 45 - - -state 10 - - 24 enumtype: ENUM . name '{' enumlist '}' - - IMPORT shift, and go to state 24 - PACKAGE shift, and go to state 25 - OPTION shift, and go to state 26 - MESSAGE shift, and go to state 27 - EXTEND shift, and go to state 28 - EXTENSIONS shift, and go to state 29 - ENUM shift, and go to state 30 - SERVICE shift, and go to state 31 - RPC shift, and go to state 32 - RETURNS shift, and go to state 33 - TO shift, and go to state 34 - MAX shift, and go to state 35 - REQUIRED shift, and go to state 36 - OPTIONAL shift, and go to state 37 - REPEATED shift, and go to state 38 - NAME shift, and go to state 39 - - name go to state 51 - text go to state 45 - - -state 11 - - 33 service: SERVICE . name '{' servicecaselist '}' - - IMPORT shift, and go to state 24 - PACKAGE shift, and go to state 25 - OPTION shift, and go to state 26 - MESSAGE shift, and go to state 27 - EXTEND shift, and go to state 28 - EXTENSIONS shift, and go to state 29 - ENUM shift, and go to state 30 - SERVICE shift, and go to state 31 - RPC shift, and go to state 32 - RETURNS shift, and go to state 33 - TO shift, and go to state 34 - MAX shift, and go to state 35 - REQUIRED shift, and go to state 36 - OPTIONAL shift, and go to state 37 - REPEATED shift, and go to state 38 - NAME shift, and go to state 39 - - name go to state 52 - text go to state 45 - - -state 12 - - 2 protobuffile: decllist ENDFILE . - - $default reduce using rule 2 (protobuffile) - - -state 13 - - 15 decl: ';' . - - $default reduce using rule 15 (decl) - - -state 14 - - 13 decl: packagedecl . - - $default reduce using rule 13 (decl) - - -state 15 - - 14 decl: importstmt . - - $default reduce using rule 14 (decl) - - -state 16 - - 4 importstmt: importprefix . protobuffile - - $default reduce using rule 6 (decllist) - - protobuffile go to state 53 - decllist go to state 3 - - -state 17 - - 7 decllist: decllist decl . - - $default reduce using rule 7 (decllist) - - -state 18 - - 11 decl: optionstmt . - - $default reduce using rule 11 (decl) - - -state 19 - - 8 decl: message . - - $default reduce using rule 8 (decl) - - -state 20 - - 9 decl: extend . - - $default reduce using rule 9 (decl) - - -state 21 - - 10 decl: enumtype . - - $default reduce using rule 10 (decl) - - -state 22 - - 12 decl: service . - - $default reduce using rule 12 (decl) - - -state 23 - - 5 importprefix: IMPORT STRINGCONST . ';' - - ';' shift, and go to state 54 - - -state 24 - - 113 text: IMPORT . - - $default reduce using rule 113 (text) - - -state 25 - - 114 text: PACKAGE . - - $default reduce using rule 114 (text) - - -state 26 - - 115 text: OPTION . - - $default reduce using rule 115 (text) - - -state 27 - - 116 text: MESSAGE . - - $default reduce using rule 116 (text) - - -state 28 - - 117 text: EXTEND . - - $default reduce using rule 117 (text) - - -state 29 - - 118 text: EXTENSIONS . - - $default reduce using rule 118 (text) - - -state 30 - - 119 text: ENUM . - - $default reduce using rule 119 (text) - - -state 31 - - 120 text: SERVICE . - - $default reduce using rule 120 (text) - - -state 32 - - 121 text: RPC . - - $default reduce using rule 121 (text) - - -state 33 - - 122 text: RETURNS . - - $default reduce using rule 122 (text) - - -state 34 - - 123 text: TO . - - $default reduce using rule 123 (text) - - -state 35 - - 124 text: MAX . - - $default reduce using rule 124 (text) - - -state 36 - - 125 text: REQUIRED . - - $default reduce using rule 125 (text) - - -state 37 - - 126 text: OPTIONAL . - - $default reduce using rule 126 (text) - - -state 38 - - 127 text: REPEATED . - - $default reduce using rule 127 (text) - - -state 39 - - 112 text: NAME . - - $default reduce using rule 112 (text) - - -state 40 - - 104 path: '.' . relpath - - IMPORT shift, and go to state 24 - PACKAGE shift, and go to state 25 - OPTION shift, and go to state 26 - MESSAGE shift, and go to state 27 - EXTEND shift, and go to state 28 - EXTENSIONS shift, and go to state 29 - ENUM shift, and go to state 30 - SERVICE shift, and go to state 31 - RPC shift, and go to state 32 - RETURNS shift, and go to state 33 - TO shift, and go to state 34 - MAX shift, and go to state 35 - REQUIRED shift, and go to state 36 - OPTIONAL shift, and go to state 37 - REPEATED shift, and go to state 38 - NAME shift, and go to state 39 - - relpath go to state 55 - name go to state 44 - text go to state 45 - - -state 41 - - 3 packagedecl: PACKAGE packagename . ';' - - ';' shift, and go to state 56 - - -state 42 - - 85 packagename: path . - - $default reduce using rule 85 (packagename) - - -state 43 - - 103 path: relpath . - 106 relpath: relpath . '.' name - - '.' shift, and go to state 57 - - $default reduce using rule 103 (path) - - -state 44 - - 105 relpath: name . - - $default reduce using rule 105 (relpath) - - -state 45 - - 111 name: text . - - $default reduce using rule 111 (name) - - -state 46 - - 18 option: '(' . name ')' '=' constant - - IMPORT shift, and go to state 24 - PACKAGE shift, and go to state 25 - OPTION shift, and go to state 26 - MESSAGE shift, and go to state 27 - EXTEND shift, and go to state 28 - EXTENSIONS shift, and go to state 29 - ENUM shift, and go to state 30 - SERVICE shift, and go to state 31 - RPC shift, and go to state 32 - RETURNS shift, and go to state 33 - TO shift, and go to state 34 - MAX shift, and go to state 35 - REQUIRED shift, and go to state 36 - OPTIONAL shift, and go to state 37 - REPEATED shift, and go to state 38 - NAME shift, and go to state 39 - - name go to state 58 - text go to state 45 - - -state 47 - - 16 optionstmt: OPTION option . ';' - - ';' shift, and go to state 59 - - -state 48 - - 17 option: name . '=' constant - - '=' shift, and go to state 60 - - -state 49 - - 19 message: MESSAGE name . messagebody - - '{' shift, and go to state 61 - - messagebody go to state 62 - - -state 50 - - 20 extend: EXTEND path . '{' fieldlist '}' - - '{' shift, and go to state 63 - - -state 51 - - 24 enumtype: ENUM name . '{' enumlist '}' - - '{' shift, and go to state 64 - - -state 52 - - 33 service: SERVICE name . '{' servicecaselist '}' - - '{' shift, and go to state 65 - - -state 53 - - 4 importstmt: importprefix protobuffile . - - $default reduce using rule 4 (importstmt) - - -state 54 - - 5 importprefix: IMPORT STRINGCONST ';' . - - $default reduce using rule 5 (importprefix) - - -state 55 - - 104 path: '.' relpath . - 106 relpath: relpath . '.' name - - '.' shift, and go to state 57 - - $default reduce using rule 104 (path) - - -state 56 - - 3 packagedecl: PACKAGE packagename ';' . - - $default reduce using rule 3 (packagedecl) - - -state 57 - - 106 relpath: relpath '.' . name - - IMPORT shift, and go to state 24 - PACKAGE shift, and go to state 25 - OPTION shift, and go to state 26 - MESSAGE shift, and go to state 27 - EXTEND shift, and go to state 28 - EXTENSIONS shift, and go to state 29 - ENUM shift, and go to state 30 - SERVICE shift, and go to state 31 - RPC shift, and go to state 32 - RETURNS shift, and go to state 33 - TO shift, and go to state 34 - MAX shift, and go to state 35 - REQUIRED shift, and go to state 36 - OPTIONAL shift, and go to state 37 - REPEATED shift, and go to state 38 - NAME shift, and go to state 39 - - name go to state 66 - text go to state 45 - - -state 58 - - 18 option: '(' name . ')' '=' constant - - ')' shift, and go to state 67 - - -state 59 - - 16 optionstmt: OPTION option ';' . - - $default reduce using rule 16 (optionstmt) - - -state 60 - - 17 option: name '=' . constant - - IMPORT shift, and go to state 24 - PACKAGE shift, and go to state 25 - OPTION shift, and go to state 26 - MESSAGE shift, and go to state 27 - EXTEND shift, and go to state 28 - EXTENSIONS shift, and go to state 29 - ENUM shift, and go to state 30 - SERVICE shift, and go to state 31 - RPC shift, and go to state 32 - RETURNS shift, and go to state 33 - TO shift, and go to state 34 - MAX shift, and go to state 35 - REQUIRED shift, and go to state 36 - OPTIONAL shift, and go to state 37 - REPEATED shift, and go to state 38 - INTCONST shift, and go to state 68 - FLOATCONST shift, and go to state 69 - STRINGCONST shift, and go to state 70 - TRUE shift, and go to state 71 - FALSE shift, and go to state 72 - POSNAN shift, and go to state 73 - POSINF shift, and go to state 74 - NAME shift, and go to state 39 - '{' shift, and go to state 75 - '-' shift, and go to state 76 - '+' shift, and go to state 77 - '.' shift, and go to state 40 - - constant go to state 78 - intconst go to state 79 - floatconst go to state 80 - path go to state 81 - relpath go to state 43 - compound go to state 82 - name go to state 44 - text go to state 45 - - -state 61 - - 43 messagebody: '{' . messageelementlist '}' - - $default reduce using rule 44 (messageelementlist) - - messageelementlist go to state 83 - - -state 62 - - 19 message: MESSAGE name messagebody . - - $default reduce using rule 19 (message) - - -state 63 - - 20 extend: EXTEND path '{' . fieldlist '}' - - $default reduce using rule 21 (fieldlist) - - fieldlist go to state 84 - - -state 64 - - 24 enumtype: ENUM name '{' . enumlist '}' - - $default reduce using rule 25 (enumlist) - - enumlist go to state 85 - - -state 65 - - 33 service: SERVICE name '{' . servicecaselist '}' - - $default reduce using rule 34 (servicecaselist) - - servicecaselist go to state 86 - - -state 66 - - 106 relpath: relpath '.' name . - - $default reduce using rule 106 (relpath) - - -state 67 - - 18 option: '(' name ')' . '=' constant - - '=' shift, and go to state 87 - - -state 68 - - 97 intconst: INTCONST . - - $default reduce using rule 97 (intconst) - - -state 69 - - 100 floatconst: FLOATCONST . - - $default reduce using rule 100 (floatconst) - - -state 70 - - 90 constant: STRINGCONST . - - $default reduce using rule 90 (constant) - - -state 71 - - 91 constant: TRUE . - - $default reduce using rule 91 (constant) - - -state 72 - - 92 constant: FALSE . - - $default reduce using rule 92 (constant) - - -state 73 - - 93 constant: POSNAN . - - $default reduce using rule 93 (constant) - - -state 74 - - 94 constant: POSINF . - - $default reduce using rule 94 (constant) - - -state 75 - - 107 compound: '{' . pairlist '}' - - IMPORT shift, and go to state 24 - PACKAGE shift, and go to state 25 - OPTION shift, and go to state 26 - MESSAGE shift, and go to state 27 - EXTEND shift, and go to state 28 - EXTENSIONS shift, and go to state 29 - ENUM shift, and go to state 30 - SERVICE shift, and go to state 31 - RPC shift, and go to state 32 - RETURNS shift, and go to state 33 - TO shift, and go to state 34 - MAX shift, and go to state 35 - REQUIRED shift, and go to state 36 - OPTIONAL shift, and go to state 37 - REPEATED shift, and go to state 38 - NAME shift, and go to state 39 - - pairlist go to state 88 - pair go to state 89 - name go to state 90 - text go to state 45 - - -state 76 - - 95 constant: '-' . POSNAN - 96 | '-' . POSINF - 99 intconst: '-' . INTCONST - 102 floatconst: '-' . FLOATCONST - - INTCONST shift, and go to state 91 - FLOATCONST shift, and go to state 92 - POSNAN shift, and go to state 93 - POSINF shift, and go to state 94 - - -state 77 - - 98 intconst: '+' . INTCONST - 101 floatconst: '+' . FLOATCONST - - INTCONST shift, and go to state 95 - FLOATCONST shift, and go to state 96 - - -state 78 - - 17 option: name '=' constant . - - $default reduce using rule 17 (option) - - -state 79 - - 88 constant: intconst . - - $default reduce using rule 88 (constant) - - -state 80 - - 89 constant: floatconst . - - $default reduce using rule 89 (constant) - - -state 81 - - 86 constant: path . - - $default reduce using rule 86 (constant) - - -state 82 - - 87 constant: compound . - - $default reduce using rule 87 (constant) - - -state 83 - - 43 messagebody: '{' messageelementlist . '}' - 45 messageelementlist: messageelementlist . messageelement - - OPTION shift, and go to state 7 - MESSAGE shift, and go to state 8 - EXTEND shift, and go to state 9 - EXTENSIONS shift, and go to state 97 - ENUM shift, and go to state 10 - REQUIRED shift, and go to state 98 - OPTIONAL shift, and go to state 99 - REPEATED shift, and go to state 100 - ';' shift, and go to state 101 - '}' shift, and go to state 102 - - optionstmt go to state 103 - message go to state 104 - extend go to state 105 - enumtype go to state 106 - messageelement go to state 107 - field go to state 108 - extensions go to state 109 - cardinality go to state 110 - - -state 84 - - 20 extend: EXTEND path '{' fieldlist . '}' - 22 fieldlist: fieldlist . field - 23 | fieldlist . ';' - - REQUIRED shift, and go to state 98 - OPTIONAL shift, and go to state 99 - REPEATED shift, and go to state 100 - ';' shift, and go to state 111 - '}' shift, and go to state 112 - - field go to state 113 - cardinality go to state 110 - - -state 85 - - 24 enumtype: ENUM name '{' enumlist . '}' - 26 enumlist: enumlist . optionstmt - 27 | enumlist . enumvalue - 28 | enumlist . ';' - - IMPORT shift, and go to state 24 - PACKAGE shift, and go to state 25 - OPTION shift, and go to state 114 - MESSAGE shift, and go to state 27 - EXTEND shift, and go to state 28 - EXTENSIONS shift, and go to state 29 - ENUM shift, and go to state 30 - SERVICE shift, and go to state 31 - RPC shift, and go to state 32 - RETURNS shift, and go to state 33 - TO shift, and go to state 34 - MAX shift, and go to state 35 - REQUIRED shift, and go to state 36 - OPTIONAL shift, and go to state 37 - REPEATED shift, and go to state 38 - NAME shift, and go to state 39 - ';' shift, and go to state 115 - '}' shift, and go to state 116 - - optionstmt go to state 117 - enumvalue go to state 118 - name go to state 119 - text go to state 45 - - -state 86 - - 33 service: SERVICE name '{' servicecaselist . '}' - 35 servicecaselist: servicecaselist . servicecase - - OPTION shift, and go to state 7 - RPC shift, and go to state 120 - ';' shift, and go to state 121 - '}' shift, and go to state 122 - - optionstmt go to state 123 - servicecase go to state 124 - rpc go to state 125 - - -state 87 - - 18 option: '(' name ')' '=' . constant - - IMPORT shift, and go to state 24 - PACKAGE shift, and go to state 25 - OPTION shift, and go to state 26 - MESSAGE shift, and go to state 27 - EXTEND shift, and go to state 28 - EXTENSIONS shift, and go to state 29 - ENUM shift, and go to state 30 - SERVICE shift, and go to state 31 - RPC shift, and go to state 32 - RETURNS shift, and go to state 33 - TO shift, and go to state 34 - MAX shift, and go to state 35 - REQUIRED shift, and go to state 36 - OPTIONAL shift, and go to state 37 - REPEATED shift, and go to state 38 - INTCONST shift, and go to state 68 - FLOATCONST shift, and go to state 69 - STRINGCONST shift, and go to state 70 - TRUE shift, and go to state 71 - FALSE shift, and go to state 72 - POSNAN shift, and go to state 73 - POSINF shift, and go to state 74 - NAME shift, and go to state 39 - '{' shift, and go to state 75 - '-' shift, and go to state 76 - '+' shift, and go to state 77 - '.' shift, and go to state 40 - - constant go to state 126 - intconst go to state 79 - floatconst go to state 80 - path go to state 81 - relpath go to state 43 - compound go to state 82 - name go to state 44 - text go to state 45 - - -state 88 - - 107 compound: '{' pairlist . '}' - 109 pairlist: pairlist . pair - - IMPORT shift, and go to state 24 - PACKAGE shift, and go to state 25 - OPTION shift, and go to state 26 - MESSAGE shift, and go to state 27 - EXTEND shift, and go to state 28 - EXTENSIONS shift, and go to state 29 - ENUM shift, and go to state 30 - SERVICE shift, and go to state 31 - RPC shift, and go to state 32 - RETURNS shift, and go to state 33 - TO shift, and go to state 34 - MAX shift, and go to state 35 - REQUIRED shift, and go to state 36 - OPTIONAL shift, and go to state 37 - REPEATED shift, and go to state 38 - NAME shift, and go to state 39 - '}' shift, and go to state 127 - - pair go to state 128 - name go to state 90 - text go to state 45 - - -state 89 - - 108 pairlist: pair . - - $default reduce using rule 108 (pairlist) - - -state 90 - - 110 pair: name . ':' constant - - ':' shift, and go to state 129 - - -state 91 - - 99 intconst: '-' INTCONST . - - $default reduce using rule 99 (intconst) - - -state 92 - - 102 floatconst: '-' FLOATCONST . - - $default reduce using rule 102 (floatconst) - - -state 93 - - 95 constant: '-' POSNAN . - - $default reduce using rule 95 (constant) - - -state 94 - - 96 constant: '-' POSINF . - - $default reduce using rule 96 (constant) - - -state 95 - - 98 intconst: '+' INTCONST . - - $default reduce using rule 98 (intconst) - - -state 96 - - 101 floatconst: '+' FLOATCONST . - - $default reduce using rule 101 (floatconst) - - -state 97 - - 59 extensions: EXTENSIONS . extensionlist ';' - - INTCONST shift, and go to state 130 - - extensionlist go to state 131 - extensionrange go to state 132 - - -state 98 - - 65 cardinality: REQUIRED . - - $default reduce using rule 65 (cardinality) - - -state 99 - - 66 cardinality: OPTIONAL . - - $default reduce using rule 66 (cardinality) - - -state 100 - - 67 cardinality: REPEATED . - - $default reduce using rule 67 (cardinality) - - -state 101 - - 52 messageelement: ';' . - - $default reduce using rule 52 (messageelement) - - -state 102 - - 43 messagebody: '{' messageelementlist '}' . - - $default reduce using rule 43 (messagebody) - - -state 103 - - 51 messageelement: optionstmt . - - $default reduce using rule 51 (messageelement) - - -state 104 - - 48 messageelement: message . - - $default reduce using rule 48 (messageelement) - - -state 105 - - 49 messageelement: extend . - - $default reduce using rule 49 (messageelement) - - -state 106 - - 47 messageelement: enumtype . - - $default reduce using rule 47 (messageelement) - - -state 107 - - 45 messageelementlist: messageelementlist messageelement . - - $default reduce using rule 45 (messageelementlist) - - -state 108 - - 46 messageelement: field . - - $default reduce using rule 46 (messageelement) - - -state 109 - - 50 messageelement: extensions . - - $default reduce using rule 50 (messageelement) - - -state 110 - - 53 field: cardinality . type name '=' intconst ';' - 54 | cardinality . type name '=' intconst '[' fieldoptionlist ']' ';' - 55 | cardinality . type name '=' intconst messagebody - - IMPORT shift, and go to state 24 - PACKAGE shift, and go to state 25 - OPTION shift, and go to state 26 - MESSAGE shift, and go to state 27 - EXTEND shift, and go to state 28 - EXTENSIONS shift, and go to state 29 - ENUM shift, and go to state 30 - SERVICE shift, and go to state 31 - RPC shift, and go to state 32 - RETURNS shift, and go to state 33 - TO shift, and go to state 34 - MAX shift, and go to state 35 - REQUIRED shift, and go to state 36 - OPTIONAL shift, and go to state 37 - REPEATED shift, and go to state 38 - DOUBLE shift, and go to state 133 - FLOAT shift, and go to state 134 - INT32 shift, and go to state 135 - INT64 shift, and go to state 136 - UINT32 shift, and go to state 137 - UINT64 shift, and go to state 138 - SINT32 shift, and go to state 139 - SINT64 shift, and go to state 140 - FIXED32 shift, and go to state 141 - FIXED64 shift, and go to state 142 - SFIXED32 shift, and go to state 143 - SFIXED64 shift, and go to state 144 - BOOL shift, and go to state 145 - STRING shift, and go to state 146 - BYTES shift, and go to state 147 - NAME shift, and go to state 39 - '.' shift, and go to state 40 - - type go to state 148 - usertype go to state 149 - path go to state 150 - relpath go to state 43 - name go to state 44 - text go to state 45 - - -state 111 - - 23 fieldlist: fieldlist ';' . - - $default reduce using rule 23 (fieldlist) - - -state 112 - - 20 extend: EXTEND path '{' fieldlist '}' . - - $default reduce using rule 20 (extend) - - -state 113 - - 22 fieldlist: fieldlist field . - - $default reduce using rule 22 (fieldlist) - - -state 114 - - 16 optionstmt: OPTION . option ';' - 115 text: OPTION . - - IMPORT shift, and go to state 24 - PACKAGE shift, and go to state 25 - OPTION shift, and go to state 26 - MESSAGE shift, and go to state 27 - EXTEND shift, and go to state 28 - EXTENSIONS shift, and go to state 29 - ENUM shift, and go to state 30 - SERVICE shift, and go to state 31 - RPC shift, and go to state 32 - RETURNS shift, and go to state 33 - TO shift, and go to state 34 - MAX shift, and go to state 35 - REQUIRED shift, and go to state 36 - OPTIONAL shift, and go to state 37 - REPEATED shift, and go to state 38 - NAME shift, and go to state 39 - '(' shift, and go to state 46 - - $default reduce using rule 115 (text) - - option go to state 47 - name go to state 48 - text go to state 45 - - -state 115 - - 28 enumlist: enumlist ';' . - - $default reduce using rule 28 (enumlist) - - -state 116 - - 24 enumtype: ENUM name '{' enumlist '}' . - - $default reduce using rule 24 (enumtype) - - -state 117 - - 26 enumlist: enumlist optionstmt . - - $default reduce using rule 26 (enumlist) - - -state 118 - - 27 enumlist: enumlist enumvalue . - - $default reduce using rule 27 (enumlist) - - -state 119 - - 29 enumvalue: name . '=' intconst - 30 | name . '=' intconst '[' enumoptionlist ']' - - '=' shift, and go to state 151 - - -state 120 - - 39 rpc: RPC . name '(' usertype ')' RETURNS '(' usertype ')' ';' - 40 | RPC . name '(' usertype ')' RETURNS '(' usertype ')' '{' optionstmtlist '}' - - IMPORT shift, and go to state 24 - PACKAGE shift, and go to state 25 - OPTION shift, and go to state 26 - MESSAGE shift, and go to state 27 - EXTEND shift, and go to state 28 - EXTENSIONS shift, and go to state 29 - ENUM shift, and go to state 30 - SERVICE shift, and go to state 31 - RPC shift, and go to state 32 - RETURNS shift, and go to state 33 - TO shift, and go to state 34 - MAX shift, and go to state 35 - REQUIRED shift, and go to state 36 - OPTIONAL shift, and go to state 37 - REPEATED shift, and go to state 38 - NAME shift, and go to state 39 - - name go to state 152 - text go to state 45 - - -state 121 - - 38 servicecase: ';' . - - $default reduce using rule 38 (servicecase) - - -state 122 - - 33 service: SERVICE name '{' servicecaselist '}' . - - $default reduce using rule 33 (service) - - -state 123 - - 36 servicecase: optionstmt . - - $default reduce using rule 36 (servicecase) - - -state 124 - - 35 servicecaselist: servicecaselist servicecase . - - $default reduce using rule 35 (servicecaselist) - - -state 125 - - 37 servicecase: rpc . - - $default reduce using rule 37 (servicecase) - - -state 126 - - 18 option: '(' name ')' '=' constant . - - $default reduce using rule 18 (option) - - -state 127 - - 107 compound: '{' pairlist '}' . - - $default reduce using rule 107 (compound) - - -state 128 - - 109 pairlist: pairlist pair . - - $default reduce using rule 109 (pairlist) - - -state 129 - - 110 pair: name ':' . constant - - IMPORT shift, and go to state 24 - PACKAGE shift, and go to state 25 - OPTION shift, and go to state 26 - MESSAGE shift, and go to state 27 - EXTEND shift, and go to state 28 - EXTENSIONS shift, and go to state 29 - ENUM shift, and go to state 30 - SERVICE shift, and go to state 31 - RPC shift, and go to state 32 - RETURNS shift, and go to state 33 - TO shift, and go to state 34 - MAX shift, and go to state 35 - REQUIRED shift, and go to state 36 - OPTIONAL shift, and go to state 37 - REPEATED shift, and go to state 38 - INTCONST shift, and go to state 68 - FLOATCONST shift, and go to state 69 - STRINGCONST shift, and go to state 70 - TRUE shift, and go to state 71 - FALSE shift, and go to state 72 - POSNAN shift, and go to state 73 - POSINF shift, and go to state 74 - NAME shift, and go to state 39 - '{' shift, and go to state 75 - '-' shift, and go to state 76 - '+' shift, and go to state 77 - '.' shift, and go to state 40 - - constant go to state 153 - intconst go to state 79 - floatconst go to state 80 - path go to state 81 - relpath go to state 43 - compound go to state 82 - name go to state 44 - text go to state 45 - - -state 130 - - 62 extensionrange: INTCONST . - 63 | INTCONST . TO INTCONST - 64 | INTCONST . TO MAX - - TO shift, and go to state 154 - - $default reduce using rule 62 (extensionrange) - - -state 131 - - 59 extensions: EXTENSIONS extensionlist . ';' - 61 extensionlist: extensionlist . ',' extensionrange - - ';' shift, and go to state 155 - ',' shift, and go to state 156 - - -state 132 - - 60 extensionlist: extensionrange . - - $default reduce using rule 60 (extensionlist) - - -state 133 - - 68 type: DOUBLE . - - $default reduce using rule 68 (type) - - -state 134 - - 69 type: FLOAT . - - $default reduce using rule 69 (type) - - -state 135 - - 70 type: INT32 . - - $default reduce using rule 70 (type) - - -state 136 - - 71 type: INT64 . - - $default reduce using rule 71 (type) - - -state 137 - - 72 type: UINT32 . - - $default reduce using rule 72 (type) - - -state 138 - - 73 type: UINT64 . - - $default reduce using rule 73 (type) - - -state 139 - - 74 type: SINT32 . - - $default reduce using rule 74 (type) - - -state 140 - - 75 type: SINT64 . - - $default reduce using rule 75 (type) - - -state 141 - - 76 type: FIXED32 . - - $default reduce using rule 76 (type) - - -state 142 - - 77 type: FIXED64 . - - $default reduce using rule 77 (type) - - -state 143 - - 78 type: SFIXED32 . - - $default reduce using rule 78 (type) - - -state 144 - - 79 type: SFIXED64 . - - $default reduce using rule 79 (type) - - -state 145 - - 80 type: BOOL . - - $default reduce using rule 80 (type) - - -state 146 - - 81 type: STRING . - - $default reduce using rule 81 (type) - - -state 147 - - 82 type: BYTES . - - $default reduce using rule 82 (type) - - -state 148 - - 53 field: cardinality type . name '=' intconst ';' - 54 | cardinality type . name '=' intconst '[' fieldoptionlist ']' ';' - 55 | cardinality type . name '=' intconst messagebody - - IMPORT shift, and go to state 24 - PACKAGE shift, and go to state 25 - OPTION shift, and go to state 26 - MESSAGE shift, and go to state 27 - EXTEND shift, and go to state 28 - EXTENSIONS shift, and go to state 29 - ENUM shift, and go to state 30 - SERVICE shift, and go to state 31 - RPC shift, and go to state 32 - RETURNS shift, and go to state 33 - TO shift, and go to state 34 - MAX shift, and go to state 35 - REQUIRED shift, and go to state 36 - OPTIONAL shift, and go to state 37 - REPEATED shift, and go to state 38 - NAME shift, and go to state 39 - - name go to state 157 - text go to state 45 - - -state 149 - - 83 type: usertype . - - $default reduce using rule 83 (type) - - -state 150 - - 84 usertype: path . - - $default reduce using rule 84 (usertype) - - -state 151 - - 29 enumvalue: name '=' . intconst - 30 | name '=' . intconst '[' enumoptionlist ']' - - INTCONST shift, and go to state 68 - '-' shift, and go to state 158 - '+' shift, and go to state 159 - - intconst go to state 160 - - -state 152 - - 39 rpc: RPC name . '(' usertype ')' RETURNS '(' usertype ')' ';' - 40 | RPC name . '(' usertype ')' RETURNS '(' usertype ')' '{' optionstmtlist '}' - - '(' shift, and go to state 161 - - -state 153 - - 110 pair: name ':' constant . - - $default reduce using rule 110 (pair) - - -state 154 - - 63 extensionrange: INTCONST TO . INTCONST - 64 | INTCONST TO . MAX - - MAX shift, and go to state 162 - INTCONST shift, and go to state 163 - - -state 155 - - 59 extensions: EXTENSIONS extensionlist ';' . - - $default reduce using rule 59 (extensions) - - -state 156 - - 61 extensionlist: extensionlist ',' . extensionrange - - INTCONST shift, and go to state 130 - - extensionrange go to state 164 - - -state 157 - - 53 field: cardinality type name . '=' intconst ';' - 54 | cardinality type name . '=' intconst '[' fieldoptionlist ']' ';' - 55 | cardinality type name . '=' intconst messagebody - - '=' shift, and go to state 165 - - -state 158 - - 99 intconst: '-' . INTCONST - - INTCONST shift, and go to state 91 - - -state 159 - - 98 intconst: '+' . INTCONST - - INTCONST shift, and go to state 95 - - -state 160 - - 29 enumvalue: name '=' intconst . - 30 | name '=' intconst . '[' enumoptionlist ']' - - '[' shift, and go to state 166 - - $default reduce using rule 29 (enumvalue) - - -state 161 - - 39 rpc: RPC name '(' . usertype ')' RETURNS '(' usertype ')' ';' - 40 | RPC name '(' . usertype ')' RETURNS '(' usertype ')' '{' optionstmtlist '}' - - IMPORT shift, and go to state 24 - PACKAGE shift, and go to state 25 - OPTION shift, and go to state 26 - MESSAGE shift, and go to state 27 - EXTEND shift, and go to state 28 - EXTENSIONS shift, and go to state 29 - ENUM shift, and go to state 30 - SERVICE shift, and go to state 31 - RPC shift, and go to state 32 - RETURNS shift, and go to state 33 - TO shift, and go to state 34 - MAX shift, and go to state 35 - REQUIRED shift, and go to state 36 - OPTIONAL shift, and go to state 37 - REPEATED shift, and go to state 38 - NAME shift, and go to state 39 - '.' shift, and go to state 40 - - usertype go to state 167 - path go to state 150 - relpath go to state 43 - name go to state 44 - text go to state 45 - - -state 162 - - 64 extensionrange: INTCONST TO MAX . - - $default reduce using rule 64 (extensionrange) - - -state 163 - - 63 extensionrange: INTCONST TO INTCONST . - - $default reduce using rule 63 (extensionrange) - - -state 164 - - 61 extensionlist: extensionlist ',' extensionrange . - - $default reduce using rule 61 (extensionlist) - - -state 165 - - 53 field: cardinality type name '=' . intconst ';' - 54 | cardinality type name '=' . intconst '[' fieldoptionlist ']' ';' - 55 | cardinality type name '=' . intconst messagebody - - INTCONST shift, and go to state 68 - '-' shift, and go to state 158 - '+' shift, and go to state 159 - - intconst go to state 168 - - -state 166 - - 30 enumvalue: name '=' intconst '[' . enumoptionlist ']' - - IMPORT shift, and go to state 24 - PACKAGE shift, and go to state 25 - OPTION shift, and go to state 26 - MESSAGE shift, and go to state 27 - EXTEND shift, and go to state 28 - EXTENSIONS shift, and go to state 29 - ENUM shift, and go to state 30 - SERVICE shift, and go to state 31 - RPC shift, and go to state 32 - RETURNS shift, and go to state 33 - TO shift, and go to state 34 - MAX shift, and go to state 35 - REQUIRED shift, and go to state 36 - OPTIONAL shift, and go to state 37 - REPEATED shift, and go to state 38 - NAME shift, and go to state 39 - '(' shift, and go to state 46 - - option go to state 169 - enumoptionlist go to state 170 - name go to state 48 - text go to state 45 - - -state 167 - - 39 rpc: RPC name '(' usertype . ')' RETURNS '(' usertype ')' ';' - 40 | RPC name '(' usertype . ')' RETURNS '(' usertype ')' '{' optionstmtlist '}' - - ')' shift, and go to state 171 - - -state 168 - - 53 field: cardinality type name '=' intconst . ';' - 54 | cardinality type name '=' intconst . '[' fieldoptionlist ']' ';' - 55 | cardinality type name '=' intconst . messagebody - - ';' shift, and go to state 172 - '{' shift, and go to state 61 - '[' shift, and go to state 173 - - messagebody go to state 174 - - -state 169 - - 31 enumoptionlist: option . - - $default reduce using rule 31 (enumoptionlist) - - -state 170 - - 30 enumvalue: name '=' intconst '[' enumoptionlist . ']' - 32 enumoptionlist: enumoptionlist . ',' option - - ']' shift, and go to state 175 - ',' shift, and go to state 176 - - -state 171 - - 39 rpc: RPC name '(' usertype ')' . RETURNS '(' usertype ')' ';' - 40 | RPC name '(' usertype ')' . RETURNS '(' usertype ')' '{' optionstmtlist '}' - - RETURNS shift, and go to state 177 - - -state 172 - - 53 field: cardinality type name '=' intconst ';' . - - $default reduce using rule 53 (field) - - -state 173 - - 54 field: cardinality type name '=' intconst '[' . fieldoptionlist ']' ';' - - IMPORT shift, and go to state 24 - PACKAGE shift, and go to state 25 - OPTION shift, and go to state 26 - MESSAGE shift, and go to state 27 - EXTEND shift, and go to state 28 - EXTENSIONS shift, and go to state 29 - ENUM shift, and go to state 30 - SERVICE shift, and go to state 31 - RPC shift, and go to state 32 - RETURNS shift, and go to state 33 - TO shift, and go to state 34 - MAX shift, and go to state 35 - REQUIRED shift, and go to state 36 - OPTIONAL shift, and go to state 37 - REPEATED shift, and go to state 38 - NAME shift, and go to state 39 - '(' shift, and go to state 46 - - option go to state 178 - fieldoptionlist go to state 179 - fieldoption go to state 180 - name go to state 48 - text go to state 45 - - -state 174 - - 55 field: cardinality type name '=' intconst messagebody . - - $default reduce using rule 55 (field) - - -state 175 - - 30 enumvalue: name '=' intconst '[' enumoptionlist ']' . - - $default reduce using rule 30 (enumvalue) - - -state 176 - - 32 enumoptionlist: enumoptionlist ',' . option - - IMPORT shift, and go to state 24 - PACKAGE shift, and go to state 25 - OPTION shift, and go to state 26 - MESSAGE shift, and go to state 27 - EXTEND shift, and go to state 28 - EXTENSIONS shift, and go to state 29 - ENUM shift, and go to state 30 - SERVICE shift, and go to state 31 - RPC shift, and go to state 32 - RETURNS shift, and go to state 33 - TO shift, and go to state 34 - MAX shift, and go to state 35 - REQUIRED shift, and go to state 36 - OPTIONAL shift, and go to state 37 - REPEATED shift, and go to state 38 - NAME shift, and go to state 39 - '(' shift, and go to state 46 - - option go to state 181 - name go to state 48 - text go to state 45 - - -state 177 - - 39 rpc: RPC name '(' usertype ')' RETURNS . '(' usertype ')' ';' - 40 | RPC name '(' usertype ')' RETURNS . '(' usertype ')' '{' optionstmtlist '}' - - '(' shift, and go to state 182 - - -state 178 - - 58 fieldoption: option . - - $default reduce using rule 58 (fieldoption) - - -state 179 - - 54 field: cardinality type name '=' intconst '[' fieldoptionlist . ']' ';' - 57 fieldoptionlist: fieldoptionlist . ',' fieldoption - - ']' shift, and go to state 183 - ',' shift, and go to state 184 - - -state 180 - - 56 fieldoptionlist: fieldoption . - - $default reduce using rule 56 (fieldoptionlist) - - -state 181 - - 32 enumoptionlist: enumoptionlist ',' option . - - $default reduce using rule 32 (enumoptionlist) - - -state 182 - - 39 rpc: RPC name '(' usertype ')' RETURNS '(' . usertype ')' ';' - 40 | RPC name '(' usertype ')' RETURNS '(' . usertype ')' '{' optionstmtlist '}' - - IMPORT shift, and go to state 24 - PACKAGE shift, and go to state 25 - OPTION shift, and go to state 26 - MESSAGE shift, and go to state 27 - EXTEND shift, and go to state 28 - EXTENSIONS shift, and go to state 29 - ENUM shift, and go to state 30 - SERVICE shift, and go to state 31 - RPC shift, and go to state 32 - RETURNS shift, and go to state 33 - TO shift, and go to state 34 - MAX shift, and go to state 35 - REQUIRED shift, and go to state 36 - OPTIONAL shift, and go to state 37 - REPEATED shift, and go to state 38 - NAME shift, and go to state 39 - '.' shift, and go to state 40 - - usertype go to state 185 - path go to state 150 - relpath go to state 43 - name go to state 44 - text go to state 45 - - -state 183 - - 54 field: cardinality type name '=' intconst '[' fieldoptionlist ']' . ';' - - ';' shift, and go to state 186 - - -state 184 - - 57 fieldoptionlist: fieldoptionlist ',' . fieldoption - - IMPORT shift, and go to state 24 - PACKAGE shift, and go to state 25 - OPTION shift, and go to state 26 - MESSAGE shift, and go to state 27 - EXTEND shift, and go to state 28 - EXTENSIONS shift, and go to state 29 - ENUM shift, and go to state 30 - SERVICE shift, and go to state 31 - RPC shift, and go to state 32 - RETURNS shift, and go to state 33 - TO shift, and go to state 34 - MAX shift, and go to state 35 - REQUIRED shift, and go to state 36 - OPTIONAL shift, and go to state 37 - REPEATED shift, and go to state 38 - NAME shift, and go to state 39 - '(' shift, and go to state 46 - - option go to state 178 - fieldoption go to state 187 - name go to state 48 - text go to state 45 - - -state 185 - - 39 rpc: RPC name '(' usertype ')' RETURNS '(' usertype . ')' ';' - 40 | RPC name '(' usertype ')' RETURNS '(' usertype . ')' '{' optionstmtlist '}' - - ')' shift, and go to state 188 - - -state 186 - - 54 field: cardinality type name '=' intconst '[' fieldoptionlist ']' ';' . - - $default reduce using rule 54 (field) - - -state 187 - - 57 fieldoptionlist: fieldoptionlist ',' fieldoption . - - $default reduce using rule 57 (fieldoptionlist) - - -state 188 - - 39 rpc: RPC name '(' usertype ')' RETURNS '(' usertype ')' . ';' - 40 | RPC name '(' usertype ')' RETURNS '(' usertype ')' . '{' optionstmtlist '}' - - ';' shift, and go to state 189 - '{' shift, and go to state 190 - - -state 189 - - 39 rpc: RPC name '(' usertype ')' RETURNS '(' usertype ')' ';' . - - $default reduce using rule 39 (rpc) - - -state 190 - - 40 rpc: RPC name '(' usertype ')' RETURNS '(' usertype ')' '{' . optionstmtlist '}' - - $default reduce using rule 41 (optionstmtlist) - - optionstmtlist go to state 191 - - -state 191 - - 40 rpc: RPC name '(' usertype ')' RETURNS '(' usertype ')' '{' optionstmtlist . '}' - 42 optionstmtlist: optionstmtlist . optionstmt - - OPTION shift, and go to state 7 - '}' shift, and go to state 192 - - optionstmt go to state 193 - - -state 192 - - 40 rpc: RPC name '(' usertype ')' RETURNS '(' usertype ')' '{' optionstmtlist '}' . - - $default reduce using rule 40 (rpc) - - -state 193 - - 42 optionstmtlist: optionstmtlist optionstmt . - - $default reduce using rule 42 (optionstmtlist) diff --git a/libcdmr/ast/src/compiler/foo.c b/libcdmr/ast/src/compiler/foo.c deleted file mode 100644 index ed5a97adf..000000000 --- a/libcdmr/ast/src/compiler/foo.c +++ /dev/null @@ -1,3376 +0,0 @@ - -#include -#include - -#include - -#include "foo.h" - -int -SubMess_write(ast_runtime* rt, SubMess* submess_v) -{ - int status = AST_NOERR; - int i = 0; - - status = ast_write(rt,ast_int32,4,&submess_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*SubMess_write*/ - -int -SubMess_read(ast_runtime* rt, SubMess** submess_vp) -{ - int status = AST_NOERR; - uint32_t wiretype, fieldno; - SubMess* submess_v; - - submess_v = (SubMess*)ast_alloc(sizeof(SubMess)); - if(submess_v == NULL) return AST_ENOMEM; - - while(status == AST_NOERR) - ast_read_tag(rt,&wiretype,&fieldno) - switch (fieldno) { - case 4: { - status = ast_read(rt,ast_int32,&submess_v->test_f); - } break; - default: - status = ast_skip_field(rt,wiretype,fieldno); - }; /*switch*/ - };/*while*/ -if(submess_v->test_f.exists) { - submess_v->test_f.value = 0; -} -done: - return status; -} /*SubMess_read*/ - -int -SubMess_reclaim(ast_runtime* rt, SubMess* submess_v) -{ - int status = AST_NOERR; - int i = 0; - - -done: - return status; - -} /*SubMess_reclaim*/ - -long -SubMess_size(ast_runtime* rt, SubMess* submess_v) -{ - int status = AST_NOERR; - int i = 0; - long totalsize = 0; - - totalsize += ast_write_size(rt,ast_int32,&submess_v->test_f); - return status; - -} /*SubMess_write_size*/ -int -TestFieldNo15_write(ast_runtime* rt, TestFieldNo15* testfieldno15_v) -{ - int status = AST_NOERR; - int i = 0; - - status = ast_write(rt,ast_string,15,&testfieldno15_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*TestFieldNo15_write*/ - -int -TestFieldNo15_read(ast_runtime* rt, TestFieldNo15** testfieldno15_vp) -{ - int status = AST_NOERR; - uint32_t wiretype, fieldno; - size_t count; - TestFieldNo15* testfieldno15_v; - - testfieldno15_v = (TestFieldNo15*)ast_alloc(sizeof(TestFieldNo15)); - if(testfieldno15_v == NULL) return AST_ENOMEM; - - while(status == AST_NOERR) - ast_read_tag(rt,&wiretype,&fieldno) - switch (fieldno) { - case 15: { - status = ast_read(rt,ast_string,&testfieldno15_v->test_f); - } break; - default: - status = ast_skip_field(rt,wiretype,fieldno); - }; /*switch*/ - };/*while*/ -done: - return status; -} /*TestFieldNo15_read*/ - -int -TestFieldNo15_reclaim(ast_runtime* rt, TestFieldNo15* testfieldno15_v) -{ - int status = AST_NOERR; - int i = 0; - - status = ast_reclaim(rt,ast_string,&testfieldno15_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*TestFieldNo15_reclaim*/ - -long -TestFieldNo15_size(ast_runtime* rt, TestFieldNo15* testfieldno15_v) -{ - int status = AST_NOERR; - int i = 0; - long totalsize = 0; - - totalsize += ast_write_size(rt,ast_string,&testfieldno15_v->test_f); - return status; - -} /*TestFieldNo15_write_size*/ -int -TestFieldNo16_write(ast_runtime* rt, TestFieldNo16* testfieldno16_v) -{ - int status = AST_NOERR; - int i = 0; - - status = ast_write(rt,ast_string,16,&testfieldno16_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*TestFieldNo16_write*/ - -int -TestFieldNo16_read(ast_runtime* rt, TestFieldNo16** testfieldno16_vp) -{ - int status = AST_NOERR; - uint32_t wiretype, fieldno; - size_t count; - TestFieldNo16* testfieldno16_v; - - testfieldno16_v = (TestFieldNo16*)ast_alloc(sizeof(TestFieldNo16)); - if(testfieldno16_v == NULL) return AST_ENOMEM; - - while(status == AST_NOERR) - ast_read_tag(rt,&wiretype,&fieldno) - switch (fieldno) { - case 16: { - status = ast_read(rt,ast_string,&testfieldno16_v->test_f); - } break; - default: - status = ast_skip_field(rt,wiretype,fieldno); - }; /*switch*/ - };/*while*/ -done: - return status; -} /*TestFieldNo16_read*/ - -int -TestFieldNo16_reclaim(ast_runtime* rt, TestFieldNo16* testfieldno16_v) -{ - int status = AST_NOERR; - int i = 0; - - status = ast_reclaim(rt,ast_string,&testfieldno16_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*TestFieldNo16_reclaim*/ - -long -TestFieldNo16_size(ast_runtime* rt, TestFieldNo16* testfieldno16_v) -{ - int status = AST_NOERR; - int i = 0; - long totalsize = 0; - - totalsize += ast_write_size(rt,ast_string,&testfieldno16_v->test_f); - return status; - -} /*TestFieldNo16_write_size*/ -int -TestFieldNo2047_write(ast_runtime* rt, TestFieldNo2047* testfieldno2047_v) -{ - int status = AST_NOERR; - int i = 0; - - status = ast_write(rt,ast_string,2047,&testfieldno2047_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*TestFieldNo2047_write*/ - -int -TestFieldNo2047_read(ast_runtime* rt, TestFieldNo2047** testfieldno2047_vp) -{ - int status = AST_NOERR; - uint32_t wiretype, fieldno; - size_t count; - TestFieldNo2047* testfieldno2047_v; - - testfieldno2047_v = (TestFieldNo2047*)ast_alloc(sizeof(TestFieldNo2047)); - if(testfieldno2047_v == NULL) return AST_ENOMEM; - - while(status == AST_NOERR) - ast_read_tag(rt,&wiretype,&fieldno) - switch (fieldno) { - case 2047: { - status = ast_read(rt,ast_string,&testfieldno2047_v->test_f); - } break; - default: - status = ast_skip_field(rt,wiretype,fieldno); - }; /*switch*/ - };/*while*/ -done: - return status; -} /*TestFieldNo2047_read*/ - -int -TestFieldNo2047_reclaim(ast_runtime* rt, TestFieldNo2047* testfieldno2047_v) -{ - int status = AST_NOERR; - int i = 0; - - status = ast_reclaim(rt,ast_string,&testfieldno2047_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*TestFieldNo2047_reclaim*/ - -long -TestFieldNo2047_size(ast_runtime* rt, TestFieldNo2047* testfieldno2047_v) -{ - int status = AST_NOERR; - int i = 0; - long totalsize = 0; - - totalsize += ast_write_size(rt,ast_string,&testfieldno2047_v->test_f); - return status; - -} /*TestFieldNo2047_write_size*/ -int -TestFieldNo2048_write(ast_runtime* rt, TestFieldNo2048* testfieldno2048_v) -{ - int status = AST_NOERR; - int i = 0; - - status = ast_write(rt,ast_string,2048,&testfieldno2048_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*TestFieldNo2048_write*/ - -int -TestFieldNo2048_read(ast_runtime* rt, TestFieldNo2048** testfieldno2048_vp) -{ - int status = AST_NOERR; - uint32_t wiretype, fieldno; - size_t count; - TestFieldNo2048* testfieldno2048_v; - - testfieldno2048_v = (TestFieldNo2048*)ast_alloc(sizeof(TestFieldNo2048)); - if(testfieldno2048_v == NULL) return AST_ENOMEM; - - while(status == AST_NOERR) - ast_read_tag(rt,&wiretype,&fieldno) - switch (fieldno) { - case 2048: { - status = ast_read(rt,ast_string,&testfieldno2048_v->test_f); - } break; - default: - status = ast_skip_field(rt,wiretype,fieldno); - }; /*switch*/ - };/*while*/ -done: - return status; -} /*TestFieldNo2048_read*/ - -int -TestFieldNo2048_reclaim(ast_runtime* rt, TestFieldNo2048* testfieldno2048_v) -{ - int status = AST_NOERR; - int i = 0; - - status = ast_reclaim(rt,ast_string,&testfieldno2048_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*TestFieldNo2048_reclaim*/ - -long -TestFieldNo2048_size(ast_runtime* rt, TestFieldNo2048* testfieldno2048_v) -{ - int status = AST_NOERR; - int i = 0; - long totalsize = 0; - - totalsize += ast_write_size(rt,ast_string,&testfieldno2048_v->test_f); - return status; - -} /*TestFieldNo2048_write_size*/ -int -TestFieldNo262143_write(ast_runtime* rt, TestFieldNo262143* testfieldno262143_v) -{ - int status = AST_NOERR; - int i = 0; - - status = ast_write(rt,ast_string,262143,&testfieldno262143_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*TestFieldNo262143_write*/ - -int -TestFieldNo262143_read(ast_runtime* rt, TestFieldNo262143** testfieldno262143_vp) -{ - int status = AST_NOERR; - uint32_t wiretype, fieldno; - size_t count; - TestFieldNo262143* testfieldno262143_v; - - testfieldno262143_v = (TestFieldNo262143*)ast_alloc(sizeof(TestFieldNo262143)); - if(testfieldno262143_v == NULL) return AST_ENOMEM; - - while(status == AST_NOERR) - ast_read_tag(rt,&wiretype,&fieldno) - switch (fieldno) { - case 262143: { - status = ast_read(rt,ast_string,&testfieldno262143_v->test_f); - } break; - default: - status = ast_skip_field(rt,wiretype,fieldno); - }; /*switch*/ - };/*while*/ -done: - return status; -} /*TestFieldNo262143_read*/ - -int -TestFieldNo262143_reclaim(ast_runtime* rt, TestFieldNo262143* testfieldno262143_v) -{ - int status = AST_NOERR; - int i = 0; - - status = ast_reclaim(rt,ast_string,&testfieldno262143_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*TestFieldNo262143_reclaim*/ - -long -TestFieldNo262143_size(ast_runtime* rt, TestFieldNo262143* testfieldno262143_v) -{ - int status = AST_NOERR; - int i = 0; - long totalsize = 0; - - totalsize += ast_write_size(rt,ast_string,&testfieldno262143_v->test_f); - return status; - -} /*TestFieldNo262143_write_size*/ -int -TestFieldNo262144_write(ast_runtime* rt, TestFieldNo262144* testfieldno262144_v) -{ - int status = AST_NOERR; - int i = 0; - - status = ast_write(rt,ast_string,262144,&testfieldno262144_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*TestFieldNo262144_write*/ - -int -TestFieldNo262144_read(ast_runtime* rt, TestFieldNo262144** testfieldno262144_vp) -{ - int status = AST_NOERR; - uint32_t wiretype, fieldno; - size_t count; - TestFieldNo262144* testfieldno262144_v; - - testfieldno262144_v = (TestFieldNo262144*)ast_alloc(sizeof(TestFieldNo262144)); - if(testfieldno262144_v == NULL) return AST_ENOMEM; - - while(status == AST_NOERR) - ast_read_tag(rt,&wiretype,&fieldno) - switch (fieldno) { - case 262144: { - status = ast_read(rt,ast_string,&testfieldno262144_v->test_f); - } break; - default: - status = ast_skip_field(rt,wiretype,fieldno); - }; /*switch*/ - };/*while*/ -done: - return status; -} /*TestFieldNo262144_read*/ - -int -TestFieldNo262144_reclaim(ast_runtime* rt, TestFieldNo262144* testfieldno262144_v) -{ - int status = AST_NOERR; - int i = 0; - - status = ast_reclaim(rt,ast_string,&testfieldno262144_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*TestFieldNo262144_reclaim*/ - -long -TestFieldNo262144_size(ast_runtime* rt, TestFieldNo262144* testfieldno262144_v) -{ - int status = AST_NOERR; - int i = 0; - long totalsize = 0; - - totalsize += ast_write_size(rt,ast_string,&testfieldno262144_v->test_f); - return status; - -} /*TestFieldNo262144_write_size*/ -int -TestFieldNo33554431_write(ast_runtime* rt, TestFieldNo33554431* testfieldno33554431_v) -{ - int status = AST_NOERR; - int i = 0; - - status = ast_write(rt,ast_string,33554431,&testfieldno33554431_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*TestFieldNo33554431_write*/ - -int -TestFieldNo33554431_read(ast_runtime* rt, TestFieldNo33554431** testfieldno33554431_vp) -{ - int status = AST_NOERR; - uint32_t wiretype, fieldno; - size_t count; - TestFieldNo33554431* testfieldno33554431_v; - - testfieldno33554431_v = (TestFieldNo33554431*)ast_alloc(sizeof(TestFieldNo33554431)); - if(testfieldno33554431_v == NULL) return AST_ENOMEM; - - while(status == AST_NOERR) - ast_read_tag(rt,&wiretype,&fieldno) - switch (fieldno) { - case 33554431: { - status = ast_read(rt,ast_string,&testfieldno33554431_v->test_f); - } break; - default: - status = ast_skip_field(rt,wiretype,fieldno); - }; /*switch*/ - };/*while*/ -done: - return status; -} /*TestFieldNo33554431_read*/ - -int -TestFieldNo33554431_reclaim(ast_runtime* rt, TestFieldNo33554431* testfieldno33554431_v) -{ - int status = AST_NOERR; - int i = 0; - - status = ast_reclaim(rt,ast_string,&testfieldno33554431_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*TestFieldNo33554431_reclaim*/ - -long -TestFieldNo33554431_size(ast_runtime* rt, TestFieldNo33554431* testfieldno33554431_v) -{ - int status = AST_NOERR; - int i = 0; - long totalsize = 0; - - totalsize += ast_write_size(rt,ast_string,&testfieldno33554431_v->test_f); - return status; - -} /*TestFieldNo33554431_write_size*/ -int -TestFieldNo33554432_write(ast_runtime* rt, TestFieldNo33554432* testfieldno33554432_v) -{ - int status = AST_NOERR; - int i = 0; - - status = ast_write(rt,ast_string,33554432,&testfieldno33554432_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*TestFieldNo33554432_write*/ - -int -TestFieldNo33554432_read(ast_runtime* rt, TestFieldNo33554432** testfieldno33554432_vp) -{ - int status = AST_NOERR; - uint32_t wiretype, fieldno; - size_t count; - TestFieldNo33554432* testfieldno33554432_v; - - testfieldno33554432_v = (TestFieldNo33554432*)ast_alloc(sizeof(TestFieldNo33554432)); - if(testfieldno33554432_v == NULL) return AST_ENOMEM; - - while(status == AST_NOERR) - ast_read_tag(rt,&wiretype,&fieldno) - switch (fieldno) { - case 33554432: { - status = ast_read(rt,ast_string,&testfieldno33554432_v->test_f); - } break; - default: - status = ast_skip_field(rt,wiretype,fieldno); - }; /*switch*/ - };/*while*/ -done: - return status; -} /*TestFieldNo33554432_read*/ - -int -TestFieldNo33554432_reclaim(ast_runtime* rt, TestFieldNo33554432* testfieldno33554432_v) -{ - int status = AST_NOERR; - int i = 0; - - status = ast_reclaim(rt,ast_string,&testfieldno33554432_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*TestFieldNo33554432_reclaim*/ - -long -TestFieldNo33554432_size(ast_runtime* rt, TestFieldNo33554432* testfieldno33554432_v) -{ - int status = AST_NOERR; - int i = 0; - long totalsize = 0; - - totalsize += ast_write_size(rt,ast_string,&testfieldno33554432_v->test_f); - return status; - -} /*TestFieldNo33554432_write_size*/ -int -TestMess_write(ast_runtime* rt, TestMess* testmess_v) -{ - int status = AST_NOERR; - int i = 0; - - for(i=0;itest_int32_f.count;i++) { - status = ast_write(rt,ast_int32,1,&testmess_v->test_int32_f.values[i]); - if(!status) {goto done;} - } - for(i=0;itest_sint32_f.count;i++) { - status = ast_write(rt,ast_sint32,2,&testmess_v->test_sint32_f.values[i]); - if(!status) {goto done;} - } - for(i=0;itest_sfixed32_f.count;i++) { - status = ast_write(rt,ast_sfixed32,3,&testmess_v->test_sfixed32_f.values[i]); - if(!status) {goto done;} - } - for(i=0;itest_int64_f.count;i++) { - status = ast_write(rt,ast_int64,4,&testmess_v->test_int64_f.values[i]); - if(!status) {goto done;} - } - for(i=0;itest_sint64_f.count;i++) { - status = ast_write(rt,ast_sint64,5,&testmess_v->test_sint64_f.values[i]); - if(!status) {goto done;} - } - for(i=0;itest_sfixed64_f.count;i++) { - status = ast_write(rt,ast_sfixed64,6,&testmess_v->test_sfixed64_f.values[i]); - if(!status) {goto done;} - } - for(i=0;itest_uint32_f.count;i++) { - status = ast_write(rt,ast_uint32,7,&testmess_v->test_uint32_f.values[i]); - if(!status) {goto done;} - } - for(i=0;itest_fixed32_f.count;i++) { - status = ast_write(rt,ast_fixed32,8,&testmess_v->test_fixed32_f.values[i]); - if(!status) {goto done;} - } - for(i=0;itest_uint64_f.count;i++) { - status = ast_write(rt,ast_uint64,9,&testmess_v->test_uint64_f.values[i]); - if(!status) {goto done;} - } - for(i=0;itest_fixed64_f.count;i++) { - status = ast_write(rt,ast_fixed64,10,&testmess_v->test_fixed64_f.values[i]); - if(!status) {goto done;} - } - for(i=0;itest_float_f.count;i++) { - status = ast_write(rt,ast_float,11,&testmess_v->test_float_f.values[i]); - if(!status) {goto done;} - } - for(i=0;itest_double_f.count;i++) { - status = ast_write(rt,ast_double,12,&testmess_v->test_double_f.values[i]); - if(!status) {goto done;} - } - for(i=0;itest_boolean_f.count;i++) { - status = ast_write(rt,ast_bool,13,&testmess_v->test_boolean_f.values[i]); - if(!status) {goto done;} - } - for(i=0;itest_enum_small_f.count;i++) { - status = TestEnumSmall_write(rt,testmess_v->test_enum_small_f.values[i]); - if(!status) {goto done;} - } - for(i=0;itest_enum_f.count;i++) { - status = TestEnum_write(rt,testmess_v->test_enum_f.values[i]); - if(!status) {goto done;} - } - for(i=0;itest_string_f.count;i++) { - status = ast_write(rt,ast_string,16,&testmess_v->test_string_f.values[i]); - if(!status) {goto done;} - } - for(i=0;itest_bytes_f.count;i++) { - status = ast_write(rt,ast_bytes,17,&testmess_v->test_bytes_f.values[i]); - if(!status) {goto done;} - } - for(i=0;itest_message_f.count;i++) { - status = SubMess_write(rt,testmess_v->test_message_f.values[i]); - if(!status) {goto done;} - } - -done: - return status; - -} /*TestMess_write*/ - -int -TestMess_read(ast_runtime* rt, TestMess** testmess_vp) -{ - int status = AST_NOERR; - uint32_t wiretype, fieldno; - size_t count; - TestMess* testmess_v; - - testmess_v = (TestMess*)ast_alloc(sizeof(TestMess)); - if(testmess_v == NULL) return AST_ENOMEM; - - while(status == AST_NOERR) - ast_read_tag(rt,&wiretype,&fieldno) - switch (fieldno) { - case 1: { - testmess_v->test_int32_f.count = 0; - testmess_v->test_int32_f.values = NULL; - status = ast_read_count(rt,&testmess_v->test_int32_f.count); - if(!status) {goto done;} - for(i=0;itest_int32_f.count;i++) { - int tmp; - status = ast_read(rt,ast_int32,&tmp); - status = ast_append(rt,ast_int32,&testmess_v->test_int32_f,&tmp); - if(!status) {goto done;} - } /*for*/; - } break; - case 2: { - testmess_v->test_sint32_f.count = 0; - testmess_v->test_sint32_f.values = NULL; - status = ast_read_count(rt,&testmess_v->test_sint32_f.count); - if(!status) {goto done;} - for(i=0;itest_sint32_f.count;i++) { - int tmp; - status = ast_read(rt,ast_sint32,&tmp); - status = ast_append(rt,ast_sint32,&testmess_v->test_sint32_f,&tmp); - if(!status) {goto done;} - } /*for*/; - } break; - case 3: { - testmess_v->test_sfixed32_f.count = 0; - testmess_v->test_sfixed32_f.values = NULL; - status = ast_read_count(rt,&testmess_v->test_sfixed32_f.count); - if(!status) {goto done;} - for(i=0;itest_sfixed32_f.count;i++) { - int tmp; - status = ast_read(rt,ast_sfixed32,&tmp); - status = ast_append(rt,ast_sfixed32,&testmess_v->test_sfixed32_f,&tmp); - if(!status) {goto done;} - } /*for*/; - } break; - case 4: { - testmess_v->test_int64_f.count = 0; - testmess_v->test_int64_f.values = NULL; - status = ast_read_count(rt,&testmess_v->test_int64_f.count); - if(!status) {goto done;} - for(i=0;itest_int64_f.count;i++) { - longlong tmp; - status = ast_read(rt,ast_int64,&tmp); - status = ast_append(rt,ast_int64,&testmess_v->test_int64_f,&tmp); - if(!status) {goto done;} - } /*for*/; - } break; - case 5: { - testmess_v->test_sint64_f.count = 0; - testmess_v->test_sint64_f.values = NULL; - status = ast_read_count(rt,&testmess_v->test_sint64_f.count); - if(!status) {goto done;} - for(i=0;itest_sint64_f.count;i++) { - longlong tmp; - status = ast_read(rt,ast_sint64,&tmp); - status = ast_append(rt,ast_sint64,&testmess_v->test_sint64_f,&tmp); - if(!status) {goto done;} - } /*for*/; - } break; - case 6: { - testmess_v->test_sfixed64_f.count = 0; - testmess_v->test_sfixed64_f.values = NULL; - status = ast_read_count(rt,&testmess_v->test_sfixed64_f.count); - if(!status) {goto done;} - for(i=0;itest_sfixed64_f.count;i++) { - longlong tmp; - status = ast_read(rt,ast_sfixed64,&tmp); - status = ast_append(rt,ast_sfixed64,&testmess_v->test_sfixed64_f,&tmp); - if(!status) {goto done;} - } /*for*/; - } break; - case 7: { - testmess_v->test_uint32_f.count = 0; - testmess_v->test_uint32_f.values = NULL; - status = ast_read_count(rt,&testmess_v->test_uint32_f.count); - if(!status) {goto done;} - for(i=0;itest_uint32_f.count;i++) { - int tmp; - status = ast_read(rt,ast_uint32,&tmp); - status = ast_append(rt,ast_uint32,&testmess_v->test_uint32_f,&tmp); - if(!status) {goto done;} - } /*for*/; - } break; - case 8: { - testmess_v->test_fixed32_f.count = 0; - testmess_v->test_fixed32_f.values = NULL; - status = ast_read_count(rt,&testmess_v->test_fixed32_f.count); - if(!status) {goto done;} - for(i=0;itest_fixed32_f.count;i++) { - int tmp; - status = ast_read(rt,ast_fixed32,&tmp); - status = ast_append(rt,ast_fixed32,&testmess_v->test_fixed32_f,&tmp); - if(!status) {goto done;} - } /*for*/; - } break; - case 9: { - testmess_v->test_uint64_f.count = 0; - testmess_v->test_uint64_f.values = NULL; - status = ast_read_count(rt,&testmess_v->test_uint64_f.count); - if(!status) {goto done;} - for(i=0;itest_uint64_f.count;i++) { - longlong tmp; - status = ast_read(rt,ast_uint64,&tmp); - status = ast_append(rt,ast_uint64,&testmess_v->test_uint64_f,&tmp); - if(!status) {goto done;} - } /*for*/; - } break; - case 10: { - testmess_v->test_fixed64_f.count = 0; - testmess_v->test_fixed64_f.values = NULL; - status = ast_read_count(rt,&testmess_v->test_fixed64_f.count); - if(!status) {goto done;} - for(i=0;itest_fixed64_f.count;i++) { - longlong tmp; - status = ast_read(rt,ast_fixed64,&tmp); - status = ast_append(rt,ast_fixed64,&testmess_v->test_fixed64_f,&tmp); - if(!status) {goto done;} - } /*for*/; - } break; - case 11: { - testmess_v->test_float_f.count = 0; - testmess_v->test_float_f.values = NULL; - status = ast_read_count(rt,&testmess_v->test_float_f.count); - if(!status) {goto done;} - for(i=0;itest_float_f.count;i++) { - float tmp; - status = ast_read(rt,ast_float,&tmp); - status = ast_append(rt,ast_float,&testmess_v->test_float_f,&tmp); - if(!status) {goto done;} - } /*for*/; - } break; - case 12: { - testmess_v->test_double_f.count = 0; - testmess_v->test_double_f.values = NULL; - status = ast_read_count(rt,&testmess_v->test_double_f.count); - if(!status) {goto done;} - for(i=0;itest_double_f.count;i++) { - double tmp; - status = ast_read(rt,ast_double,&tmp); - status = ast_append(rt,ast_double,&testmess_v->test_double_f,&tmp); - if(!status) {goto done;} - } /*for*/; - } break; - case 13: { - testmess_v->test_boolean_f.count = 0; - testmess_v->test_boolean_f.values = NULL; - status = ast_read_count(rt,&testmess_v->test_boolean_f.count); - if(!status) {goto done;} - for(i=0;itest_boolean_f.count;i++) { - int tmp; - status = ast_read(rt,ast_bool,&tmp); - status = ast_append(rt,ast_bool,&testmess_v->test_boolean_f,&tmp); - if(!status) {goto done;} - } /*for*/; - } break; - case 14: { - testmess_v->test_enum_small_f.count = 0; - testmess_v->test_enum_small_f.values = NULL; - status = ast_read(rt,ast_int32,testmess_v->test_enum_small_f.count); - if(!status) {goto done;} - for(i=0;itest_enum_small_f.count;i++) { - TestEnumSmall* tmp; - status = TestEnumSmall_read(rt,&tmp); - status = ast_append(rt,ast_enum,&testmess_v->test_enum_small_f,&tmp); - if(!status) {goto done;} - } /*for*/; - } break; - case 15: { - testmess_v->test_enum_f.count = 0; - testmess_v->test_enum_f.values = NULL; - status = ast_read(rt,ast_int32,testmess_v->test_enum_f.count); - if(!status) {goto done;} - for(i=0;itest_enum_f.count;i++) { - TestEnum* tmp; - status = TestEnum_read(rt,&tmp); - status = ast_append(rt,ast_enum,&testmess_v->test_enum_f,&tmp); - if(!status) {goto done;} - } /*for*/; - } break; - case 16: { - testmess_v->test_string_f.count = 0; - testmess_v->test_string_f.values = NULL; - status = ast_read_count(rt,&testmess_v->test_string_f.count); - if(!status) {goto done;} - for(i=0;itest_string_f.count;i++) { - char* tmp; - status = ast_read(rt,ast_string,&tmp); - status = ast_append(rt,ast_string,&testmess_v->test_string_f,&tmp); - if(!status) {goto done;} - } /*for*/; - } break; - case 17: { - testmess_v->test_bytes_f.count = 0; - testmess_v->test_bytes_f.values = NULL; - status = ast_read_count(rt,&testmess_v->test_bytes_f.count); - if(!status) {goto done;} - for(i=0;itest_bytes_f.count;i++) { - Bytestring tmp; - status = ast_read(rt,ast_bytes,&tmp); - status = ast_append(rt,ast_bytes,&testmess_v->test_bytes_f,&tmp); - if(!status) {goto done;} - } /*for*/; - } break; - case 18: { - testmess_v->test_message_f.count = 0; - testmess_v->test_message_f.values = NULL; - status = ast_read(rt,ast_int32,testmess_v->test_message_f.count); - if(!status) {goto done;} - for(i=0;itest_message_f.count;i++) { - SubMess* tmp; - status = SubMess_read(rt,&tmp); - status = ast_append(rt,ast_message,&testmess_v->test_message_f,&tmp); - if(!status) {goto done;} - } /*for*/; - } break; - default: - status = ast_skip_field(rt,wiretype,fieldno); - }; /*switch*/ - };/*while*/ -if(testmess_v->test_int32_f.exists) { - testmess_v->test_int32_f.value = 0; -} -if(testmess_v->test_sint32_f.exists) { - testmess_v->test_sint32_f.value = 0; -} -if(testmess_v->test_sfixed32_f.exists) { - testmess_v->test_sfixed32_f.value = 0; -} -if(testmess_v->test_int64_f.exists) { - testmess_v->test_int64_f.value = 0; -} -if(testmess_v->test_sint64_f.exists) { - testmess_v->test_sint64_f.value = 0; -} -if(testmess_v->test_sfixed64_f.exists) { - testmess_v->test_sfixed64_f.value = 0; -} -if(testmess_v->test_uint32_f.exists) { - testmess_v->test_uint32_f.value = 0; -} -if(testmess_v->test_fixed32_f.exists) { - testmess_v->test_fixed32_f.value = 0; -} -if(testmess_v->test_uint64_f.exists) { - testmess_v->test_uint64_f.value = 0; -} -if(testmess_v->test_fixed64_f.exists) { - testmess_v->test_fixed64_f.value = 0; -} -if(testmess_v->test_float_f.exists) { - testmess_v->test_float_f.value = 0; -} -if(testmess_v->test_double_f.exists) { - testmess_v->test_double_f.value = 0; -} -if(testmess_v->test_boolean_f.exists) { - testmess_v->test_boolean_f.value = 0; -} -done: - return status; -} /*TestMess_read*/ - -int -TestMess_reclaim(ast_runtime* rt, TestMess* testmess_v) -{ - int status = AST_NOERR; - int i = 0; - - for(i=0;itest_string_f.count;i++) { - status = ast_reclaim(rt,ast_string,&testmess_v->test_string_f.values[i]); - if(!status) {goto done;} - } - ast_free(TestMess->test_string.values) - for(i=0;itest_bytes_f.count;i++) { - status = ast_reclaim(rt,ast_bytes,&testmess_v->test_bytes_f.values[i]); - if(!status) {goto done;} - } - ast_free(TestMess->test_bytes.values) - for(i=0;itest_message_f.count;i++) { - status = SubMess_reclaim(rt,testmess_v->test_message_f.values[i]); - if(!status) {goto done;} - } - ast_free(TestMess->test_message.values) - -done: - return status; - -} /*TestMess_reclaim*/ - -long -TestMess_size(ast_runtime* rt, TestMess* testmess_v) -{ - int status = AST_NOERR; - int i = 0; - long totalsize = 0; - - for(i=0;itest_int32_f.count;i++) { - totalsize += ast_write_size(rt,ast_int32,testmess_v->test_int32_f.values[i]); - } - for(i=0;itest_sint32_f.count;i++) { - totalsize += ast_write_size(rt,ast_sint32,testmess_v->test_sint32_f.values[i]); - } - for(i=0;itest_sfixed32_f.count;i++) { - totalsize += ast_write_size(rt,ast_sfixed32,testmess_v->test_sfixed32_f.values[i]); - } - for(i=0;itest_int64_f.count;i++) { - totalsize += ast_write_size(rt,ast_int64,testmess_v->test_int64_f.values[i]); - } - for(i=0;itest_sint64_f.count;i++) { - totalsize += ast_write_size(rt,ast_sint64,testmess_v->test_sint64_f.values[i]); - } - for(i=0;itest_sfixed64_f.count;i++) { - totalsize += ast_write_size(rt,ast_sfixed64,testmess_v->test_sfixed64_f.values[i]); - } - for(i=0;itest_uint32_f.count;i++) { - totalsize += ast_write_size(rt,ast_uint32,testmess_v->test_uint32_f.values[i]); - } - for(i=0;itest_fixed32_f.count;i++) { - totalsize += ast_write_size(rt,ast_fixed32,testmess_v->test_fixed32_f.values[i]); - } - for(i=0;itest_uint64_f.count;i++) { - totalsize += ast_write_size(rt,ast_uint64,testmess_v->test_uint64_f.values[i]); - } - for(i=0;itest_fixed64_f.count;i++) { - totalsize += ast_write_size(rt,ast_fixed64,testmess_v->test_fixed64_f.values[i]); - } - for(i=0;itest_float_f.count;i++) { - totalsize += ast_write_size(rt,ast_float,testmess_v->test_float_f.values[i]); - } - for(i=0;itest_double_f.count;i++) { - totalsize += ast_write_size(rt,ast_double,testmess_v->test_double_f.values[i]); - } - for(i=0;itest_boolean_f.count;i++) { - totalsize += ast_write_size(rt,ast_bool,testmess_v->test_boolean_f.values[i]); - } - for(i=0;itest_enum_small_f.count;i++) { - totalsize += TestEnumSmall_write_size(rt,14,&testmess_v->test_enum_small_f); - } - for(i=0;itest_enum_f.count;i++) { - totalsize += TestEnum_write_size(rt,15,&testmess_v->test_enum_f); - } - for(i=0;itest_string_f.count;i++) { - totalsize += ast_write_size(rt,ast_string,testmess_v->test_string_f.values[i]); - } - for(i=0;itest_bytes_f.count;i++) { - totalsize += ast_write_size(rt,ast_bytes,testmess_v->test_bytes_f.values[i]); - } - for(i=0;itest_message_f.count;i++) { - totalsize += SubMess_write_size(rt,18,&testmess_v->test_message_f); - } - return status; - -} /*TestMess_write_size*/ -int -TestMessPacked_write(ast_runtime* rt, TestMessPacked* testmesspacked_v) -{ - int status = AST_NOERR; - int i = 0; - - for(i=0;itest_int32_f.count;i++) { - status = ast_write(rt,ast_int32,1,&testmesspacked_v->test_int32_f.values[i]); - if(!status) {goto done;} - } - for(i=0;itest_sint32_f.count;i++) { - status = ast_write(rt,ast_sint32,2,&testmesspacked_v->test_sint32_f.values[i]); - if(!status) {goto done;} - } - for(i=0;itest_sfixed32_f.count;i++) { - status = ast_write(rt,ast_sfixed32,3,&testmesspacked_v->test_sfixed32_f.values[i]); - if(!status) {goto done;} - } - for(i=0;itest_int64_f.count;i++) { - status = ast_write(rt,ast_int64,4,&testmesspacked_v->test_int64_f.values[i]); - if(!status) {goto done;} - } - for(i=0;itest_sint64_f.count;i++) { - status = ast_write(rt,ast_sint64,5,&testmesspacked_v->test_sint64_f.values[i]); - if(!status) {goto done;} - } - for(i=0;itest_sfixed64_f.count;i++) { - status = ast_write(rt,ast_sfixed64,6,&testmesspacked_v->test_sfixed64_f.values[i]); - if(!status) {goto done;} - } - for(i=0;itest_uint32_f.count;i++) { - status = ast_write(rt,ast_uint32,7,&testmesspacked_v->test_uint32_f.values[i]); - if(!status) {goto done;} - } - for(i=0;itest_fixed32_f.count;i++) { - status = ast_write(rt,ast_fixed32,8,&testmesspacked_v->test_fixed32_f.values[i]); - if(!status) {goto done;} - } - for(i=0;itest_uint64_f.count;i++) { - status = ast_write(rt,ast_uint64,9,&testmesspacked_v->test_uint64_f.values[i]); - if(!status) {goto done;} - } - for(i=0;itest_fixed64_f.count;i++) { - status = ast_write(rt,ast_fixed64,10,&testmesspacked_v->test_fixed64_f.values[i]); - if(!status) {goto done;} - } - for(i=0;itest_float_f.count;i++) { - status = ast_write(rt,ast_float,11,&testmesspacked_v->test_float_f.values[i]); - if(!status) {goto done;} - } - for(i=0;itest_double_f.count;i++) { - status = ast_write(rt,ast_double,12,&testmesspacked_v->test_double_f.values[i]); - if(!status) {goto done;} - } - for(i=0;itest_boolean_f.count;i++) { - status = ast_write(rt,ast_bool,13,&testmesspacked_v->test_boolean_f.values[i]); - if(!status) {goto done;} - } - for(i=0;itest_enum_small_f.count;i++) { - status = TestEnumSmall_write(rt,testmesspacked_v->test_enum_small_f.values[i]); - if(!status) {goto done;} - } - for(i=0;itest_enum_f.count;i++) { - status = TestEnum_write(rt,testmesspacked_v->test_enum_f.values[i]); - if(!status) {goto done;} - } - -done: - return status; - -} /*TestMessPacked_write*/ - -int -TestMessPacked_read(ast_runtime* rt, TestMessPacked** testmesspacked_vp) -{ - int status = AST_NOERR; - uint32_t wiretype, fieldno; - size_t count; - TestMessPacked* testmesspacked_v; - - testmesspacked_v = (TestMessPacked*)ast_alloc(sizeof(TestMessPacked)); - if(testmesspacked_v == NULL) return AST_ENOMEM; - - while(status == AST_NOERR) - ast_read_tag(rt,&wiretype,&fieldno) - switch (fieldno) { - case 1: { - testmesspacked_v->test_int32_f.count = 0; - testmesspacked_v->test_int32_f.values = NULL; - status = ast_read_count(rt,&testmesspacked_v->test_int32_f.count); - if(!status) {goto done;} - for(i=0;itest_int32_f.count;i++) { - int tmp; - status = ast_read(rt,ast_int32,&tmp); - status = ast_append(rt,ast_int32,&testmesspacked_v->test_int32_f,&tmp); - if(!status) {goto done;} - } /*for*/; - } break; - case 2: { - testmesspacked_v->test_sint32_f.count = 0; - testmesspacked_v->test_sint32_f.values = NULL; - status = ast_read_count(rt,&testmesspacked_v->test_sint32_f.count); - if(!status) {goto done;} - for(i=0;itest_sint32_f.count;i++) { - int tmp; - status = ast_read(rt,ast_sint32,&tmp); - status = ast_append(rt,ast_sint32,&testmesspacked_v->test_sint32_f,&tmp); - if(!status) {goto done;} - } /*for*/; - } break; - case 3: { - testmesspacked_v->test_sfixed32_f.count = 0; - testmesspacked_v->test_sfixed32_f.values = NULL; - status = ast_read_count(rt,&testmesspacked_v->test_sfixed32_f.count); - if(!status) {goto done;} - for(i=0;itest_sfixed32_f.count;i++) { - int tmp; - status = ast_read(rt,ast_sfixed32,&tmp); - status = ast_append(rt,ast_sfixed32,&testmesspacked_v->test_sfixed32_f,&tmp); - if(!status) {goto done;} - } /*for*/; - } break; - case 4: { - testmesspacked_v->test_int64_f.count = 0; - testmesspacked_v->test_int64_f.values = NULL; - status = ast_read_count(rt,&testmesspacked_v->test_int64_f.count); - if(!status) {goto done;} - for(i=0;itest_int64_f.count;i++) { - longlong tmp; - status = ast_read(rt,ast_int64,&tmp); - status = ast_append(rt,ast_int64,&testmesspacked_v->test_int64_f,&tmp); - if(!status) {goto done;} - } /*for*/; - } break; - case 5: { - testmesspacked_v->test_sint64_f.count = 0; - testmesspacked_v->test_sint64_f.values = NULL; - status = ast_read_count(rt,&testmesspacked_v->test_sint64_f.count); - if(!status) {goto done;} - for(i=0;itest_sint64_f.count;i++) { - longlong tmp; - status = ast_read(rt,ast_sint64,&tmp); - status = ast_append(rt,ast_sint64,&testmesspacked_v->test_sint64_f,&tmp); - if(!status) {goto done;} - } /*for*/; - } break; - case 6: { - testmesspacked_v->test_sfixed64_f.count = 0; - testmesspacked_v->test_sfixed64_f.values = NULL; - status = ast_read_count(rt,&testmesspacked_v->test_sfixed64_f.count); - if(!status) {goto done;} - for(i=0;itest_sfixed64_f.count;i++) { - longlong tmp; - status = ast_read(rt,ast_sfixed64,&tmp); - status = ast_append(rt,ast_sfixed64,&testmesspacked_v->test_sfixed64_f,&tmp); - if(!status) {goto done;} - } /*for*/; - } break; - case 7: { - testmesspacked_v->test_uint32_f.count = 0; - testmesspacked_v->test_uint32_f.values = NULL; - status = ast_read_count(rt,&testmesspacked_v->test_uint32_f.count); - if(!status) {goto done;} - for(i=0;itest_uint32_f.count;i++) { - int tmp; - status = ast_read(rt,ast_uint32,&tmp); - status = ast_append(rt,ast_uint32,&testmesspacked_v->test_uint32_f,&tmp); - if(!status) {goto done;} - } /*for*/; - } break; - case 8: { - testmesspacked_v->test_fixed32_f.count = 0; - testmesspacked_v->test_fixed32_f.values = NULL; - status = ast_read_count(rt,&testmesspacked_v->test_fixed32_f.count); - if(!status) {goto done;} - for(i=0;itest_fixed32_f.count;i++) { - int tmp; - status = ast_read(rt,ast_fixed32,&tmp); - status = ast_append(rt,ast_fixed32,&testmesspacked_v->test_fixed32_f,&tmp); - if(!status) {goto done;} - } /*for*/; - } break; - case 9: { - testmesspacked_v->test_uint64_f.count = 0; - testmesspacked_v->test_uint64_f.values = NULL; - status = ast_read_count(rt,&testmesspacked_v->test_uint64_f.count); - if(!status) {goto done;} - for(i=0;itest_uint64_f.count;i++) { - longlong tmp; - status = ast_read(rt,ast_uint64,&tmp); - status = ast_append(rt,ast_uint64,&testmesspacked_v->test_uint64_f,&tmp); - if(!status) {goto done;} - } /*for*/; - } break; - case 10: { - testmesspacked_v->test_fixed64_f.count = 0; - testmesspacked_v->test_fixed64_f.values = NULL; - status = ast_read_count(rt,&testmesspacked_v->test_fixed64_f.count); - if(!status) {goto done;} - for(i=0;itest_fixed64_f.count;i++) { - longlong tmp; - status = ast_read(rt,ast_fixed64,&tmp); - status = ast_append(rt,ast_fixed64,&testmesspacked_v->test_fixed64_f,&tmp); - if(!status) {goto done;} - } /*for*/; - } break; - case 11: { - testmesspacked_v->test_float_f.count = 0; - testmesspacked_v->test_float_f.values = NULL; - status = ast_read_count(rt,&testmesspacked_v->test_float_f.count); - if(!status) {goto done;} - for(i=0;itest_float_f.count;i++) { - float tmp; - status = ast_read(rt,ast_float,&tmp); - status = ast_append(rt,ast_float,&testmesspacked_v->test_float_f,&tmp); - if(!status) {goto done;} - } /*for*/; - } break; - case 12: { - testmesspacked_v->test_double_f.count = 0; - testmesspacked_v->test_double_f.values = NULL; - status = ast_read_count(rt,&testmesspacked_v->test_double_f.count); - if(!status) {goto done;} - for(i=0;itest_double_f.count;i++) { - double tmp; - status = ast_read(rt,ast_double,&tmp); - status = ast_append(rt,ast_double,&testmesspacked_v->test_double_f,&tmp); - if(!status) {goto done;} - } /*for*/; - } break; - case 13: { - testmesspacked_v->test_boolean_f.count = 0; - testmesspacked_v->test_boolean_f.values = NULL; - status = ast_read_count(rt,&testmesspacked_v->test_boolean_f.count); - if(!status) {goto done;} - for(i=0;itest_boolean_f.count;i++) { - int tmp; - status = ast_read(rt,ast_bool,&tmp); - status = ast_append(rt,ast_bool,&testmesspacked_v->test_boolean_f,&tmp); - if(!status) {goto done;} - } /*for*/; - } break; - case 14: { - testmesspacked_v->test_enum_small_f.count = 0; - testmesspacked_v->test_enum_small_f.values = NULL; - status = ast_read(rt,ast_int32,testmesspacked_v->test_enum_small_f.count); - if(!status) {goto done;} - for(i=0;itest_enum_small_f.count;i++) { - TestEnumSmall* tmp; - status = TestEnumSmall_read(rt,&tmp); - status = ast_append(rt,ast_enum,&testmesspacked_v->test_enum_small_f,&tmp); - if(!status) {goto done;} - } /*for*/; - } break; - case 15: { - testmesspacked_v->test_enum_f.count = 0; - testmesspacked_v->test_enum_f.values = NULL; - status = ast_read(rt,ast_int32,testmesspacked_v->test_enum_f.count); - if(!status) {goto done;} - for(i=0;itest_enum_f.count;i++) { - TestEnum* tmp; - status = TestEnum_read(rt,&tmp); - status = ast_append(rt,ast_enum,&testmesspacked_v->test_enum_f,&tmp); - if(!status) {goto done;} - } /*for*/; - } break; - default: - status = ast_skip_field(rt,wiretype,fieldno); - }; /*switch*/ - };/*while*/ -if(testmesspacked_v->test_int32_f.exists) { - testmesspacked_v->test_int32_f.value = 0; -} -if(testmesspacked_v->test_sint32_f.exists) { - testmesspacked_v->test_sint32_f.value = 0; -} -if(testmesspacked_v->test_sfixed32_f.exists) { - testmesspacked_v->test_sfixed32_f.value = 0; -} -if(testmesspacked_v->test_int64_f.exists) { - testmesspacked_v->test_int64_f.value = 0; -} -if(testmesspacked_v->test_sint64_f.exists) { - testmesspacked_v->test_sint64_f.value = 0; -} -if(testmesspacked_v->test_sfixed64_f.exists) { - testmesspacked_v->test_sfixed64_f.value = 0; -} -if(testmesspacked_v->test_uint32_f.exists) { - testmesspacked_v->test_uint32_f.value = 0; -} -if(testmesspacked_v->test_fixed32_f.exists) { - testmesspacked_v->test_fixed32_f.value = 0; -} -if(testmesspacked_v->test_uint64_f.exists) { - testmesspacked_v->test_uint64_f.value = 0; -} -if(testmesspacked_v->test_fixed64_f.exists) { - testmesspacked_v->test_fixed64_f.value = 0; -} -if(testmesspacked_v->test_float_f.exists) { - testmesspacked_v->test_float_f.value = 0; -} -if(testmesspacked_v->test_double_f.exists) { - testmesspacked_v->test_double_f.value = 0; -} -if(testmesspacked_v->test_boolean_f.exists) { - testmesspacked_v->test_boolean_f.value = 0; -} -done: - return status; -} /*TestMessPacked_read*/ - -int -TestMessPacked_reclaim(ast_runtime* rt, TestMessPacked* testmesspacked_v) -{ - int status = AST_NOERR; - int i = 0; - - -done: - return status; - -} /*TestMessPacked_reclaim*/ - -long -TestMessPacked_size(ast_runtime* rt, TestMessPacked* testmesspacked_v) -{ - int status = AST_NOERR; - int i = 0; - long totalsize = 0; - - for(i=0;itest_int32_f.count;i++) { - totalsize += ast_write_size(rt,ast_int32,testmesspacked_v->test_int32_f.values[i]); - } - for(i=0;itest_sint32_f.count;i++) { - totalsize += ast_write_size(rt,ast_sint32,testmesspacked_v->test_sint32_f.values[i]); - } - for(i=0;itest_sfixed32_f.count;i++) { - totalsize += ast_write_size(rt,ast_sfixed32,testmesspacked_v->test_sfixed32_f.values[i]); - } - for(i=0;itest_int64_f.count;i++) { - totalsize += ast_write_size(rt,ast_int64,testmesspacked_v->test_int64_f.values[i]); - } - for(i=0;itest_sint64_f.count;i++) { - totalsize += ast_write_size(rt,ast_sint64,testmesspacked_v->test_sint64_f.values[i]); - } - for(i=0;itest_sfixed64_f.count;i++) { - totalsize += ast_write_size(rt,ast_sfixed64,testmesspacked_v->test_sfixed64_f.values[i]); - } - for(i=0;itest_uint32_f.count;i++) { - totalsize += ast_write_size(rt,ast_uint32,testmesspacked_v->test_uint32_f.values[i]); - } - for(i=0;itest_fixed32_f.count;i++) { - totalsize += ast_write_size(rt,ast_fixed32,testmesspacked_v->test_fixed32_f.values[i]); - } - for(i=0;itest_uint64_f.count;i++) { - totalsize += ast_write_size(rt,ast_uint64,testmesspacked_v->test_uint64_f.values[i]); - } - for(i=0;itest_fixed64_f.count;i++) { - totalsize += ast_write_size(rt,ast_fixed64,testmesspacked_v->test_fixed64_f.values[i]); - } - for(i=0;itest_float_f.count;i++) { - totalsize += ast_write_size(rt,ast_float,testmesspacked_v->test_float_f.values[i]); - } - for(i=0;itest_double_f.count;i++) { - totalsize += ast_write_size(rt,ast_double,testmesspacked_v->test_double_f.values[i]); - } - for(i=0;itest_boolean_f.count;i++) { - totalsize += ast_write_size(rt,ast_bool,testmesspacked_v->test_boolean_f.values[i]); - } - for(i=0;itest_enum_small_f.count;i++) { - totalsize += TestEnumSmall_write_size(rt,14,&testmesspacked_v->test_enum_small_f); - } - for(i=0;itest_enum_f.count;i++) { - totalsize += TestEnum_write_size(rt,15,&testmesspacked_v->test_enum_f); - } - return status; - -} /*TestMessPacked_write_size*/ -int -TestMessOptional_write(ast_runtime* rt, TestMessOptional* testmessoptional_v) -{ - int status = AST_NOERR; - int i = 0; - - if(testmessoptional_v->test_int32_f.exists) { - status = ast_write(rt,ast_int32,1,&testmessoptional_v->test_int32_f.value); - if(!status) {goto done;} - } - if(testmessoptional_v->test_sint32_f.exists) { - status = ast_write(rt,ast_sint32,2,&testmessoptional_v->test_sint32_f.value); - if(!status) {goto done;} - } - if(testmessoptional_v->test_sfixed32_f.exists) { - status = ast_write(rt,ast_sfixed32,3,&testmessoptional_v->test_sfixed32_f.value); - if(!status) {goto done;} - } - if(testmessoptional_v->test_int64_f.exists) { - status = ast_write(rt,ast_int64,4,&testmessoptional_v->test_int64_f.value); - if(!status) {goto done;} - } - if(testmessoptional_v->test_sint64_f.exists) { - status = ast_write(rt,ast_sint64,5,&testmessoptional_v->test_sint64_f.value); - if(!status) {goto done;} - } - if(testmessoptional_v->test_sfixed64_f.exists) { - status = ast_write(rt,ast_sfixed64,6,&testmessoptional_v->test_sfixed64_f.value); - if(!status) {goto done;} - } - if(testmessoptional_v->test_uint32_f.exists) { - status = ast_write(rt,ast_uint32,7,&testmessoptional_v->test_uint32_f.value); - if(!status) {goto done;} - } - if(testmessoptional_v->test_fixed32_f.exists) { - status = ast_write(rt,ast_fixed32,8,&testmessoptional_v->test_fixed32_f.value); - if(!status) {goto done;} - } - if(testmessoptional_v->test_uint64_f.exists) { - status = ast_write(rt,ast_uint64,9,&testmessoptional_v->test_uint64_f.value); - if(!status) {goto done;} - } - if(testmessoptional_v->test_fixed64_f.exists) { - status = ast_write(rt,ast_fixed64,10,&testmessoptional_v->test_fixed64_f.value); - if(!status) {goto done;} - } - if(testmessoptional_v->test_float_f.exists) { - status = ast_write(rt,ast_float,11,&testmessoptional_v->test_float_f.value); - if(!status) {goto done;} - } - if(testmessoptional_v->test_double_f.exists) { - status = ast_write(rt,ast_double,12,&testmessoptional_v->test_double_f.value); - if(!status) {goto done;} - } - if(testmessoptional_v->test_boolean_f.exists) { - status = ast_write(rt,ast_bool,13,&testmessoptional_v->test_boolean_f.value); - if(!status) {goto done;} - } - if(testmessoptional_v->test_enum_small_f.exists) { - status = TestEnumSmall_write(rt,testmessoptional_v->test_enum_small_f.value); - if(!status) {goto done;} - } - if(testmessoptional_v->test_enum_f.exists) { - status = TestEnum_write(rt,testmessoptional_v->test_enum_f.value); - if(!status) {goto done;} - } - if(testmessoptional_v->test_string_f.exists) { - status = ast_write(rt,ast_string,16,&testmessoptional_v->test_string_f.value); - if(!status) {goto done;} - } - if(testmessoptional_v->test_bytes_f.exists) { - status = ast_write(rt,ast_bytes,17,&testmessoptional_v->test_bytes_f.value); - if(!status) {goto done;} - } - if(testmessoptional_v->test_message_f.exists) { - status = SubMess_write(rt,testmessoptional_v->test_message_f.value); - if(!status) {goto done;} - } - -done: - return status; - -} /*TestMessOptional_write*/ - -int -TestMessOptional_read(ast_runtime* rt, TestMessOptional** testmessoptional_vp) -{ - int status = AST_NOERR; - uint32_t wiretype, fieldno; - int i = 0; - size_t count; - TestMessOptional* testmessoptional_v; - - testmessoptional_v = (TestMessOptional*)ast_alloc(sizeof(TestMessOptional)); - if(testmessoptional_v == NULL) return AST_ENOMEM; - - while(status == AST_NOERR) - ast_read_tag(rt,&wiretype,&fieldno) - switch (fieldno) { - case 1: { - testmessoptional_v->test_int32_f.exists = 1; - testmessoptional_v->test_int32_f.value = 0; - status = ast_read(rt,ast_int32,&testmessoptional_v->test_int32_f.value); - } break; - case 2: { - testmessoptional_v->test_sint32_f.exists = 1; - testmessoptional_v->test_sint32_f.value = 0; - status = ast_read(rt,ast_sint32,&testmessoptional_v->test_sint32_f.value); - } break; - case 3: { - testmessoptional_v->test_sfixed32_f.exists = 1; - testmessoptional_v->test_sfixed32_f.value = 0; - status = ast_read(rt,ast_sfixed32,&testmessoptional_v->test_sfixed32_f.value); - } break; - case 4: { - testmessoptional_v->test_int64_f.exists = 1; - testmessoptional_v->test_int64_f.value = 0; - status = ast_read(rt,ast_int64,&testmessoptional_v->test_int64_f.value); - } break; - case 5: { - testmessoptional_v->test_sint64_f.exists = 1; - testmessoptional_v->test_sint64_f.value = 0; - status = ast_read(rt,ast_sint64,&testmessoptional_v->test_sint64_f.value); - } break; - case 6: { - testmessoptional_v->test_sfixed64_f.exists = 1; - testmessoptional_v->test_sfixed64_f.value = 0; - status = ast_read(rt,ast_sfixed64,&testmessoptional_v->test_sfixed64_f.value); - } break; - case 7: { - testmessoptional_v->test_uint32_f.exists = 1; - testmessoptional_v->test_uint32_f.value = 0; - status = ast_read(rt,ast_uint32,&testmessoptional_v->test_uint32_f.value); - } break; - case 8: { - testmessoptional_v->test_fixed32_f.exists = 1; - testmessoptional_v->test_fixed32_f.value = 0; - status = ast_read(rt,ast_fixed32,&testmessoptional_v->test_fixed32_f.value); - } break; - case 9: { - testmessoptional_v->test_uint64_f.exists = 1; - testmessoptional_v->test_uint64_f.value = 0; - status = ast_read(rt,ast_uint64,&testmessoptional_v->test_uint64_f.value); - } break; - case 10: { - testmessoptional_v->test_fixed64_f.exists = 1; - testmessoptional_v->test_fixed64_f.value = 0; - status = ast_read(rt,ast_fixed64,&testmessoptional_v->test_fixed64_f.value); - } break; - case 11: { - testmessoptional_v->test_float_f.exists = 1; - testmessoptional_v->test_float_f.value = 0; - status = ast_read(rt,ast_float,&testmessoptional_v->test_float_f.value); - } break; - case 12: { - testmessoptional_v->test_double_f.exists = 1; - testmessoptional_v->test_double_f.value = 0; - status = ast_read(rt,ast_double,&testmessoptional_v->test_double_f.value); - } break; - case 13: { - testmessoptional_v->test_boolean_f.exists = 1; - testmessoptional_v->test_boolean_f.value = 0; - status = ast_read(rt,ast_bool,&testmessoptional_v->test_boolean_f.value); - } break; - case 14: { - testmessoptional_v->test_enum_small_f.exists = 1; - testmessoptional_v->test_enum_small_f.value = NULL; - status = TestEnumSmall_read(rt,&testmessoptional_v->test_enum_small_f.value); - if(!status) {goto done;} - } break; - case 15: { - testmessoptional_v->test_enum_f.exists = 1; - testmessoptional_v->test_enum_f.value = NULL; - status = TestEnum_read(rt,&testmessoptional_v->test_enum_f.value); - if(!status) {goto done;} - } break; - case 16: { - testmessoptional_v->test_string_f.exists = 1; - testmessoptional_v->test_string_f.value = NULL; - status = ast_read(rt,ast_string,&testmessoptional_v->test_string_f.value); - } break; - case 17: { - testmessoptional_v->test_bytes_f.exists = 1; - testmessoptional_v->test_bytes_f.value.nbytes = 0; - testmessoptional_v->test_bytes_f.value.bytes = NULL; - status = ast_read(rt,ast_bytes,&testmessoptional_v->test_bytes_f.value); - } break; - case 18: { - testmessoptional_v->test_message_f.exists = 1; - testmessoptional_v->test_message_f.value = NULL; - status = SubMess_read(rt,&testmessoptional_v->test_message_f.value); - if(!status) {goto done;} - } break; - default: - status = ast_skip_field(rt,wiretype,fieldno); - }; /*switch*/ - };/*while*/ -if(testmessoptional_v->test_int32_f.exists) { - testmessoptional_v->test_int32_f.value = 0; -} -if(testmessoptional_v->test_sint32_f.exists) { - testmessoptional_v->test_sint32_f.value = 0; -} -if(testmessoptional_v->test_sfixed32_f.exists) { - testmessoptional_v->test_sfixed32_f.value = 0; -} -if(testmessoptional_v->test_int64_f.exists) { - testmessoptional_v->test_int64_f.value = 0; -} -if(testmessoptional_v->test_sint64_f.exists) { - testmessoptional_v->test_sint64_f.value = 0; -} -if(testmessoptional_v->test_sfixed64_f.exists) { - testmessoptional_v->test_sfixed64_f.value = 0; -} -if(testmessoptional_v->test_uint32_f.exists) { - testmessoptional_v->test_uint32_f.value = 0; -} -if(testmessoptional_v->test_fixed32_f.exists) { - testmessoptional_v->test_fixed32_f.value = 0; -} -if(testmessoptional_v->test_uint64_f.exists) { - testmessoptional_v->test_uint64_f.value = 0; -} -if(testmessoptional_v->test_fixed64_f.exists) { - testmessoptional_v->test_fixed64_f.value = 0; -} -if(testmessoptional_v->test_float_f.exists) { - testmessoptional_v->test_float_f.value = 0; -} -if(testmessoptional_v->test_double_f.exists) { - testmessoptional_v->test_double_f.value = 0; -} -if(testmessoptional_v->test_boolean_f.exists) { - testmessoptional_v->test_boolean_f.value = 0; -} -done: - return status; -} /*TestMessOptional_read*/ - -int -TestMessOptional_reclaim(ast_runtime* rt, TestMessOptional* testmessoptional_v) -{ - int status = AST_NOERR; - int i = 0; - - if(testmessoptional_v->test_string_f.exists) { - status = ast_reclaim(rt,ast_string,&testmessoptional_v->test_string_f.value); - if(!status) {goto done;} - } - if(testmessoptional_v->test_bytes_f.exists) { - status = ast_reclaim(rt,ast_bytes,&testmessoptional_v->test_bytes_f.value); - if(!status) {goto done;} - } - if(testmessoptional_v->test_message_f.exists) { - status = SubMess_reclaim(rt,testmessoptional_v->test_message_f.value); - if(!status) {goto done;} - } - -done: - return status; - -} /*TestMessOptional_reclaim*/ - -long -TestMessOptional_size(ast_runtime* rt, TestMessOptional* testmessoptional_v) -{ - int status = AST_NOERR; - int i = 0; - long totalsize = 0; - - if(testmessoptional_v->test_int32_f.exists) { - totalsize += ast_write_size(rt,ast_int32,&testmessoptional_v->test_int32_f.value); - } - if(testmessoptional_v->test_sint32_f.exists) { - totalsize += ast_write_size(rt,ast_sint32,&testmessoptional_v->test_sint32_f.value); - } - if(testmessoptional_v->test_sfixed32_f.exists) { - totalsize += ast_write_size(rt,ast_sfixed32,&testmessoptional_v->test_sfixed32_f.value); - } - if(testmessoptional_v->test_int64_f.exists) { - totalsize += ast_write_size(rt,ast_int64,&testmessoptional_v->test_int64_f.value); - } - if(testmessoptional_v->test_sint64_f.exists) { - totalsize += ast_write_size(rt,ast_sint64,&testmessoptional_v->test_sint64_f.value); - } - if(testmessoptional_v->test_sfixed64_f.exists) { - totalsize += ast_write_size(rt,ast_sfixed64,&testmessoptional_v->test_sfixed64_f.value); - } - if(testmessoptional_v->test_uint32_f.exists) { - totalsize += ast_write_size(rt,ast_uint32,&testmessoptional_v->test_uint32_f.value); - } - if(testmessoptional_v->test_fixed32_f.exists) { - totalsize += ast_write_size(rt,ast_fixed32,&testmessoptional_v->test_fixed32_f.value); - } - if(testmessoptional_v->test_uint64_f.exists) { - totalsize += ast_write_size(rt,ast_uint64,&testmessoptional_v->test_uint64_f.value); - } - if(testmessoptional_v->test_fixed64_f.exists) { - totalsize += ast_write_size(rt,ast_fixed64,&testmessoptional_v->test_fixed64_f.value); - } - if(testmessoptional_v->test_float_f.exists) { - totalsize += ast_write_size(rt,ast_float,&testmessoptional_v->test_float_f.value); - } - if(testmessoptional_v->test_double_f.exists) { - totalsize += ast_write_size(rt,ast_double,&testmessoptional_v->test_double_f.value); - } - if(testmessoptional_v->test_boolean_f.exists) { - totalsize += ast_write_size(rt,ast_bool,&testmessoptional_v->test_boolean_f.value); - } - if(testmessoptional_v->test_enum_small_f.exists) { - totalsize += TestEnumSmall_write_size(rt,14,testmessoptional_v->test_enum_small_f); - } - if(testmessoptional_v->test_enum_f.exists) { - totalsize += TestEnum_write_size(rt,15,testmessoptional_v->test_enum_f); - } - if(testmessoptional_v->test_string_f.exists) { - totalsize += ast_write_size(rt,ast_string,&testmessoptional_v->test_string_f.value); - } - if(testmessoptional_v->test_bytes_f.exists) { - totalsize += ast_write_size(rt,ast_bytes,&testmessoptional_v->test_bytes_f.value); - } - if(testmessoptional_v->test_message_f.exists) { - totalsize += SubMess_write_size(rt,18,testmessoptional_v->test_message_f); - } - return status; - -} /*TestMessOptional_write_size*/ -int -TestMessRequiredInt32_write(ast_runtime* rt, TestMessRequiredInt32* testmessrequiredint32_v) -{ - int status = AST_NOERR; - int i = 0; - - status = ast_write(rt,ast_int32,42,&testmessrequiredint32_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*TestMessRequiredInt32_write*/ - -int -TestMessRequiredInt32_read(ast_runtime* rt, TestMessRequiredInt32** testmessrequiredint32_vp) -{ - int status = AST_NOERR; - uint32_t wiretype, fieldno; - TestMessRequiredInt32* testmessrequiredint32_v; - - testmessrequiredint32_v = (TestMessRequiredInt32*)ast_alloc(sizeof(TestMessRequiredInt32)); - if(testmessrequiredint32_v == NULL) return AST_ENOMEM; - - while(status == AST_NOERR) - ast_read_tag(rt,&wiretype,&fieldno) - switch (fieldno) { - case 42: { - status = ast_read(rt,ast_int32,&testmessrequiredint32_v->test_f); - } break; - default: - status = ast_skip_field(rt,wiretype,fieldno); - }; /*switch*/ - };/*while*/ -if(testmessrequiredint32_v->test_f.exists) { - testmessrequiredint32_v->test_f.value = 0; -} -done: - return status; -} /*TestMessRequiredInt32_read*/ - -int -TestMessRequiredInt32_reclaim(ast_runtime* rt, TestMessRequiredInt32* testmessrequiredint32_v) -{ - int status = AST_NOERR; - int i = 0; - - -done: - return status; - -} /*TestMessRequiredInt32_reclaim*/ - -long -TestMessRequiredInt32_size(ast_runtime* rt, TestMessRequiredInt32* testmessrequiredint32_v) -{ - int status = AST_NOERR; - int i = 0; - long totalsize = 0; - - totalsize += ast_write_size(rt,ast_int32,&testmessrequiredint32_v->test_f); - return status; - -} /*TestMessRequiredInt32_write_size*/ -int -TestMessRequiredSInt32_write(ast_runtime* rt, TestMessRequiredSInt32* testmessrequiredsint32_v) -{ - int status = AST_NOERR; - int i = 0; - - status = ast_write(rt,ast_sint32,43,&testmessrequiredsint32_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*TestMessRequiredSInt32_write*/ - -int -TestMessRequiredSInt32_read(ast_runtime* rt, TestMessRequiredSInt32** testmessrequiredsint32_vp) -{ - int status = AST_NOERR; - uint32_t wiretype, fieldno; - TestMessRequiredSInt32* testmessrequiredsint32_v; - - testmessrequiredsint32_v = (TestMessRequiredSInt32*)ast_alloc(sizeof(TestMessRequiredSInt32)); - if(testmessrequiredsint32_v == NULL) return AST_ENOMEM; - - while(status == AST_NOERR) - ast_read_tag(rt,&wiretype,&fieldno) - switch (fieldno) { - case 43: { - status = ast_read(rt,ast_sint32,&testmessrequiredsint32_v->test_f); - } break; - default: - status = ast_skip_field(rt,wiretype,fieldno); - }; /*switch*/ - };/*while*/ -if(testmessrequiredsint32_v->test_f.exists) { - testmessrequiredsint32_v->test_f.value = 0; -} -done: - return status; -} /*TestMessRequiredSInt32_read*/ - -int -TestMessRequiredSInt32_reclaim(ast_runtime* rt, TestMessRequiredSInt32* testmessrequiredsint32_v) -{ - int status = AST_NOERR; - int i = 0; - - -done: - return status; - -} /*TestMessRequiredSInt32_reclaim*/ - -long -TestMessRequiredSInt32_size(ast_runtime* rt, TestMessRequiredSInt32* testmessrequiredsint32_v) -{ - int status = AST_NOERR; - int i = 0; - long totalsize = 0; - - totalsize += ast_write_size(rt,ast_sint32,&testmessrequiredsint32_v->test_f); - return status; - -} /*TestMessRequiredSInt32_write_size*/ -int -TestMessRequiredSFixed32_write(ast_runtime* rt, TestMessRequiredSFixed32* testmessrequiredsfixed32_v) -{ - int status = AST_NOERR; - int i = 0; - - status = ast_write(rt,ast_sfixed32,100,&testmessrequiredsfixed32_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*TestMessRequiredSFixed32_write*/ - -int -TestMessRequiredSFixed32_read(ast_runtime* rt, TestMessRequiredSFixed32** testmessrequiredsfixed32_vp) -{ - int status = AST_NOERR; - uint32_t wiretype, fieldno; - TestMessRequiredSFixed32* testmessrequiredsfixed32_v; - - testmessrequiredsfixed32_v = (TestMessRequiredSFixed32*)ast_alloc(sizeof(TestMessRequiredSFixed32)); - if(testmessrequiredsfixed32_v == NULL) return AST_ENOMEM; - - while(status == AST_NOERR) - ast_read_tag(rt,&wiretype,&fieldno) - switch (fieldno) { - case 100: { - status = ast_read(rt,ast_sfixed32,&testmessrequiredsfixed32_v->test_f); - } break; - default: - status = ast_skip_field(rt,wiretype,fieldno); - }; /*switch*/ - };/*while*/ -if(testmessrequiredsfixed32_v->test_f.exists) { - testmessrequiredsfixed32_v->test_f.value = 0; -} -done: - return status; -} /*TestMessRequiredSFixed32_read*/ - -int -TestMessRequiredSFixed32_reclaim(ast_runtime* rt, TestMessRequiredSFixed32* testmessrequiredsfixed32_v) -{ - int status = AST_NOERR; - int i = 0; - - -done: - return status; - -} /*TestMessRequiredSFixed32_reclaim*/ - -long -TestMessRequiredSFixed32_size(ast_runtime* rt, TestMessRequiredSFixed32* testmessrequiredsfixed32_v) -{ - int status = AST_NOERR; - int i = 0; - long totalsize = 0; - - totalsize += ast_write_size(rt,ast_sfixed32,&testmessrequiredsfixed32_v->test_f); - return status; - -} /*TestMessRequiredSFixed32_write_size*/ -int -TestMessRequiredInt64_write(ast_runtime* rt, TestMessRequiredInt64* testmessrequiredint64_v) -{ - int status = AST_NOERR; - int i = 0; - - status = ast_write(rt,ast_int64,1,&testmessrequiredint64_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*TestMessRequiredInt64_write*/ - -int -TestMessRequiredInt64_read(ast_runtime* rt, TestMessRequiredInt64** testmessrequiredint64_vp) -{ - int status = AST_NOERR; - uint32_t wiretype, fieldno; - TestMessRequiredInt64* testmessrequiredint64_v; - - testmessrequiredint64_v = (TestMessRequiredInt64*)ast_alloc(sizeof(TestMessRequiredInt64)); - if(testmessrequiredint64_v == NULL) return AST_ENOMEM; - - while(status == AST_NOERR) - ast_read_tag(rt,&wiretype,&fieldno) - switch (fieldno) { - case 1: { - status = ast_read(rt,ast_int64,&testmessrequiredint64_v->test_f); - } break; - default: - status = ast_skip_field(rt,wiretype,fieldno); - }; /*switch*/ - };/*while*/ -if(testmessrequiredint64_v->test_f.exists) { - testmessrequiredint64_v->test_f.value = 0; -} -done: - return status; -} /*TestMessRequiredInt64_read*/ - -int -TestMessRequiredInt64_reclaim(ast_runtime* rt, TestMessRequiredInt64* testmessrequiredint64_v) -{ - int status = AST_NOERR; - int i = 0; - - -done: - return status; - -} /*TestMessRequiredInt64_reclaim*/ - -long -TestMessRequiredInt64_size(ast_runtime* rt, TestMessRequiredInt64* testmessrequiredint64_v) -{ - int status = AST_NOERR; - int i = 0; - long totalsize = 0; - - totalsize += ast_write_size(rt,ast_int64,&testmessrequiredint64_v->test_f); - return status; - -} /*TestMessRequiredInt64_write_size*/ -int -TestMessRequiredSInt64_write(ast_runtime* rt, TestMessRequiredSInt64* testmessrequiredsint64_v) -{ - int status = AST_NOERR; - int i = 0; - - status = ast_write(rt,ast_sint64,11,&testmessrequiredsint64_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*TestMessRequiredSInt64_write*/ - -int -TestMessRequiredSInt64_read(ast_runtime* rt, TestMessRequiredSInt64** testmessrequiredsint64_vp) -{ - int status = AST_NOERR; - uint32_t wiretype, fieldno; - TestMessRequiredSInt64* testmessrequiredsint64_v; - - testmessrequiredsint64_v = (TestMessRequiredSInt64*)ast_alloc(sizeof(TestMessRequiredSInt64)); - if(testmessrequiredsint64_v == NULL) return AST_ENOMEM; - - while(status == AST_NOERR) - ast_read_tag(rt,&wiretype,&fieldno) - switch (fieldno) { - case 11: { - status = ast_read(rt,ast_sint64,&testmessrequiredsint64_v->test_f); - } break; - default: - status = ast_skip_field(rt,wiretype,fieldno); - }; /*switch*/ - };/*while*/ -if(testmessrequiredsint64_v->test_f.exists) { - testmessrequiredsint64_v->test_f.value = 0; -} -done: - return status; -} /*TestMessRequiredSInt64_read*/ - -int -TestMessRequiredSInt64_reclaim(ast_runtime* rt, TestMessRequiredSInt64* testmessrequiredsint64_v) -{ - int status = AST_NOERR; - int i = 0; - - -done: - return status; - -} /*TestMessRequiredSInt64_reclaim*/ - -long -TestMessRequiredSInt64_size(ast_runtime* rt, TestMessRequiredSInt64* testmessrequiredsint64_v) -{ - int status = AST_NOERR; - int i = 0; - long totalsize = 0; - - totalsize += ast_write_size(rt,ast_sint64,&testmessrequiredsint64_v->test_f); - return status; - -} /*TestMessRequiredSInt64_write_size*/ -int -TestMessRequiredSFixed64_write(ast_runtime* rt, TestMessRequiredSFixed64* testmessrequiredsfixed64_v) -{ - int status = AST_NOERR; - int i = 0; - - status = ast_write(rt,ast_sfixed64,12,&testmessrequiredsfixed64_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*TestMessRequiredSFixed64_write*/ - -int -TestMessRequiredSFixed64_read(ast_runtime* rt, TestMessRequiredSFixed64** testmessrequiredsfixed64_vp) -{ - int status = AST_NOERR; - uint32_t wiretype, fieldno; - TestMessRequiredSFixed64* testmessrequiredsfixed64_v; - - testmessrequiredsfixed64_v = (TestMessRequiredSFixed64*)ast_alloc(sizeof(TestMessRequiredSFixed64)); - if(testmessrequiredsfixed64_v == NULL) return AST_ENOMEM; - - while(status == AST_NOERR) - ast_read_tag(rt,&wiretype,&fieldno) - switch (fieldno) { - case 12: { - status = ast_read(rt,ast_sfixed64,&testmessrequiredsfixed64_v->test_f); - } break; - default: - status = ast_skip_field(rt,wiretype,fieldno); - }; /*switch*/ - };/*while*/ -if(testmessrequiredsfixed64_v->test_f.exists) { - testmessrequiredsfixed64_v->test_f.value = 0; -} -done: - return status; -} /*TestMessRequiredSFixed64_read*/ - -int -TestMessRequiredSFixed64_reclaim(ast_runtime* rt, TestMessRequiredSFixed64* testmessrequiredsfixed64_v) -{ - int status = AST_NOERR; - int i = 0; - - -done: - return status; - -} /*TestMessRequiredSFixed64_reclaim*/ - -long -TestMessRequiredSFixed64_size(ast_runtime* rt, TestMessRequiredSFixed64* testmessrequiredsfixed64_v) -{ - int status = AST_NOERR; - int i = 0; - long totalsize = 0; - - totalsize += ast_write_size(rt,ast_sfixed64,&testmessrequiredsfixed64_v->test_f); - return status; - -} /*TestMessRequiredSFixed64_write_size*/ -int -TestMessRequiredUInt32_write(ast_runtime* rt, TestMessRequiredUInt32* testmessrequireduint32_v) -{ - int status = AST_NOERR; - int i = 0; - - status = ast_write(rt,ast_uint32,1,&testmessrequireduint32_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*TestMessRequiredUInt32_write*/ - -int -TestMessRequiredUInt32_read(ast_runtime* rt, TestMessRequiredUInt32** testmessrequireduint32_vp) -{ - int status = AST_NOERR; - uint32_t wiretype, fieldno; - TestMessRequiredUInt32* testmessrequireduint32_v; - - testmessrequireduint32_v = (TestMessRequiredUInt32*)ast_alloc(sizeof(TestMessRequiredUInt32)); - if(testmessrequireduint32_v == NULL) return AST_ENOMEM; - - while(status == AST_NOERR) - ast_read_tag(rt,&wiretype,&fieldno) - switch (fieldno) { - case 1: { - status = ast_read(rt,ast_uint32,&testmessrequireduint32_v->test_f); - } break; - default: - status = ast_skip_field(rt,wiretype,fieldno); - }; /*switch*/ - };/*while*/ -if(testmessrequireduint32_v->test_f.exists) { - testmessrequireduint32_v->test_f.value = 0; -} -done: - return status; -} /*TestMessRequiredUInt32_read*/ - -int -TestMessRequiredUInt32_reclaim(ast_runtime* rt, TestMessRequiredUInt32* testmessrequireduint32_v) -{ - int status = AST_NOERR; - int i = 0; - - -done: - return status; - -} /*TestMessRequiredUInt32_reclaim*/ - -long -TestMessRequiredUInt32_size(ast_runtime* rt, TestMessRequiredUInt32* testmessrequireduint32_v) -{ - int status = AST_NOERR; - int i = 0; - long totalsize = 0; - - totalsize += ast_write_size(rt,ast_uint32,&testmessrequireduint32_v->test_f); - return status; - -} /*TestMessRequiredUInt32_write_size*/ -int -TestMessRequiredFixed32_write(ast_runtime* rt, TestMessRequiredFixed32* testmessrequiredfixed32_v) -{ - int status = AST_NOERR; - int i = 0; - - status = ast_write(rt,ast_fixed32,1,&testmessrequiredfixed32_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*TestMessRequiredFixed32_write*/ - -int -TestMessRequiredFixed32_read(ast_runtime* rt, TestMessRequiredFixed32** testmessrequiredfixed32_vp) -{ - int status = AST_NOERR; - uint32_t wiretype, fieldno; - TestMessRequiredFixed32* testmessrequiredfixed32_v; - - testmessrequiredfixed32_v = (TestMessRequiredFixed32*)ast_alloc(sizeof(TestMessRequiredFixed32)); - if(testmessrequiredfixed32_v == NULL) return AST_ENOMEM; - - while(status == AST_NOERR) - ast_read_tag(rt,&wiretype,&fieldno) - switch (fieldno) { - case 1: { - status = ast_read(rt,ast_fixed32,&testmessrequiredfixed32_v->test_f); - } break; - default: - status = ast_skip_field(rt,wiretype,fieldno); - }; /*switch*/ - };/*while*/ -if(testmessrequiredfixed32_v->test_f.exists) { - testmessrequiredfixed32_v->test_f.value = 0; -} -done: - return status; -} /*TestMessRequiredFixed32_read*/ - -int -TestMessRequiredFixed32_reclaim(ast_runtime* rt, TestMessRequiredFixed32* testmessrequiredfixed32_v) -{ - int status = AST_NOERR; - int i = 0; - - -done: - return status; - -} /*TestMessRequiredFixed32_reclaim*/ - -long -TestMessRequiredFixed32_size(ast_runtime* rt, TestMessRequiredFixed32* testmessrequiredfixed32_v) -{ - int status = AST_NOERR; - int i = 0; - long totalsize = 0; - - totalsize += ast_write_size(rt,ast_fixed32,&testmessrequiredfixed32_v->test_f); - return status; - -} /*TestMessRequiredFixed32_write_size*/ -int -TestMessRequiredUInt64_write(ast_runtime* rt, TestMessRequiredUInt64* testmessrequireduint64_v) -{ - int status = AST_NOERR; - int i = 0; - - status = ast_write(rt,ast_uint64,1,&testmessrequireduint64_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*TestMessRequiredUInt64_write*/ - -int -TestMessRequiredUInt64_read(ast_runtime* rt, TestMessRequiredUInt64** testmessrequireduint64_vp) -{ - int status = AST_NOERR; - uint32_t wiretype, fieldno; - TestMessRequiredUInt64* testmessrequireduint64_v; - - testmessrequireduint64_v = (TestMessRequiredUInt64*)ast_alloc(sizeof(TestMessRequiredUInt64)); - if(testmessrequireduint64_v == NULL) return AST_ENOMEM; - - while(status == AST_NOERR) - ast_read_tag(rt,&wiretype,&fieldno) - switch (fieldno) { - case 1: { - status = ast_read(rt,ast_uint64,&testmessrequireduint64_v->test_f); - } break; - default: - status = ast_skip_field(rt,wiretype,fieldno); - }; /*switch*/ - };/*while*/ -if(testmessrequireduint64_v->test_f.exists) { - testmessrequireduint64_v->test_f.value = 0; -} -done: - return status; -} /*TestMessRequiredUInt64_read*/ - -int -TestMessRequiredUInt64_reclaim(ast_runtime* rt, TestMessRequiredUInt64* testmessrequireduint64_v) -{ - int status = AST_NOERR; - int i = 0; - - -done: - return status; - -} /*TestMessRequiredUInt64_reclaim*/ - -long -TestMessRequiredUInt64_size(ast_runtime* rt, TestMessRequiredUInt64* testmessrequireduint64_v) -{ - int status = AST_NOERR; - int i = 0; - long totalsize = 0; - - totalsize += ast_write_size(rt,ast_uint64,&testmessrequireduint64_v->test_f); - return status; - -} /*TestMessRequiredUInt64_write_size*/ -int -TestMessRequiredFixed64_write(ast_runtime* rt, TestMessRequiredFixed64* testmessrequiredfixed64_v) -{ - int status = AST_NOERR; - int i = 0; - - status = ast_write(rt,ast_fixed64,1,&testmessrequiredfixed64_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*TestMessRequiredFixed64_write*/ - -int -TestMessRequiredFixed64_read(ast_runtime* rt, TestMessRequiredFixed64** testmessrequiredfixed64_vp) -{ - int status = AST_NOERR; - uint32_t wiretype, fieldno; - TestMessRequiredFixed64* testmessrequiredfixed64_v; - - testmessrequiredfixed64_v = (TestMessRequiredFixed64*)ast_alloc(sizeof(TestMessRequiredFixed64)); - if(testmessrequiredfixed64_v == NULL) return AST_ENOMEM; - - while(status == AST_NOERR) - ast_read_tag(rt,&wiretype,&fieldno) - switch (fieldno) { - case 1: { - status = ast_read(rt,ast_fixed64,&testmessrequiredfixed64_v->test_f); - } break; - default: - status = ast_skip_field(rt,wiretype,fieldno); - }; /*switch*/ - };/*while*/ -if(testmessrequiredfixed64_v->test_f.exists) { - testmessrequiredfixed64_v->test_f.value = 0; -} -done: - return status; -} /*TestMessRequiredFixed64_read*/ - -int -TestMessRequiredFixed64_reclaim(ast_runtime* rt, TestMessRequiredFixed64* testmessrequiredfixed64_v) -{ - int status = AST_NOERR; - int i = 0; - - -done: - return status; - -} /*TestMessRequiredFixed64_reclaim*/ - -long -TestMessRequiredFixed64_size(ast_runtime* rt, TestMessRequiredFixed64* testmessrequiredfixed64_v) -{ - int status = AST_NOERR; - int i = 0; - long totalsize = 0; - - totalsize += ast_write_size(rt,ast_fixed64,&testmessrequiredfixed64_v->test_f); - return status; - -} /*TestMessRequiredFixed64_write_size*/ -int -TestMessRequiredFloat_write(ast_runtime* rt, TestMessRequiredFloat* testmessrequiredfloat_v) -{ - int status = AST_NOERR; - int i = 0; - - status = ast_write(rt,ast_float,1,&testmessrequiredfloat_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*TestMessRequiredFloat_write*/ - -int -TestMessRequiredFloat_read(ast_runtime* rt, TestMessRequiredFloat** testmessrequiredfloat_vp) -{ - int status = AST_NOERR; - uint32_t wiretype, fieldno; - TestMessRequiredFloat* testmessrequiredfloat_v; - - testmessrequiredfloat_v = (TestMessRequiredFloat*)ast_alloc(sizeof(TestMessRequiredFloat)); - if(testmessrequiredfloat_v == NULL) return AST_ENOMEM; - - while(status == AST_NOERR) - ast_read_tag(rt,&wiretype,&fieldno) - switch (fieldno) { - case 1: { - status = ast_read(rt,ast_float,&testmessrequiredfloat_v->test_f); - } break; - default: - status = ast_skip_field(rt,wiretype,fieldno); - }; /*switch*/ - };/*while*/ -if(testmessrequiredfloat_v->test_f.exists) { - testmessrequiredfloat_v->test_f.value = 0; -} -done: - return status; -} /*TestMessRequiredFloat_read*/ - -int -TestMessRequiredFloat_reclaim(ast_runtime* rt, TestMessRequiredFloat* testmessrequiredfloat_v) -{ - int status = AST_NOERR; - int i = 0; - - -done: - return status; - -} /*TestMessRequiredFloat_reclaim*/ - -long -TestMessRequiredFloat_size(ast_runtime* rt, TestMessRequiredFloat* testmessrequiredfloat_v) -{ - int status = AST_NOERR; - int i = 0; - long totalsize = 0; - - totalsize += ast_write_size(rt,ast_float,&testmessrequiredfloat_v->test_f); - return status; - -} /*TestMessRequiredFloat_write_size*/ -int -TestMessRequiredDouble_write(ast_runtime* rt, TestMessRequiredDouble* testmessrequireddouble_v) -{ - int status = AST_NOERR; - int i = 0; - - status = ast_write(rt,ast_double,1,&testmessrequireddouble_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*TestMessRequiredDouble_write*/ - -int -TestMessRequiredDouble_read(ast_runtime* rt, TestMessRequiredDouble** testmessrequireddouble_vp) -{ - int status = AST_NOERR; - uint32_t wiretype, fieldno; - TestMessRequiredDouble* testmessrequireddouble_v; - - testmessrequireddouble_v = (TestMessRequiredDouble*)ast_alloc(sizeof(TestMessRequiredDouble)); - if(testmessrequireddouble_v == NULL) return AST_ENOMEM; - - while(status == AST_NOERR) - ast_read_tag(rt,&wiretype,&fieldno) - switch (fieldno) { - case 1: { - status = ast_read(rt,ast_double,&testmessrequireddouble_v->test_f); - } break; - default: - status = ast_skip_field(rt,wiretype,fieldno); - }; /*switch*/ - };/*while*/ -if(testmessrequireddouble_v->test_f.exists) { - testmessrequireddouble_v->test_f.value = 0; -} -done: - return status; -} /*TestMessRequiredDouble_read*/ - -int -TestMessRequiredDouble_reclaim(ast_runtime* rt, TestMessRequiredDouble* testmessrequireddouble_v) -{ - int status = AST_NOERR; - int i = 0; - - -done: - return status; - -} /*TestMessRequiredDouble_reclaim*/ - -long -TestMessRequiredDouble_size(ast_runtime* rt, TestMessRequiredDouble* testmessrequireddouble_v) -{ - int status = AST_NOERR; - int i = 0; - long totalsize = 0; - - totalsize += ast_write_size(rt,ast_double,&testmessrequireddouble_v->test_f); - return status; - -} /*TestMessRequiredDouble_write_size*/ -int -TestMessRequiredBool_write(ast_runtime* rt, TestMessRequiredBool* testmessrequiredbool_v) -{ - int status = AST_NOERR; - int i = 0; - - status = ast_write(rt,ast_bool,1,&testmessrequiredbool_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*TestMessRequiredBool_write*/ - -int -TestMessRequiredBool_read(ast_runtime* rt, TestMessRequiredBool** testmessrequiredbool_vp) -{ - int status = AST_NOERR; - uint32_t wiretype, fieldno; - TestMessRequiredBool* testmessrequiredbool_v; - - testmessrequiredbool_v = (TestMessRequiredBool*)ast_alloc(sizeof(TestMessRequiredBool)); - if(testmessrequiredbool_v == NULL) return AST_ENOMEM; - - while(status == AST_NOERR) - ast_read_tag(rt,&wiretype,&fieldno) - switch (fieldno) { - case 1: { - status = ast_read(rt,ast_bool,&testmessrequiredbool_v->test_f); - } break; - default: - status = ast_skip_field(rt,wiretype,fieldno); - }; /*switch*/ - };/*while*/ -if(testmessrequiredbool_v->test_f.exists) { - testmessrequiredbool_v->test_f.value = 0; -} -done: - return status; -} /*TestMessRequiredBool_read*/ - -int -TestMessRequiredBool_reclaim(ast_runtime* rt, TestMessRequiredBool* testmessrequiredbool_v) -{ - int status = AST_NOERR; - int i = 0; - - -done: - return status; - -} /*TestMessRequiredBool_reclaim*/ - -long -TestMessRequiredBool_size(ast_runtime* rt, TestMessRequiredBool* testmessrequiredbool_v) -{ - int status = AST_NOERR; - int i = 0; - long totalsize = 0; - - totalsize += ast_write_size(rt,ast_bool,&testmessrequiredbool_v->test_f); - return status; - -} /*TestMessRequiredBool_write_size*/ -int -TestMessRequiredEnum_write(ast_runtime* rt, TestMessRequiredEnum* testmessrequiredenum_v) -{ - int status = AST_NOERR; - int i = 0; - - status = TestEnum_write(rt,testmessrequiredenum_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*TestMessRequiredEnum_write*/ - -int -TestMessRequiredEnum_read(ast_runtime* rt, TestMessRequiredEnum** testmessrequiredenum_vp) -{ - int status = AST_NOERR; - uint32_t wiretype, fieldno; - TestMessRequiredEnum* testmessrequiredenum_v; - - testmessrequiredenum_v = (TestMessRequiredEnum*)ast_alloc(sizeof(TestMessRequiredEnum)); - if(testmessrequiredenum_v == NULL) return AST_ENOMEM; - - while(status == AST_NOERR) - ast_read_tag(rt,&wiretype,&fieldno) - switch (fieldno) { - case 1: { - status = TestEnum_read(rt,&testmessrequiredenum_v->test_f); - if(!status) {goto done;} - } break; - default: - status = ast_skip_field(rt,wiretype,fieldno); - }; /*switch*/ - };/*while*/ -done: - return status; -} /*TestMessRequiredEnum_read*/ - -int -TestMessRequiredEnum_reclaim(ast_runtime* rt, TestMessRequiredEnum* testmessrequiredenum_v) -{ - int status = AST_NOERR; - int i = 0; - - -done: - return status; - -} /*TestMessRequiredEnum_reclaim*/ - -long -TestMessRequiredEnum_size(ast_runtime* rt, TestMessRequiredEnum* testmessrequiredenum_v) -{ - int status = AST_NOERR; - int i = 0; - long totalsize = 0; - - totalsize += TestEnum_write_size(rt,1,testmessrequiredenum_v->test_f); - return status; - -} /*TestMessRequiredEnum_write_size*/ -int -TestMessRequiredEnumSmall_write(ast_runtime* rt, TestMessRequiredEnumSmall* testmessrequiredenumsmall_v) -{ - int status = AST_NOERR; - int i = 0; - - status = TestEnumSmall_write(rt,testmessrequiredenumsmall_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*TestMessRequiredEnumSmall_write*/ - -int -TestMessRequiredEnumSmall_read(ast_runtime* rt, TestMessRequiredEnumSmall** testmessrequiredenumsmall_vp) -{ - int status = AST_NOERR; - uint32_t wiretype, fieldno; - TestMessRequiredEnumSmall* testmessrequiredenumsmall_v; - - testmessrequiredenumsmall_v = (TestMessRequiredEnumSmall*)ast_alloc(sizeof(TestMessRequiredEnumSmall)); - if(testmessrequiredenumsmall_v == NULL) return AST_ENOMEM; - - while(status == AST_NOERR) - ast_read_tag(rt,&wiretype,&fieldno) - switch (fieldno) { - case 1: { - status = TestEnumSmall_read(rt,&testmessrequiredenumsmall_v->test_f); - if(!status) {goto done;} - } break; - default: - status = ast_skip_field(rt,wiretype,fieldno); - }; /*switch*/ - };/*while*/ -done: - return status; -} /*TestMessRequiredEnumSmall_read*/ - -int -TestMessRequiredEnumSmall_reclaim(ast_runtime* rt, TestMessRequiredEnumSmall* testmessrequiredenumsmall_v) -{ - int status = AST_NOERR; - int i = 0; - - -done: - return status; - -} /*TestMessRequiredEnumSmall_reclaim*/ - -long -TestMessRequiredEnumSmall_size(ast_runtime* rt, TestMessRequiredEnumSmall* testmessrequiredenumsmall_v) -{ - int status = AST_NOERR; - int i = 0; - long totalsize = 0; - - totalsize += TestEnumSmall_write_size(rt,1,testmessrequiredenumsmall_v->test_f); - return status; - -} /*TestMessRequiredEnumSmall_write_size*/ -int -TestMessRequiredString_write(ast_runtime* rt, TestMessRequiredString* testmessrequiredstring_v) -{ - int status = AST_NOERR; - int i = 0; - - status = ast_write(rt,ast_string,1,&testmessrequiredstring_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*TestMessRequiredString_write*/ - -int -TestMessRequiredString_read(ast_runtime* rt, TestMessRequiredString** testmessrequiredstring_vp) -{ - int status = AST_NOERR; - uint32_t wiretype, fieldno; - size_t count; - TestMessRequiredString* testmessrequiredstring_v; - - testmessrequiredstring_v = (TestMessRequiredString*)ast_alloc(sizeof(TestMessRequiredString)); - if(testmessrequiredstring_v == NULL) return AST_ENOMEM; - - while(status == AST_NOERR) - ast_read_tag(rt,&wiretype,&fieldno) - switch (fieldno) { - case 1: { - status = ast_read(rt,ast_string,&testmessrequiredstring_v->test_f); - } break; - default: - status = ast_skip_field(rt,wiretype,fieldno); - }; /*switch*/ - };/*while*/ -done: - return status; -} /*TestMessRequiredString_read*/ - -int -TestMessRequiredString_reclaim(ast_runtime* rt, TestMessRequiredString* testmessrequiredstring_v) -{ - int status = AST_NOERR; - int i = 0; - - status = ast_reclaim(rt,ast_string,&testmessrequiredstring_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*TestMessRequiredString_reclaim*/ - -long -TestMessRequiredString_size(ast_runtime* rt, TestMessRequiredString* testmessrequiredstring_v) -{ - int status = AST_NOERR; - int i = 0; - long totalsize = 0; - - totalsize += ast_write_size(rt,ast_string,&testmessrequiredstring_v->test_f); - return status; - -} /*TestMessRequiredString_write_size*/ -int -TestMessRequiredBytes_write(ast_runtime* rt, TestMessRequiredBytes* testmessrequiredbytes_v) -{ - int status = AST_NOERR; - int i = 0; - - status = ast_write(rt,ast_bytes,1,&testmessrequiredbytes_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*TestMessRequiredBytes_write*/ - -int -TestMessRequiredBytes_read(ast_runtime* rt, TestMessRequiredBytes** testmessrequiredbytes_vp) -{ - int status = AST_NOERR; - uint32_t wiretype, fieldno; - size_t count; - TestMessRequiredBytes* testmessrequiredbytes_v; - - testmessrequiredbytes_v = (TestMessRequiredBytes*)ast_alloc(sizeof(TestMessRequiredBytes)); - if(testmessrequiredbytes_v == NULL) return AST_ENOMEM; - - while(status == AST_NOERR) - ast_read_tag(rt,&wiretype,&fieldno) - switch (fieldno) { - case 1: { - status = ast_read(rt,ast_bytes,&testmessrequiredbytes_v->test_f); - } break; - default: - status = ast_skip_field(rt,wiretype,fieldno); - }; /*switch*/ - };/*while*/ -done: - return status; -} /*TestMessRequiredBytes_read*/ - -int -TestMessRequiredBytes_reclaim(ast_runtime* rt, TestMessRequiredBytes* testmessrequiredbytes_v) -{ - int status = AST_NOERR; - int i = 0; - - status = ast_reclaim(rt,ast_bytes,&testmessrequiredbytes_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*TestMessRequiredBytes_reclaim*/ - -long -TestMessRequiredBytes_size(ast_runtime* rt, TestMessRequiredBytes* testmessrequiredbytes_v) -{ - int status = AST_NOERR; - int i = 0; - long totalsize = 0; - - totalsize += ast_write_size(rt,ast_bytes,&testmessrequiredbytes_v->test_f); - return status; - -} /*TestMessRequiredBytes_write_size*/ -int -TestMessRequiredMessage_write(ast_runtime* rt, TestMessRequiredMessage* testmessrequiredmessage_v) -{ - int status = AST_NOERR; - int i = 0; - - status = SubMess_write(rt,testmessrequiredmessage_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*TestMessRequiredMessage_write*/ - -int -TestMessRequiredMessage_read(ast_runtime* rt, TestMessRequiredMessage** testmessrequiredmessage_vp) -{ - int status = AST_NOERR; - uint32_t wiretype, fieldno; - TestMessRequiredMessage* testmessrequiredmessage_v; - - testmessrequiredmessage_v = (TestMessRequiredMessage*)ast_alloc(sizeof(TestMessRequiredMessage)); - if(testmessrequiredmessage_v == NULL) return AST_ENOMEM; - - while(status == AST_NOERR) - ast_read_tag(rt,&wiretype,&fieldno) - switch (fieldno) { - case 1: { - status = SubMess_read(rt,&testmessrequiredmessage_v->test_f); - if(!status) {goto done;} - } break; - default: - status = ast_skip_field(rt,wiretype,fieldno); - }; /*switch*/ - };/*while*/ -done: - return status; -} /*TestMessRequiredMessage_read*/ - -int -TestMessRequiredMessage_reclaim(ast_runtime* rt, TestMessRequiredMessage* testmessrequiredmessage_v) -{ - int status = AST_NOERR; - int i = 0; - - status = SubMess_reclaim(rt,testmessrequiredmessage_v->test_f); - if(!status) {goto done;} - -done: - return status; - -} /*TestMessRequiredMessage_reclaim*/ - -long -TestMessRequiredMessage_size(ast_runtime* rt, TestMessRequiredMessage* testmessrequiredmessage_v) -{ - int status = AST_NOERR; - int i = 0; - long totalsize = 0; - - totalsize += SubMess_write_size(rt,1,testmessrequiredmessage_v->test_f); - return status; - -} /*TestMessRequiredMessage_write_size*/ -int -EmptyMess_write(ast_runtime* rt, EmptyMess* emptymess_v) -{ - int status = AST_NOERR; - int i = 0; - - -done: - return status; - -} /*EmptyMess_write*/ - -int -EmptyMess_read(ast_runtime* rt, EmptyMess** emptymess_vp) -{ - int status = AST_NOERR; - uint32_t wiretype, fieldno; - EmptyMess* emptymess_v; - - emptymess_v = (EmptyMess*)ast_alloc(sizeof(EmptyMess)); - if(emptymess_v == NULL) return AST_ENOMEM; - - while(status == AST_NOERR) - ast_read_tag(rt,&wiretype,&fieldno) - switch (fieldno) { - default: - status = ast_skip_field(rt,wiretype,fieldno); - }; /*switch*/ - };/*while*/ -done: - return status; -} /*EmptyMess_read*/ - -int -EmptyMess_reclaim(ast_runtime* rt, EmptyMess* emptymess_v) -{ - int status = AST_NOERR; - int i = 0; - - -done: - return status; - -} /*EmptyMess_reclaim*/ - -long -EmptyMess_size(ast_runtime* rt, EmptyMess* emptymess_v) -{ - int status = AST_NOERR; - int i = 0; - long totalsize = 0; - - return status; - -} /*EmptyMess_write_size*/ -int -DefaultRequiredValues_write(ast_runtime* rt, DefaultRequiredValues* defaultrequiredvalues_v) -{ - int status = AST_NOERR; - int i = 0; - - status = ast_write(rt,ast_int32,1,&defaultrequiredvalues_v->v_int32_f); - if(!status) {goto done;} - status = ast_write(rt,ast_uint32,2,&defaultrequiredvalues_v->v_uint32_f); - if(!status) {goto done;} - status = ast_write(rt,ast_int32,3,&defaultrequiredvalues_v->v_int64_f); - if(!status) {goto done;} - status = ast_write(rt,ast_uint32,4,&defaultrequiredvalues_v->v_uint64_f); - if(!status) {goto done;} - status = ast_write(rt,ast_float,5,&defaultrequiredvalues_v->v_float_f); - if(!status) {goto done;} - status = ast_write(rt,ast_double,6,&defaultrequiredvalues_v->v_double_f); - if(!status) {goto done;} - status = ast_write(rt,ast_string,7,&defaultrequiredvalues_v->v_string_f); - if(!status) {goto done;} - status = ast_write(rt,ast_bytes,8,&defaultrequiredvalues_v->v_bytes_f); - if(!status) {goto done;} - -done: - return status; - -} /*DefaultRequiredValues_write*/ - -int -DefaultRequiredValues_read(ast_runtime* rt, DefaultRequiredValues** defaultrequiredvalues_vp) -{ - int status = AST_NOERR; - uint32_t wiretype, fieldno; - size_t count; - DefaultRequiredValues* defaultrequiredvalues_v; - - defaultrequiredvalues_v = (DefaultRequiredValues*)ast_alloc(sizeof(DefaultRequiredValues)); - if(defaultrequiredvalues_v == NULL) return AST_ENOMEM; - - while(status == AST_NOERR) - ast_read_tag(rt,&wiretype,&fieldno) - switch (fieldno) { - case 1: { - status = ast_read(rt,ast_int32,&defaultrequiredvalues_v->v_int32_f); - } break; - case 2: { - status = ast_read(rt,ast_uint32,&defaultrequiredvalues_v->v_uint32_f); - } break; - case 3: { - status = ast_read(rt,ast_int32,&defaultrequiredvalues_v->v_int64_f); - } break; - case 4: { - status = ast_read(rt,ast_uint32,&defaultrequiredvalues_v->v_uint64_f); - } break; - case 5: { - status = ast_read(rt,ast_float,&defaultrequiredvalues_v->v_float_f); - } break; - case 6: { - status = ast_read(rt,ast_double,&defaultrequiredvalues_v->v_double_f); - } break; - case 7: { - status = ast_read(rt,ast_string,&defaultrequiredvalues_v->v_string_f); - } break; - case 8: { - status = ast_read(rt,ast_bytes,&defaultrequiredvalues_v->v_bytes_f); - } break; - default: - status = ast_skip_field(rt,wiretype,fieldno); - }; /*switch*/ - };/*while*/ -if(defaultrequiredvalues_v->v_int32_f.exists) { - defaultrequiredvalues_v->v_int32_f.value = 0; -} -if(defaultrequiredvalues_v->v_uint32_f.exists) { - defaultrequiredvalues_v->v_uint32_f.value = 0; -} -if(defaultrequiredvalues_v->v_int64_f.exists) { - defaultrequiredvalues_v->v_int64_f.value = 0; -} -if(defaultrequiredvalues_v->v_uint64_f.exists) { - defaultrequiredvalues_v->v_uint64_f.value = 0; -} -if(defaultrequiredvalues_v->v_float_f.exists) { - defaultrequiredvalues_v->v_float_f.value = 0; -} -if(defaultrequiredvalues_v->v_double_f.exists) { - defaultrequiredvalues_v->v_double_f.value = 0; -} -done: - return status; -} /*DefaultRequiredValues_read*/ - -int -DefaultRequiredValues_reclaim(ast_runtime* rt, DefaultRequiredValues* defaultrequiredvalues_v) -{ - int status = AST_NOERR; - int i = 0; - - status = ast_reclaim(rt,ast_string,&defaultrequiredvalues_v->v_string_f); - if(!status) {goto done;} - status = ast_reclaim(rt,ast_bytes,&defaultrequiredvalues_v->v_bytes_f); - if(!status) {goto done;} - -done: - return status; - -} /*DefaultRequiredValues_reclaim*/ - -long -DefaultRequiredValues_size(ast_runtime* rt, DefaultRequiredValues* defaultrequiredvalues_v) -{ - int status = AST_NOERR; - int i = 0; - long totalsize = 0; - - totalsize += ast_write_size(rt,ast_int32,&defaultrequiredvalues_v->v_int32_f); - totalsize += ast_write_size(rt,ast_uint32,&defaultrequiredvalues_v->v_uint32_f); - totalsize += ast_write_size(rt,ast_int32,&defaultrequiredvalues_v->v_int64_f); - totalsize += ast_write_size(rt,ast_uint32,&defaultrequiredvalues_v->v_uint64_f); - totalsize += ast_write_size(rt,ast_float,&defaultrequiredvalues_v->v_float_f); - totalsize += ast_write_size(rt,ast_double,&defaultrequiredvalues_v->v_double_f); - totalsize += ast_write_size(rt,ast_string,&defaultrequiredvalues_v->v_string_f); - totalsize += ast_write_size(rt,ast_bytes,&defaultrequiredvalues_v->v_bytes_f); - return status; - -} /*DefaultRequiredValues_write_size*/ -int -DefaultOptionalValues_write(ast_runtime* rt, DefaultOptionalValues* defaultoptionalvalues_v) -{ - int status = AST_NOERR; - int i = 0; - - if(defaultoptionalvalues_v->v_int32_f.exists) { - status = ast_write(rt,ast_int32,1,&defaultoptionalvalues_v->v_int32_f.value); - if(!status) {goto done;} - } - if(defaultoptionalvalues_v->v_uint32_f.exists) { - status = ast_write(rt,ast_uint32,2,&defaultoptionalvalues_v->v_uint32_f.value); - if(!status) {goto done;} - } - if(defaultoptionalvalues_v->v_int64_f.exists) { - status = ast_write(rt,ast_int32,3,&defaultoptionalvalues_v->v_int64_f.value); - if(!status) {goto done;} - } - if(defaultoptionalvalues_v->v_uint64_f.exists) { - status = ast_write(rt,ast_uint32,4,&defaultoptionalvalues_v->v_uint64_f.value); - if(!status) {goto done;} - } - if(defaultoptionalvalues_v->v_float_f.exists) { - status = ast_write(rt,ast_float,5,&defaultoptionalvalues_v->v_float_f.value); - if(!status) {goto done;} - } - if(defaultoptionalvalues_v->v_double_f.exists) { - status = ast_write(rt,ast_double,6,&defaultoptionalvalues_v->v_double_f.value); - if(!status) {goto done;} - } - if(defaultoptionalvalues_v->v_string_f.exists) { - status = ast_write(rt,ast_string,7,&defaultoptionalvalues_v->v_string_f.value); - if(!status) {goto done;} - } - if(defaultoptionalvalues_v->v_bytes_f.exists) { - status = ast_write(rt,ast_bytes,8,&defaultoptionalvalues_v->v_bytes_f.value); - if(!status) {goto done;} - } - -done: - return status; - -} /*DefaultOptionalValues_write*/ - -int -DefaultOptionalValues_read(ast_runtime* rt, DefaultOptionalValues** defaultoptionalvalues_vp) -{ - int status = AST_NOERR; - uint32_t wiretype, fieldno; - int i = 0; - size_t count; - DefaultOptionalValues* defaultoptionalvalues_v; - - defaultoptionalvalues_v = (DefaultOptionalValues*)ast_alloc(sizeof(DefaultOptionalValues)); - if(defaultoptionalvalues_v == NULL) return AST_ENOMEM; - - while(status == AST_NOERR) - ast_read_tag(rt,&wiretype,&fieldno) - switch (fieldno) { - case 1: { - defaultoptionalvalues_v->v_int32_f.exists = 1; - defaultoptionalvalues_v->v_int32_f.value = 0; - status = ast_read(rt,ast_int32,&defaultoptionalvalues_v->v_int32_f.value); - } break; - case 2: { - defaultoptionalvalues_v->v_uint32_f.exists = 1; - defaultoptionalvalues_v->v_uint32_f.value = 0; - status = ast_read(rt,ast_uint32,&defaultoptionalvalues_v->v_uint32_f.value); - } break; - case 3: { - defaultoptionalvalues_v->v_int64_f.exists = 1; - defaultoptionalvalues_v->v_int64_f.value = 0; - status = ast_read(rt,ast_int32,&defaultoptionalvalues_v->v_int64_f.value); - } break; - case 4: { - defaultoptionalvalues_v->v_uint64_f.exists = 1; - defaultoptionalvalues_v->v_uint64_f.value = 0; - status = ast_read(rt,ast_uint32,&defaultoptionalvalues_v->v_uint64_f.value); - } break; - case 5: { - defaultoptionalvalues_v->v_float_f.exists = 1; - defaultoptionalvalues_v->v_float_f.value = 0; - status = ast_read(rt,ast_float,&defaultoptionalvalues_v->v_float_f.value); - } break; - case 6: { - defaultoptionalvalues_v->v_double_f.exists = 1; - defaultoptionalvalues_v->v_double_f.value = 0; - status = ast_read(rt,ast_double,&defaultoptionalvalues_v->v_double_f.value); - } break; - case 7: { - defaultoptionalvalues_v->v_string_f.exists = 1; - defaultoptionalvalues_v->v_string_f.value = NULL; - status = ast_read(rt,ast_string,&defaultoptionalvalues_v->v_string_f.value); - } break; - case 8: { - defaultoptionalvalues_v->v_bytes_f.exists = 1; - defaultoptionalvalues_v->v_bytes_f.value.nbytes = 0; - defaultoptionalvalues_v->v_bytes_f.value.bytes = NULL; - status = ast_read(rt,ast_bytes,&defaultoptionalvalues_v->v_bytes_f.value); - } break; - default: - status = ast_skip_field(rt,wiretype,fieldno); - }; /*switch*/ - };/*while*/ -if(defaultoptionalvalues_v->v_int32_f.exists) { - defaultoptionalvalues_v->v_int32_f.value = 0; -} -if(defaultoptionalvalues_v->v_uint32_f.exists) { - defaultoptionalvalues_v->v_uint32_f.value = 0; -} -if(defaultoptionalvalues_v->v_int64_f.exists) { - defaultoptionalvalues_v->v_int64_f.value = 0; -} -if(defaultoptionalvalues_v->v_uint64_f.exists) { - defaultoptionalvalues_v->v_uint64_f.value = 0; -} -if(defaultoptionalvalues_v->v_float_f.exists) { - defaultoptionalvalues_v->v_float_f.value = 0; -} -if(defaultoptionalvalues_v->v_double_f.exists) { - defaultoptionalvalues_v->v_double_f.value = 0; -} -done: - return status; -} /*DefaultOptionalValues_read*/ - -int -DefaultOptionalValues_reclaim(ast_runtime* rt, DefaultOptionalValues* defaultoptionalvalues_v) -{ - int status = AST_NOERR; - int i = 0; - - if(defaultoptionalvalues_v->v_string_f.exists) { - status = ast_reclaim(rt,ast_string,&defaultoptionalvalues_v->v_string_f.value); - if(!status) {goto done;} - } - if(defaultoptionalvalues_v->v_bytes_f.exists) { - status = ast_reclaim(rt,ast_bytes,&defaultoptionalvalues_v->v_bytes_f.value); - if(!status) {goto done;} - } - -done: - return status; - -} /*DefaultOptionalValues_reclaim*/ - -long -DefaultOptionalValues_size(ast_runtime* rt, DefaultOptionalValues* defaultoptionalvalues_v) -{ - int status = AST_NOERR; - int i = 0; - long totalsize = 0; - - if(defaultoptionalvalues_v->v_int32_f.exists) { - totalsize += ast_write_size(rt,ast_int32,&defaultoptionalvalues_v->v_int32_f.value); - } - if(defaultoptionalvalues_v->v_uint32_f.exists) { - totalsize += ast_write_size(rt,ast_uint32,&defaultoptionalvalues_v->v_uint32_f.value); - } - if(defaultoptionalvalues_v->v_int64_f.exists) { - totalsize += ast_write_size(rt,ast_int32,&defaultoptionalvalues_v->v_int64_f.value); - } - if(defaultoptionalvalues_v->v_uint64_f.exists) { - totalsize += ast_write_size(rt,ast_uint32,&defaultoptionalvalues_v->v_uint64_f.value); - } - if(defaultoptionalvalues_v->v_float_f.exists) { - totalsize += ast_write_size(rt,ast_float,&defaultoptionalvalues_v->v_float_f.value); - } - if(defaultoptionalvalues_v->v_double_f.exists) { - totalsize += ast_write_size(rt,ast_double,&defaultoptionalvalues_v->v_double_f.value); - } - if(defaultoptionalvalues_v->v_string_f.exists) { - totalsize += ast_write_size(rt,ast_string,&defaultoptionalvalues_v->v_string_f.value); - } - if(defaultoptionalvalues_v->v_bytes_f.exists) { - totalsize += ast_write_size(rt,ast_bytes,&defaultoptionalvalues_v->v_bytes_f.value); - } - return status; - -} /*DefaultOptionalValues_write_size*/ -int -AllocValues_write(ast_runtime* rt, AllocValues* allocvalues_v) -{ - int status = AST_NOERR; - int i = 0; - - if(allocvalues_v->o_bytes_f.exists) { - status = ast_write(rt,ast_bytes,1,&allocvalues_v->o_bytes_f.value); - if(!status) {goto done;} - } - for(i=0;ir_string_f.count;i++) { - status = ast_write(rt,ast_string,2,&allocvalues_v->r_string_f.values[i]); - if(!status) {goto done;} - } - status = ast_write(rt,ast_string,3,&allocvalues_v->a_string_f); - if(!status) {goto done;} - status = ast_write(rt,ast_bytes,4,&allocvalues_v->a_bytes_f); - if(!status) {goto done;} - status = DefaultRequiredValues_write(rt,allocvalues_v->a_mess_f); - if(!status) {goto done;} - -done: - return status; - -} /*AllocValues_write*/ - -int -AllocValues_read(ast_runtime* rt, AllocValues** allocvalues_vp) -{ - int status = AST_NOERR; - uint32_t wiretype, fieldno; - int i = 0; - size_t count; - AllocValues* allocvalues_v; - - allocvalues_v = (AllocValues*)ast_alloc(sizeof(AllocValues)); - if(allocvalues_v == NULL) return AST_ENOMEM; - - while(status == AST_NOERR) - ast_read_tag(rt,&wiretype,&fieldno) - switch (fieldno) { - case 1: { - allocvalues_v->o_bytes_f.exists = 1; - allocvalues_v->o_bytes_f.value.nbytes = 0; - allocvalues_v->o_bytes_f.value.bytes = NULL; - status = ast_read(rt,ast_bytes,&allocvalues_v->o_bytes_f.value); - } break; - case 2: { - allocvalues_v->r_string_f.count = 0; - allocvalues_v->r_string_f.values = NULL; - status = ast_read_count(rt,&allocvalues_v->r_string_f.count); - if(!status) {goto done;} - for(i=0;ir_string_f.count;i++) { - char* tmp; - status = ast_read(rt,ast_string,&tmp); - status = ast_append(rt,ast_string,&allocvalues_v->r_string_f,&tmp); - if(!status) {goto done;} - } /*for*/; - } break; - case 3: { - status = ast_read(rt,ast_string,&allocvalues_v->a_string_f); - } break; - case 4: { - status = ast_read(rt,ast_bytes,&allocvalues_v->a_bytes_f); - } break; - case 5: { - status = DefaultRequiredValues_read(rt,&allocvalues_v->a_mess_f); - if(!status) {goto done;} - } break; - default: - status = ast_skip_field(rt,wiretype,fieldno); - }; /*switch*/ - };/*while*/ -done: - return status; -} /*AllocValues_read*/ - -int -AllocValues_reclaim(ast_runtime* rt, AllocValues* allocvalues_v) -{ - int status = AST_NOERR; - int i = 0; - - if(allocvalues_v->o_bytes_f.exists) { - status = ast_reclaim(rt,ast_bytes,&allocvalues_v->o_bytes_f.value); - if(!status) {goto done;} - } - for(i=0;ir_string_f.count;i++) { - status = ast_reclaim(rt,ast_string,&allocvalues_v->r_string_f.values[i]); - if(!status) {goto done;} - } - ast_free(AllocValues->r_string.values) - status = ast_reclaim(rt,ast_string,&allocvalues_v->a_string_f); - if(!status) {goto done;} - status = ast_reclaim(rt,ast_bytes,&allocvalues_v->a_bytes_f); - if(!status) {goto done;} - status = DefaultRequiredValues_reclaim(rt,allocvalues_v->a_mess_f); - if(!status) {goto done;} - -done: - return status; - -} /*AllocValues_reclaim*/ - -long -AllocValues_size(ast_runtime* rt, AllocValues* allocvalues_v) -{ - int status = AST_NOERR; - int i = 0; - long totalsize = 0; - - if(allocvalues_v->o_bytes_f.exists) { - totalsize += ast_write_size(rt,ast_bytes,&allocvalues_v->o_bytes_f.value); - } - for(i=0;ir_string_f.count;i++) { - totalsize += ast_write_size(rt,ast_string,allocvalues_v->r_string_f.values[i]); - } - totalsize += ast_write_size(rt,ast_string,&allocvalues_v->a_string_f); - totalsize += ast_write_size(rt,ast_bytes,&allocvalues_v->a_bytes_f); - totalsize += DefaultRequiredValues_write_size(rt,5,allocvalues_v->a_mess_f); - return status; - -} /*AllocValues_write_size*/ diff --git a/libcdmr/ast/src/compiler/foo.h b/libcdmr/ast/src/compiler/foo.h deleted file mode 100644 index c6a722102..000000000 --- a/libcdmr/ast/src/compiler/foo.h +++ /dev/null @@ -1,408 +0,0 @@ -#ifndef foo_H -#define foo_H - - - -typedef enum TestEnumSmall { - VALUE=0, - OTHER_VALUE=1 -} TestEnumSmall; - - -typedef enum TestEnum { - VALUE0=0, - VALUE1=1, - VALUE127=127, - VALUE128=128, - VALUE16383=16383, - VALUE16384=16384, - VALUE2097151=2097151, - VALUE2097152=2097152, - VALUE268435455=268435455, - VALUE268435456=268435456 -} TestEnum; - - -typedef enum TestEnumDupValues { - VALUE_A=42, - VALUE_B=42, - VALUE_C=42, - VALUE_D=666, - VALUE_E=666, - VALUE_F=1000, - VALUE_AA=1000, - VALUE_BB=1001 -} TestEnumDupValues; - -typedef struct SubMess { - int test_f; -} SubMess; - -extern int SubMess_write(ast_runtime*,SubMess*); -extern int SubMess_read(ast_runtime*,SubMess**); -extern int SubMess_reclaim(ast_runtime*,SubMess*); -extern long SubMess_size(ast_runtime*,SubMess*); - -typedef struct TestFieldNo15 { - char* test_f; -} TestFieldNo15; - -extern int TestFieldNo15_write(ast_runtime*,TestFieldNo15*); -extern int TestFieldNo15_read(ast_runtime*,TestFieldNo15**); -extern int TestFieldNo15_reclaim(ast_runtime*,TestFieldNo15*); -extern long TestFieldNo15_size(ast_runtime*,TestFieldNo15*); - -typedef struct TestFieldNo16 { - char* test_f; -} TestFieldNo16; - -extern int TestFieldNo16_write(ast_runtime*,TestFieldNo16*); -extern int TestFieldNo16_read(ast_runtime*,TestFieldNo16**); -extern int TestFieldNo16_reclaim(ast_runtime*,TestFieldNo16*); -extern long TestFieldNo16_size(ast_runtime*,TestFieldNo16*); - -typedef struct TestFieldNo2047 { - char* test_f; -} TestFieldNo2047; - -extern int TestFieldNo2047_write(ast_runtime*,TestFieldNo2047*); -extern int TestFieldNo2047_read(ast_runtime*,TestFieldNo2047**); -extern int TestFieldNo2047_reclaim(ast_runtime*,TestFieldNo2047*); -extern long TestFieldNo2047_size(ast_runtime*,TestFieldNo2047*); - -typedef struct TestFieldNo2048 { - char* test_f; -} TestFieldNo2048; - -extern int TestFieldNo2048_write(ast_runtime*,TestFieldNo2048*); -extern int TestFieldNo2048_read(ast_runtime*,TestFieldNo2048**); -extern int TestFieldNo2048_reclaim(ast_runtime*,TestFieldNo2048*); -extern long TestFieldNo2048_size(ast_runtime*,TestFieldNo2048*); - -typedef struct TestFieldNo262143 { - char* test_f; -} TestFieldNo262143; - -extern int TestFieldNo262143_write(ast_runtime*,TestFieldNo262143*); -extern int TestFieldNo262143_read(ast_runtime*,TestFieldNo262143**); -extern int TestFieldNo262143_reclaim(ast_runtime*,TestFieldNo262143*); -extern long TestFieldNo262143_size(ast_runtime*,TestFieldNo262143*); - -typedef struct TestFieldNo262144 { - char* test_f; -} TestFieldNo262144; - -extern int TestFieldNo262144_write(ast_runtime*,TestFieldNo262144*); -extern int TestFieldNo262144_read(ast_runtime*,TestFieldNo262144**); -extern int TestFieldNo262144_reclaim(ast_runtime*,TestFieldNo262144*); -extern long TestFieldNo262144_size(ast_runtime*,TestFieldNo262144*); - -typedef struct TestFieldNo33554431 { - char* test_f; -} TestFieldNo33554431; - -extern int TestFieldNo33554431_write(ast_runtime*,TestFieldNo33554431*); -extern int TestFieldNo33554431_read(ast_runtime*,TestFieldNo33554431**); -extern int TestFieldNo33554431_reclaim(ast_runtime*,TestFieldNo33554431*); -extern long TestFieldNo33554431_size(ast_runtime*,TestFieldNo33554431*); - -typedef struct TestFieldNo33554432 { - char* test_f; -} TestFieldNo33554432; - -extern int TestFieldNo33554432_write(ast_runtime*,TestFieldNo33554432*); -extern int TestFieldNo33554432_read(ast_runtime*,TestFieldNo33554432**); -extern int TestFieldNo33554432_reclaim(ast_runtime*,TestFieldNo33554432*); -extern long TestFieldNo33554432_size(ast_runtime*,TestFieldNo33554432*); - -typedef struct TestMess { - struct {int count; int* values;} test_int32_f; - struct {int count; int* values;} test_sint32_f; - struct {int count; int* values;} test_sfixed32_f; - struct {int count; longlong* values;} test_int64_f; - struct {int count; longlong* values;} test_sint64_f; - struct {int count; longlong* values;} test_sfixed64_f; - struct {int count; int* values;} test_uint32_f; - struct {int count; int* values;} test_fixed32_f; - struct {int count; longlong* values;} test_uint64_f; - struct {int count; longlong* values;} test_fixed64_f; - struct {int count; float* values;} test_float_f; - struct {int count; double* values;} test_double_f; - struct {int count; int* values;} test_boolean_f; - struct {int count; TestEnumSmall** values;} test_enum_small_f; - struct {int count; TestEnum** values;} test_enum_f; - struct {int count; char** values;} test_string_f; - struct {int count; Bytestring* values;} test_bytes_f; - struct {int count; SubMess** values;} test_message_f; -} TestMess; - -extern int TestMess_write(ast_runtime*,TestMess*); -extern int TestMess_read(ast_runtime*,TestMess**); -extern int TestMess_reclaim(ast_runtime*,TestMess*); -extern long TestMess_size(ast_runtime*,TestMess*); - -typedef struct TestMessPacked { - struct {int count; int* values;} test_int32_f; - struct {int count; int* values;} test_sint32_f; - struct {int count; int* values;} test_sfixed32_f; - struct {int count; longlong* values;} test_int64_f; - struct {int count; longlong* values;} test_sint64_f; - struct {int count; longlong* values;} test_sfixed64_f; - struct {int count; int* values;} test_uint32_f; - struct {int count; int* values;} test_fixed32_f; - struct {int count; longlong* values;} test_uint64_f; - struct {int count; longlong* values;} test_fixed64_f; - struct {int count; float* values;} test_float_f; - struct {int count; double* values;} test_double_f; - struct {int count; int* values;} test_boolean_f; - struct {int count; TestEnumSmall** values;} test_enum_small_f; - struct {int count; TestEnum** values;} test_enum_f; -} TestMessPacked; - -extern int TestMessPacked_write(ast_runtime*,TestMessPacked*); -extern int TestMessPacked_read(ast_runtime*,TestMessPacked**); -extern int TestMessPacked_reclaim(ast_runtime*,TestMessPacked*); -extern long TestMessPacked_size(ast_runtime*,TestMessPacked*); - -typedef struct TestMessOptional { - struct {int exists; int value;} test_int32_f; - struct {int exists; int value;} test_sint32_f; - struct {int exists; int value;} test_sfixed32_f; - struct {int exists; longlong value;} test_int64_f; - struct {int exists; longlong value;} test_sint64_f; - struct {int exists; longlong value;} test_sfixed64_f; - struct {int exists; int value;} test_uint32_f; - struct {int exists; int value;} test_fixed32_f; - struct {int exists; longlong value;} test_uint64_f; - struct {int exists; longlong value;} test_fixed64_f; - struct {int exists; float value;} test_float_f; - struct {int exists; double value;} test_double_f; - struct {int exists; int value;} test_boolean_f; - struct {int exists; TestEnumSmall* value;} test_enum_small_f; - struct {int exists; TestEnum* value;} test_enum_f; - struct {int exists; char* value;} test_string_f; - struct {int exists; Bytestring value;} test_bytes_f; - struct {int exists; SubMess* value;} test_message_f; -} TestMessOptional; - -extern int TestMessOptional_write(ast_runtime*,TestMessOptional*); -extern int TestMessOptional_read(ast_runtime*,TestMessOptional**); -extern int TestMessOptional_reclaim(ast_runtime*,TestMessOptional*); -extern long TestMessOptional_size(ast_runtime*,TestMessOptional*); - -typedef struct TestMessRequiredInt32 { - int test_f; -} TestMessRequiredInt32; - -extern int TestMessRequiredInt32_write(ast_runtime*,TestMessRequiredInt32*); -extern int TestMessRequiredInt32_read(ast_runtime*,TestMessRequiredInt32**); -extern int TestMessRequiredInt32_reclaim(ast_runtime*,TestMessRequiredInt32*); -extern long TestMessRequiredInt32_size(ast_runtime*,TestMessRequiredInt32*); - -typedef struct TestMessRequiredSInt32 { - int test_f; -} TestMessRequiredSInt32; - -extern int TestMessRequiredSInt32_write(ast_runtime*,TestMessRequiredSInt32*); -extern int TestMessRequiredSInt32_read(ast_runtime*,TestMessRequiredSInt32**); -extern int TestMessRequiredSInt32_reclaim(ast_runtime*,TestMessRequiredSInt32*); -extern long TestMessRequiredSInt32_size(ast_runtime*,TestMessRequiredSInt32*); - -typedef struct TestMessRequiredSFixed32 { - int test_f; -} TestMessRequiredSFixed32; - -extern int TestMessRequiredSFixed32_write(ast_runtime*,TestMessRequiredSFixed32*); -extern int TestMessRequiredSFixed32_read(ast_runtime*,TestMessRequiredSFixed32**); -extern int TestMessRequiredSFixed32_reclaim(ast_runtime*,TestMessRequiredSFixed32*); -extern long TestMessRequiredSFixed32_size(ast_runtime*,TestMessRequiredSFixed32*); - -typedef struct TestMessRequiredInt64 { - longlong test_f; -} TestMessRequiredInt64; - -extern int TestMessRequiredInt64_write(ast_runtime*,TestMessRequiredInt64*); -extern int TestMessRequiredInt64_read(ast_runtime*,TestMessRequiredInt64**); -extern int TestMessRequiredInt64_reclaim(ast_runtime*,TestMessRequiredInt64*); -extern long TestMessRequiredInt64_size(ast_runtime*,TestMessRequiredInt64*); - -typedef struct TestMessRequiredSInt64 { - longlong test_f; -} TestMessRequiredSInt64; - -extern int TestMessRequiredSInt64_write(ast_runtime*,TestMessRequiredSInt64*); -extern int TestMessRequiredSInt64_read(ast_runtime*,TestMessRequiredSInt64**); -extern int TestMessRequiredSInt64_reclaim(ast_runtime*,TestMessRequiredSInt64*); -extern long TestMessRequiredSInt64_size(ast_runtime*,TestMessRequiredSInt64*); - -typedef struct TestMessRequiredSFixed64 { - longlong test_f; -} TestMessRequiredSFixed64; - -extern int TestMessRequiredSFixed64_write(ast_runtime*,TestMessRequiredSFixed64*); -extern int TestMessRequiredSFixed64_read(ast_runtime*,TestMessRequiredSFixed64**); -extern int TestMessRequiredSFixed64_reclaim(ast_runtime*,TestMessRequiredSFixed64*); -extern long TestMessRequiredSFixed64_size(ast_runtime*,TestMessRequiredSFixed64*); - -typedef struct TestMessRequiredUInt32 { - int test_f; -} TestMessRequiredUInt32; - -extern int TestMessRequiredUInt32_write(ast_runtime*,TestMessRequiredUInt32*); -extern int TestMessRequiredUInt32_read(ast_runtime*,TestMessRequiredUInt32**); -extern int TestMessRequiredUInt32_reclaim(ast_runtime*,TestMessRequiredUInt32*); -extern long TestMessRequiredUInt32_size(ast_runtime*,TestMessRequiredUInt32*); - -typedef struct TestMessRequiredFixed32 { - int test_f; -} TestMessRequiredFixed32; - -extern int TestMessRequiredFixed32_write(ast_runtime*,TestMessRequiredFixed32*); -extern int TestMessRequiredFixed32_read(ast_runtime*,TestMessRequiredFixed32**); -extern int TestMessRequiredFixed32_reclaim(ast_runtime*,TestMessRequiredFixed32*); -extern long TestMessRequiredFixed32_size(ast_runtime*,TestMessRequiredFixed32*); - -typedef struct TestMessRequiredUInt64 { - longlong test_f; -} TestMessRequiredUInt64; - -extern int TestMessRequiredUInt64_write(ast_runtime*,TestMessRequiredUInt64*); -extern int TestMessRequiredUInt64_read(ast_runtime*,TestMessRequiredUInt64**); -extern int TestMessRequiredUInt64_reclaim(ast_runtime*,TestMessRequiredUInt64*); -extern long TestMessRequiredUInt64_size(ast_runtime*,TestMessRequiredUInt64*); - -typedef struct TestMessRequiredFixed64 { - longlong test_f; -} TestMessRequiredFixed64; - -extern int TestMessRequiredFixed64_write(ast_runtime*,TestMessRequiredFixed64*); -extern int TestMessRequiredFixed64_read(ast_runtime*,TestMessRequiredFixed64**); -extern int TestMessRequiredFixed64_reclaim(ast_runtime*,TestMessRequiredFixed64*); -extern long TestMessRequiredFixed64_size(ast_runtime*,TestMessRequiredFixed64*); - -typedef struct TestMessRequiredFloat { - float test_f; -} TestMessRequiredFloat; - -extern int TestMessRequiredFloat_write(ast_runtime*,TestMessRequiredFloat*); -extern int TestMessRequiredFloat_read(ast_runtime*,TestMessRequiredFloat**); -extern int TestMessRequiredFloat_reclaim(ast_runtime*,TestMessRequiredFloat*); -extern long TestMessRequiredFloat_size(ast_runtime*,TestMessRequiredFloat*); - -typedef struct TestMessRequiredDouble { - double test_f; -} TestMessRequiredDouble; - -extern int TestMessRequiredDouble_write(ast_runtime*,TestMessRequiredDouble*); -extern int TestMessRequiredDouble_read(ast_runtime*,TestMessRequiredDouble**); -extern int TestMessRequiredDouble_reclaim(ast_runtime*,TestMessRequiredDouble*); -extern long TestMessRequiredDouble_size(ast_runtime*,TestMessRequiredDouble*); - -typedef struct TestMessRequiredBool { - int test_f; -} TestMessRequiredBool; - -extern int TestMessRequiredBool_write(ast_runtime*,TestMessRequiredBool*); -extern int TestMessRequiredBool_read(ast_runtime*,TestMessRequiredBool**); -extern int TestMessRequiredBool_reclaim(ast_runtime*,TestMessRequiredBool*); -extern long TestMessRequiredBool_size(ast_runtime*,TestMessRequiredBool*); - -typedef struct TestMessRequiredEnum { - TestEnum* test_f; -} TestMessRequiredEnum; - -extern int TestMessRequiredEnum_write(ast_runtime*,TestMessRequiredEnum*); -extern int TestMessRequiredEnum_read(ast_runtime*,TestMessRequiredEnum**); -extern int TestMessRequiredEnum_reclaim(ast_runtime*,TestMessRequiredEnum*); -extern long TestMessRequiredEnum_size(ast_runtime*,TestMessRequiredEnum*); - -typedef struct TestMessRequiredEnumSmall { - TestEnumSmall* test_f; -} TestMessRequiredEnumSmall; - -extern int TestMessRequiredEnumSmall_write(ast_runtime*,TestMessRequiredEnumSmall*); -extern int TestMessRequiredEnumSmall_read(ast_runtime*,TestMessRequiredEnumSmall**); -extern int TestMessRequiredEnumSmall_reclaim(ast_runtime*,TestMessRequiredEnumSmall*); -extern long TestMessRequiredEnumSmall_size(ast_runtime*,TestMessRequiredEnumSmall*); - -typedef struct TestMessRequiredString { - char* test_f; -} TestMessRequiredString; - -extern int TestMessRequiredString_write(ast_runtime*,TestMessRequiredString*); -extern int TestMessRequiredString_read(ast_runtime*,TestMessRequiredString**); -extern int TestMessRequiredString_reclaim(ast_runtime*,TestMessRequiredString*); -extern long TestMessRequiredString_size(ast_runtime*,TestMessRequiredString*); - -typedef struct TestMessRequiredBytes { - Bytestring test_f; -} TestMessRequiredBytes; - -extern int TestMessRequiredBytes_write(ast_runtime*,TestMessRequiredBytes*); -extern int TestMessRequiredBytes_read(ast_runtime*,TestMessRequiredBytes**); -extern int TestMessRequiredBytes_reclaim(ast_runtime*,TestMessRequiredBytes*); -extern long TestMessRequiredBytes_size(ast_runtime*,TestMessRequiredBytes*); - -typedef struct TestMessRequiredMessage { - SubMess* test_f; -} TestMessRequiredMessage; - -extern int TestMessRequiredMessage_write(ast_runtime*,TestMessRequiredMessage*); -extern int TestMessRequiredMessage_read(ast_runtime*,TestMessRequiredMessage**); -extern int TestMessRequiredMessage_reclaim(ast_runtime*,TestMessRequiredMessage*); -extern long TestMessRequiredMessage_size(ast_runtime*,TestMessRequiredMessage*); - -typedef struct EmptyMess { -} EmptyMess; - -extern int EmptyMess_write(ast_runtime*,EmptyMess*); -extern int EmptyMess_read(ast_runtime*,EmptyMess**); -extern int EmptyMess_reclaim(ast_runtime*,EmptyMess*); -extern long EmptyMess_size(ast_runtime*,EmptyMess*); - -typedef struct DefaultRequiredValues { - int v_int32_f; - int v_uint32_f; - int v_int64_f; - int v_uint64_f; - float v_float_f; - double v_double_f; - char* v_string_f; - Bytestring v_bytes_f; -} DefaultRequiredValues; - -extern int DefaultRequiredValues_write(ast_runtime*,DefaultRequiredValues*); -extern int DefaultRequiredValues_read(ast_runtime*,DefaultRequiredValues**); -extern int DefaultRequiredValues_reclaim(ast_runtime*,DefaultRequiredValues*); -extern long DefaultRequiredValues_size(ast_runtime*,DefaultRequiredValues*); - -typedef struct DefaultOptionalValues { - struct {int exists; int value;} v_int32_f; - struct {int exists; int value;} v_uint32_f; - struct {int exists; int value;} v_int64_f; - struct {int exists; int value;} v_uint64_f; - struct {int exists; float value;} v_float_f; - struct {int exists; double value;} v_double_f; - struct {int exists; char* value;} v_string_f; - struct {int exists; Bytestring value;} v_bytes_f; -} DefaultOptionalValues; - -extern int DefaultOptionalValues_write(ast_runtime*,DefaultOptionalValues*); -extern int DefaultOptionalValues_read(ast_runtime*,DefaultOptionalValues**); -extern int DefaultOptionalValues_reclaim(ast_runtime*,DefaultOptionalValues*); -extern long DefaultOptionalValues_size(ast_runtime*,DefaultOptionalValues*); - -typedef struct AllocValues { - struct {int exists; Bytestring value;} o_bytes_f; - struct {int count; char** values;} r_string_f; - char* a_string_f; - Bytestring a_bytes_f; - DefaultRequiredValues* a_mess_f; -} AllocValues; - -extern int AllocValues_write(ast_runtime*,AllocValues*); -extern int AllocValues_read(ast_runtime*,AllocValues**); -extern int AllocValues_reclaim(ast_runtime*,AllocValues*); -extern long AllocValues_size(ast_runtime*,AllocValues*); - -#endif /*foo_H*/ diff --git a/libcdmr/ast/src/compiler/t.h b/libcdmr/ast/src/compiler/t.h deleted file mode 100644 index b1b40dd5f..000000000 --- a/libcdmr/ast/src/compiler/t.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef t_H -#define t_H - - - -typedef enum PhoneType { - MOBILE=0, - HOME=1, - WORK=2 -} PhoneType; - -typedef struct t { - int f1_f; - struct {int exists; float value;} f2_f; - struct {int count; int* values;} f3_f; - m2* f4_f; -} t; - -extern int t_write(ast_runtime*,t*); -extern int t_read(ast_runtime*,t**); -extern int t_reclaim(ast_runtime*,t*); -extern long t_size(ast_runtime*,t*); - -#endif /*t_H*/ diff --git a/libcdmr/cce.y b/libcdmr/cce.y new file mode 100644 index 000000000..dd5667994 --- /dev/null +++ b/libcdmr/cce.y @@ -0,0 +1,94 @@ +/* Copyright 2009, UCAR/Unidata and OPeNDAP, Inc. + See the COPYRIGHT file for more information. */ + +/*The lines down to DO NOT DELETE ... comment are specific to the C Parser. + They will be commennted out when building a java parser. +*/ + +%pure-parser +%lex-param {CCEparsestate* parsestate} +%parse-param {CCEparsestate* parsestate} +%{ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include +#include "netcdf.h" +#include "ncbytes.h" +#include "nclist.h" +#include "cceconstraints.h" +#include "cceparselex.h" +%} + +/*DO NOT DELETE THIS LINE*/ + +%token SCAN_WORD +%token SCAN_STRINGCONST +%token SCAN_NUMBERCONST + +%start constraints + +%% + +constraints: + optquestionmark projections + | /*empty*/ + ; + +optquestionmark: '?' | /*empty*/ ; + +projections: + projectionlist {projections(parsestate,$1);} + ; + +projectionlist: + projection + {$$=projectionlist(parsestate,(Object)null,$1);} + | projectionlist ',' projection + {$$=projectionlist(parsestate,$1,$3);} + ; + +projection: + segmentlist + {$$=projection(parsestate,$1);} + ; + +segmentlist: + segment + {$$=segmentlist(parsestate,null,$1);} + | segmentlist '.' segment + {$$=segmentlist(parsestate,$1,$3);} + ; + +segment: + word + {$$=segment(parsestate,$1,null);} + | word rangelist + {$$=segment(parsestate,$1,$2);} + ; + +rangelist: + range + {$$=rangelist(parsestate,null,$1);} + | rangelist range + {$$=rangelist(parsestate,$1,$2);} + ; + +range: + '[' number ']' + {$$=range(parsestate,$2,null,null);} + | '[' number ':' number ']' + {$$=range(parsestate,$2,null,$4);} + | '[' number ':' number ':' number ']' + {$$=range(parsestate,$2,$4,$6);} + ; + + +word: SCAN_WORD + {$$ = checkobject($1);} + ; +number: SCAN_NUMBERCONST + {$$ = checkobject($1);} + ; + +%% diff --git a/libcdmr/cceconstraints.c b/libcdmr/cceconstraints.c new file mode 100644 index 000000000..18c307bdc --- /dev/null +++ b/libcdmr/cceconstraints.c @@ -0,0 +1,844 @@ +/********************************************************************* + * Copyright 1993, UCAR/Unidata + * See netcdf/COPYRIGHT file for copying and redistribution conditions. + * $Header: /upc/share/CVS/netcdf-3/libncdap3/constraints3.c,v 1.40 2010/05/27 21:34:07 dmh Exp $ + *********************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include + +#include "nclist.h" +#include "ncbytes.h" +#include "nclog.h" + +#include "netcdf.h" +#include "cceconstraints.h" +#include "crdebug.h" + +#define DEBUG + +#ifndef nulldup +#define nulldup(s) ((s)==NULL?NULL:strdup(s)) +#endif +#ifndef nullfree +#define nullfree(s) if((s)!=NULL) {free(s);} else {} +#endif + +static char* opstrings[] = OPSTRINGS ; + +static int mergeprojection(CCEprojection* dst, CCEprojection* src); +static void ceallnodesr(CCEnode* node, NClist* allnodes, CEsort which); + +/* Parse incoming url constraints, if any, + to check for syntactic correctness +*/ +int +cdmparseconstraints(char* constraints, CCEconstraint* dapconstraint) +{ + int ncstat = NC_NOERR; + char* errmsg; + + assert(dapconstraint != NULL); + nclistclear(dapconstraint->projections); + nclistclear(dapconstraint->selections); + + ncstat = dapceparse(constraints,dapconstraint,&errmsg); + if(ncstat) { + nclog(NCLOGWARN,"DAP constraint parse failure: %s",errmsg); + if(errmsg) free(errmsg); + nclistclear(dapconstraint->projections); + nclistclear(dapconstraint->selections); + } + +#ifdef DEBUG +fprintf(stderr,"constraint: %s",ccetostring((CCEnode*)dapconstraint)); +#endif + return ncstat; +} + +/* Worksheet + +mg.st = md.st * ms.st +mg.f = md.f+(ms.f*md.st) +mg.l = ((ms.l-1) / ms.st) * mg.st + 1 +mg.p = mg.f + mg.l +mg.c = mg.l / mg.st + +0000000000111111111122222222223 +0123456789012345678901234567890 + xxxxxx + xxxxxx + 0 1 2 3 4 5 6 7 8 md=(st=3 f=1 l=25 p=26) + 0 1 2 ms=(st=2 f=3 l=5 p=8 ) + ---------------------------- + mg=(st=6 f=10 p=23 l=13) +c = 4 / 2 = 2 +l = 2 * 6 + 1 = 13 + +0000000000111111 +0123456789012345 + 0 1 2 3 4 md=(st=2 f=1 l=9 p=10) + 0 1 2 ms=(st=1 f=2 l=3 p=5) + ---------------------------- + mg=(st=2 f=5 p=10 l=5 ) +c = 2/1 = 2 +l = 2 * 2 + 1 = 13 + +0000000000111111111 +0123456789012345678 + 0 1 2 3 4 5 6 7 8 md=(st=2 f=1 l=17 p=18) + 0 1 2 ms=(st=2 f=3 l=5 p=8) + ---------------------------- + mg=(st=4 f=7 p=16 l=9 ) +c = 4/2 = 2 +l = 2 * 4 + 1 = 9 + +0000000000111111111 +0123456789012345678 + 0 1 2 3 4 md=(st=2 f=1 l=9 p=10) + 0 1 2 3 4 ms=(st=1 f=0 l=5 p=5) + ---------------------------- + mg=(st=2 f=1 p=10 l=9 ) +c = 4/1 = 4 +l = 4 * 2 + 1 = 9 + +00000 +01234 +01 md=(st=1 f=0 l=2 p=2) +0 ms=(st=1 f=0 l=1 p=1) + ---------------------------- + mg=(st=1 f=0 p=1 l=1 ) +c = 0/1 = 0 +l = 0 * 1 + 1 = 1 + +000000000011 +012345678901 +012 md=(st=1 f=0 l=3 p=3) +012 ms=(st=1 f=0 l=3 p=2) + ---------------------------- + mg=(st=1 f=0 p=3 l=3 ) +c = 2/1 = 2 +l = 2 * 1 + 1 = 3 + +*/ + +/* Merge slice src into slice dst; dst != src */ + +int +cceslicemerge(CCEslice* dst, CCEslice* src) +{ + int err = NC_NOERR; + CCEslice tmp; + + tmp.stride = (dst->stride * src->stride); + tmp.first = (dst->first+((src->first)*(dst->stride))); + tmp.length = (((src->length - 1) / src->stride) * tmp.stride) + 1; + tmp.stop = tmp.first + tmp.length; + tmp.count = tmp.length / tmp.stride; + tmp.declsize = dst->declsize; + if(tmp.length % tmp.stride != 0) tmp.count++; + if(tmp.first >= dst->stop || tmp.stop > dst->stop) + err = NC_EINVALCOORDS; + else + *dst = tmp; + return err; +} + + +/* +Given two projection lists, merge +src into dst taking +overlapping projections into acct. +*/ +int +cdmmergeprojections(NClist* dst, NClist* src) +{ + int i; + NClist* cat = nclistnew(); + int ncstat = NC_NOERR; + +#ifdef DEBUG +fprintf(stderr,"dapmergeprojection: dst = %s\n",ccetostring((CCEnode*)dst)); +fprintf(stderr,"dapmergeprojection: src = %s\n",ccetostring((CCEnode*)src)); +#endif + + /* get dst concat clone(src) */ + nclistsetalloc(cat,nclistlength(dst)+nclistlength(src)); + for(i=0;i 0) { + CCEprojection* target = (CCEprojection*)nclistremove(cat,0); + if(target == NULL) continue; + if(target->discrim != CES_VAR) continue; + for(i=0;idiscrim != CES_VAR) continue; + if(ccesamepath(target->var->segments, + p2->var->segments)!=0) continue; + /* This entry matches our current target; merge */ + ncstat = mergeprojection(target,p2); + /* null out this merged entry and release it */ + nclistset(cat,i,(ncelem)NULL); + ccefree((CCEnode*)p2); + } + /* Capture the clone */ + nclistpush(dst,(ncelem)target); + } + nclistfree(cat); + return ncstat; +} + +static int +mergeprojection(CCEprojection* dst, CCEprojection* src) +{ + int ncstat = NC_NOERR; + int i,j; + + /* merge segment by segment; + |dst->segments| == |src->segments| + by construction + */ + assert((dst->discrim == CES_VAR && src->discrim == CES_VAR)); + assert((nclistlength(dst->var->segments) == nclistlength(src->var->segments))); + for(i=0;ivar->segments);i++) { + CCEsegment* dstseg = (CCEsegment*)nclistget(dst->var->segments,i); + CCEsegment* srcseg = (CCEsegment*)nclistget(src->var->segments,i); + for(j=0;jrank;j++) { + cceslicemerge(dstseg->slices+j, + srcseg->slices+j); + } + } + return ncstat; +} + +/* Convert an CCEprojection instance into a string + that can be used with the url +*/ + +char* +cdmbuildprojectionstring(NClist* projections) +{ + char* pstring; + NCbytes* buf = ncbytesnew(); + ccelisttobuffer(projections,buf,","); + pstring = ncbytesdup(buf); + ncbytesfree(buf); + return pstring; +} + +char* +cdmbuildselectionstring(NClist* selections) +{ + NCbytes* buf = ncbytesnew(); + char* sstring; + ccelisttobuffer(selections,buf,","); + sstring = ncbytesdup(buf); + ncbytesfree(buf); + return sstring; +} + +char* +cdmbuildconstraintstring(CCEconstraint* constraints) +{ + NCbytes* buf = ncbytesnew(); + char* result = NULL; + ccetobuffer((CCEnode*)constraints,buf); + result = ncbytesdup(buf); + ncbytesfree(buf); + return result; +} + +CCEnode* +cceclone(CCEnode* node) +{ + int i; + CCEnode* result = NULL; + + result = (CCEnode*)ccecreate(node->sort); + if(result == NULL) goto done; + + switch (node->sort) { + + case CES_SLICE: { + CCEslice* clone = (CCEslice*)result; + CCEslice* orig = (CCEslice*)node; + *clone = *orig; + } break; + + case CES_SEGMENT: { + CCEsegment* clone = (CCEsegment*)result; + CCEsegment* orig = (CCEsegment*)node; + *clone = *orig; + clone->name = nulldup(orig->name); + if(orig->rank > 0) + memcpy(clone->slices,orig->slices,orig->rank*sizeof(CCEslice)); + } break; + + case CES_VAR: { + CCEvar* clone = (CCEvar*)result; + CCEvar* orig = (CCEvar*)node; + *clone = *orig; + clone->segments = cceclonelist(clone->segments); + } break; + + case CES_FCN: { + CCEfcn* clone = (CCEfcn*)result; + CCEfcn* orig = (CCEfcn*)node; + *clone = *orig; + clone->name = nulldup(orig->name); + clone->args = cceclonelist(orig->args); + } break; + + case CES_CONST: { + CCEconstant* clone = (CCEconstant*)result; + CCEconstant* orig = (CCEconstant*)node; + *clone = *orig; + if(clone->discrim == CES_STR) + clone->text = nulldup(clone->text); + } break; + + case CES_VALUE: { + CCEvalue* clone = (CCEvalue*)result; + CCEvalue* orig = (CCEvalue*)node; + *clone = *orig; + switch (clone->discrim) { + case CES_CONST: + clone->constant = (CCEconstant*)cceclone((CCEnode*)orig->constant); break; + case CES_VAR: + clone->var = (CCEvar*)cceclone((CCEnode*)orig->var); break; + case CES_FCN: + clone->fcn = (CCEfcn*)cceclone((CCEnode*)orig->fcn); break; + default: assert(0); + } + } break; + + case CES_PROJECT: { + CCEprojection* clone = (CCEprojection*)result; + CCEprojection* orig = (CCEprojection*)node; + *clone = *orig; + switch (orig->discrim) { + case CES_VAR: + clone->var = (CCEvar*)cceclone((CCEnode*)orig->var); break; + case CES_FCN: + clone->fcn = (CCEfcn*)cceclone((CCEnode*)orig->fcn); break; + default: assert(0); + } + } break; + + case CES_SELECT: { + CCEselection* clone = (CCEselection*)result; + CCEselection* orig = (CCEselection*)node; + *clone = *orig; + clone->lhs = (CCEvalue*)cceclone((CCEnode*)orig->lhs); + clone->rhs = cceclonelist(orig->rhs); + } break; + + case CES_CONSTRAINT: { + CCEconstraint* clone = (CCEconstraint*)result; + CCEconstraint* orig = (CCEconstraint*)node; + *clone = *orig; + clone->projections = cceclonelist(orig->projections); + clone->selections = cceclonelist(orig->selections); + } break; + + default: + assert(0); + } + +done: + return result; +} + +NClist* +cceclonelist(NClist* list) +{ + int i; + NClist* clone; + if(list == NULL) return NULL; + clone = nclistnew(); + for(i=0;isort) { + + case CES_VAR: { + CCEvar* target = (CCEvar*)node; + ccefreelist(target->segments); + } break; + + case CES_FCN: { + CCEfcn* target = (CCEfcn*)node; + ccefreelist(target->args); + nullfree(target->name); + } break; + + case CES_CONST: { + CCEconstant* target = (CCEconstant*)node; + if(target->discrim == CES_STR) + nullfree(target->text); + } break; + + case CES_VALUE: { + CCEvalue* target = (CCEvalue*)node; + switch(target->discrim) { + case CES_CONST: ccefree((CCEnode*)target->constant); break; + case CES_VAR: ccefree((CCEnode*)target->var); break; + case CES_FCN: ccefree((CCEnode*)target->fcn); break; + default: assert(0); + } + } break; + + case CES_PROJECT: { + CCEprojection* target = (CCEprojection*)node; + switch (target->discrim) { + case CES_VAR: ccefree((CCEnode*)target->var); break; + case CES_FCN: ccefree((CCEnode*)target->fcn); break; + default: assert(0); + } + } break; + + case CES_SELECT: { + CCEselection* target = (CCEselection*)node; + ccefreelist(target->rhs); + ccefree((CCEnode*)target->lhs); + } break; + + case CES_CONSTRAINT: { + CCEconstraint* target = (CCEconstraint*)node; + ccefreelist(target->projections); + ccefreelist(target->selections); + } break; + + case CES_SEGMENT: { + CCEsegment* target = (CCEsegment*)node; + target->rank = 0; + nullfree(target->name); + } break; + + case CES_SLICE: { + } break; + + default: + assert(0); + } + + /* final action */ + free(node); +} + +void +ccefreelist(NClist* list) +{ + int i; + if(list == NULL) return; + for(i=0;isort) { + + case CES_SLICE: { + CCEslice* slice = (CCEslice*)node; + size_t last = (slice->first+slice->length)-1; + if(last > slice->declsize && slice->declsize > 0) + last = slice->declsize - 1; + if(slice->count == 1) { + snprintf(tmp,sizeof(tmp),"[%lu]", + (unsigned long)slice->first); + } else if(slice->stride == 1) { + snprintf(tmp,sizeof(tmp),"[%lu:%lu]", + (unsigned long)slice->first, + (unsigned long)last); + } else { + snprintf(tmp,sizeof(tmp),"[%lu:%lu:%lu]", + (unsigned long)slice->first, + (unsigned long)slice->stride, + (unsigned long)last); + } + ncbytescat(buf,tmp); + } break; + + case CES_SEGMENT: { + CCEsegment* segment = (CCEsegment*)node; + int rank = segment->rank; + char* name = (segment->name?segment->name:""); + ncbytescat(buf,nulldup(name)); + if(!cceiswholesegment(segment)) { + for(i=0;islices+i; + ccetobuffer((CCEnode*)slice,buf); + } + } + } break; + + case CES_VAR: { + CCEvar* var = (CCEvar*)node; + ccelisttobuffer(var->segments,buf,"."); + } break; + + case CES_FCN: { + CCEfcn* fcn = (CCEfcn*)node; + ncbytescat(buf,fcn->name); + ncbytescat(buf,"("); + ccelisttobuffer(fcn->args,buf,","); + ncbytescat(buf,")"); + } break; + + case CES_CONST: { + CCEconstant* value = (CCEconstant*)node; + switch (value->discrim) { + case CES_STR: + ncbytescat(buf,value->text); + break; + case CES_INT: + snprintf(tmp,sizeof(tmp),"%lld",value->intvalue); + ncbytescat(buf,tmp); + break; + case CES_FLOAT: + snprintf(tmp,sizeof(tmp),"%g",value->floatvalue); + ncbytescat(buf,tmp); + break; + default: assert(0); + } + } break; + + case CES_VALUE: { + CCEvalue* value = (CCEvalue*)node; + switch (value->discrim) { + case CES_CONST: + ccetobuffer((CCEnode*)value->constant,buf); + break; + case CES_VAR: + ccetobuffer((CCEnode*)value->var,buf); + break; + case CES_FCN: + ccetobuffer((CCEnode*)value->fcn,buf); + break; + default: assert(0); + } + } break; + + case CES_PROJECT: { + CCEprojection* target = (CCEprojection*)node; + switch (target->discrim) { + case CES_VAR: + ccetobuffer((CCEnode*)target->var,buf); + break; + case CES_FCN: ccetobuffer((CCEnode*)target->fcn,buf); break; + default: assert(0); + } + } break; + + case CES_SELECT: { + CCEselection* sel = (CCEselection*)node; + ccetobuffer((CCEnode*)sel->lhs,buf); + if(sel->operator == CES_NIL) break; + ncbytescat(buf,opstrings[(int)sel->operator]); + if(nclistlength(sel->rhs) > 1) + ncbytescat(buf,"{"); + ccelisttobuffer(sel->rhs,buf,","); + if(nclistlength(sel->rhs) > 1) + ncbytescat(buf,"}"); + } break; + + case CES_CONSTRAINT: { + CCEconstraint* con = (CCEconstraint*)node; + if(con->projections != NULL && nclistlength(con->projections) > 0) { + ccelisttobuffer(con->projections,buf,","); + } + if(con->selections != NULL && nclistlength(con->selections) > 0) { + ncbytescat(buf,"&"); /* because & is really a prefix */ + ccelisttobuffer(con->selections,buf,"&"); + } + } break; + + case CES_NIL: { + ncbytescat(buf,""); + } break; + + default: + assert(0); + } +} + +char* +ccelisttostring(NClist* list, char* sep) +{ + char* s; + NCbytes* buf = ncbytesnew(); + ccelisttobuffer(list,buf,sep); + s = ncbytesextract(buf); + ncbytesfree(buf); + return s; +} + +void +ccelisttobuffer(NClist* list, NCbytes* buf, char* sep) +{ + int i; + if(list == NULL || buf == NULL) return; + if(sep == NULL) sep = ","; + for(i=0;i0) ncbytescat(buf,sep); + ccetobuffer((CCEnode*)node,buf); + } +} + +/* Collect all nodes within a specified constraint tree */ +/* Caller frees result */ +NClist* +cceallnodes(CCEnode* node, CEsort which) +{ + NClist* allnodes = nclistnew(); + ceallnodesr(node,allnodes,which); + return allnodes; +} + +static void +ceallnodesr(CCEnode* node, NClist* allnodes, CEsort which) +{ + int i; + if(node == NULL) return; + if(nclistcontains(allnodes,(ncelem)node)) return; + if(which == CES_NIL || node->sort == which) + nclistpush(allnodes,(ncelem)node); + switch(node->sort) { + case CES_FCN: { + CCEfcn* fcn = (CCEfcn*)node; + for(i=0;iargs);i++) { + ceallnodesr((CCEnode*)nclistget(fcn->args,i),allnodes,which); + } + } break; + case CES_VAR: { + CCEvar* var = (CCEvar*)node; + for(i=0;isegments);i++) { + ceallnodesr((CCEnode*)nclistget(var->segments,i),allnodes,which); + } + } break; + case CES_VALUE: { + CCEvalue* value = (CCEvalue*)node; + if(value->discrim == CES_VAR) + ceallnodesr((CCEnode*)value->var,allnodes,which); + else if(value->discrim == CES_FCN) + ceallnodesr((CCEnode*)value->fcn,allnodes,which); + else + ceallnodesr((CCEnode*)value->constant,allnodes,which); + } break; + case CES_SELECT: { + CCEselection* selection = (CCEselection*)node; + ceallnodesr((CCEnode*)selection->lhs,allnodes,which); + for(i=0;irhs);i++) + ceallnodesr((CCEnode*)nclistget(selection->rhs,i),allnodes,which); + } break; + case CES_PROJECT: { + CCEprojection* projection = (CCEprojection*)node; + if(projection->discrim == CES_VAR) + ceallnodesr((CCEnode*)projection->var,allnodes,which); + else + ceallnodesr((CCEnode*)projection->fcn,allnodes,which); + } break; + case CES_CONSTRAINT: { + CCEconstraint* constraint = (CCEconstraint*)node; + for(i=0;iprojections);i++) + ceallnodesr((CCEnode*)nclistget(constraint->projections,i),allnodes,which); + for(i=0;iselections);i++) + ceallnodesr((CCEnode*)nclistget(constraint->selections,i),allnodes,which); + } break; + + /* All others have no subnodes */ + default: + break; + } +} + +CCEnode* +ccecreate(CEsort sort) +{ + CCEnode* node = NULL; + + switch (sort) { + + case CES_SLICE: { + CCEslice* target = (CCEslice*)calloc(1,sizeof(CCEslice)); + if(target == NULL) return NULL; + node = (CCEnode*)target; + } break; + + case CES_SEGMENT: { + int i; + CCEsegment* target = (CCEsegment*)calloc(1,sizeof(CCEsegment)); + if(target == NULL) return NULL; + /* Initialize the sort of the slices */ + for(i=0;islices[i].node.sort = CES_SLICE; + node = (CCEnode*)target; + } break; + + case CES_CONST: { + CCEconstant* target = (CCEconstant*)calloc(1,sizeof(CCEconstant)); + if(target == NULL) return NULL; + node = (CCEnode*)target; + target->discrim == CES_NIL; + } break; + + case CES_VALUE: { + CCEvalue* target = (CCEvalue*)calloc(1,sizeof(CCEvalue)); + if(target == NULL) return NULL; + node = (CCEnode*)target; + target->discrim == CES_NIL; + } break; + + case CES_VAR: { + CCEvar* target = (CCEvar*)calloc(1,sizeof(CCEvar)); + if(target == NULL) return NULL; + node = (CCEnode*)target; + } break; + + case CES_FCN: { + CCEfcn* target = (CCEfcn*)calloc(1,sizeof(CCEfcn)); + if(target == NULL) return NULL; + node = (CCEnode*)target; + } break; + + case CES_PROJECT: { + CCEprojection* target = (CCEprojection*)calloc(1,sizeof(CCEprojection)); + if(target == NULL) return NULL; + node = (CCEnode*)target; + } break; + + case CES_SELECT: { + CCEselection* target = (CCEselection*)calloc(1,sizeof(CCEselection)); + if(target == NULL) return NULL; + node = (CCEnode*)target; + target->operator = CEO_NIL; + } break; + + case CES_CONSTRAINT: { + CCEconstraint* target = (CCEconstraint*)calloc(1,sizeof(CCEconstraint)); + if(target == NULL) return NULL; + node = (CCEnode*)target; + } break; + + default: + assert(0); + } + + /* final action */ + node->sort = sort; + return node; +} + +void +ccemakewholeslice(CCEslice* slice, size_t declsize) +{ + slice->first = 0; + slice->stride = 1; + slice->length = declsize; + slice->stop = declsize; + slice->declsize = declsize; + slice->count = declsize; +} + +int +cceiswholeslice(CCEslice* slice) +{ + if(slice->first != 0 || slice->stride != 1) return 0; + return 1; +} + +int +cceiswholesegment(CCEsegment* seg) +{ + int i,whole; + NClist* dimset = NULL; + unsigned int rank; + + if(!seg->slicesdefined) return 0; /* actually, we don't know */ + whole = 1; /* assume so */ + for(i=0;irank;i++) { + if(!cceiswholeslice(&seg->slices[i])) {whole = 0; break;} + } + return whole; +} + +int +cceiswholevar(CCEvar* var) +{ + int i,whole; + whole = 1; /* assume so */ + for(i=0;isegments);i++) { + CCEsegment* segment = (CCEsegment*)nclistget(var->segments,i); + if(!cceiswholesegment(segment)) {whole = 0; break;} + } + return whole; +} + +int +ccesamepath(NClist* list1, NClist* list2) +{ + int i; + int len = nclistlength(list1); + if(len != nclistlength(list2)) return 0; + for(i=0;iname,s2->name) != 0) return 0; + } + return 1; +} diff --git a/libcdmr/cceconstraints.h b/libcdmr/cceconstraints.h new file mode 100644 index 000000000..e09f3a333 --- /dev/null +++ b/libcdmr/cceconstraints.h @@ -0,0 +1,126 @@ +/********************************************************************* + * Copyright 1993, UCAR/Unidata + * See netcdf/COPYRIGHT file for copying and redistribution conditions. + *********************************************************************/ +/* $Header$ */ + +#ifndef CCECONSTRAINTS_H +#define CCECONSTRAINTS_H 1 + +#include "ceconstraints.h" + +#ifndef NC_MAX_VAR_DIMS +#define NC_MAX_VAR_DIMS 1024 +#endif + +/* Provide a universal cast type containing common fields */ + +struct CDFnode; /* Forward */ + +typedef struct CCEnode { + CEsort sort; +} CCEnode; + +typedef struct CCEslice { + CCEnode node; + size_t first; + size_t count; + size_t length; /* count*stride */ + size_t stride; + size_t stop; /* == first + count*/ + size_t declsize; /* from defining dimension, if any.*/ +} CCEslice; + +typedef struct CCEsegment { + CCEnode node; + char* name; + int slicesdefined; /*1=>slice counts defined, except declsize*/ + int slicesdeclized; /*1=>slice declsize defined */ + size_t rank; + CCEslice slices[NC_MAX_VAR_DIMS]; + struct CDFnode* cdfnode; +} CCEsegment; + +typedef struct CCEfcn { + CCEnode node; + char* name; + NClist* args; +} CCEfcn; + +typedef struct CCEvar { + CCEnode node; + NClist* segments; + struct CDFnode* cdfnode; + struct CDFnode* cdfleaf; +} CCEvar; + +typedef struct CCEconstant { + CCEnode node; + CEsort discrim; + char* text; + long long intvalue; + double floatvalue; +} CCEconstant; + +typedef struct CCEvalue { + CCEnode node; + CEsort discrim; + /* Do not bother with a union */ + CCEconstant* constant; + CCEvar* var; + CCEfcn* fcn; +} CCEvalue; + +typedef struct CCEselection { + CCEnode node; + CEsort operator; + CCEvalue* lhs; + NClist* rhs; +} CCEselection; + +typedef struct CCEprojection { + CCEnode node; + CEsort discrim; + /* Do not bother with a union */ + CCEvar* var; + CCEfcn* fcn; +} CCEprojection; + +typedef struct CCEconstraint { + CCEnode node; + NClist* projections; + NClist* selections; +} CCEconstraint; + + +extern int cceparseconstraints(char* constraints, CCEconstraint* CCEonstraint); +extern int cceslicemerge(CCEslice* dst, CCEslice* src); +extern int ccemergeprojections(NClist* dst, NClist* src); + +extern char* ccebuildprojectionstring(NClist* projections); +extern char* ccebuildselectionstring(NClist* selections); +extern char* ccebuildconstraintstring(CCEconstraint* constraints); + +extern CCEnode* cceclone(CCEnode* node); +extern NClist* cceclonelist(NClist* list); + +extern void ccefree(CCEnode* node); +extern void ccefreelist(NClist* list); + +extern char* ccetostring(CCEnode* node); +extern char* ccelisttostring(NClist* list,char*); +extern void ccetobuffer(CCEnode* node, NCbytes* buf); +extern void ccelisttobuffer(NClist* list, NCbytes* buf,char*); + +extern NClist* cceallnodes(CCEnode* node, CEsort which); + +extern CCEnode* ccecreate(CEsort sort); + +extern void ccemakewholeslice(CCEslice* slice, size_t declsize); + +extern int cceiswholesegment(CCEsegment*); +extern int cceiswholeslice(CCEslice*); +extern int cceiswholeseglist(NClist*); +extern int ccesamepath(NClist* list1, NClist* list2); + +#endif /*CCECONSTRAINTS_H*/ diff --git a/libcdmr/ccelex.c b/libcdmr/ccelex.c new file mode 100644 index 000000000..3180a67e9 --- /dev/null +++ b/libcdmr/ccelex.c @@ -0,0 +1,223 @@ +/* Copyright 2009, UCAR/Unidata and OPeNDAP, Inc. + See the COPYRIGHT file for more information. */ + +#include "config.h" +#include +#include +#include +#include + +#include "netcdf.h" + +#include "nclist.h" +#include "ncbytes.h" +#include "cceconstraints.h" +#include "cceparselex.h" + +/* Forward */ +static void dumptoken(CCElexstate* lexstate); +static int tohex(int c); +static void ceaddyytext(CCElexstate* lex, int c); + +/****************************************************/ +#ifdef UNUSED +static char* worddelims = + "{}[]:;=,"; +#endif + +/* Define 1 and > 1st legal characters */ +static char* wordchars1 = + "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-+_/%\\"; +static char* wordcharsn = + "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-+_/%\\"; + +/* Number characters */ +static char* numchars1="+-0123456789"; +static char* numcharsn="Ee.+-0123456789"; + +/**************************************************/ + +static int +ccelex(YYSTYPE* lvalp, CCEparsestate* state) +{ + CCElexstate* lexstate = state->lexstate; + int token; + int c; + int len; + char* p=lexstate->next; + token = 0; + ncbytesclear(lexstate->yytext); + ncbytesnull(lexstate->yytext); + p=lexstate->next; + while(token == 0 && (c=*p)) { + if(c <= ' ' || c >= '\177') {p++; continue;} + if(c == '"') { + int more = 1; + /* We have a SCAN_STRINGCONST */ + while(more && (c=*(++p))) { + switch (c) { + case '"': p++; more=0; break; + case '\\': + c=*(++p); + switch (c) { + case 'r': c = '\r'; break; + case 'n': c = '\n'; break; + case 'f': c = '\f'; break; + case 't': c = '\t'; break; + case 'x': { + int d1,d2; + c = '?'; + ++p; + d1 = tohex(*p++); + if(d1 < 0) { + cceerror(state,"Illegal \\xDD in SCAN_STRING"); + } else { + d2 = tohex(*p++); + if(d2 < 0) { + cceerror(state,"Illegal \\xDD in SCAN_STRING"); + } else { + c=(((unsigned int)d1)<<4) | (unsigned int)d2; + } + } + } break; + default: break; + } + break; + default: break; + } + ceaddyytext(lexstate,c); + } + token=SCAN_STRINGCONST; + } else if(strchr(numchars1,c) != NULL) { + /* we might have a SCAN_NUMBERCONST */ + int isnumber = 0; + char* yytext; + char* endpoint; + ceaddyytext(lexstate,c); + for(p++;(c=*p);p++) { + if(strchr(numcharsn,c) == NULL) break; + ceaddyytext(lexstate,c); + } + /* See if this is a number */ + ncbytesnull(lexstate->yytext); + yytext = ncbytescontents(lexstate->yytext); + (void)strtoll(yytext,&endpoint,10); + if(*yytext != '\0' && *endpoint == '\0') + isnumber = 1; + else { + (void)strtod(yytext,&endpoint); + if(*yytext != '\0' && *endpoint == '\0') + isnumber = 1; /* maybe */ + } + /* A number followed by an id char is assumed to just be + a funny id */ + if(isnumber && (*p == '\0' || strchr(wordcharsn,*p) == NULL)) { + token = SCAN_NUMBERCONST; + } else { + /* Now, if the funny word has a "." in it, + we have to back up to that dot */ + char* dotpoint = strchr(yytext,'.'); + if(dotpoint != NULL) { + p = dotpoint; + *dotpoint = '\0'; + } + token = SCAN_WORD; + } + } else if(strchr(wordchars1,c) != NULL) { + /* we have a SCAN_WORD */ + ceaddyytext(lexstate,c); + for(p++;(c=*p);p++) { + if(strchr(wordcharsn,c) == NULL) break; + ceaddyytext(lexstate,c); + } + token=SCAN_WORD; + } else { + /* we have a single char token */ + token = c; + ceaddyytext(lexstate,c); + p++; + } + } + lexstate->next = p; + len = ncbyteslength(lexstate->yytext); + if(len > MAX_TOKEN_LENGTH) len = MAX_TOKEN_LENGTH; + strncpy(lexstate->lasttokentext,ncbytescontents(lexstate->yytext),len); + lexstate->lasttokentext[len] = '\0'; + lexstate->lasttoken = token; +#ifdef PARSEDEBUG + if(ccedebug) dumptoken(lexstate); +#endif + + /*Put return value onto Bison stack*/ + + if(ncbyteslength(lexstate->yytext) == 0) + *lvalp = NULL; + else { + *lvalp = ncbytesdup(lexstate->yytext); + nclistpush(lexstate->reclaim,(ncelem)*lvalp); + } + + return token; +} + +static void +ceaddyytext(CCElexstate* lex, int c) +{ + ncbytesappend(lex->yytext,(char)c); +} + +static int +tohex(int c) +{ + if(c >= 'a' && c <= 'f') return (c - 'a') + 0xa; + if(c >= 'A' && c <= 'F') return (c - 'A') + 0xa; + if(c >= '0' && c <= '9') return (c - '0'); + return -1; +} + +static void +dumptoken(CCElexstate* lexstate) +{ + switch (lexstate->lasttoken) { + case SCAN_STRINGCONST: + fprintf(stderr,"TOKEN = |\"%s\"|\n",lexstate->lasttokentext); + break; + case SCAN_WORD: + case SCAN_NUMBERCONST: + default: + fprintf(stderr,"TOKEN = |%s|\n",lexstate->lasttokentext); + break; + } +} + +static void +ccelexinit(char* input, CCElexstate** lexstatep) +{ + CCElexstate* lexstate = (CCElexstate*)malloc(sizeof(CCElexstate)); + if(lexstatep) *lexstatep = lexstate; + if(lexstate == NULL) return; + memset((void*)lexstate,0,sizeof(CCElexstate)); + lexstate->input = strdup(input); + lexstate->next = lexstate->input; + lexstate->yytext = ncbytesnew(); + lexstate->reclaim = nclistnew(); +} + +static void +ccelexcleanup(CCElexstate** lexstatep) +{ + CCElexstate* lexstate = *lexstatep; + if(lexstate == NULL) return; + if(lexstate->input != NULL) free(lexstate->input); + if(lexstate->reclaim != NULL) { + while(nclistlength(lexstate->reclaim) > 0) { + char* word = (char*)nclistpop(lexstate->reclaim); + if(word) free(word); + } + nclistfree(lexstate->reclaim); + } + ncbytesfree(lexstate->yytext); + free(lexstate); + *lexstatep = NULL; +} + diff --git a/libcdmr/cceparse.c b/libcdmr/cceparse.c new file mode 100644 index 000000000..93b512d8e --- /dev/null +++ b/libcdmr/cceparse.c @@ -0,0 +1,244 @@ +/* Copyright 2009, UCAR/Unidata and OPeNDAP, Inc. + See the COPYRIGHT file for more information. */ + +/* Parser actions for constraint expressions */ + +/* Since oc does not use the constraint parser, + they functions all just abort if called. +*/ + +#include "config.h" +#include +#include +#include +#include + +#include "netcdf.h" + +#include "nclist.h" +#include "ncbytes.h" +#include "cceconstraints.h" +#include "cceparselex.h" + +#ifndef nulldup +#define nulldup(s) ((s)==NULL?NULL:strdup(s)) +#endif +#ifndef nullfree +#define nullfree(s) if((s)!=NULL) {free(s);} else {} +#endif + +#ifdef PARSEDEBUG +extern int ccedebug; +#endif + +static int ccelex(YYSTYPE* lvalp, CCEparsestate* state); +static void ccelexinit(char* input, CCElexstate** lexstatep); +static void ccelexcleanup(CCElexstate** lexstatep); + +static Object collectlist(Object list0, Object decl); + +static void +projections(CCEparsestate* state, Object list0) +{ + NClist* list = (NClist*)list0; + if(list != NULL) { + nclistfree(state->constraint->projections); + state->constraint->projections = list; + } +#ifdef DEBUG +fprintf(stderr," ce.projections: %s\n", + ccetostring((CCEnode*)state->constraint->projections)); +#endif +} + + +static Object +projectionlist(CCEparsestate* state, Object list0, Object decl) +{ + return collectlist(list0,decl); +} + +static Object +projection(CCEparsestate* state, Object varorfcn) +{ + CCEprojection* p = (CCEprojection*)ccecreate(CES_PROJECT); + CEsort tag = *(CEsort*)varorfcn; + if(tag == CES_FCN) + p->fcn = varorfcn; + else + p->var = varorfcn; + p->discrim = tag; +#ifdef DEBUG +fprintf(stderr," ce.projection: %s\n", + ccetostring((CCEnode*)p)); +#endif + return p; +} + +static Object +segmentlist(CCEparsestate* state, Object var0, Object decl) +{ + /* watch out: this is non-standard */ + NClist* list; + CCEvar* v = (CCEvar*)var0; + if(v==NULL) v = (CCEvar*)ccecreate(CES_VAR); + list = v->segments; + if(list == NULL) list = nclistnew(); + nclistpush(list,(ncelem)decl); + v->segments = list; + return v; +} + +static Object +segment(CCEparsestate* state, Object name, Object slices0) +{ + int i; + CCEsegment* segment = (CCEsegment*)ccecreate(CES_SEGMENT); + NClist* slices = (NClist*)slices0; + segment->name = strdup((char*)name); + if(slices != NULL && nclistlength(slices) > 0) { + segment->slicesdefined = 1; /* but not declsizes */ + for(i=0;islices[i] = *slice; + free(slice); + } + nclistfree(slices); + } else + segment->slicesdefined = 0; +#ifdef DEBUG +fprintf(stderr," ce.segment: %s\n", + dumpsegment(segment)); +#endif + return segment; +} + + +static Object +rangelist(CCEparsestate* state, Object list0, Object decl) +{ + return collectlist(list0,decl); +} + +static Object +range(CCEparsestate* state, Object sfirst, Object sstride, Object slast) +{ + CCEslice* slice = (CCEslice*)ccecreate(CES_SLICE); + unsigned long first,stride,last; + + /* Note: that incoming arguments are strings; we must convert to size_t; + but we do know they are legal integers or NULL */ + sscanf((char*)sfirst,"%lu",&first); /* always defined */ + if(slast != NULL) + sscanf((char*)slast,"%lu",&last); + else + last = first; + if(sstride != NULL) + sscanf((char*)sstride,"%lu",&stride); + else + stride = 1; /* default */ + + if(stride == 0) + cceerror(state,"Illegal index for range stride"); + if(last < first) + cceerror(state,"Illegal index for range last index"); + slice->first = first; + slice->stride = stride; + slice->stop = last + 1; + slice->length = slice->stop - slice->first; + slice->count = slice->length / slice->stride; +#ifdef DEBUG +fprintf(stderr," ce.slice: %s\n", + dumpslice(slice)); +#endif + return slice; +} + + +static Object +collectlist(Object list0, Object decl) +{ + NClist* list = (NClist*)list0; + if(list == NULL) list = nclistnew(); + nclistpush(list,(ncelem)decl); + return list; +} + +int +cceerror(CCEparsestate* state, char* msg) +{ + strcpy(state->errorbuf,msg); + state->errorcode=1; + return 0; +} + +static void +cce_parse_cleanup(CCEparsestate* state) +{ + ccelexcleanup(&state->lexstate); /* will free */ +} + +static CCEparsestate* +ce_parse_init(char* input, CCEconstraint* constraint) +{ + CCEparsestate* state = NULL; + if(input==NULL) { + cceerror(state,"ce_parse_init: no input buffer"); + } else { + state = (CCEparsestate*)calloc(1,sizeof(CCEparsestate)); + if(state==NULL) return (CCEparsestate*)NULL; + state->errorbuf[0] = '\0'; + state->errorcode = 0; + ccelexinit(input,&state->lexstate); + state->constraint = constraint; + } + return state; +} + +/* Wrapper for ceparse */ +int +cdmceparse(char* input, CCEconstraint* constraint, char** errmsgp) +{ + CCEparsestate* state; + int errcode = 0; + +#ifdef PARSEDEBUG +ccedebug = 1; +#endif + + if(input != NULL) { +#ifdef DEBUG +fprintf(stderr,"cceeparse: input=%s\n",input); +#endif + state = ce_parse_init(input,constraint); + if(cceparse(state) == 0) { +#ifdef DEBUG +if(nclistlength(constraint->projections) > 0) +fprintf(stderr,"cceeparse: projections=%s\n", + ccetostring((CCEnode*)constraint->projections)); +#endif +#ifdef DEBUG +if(nclistlength(constraint->selections) > 0) +fprintf(stderr,"cceeparse: selections=%s\n", + dumpselections(constraint->selections)); +#endif + } else { + if(errmsgp) *errmsgp = nulldup(state->errorbuf); + } + errcode = state->errorcode; + cce_parse_cleanup(state); + } + return errcode; +} + +#ifdef PARSEDEBUG +Object +debugobject(Object o) +{ + return o; +} +#endif + +#include "ccelex.c" + +#include "ccetab.c" diff --git a/libcdmr/cceparselex.h b/libcdmr/cceparselex.h new file mode 100644 index 000000000..ec8754afd --- /dev/null +++ b/libcdmr/cceparselex.h @@ -0,0 +1,89 @@ +/* Copyright 2009, UCAR/Unidata and OPeNDAP, Inc. + See the COPYRIGHT file for more information. */ + +#ifndef CCEPARSELEX_H +#define CCEPARSELEX_H + +#include "config.h" +#include "ccetab.h" + +#ifdef WIN32 +#define strcasecmp stricmp +#define snprintf _snprintf +#endif + +/* For consistency with Java parser */ +#ifndef null +#define null NULL +#endif + +typedef void* Object; + +#define YYSTYPE Object + +#define MAX_TOKEN_LENGTH 1024 + +/*! Specifies CCElexstate. */ +typedef struct CCElexstate { + 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 */ +} CCElexstate; + +/*! Specifies CCEparsestate. */ +typedef struct CCEparsestate { + CCEconstraint* constraint; + char errorbuf[1024]; + int errorcode; + CCElexstate* lexstate; +} CCEparsestate; + +/* Define a generic object carrier; this serves + essentially the same role as the typical bison %union + declaration +*/ + +#ifdef IGNORE +extern int ceerror(CCEparsestate*,char*); +extern void ce_parse_error(CCEparsestate*,const char *fmt, ...); + +/* bison parse entry point */ +extern int cceparse(CCEparsestate*); + +extern int yyerror(CCEparsestate* state, char* msg); +extern void projections(CCEparsestate* state, Object list0); +extern Object projectionlist(CCEparsestate* state, Object list0, Object decl); +extern Object projection(CCEparsestate* state, Object segmentlist); +extern Object segmentlist(CCEparsestate* state, Object list0, Object decl); +extern Object segment(CCEparsestate* state, Object name, Object slices0); +extern Object range(CCEparsestate* state, Object, Object, Object); +extern Object indexer(CCEparsestate* state, Object name, Object indices); +extern Object indexpath(CCEparsestate* state, Object list0, Object index); +extern Object var(CCEparsestate* state, Object indexpath); +extern Object range1(CCEparsestate* state, Object rangenumber); +extern Object rangelist(CCEparsestate* state, Object list0, Object decl); + +/* lexer interface */ +extern int ccelex(YYSTYPE*, CCEparsestate*); +extern void ccelexinit(char* input, CCElexstate** lexstatep); +extern void ccelexcleanup(CCElexstate** lexstatep); +#endif + +extern int cdmceparse(char* input, CCEconstraint*, char**); + + +#ifdef PARSEDEBUG +extern int ccedebug; +extern Object debugobject(Object); +#define checkobject(x) debugobject(x) +#else +#define checkobject(x) (x) +#endif + + +#endif /*CCEPARSELEX_H*/ + diff --git a/libcdmr/ccetab.c b/libcdmr/ccetab.c new file mode 100644 index 000000000..961ef6533 --- /dev/null +++ b/libcdmr/ccetab.c @@ -0,0 +1,1679 @@ +/* A Bison parser, made by GNU Bison 2.4.3. */ + +/* Skeleton implementation for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, + 2009, 2010 Free Software Foundation, Inc. + + 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, either version 3 of the License, or + (at your option) any later version. + + 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, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Bison version. */ +#define YYBISON_VERSION "2.4.3" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 1 + +/* Push parsers. */ +#define YYPUSH 0 + +/* Pull parsers. */ +#define YYPULL 1 + +/* Using locations. */ +#define YYLSP_NEEDED 0 + +/* Substitute the variable and function names. */ +#define yyparse cceparse +#define yylex ccelex +#define yyerror cceerror +#define yylval ccelval +#define yychar ccechar +#define yydebug ccedebug +#define yynerrs ccenerrs + + +/* Copy the first part of user declarations. */ + +/* Line 189 of yacc.c */ +#line 11 "cce.y" + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include +#include "netcdf.h" +#include "ncbytes.h" +#include "nclist.h" +#include "cceconstraints.h" +#include "cceparselex.h" + + +/* Line 189 of yacc.c */ +#line 93 "cce.tab.c" + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 1 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + SCAN_WORD = 258, + SCAN_STRINGCONST = 259, + SCAN_NUMBERCONST = 260 + }; +#endif + + + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef int YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +#endif + + +/* Copy the second part of user declarations. */ + + +/* Line 264 of yacc.c */ +#line 140 "cce.tab.c" + +#ifdef short +# undef short +#endif + +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; +#endif + +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#elif (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +typedef signed char yytype_int8; +#else +typedef short int yytype_int8; +#endif + +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif + +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned int +# endif +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(e) ((void) (e)) +#else +# define YYUSE(e) /* empty */ +#endif + +/* Identity function, used to suppress warnings about constant conditions. */ +#ifndef lint +# define YYID(n) (n) +#else +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static int +YYID (int yyi) +#else +static int +YYID (yyi) + int yyi; +#endif +{ + return yyi; +} +#endif + +#if ! defined yyoverflow || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined _STDLIB_H \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# endif +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ + + +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + yytype_int16 yyss_alloc; + YYSTYPE yyvs_alloc; +}; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (YYID (0)) + +#endif + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 4 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 22 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 12 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 12 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 20 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 29 + +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 260 + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +static const yytype_uint8 yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 7, 2, 8, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 11, 2, + 2, 2, 2, 6, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 9, 2, 10, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5 +}; + +#if YYDEBUG +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +static const yytype_uint8 yyprhs[] = +{ + 0, 0, 3, 6, 7, 9, 10, 12, 14, 18, + 20, 22, 26, 28, 31, 33, 36, 40, 46, 54, + 56 +}; + +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int8 yyrhs[] = +{ + 13, 0, -1, 14, 15, -1, -1, 6, -1, -1, + 16, -1, 17, -1, 16, 7, 17, -1, 18, -1, + 19, -1, 18, 8, 19, -1, 22, -1, 22, 20, + -1, 21, -1, 20, 21, -1, 9, 23, 10, -1, + 9, 23, 11, 23, 10, -1, 9, 23, 11, 23, + 11, 23, 10, -1, 3, -1, 5, -1 +}; + +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const yytype_uint8 yyrline[] = +{ + 0, 34, 34, 35, 38, 38, 41, 45, 47, 52, + 57, 59, 64, 66, 71, 73, 78, 80, 82, 87, + 90 +}; +#endif + +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "$end", "error", "$undefined", "SCAN_WORD", "SCAN_STRINGCONST", + "SCAN_NUMBERCONST", "'?'", "','", "'.'", "'['", "']'", "':'", "$accept", + "constraints", "optquestionmark", "projections", "projectionlist", + "projection", "segmentlist", "segment", "rangelist", "range", "word", + "number", 0 +}; +#endif + +# ifdef YYPRINT +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ +static const yytype_uint16 yytoknum[] = +{ + 0, 256, 257, 258, 259, 260, 63, 44, 46, 91, + 93, 58 +}; +# endif + +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 12, 13, 13, 14, 14, 15, 16, 16, 17, + 18, 18, 19, 19, 20, 20, 21, 21, 21, 22, + 23 +}; + +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 2, 0, 1, 0, 1, 1, 3, 1, + 1, 3, 1, 2, 1, 2, 3, 5, 7, 1, + 1 +}; + +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ +static const yytype_uint8 yydefact[] = +{ + 3, 4, 0, 0, 1, 19, 2, 6, 7, 9, + 10, 12, 0, 0, 0, 13, 14, 8, 11, 20, + 0, 15, 16, 0, 0, 17, 0, 0, 18 +}; + +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int8 yydefgoto[] = +{ + -1, 2, 3, 6, 7, 8, 9, 10, 15, 16, + 11, 20 +}; + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +#define YYPACT_NINF -23 +static const yytype_int8 yypact[] = +{ + -3, -23, 2, 4, -23, -23, -23, 3, -23, 5, + -23, 6, 4, 4, 7, 6, -23, -23, -23, -23, + -5, -23, -23, 7, -2, -23, 7, 1, -23 +}; + +/* YYPGOTO[NTERM-NUM]. */ +static const yytype_int8 yypgoto[] = +{ + -23, -23, -23, -23, -23, 8, -23, 9, -23, -1, + -23, -22 +}; + +/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule which + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ +#define YYTABLE_NINF -6 +static const yytype_int8 yytable[] = +{ + -5, 24, 4, 1, 27, 22, 23, 5, 25, 26, + 12, 28, 19, 13, 21, 14, 0, 0, 0, 0, + 17, 0, 18 +}; + +static const yytype_int8 yycheck[] = +{ + 3, 23, 0, 6, 26, 10, 11, 3, 10, 11, + 7, 10, 5, 8, 15, 9, -1, -1, -1, -1, + 12, -1, 13 +}; + +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const yytype_uint8 yystos[] = +{ + 0, 6, 13, 14, 0, 3, 15, 16, 17, 18, + 19, 22, 7, 8, 9, 20, 21, 17, 19, 5, + 23, 21, 10, 11, 23, 10, 11, 23, 10 +}; + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + + +/* Like YYERROR except do call yyerror. This remains here temporarily + to ease the transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. However, + YYFAIL appears to be in use. Nevertheless, it is formally deprecated + in Bison 2.4.2's NEWS entry, where a plan to phase it out is + discussed. */ + +#define YYFAIL goto yyerrlab +#if defined YYFAIL + /* This is here to suppress warnings from the GCC cpp's + -Wunused-macros. Normally we don't worry about that warning, but + some users do, and we want to make it easy for users to remove + YYFAIL uses, which will produce warnings from Bison 2.5. */ +#endif + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ + YYPOPSTACK (1); \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (parsestate, YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (YYID (0)) + + +#define YYTERROR 1 +#define YYERRCODE 256 + + +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (YYID (N)) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (YYID (0)) +#endif + + +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +#ifndef YY_LOCATION_PRINT +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif +#endif + + +/* YYLEX -- calling `yylex' with the right arguments. */ + +#ifdef YYLEX_PARAM +# define YYLEX yylex (&yylval, YYLEX_PARAM) +#else +# define YYLEX yylex (&yylval, parsestate) +#endif + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (YYID (0)) + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value, parsestate); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (YYID (0)) + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, CCEparsestate* parsestate) +#else +static void +yy_symbol_value_print (yyoutput, yytype, yyvaluep, parsestate) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; + CCEparsestate* parsestate; +#endif +{ + if (!yyvaluep) + return; + YYUSE (parsestate); +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# else + YYUSE (yyoutput); +# endif + switch (yytype) + { + default: + break; + } +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, CCEparsestate* parsestate) +#else +static void +yy_symbol_print (yyoutput, yytype, yyvaluep, parsestate) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; + CCEparsestate* parsestate; +#endif +{ + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + yy_symbol_value_print (yyoutput, yytype, yyvaluep, parsestate); + YYFPRINTF (yyoutput, ")"); +} + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) +#else +static void +yy_stack_print (yybottom, yytop) + yytype_int16 *yybottom; + yytype_int16 *yytop; +#endif +{ + YYFPRINTF (stderr, "Stack now"); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (YYID (0)) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_reduce_print (YYSTYPE *yyvsp, int yyrule, CCEparsestate* parsestate) +#else +static void +yy_reduce_print (yyvsp, yyrule, parsestate) + YYSTYPE *yyvsp; + int yyrule; + CCEparsestate* parsestate; +#endif +{ + int yynrhs = yyr2[yyrule]; + int yyi; + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], + &(yyvsp[(yyi + 1) - (yynrhs)]) + , parsestate); + YYFPRINTF (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyvsp, Rule, parsestate); \ +} while (YYID (0)) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + + +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static YYSIZE_T +yystrlen (const char *yystr) +#else +static YYSIZE_T +yystrlen (yystr) + const char *yystr; +#endif +{ + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; +} +# endif +# endif + +# ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static char * +yystpcpy (char *yydest, const char *yysrc) +#else +static char * +yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; +#endif +{ + char *yyd = yydest; + const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) +{ + int yyn = yypact[yystate]; + + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; + else + { + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; + +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +# endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + + if (yysize_overflow) + return YYSIZE_MAXIMUM; + + if (yyresult) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; + } +} +#endif /* YYERROR_VERBOSE */ + + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, CCEparsestate* parsestate) +#else +static void +yydestruct (yymsg, yytype, yyvaluep, parsestate) + const char *yymsg; + int yytype; + YYSTYPE *yyvaluep; + CCEparsestate* parsestate; +#endif +{ + YYUSE (yyvaluep); + YYUSE (parsestate); + + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + + switch (yytype) + { + + default: + break; + } +} + +/* Prevent warnings from -Wmissing-prototypes. */ +#ifdef YYPARSE_PARAM +#if defined __STDC__ || defined __cplusplus +int yyparse (void *YYPARSE_PARAM); +#else +int yyparse (); +#endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus +int yyparse (CCEparsestate* parsestate); +#else +int yyparse (); +#endif +#endif /* ! YYPARSE_PARAM */ + + + + + +/*-------------------------. +| yyparse or yypush_parse. | +`-------------------------*/ + +#ifdef YYPARSE_PARAM +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void *YYPARSE_PARAM) +#else +int +yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +#endif +#else /* ! YYPARSE_PARAM */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (CCEparsestate* parsestate) +#else +int +yyparse (parsestate) + CCEparsestate* parsestate; +#endif +#endif +{ +/* The lookahead symbol. */ +int yychar; + +/* The semantic value of the lookahead symbol. */ +YYSTYPE yylval; + + /* Number of syntax errors so far. */ + int yynerrs; + + int yystate; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + + /* The stacks and their tools: + `yyss': related to states. + `yyvs': related to semantic values. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs; + YYSTYPE *yyvsp; + + YYSIZE_T yystacksize; + + int yyn; + int yyresult; + /* Lookahead token as an internal (translated) token number. */ + int yytoken; + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + + yytoken = 0; + yyss = yyssa; + yyvs = yyvsa; + yystacksize = YYINITDEPTH; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + yyssp = yyss; + yyvsp = yyvs; + + goto yysetstate; + +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + + yysetstate: + *yyssp = yystate; + + if (yyss + yystacksize - 1 <= yyssp) + { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; + +#ifdef yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; + } +#else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyexhaustedlab; +# else + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif +#endif /* no yyoverflow */ + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + if (yystate == YYFINAL) + YYACCEPT; + + goto yybackup; + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + + /* Do appropriate processing given the current state. Read a + lookahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to lookahead token. */ + yyn = yypact[yystate]; + if (yyn == YYPACT_NINF) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = YYLEX; + } + + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yyn == 0 || yyn == YYTABLE_NINF) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the lookahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the shifted token. */ + yychar = YYEMPTY; + + yystate = yyn; + *++yyvsp = yylval; + + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 6: + +/* Line 1464 of yacc.c */ +#line 41 "cce.y" + {projections(parsestate,(yyvsp[(1) - (1)]));;} + break; + + case 7: + +/* Line 1464 of yacc.c */ +#line 46 "cce.y" + {(yyval)=projectionlist(parsestate,(Object)null,(yyvsp[(1) - (1)]));;} + break; + + case 8: + +/* Line 1464 of yacc.c */ +#line 48 "cce.y" + {(yyval)=projectionlist(parsestate,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));;} + break; + + case 9: + +/* Line 1464 of yacc.c */ +#line 53 "cce.y" + {(yyval)=projection(parsestate,(yyvsp[(1) - (1)]));;} + break; + + case 10: + +/* Line 1464 of yacc.c */ +#line 58 "cce.y" + {(yyval)=segmentlist(parsestate,null,(yyvsp[(1) - (1)]));;} + break; + + case 11: + +/* Line 1464 of yacc.c */ +#line 60 "cce.y" + {(yyval)=segmentlist(parsestate,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));;} + break; + + case 12: + +/* Line 1464 of yacc.c */ +#line 65 "cce.y" + {(yyval)=segment(parsestate,(yyvsp[(1) - (1)]),null);;} + break; + + case 13: + +/* Line 1464 of yacc.c */ +#line 67 "cce.y" + {(yyval)=segment(parsestate,(yyvsp[(1) - (2)]),(yyvsp[(2) - (2)]));;} + break; + + case 14: + +/* Line 1464 of yacc.c */ +#line 72 "cce.y" + {(yyval)=rangelist(parsestate,null,(yyvsp[(1) - (1)]));;} + break; + + case 15: + +/* Line 1464 of yacc.c */ +#line 74 "cce.y" + {(yyval)=rangelist(parsestate,(yyvsp[(1) - (2)]),(yyvsp[(2) - (2)]));;} + break; + + case 16: + +/* Line 1464 of yacc.c */ +#line 79 "cce.y" + {(yyval)=range(parsestate,(yyvsp[(2) - (3)]),null,null);;} + break; + + case 17: + +/* Line 1464 of yacc.c */ +#line 81 "cce.y" + {(yyval)=range(parsestate,(yyvsp[(2) - (5)]),null,(yyvsp[(4) - (5)]));;} + break; + + case 18: + +/* Line 1464 of yacc.c */ +#line 83 "cce.y" + {(yyval)=range(parsestate,(yyvsp[(2) - (7)]),(yyvsp[(4) - (7)]),(yyvsp[(6) - (7)]));;} + break; + + case 19: + +/* Line 1464 of yacc.c */ +#line 88 "cce.y" + {(yyval) = checkobject((yyvsp[(1) - (1)]));;} + break; + + case 20: + +/* Line 1464 of yacc.c */ +#line 91 "cce.y" + {(yyval) = checkobject((yyvsp[(1) - (1)]));;} + break; + + + +/* Line 1464 of yacc.c */ +#line 1466 "cce.tab.c" + default: break; + } + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + + *++yyvsp = yyval; + + /* Now `shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; + + goto yynewstate; + + +/*------------------------------------. +| yyerrlab -- here on detecting error | +`------------------------------------*/ +yyerrlab: + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; +#if ! YYERROR_VERBOSE + yyerror (parsestate, YY_("syntax error")); +#else + { + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + } + } + + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (parsestate, yymsg); + } + else + { + yyerror (parsestate, YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } + } +#endif + } + + + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval, parsestate); + yychar = YYEMPTY; + } + } + + /* Else will try to reuse lookahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) + goto yyerrorlab; + + /* Do not reclaim the symbols of the rule which action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + for (;;) + { + yyn = yypact[yystate]; + if (yyn != YYPACT_NINF) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + + yydestruct ("Error: popping", + yystos[yystate], yyvsp, parsestate); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + *++yyvsp = yylval; + + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturn; + +#if !defined(yyoverflow) || YYERROR_VERBOSE +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (parsestate, YY_("memory exhausted")); + yyresult = 2; + /* Fall through. */ +#endif + +yyreturn: + if (yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval, parsestate); + /* Do not reclaim the symbols of the rule which action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp, parsestate); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + /* Make sure YYID is used. */ + return YYID (yyresult); +} + + + +/* Line 1684 of yacc.c */ +#line 94 "cce.y" + + diff --git a/libcdmr/ccetab.h b/libcdmr/ccetab.h new file mode 100644 index 000000000..b7336bdc3 --- /dev/null +++ b/libcdmr/ccetab.h @@ -0,0 +1,58 @@ +/* A Bison parser, made by GNU Bison 2.4.3. */ + +/* Skeleton interface for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, + 2009, 2010 Free Software Foundation, Inc. + + 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, either version 3 of the License, or + (at your option) any later version. + + 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, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + SCAN_WORD = 258, + SCAN_STRINGCONST = 259, + SCAN_NUMBERCONST = 260 + }; +#endif + + + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef int YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +#endif + + + + diff --git a/libcdmr/curlwrap.c b/libcdmr/curlwrap.c index 6cb56f16e..276597203 100644 --- a/libcdmr/curlwrap.c +++ b/libcdmr/curlwrap.c @@ -165,8 +165,8 @@ nccr_fetchurl(CURL* curl, char* url, bytes_t* buf, long* filetime) endex = crstrindex(buf->bytes,""); if(endex >= 0) endex += 7; else endex = buf->nbytes-1; nclog(NCLOGWARN,"Probable Server error"); - nclogtext(NCLOGWARN,buf->bytes+first,endex-first); - nclogtext(NCLOGWARN,"\n",1); + nclogtextn(NCLOGWARN,buf->bytes+first,endex-first); + nclogtext(NCLOGWARN,"\n"); } return stat; diff --git a/libcdmr/nccr.c b/libcdmr/nccr.c index 8d98d4b0d..d4a0a5b43 100644 --- a/libcdmr/nccr.c +++ b/libcdmr/nccr.c @@ -40,8 +40,8 @@ extern NC_FILE_INFO_T* nc_file; -static NCerror skiptoheader(bytes_t* packet, size_t* offsetp); static void freeNCCDMR(NCCDMR* cdmr); +static int nccr_elide_vars(NCCDMR* cdmr); /**************************************************/ int @@ -226,37 +226,11 @@ NCCR_close(int ncid) /* Auxilliary routines */ /**************************************************/ -static NCerror -skiptoheader(bytes_t* packet, size_t* offsetp) +static int +nccr_elide_vars(NCCDMR* cdmr) { - NCerror status = NC_NOERR; - unsigned long long vlen; - size_t size,offset; - - /* Check the structure of the resulting data */ - if(packet->nbytes < (strlen(MAGIC_HEADER) + strlen(MAGIC_HEADER))) { - nclog(NCLOGERR,"Curl data too short: %d\n",packet->nbytes); - status = NC_ECURL; - goto done; - } - if(memcmp(packet->bytes,MAGIC_HEADER,strlen(MAGIC_HEADER)) != 0) { - nclog(NCLOGERR,"MAGIC_HEADER missing\n"); - status = NC_ECURL; - goto done; - } - offset = strlen(MAGIC_HEADER); - /* Extract the proposed count as a varint */ - vlen = varint_decode(10,packet->bytes+offset,&size); - offset += size; - if(vlen != (packet->nbytes-offset)) { - nclog(NCLOGERR,"Curl data size mismatch\n"); - status = NC_ECURL; - goto done; - } - if(offsetp) *offsetp = offset; - -done: - return status; + int ncstat = NC_NOERR; + return ncstat; } static void diff --git a/libcdmr/nccr.h b/libcdmr/nccr.h index 63c55d60c..b85291a01 100644 --- a/libcdmr/nccr.h +++ b/libcdmr/nccr.h @@ -76,16 +76,6 @@ extern char* nulldup(const char*); #define nulllen(s) (s==NULL?0:strlen(s)) #define nullstring(s) (s==NULL?"(null)":s) -/**************************************************/ -/* Define cdmremote magic numbers */ - -#define MAGIC_START "\x43\x44\x46\x53" -#define MAGIC_END "\xed\xed\xde\xde" -#define MAGIC_HEADER "\xad\xec\xce\xda" -#define MAGIC_DATA "\xab\xec\xce\xba" -#define MAGIC_ERR "\xab\xad\xba\xda" - - /**********************************************************/ /* Forwards */ struct Header; diff --git a/libcdmr/nccrconstraints.c b/libcdmr/nccrconstraints.c deleted file mode 100755 index 489608ef8..000000000 --- a/libcdmr/nccrconstraints.c +++ /dev/null @@ -1,173 +0,0 @@ -/********************************************************************* - * Copyright 1993, UCAR/Unidata - * See netcdf/COPYRIGHT file for copying and redistribution conditions. - * $Header: /upc/share/CVS/netcdf-3/libncdap4/constraints4.c,v 1.9 2010/04/13 03:36:31 dmh Exp $ - *********************************************************************/ -#include "ncdap4.h" -#include "dapodom.h" - -#ifdef DEBUG -#include "dapdump.h" -#endif - -/* In order to construct the projection, -we need to make sure to match the relevant dimensions -against the relevant nodes in which the ultimate target -is contained. -*/ -int -crbuildvaraprojection(Getvara* getvar, - const size_t* startp, const size_t* countp, const ptrdiff_t* stridep, - CRCprojection** projectionp) -{ - int i; - int ncstat = NC_NOERR; - NClist* dimset; - CDFnode* var = getvar->target; - CRCprojection* projection = NULL; - NClist* segments = NULL; - NCsegment* segment; - - segment = createncsegment(); - segment->node = var; - ASSERT((segment->node != NULL)); - segment->name = nulldup(segment->node->name); - segment->slicesdefined = 0; /* temporary */ - segments = nclistnew(); - nclistpush(segments,(ncelem)segment); - - projection = createCRCprojection(); - projection->discrim = NS_VAR; - projection->var = createncvar(); - projection->var->leaf = var; - projection->var->segments = segments; - - /* All slices are assigned to the first (and only segment) */ - dimset = var->array.dimensions; - segment->slicerank = nclistlength(var->array.dimensions); - for(i=0;islicerank;i++) { - NCslice* slice = &segment->slices[i]; - CDFnode* dim = (CDFnode*)nclistget(dimset,i); - slice->first = startp[i]; - slice->stride = stridep[i]; - slice->count = countp[i]; - slice->length = slice->count * slice->stride; - slice->stop = (slice->first + slice->length); - ASSERT(dim->dim.declsize > 0); - slice->declsize = dim->dim.declsize; - } - segment->slicesdefined = 1; - - if(projectionp) *projectionp = projection; - if(ncstat) freeCRCprojection(projection); - return ncstat; -} - -/* Compute the set of prefetched data */ -int -crprefetchdata(NCCR* drno) -{ - int i,j; - int ncstat = NC_NOERR; - NClist* allvars = drno->dap.cdf.varnodes; - NCconstraint* constraint = drno->dap.oc.dapconstraint; - NClist* vars = nclistnew(); - NCcachenode* cache = NULL; - NCconstraint* newconstraint; - - /* If caching is off, and we can do constraints, then - don't even do prefetch - */ - if(!FLAGSET(drno->dap.controls,NCF_CACHE) && !FLAGSET(drno->dap.controls,NCF_UNCONSTRAINABLE)) { - drno->dap.cdf.cache->prefetch = NULL; - goto done; - } - - for(i=0;iarray.dimensions);j++) { - CDFnode* dim = (CDFnode*)nclistget(var->array.dimensions,j); - nelems *= dim->dim.declsize; - } - /* If we cannot constrain, then pull in everything */ - if(FLAGSET(drno->dap.controls,NCF_UNCONSTRAINABLE) - || nelems <= drno->dap.cdf.smallsizelimit) - nclistpush(vars,(ncelem)var); - } - - /* If we cannot constrain, then pull in everything */ - newconstraint = createncconstraint(); - if(FLAGSET(drno->dap.controls,NCF_UNCONSTRAINABLE)) { - newconstraint->projections = NULL; - newconstraint->selections= NULL; - } else { /* Construct the projections for this set of vars */ - /* Construct the projections for this set of vars */ - /* Initially, the constraints are same as the merged constraints */ - newconstraint->projections = cloneCRCprojections(constraint->projections); - crrestrictprojection3(vars,newconstraint->projections); - /* similar for selections */ - newconstraint->selections = clonencselections(constraint->selections); - } - - ncstat = crbuildcachenode3(&drno->dap,newconstraint,vars,&cache,0); - if(ncstat) goto done; - -if(FLAGSET(drno->dap.controls,NCF_SHOWFETCH)) { -/* Log the set of prefetch variables */ -NCbytes* buf = ncbytesnew(); -ncbytescat(buf,"prefetch.vars: "); -for(i=0;idap,cache); - } - return THROW(ncstat); -} - -#ifdef IGNORE -/* Based on the tactic, determine the set of variables to add */ -static void -crcomputevarset(NCCR* drno, Getvara* getvar, NClist* varlist) -{ - int i; - nclistclear(varlist); - for(i=0;idap.cdf.varnodes);i++) { - CDFnode* var = (CDFnode*)nclistget(drno->dap.cdf.varnodes,i); -#ifdef IGNORE - int ok = 1; - for(j=0;jarray.ncdimensions);j++) { - CDFnode* dim = (CDFnode*)nclistget(var->array.ncdimensions,j); - if(dim->dim.declsize == NC_UNLIMITED) {ok = 0; break;} - } - if(!ok) continue; -#endif - switch (getvar->tactic->tactic) { - case tactic_all: /* add all visible variables */ - nclistpush(varlist,(ncelem)var); - break; - case tactic_partial: /* add only small variables + target */ - if(var->estimatedsize < drno->dap.cdf.smallsizelimit - || getvar->target == var) { - nclistpush(varlist,(ncelem)var); - } - break; - case tactic_var: /* add only target var */ - if(getvar->target == var) nclistpush(varlist,(ncelem)var); - break; - default: break; - } - } -} -#endif - diff --git a/libcdmr/nccrconstraints.h b/libcdmr/nccrconstraints.h deleted file mode 100644 index 6835e8a8d..000000000 --- a/libcdmr/nccrconstraints.h +++ /dev/null @@ -1,108 +0,0 @@ -/********************************************************************* - * Copyright 1993, UCAR/Unidata - * See netcdf/COPYRIGHT file for copying and redistribution conditions. - * $Header: /upc/share/CVS/netcdf-3/libncconstraints/ncconstraints.h,v 1.40 2010/05/30 19:45:52 dmh Exp $ - *********************************************************************/ -#ifndef NCCONSTRAINTS_H -#define NCCONSTRAINTS_H 1 - -typedef enum NCsort { -NS_NIL=0, -NS_EQ=1,NS_NEQ=2,NS_GE=3,NS_GT=4,NS_LT=5,NS_LE=6,NS_RE=7, -NS_STR=8,NS_INT=9,NS_FLOAT=10, -NS_VAR=11,NS_FCN=12,NS_CONST=13, -NS_SELECT=14, NS_PROJECT=15, -NS_SEGMENT=16, NS_SLICE=17, -NS_CONSTRAINT=18, -NS_VALUE=19 -} NCsort; - -/* Must match NCsort */ -#define OPSTRINGS \ -{"?","=","!=",">=",">","<=","<","=~","?","?","?","?","?","?","?","?","?","?","?"} - - -/* Provide a universal cast type */ -typedef struct NCany { - NCsort sort; -} NCany; - -/* -Store the relevant parameters for accessing -data for a particular variable -Break up the startp, countp, stridep into slices -to facilitate the odometer walk -*/ - -typedef struct NCslice { - NCsort sort; - size_t first; - size_t count; - size_t length; /* count*stride */ - size_t stride; - size_t stop; /* == first + count*/ - size_t declsize; /* from defining dimension, if any.*/ -} NCslice; - - -typedef struct NCsegment { - NCsort sort; - char* name; - struct CDFnode* node; - int slicesdefined; /* do we know yet if this has defined slices */ - unsigned int slicerank; /* Note: this is the rank as shown in the - projection; may be less than node->array.rank */ - NCslice slices[NC_MAX_VAR_DIMS]; -} NCsegment; - -typedef struct NCfcn { - NCsort sort; - char* name; - NClist* args; -} NCfcn; - -typedef struct NCvar { - NCsort sort; - NClist* segments; - struct CDFnode* node; - /* Following duplicate info inferrable from the segments */ - struct CDFnode* leaf; -} NCvar; - -typedef struct NCconstant { - NCsort sort; - NCsort discrim; - char* text; - long long intvalue; - double floatvalue; -} NCconstant; - -typedef struct NCvalue { - NCsort sort; - NCsort discrim; - NCconstant* constant; - NCvar* var; - NCfcn* fcn; -} NCvalue; - -typedef struct NCselection { - NCsort sort; - NCsort operator; - NCvalue* lhs; - NClist* rhs; -} NCselection; - -typedef struct NCprojection { - NCsort sort; - NCsort discrim; - NCvar* var; - NCfcn* fcn; -} NCprojection; - -typedef struct NCconstraint { - NCsort sort; - NClist* projections; - NClist* selections; -} NCconstraint; - -#endif /*NCCONSTRAINTS_H*/ diff --git a/libcdmr/nccrproto.c b/libcdmr/nccrproto.c index f568e8af5..de6d9fd7b 100644 --- a/libcdmr/nccrproto.c +++ b/libcdmr/nccrproto.c @@ -13,6 +13,7 @@ #include "nclist.h" #include "ncbytes.h" +#include "nclog.h" #include "netcdf.h" #include "ast.h" @@ -33,6 +34,17 @@ static void annotate(Group*, CRnode*, Sort, NClist*); static void computepathname(CRnode* leaf); static char* getname(CRnode* node); +static int skiptoheader(bytes_t* packet, size_t* offsetp); + +/**************************************************/ +/* Define cdmremote magic numbers */ + +#define MAGIC_START "\x43\x44\x46\x53" +#define MAGIC_END "\xed\xed\xde\xde" +#define MAGIC_HEADER "\xad\xec\xce\xda" +#define MAGIC_DATA "\xab\xec\xce\xba" +#define MAGIC_ERR "\xab\xad\xba\xda" + int nccr_cvtasterr(ast_err err) { @@ -408,3 +420,36 @@ nccr_deref_dimensions(NClist* nodes) } nclistfree(replaced); } + +static int +skiptoheader(bytes_t* packet, size_t* offsetp) +{ + int status = NC_NOERR; + unsigned long long vlen; + size_t size,offset; + + /* Check the structure of the resulting data */ + if(packet->nbytes < (strlen(MAGIC_HEADER) + strlen(MAGIC_HEADER))) { + nclog(NCLOGERR,"Curl data too short: %d\n",packet->nbytes); + status = NC_ECURL; + goto done; + } + if(memcmp(packet->bytes,MAGIC_HEADER,strlen(MAGIC_HEADER)) != 0) { + nclog(NCLOGERR,"MAGIC_HEADER missing\n"); + status = NC_ECURL; + goto done; + } + offset = strlen(MAGIC_HEADER); + /* Extract the proposed count as a varint */ + vlen = varint_decode(10,packet->bytes+offset,&size); + offset += size; + if(vlen != (packet->nbytes-offset)) { + nclog(NCLOGERR,"Curl data size mismatch\n"); + status = NC_ECURL; + goto done; + } + if(offsetp) *offsetp = offset; + +done: + return status; +} diff --git a/liblib/Makefile.am b/liblib/Makefile.am index 82cf5eabc..bfc71374a 100755 --- a/liblib/Makefile.am +++ b/liblib/Makefile.am @@ -34,8 +34,8 @@ ${top_builddir}/libsrc/libnetcdf3.la # netcdf3 + dap if USE_DAP -AM_CPPFLAGS += -I${top_srcdir}/libncdap3 -I${top_srcdir}/oc -libnetcdf_la_LIBADD += ${top_builddir}/libncdap3/libncdap3.la +AM_CPPFLAGS += -I${top_srcdir}/libdap2 -I${top_srcdir}/oc +libnetcdf_la_LIBADD += ${top_builddir}/libdap2/libdap2.la libnetcdf_la_LIBADD += ${top_builddir}/oc/liboc.la endif # USE_DAP @@ -45,11 +45,6 @@ if USE_NETCDF4 AM_CPPFLAGS += -I${top_srcdir}/libsrc4 libnetcdf_la_LIBADD += ${top_builddir}/libsrc4/libnetcdf4.la -# netcdf4+dap -if USE_DAP -libnetcdf_la_LIBADD += ${top_builddir}/libncdap4/libncdap4.la -endif # USE_DAP - # netcdf4+cdmremote if BUILD_CDMREMOTE libnetcdf_la_LIBADD += ${top_builddir}/libcdmr/libnccr.la diff --git a/libncdap3/Makefile.am b/libncdap3/Makefile.am index 08388aa2e..f27a6885e 100755 --- a/libncdap3/Makefile.am +++ b/libncdap3/Makefile.am @@ -47,8 +47,7 @@ daputil.h \ dapdebug.h \ dapdump.h \ dceconstraints.h \ -dcetab.h dceparselex.h \ -ceconstraints.h +dcetab.h dceparselex.h if BUILD_DAP diff --git a/libncdap3/dapodom.h b/libncdap3/dapodom.h index bf38e5ebe..c0af66abf 100644 --- a/libncdap3/dapodom.h +++ b/libncdap3/dapodom.h @@ -1,17 +1,15 @@ /********************************************************************* * Copyright 1993, UCAR/Unidata * See netcdf/COPYRIGHT file for copying and redistribution conditions. - * $Header: /upc/share/CVS/netcdf-3/libncdap3/dapodom.h,v 1.10 2010/05/27 21:34:08 dmh Exp $ + * $Header$ *********************************************************************/ -/* Copyright 2009, UCAR/Unidata and OPeNDAP, Inc. - See the COPYRIGHT file for more information. */ #ifndef DAPODOM_H #define DAPODOM_H 1 typedef struct Dapodometer { int rank; - DCEslice slices[NC_MAX_VAR_DIMS]; + DCEslice slices[NC_MAX_VAR_DIMS]; size_t index[NC_MAX_VAR_DIMS]; } Dapodometer; diff --git a/libncdap3/dceconstraints.h b/libncdap3/dceconstraints.h index 9d11871f3..1019fc575 100644 --- a/libncdap3/dceconstraints.h +++ b/libncdap3/dceconstraints.h @@ -9,18 +9,16 @@ #include "ceconstraints.h" -#ifndef NC_MAX_VAR_DIMS -#define NC_MAX_VAR_DIMS 1024 -#endif - /* Provide a universal cast type containing common fields */ struct CDFnode; /* Forward */ +/* Define the common "supertype */ typedef struct DCEnode { CEsort sort; } DCEnode; +/* The slice structure is assumed common to all uses */ typedef struct DCEslice { DCEnode node; size_t first;