apidoc
[ class tree: apidoc ] [ index: apidoc ] [ all elements ]

Class: Text_Highlighter_Generator

Source Location: /Text_Highlighter-0.5.1/Highlighter/Generator.php

Class Overview

XML_Parser
   |
   --Text_Highlighter_Generator

Syntax highliter class generator class


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2004 Andrey Demenev

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 74]
Syntax highliter class generator class

This class is used to generate PHP classes from XML files with highlighting rules

Usage example


1 require_once 'Text/Highlighter/Generator.php';
2 $generator =& new Text_Highlighter_Generator('php.xml');
3 $generator->generate();
4 $generator->saveCode('PHP.php');

A command line script generate is provided for class generation (installs in scripts/Text/Highlighter).



[ Top ]


Class Variables

$folding =  false

[line 84]

Whether to do case folding.

We have to declare it here, because XML_Parser sets case folding in constructor


Type:   boolean


[ Top ]

$language =  ''

[line 140]

Name of language
  • Access: public

Type:   string


[ Top ]



Method Detail

Text_Highlighter_Generator (Constructor)   [line 202]

Text_Highlighter_Generator Text_Highlighter_Generator( [string $syntaxFile = ''])

PHP4 compatable constructor
  • Access: public

Parameters:

string   $syntaxFile     Name of XML file with syntax highlighting rules

[ Top ]

generate   [line 308]

void generate( )

Generates class code
  • Access: public

[ Top ]

getCode   [line 341]

string getCode( )

Returns generated code as a string.
  • Return: Generated code
  • Access: public

[ Top ]

getErrors   [line 396]

array getErrors( )

Returns errors
  • Access: public

[ Top ]

hasErrors   [line 381]

boolean hasErrors( )

Reports if there were errors
  • Access: public

[ Top ]

saveCode   [line 359]

boolean saveCode( string $filename)

Saves generated class to file. Note that Text_Highlighter::factory() assumes that filename is uppercase (SQL.php, DTD.php, etc), and file is located in Text/Highlighter
  • Return: true on success, false on failure
  • Access: public

Parameters:

string   $filename     Name of file to write the code to

[ Top ]

setInputFile   [line 288]

boolean setInputFile( string $file)

Sets the input xml file to be parsed
  • Access: public

Parameters:

string   $file     Filename (full path)

[ Top ]

_formatError   [line 239]

array _formatError( int $code, string $params, string $fileName, int $lineNo)

Set up error message templates
  • Access: public

Parameters:

int   $code     error code
string   $params     parameters
string   $fileName     file name
int   $lineNo     line number

[ Top ]

__construct   [line 216]

void __construct( [string $syntaxFile = ''])

Constructor
  • Access: public

Parameters:

string   $syntaxFile     Name of XML file with syntax highlighting rules

[ Top ]


Documentation generated on Fri, 8 Oct 2004 01:00:26 -0400 by phpDocumentor 1.2.3. PEAR Logo Copyright © PHP Group 2004.