[antlr-interest] Possible bug?

Hill, Robert rhill03 at eds.com
Thu May 3 00:48:33 PDT 2007


Ter / anyone!,
 
I've narrowed this down and 
 
 : ^(MAPDEF mappingName )  {
     String test = $mappingName.text;
}
mappingName
    : Identifier 
    ;
---------------------
generates  this code , 
 
String     test = input.getTokenStream().toString(
 
input.getTreeAdaptor().getTokenStartIndex(mappingName15.start),
 
input.getTreeAdaptor().getTokenStopIndex(mappingName15.start));

...and input.getTokenStream() is returning null.
 
Im a bit suspicious since this is the only place in my grammars that
"input.getTokenStream().toString()" is getting generated.
everywhere else i don't seem to be using identifiers in subrules.
 
do subrules still allow you to get the returned text of the tree? this
worked in 3.0b5.
or am i doing something else wrong here?
 
Damn, this is taking some getting back into after 6 months away :(
 
TIA!
 
/2ob
 
 
 
 

Robert Hill 
Information Analyst (C/C++,C#,.NET,Java) 
Agile Alliance Member 
UKIMEA Technical Capabilities ADU 
UKIMEA RABU 
Application Services Field Operations EMEA 

Hallamshire Business Park, 100 Napier St, Sheffield. S11 8HD 
email:  rhill03 at eds.com 
Office: +44 114 291 1928 
Mobile: +44 7903 185 516 

This email contains information which is confidential and may be
privileged. Unless you are the intended addressee (or authorised to
receive for the addressee) you may not use, forward, copy or disclose to
anyone this email or any information contained in this email. If you
have received this email in error, please advise the sender by reply
email immediately and delete this email.

Electronic Data Systems Ltd 
Registered Office:, Lansdowne House, Berkeley Square, London  W1J 6ER 
Registered in England no: 53419 
VAT number: 432 99 5915 


 


________________________________

	From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Hill, Robert
	Sent: 02 May 2007 15:17
	To: antlr-interest at antlr.org
	Subject: [antlr-interest] More upgrade problems!
	
	

	After upgrading to 3.0b8, im also getting null pointer
exceptions :( 

	Should this : 
	        : ^(MAPDEF mappingName mappingTypeDecl+ SEP
classAttributes*)  { 
	            Mapping m =
(Mapping)Symbol.FullResolve($mappingName.text); 
	... 

	Generate this? 

	              Mapping m =
(Mapping)Symbol.FullResolve(input.getTokenStream().toString( 
	
input.getTreeAdaptor().getTokenStartIndex(mappingName15.start), 
	
input.getTreeAdaptor().getTokenStopIndex(mappingName15.start))); 

	mapingName15.start , twice? 

	I see a previous mail from Ter about just using $text
(..throwing nullptr exception), might this be related? 

	Thanks 

	/2ob 






	Robert Hill 
	Information Analyst (C/C++,C#,.NET,Java) 
	Agile Alliance Member 
	UKIMEA Technical Capabilities ADU 
	UKIMEA RABU 
	Application Services Field Operations EMEA 

	Hallamshire Business Park, 100 Napier St, Sheffield. S11 8HD 
	email:  rhill03 at eds.com 
	Office: +44 114 291 1928 
	Mobile: +44 7903 185 516 

	This email contains information which is confidential and may be
privileged. Unless you are the intended addressee (or authorised to
receive for the addressee) you may not use, forward, copy or disclose to
anyone this email or any information contained in this email. If you
have received this email in error, please advise the sender by reply
email immediately and delete this email.

	Electronic Data Systems Ltd 
	Registered Office:, Lansdowne House, Berkeley Square, London
W1J 6ER 
	Registered in England no: 53419 
	VAT number: 432 99 5915 



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070503/8c32c581/attachment.html 


More information about the antlr-interest mailing list