c2ephp

CAOSHighlighter Class Reference

Class for highlighting CAOS. More...

List of all members.

Public Member Functions

 CAOSHighlighter ($format)
 Instantiates a new CAOSHighlighter for the given CAOS format.
 HighlightScript ($script)
 Highlights the given CAOS script.

Detailed Description

Class for highlighting CAOS.

This is the class used for highlighting CAOS code.
It outputs HTML code, using spans with classes.
It current supports C2, C3 and DS CAOS.
It automatically formats a script while preserving formatting in comments and strings. The reason it formats scripts is because scripts in COBs and agents tend to have little in the way of formatting, making them hard to read.
It also provides rudimentary error detection which will display errors with strings, byte strings and invalid CAOS functions. It checks labels (used with SUBR and GSUB) for validity and existence

Usage: $highlighter = new CAOSHighlighter(FORMAT_C1); $highlighter->HighlightScript($caos_code);

Definition at line 28 of file CAOSHighlighter.php.


Member Function Documentation

CAOSHighlighter::CAOSHighlighter ( format)

Instantiates a new CAOSHighlighter for the given CAOS format.

This function also loads CAOS definitions from the subfolders of this folder. In this way it is extensible.

Parameters:
$formatThe format of the CAOS you intend to highlight.

Definition at line 56 of file CAOSHighlighter.php.

CAOSHighlighter::HighlightScript ( script)

Highlights the given CAOS script.

If you're taking CAOS from a COB file, please replace the commas with newlines. This may not be necessary any more.

Parameters:
$scriptthe CAOS script as a string.

Definition at line 80 of file CAOSHighlighter.php.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Enumerations