Warning: mysqli::__construct(): (HY000/1203): User howardkn already has more than 'max_user_connections' active connections in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\includes\artfuncs.php on line 21
Failed to connect to MySQL: (1203) User howardkn already has more than 'max_user_connections' active connections
Warning: mysqli::query(): Couldn't fetch mysqli in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\index.php on line 66
Article <v25mbn$1njma$1@dont-email.me>
Deutsch   English   Français   Italiano  
<v25mbn$1njma$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bart <bc@freeuk.com>
Newsgroups: comp.lang.c
Subject: Re: Which newsgroup for json parsing?
Date: Thu, 16 May 2024 20:21:28 +0100
Organization: A noiseless patient Spider
Lines: 44
Message-ID: <v25mbn$1njma$1@dont-email.me>
References: <la1bjoF2anmU1@mid.individual.net> <v25c4k$1lhfu$1@dont-email.me>
 <lamvvbFb0g2U1@mid.individual.net> <MCs1O.681$29Ia.396@fx13.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 16 May 2024 21:21:27 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="3c080fc5cc300462d285cef5c3e8ca8e";
	logging-data="1822410"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18aMrb2WuOj7EqCTiWjW5+l"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:5CtnI+hYNQ3E7PLIdNJBPENnVnc=
In-Reply-To: <MCs1O.681$29Ia.396@fx13.iad>
Content-Language: en-GB
Bytes: 2753

On 16/05/2024 19:53, Scott Lurndal wrote:
> =?UTF-8?Q?Josef_M=C3=B6llers?= <josef@invalid.invalid> writes:
>> On 16.05.24 18:27, Mikko wrote:
>>> On 2024-05-08 13:04:56 +0000, Josef Möllers said:
>>>
>>>> Hi all,
>>>>
>>>> I am trying to parse a json string received through MQTT from a
>>>> "Shelly Plug S", e.g.
>>>> {"id":0, "source":"button", "output":true, "apower":0.0,
>>>> "voltage":237.9, "current":0.000,
>>>> "aenergy":{"total":0.000,"by_minute":[0.000,0.000,0.000],"minute_ts":1715172119},"temperature":{"tC":41.1, "tF":106.0}}
>>>>
>>>> I am trying to use libjson-glib but I can't figure out what to use as
>>>> the first argument to json_gobject_from_data()!
>>>> I am also looking at libjson-c but cannot find any examples that could
>>>> guide me.
>>>>
>>>> Thanks in advance,
>>>
>>> Sometimes it is easier to make a parser than to use an existing one.
>>> In this case I might try LEX.
>>>
>>
>> Sorry to be nitpicking, but lex is a "lexical analyzer" aka a "scanner",
>> it can only recognize tokens, eg the brackets, quotes, identifiers etc,
>> but not structures.
>> "yacc" (or its "bison" equivalent" would be a parser but definitely too
>> heavy.
>>
>> What one could do would be to use LEX to recognize the tokens and the
>> write a recursive descent parser in plain C.
> 
> I've done full expression parsing and subsequent evaluation with
> lex (or flex).  No parser needed.
> 

You've done 'full expression PARSING', then you say 'No PARSER needed'.

A bit contradictory?

Clearly parsing IS needed, so either you've used LEX from code that acts 
as a parser, or it does more than just recognise tokens.