Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #30433

Re: Time parse step for gforth?

From Bernd Paysan <bernd.paysan@gmx.de>
Newsgroups comp.lang.forth
Subject Re: Time parse step for gforth?
Date 2014-05-17 01:11 +0200
Organization 1&1 Internet AG
Message-ID <ll65vd$34k$1@online.de> (permalink)
References <2d332084-ec90-42db-9558-a9bbdbc55eec@googlegroups.com> <2014May16.190233@mips.complang.tuwien.ac.at>

Show all headers | View raw


Anton Ertl wrote:

> Hannu Vuolasaho <vuokkosetae@gmail.com> writes:
>>I'm trying to write parse step
>>which could understand
>>
>>hh:mm:ss.fragment
>>
>>format.
> ...
>>I know I lose double input recognizer part I don't mind that.
>>
>>Has anyone done this before and can this be done easily?
> 
> It's not particularly easy, and I have not done so before.  You do not
> necessarily lose the double number recognizer (there are no conflicts
> in the syntax of your number).  There have been changes in this area
> between 0.7.0 and the current development version; I expected Bernd,
> who implemented recognizers in the development version to speak up,
> but he has not done so yet.

Yes, in the git head version of Gforth, you could do that with a recognizer.  
Writing a recognizer is fairly trivial, it's two components, one of which 
here already exists (that's the r:float table that knows how to deal with a 
floating point number).  The other takes a string, and tries to convert it 
if it is recognized, and then returns r:float, otherwise r:fail.

-- 
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://bernd-paysan.de/

Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Time parse step for gforth? Hannu Vuolasaho <vuokkosetae@gmail.com> - 2014-05-14 22:43 -0700
  Re: Time parse step for gforth? humptydumpty <ouatubi@gmail.com> - 2014-05-15 23:46 -0700
  Re: Time parse step for gforth? Mark Wills <markwills1970@gmail.com> - 2014-05-16 01:41 -0700
  Re: Time parse step for gforth? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-05-16 17:02 +0000
    Re: Time parse step for gforth? Bernd Paysan <bernd.paysan@gmx.de> - 2014-05-17 01:11 +0200
    Re: Time parse step for gforth? Hannu Vuolasaho <vuokkosetae@gmail.com> - 2014-05-18 03:45 -0700
      Re: Time parse step for gforth? humptydumpty <ouatubi@gmail.com> - 2014-05-19 02:31 -0700
      Re: Time parse step for gforth? m.a.m.hendrix@tue.nl - 2014-05-19 04:58 -0700
        Re: Time parse step for gforth? mhx@iae.nl - 2014-05-19 10:51 -0700
  Re: Time parse step for gforth? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-05-19 13:03 +0000

csiph-web