Changeset 8389 in project


Ignore:
Timestamp:
02/12/08 00:32:26 (10 years ago)
Author:
kon
Message:

Changed number pattern to handle exponential format. Hex & Octal specific digits. Remove '_' from letter since part of identifier pattern. Removed '.' from digit since not legal in an identifier. Trac #115 fix. Removed ('compress-literals)' since not legal in Rel 3.

Location:
release/3/easyffi
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • release/3/easyffi/easyffi.l

    r7166 r8389  
    3434
    3535
    36 letter [a-zA-Z_]
    37 digit  [0-9.]
    38 space  [ ]
     36letter    [a-zA-Z]
     37digit     [0-9]
     38digit16   [0-9a-fA-F]
     39digit8    [0-7]
     40space     [ ]
    3941
    4042%%
     
    164166\'.\'                              (list 'char (string-ref yytext 1))
    165167({letter}|_)({letter}|_|{digit})*  (list 'id yytext)
    166 0(x|X)({digit}|{letter})+          (list 'num (string->number (substring yytext 2 (string-length yytext)) 16))
    167 0[0-7]+                            (list 'num (string->number (substring yytext 1 (string-length yytext)) 8))
    168 -?{digit}+                         (list 'num (string->number yytext))
     1680(x|X){digit16}+                   (list 'num (string->number (substring yytext 2 (string-length yytext)) 16))
     1690{digit8}+                         (list 'num (string->number (substring yytext 1 (string-length yytext)) 8))
     170(\+|-)?{digit}+(\.{digit}*)?((e|E)(\+|-)?{digit}+)?
     171                                   (list 'num (string->number yytext))
    169172"<"                                (if (eq? pp-mode 'include)
    170173                                       (let loop ([s '()])
  • release/3/easyffi/easyffi.scm

    r6923 r8389  
    3737  (uses srfi-13 srfi-1 utils regex)
    3838  ;(disable-warning var)
    39   (compress-literals)
    4039  (export parse-easy-ffi register-ffi-macro number-type
    4140          ffi-include-path-list ffi-dont-include ##compiler#foreign-type-table
  • release/3/easyffi/easyffi.setup

    r7166 r8389  
    1010 'easyffi
    1111 '("easyffi.so")
    12  '((version 1.91)
     12 '((version 1.92)
    1313   (syntax)) )
    1414
     
    1616 'chicken-wrap
    1717 "chicken-wrap"
    18  '((version 1.91)))
     18 '((version 1.92)))
    1919
  • release/3/easyffi/tests.scm

    r3496 r8389  
    3838(pp (list (My_struct-x s) (My_struct-y s)))
    3939
     40;;================================================================================
     41;; Test number pattern
     42
    4043#>?
    4144#define GLU_TESS_MAX_COORD 1.0e+150
     45
     46#define X1_1 1.0e+150
     47#define X1_2 -1.0e+150
     48#define X1_3 -1.0e-150
     49
     50#define X1_4 1.0E+150
     51#define X1_5 -1.0E+150
     52#define X1_6 -1.0E-150
     53
     54#define X2_1 1.e150
     55#define X2_2 -1.e150
     56#define X2_3 -1.e-150
     57#define X2_4 1E+150
     58#define X2_5 -1e+150
     59#define X2_6 -1E-150
     60
     61#define X3_1 1
     62#define X3_2 12
     63#define X3_3 -1
     64#define X3_4 -12
     65
     66#define X4_1 1.
     67#define X4_2 12.
     68#define X4_3 -1.
     69#define X4_4 -12.
     70
     71#define X5_1 1.0
     72#define X5_2 12.0
     73#define X5_3 -1.0
     74#define X5_4 -12.0
    4275<#
Note: See TracChangeset for help on using the changeset viewer.