C++ class: doctemplate.h.
More...
Classes
The main class for writing into the output.
More...
Translates specific character sequences into corresponding ones; it can also use regular expression for the characters to be translated.
More...
Simple map for colors (maps a color constant string to the corresponding color of the output format)
More...
Collects the tags information generated by the ctags program for a given word.
More...
Takes care of running ctags and to generate a CTagsFormmatter.
More...
Implementation of highlight events that prints debug information.
More...
Given a
DocTemplate it generates the start of the document and the end, using variables such as title, file_name, header, etc.
More...
A generic event generator, for listeners of type EventListener and events of type EventType.
More...
Information about the file we are processing.
More...
The base abstract class for formatting strings.
More...
The generic abstract factory to create
Formatter objects, during the parsing of style files.
More...
Associates to an element name the corresponding formatter.
More...
Additional parameters that can be passed to a formatter.
More...
Event concerning an highlighting operation (e.g., formatting, entering a new state, exiting a state, etc.)
More...
Base class for highlight rules.
More...
Abstract factory for highlighting rules.
More...
Represents a state during the highlighting (e.g., comment state, string state, etc.)
More...
Token containing information for performing the highlight.
More...
This class contains static and singleton instances for some utility classes for LangDefManagers,
LangMap, etc.
More...
Exception representing an error in an input/output operation.
More...
Handles langdef language definition files.
More...
Prints all the language elements.
More...
A map stored in a file with the format key = elem.
More...
Tries to infer the language by inspecting the input file.
More...
A buffer for a line to be generated.
More...
Generates line numbers in the output.
More...
Functionalities for detecting whether a line is in one of the stored line ranges (or in the context of a range).
More...
Structure for passing parameters to the matching algorithm, for instance, "not beginning of line", etc.
More...
An element with subparts (subexpressions), each with a possible different name.
More...
Represents an exception during parsing, for instance, syntax errors.
More...
Stores information about the file name and the line number of a generic element created during parsing.
More...
Preformats text to be generated.
More...
internal struct to store information about references
More...
preprocess a regular expression, e.g., transform "()" into "(?:)"
More...
Stores possible separators implemented as regular expressions and provides functionalities to search for such occurrences in lines.
More...
Implementation of the abstract factory, creating highlighting rules based on boost::regex regular expressions.
More...
Handles the settings for source-highlight (and its library).
More...
The main class performing highlighting of an input file generating an output file.
More...
The main class performing the highlighting of a single line.
More...
Class with some utility static methods.
More...
a language element that introduces a new state pattern Composite
More...
A language element that may start a new state/environment.
More...
represent a string for a language definition file's element
More...
A language element consisting of a list of strings.
More...
Stores dynamically allocated strings (used by the scanners), so that, later on, we can easily free all the memory for these strings.
More...
A utility class with static methods to parse style files.
More...
Represents a formatting template where there can be some variables (starting with ,ドル e.g., $style, $text, etc.) that will be replaced with specific elements, e.g., the actual style for the formatting, the text to format, etc.
More...
Given
TextStyle objects build a new one, adding a starting part, and ending part, and separating them.
More...
Contains
TextStyle objects for all formats (e.g., bold, italics, etc), and other templates (e.g., for the document header, etc.); it also contains the color map and the char translator.
More...
PerFormratter to convert tabs to spaces before generation.
More...
generic utils functions (e.g., string manipulation)
More...
store definitions of strings and regular expressions representing language elements
More...
Utility class to output messages in case of verbose option is requested.
More...
Utility functions for version numbers.
More...
Tokenizes a paragraph separating words from spaces.
More...
Typedefs
the contents to be put after a line or after the document
The collection of information about a tag.
collection of strings to be written after (post) a line or a doc
collection of StyleConstant objects
shared pointer for StyleConstants
iterator for StyleConstants
the map for formatters
typedef std::deque< std::string >
ElemList
list representing the names of parts of a program
typedef std::list< std::string > WordList
typedef std::list< std::string > ElemNameList
List of rules.
the values for replacing references (it should contain 9 possibly empty elements, because 9 is usually the limit for backreferences in regular expressions)
typedef std::set< int > StateIdSet
typedef std::list< std::pair
< std::string, std::string > >
MatchedElements
The matched element information by a rule.
More...
The matched subexpressions (if the original rule had subexpressions)
collection of element names
typedef boost::shared_ptr
<
ParseStruct >
ParseStructPtr
all the marked subexpressions in a list
Information about backreferences; the first elem contains the number of backreferences and the second one contains the highest backreference info.
What to replace to backreferences in a regular expression.
The result of boost::regex_search.
typedef boost::shared_ptr
< HighlightStateStack > HighlightStateStackPtr
a set of strings
typedef std::list<
StringDef * >
StringDefsBase
typedef string KeyType
typedef list< KeyType > KeyList
map for substitutions
shared pointer
Enumerations
constants indicating boldface, italics, etc.
More...
enum
RangeError {
NO_ERROR = 0,
INVALID_RANGE_NUMBER
}
a possible error in specifying a range
enum
RangeResult {
NOT_IN_RANGE = 0,
CONTEXT_RANGE,
IN_RANGE
}
result for a check whether a number is in a range (or in a context)
where a reference must be put
More...
enum
SettingError {
NO_SETTING_ERROR = 0,
CANT_CREATE_DIR,
CANT_CREATE_FILE
}
an error dealing with setting configuration file
enum load_line_ret { FOUND_EOF = 0,
FOUND_NL,
FOUND_END
}
debugging policy
Functions
void set_file_util_verbose (bool b)
string
readFile (const string &fileName) throw (IOException)
Reads the contents of the file into a string and returns it.
More...
string
createOutputFileName (const string &inputFileName, const string &outputDir, const string &ext)
Creates the output file name as outputDir + input file name + ext.
More...
FILE * open_file_stream (const string &input_file_name)
istream * open_file_istream (const string &input_file_name)
istream * open_file_istream_or_error (const string &input_file_name)
istream * _open_data_file_istream (const string &path, const string &input_file_name)
istream * open_data_file_istream (const string &path, const string &input_file_name, const string &start)
FILE * _open_data_file_stream (const string &path, const string &input_file_name)
FILE * open_data_file_stream (const string &path, const string &input_file_name, const string &start)
bool read_line (istream *in, string &line)
string get_file_path (const string &s)
bool contains_path (const string &s)
string strip_file_path (const string &s)
string get_input_file_name (const string &file_name)
std::ostream &
operator<< (std::ostream &os, const
IOException &entry)
LangElems *
parse_lang_def (const char *path, const char *name)
void open_file_to_scan (const string &path, const string &name)
Releases resources allocated by the scanner.
boost::regex
assoc_exp ("[[:blank:]]*([^[:blank:]]+)[[:blank:]]*=[[:blank:]]*([^[:blank:]\\r]+)[[:blank:]\\r]*|([[:space:]]+)|([[:space:]]*#.*)")
the regular expression for the map file syntax
const string guessEmacsMode (const string &modeline)
TextStylesPtr parse_outlang_def (const char *path, const char *name)
void open_outlang_file_to_scan (const string &path, const string &name)
Releases resources allocated by the scanner.
Parses the specified style file, and creates the corresponding formatters, using the passed
FormatterFactory.
More...
Parses the specified style file, and creates the corresponding formatters, using the passed
FormatterFactory.
More...
void parseStyleError (const std::string &error)
for css style files
matches character sets in a regular expression
const boost::regex
from ("(\\\\\\()|(\\((?!\\?))")
substitute a "(" with "(?:" if it's not followed by a ? and not preceeded by \ char
const boost::regex
paren ("(?<!\\\\)\\((?!\\?)")
found actual marking parenthesis, i.e., not preceeded by \ and not followed by ?
const boost::regex
backreference ("(\\\\([[:digit:]]))|(\\(\\?\\(([[:digit:]]))")
regular expression matching a backreference, e.g., 1円 or inside a conditional (?(1)...)
boost::regex
datadir_exp ("[[:blank:]]*(datadir)[[:blank:]]*=[[:blank:]]*\"([^[:blank:]\\r]+)\"[[:blank:]\\r]*|([[:space:]]+)|([[:space:]]*#.*)")
the regular expression for the conf file syntax
const boost::regex tabexp ("[\\t]")
string subst (const boost::regex &e, const string &s, const string &sub)
template<class T >
Converts a collection of objects with method toString into a string, using the passed separator to separate the elements.
More...
template<class T >
Converts a collection of objects into a string (relying on its stream representation), using the passed separator to separate the elements.
More...
template<class T >
Converts a collection of objects with method toStringOriginal into a string, using the passed separator to separate the elements.
More...
template<class T >
Converts a collection of objects into a string, using the passed separator to separate the elements.
More...
template<class T >
Converts a collection of objects into a string, using the passed separator to separate the elements.
More...
Variables
std::string start_path
const string
into = "(?1\\\\\\()(?2\\(\\?\\:)"
substitute a "(" with "(?:" if it's not followed by a ? and not preceeded by \ char
if set (i.e., not empty), retrieveDataDir() always returns this value
...with its escaped version
const boost::regex
reference_exp ("(?<!\\\\)@\\{([[:digit:]])\\}")
regular expression matching a reference, e.g.,digit} the $ must not be preceeded by an escape char
const boost::regex
special_char ("(\\.|\\[|\\]|\\{|\\}|\\(|\\)|\\\\|\\*|\\+|\\?|\\||\\^|\\$)")
substitute a special char (i.e., .[{()*+?|^$)...
const string _make_nonsensitive (const string &s)
Detailed Description
Typedef Documentation
typedef boost::shared_ptr<
HighlightRule> srchilite::HighlightRulePtr
Shared pointer for HighlightRule.
We need to use shared pointers because if we need to substitute some variables in a rule, we need to create a brand new copy of it, while we keep on using the same rules that do not need substitutions. Using shared pointers will automatically keep track of those that need to be removed.
The matched element information by a rule.
Each element of the collection is: first = the element name, second = the actual program string
Enumeration Type Documentation
where a reference must be put
| Enumerator |
|---|
| INLINE |
put reference inline
|
| POSTLINE |
put all references of a line at the end of the line
|
| POSTDOC |
put all references at the end of the document
|
constants indicating boldface, italics, etc.
| Enumerator |
|---|
| ISBOLD |
bold
|
| ISITALIC |
italics
|
| ISUNDERLINE |
underline
|
| ISFIXED |
fixed size
|
| ISNOTFIXED |
non fixed size
|
| ISNOREF |
must not contain references
|
Function Documentation
void srchilite::close_langdefinputfile
(
)
Closes the input file.
This is required only in case of errors during parsing (otherwise the file is closed automatically when the scanner reaches the end of file).
void srchilite::close_outlangdefinputfile
(
)
Closes the input file.
This is required only in case of errors during parsing (otherwise the file is closed automatically when the scanner reaches the end of file).
template<class T >
const std::string srchilite::collectionRefToString
(
const T &
collection,
char
sep = ' '
)
Converts a collection of objects into a string, using the passed separator to separate the elements.
- Parameters
-
collection
sep
template<class T >
const std::string srchilite::collectionToString
(
const T *
collection,
char
sep = ' '
)
Converts a collection of objects into a string, using the passed separator to separate the elements.
- Parameters
-
collection
sep
string srchilite::createOutputFileName
(
const string &
inputFileName,
const string &
outputDir,
const string &
ext
)
Creates the output file name as outputDir + input file name + ext.
- Parameters
-
inputFileName
outputDir
ext
- Returns
- the output file (including the path)
string srchilite::get_file_extension
(
const string &
filename )
- Parameters
-
filename
- Returns
- returns the file extension (without the dot)
unsigned int srchilite::get_line_count
(
istream &
input )
- Parameters
-
input
- Returns
- returns the number of lines of the passed input stream
void srchilite::parseStyles
(
const std::string &
path,
const std::string &
name,
std::string &
bodyBgColor
)
Parses the specified style file, and creates the corresponding formatters, using the passed FormatterFactory.
- Parameters
-
path the path for searching for style files
name the style file name
formatterFactory
bodyBgColor the background color for the document (can be an empty string)
void srchilite::parseStyles
(
const std::string &
name,
std::string &
bodyBgColor
)
Parses the specified style file, and creates the corresponding formatters, using the passed FormatterFactory.
(For the default searching path, it uses the hardcoded data dir).
- Parameters
-
name the style file name
formatterFactory
bodyBgColor the background color for the document (output parameter)
string srchilite::readFile
(
const string &
fileName )
throw ( IOException
)
Reads the contents of the file into a string and returns it.
- Parameters
-
fileName
- Returns
- the contents of the file
- Exceptions
-
template<class T >
const std::string srchilite::toStringCollection
(
const T *
collection,
char
sep = ' '
)
Converts a collection of objects with method toString into a string, using the passed separator to separate the elements.
- Parameters
-
collection
sep
template<class T >
const std::string srchilite::toStringCollection
(
const T &
collection,
char
sep = ' '
)
Converts a collection of objects into a string (relying on its stream representation), using the passed separator to separate the elements.
- Parameters
-
collection
sep
template<class T >
const std::string srchilite::toStringOriginalCollection
(
const T *
collection,
char
sep = ' '
)
Converts a collection of objects with method toStringOriginal into a string, using the passed separator to separate the elements.
- Parameters
-
collection
sep