lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Mon, Mar 19, 2012 at 11:09 PM, Miles Bader <[email protected]> wrote:
> Luiz Henrique de Figueiredo <[email protected]> writes:
>>> With some luck, GNU date is based on a library that can be reused.
>>
>> It's a BISON parser. The file is parse-datetime.c in GNU coreutils.
>> See a vesion at
>>       http://www.nongnu.org/oath-toolkit/clang-analyzer/report-5d72bY.html
>
> The original yacc source is probably easier to read tho... :
>
>   http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;f=lib/parse-datetime.y
>
> :]
>
> [Hmm, I guess this is a job for ... LPEG!]

There is also something similar in PHP for re2c, under PHP license:

http://svn.php.net/viewvc/php/php-src/trunk/ext/date/lib/parse_date.re?revision=320481&view=markup

-- 
Bertrand Mansion
Mamasam