highlight::LanguageDefinition Class Reference

Contains specific data of the programming language being processed. More...

List of all members.

Public Member Functions

const string & getSymbolString () const
const string & getFailedRegex () const
unsigned char getRawStringPrefix () const
unsigned char getContinuationChar () const
bool highlightingEnabled () const
bool isIgnoreCase () const
int isKeyword (const string &s)
bool load (const string &langDefPath, bool clear=true)
bool allowNestedMLComments () const
bool highlightingDisabled () const
bool needsReload (const string &langDefPath) const
bool enableReformatting () const
bool allowExtEscSeq () const
const KeywordMapgetKeywords () const
const vector< string > & getKeywordClasses () const
const vector< RegexElement * > & getRegexElements () const
const string & getDescription () const
bool delimiterIsDistinct (int stateID)
int getDelimiterPairID (const string &token)
string getDelimRegex (const string &lang)
void restoreLangEndDelim (const string &langPath)
string getNewPath (const string &lang)
string getCurrentPath ()


Detailed Description

Contains specific data of the programming language being processed.

The load() method will only read a new language definition if the given file path is not equal to the path of the current language definition.

Author:
Andre Simon

Member Function Documentation

bool highlight::LanguageDefinition::allowExtEscSeq (  )  const [inline]

Returns:
True if escape sequences are allowed outsde of strings

Referenced by highlight::CodeGenerator::processRootState().

bool highlight::LanguageDefinition::allowNestedMLComments (  )  const [inline]

Returns:
True if multi line comments may be nested

bool highlight::LanguageDefinition::delimiterIsDistinct ( int  stateID  )  [inline]

Parameters:
stateID state id
Returns:
true, if no closing delimiter exists (open and close delimiters are equal)

bool highlight::LanguageDefinition::enableReformatting (  )  const [inline]

Returns:
True if current language may be reformatted (c, c++, c#, java)

Referenced by highlight::CodeGenerator::loadLanguage().

unsigned char highlight::LanguageDefinition::getContinuationChar (  )  const [inline]

Returns:
Continuation Character

int highlight::LanguageDefinition::getDelimiterPairID ( const string &  token  )  [inline]

Pairs of open/close tokens have a unique ID to test if two tokens act as delimiters

Parameters:
token delimiter token
Returns:
token ID

const string& highlight::LanguageDefinition::getDescription (  )  const [inline]

Returns:
description of the programming language

const string& highlight::LanguageDefinition::getFailedRegex (  )  const [inline]

Returns:
Failed regilar expression

Referenced by highlight::CodeGenerator::loadLanguage().

const vector<string>& highlight::LanguageDefinition::getKeywordClasses (  )  const [inline]

Returns:
keyword classes

Referenced by highlight::CodeGenerator::loadLanguage().

const KeywordMap& highlight::LanguageDefinition::getKeywords (  )  const [inline]

Returns:
keywords

string highlight::LanguageDefinition::getNewPath ( const string &  lang  ) 

Parameters:
lang language definition name (no path, no ".lang" extension)
Returns:
absolute path based on the previously loaded definition

Referenced by load(), and highlight::CodeGenerator::processRootState().

unsigned char highlight::LanguageDefinition::getRawStringPrefix (  )  const [inline]

Returns:
Prefix of raw strings

const vector<RegexElement*>& highlight::LanguageDefinition::getRegexElements (  )  const [inline]

Returns:
regular expressions

const string& highlight::LanguageDefinition::getSymbolString (  )  const [inline]

Returns:
Symbol string, containg all known symbols with the referencing state ids

bool highlight::LanguageDefinition::highlightingDisabled (  )  const [inline]

Returns:
True if highlighting is disabled TODO remove method

Referenced by highlight::CodeGenerator::processRootState().

bool highlight::LanguageDefinition::highlightingEnabled (  )  const [inline]

Returns:
true if syntax highlighting is enabled

Referenced by highlight::CodeGenerator::printExternalStyle().

bool highlight::LanguageDefinition::isIgnoreCase (  )  const [inline]

Returns:
True if language is case sensitive

int highlight::LanguageDefinition::isKeyword ( const string &  s  ) 

Parameters:
s String
Returns:
class id of keyword, 0 if s is not a keyword

bool highlight::LanguageDefinition::load ( const string &  langDefPath,
bool  clear = true 
)

Load new language definition

Parameters:
langDefPath Path of language definition
clear Test if former data should be deleted
Returns:
True if successfull

References Pattern::compile(), ConfigurationReader::found(), getNewPath(), ConfigurationReader::getParameter(), ConfigurationReader::getParameterNames(), and StringTools::getParantheseVal().

Referenced by highlight::CodeGenerator::loadLanguage().

bool highlight::LanguageDefinition::needsReload ( const string &  langDefPath  )  const [inline]

Returns:
True if the next load() call would load a new language definition
Parameters:
langDefPath Path to language definition

Referenced by highlight::CodeGenerator::loadLanguage().

void highlight::LanguageDefinition::restoreLangEndDelim ( const string &  langPath  ) 

initializes end delimiter regex to switch back to host language

Parameters:
langPath path of embedded language definition

References Pattern::compile().


The documentation for this class was generated from the following files:

Generated on Tue Oct 26 19:44:51 2010 for Highlight Code Converter by  doxygen 1.5.7.1