Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » [CORE] ClassInstanceCreation grammar question
[CORE] ClassInstanceCreation grammar question [message #62854] Fri, 20 June 2003 11:19 Go to next message
Eclipse UserFriend
Given:

ClassInstanceCreation:
[ Expression . ] new TypeName
( [ Expression { , Expression } ] )
[ AnonymousClassDeclaration ]

as the grammar for a ClassInstanceCreation per the JavaDoc in
ClassInstanceCreation,

I'm confused about what valid Java code would parse using the initial

[ Expression . ]

part of the grammar. Or even where I would go to find out.

I'd be most appreciative if someone could just post an example of valid
Java code that would parse using that optional Expression dot at the
beginning of that grammar.


Thanks much in advance,


Dave
--
Dave Orme
Advanced Systems Concepts
http://www.swtworkbench.com
Re: [CORE] ClassInstanceCreation grammar question [message #63224 is a reply to message #62854] Fri, 20 June 2003 11:56 Go to previous messageGo to next message
Eclipse UserFriend
Is this kind of example you're looking for?

public class A {
public class B {
public class C {
void foo() {
}
}
}
public static void main(String args[]) {
new A().new B().new C().foo();
}
}


"David J. Orme" <daveo@asc-iseries.com> wrote in message
news:bcv8lg$ug0$1@rogue.oti.com...
> Given:
>
> ClassInstanceCreation:
> [ Expression . ] new TypeName
> ( [ Expression { , Expression } ] )
> [ AnonymousClassDeclaration ]
>
> as the grammar for a ClassInstanceCreation per the JavaDoc in
> ClassInstanceCreation,
>
> I'm confused about what valid Java code would parse using the initial
>
> [ Expression . ]
>
> part of the grammar. Or even where I would go to find out.
>
> I'd be most appreciative if someone could just post an example of valid
> Java code that would parse using that optional Expression dot at the
> beginning of that grammar.
>
>
> Thanks much in advance,
>
>
> Dave
> --
> Dave Orme
> Advanced Systems Concepts
> http://www.swtworkbench.com
>
Re: [CORE] ClassInstanceCreation grammar question [message #64099 is a reply to message #63224] Sat, 21 June 2003 17:04 Go to previous message
Eclipse UserFriend
Jerome Lanneluc wrote:
> Is this kind of example you're looking for?
>
> public class A {
> public class B {
> public class C {
> void foo() {
> }
> }
> }
> public static void main(String args[]) {
> new A().new B().new C().foo();
> }
> }

Yes, perfect! Thanks.

Dave
Previous Topic:Verifier Related HotSwap Bug
Next Topic:Run configuration display in favorites menu?
Goto Forum:
  


Current Time: Wed Apr 16 10:35:21 EDT 2025

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

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

Back to the top