Re: Opinions about "epsilon" Symbols in Parse Trees

0x4e71 <news4e71@yahoo.com>
12 Jun 2005 21:32:17 -0400

          From comp.compilers

Related articles
Opinions about "epsilon" Symbols in Parse Trees drikosv@otenet.gr (Evangelos Drikos) (2005-06-09)
Re: Opinions about "epsilon" Symbols in Parse Trees schmitz@i3s.unice.fr (Sylvain Schmitz) (2005-06-10)
Re: Opinions about "epsilon" Symbols in Parse Trees DrDiettrich@compuserve.de (Hans-Peter Diettrich) (2005-06-10)
Re: Opinions about "epsilon" Symbols in Parse Trees mefrill@yandex.ru (mefrill) (2005-06-12)
Re: Opinions about "epsilon" Symbols in Parse Trees news4e71@yahoo.com (0x4e71) (2005-06-12)
Re: Opinions about "epsilon" Symbols in Parse Trees DrDiettrich@compuserve.de (Hans-Peter Diettrich) (2005-06-12)
Re: Opinions about "epsilon" Symbols in Parse Trees drikosv@otenet.gr (eDrikos) (2005-06-13)
| List of all articles for this month |

From: 0x4e71 <news4e71@yahoo.com>
Newsgroups: comp.compilers
Date: 12 Jun 2005 21:32:17 -0400
Organization: Compilers Central
References: 05-06-052
Keywords: parse

Hi,


"Evangelos Drikos" <drikosv@otenet.gr> said:




> <Identifier> ::= <Identifier start> <Identifier part>
> <Identifier start> ::= <Latin Letter>
> <Identifier part> ::= { <Latin Letter> | <digit> | NONE } .
> /* where NONE is the "epsilon" */
>
> How many times should the Parser reduce the production "<Identifier
> part>-> NONE" when it read an identifier consisting of only one <Latin
> Letter>?


Well, if we assume
A) NONE (Epsilon) is handled like a normal terminal.
    And
B) "{x}" means "zero or more x".


The answer is: infinite times.


What about:


- Treating NONE like a special case (i.e. always an outgoing edge) ?


- Modifying the production, taking NONE out of {}
    <Identifier part> ::= { <Latin Letter> | <digit>
} NONE


- Using a different grammar, for example :
id -> START_CHAR id_part


id_part -> MID_CHAR id_part
                                  | EPSILON


Cheers,
Luigi


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.