\Luxor_Lang_Generic

A generic implementation of the Luxor_Lang API to handle all programming languages that don't have a specific driver.

Summary

Methods
Properties
Constants
factory()
builder()
processInclude()
__construct()
indexFile()
referenceFile()
processCode()
$_language
$_langmap
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$_language

$_language : string

The current language.

Type

string

$_langmap

$_langmap : array

This language's copy of the 'langmap' hash from the $languages array.

Type

array

Methods

factory()

factory(string  $driver, array  $params = array()) : mixed

Attempts to return a concrete Luxor_Lang instance based on $driver.

Parameters

string $driver

The type of concrete Luxor_Lang subclass to return. The is based on the repository driver ($driver). The code is dynamically included.

array $params

(optional) A hash containing any additional configuration or connection parameters a subclass might need.

Returns

mixed —

The newly created concrete Luxor_Lang instance, or false on an error.

builder()

builder(\Luxor_Files  $files, string  $pathname) : mixed

Attempts to determine a files programming language and returns a parser instance for this language.

Parameters

\Luxor_Files $files

An instance of Luxor_Files to use for file operations and path name resolution.

string $pathname

The path name of the file to create a parser for.

Returns

mixed —

The created concrete Luxor_Lang instance, or false on error.

processInclude()

processInclude(  $frag,   $dir) 

Parameters

$frag
$dir

__construct()

__construct(array  $params) 

Constructs a new generic language parser.

Parameters

array $params

A hash containing necessary parameters.

indexFile()

indexFile(string  $path, integer  $fileId) : mixed

Indexes a file.

Parameters

string $path

The full path name of the file to index.

integer $fileId

The file's unique ID.

Returns

mixed —

A PEAR_Error on error.

referenceFile()

referenceFile(string  $path, integer  $fileId) : mixed

References a file.

Parameters

string $path

The full path name of the file to reference.

integer $fileId

The file's unique ID.

Returns

mixed —

A PEAR_Error on error.

processCode()

processCode(string  $code,   $altsources = array()) 

Process a chunk of code

Basically, look for anything that looks like a symbol, and if it is then make it a hyperlink, unless it's a reserved word in this language.

Parameters

string $code

Reference to the code to markup.

$altsources