Skip to main content



      Home
Home » Newcomers » Newcomers » Adding array node to the AST tree
Adding array node to the AST tree [message #246904] Fri, 25 January 2008 18:33 Go to next message
Eclipse UserFriend
Originally posted by: alexyermolovich.gmail.com

Hi.
I am trying to figure out how to add an array declaration to an Eclipse
AST tree.
I can create Array node with dimensions like this:
ArrayCreation ac2 = ast.newArrayCreation();
ac2.setType(ast.newArrayType(ast.newPrimitiveType(PrimitiveT ype.DOUBLE),
3));
ac2.dimensions().add(ast.newNumberLiteral("7"));
ac2.dimensions().add(ast.newNumberLiteral("24"));

But then I don't know how to connect it to a tree as a field of a class.
I can set FieldDeclaration as ArrayType, but not sure how to specify the
size of each dimension.

Any help would be appreciated.

Thanks.
Re: Adding array node to the AST tree [message #246965 is a reply to message #246904] Sun, 27 January 2008 22:06 Go to previous message
Eclipse UserFriend
Alex a écrit :
> I am trying to figure out how to add an array declaration to an Eclipse
> AST tree.
> I can create Array node with dimensions like this:
> ArrayCreation ac2 = ast.newArrayCreation();
> ac2.setType(ast.newArrayType(ast.newPrimitiveType(PrimitiveT ype.DOUBLE),
> 3));
> ac2.dimensions().add(ast.newNumberLiteral("7"));
> ac2.dimensions().add(ast.newNumberLiteral("24"));
> But then I don't know how to connect it to a tree as a field of a class.
> I can set FieldDeclaration as ArrayType, but not sure how to specify the
> size of each dimension.
> Any help would be appreciated.
Hi,

If you descrive more the whole picture, I might be able to help you.
--
Olivier
Previous Topic:Relationship between plugins
Next Topic:Eclipse Group on Linkedin.com
Goto Forum:
  


Current Time: Sat Jun 07 16:56:55 EDT 2025

Powered by FUDForum. Page generated in 0.07341 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top