head	1.2;
access;
symbols
	java:1.1.0.2;
locks; strict;
comment	@# @;


1.2
date	96.10.23.04.22.42;	author hartmans;	state Exp;
branches;
next	1.1;

1.1
date	96.10.23.01.50.40;	author nathanw;	state dead;
branches
	1.1.2.1;
next	;

1.1.2.1
date	96.10.23.01.50.41;	author nathanw;	state Exp;
branches;
next	;


desc
@@


1.2
log
@mainline java-notes
@
text
@

Naming conventions
 - ADTs are classes
 - "global" procedures/variables are in class MacheteApp. 
   What if there is an adt MacheteApp? Lossage, but it's officially OK.
 - No packages are involved 
 

Codegen conventions
 - expr  has code to leave value on top of stack
 - lvalue has code to put value on top into variable
   (lloc and rloc both have attribs type "location", but the code
    is treated differently)
 - classes have null default constructors
 - methods are static
 - Booleans are passed as ints
 
 - we're using jasmin syntax, not javaa. Win: Fewer stupid bugs, easier
   to generate on-the-fly line number information and the like. Lose: ?


Code tossed into attribs; code generated in a completely bottom-up fashion.
Division of labor in syntax-directed calls: If a check needs to be made,
the routine in statics will call the routine in javagen.

Weird. isnull() can only be applied to locations. Makes some sense, since
it's a runtime error for an expression to evaluate to null, but syntacticly 
strange. 

Ever more strange, isnull() can be used on ints and bools in
Machete. It's never true, but the possibility of side-effects means
that the expression must be evaluated.  So we generate special code to
eval the expression, pop the value off the stack, and push false on the stack.

Split statics into statics (for checking) and syntax (for not-checking)

javagen cluster created

Java instruction cluster created
 - has newlabel, routines for generating common code blocks (like isnull)
 - has code for generating various special-case bits of code, like 
   isnull, write{int,string}, read{int,char}

Grammar changed
 - it didn't express the concept of lvalues vs. rvalues
 - it didn't pass in the actual operations performed in binary ops.

The attrib types of tokens really sucks. Strings? I mean, really....

Mass confusion about locations/symbols and the kinds of things that should 
be stored in them. @


1.1
log
@file java-notes was initially added on branch java.
@
text
@d1 52
@


1.1.2.1
log
@My notes on the java codegen to date.
@
text
@a0 52


Naming conventions
 - ADTs are classes
 - "global" procedures/variables are in class MacheteApp. 
   What if there is an adt MacheteApp? Lossage, but it's officially OK.
 - No packages are involved 
 

Codegen conventions
 - expr  has code to leave value on top of stack
 - lvalue has code to put value on top into variable
   (lloc and rloc both have attribs type "location", but the code
    is treated differently)
 - classes have null default constructors
 - methods are static
 - Booleans are passed as ints
 
 - we're using jasmin syntax, not javaa. Win: Fewer stupid bugs, easier
   to generate on-the-fly line number information and the like. Lose: ?


Code tossed into attribs; code generated in a completely bottom-up fashion.
Division of labor in syntax-directed calls: If a check needs to be made,
the routine in statics will call the routine in javagen.

Weird. isnull() can only be applied to locations. Makes some sense, since
it's a runtime error for an expression to evaluate to null, but syntacticly 
strange. 

Ever more strange, isnull() can be used on ints and bools in
Machete. It's never true, but the possibility of side-effects means
that the expression must be evaluated.  So we generate special code to
eval the expression, pop the value off the stack, and push false on the stack.

Split statics into statics (for checking) and syntax (for not-checking)

javagen cluster created

Java instruction cluster created
 - has newlabel, routines for generating common code blocks (like isnull)
 - has code for generating various special-case bits of code, like 
   isnull, write{int,string}, read{int,char}

Grammar changed
 - it didn't express the concept of lvalues vs. rvalues
 - it didn't pass in the actual operations performed in binary ops.

The attrib types of tokens really sucks. Strings? I mean, really....

Mass confusion about locations/symbols and the kinds of things that should 
be stored in them. @
