New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
convert.lex in branches/UKMO/dev_r5518_GO6_package/NEMOGCM/EXTERNAL/AGRIF/LIB – NEMO

source: branches/UKMO/dev_r5518_GO6_package/NEMOGCM/EXTERNAL/AGRIF/LIB/convert.lex @ 6486

Last change on this file since 6486 was 6486, checked in by davestorkey, 8 years ago

Remove SVN keywords from UKMO/dev_r5518_GO6_package branch.

File size: 4.0 KB
Line 
1/******************************************************************************/
2/*                                                                            */
3/*     CONV (converter) for Agrif (Adaptive Grid Refinement In Fortran)       */
4/*                                                                            */
5/* Copyright or   or Copr. Laurent Debreu (Laurent.Debreu@imag.fr)            */
6/*                        Cyril Mazauric (Cyril_Mazauric@yahoo.fr)            */
7/* This software is governed by the CeCILL-C license under French law and     */
8/* abiding by the rules of distribution of free software.  You can  use,      */
9/* modify and/ or redistribute the software under the terms of the CeCILL-C   */
10/* license as circulated by CEA, CNRS and INRIA at the following URL          */
11/* "http://www.cecill.info".                                                  */
12/*                                                                            */
13/* As a counterpart to the access to the source code and  rights to copy,     */
14/* modify and redistribute granted by the license, users are provided only    */
15/* with a limited warranty  and the software's author,  the holder of the     */
16/* economic rights,  and the successive licensors  have only  limited         */
17/* liability.                                                                 */
18/*                                                                            */
19/* In this respect, the user's attention is drawn to the risks associated     */
20/* with loading,  using,  modifying and/or developing or reproducing the      */
21/* software by the user in light of its specific status of free software,     */
22/* that may mean  that it is complicated to manipulate,  and  that  also      */
23/* therefore means  that it is reserved for developers  and  experienced      */
24/* professionals having in-depth computer knowledge. Users are therefore      */
25/* encouraged to load and test the software's suitability as regards their    */
26/* requirements in conditions enabling the security of their systems and/or   */
27/* data to be ensured and,  more generally, to use and operate it in the      */
28/* same conditions as regards security.                                       */
29/*                                                                            */
30/* The fact that you are presently reading this means that you have had       */
31/* knowledge of the CeCILL-C license and that you accept its terms.           */
32/******************************************************************************/
33/* version 1.7                                                                */
34/******************************************************************************/
35%s character
36%{
37#include <math.h>
38#include <stdlib.h>
39#include <string.h>
40int line_num=1;
41extern FILE * yyin;
42#define MAX_INCLUDE_DEPTH 30
43YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
44%}
45
46COMMENT "%"
47SEPARATEUR "::"
48NIMPORTEQUOI .
49COMMENTAIRES1 {COMMENT}{NIMPORTEQUOI}*{COMMENT}
50PROBTYPE "1D"|"2D"|"3D"
51USEITEM "FIXED_GRIDS"|"ONLY_FIXED_GRIDS"|"F77"
52NAME [a-zA-Z\_][a-zA-Z0-9\_]*
53DIGIT [0-9]+
54NEXTLINE \n+[ \t]+"$"|\n+[ \t]+"&"
55%%
56parammodule return TOK_MODULEMAIN; /* name of the module                      */
57notgriddep  return TOK_NOTGRIDDEP; /* variable which are not grid dependent   */
58use         return TOK_USE;
59{COMMENTAIRES1}    {}
60{SEPARATEUR}        return TOK_SEP;
61{USEITEM}          {strcpy(yylval.na,yytext); return TOK_USEITEM;}
62{PROBTYPE}         {strcpy(yylval.na,yytext); return TOK_PROBTYPE;}
63                                   /* dimension of the problem                */
64{NAME}             {strcpy(yylval.na,yytext); return TOK_NAME;}
65;|\,|\(|\)|:|\[|\] {return (int) *yytext;}
66\n                 {line_num++;return (int) *yytext;}
67[ \t]+ ;
68%%
69
70
71int yywrap()
72{
73}
74
75
76yyerror(char *s)
77{
78if (!strcasecmp(curfile,mainfile))
79{
80   printf("Dans convert %s line %d, fichier %s\n",s,line_num,curfile);
81}
82else
83{
84   printf("Dans convert %s line %d, fichier %s\n",s,line_num,curfile);
85}
86exit(0);
87}
Note: See TracBrowser for help on using the repository browser.