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

Simon Richter <[email protected]>
Newsgroups gmane.comp.parsers.bison.general
Message-ID <[email protected]>
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

_______________________________________________
[email protected] https://lists.gnu.org/mailman/listinfo/help-bison
signature.asc (application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEtjuqOJSXmNjSiX3Tfr04e7CZCBEFAlxpoIUACgkQfr04e7CZ
CBFRcgf/Xs6tw5jhmeaXI03bezIEFbG3n2xsBLGt54Z0Aj2Km3q6HyaarQUEJBW1
gWbsYMiy+ZePatXhPoYTdFGyTsDwAlE+0os6URYDbJHzNUNBEEpPoCmPiIZqn3jF
P60ayPq+2NS28ijvPnc9AzI980gMYfjvzS5TV1TQncupKmnYsX8CCYa0oMtqaqye
/84hVtBvWkNjZW+H6/C1GCgWxnfNPM9fXML8nTTnECJj2kHtws5VChdaicFthVPv
AUAhEhmKubSJPzPd9AtsUHAfbBLePf1Zv0oM/dya6ZUj6NYx27rXmo8IvhroQN1T
NbBNQrgIZ4mA9Q2bdqHlF3nq4gVRfg==
=lMuG
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.