/[MITgcm]/mitgcm.org/devel/buildweb/code-browser/F90Mapper/VarDic.y
ViewVC logotype

Annotation of /mitgcm.org/devel/buildweb/code-browser/F90Mapper/VarDic.y

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Fri Sep 20 19:47:31 2002 UTC (22 years, 9 months ago) by adcroft
Branch point for: Import, MAIN
Initial revision

1 adcroft 1.1 /* $Id: */
2    
3     /* Data dictionary -> HTML table translator */
4     %{
5     #include <stdio.h>
6     #include <string.h>
7     #include "DD.h"
8     #include "GLOBALS.h"
9     %}
10    
11     %union {
12     int LineNo;
13     char *stringPtr;
14     }
15    
16     %token <LineNo> HREF
17     %token <LineNo> TEXT
18     %token <LineNo> UNITS
19     %token <LineNo> NOTES
20     %token <stringPtr> NAME
21     %token <stringPtr> STRING
22     %type <stringPtr> stringList
23    
24     %%
25    
26     input: /* empty */
27     | input recordDefinition
28     ;
29     recordDefinition: name '{' tableEntries '}' {addRecord();}
30     | name {addRecord();}
31     ;
32     tableEntries: tableEntries tableEntry {}
33     | tableEntry {}
34     ;
35     tableEntry: HREF '=' stringList ';' {curHref = strdup($3);}
36     | TEXT '=' stringList ';' {fprintf(stdout,"TEXT %s found\n",$3);
37     curText = strdup($3);
38     fprintf(stdout,"TEXT %s found\n",$3);
39     fflush(stdout);}
40     | UNITS '=' stringList ';' {curUnits = strdup($3);}
41     | NOTES '=' stringList ';' {curFootNotes = strdup($3);}
42     | error ';'
43     ;
44     name: NAME {curName = strdup($1);
45     fprintf(stdout,"NAME %s found\n",curName);fflush(stdout);
46     }
47     ;
48     stringList: stringList STRING {$$=strjoin($1,$2); }
49     | STRING {$$=$1; }
50     ;
51     %%

  ViewVC Help
Powered by ViewVC 1.1.22