lexx.parser
Class ParserListener

java.lang.Object
  |
  +--lexx.parser.ParserListener
All Implemented Interfaces:
javax.swing.event.DocumentListener, java.util.EventListener
Direct Known Subclasses:
JavaParserListener

public abstract class ParserListener
extends java.lang.Object
implements javax.swing.event.DocumentListener

Performs parsing on a OO programming language and produces an AST

This package takes in an DocumentEvent and creates an AST of the OO programming language source code.

Copyright (c) 2002-2003

Since:
20/03/2003
Version:
1.0
Author:
Mohammed Imran

Field Summary
(package private)  ASTAnalyser analyse
           
(package private)  java.lang.String code
           
(package private)  javax.swing.text.Document doc
           
(package private) static org.apache.log4j.Logger log
           
(package private)  Packages pack
           
(package private)  IncrementAST root
           
 
Constructor Summary
ParserListener()
           
 
Method Summary
 void changedUpdate(javax.swing.event.DocumentEvent e)
           
protected  ASTAnalyser getAnalyse()
           
abstract  ASTAnalyser getAnalyser()
           
 java.awt.Dimension getCoord(int position)
           
 int getPos(int line, int col)
           
 void insertUpdate(javax.swing.event.DocumentEvent e)
          Updates document structure as a result of text insertion.
 void removeUpdate(javax.swing.event.DocumentEvent e)
          Updates any document structure as a result of text removal.
protected abstract  void scan(javax.swing.event.DocumentEvent chng, boolean wasInserted)
           
protected  void setAnalyse(ASTAnalyser analyse)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

doc

javax.swing.text.Document doc

log

static final org.apache.log4j.Logger log

pack

Packages pack

code

java.lang.String code

root

IncrementAST root

analyse

ASTAnalyser analyse
Constructor Detail

ParserListener

public ParserListener()
Method Detail

insertUpdate

public final void insertUpdate(javax.swing.event.DocumentEvent e)
Updates document structure as a result of text insertion. This will happen within a write lock. The superclass behavior of updating the line map is executed followed by marking any comment areas that should backtracked before scanning.

Specified by:
insertUpdate in interface javax.swing.event.DocumentListener

removeUpdate

public final void removeUpdate(javax.swing.event.DocumentEvent e)
Updates any document structure as a result of text removal. This will happen within a write lock. The superclass behavior of updating the line map is executed followed by placing a lexical update command on the analyzer queue.

Specified by:
removeUpdate in interface javax.swing.event.DocumentListener

getCoord

public final java.awt.Dimension getCoord(int position)

getPos

public final int getPos(int line,
                        int col)

changedUpdate

public final void changedUpdate(javax.swing.event.DocumentEvent e)
Specified by:
changedUpdate in interface javax.swing.event.DocumentListener

getAnalyser

public abstract ASTAnalyser getAnalyser()

scan

protected abstract void scan(javax.swing.event.DocumentEvent chng,
                             boolean wasInserted)

getAnalyse

protected final ASTAnalyser getAnalyse()

setAnalyse

protected final void setAnalyse(ASTAnalyser analyse)