parent is defined as a PApplet, so the compiler knows only the methods in PApplet, coming with Processing.
cool() is part of your program, which is actually inside a class created by Processing, of the name of your sketch, extending PApplet.
Something like:
Code:class MyFabulousSketch extends PApplet {
void setup() {} // Override PApplet's setup
void cool() {} // Add a new method not in PApplet
}
Since myClass is actually a nested class inside MyFabulousSketch, as blindfish wrote, it can access all the methods of the parent without problem.
If you really want to use parent, you can do it in a convoluted way (untested):
((MyFabulousSketch) parent).cool()ie. you tell the compiler that parent is more than a PApplet.
Libraries are another story: their classes are not nested in a PApplet, so they don't have a direct access to its methods, hence the need to pass a PApplet instance to them, eg. to draw on the surface of the sketch.
That's what you would get by putting myClass in a .java tab.
In short, for classes in .pde files (main or secondary), you don't have to pass around the 'this', it is always available.