Thread: [libposix-development] printf parser
Status: Pre-Alpha
Brought to you by:
hdante
From: Henrique A. <hd...@gm...> - 2009-06-28 15:44:41
|
I'm approaching a complete printf implementation, and I've just updated a printf parser to the repository, which is already in an advanced state. It's able to parse non trivial strings, like "e %-2ld f %0#'133.45Lg g %+.hhX i\n". The actual output functions (output_unsigned, output_double, etc.) are still missing, so it doesn't print anything yet, but I'll start writing those soon. Also missing are dealing with "numbered arguments" (things like "%2$d %1$s %3$g", they allow out of order argument passing), which are harder and require a working malloc implementation. Please run the tests "printf_parser" and "printf_scanner" and check that they don't crash or give weird results. printf_scanner should return zero and printf_parser should have the following result at the moment: abcd e f g i I expect to finish this until the middle of the week, so that we have a nearly complete printf. -- Henrique Dante de Almeida hd...@gm... |
From: Kirill A. S. <ki...@sh...> - 2009-06-28 18:50:07
|
On Sun, Jun 28, 2009 at 6:41 PM, Henrique Almeida<hd...@gm...> wrote: > I'm approaching a complete printf implementation, and I've just > updated a printf parser to the repository, which is already in an > advanced state. It's able to parse non trivial strings, like "e %-2ld > f %0#'133.45Lg g %+.hhX i\n". The actual output functions > (output_unsigned, output_double, etc.) are still missing, so it > doesn't print anything yet, but I'll start writing those soon. Also > missing are dealing with "numbered arguments" (things like "%2$d %1$s > %3$g", they allow out of order argument passing), which are harder and > require a working malloc implementation. > > Please run the tests "printf_parser" and "printf_scanner" and check > that they don't crash or give weird results. printf_scanner should > return zero and printf_parser should have the following result at the > moment: > > abcd > e f g i > > I expect to finish this until the middle of the week, so that we have > a nearly complete printf. What about unit tests? |
From: Henrique A. <hd...@gm...> - 2009-06-29 02:19:05
|
We have to make them too. Lots of them. While printf is not ready, the two programs cited are unit tests for the parser and scanner. I've put them in the "tests/internal" directory since they are implementation details. Also we're missing support for tests in our CMakeLists.txt (ie "make test"). After that the CMake build will be complete. 2009/6/28 Kirill A. Shutemov <ki...@sh...>: > On Sun, Jun 28, 2009 at 6:41 PM, Henrique Almeida<hd...@gm...> wrote: >> I'm approaching a complete printf implementation, and I've just >> updated a printf parser to the repository, which is already in an >> advanced state. It's able to parse non trivial strings, like "e %-2ld >> f %0#'133.45Lg g %+.hhX i\n". The actual output functions >> (output_unsigned, output_double, etc.) are still missing, so it >> doesn't print anything yet, but I'll start writing those soon. Also >> missing are dealing with "numbered arguments" (things like "%2$d %1$s >> %3$g", they allow out of order argument passing), which are harder and >> require a working malloc implementation. >> >> Please run the tests "printf_parser" and "printf_scanner" and check >> that they don't crash or give weird results. printf_scanner should >> return zero and printf_parser should have the following result at the >> moment: >> >> abcd >> e f g i >> >> I expect to finish this until the middle of the week, so that we have >> a nearly complete printf. > > What about unit tests? > > ------------------------------------------------------------------------------ > _______________________________________________ > Libposix-development mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/libposix-development > -- Henrique Dante de Almeida hd...@gm... |
From: Kirill A. S. <ki...@sh...> - 2009-06-29 06:28:58
|
On Mon, Jun 29, 2009 at 3:14 AM, Henrique Almeida<hd...@gm...> wrote: > We have to make them too. Lots of them. While printf is not ready, > the two programs cited are unit tests for the parser and scanner. I've > put them in the "tests/internal" directory since they are > implementation details. Also we're missing support for tests in our > CMakeLists.txt (ie "make test"). After that the CMake build will be > complete. I think the Test-Driven Development is right thing for project like this. |
From: Chris F. <ch...@fa...> - 2009-06-29 02:21:59
|
Henrique: > require a working malloc implementation I assume you'd be able to allocate that stuff locally in your own stack frame with alloca(), in lieu of having a real allocator? -- Chris -----Original Message----- From: Henrique Almeida [mailto:hd...@gm...] Sent: Monday, 29 June 2009 12:14 p.m. To: lib...@li... Subject: Re: [libposix-development] printf parser We have to make them too. Lots of them. While printf is not ready, the two programs cited are unit tests for the parser and scanner. I've put them in the "tests/internal" directory since they are implementation details. Also we're missing support for tests in our CMakeLists.txt (ie "make test"). After that the CMake build will be complete. 2009/6/28 Kirill A. Shutemov <ki...@sh...>: > On Sun, Jun 28, 2009 at 6:41 PM, Henrique Almeida<hd...@gm...> wrote: >> I'm approaching a complete printf implementation, and I've just >> updated a printf parser to the repository, which is already in an >> advanced state. It's able to parse non trivial strings, like "e %-2ld >> f %0#'133.45Lg g %+.hhX i\n". The actual output functions >> (output_unsigned, output_double, etc.) are still missing, so it >> doesn't print anything yet, but I'll start writing those soon. Also >> missing are dealing with "numbered arguments" (things like "%2$d %1$s >> %3$g", they allow out of order argument passing), which are harder and >> require a working malloc implementation. >> >> Please run the tests "printf_parser" and "printf_scanner" and check >> that they don't crash or give weird results. printf_scanner should >> return zero and printf_parser should have the following result at the >> moment: >> >> abcd >> e f g i >> >> I expect to finish this until the middle of the week, so that we have >> a nearly complete printf. > > What about unit tests? > > ------------------------------------------------------------------------------ > _______________________________________________ > Libposix-development mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/libposix-development > -- Henrique Dante de Almeida hd...@gm... ------------------------------------------------------------------------------ _______________________________________________ Libposix-development mailing list Lib...@li... https://lists.sourceforge.net/lists/listinfo/libposix-development |
From: Henrique A. <hd...@gm...> - 2009-06-29 14:31:43
|
It could be used in the short term, but alloca is not present in the standard. According to glibc docs, it's a BSD extension. 2009/6/28 Chris Forbes <ch...@fa...>: > Henrique: > >> require a working malloc implementation > > I assume you'd be able to allocate that stuff locally in your own stack > frame with alloca(), in lieu of having a real allocator? > > -- Chris > > -----Original Message----- > From: Henrique Almeida [mailto:hd...@gm...] > Sent: Monday, 29 June 2009 12:14 p.m. > To: lib...@li... > Subject: Re: [libposix-development] printf parser > > We have to make them too. Lots of them. While printf is not ready, > the two programs cited are unit tests for the parser and scanner. I've > put them in the "tests/internal" directory since they are > implementation details. Also we're missing support for tests in our > CMakeLists.txt (ie "make test"). After that the CMake build will be > complete. > > 2009/6/28 Kirill A. Shutemov <ki...@sh...>: >> On Sun, Jun 28, 2009 at 6:41 PM, Henrique Almeida<hd...@gm...> wrote: >>> I'm approaching a complete printf implementation, and I've just >>> updated a printf parser to the repository, which is already in an >>> advanced state. It's able to parse non trivial strings, like "e %-2ld >>> f %0#'133.45Lg g %+.hhX i\n". The actual output functions >>> (output_unsigned, output_double, etc.) are still missing, so it >>> doesn't print anything yet, but I'll start writing those soon. Also >>> missing are dealing with "numbered arguments" (things like "%2$d %1$s >>> %3$g", they allow out of order argument passing), which are harder and >>> require a working malloc implementation. >>> >>> Please run the tests "printf_parser" and "printf_scanner" and check >>> that they don't crash or give weird results. printf_scanner should >>> return zero and printf_parser should have the following result at the >>> moment: >>> >>> abcd >>> e f g i >>> >>> I expect to finish this until the middle of the week, so that we have >>> a nearly complete printf. >> >> What about unit tests? >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> Libposix-development mailing list >> Lib...@li... >> https://lists.sourceforge.net/lists/listinfo/libposix-development >> > > > > -- > Henrique Dante de Almeida > hd...@gm... > > ------------------------------------------------------------------------------ > _______________________________________________ > Libposix-development mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/libposix-development > ------------------------------------------------------------------------------ > _______________________________________________ > Libposix-development mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/libposix-development > -- Henrique Dante de Almeida hd...@gm... |
From: Henrique A. <hd...@gm...> - 2009-07-02 02:49:41
|
Some integer and string outputs are working. The output of printf_parser should be: 511abcd abcdxyz e 4095 f g 0X2D i Please test. 2009/6/29 Henrique Almeida <hd...@gm...>: > It could be used in the short term, but alloca is not present in the > standard. According to glibc docs, it's a BSD extension. > > 2009/6/28 Chris Forbes <ch...@fa...>: >> Henrique: >> >>> require a working malloc implementation >> >> I assume you'd be able to allocate that stuff locally in your own stack >> frame with alloca(), in lieu of having a real allocator? >> >> -- Chris >> >> -----Original Message----- >> From: Henrique Almeida [mailto:hd...@gm...] >> Sent: Monday, 29 June 2009 12:14 p.m. >> To: lib...@li... >> Subject: Re: [libposix-development] printf parser >> >> We have to make them too. Lots of them. While printf is not ready, >> the two programs cited are unit tests for the parser and scanner. I've >> put them in the "tests/internal" directory since they are >> implementation details. Also we're missing support for tests in our >> CMakeLists.txt (ie "make test"). After that the CMake build will be >> complete. >> >> 2009/6/28 Kirill A. Shutemov <ki...@sh...>: >>> On Sun, Jun 28, 2009 at 6:41 PM, Henrique Almeida<hd...@gm...> wrote: >>>> I'm approaching a complete printf implementation, and I've just >>>> updated a printf parser to the repository, which is already in an >>>> advanced state. It's able to parse non trivial strings, like "e %-2ld >>>> f %0#'133.45Lg g %+.hhX i\n". The actual output functions >>>> (output_unsigned, output_double, etc.) are still missing, so it >>>> doesn't print anything yet, but I'll start writing those soon. Also >>>> missing are dealing with "numbered arguments" (things like "%2$d %1$s >>>> %3$g", they allow out of order argument passing), which are harder and >>>> require a working malloc implementation. >>>> >>>> Please run the tests "printf_parser" and "printf_scanner" and check >>>> that they don't crash or give weird results. printf_scanner should >>>> return zero and printf_parser should have the following result at the >>>> moment: >>>> >>>> abcd >>>> e f g i >>>> >>>> I expect to finish this until the middle of the week, so that we have >>>> a nearly complete printf. >>> >>> What about unit tests? >>> >>> ------------------------------------------------------------------------------ >>> _______________________________________________ >>> Libposix-development mailing list >>> Lib...@li... >>> https://lists.sourceforge.net/lists/listinfo/libposix-development >>> >> >> >> >> -- >> Henrique Dante de Almeida >> hd...@gm... >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> Libposix-development mailing list >> Lib...@li... >> https://lists.sourceforge.net/lists/listinfo/libposix-development >> ------------------------------------------------------------------------------ >> _______________________________________________ >> Libposix-development mailing list >> Lib...@li... >> https://lists.sourceforge.net/lists/listinfo/libposix-development >> > > > > -- > Henrique Dante de Almeida > hd...@gm... > -- Henrique Dante de Almeida hd...@gm... |
From: Henrique A. <hd...@gm...> - 2009-07-12 16:14:48
|
Added sprintf for those who needed it. 2009/7/1 Henrique Almeida <hd...@gm...>: > Some integer and string outputs are working. The output of > printf_parser should be: > > 511abcd abcdxyz > e 4095 f g 0X2D i > > Please test. > > 2009/6/29 Henrique Almeida <hd...@gm...>: >> It could be used in the short term, but alloca is not present in the >> standard. According to glibc docs, it's a BSD extension. >> >> 2009/6/28 Chris Forbes <ch...@fa...>: >>> Henrique: >>> >>>> require a working malloc implementation >>> >>> I assume you'd be able to allocate that stuff locally in your own stack >>> frame with alloca(), in lieu of having a real allocator? >>> >>> -- Chris >>> >>> -----Original Message----- >>> From: Henrique Almeida [mailto:hd...@gm...] >>> Sent: Monday, 29 June 2009 12:14 p.m. >>> To: lib...@li... >>> Subject: Re: [libposix-development] printf parser >>> >>> We have to make them too. Lots of them. While printf is not ready, >>> the two programs cited are unit tests for the parser and scanner. I've >>> put them in the "tests/internal" directory since they are >>> implementation details. Also we're missing support for tests in our >>> CMakeLists.txt (ie "make test"). After that the CMake build will be >>> complete. >>> >>> 2009/6/28 Kirill A. Shutemov <ki...@sh...>: >>>> On Sun, Jun 28, 2009 at 6:41 PM, Henrique Almeida<hd...@gm...> wrote: >>>>> I'm approaching a complete printf implementation, and I've just >>>>> updated a printf parser to the repository, which is already in an >>>>> advanced state. It's able to parse non trivial strings, like "e %-2ld >>>>> f %0#'133.45Lg g %+.hhX i\n". The actual output functions >>>>> (output_unsigned, output_double, etc.) are still missing, so it >>>>> doesn't print anything yet, but I'll start writing those soon. Also >>>>> missing are dealing with "numbered arguments" (things like "%2$d %1$s >>>>> %3$g", they allow out of order argument passing), which are harder and >>>>> require a working malloc implementation. >>>>> >>>>> Please run the tests "printf_parser" and "printf_scanner" and check >>>>> that they don't crash or give weird results. printf_scanner should >>>>> return zero and printf_parser should have the following result at the >>>>> moment: >>>>> >>>>> abcd >>>>> e f g i >>>>> >>>>> I expect to finish this until the middle of the week, so that we have >>>>> a nearly complete printf. >>>> >>>> What about unit tests? >>>> >>>> ------------------------------------------------------------------------------ >>>> _______________________________________________ >>>> Libposix-development mailing list >>>> Lib...@li... >>>> https://lists.sourceforge.net/lists/listinfo/libposix-development >>>> >>> >>> >>> >>> -- >>> Henrique Dante de Almeida >>> hd...@gm... >>> >>> ------------------------------------------------------------------------------ >>> _______________________________________________ >>> Libposix-development mailing list >>> Lib...@li... >>> https://lists.sourceforge.net/lists/listinfo/libposix-development >>> ------------------------------------------------------------------------------ >>> _______________________________________________ >>> Libposix-development mailing list >>> Lib...@li... >>> https://lists.sourceforge.net/lists/listinfo/libposix-development >>> >> >> >> >> -- >> Henrique Dante de Almeida >> hd...@gm... >> > > > > -- > Henrique Dante de Almeida > hd...@gm... > -- Henrique Dante de Almeida hd...@gm... |
From: John H. <jh...@gm...> - 2009-07-12 19:05:18
|
Thanks Henrique! On Sun, Jul 12, 2009 at 11:14 AM, Henrique Almeida<hd...@gm...> wrote: > Added sprintf for those who needed it. > > 2009/7/1 Henrique Almeida <hd...@gm...>: >> Some integer and string outputs are working. The output of >> printf_parser should be: >> >> 511abcd abcdxyz >> e 4095 f g 0X2D i >> >> Please test. >> >> 2009/6/29 Henrique Almeida <hd...@gm...>: >>> It could be used in the short term, but alloca is not present in the >>> standard. According to glibc docs, it's a BSD extension. >>> >>> 2009/6/28 Chris Forbes <ch...@fa...>: >>>> Henrique: >>>> >>>>> require a working malloc implementation >>>> >>>> I assume you'd be able to allocate that stuff locally in your own stack >>>> frame with alloca(), in lieu of having a real allocator? >>>> >>>> -- Chris >>>> >>>> -----Original Message----- >>>> From: Henrique Almeida [mailto:hd...@gm...] >>>> Sent: Monday, 29 June 2009 12:14 p.m. >>>> To: lib...@li... >>>> Subject: Re: [libposix-development] printf parser >>>> >>>> We have to make them too. Lots of them. While printf is not ready, >>>> the two programs cited are unit tests for the parser and scanner. I've >>>> put them in the "tests/internal" directory since they are >>>> implementation details. Also we're missing support for tests in our >>>> CMakeLists.txt (ie "make test"). After that the CMake build will be >>>> complete. >>>> >>>> 2009/6/28 Kirill A. Shutemov <ki...@sh...>: >>>>> On Sun, Jun 28, 2009 at 6:41 PM, Henrique Almeida<hd...@gm...> wrote: >>>>>> I'm approaching a complete printf implementation, and I've just >>>>>> updated a printf parser to the repository, which is already in an >>>>>> advanced state. It's able to parse non trivial strings, like "e %-2ld >>>>>> f %0#'133.45Lg g %+.hhX i\n". The actual output functions >>>>>> (output_unsigned, output_double, etc.) are still missing, so it >>>>>> doesn't print anything yet, but I'll start writing those soon. Also >>>>>> missing are dealing with "numbered arguments" (things like "%2$d %1$s >>>>>> %3$g", they allow out of order argument passing), which are harder and >>>>>> require a working malloc implementation. >>>>>> >>>>>> Please run the tests "printf_parser" and "printf_scanner" and check >>>>>> that they don't crash or give weird results. printf_scanner should >>>>>> return zero and printf_parser should have the following result at the >>>>>> moment: >>>>>> >>>>>> abcd >>>>>> e f g i >>>>>> >>>>>> I expect to finish this until the middle of the week, so that we have >>>>>> a nearly complete printf. >>>>> >>>>> What about unit tests? >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> _______________________________________________ >>>>> Libposix-development mailing list >>>>> Lib...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/libposix-development >>>>> >>>> >>>> >>>> >>>> -- >>>> Henrique Dante de Almeida >>>> hd...@gm... >>>> >>>> ------------------------------------------------------------------------------ >>>> _______________________________________________ >>>> Libposix-development mailing list >>>> Lib...@li... >>>> https://lists.sourceforge.net/lists/listinfo/libposix-development >>>> ------------------------------------------------------------------------------ >>>> _______________________________________________ >>>> Libposix-development mailing list >>>> Lib...@li... >>>> https://lists.sourceforge.net/lists/listinfo/libposix-development >>>> >>> >>> >>> >>> -- >>> Henrique Dante de Almeida >>> hd...@gm... >>> >> >> >> >> -- >> Henrique Dante de Almeida >> hd...@gm... >> > > > > -- > Henrique Dante de Almeida > hd...@gm... > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to $100,000 in prizes! For a limited time, > vendors submitting new applications to BlackBerry App World(TM) will have > the opportunity to enter the BlackBerry Developer Challenge. See full prize > details at: http://p.sf.net/sfu/Challenge > _______________________________________________ > Libposix-development mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/libposix-development > -- John Haitas jh...@gm... |