[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ShopSuite-dev] [rational type] X/1 --> X
From: |
Davi Leal |
Subject: |
Re: [ShopSuite-dev] [rational type] X/1 --> X |
Date: |
Fri, 07 Sep 2001 18:52:56 +0100 |
Tomasz Wegrzanowski wrote:
> On Fri, Aug 31, 2001 at 11:40:11PM +0100, Davi Leal wrote:
> > I have modified rational_out() to realize the X/1 --> X conversion. The GUI
> > is
> > more readable and clean now.
> >
> > I have tried some modifications to rational_in() but I have not finished it
> > yet. Its goal is to check the format at input so as to fit fully the below
> > regular expressions. If the input does not fit then RETURN_UNDEF is used.
> > See
> > the attached rational.c file. Execute 'cvs diff rational.c'.
> >
> > Number: "^ *[0-9]\+ *$"
> > Rational: "^ *[0-9]\+\/[0-9]\+ *$"
>
> Why did you escape '+' ?
I had to escape it at the ':' vim's prompt, which I used to check it.
> > Do you know about regcomp() and regexec(). Do you have any idea of how check
> > if the input match a regular expressions?.
>
> It's simple and I even have some helloworlds available
> (I allways write helloworlds when I'm learning something new,
> and I often save them for reference).
> Tell me if you want me to send them to you.
Please, send me it.
> But I don't know if it's any useful.
> Parser is quite simple, and finding number start and end
> is only half of parsing.
Well, ... I think the use of a regular expression checker make it easier and
less
prone to mistake at some cases. See below:
"2 " --> "2"
" 23 " --> "23"
" 4/7 " --> "4/7"
"sk2 " --> "0/0"
" 3/4 A" --> "0/0"
" 3/4 A " --> "0/0"
" 3/4 8" --> "0/0"
" 3/48 " --> "1/16"
Note that the initial and final blanks are
stripped but not the middle ones.
- Re: [ShopSuite-dev] [rational type] X/1 --> X, Tomasz Wegrzanowski, 2001/09/01
- Re: [ShopSuite-dev] [rational type] X/1 --> X,
Davi Leal <=
- Re: [ShopSuite-dev] [rational type] X/1 --> X, Tomasz Wegrzanowski, 2001/09/08
- Re: [ShopSuite-dev] [rational type] X/1 --> X, Davi Leal, 2001/09/09
- Re: [ShopSuite-dev] [rational type] X/1 --> X, Tomasz Wegrzanowski, 2001/09/09
- Re: [ShopSuite-dev] [rational type] X/1 --> X, Davi Leal, 2001/09/09
- Re: [ShopSuite-dev] [rational type] X/1 --> X, Tomasz Wegrzanowski, 2001/09/09
- Re: [ShopSuite-dev] [rational type] X/1 --> X, Davi Leal, 2001/09/09
- Re: [ShopSuite-dev] [rational type] X/1 --> X, Tomasz Wegrzanowski, 2001/09/09