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

Class: Text_Highlighter_Generator

Source Location: /Text_Highlighter-0.7.3/Text/Highlighter/Generator.php

Class Overview

XML_Parser
   |
   --Text_Highlighter_Generator

Syntax highliter class generator class


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2004-2006 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

__construct (Constructor)   [line 216]

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 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 340]

string getCode( )

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

[ Top ]

getErrors   [line 395]

array getErrors( )

Returns errors
  • Access: public

[ Top ]

hasErrors   [line 380]

boolean hasErrors( )

Reports if there were errors
  • Access: public

[ Top ]

saveCode   [line 358]

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)

Format error message
  • Access: public

Parameters:

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

[ Top ]


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