kmy.jint.parser
Class ClassConsumer

java.lang.Object
  |
  +--kmy.jint.parser.ClassConsumer
Direct Known Subclasses:
JintClassTable.JintClassConsumer

public class ClassConsumer
extends java.lang.Object

This defines an object that "consumes" parsing tree as it is being produced. ClassConsumer object can be given to Parser and its methods will be called as corresponding constructions are being parsed.


Constructor Summary
ClassConsumer()
           
 
Method Summary
 void finishScope(java.lang.Object handle, BasicNode def)
          This method is called when scope (class or method) is completely parsed.
 java.lang.Object startScope(java.lang.Object outerHandle, Identifier name, int flags, IdentifierNode[] ext, IdentifierNode[] impl, java.lang.Class what)
          This method is called when a scope (class or method) is discovered by the parser.
 void tellErrorStorage(ErrorStorage errorStorage)
           
 void tellImport(IdentifierNode imp)
          Notifies class consumer when import statement is encountered.
 void tellPackage(IdentifierNode pack)
          Notifies class consumer when package statement is encountered.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Constructor Detail

ClassConsumer

public ClassConsumer()
Method Detail

tellImport

public void tellImport(IdentifierNode imp)
Notifies class consumer when import statement is encountered.

tellPackage

public void tellPackage(IdentifierNode pack)
Notifies class consumer when package statement is encountered.

tellErrorStorage

public void tellErrorStorage(ErrorStorage errorStorage)

startScope

public java.lang.Object startScope(java.lang.Object outerHandle,
                                   Identifier name,
                                   int flags,
                                   IdentifierNode[] ext,
                                   IdentifierNode[] impl,
                                   java.lang.Class what)
This method is called when a scope (class or method) is discovered by the parser. Note that scope is not just any {...}, it is either class or method (or [...] block in Jint which is considered to be an inner class with single method).
Parameters:
outerHanle - handle to the outer class or null for top-level classes
packageName - name of the package, or null for inner classes
name - class name

finishScope

public void finishScope(java.lang.Object handle,
                        BasicNode def)
This method is called when scope (class or method) is completely parsed.