help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to decide what to put in the lexer and the grammar respectively?


From: Simon Richter
Subject: Re: How to decide what to put in the lexer and the grammar respectively?
Date: Sun, 17 Feb 2019 18:57:24 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0

Hi,

On 17.02.19 14:08, Peng Yu wrote:

> [[:alpha:]_][[:alnum:]_]=[[:digit:]+]  { /* parse yytext to get the
> name and value, then do the assignment */ }

The main reason you are using a lexer is to avoid writing code for
manual parsing. The lexer can already tell you where the equals sign is
and how long the identifier and value are, but only if they are separate
tokens.

   Simon

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]