Home | Modules | Class Hierarchy | Alphabetical List | Compound List | Related Pages

# RegionHandler Class Reference
[Colorer interfaces]

Inheritance diagram for RegionHandler:

## Detailed Description

Handles parse information, passed from TextParser.

TextParser class generates calls of this class methods sequentially while parsing the text from top to bottom. All enterScheme and leaveScheme calls are properly enclosed, addRegion calls can inform about regions, overlapped with each other. All handler methods are called sequentially. It means, that if one of methods is called with some line number, all other calls (before endParsing event comes) can inform about events in the same, or lower line's numbers. This makes sequential tokens processing.

## Public Member Functions

virtual void | startParsing (int lno)
| Start of text parsing.
virtual void | endParsing (int lno)
| End of text parsing.
virtual void | clearLine (int lno, String *line)
| Clear line event.
virtual void | addRegion (int lno, String *line, int sx, int ex, const Region *region)=0
| Informs handler about lexical region in line.
virtual void | enterScheme (int lno, String *line, int sx, int ex, const Region *region, const Scheme *scheme)=0
| Informs handler about entering into specified scheme.
virtual void | leaveScheme (int lno, String *line, int sx, int ex, const Region *region, const Scheme *scheme)=0
| Informs handler about leaveing specified scheme.

## Member Function Documentation

virtual void RegionHandler::startParsing | ( | int | lno | ) | `[inline, virtual]`

Start of text parsing.

Called only once, when TextParser starts parsing of the specified block of text. All other event messages comes between this call and endParsing call.

Parameters:

  | lno | Start line number

Reimplemented in LineRegionsSupport.

virtual void RegionHandler::endParsing | ( | int | lno | ) | `[inline, virtual]`

End of text parsing.

Called only once, when TextParser stops parsing of the specified block of text.

Parameters:

  | lno | End line number

virtual void RegionHandler::clearLine | ( | int | lno,
|  | String * | line
| ) | `[inline, virtual]`

Clear line event.

Called once for each parsed text line, when TextParser starts to parse specified line of text. This method is called before any of the region information passed, and used often to clear internal handler structure of this line before adding new one.

Parameters:

  | lno | Line number

virtual void RegionHandler::addRegion | ( | int | lno,
|  | String * | line,
|  | int | sx,
|  | int | ex,
|  | const Region * | region
| ) | `[pure virtual]`

Informs handler about lexical region in line.

This is a basic method, wich transfer information from parser to application. Positions of different passed regions can be overlapped.

Parameters:

  | lno | Current line number
  | sx | Start X position of region in line
  | ex | End X position of region in line
  | region | Region information

virtual void RegionHandler::enterScheme | ( | int | lno,
|  | String * | line,
|  | int | sx,
|  | int | ex,
|  | const Region * | region,
|  | const Scheme * | scheme
| ) | `[pure virtual]`

Informs handler about entering into specified scheme.

Parameter `region` is used to specify scheme background region information. If text is parsed not from the first line, this method is called with fake parameters to compensate required scheme structure.

Parameters:

  | lno | Current line number
  | sx | Start X position of region in line
  | ex | End X position of region in line
  | region | Scheme Region information (background)
  | scheme | Additional Scheme information

virtual void RegionHandler::leaveScheme | ( | int | lno,
|  | String * | line,
|  | int | sx,
|  | int | ex,
|  | const Region * | region,
|  | const Scheme * | scheme
| ) | `[pure virtual]`

Informs handler about leaveing specified scheme.

Parameter `region` is used to specify scheme background region information. If text parse process ends, but current schemes stack is not balanced (this can happends because of bad balanced structure of source text, or partial text parse) this method is not called for unbalanced levels.

Parameters:

  | lno | Current line number
  | sx | Start X position of region in line
  | ex | End X position of region in line
  | region | Scheme Region information (background)
  | scheme | Additional Scheme information

Colorer-take5 Library. Copyright © 1999-2006 Igor Russkih.
Generated at Fri Nov 24 17:13:14 2006 by doxygen 1.4.6.