What's new? | Help | Directory | Sign in
Google
heron-language
Heron is an object-oriented programming language for model driven architecture
  
  
  
  
    
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
public class Point extends HeronObject {
// attributes
public double x;
public double y;
// operations
public Point(final double x, final double y){
{
this .x = x ;
this .y = y ;
}
}
public Vector asVector(){
{
return new Vector(x , y ) ;
}
}
public Point translate(final Vector v){
{
return new Point(x + v .x , y + v .y ) ;
}
}
public Vector difference(final Point pt){
{
return new Vector(pt .x - x , pt .y - y ) ;
}
}
public double distance(final Point pt){
{
return difference (pt ) .length () ;
}
}
public Point rotate(final Point pt, final double th){
{
double x1 = x * Demo .cos (th ) - y * Demo .sin (th ) ;
double y1 = x * Demo .sin (th ) + y * Demo .cos (th ) ;
return new Point(x1 , y1 ) ;
}
}
// state entry procedures
// dispatch function
public void onSignal(HeronSignal signal) {
if (false) {
}
}
}
Show details Hide details

Change log

r46 by cdiggins on Apr 08, 2008   Diff

 
Go to: 
Project members, sign in to write a code review

Older revisions

r44 by cdiggins on Mar 26, 2008   Diff
Improved parsing. Java code generation
still not great.
r43 by cdiggins on Mar 25, 2008   Diff
Improved C++ compliance of YARD
library. Started using unit tests
again. Made a bunch of improvements.
r41 by cdiggins on Feb 23, 2008   Diff

 
All revisions of this file

File info

Size: 1040 bytes, 45 lines