rwlogo

Rogue Wave Views
Gadgets Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
List of all members | Public Member Functions | Static Public Member Functions
IlvCodeEditor::Parser Class Referenceabstract

A Parser can read the text content of a CodeEditor and decorate it. More...

#include <ilviews/gadgets/codeedit.h>

Public Member Functions

void associate (const char *ext)
 Associates a parser with a filename extension. More...
 

Static Public Member Functions

static ParserCreateCPPParser ()
 Creates a new parser that can handle C and C++ source code. More...
 
static ParserCreateDefaultParser ()
 Creates a new parser that can handle raw text. More...
 
static ParserCreateHTMLParser ()
 Creates a new parser that can handle HTML code. More...
 
static ParserCreateJavaParser ()
 Creates a new parser that can handle Java source code. More...
 
static ParserCreateJavaScriptParser ()
 Creates a new parser that can handle JavaScript source code. More...
 
static ParserCreateMakefileParser ()
 Creates a new parser that can handle Makefile content. More...
 

Detailed Description

A Parser can read the text content of a CodeEditor and decorate it.

Library: ilvadvgdt

Predefined parsers can be associated with filename extensions.

Member Function Documentation

void IlvCodeEditor::Parser::associate ( const char *  ext)

Associates a parser with a filename extension.

After this method is called, and when the user calls IlvCodeEditor::loadFile() providing a filename that has this extension, then the associated parser is invoked to decorate the file content.

Once associated with one or several filename extensions, the instance of Parser is automatically deleted by the library when the application exits. So the user code may typically look like:

cppParser->associate("cpp");
cppParser->associate("C");
cppParser->associate("h");
cppParser->associate("hxx");

The variable cppParser will be deleted on exit.

The predefined parser are:

If the extension has already been associated to another parser, the old association is replaced by the new one

Parameters
extThe filename extension, without the leading dot.
static Parser* IlvCodeEditor::Parser::CreateCPPParser ( )
static

Creates a new parser that can handle C and C++ source code.

Returns
A new parser that can handle C/C++ code.
static Parser* IlvCodeEditor::Parser::CreateDefaultParser ( )
static

Creates a new parser that can handle raw text.

Returns
A new parser that can handle text with no specific grammar.
static Parser* IlvCodeEditor::Parser::CreateHTMLParser ( )
static

Creates a new parser that can handle HTML code.

Returns
A new parser that can handle HTML code.
static Parser* IlvCodeEditor::Parser::CreateJavaParser ( )
static

Creates a new parser that can handle Java source code.

Returns
A new parser that can handle C/C++ code.
static Parser* IlvCodeEditor::Parser::CreateJavaScriptParser ( )
static

Creates a new parser that can handle JavaScript source code.

Returns
A new parser that can handle JavaScript code.
static Parser* IlvCodeEditor::Parser::CreateMakefileParser ( )
static

Creates a new parser that can handle Makefile content.

Returns
A new parser that can handle Makefiles.

© Copyright 2015, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.