/[ghosts]/ghosts/gedcomparser/src/GEDCOMParser/DateManagement/datevaluelexer.lxx
ViewVC logotype

Diff of /ghosts/gedcomparser/src/GEDCOMParser/DateManagement/datevaluelexer.lxx

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by cpcp, Wed Oct 23 19:21:41 2002 UTC revision 1.2 by cpcp, Tue Nov 12 21:25:21 2002 UTC
# Line 0  Line 1 
1    /*
2        Copyright 2002 Cyril Picard
3    
4        This file is part of the GEDCOMParser library
5        (developed within the Genealogy Free Software Tools project).
6    
7        The GEDCOMParser library is free software; you can redistribute it and/or modify
8        it under the terms of the GNU General Public License as published by
9        the Free Software Foundation; either version 2 of the License, or
10        (at your option) any later version.
11    
12        The GEDCOMParser library is distributed in the hope that it will be useful,
13        but WITHOUT ANY WARRANTY; without even the implied warranty of
14        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15        GNU General Public License for more details.
16    
17        You should have received a copy of the GNU General Public License
18        along with the GEDCOMParser library ; if not, write to the Free Software
19        Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20    
21    */
22    
23    %{
24    
25    #include "GEDCOMParser/DateManagement/datevalueparser_decl.hh"
26    #include "GEDCOMParser/DateManagement/datevalueparser.h"
27    #include <iostream>
28    
29    %}
30    
31    %option prefix="datevalue" outfile="lex.yy.c"
32    
33    DIGIT  [0-9]
34    
35    %%
36    
37    "@#DGREGORIAN@ " { return CAL_GREGORIAN; }
38    "@#DJULIAN@ " { return CAL_JULIAN; }
39    "@#DHEBREW@ " { return CAL_HEBREW; }
40    "@#DFRENCH R@ " { return CAL_FRENCH; }
41    "@#DROMAN@ " { return CAL_ROMAN; }
42    "@#DUNKNOWN@ " { return CAL_UNKNOWN; }
43    "JAN" { return MONTH_JAN; }
44    "FEB" { return MONTH_FEB; }
45    "MAR" { return MONTH_MAR; }
46    "APR" { return MONTH_APR; }
47    "MAY" { return MONTH_MAY; }
48    "JUN" { return MONTH_JUN; }
49    "JUL" { return MONTH_JUL; }
50    "AUG" { return MONTH_AUG; }
51    "SEP" { return MONTH_SEP; }
52    "OCT" { return MONTH_OCT; }
53    "NOV" { return MONTH_NOV; }
54    "DEC" { return MONTH_DEC; }
55    "TSH" { return MONTH_HEBR_TSH; }
56    "CSH" { return MONTH_HEBR_CSH; }
57    "KSL" { return MONTH_HEBR_KSL; }
58    "TVT" { return MONTH_HEBR_TVT; }
59    "SHV" { return MONTH_HEBR_SHV; }
60    "ADR" { return MONTH_HEBR_ADR; }
61    "ADS" { return MONTH_HEBR_ADS; }
62    "NSN" { return MONTH_HEBR_NSN; }
63    "IYR" { return MONTH_HEBR_IYR; }
64    "SVN" { return MONTH_HEBR_SVN; }
65    "TMZ" { return MONTH_HEBR_TMZ; }
66    "AAV" { return MONTH_HEBR_AAV; }
67    "ELL" { return MONTH_HEBR_ELL; }
68    "VEND" { return MONTH_FREN_VEND; }
69    "BRUM" { return MONTH_FREN_BRUM; }
70    "FRIM" { return MONTH_FREN_FRIM; }
71    "NIVO" { return MONTH_FREN_NIVO; }
72    "PLUV" { return MONTH_FREN_PLUV; }
73    "VENT" { return MONTH_FREN_VENT; }
74    "GERM" { return MONTH_FREN_GERM; }
75    "FLOR" { return MONTH_FREN_FLOR; }
76    "PRAI" { return MONTH_FREN_PRAI; }
77    "MESS" { return MONTH_FREN_MESS; }
78    "THER" { return MONTH_FREN_THER; }
79    "FRUC" { return MONTH_FREN_FRUC; }
80    "COMP" { return MONTH_FREN_COMP; }
81    "FROM " { return FROM; }
82    "TO "   { return TO; }
83    "BEF "  { return BEF; }
84    "AFT "  { return AFT; }
85    "BET "  { return BET; }
86    " AND "  { return AND; }
87    "INT "  { return INT; }
88    "ABT "  { return ABT; }
89    "CAL "  { return CAL; }
90    "EST "  { return EST; }
91    "/" { return SLASH; }
92    [ ]*"(B.C.)"|[ ]*"BC" { return BC; }
93    [ ]* { return SPACE; }
94    {DIGIT}* { yylval = strdup(datevaluetext); return NUMBER; }
95    "an "|" AN " { return AN; }
96    I|II|III|IV|V|VI|VII|VIII|IX|X|XI|XII|XIII|XIV|i|ii|iii|iv|v|vi|vii|viii|ix|x|xi|xii|xiii|xiv { yylval = strdup(datevaluetext); return FRENCH_YEAR; }
97    "(".*")" { yylval = strdup(datevaluetext); return DATEPHRASE; }
98    %%
99    
100    int yywrap(void)
101    {
102      return 1;
103    }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26