[antlr-interest] A simple Type related question.

Bharath Sundararaman bharath at starthis.com
Wed Aug 11 12:52:03 PDT 2004


Hi all,

If you had the following statement in your code: "int a := 100000000;" and
you wanted to prompt an error, how can it be done? I use the
integer.parseInt() method to check the range but I have a LONG INTEGER which
can go upto 2^64, which means I cant use Integer.parseInt() to check its
range. Also, how do I check real values? I have a REAL and a LONG REAL and
I'm not sure how to check if the values assigned to them will be acceptable.

Thanks,

Bharath.

-----Original Message-----
From: Jon Schewe [mailto:jpschewe at mtu.net] 
Sent: Friday, July 30, 2004 10:09 PM
To: antlr-interest at yahoogroups.com
Subject: Re: [antlr-interest] I am planning to write a beautifier for
Java(jaboby..)


On Fri, 2004-07-30 at 09:50, thirumalaikv wrote:
> Hi
> I am planning to write a beautifier for Java, which will 
> automatically beautify the code based on certain rules. I have 

Any particular reason the ones that currently exist don't fit your needs?
You might be better off enhancing an existing one, rather than starting from
scratch.

> 1. I want Special Tokens(spaces, comments, javadocs,...) part of the
> Token 

You'll probably want to have two Parsers here, one for the Java code and one
for the Javadoc comments.

> 2. I would like to know how to add/remove tokens/nodes of AST/Token.

I seem to remember this is in the tree construction documentation for antlr,
but could be mistaken.

> 3. Java 1.3.1 grammar

One can be found on the antlr website, although it tosses comments, which is
why I suggested two parsers in 1.
 
-- 
Jon Schewe | http://mtu.net/~jpschewe
GPG signature at http://mtu.net/~jpschewe/gpg.sig.html
For I am convinced that neither death nor life, neither angels 
nor demons, neither the present nor the future, nor any 
powers, neither height nor depth, nor anything else in all 
creation, will be able to separate us from the love of God that 
is in Christ Jesus our Lord. - Romans 8:38-39




 
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