๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #10274

Gramatica LL1 de un interprete

#10274
From: Angel Ivan Castell Rovira
Date: Tue, 12 Mar 2002 11:28
31 lines
2119 bytes
Estoy desarrollando un interprete con python y tengo un problema
en mi gramatica del analizador sintactico. La gramatica tiene
una ambiguedad que no se resolver. ๏ฟฝAlguien me puede guiar
para resolver este conflicto? Aqui teneis un extracto de la
gramatica:

<Sentencia> -> <DeclVar> tkEOL|
	       <Asignacion> tkEOL |
	       <Expresion> tkEOL

<DeclVar> ... [por aqui no tengo problemas]
<Asignacion> -> tkIdentificador tk:= <Expresion>
<Expresion> -> <Termino> <E> 
<E> -> tk+ <Termino> <E>
<E> -> tk- <Termino> <E>
...
<Termino> -> <Factor> <T>
<T> -> tk* <Factor> <T>
<T> -> tk/ <Factor> <T>
...
<Factor> -> tkIdentificador |
	    tk( <Expresion> tk) |
...


La ambiguedad aparece cuando desde sentencia podemos derivar
el tkIdentificador bien por <Asignacion> o bien por <Expresion>.
No se como quitar esta ambiguedad. Si alguien puede ayudarme
y necesita mas detalles sobre la gramatica, me lo diga y se
la mandare entera si es necesario. Muchas gracias a todos.
Technical Details
Message-ID: <a6koob$s6p$1@marti.uji.es>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.cwix.com!newsfeed1.cidera.com!Cidera!news.comunitel.net!news.rediris.es!news.uv.es!marti.uji.es!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII
X-Google-Thread: f86c8,c7891475e16a4222,start
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2002-03-12 02:48:16 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.cwix.com!newsfeed1.cidera.com!Cidera!news.comunitel.net!news.rediris.es!news.uv.es!marti.uji.es!not-for-mail
From: Angel Ivan Castell Rovira <al004140@alumail.uji.es>
Newsgroups: es.comp.os.linux.programacion
Subject: Gramatica LL1 de un interprete
Date: Tue, 12 Mar 2002 11:28:11 +0000 (UTC)
Organization: Universitat Jaume I
Lines: 35
Sender: Angel Ivan Castell Rovira <al004140@anubis.uji.es>
Message-ID: <a6koob$s6p$1@marti.uji.es>
NNTP-Posting-Host: anubis.uji.es
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-2
Content-Transfer-Encoding: 8bit
X-Trace: marti.uji.es 1015932491 28889 150.128.40.100 (12 Mar 2002 11:28:11 GMT)
X-Complaints-To: news@mati.uji.es
NNTP-Posting-Date: Tue, 12 Mar 2002 11:28:11 +0000 (UTC)
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (AIX/4-3)