[antlr-interest] AST, value manipulation.

Bharath Sundararaman bharath.sundararaman at starthis.com
Thu Nov 18 09:31:28 PST 2004


Hi John,

That's exactly what I am trying to do! In order to decide if the array index value is statically known, I have to store the value someplace and have a check for 

IF variable_value is known
	Check if it complies with the array range

Can you give me some pointers/links/information that can help me achieve this? I searched the web and looked at some books in vain. Is this static analysis not regular practice? This is the first time I'm writing a compiler, please bear with me if you find my questions naïve.

Thanks!

Bharath.

-----Original Message-----
From: John D. Mitchell [mailto:johnm-antlr at non.net] 
Sent: Thursday, November 18, 2004 11:01 AM
To: antlr-interest at yahoogroups.com
Subject: RE: [antlr-interest] AST, value manipulation.


>>>>> "Maassen," == Maassen, H A M <H.A.M.Maassen at student.tue.nl> writes:
[...]

> I don't think rangechecking is (usually? ever?) done at compile time. How
> would you check the following?

If you wanted to, you can do a static analysis on the indices and array
sizes and determine if they are statically known or not.  If they are known
then you can check them right then and there and elide the runtime check.

Take care,
	John


 
Yahoo! Groups Links



 





 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 





More information about the antlr-interest mailing list