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

BOUNCE sablecc-list@sable.mcgill.ca: Non-member submission from [(Carlos Costa e Silva) carlos@keysoft.pt]



>From egagnon@j-meg.com  Tue Aug 20 12:13:14 2002
Received: from hub.CS.McGill.CA (hub.CS.McGill.CA [132.206.3.45])
	by gloom.cs.mcgill.ca (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id MAA25739
	for <sablecc-list@sable.mcgill.ca>; Tue, 20 Aug 2002 12:13:14 -0400
Received: from fep03-svc.mail.telepac.pt (fep03-svc.mail.telepac.pt [194.65.5.202])
	by hub.CS.McGill.CA (8.11.6/8.11.6) with ESMTP id g7KGGf733205
	for <sablecc-list@sable.mcgill.ca>; Tue, 20 Aug 2002 12:16:42 -0400 (EDT)
	(envelope-from carlos@keysoft.pt)
Received: from zeus.keysoft.pt ([213.22.80.180])
          by fep03-svc.mail.telepac.pt
          (InterMail vM.5.01.04.13 201-253-122-122-113-20020313) with ESMTP
          id <20020820161251.ZJHO9733.fep03-svc.mail.telepac.pt@zeus.keysoft.pt>;
          Tue, 20 Aug 2002 17:12:51 +0100
Received: from localhost (openmail@localhost)
	by zeus.keysoft.pt (8.11.0/8.11.0/SuSE Linux 8.11.0-0.4) with ESMTP id g7KGACK01400;
	Tue, 20 Aug 2002 17:10:12 +0100
X-OpenMail-Hops: 1
Date: Tue, 20 Aug 2002 17:10:11 +0100
Message-Id: <H000006600045544.1029859811.zeus.keysoft.pt@MHS>
Subject: RE: Grammar -- identifier token
MIME-Version: 1.0
From: (Carlos Costa e Silva) carlos@keysoft.pt
TO: markmann@daimi.au.dk, sablecc-list@sable.mcgill.ca
Content-Type: text/plain; charset=ISO-8859-1
Content-Disposition: inline
	;Creation-Date="Tue, 20 Aug 2002 17:10:11 +0100"
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by gloom.cs.mcgill.ca id MAA25740

> -----Original Message-----
> From: markmann@daimi.au.dk [mailto:markmann@daimi.au.dk]
> Sent: terça-feira, 20 de Agosto de 2002 14:42
> To: sablecc-list@sable.mcgill.ca
> Subject: Grammar -- identifier token
> 
> I want to make a token, that recognise your genuine 
> identifier, and the array identifier. 
> 
> That is it should accept: Exp and Exp[] and Id[][][]

This seems to work:

Helpers
	letter = [ ['a' .. 'z'] + ['A'..'Z'] ];
	digit = ['0' .. '9'];
	name = letter ( letter | digit | '_' )*;

Tokens
	id = name;
	array = name '[]'+;

Productions

goal =
	{id} id |
	{array} array;


Carlos

----
Carlos Costa e Silva <carlos@keysoft.pt>