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

Class: Text_Highlighter_Generator

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

Class Overview

XML_Parser
   |
   --Text_Highlighter_Generator

Syntax highliter class generator class


Author(s):

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).

  • See:


[ 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

__construct (Constructor)   [line 208]

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

Constructor
  • Access: public

Parameters:

string   $syntaxFile   —  Name of XML file with syntax highlighting rules

[ Top ]

Text_Highlighter_Generator (Constructor)   [line 194]

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 ]

declareErrorMessages   [line 252]

array declareErrorMessages( )

Set up error message templates for PEAR_ErrorStack.
  • Access: public

[ Top ]

generate   [line 301]

void generate( )

Generates class code
  • Access: public

[ Top ]

getCode   [line 332]

string getCode( )

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

[ Top ]

saveCode   [line 350]

foolean 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 281]

boolean setInputFile( string $file)

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

Parameters:

string   $file   —  Filename (full path)

[ Top ]

_formatError   [line 232]

array _formatError( $stack, array $err, object $syntaxFile)

Set up error message templates for PEAR_ErrorStack.
  • Access: public

Parameters:

object   $syntaxFile   —  PEAR_ErrorStack
array   $err   —  error
   $stack   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 13:51:46 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.