help-bison
[Top][All Lists]
Advanced

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

Token Syntax is confusing


From: slipbits
Subject: Token Syntax is confusing
Date: Tue, 7 Jun 2022 14:00:29 -0700
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0

In 3.7.5 Syntax of Symbol Declarations

  %token tag? ( id number? string? )+ ( tag ( id number? string? )+ )*  // is legal

A few points (minor I admit):

1. The meaning of '+', '?', '*' is given. The meaning of '|' is not
   (see %type definition).
2. No mention of the meaning of a line feed, see 3.7.2 Token Kind Names
   example for OR.
3. I  believe that any of id, number, tag, or string should be defined
   here.
     * In this regard there has been mention that tag has two forms,
       name and <name>.  If this is to be a syntactic description then
       it might be best to put it here.
     * There are restrictions on the use of number. This might be good
       place to put it. If memory serves me right (always an issue),
       the circa 2013 version of Bison mentioned a set or reserved numbers.
     * This might be a good place to define an id. If this is for
       syntax, this is a good place to put it.
     * The format of a string appears to be "string". What about 'c'?
       What about internal white space?
4. Spaces (line feeds, carriage returns, etc.) are nowhere addressed as
   linguistic elements.

Sorry. I just noticed this.

art


reply via email to

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