Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 02 May 2011 14:13:11 +0200
From:      Martin =?ISO-8859-1?B?TfZsbGVy?= <moeller.akt@googlemail.com>
To:        <freebsd-hackers@freebsd.org>
Subject:   Re: [LIBC] Modfied Version of sscanf
Message-ID:  <C9E46C77.389%moeller.akt@googlemail.com>
In-Reply-To: <20110501162925.GB47497@stack.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
Hello,

Thanks for all the replies.
We have so far discovered the following suggetions for the parsing Problem:
Using: 
    o a tokenizer/parser is too much overhead for such a simple task
    o strchr, memchr is too low-level and not elegant enough
    o strtok would not even parse (tokenize) this simple example
    o a regexp library: How would you solve the problem with a regexp lib ?

Criteria:
    o Receive the value of <resource>
    o Check the Environment: Is <resource> really sourrounded by 'GET ' and
      'HTTP/1.1' ?!

I need a function which accepts BNF-style rules.
E.g.:
    char resource [512];

    ret = bnfparse (request, "GET %s HTTP/1.1", resource);

Ret would be $(NUMBER OF FORMAT SPECIFIERS, successfully handled) +env.
Env would be 1 if the Environment passes, and 0 is not.

Any comments ?
Best regards,
Martin





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?C9E46C77.389%moeller.akt>