Java2D III a better problem description
BLS
lietz at wanadoo.fr
Fri Jul 21 02:21:43 PDT 2006
Hi Frank,
I am sorry. My previous problem discription was a piece of ...., I was a bit
in a hurry, so give me a second chance.
How to translate the following Java class/method/variable modifieres into D.
public, protected, private
do the D counterparts have the same scope ?.
static, final (or a combination of them)
...especially, when in use for Java classes.
synchronized, volatile (the thread thing).
any hint, tip, etc. is welcome.Thanks bjoern
PS ----------------------------------------
I know about the problems you are talking about in your previous msg.. I
think I should be able to solve them (better > some of them) because walking
the AST back or doing AST lookaheads is possible. I am also able to
visualize the AST, which is indeed, a great help.
"Frank Benoit" <keinfarbton at nospam.xyz> schreef in bericht
news:e9ovom$15sb$1 at digitaldaemon.com...
> What does this table mean?
>
> tokenNames[POST_INC]="++";
> tokenNames[Java symbol] = "D translation"
> ??
>
> The main problem is, that the operator cannot be mapped 1o1.
> The plus in Java can concatenate two strings, in D the '~' is used.
> Same for += and ~=.
> So if the parser do not know the types of the + operands, a solution can
> be to make every + operation to a D function call.
>
> java:
> a += b;
> c = a + b;
> D:
> AddAssign( a, b );
> c = Add( a, b );
>
> And AddAssign, Add are overloaded with various types:
> Add( char[], ... )
> Add( int, int )
> Add( long, long )
> ...
>
> Java:
> a instanceof ClassA
> D:
> ((cast(ClassA)a) !is null )
>
>
>
>
>
More information about the Digitalmars-d-announce
mailing list