Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | Related Pages

AutoCompletion Class Reference

Class to discovers which auto-completion possibilities there is from a string. More...

Collaboration diagram for AutoCompletion:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 AutoCompletion (Shell shell)
string AutoCompletePart (string program, out bool firstWord)
 Extracts the tail of a string which should be tested for auto-completion.
ArrayList Word (string word, bool firstWord)
 Discovers auto-completion possibilities for a string.

Static Public Member Functions

static string MakeCommonPart (ArrayList matches)
 Finds the n first common letters and insert them as the first string in the matches arraylist.

Private Member Functions

void CheckBuildinCommands (string word, ref ArrayList matches)
void CheckVariables (string word, ref ArrayList matches)
 Checks user defined variables.
void CheckType (Type type, string qualifier, Match m, ref ArrayList matches)
 Checks for auto-completion, given a type of object (a class) and a string.
void CheckTypeDescrendLevel (string memberName, Type type, string qualifier, Match m, ref ArrayList matches)
 Descrends a level when checking a type. It is done when there is a seperator, such as a dot (.).
void CheckNamespaces (string word, ref ArrayList matches)
 Checks for auto-completion possibilities that begins with a namespace or a class.
void DllChanged ()
void CheckNamespacesRecursive (Node current, string nspace, Match m, string word, ref ArrayList matches)
 Helper function for CheckNamespaces.
void AddTypeNameMatches (Node current, string uncompletedTypeName, string element, ref ArrayList matches)
 Adds typenames when doing namespace completion.
Node BuildGraph ()
void RemoveDuplicates (ref ArrayList matches)
 Remove duplicate intries in the match array list.

Private Attributes

Regex namespaceRegex = new Regex(@"([a-zA-Z][a-zA-Z0-9]*)\.?")
Shell _shell
Node head = null

Static Private Attributes

static Regex completePartRegex
static Regex completePartVerifyRegex
static Regex typeMatch
static Regex isQualified = new Regex(@"[\(\)\.]")

Detailed Description

Class to discovers which auto-completion possibilities there is from a string.

Todo:
Auto-complete filenames and variables which are used without #-sign.


Constructor & Destructor Documentation

AutoCompletion::AutoCompletion Shell  shell  )  [inline]
 


Member Function Documentation

void AutoCompletion::AddTypeNameMatches Node  current,
string  uncompletedTypeName,
string  element,
ref ArrayList  matches
[inline, private]
 

Adds typenames when doing namespace completion.

Parameters:
current The node in the namespace/type graph which is currently active.
uncompletedTypeName The uncompleted typename _with_ the qualifying namespace(s).
element The uncompleted typename _without_ the qualifying namespace(s).
matches The list of matches, where new matches should be added to.

string AutoCompletion::AutoCompletePart string  program,
out bool  firstWord
[inline]
 

Extracts the tail of a string which should be tested for auto-completion.

Parameters:
program The hole up until where the cursor are placed.
firstWord This decides if the first word is included in the returned string.
Returns:
The string which should be tested for auto-completion possibilities, by the function Word.

Node AutoCompletion::BuildGraph  )  [inline, private]
 

void AutoCompletion::CheckBuildinCommands string  word,
ref ArrayList  matches
[inline, private]
 

void AutoCompletion::CheckNamespaces string  word,
ref ArrayList  matches
[inline, private]
 

Checks for auto-completion possibilities that begins with a namespace or a class.

void AutoCompletion::CheckNamespacesRecursive Node  current,
string  nspace,
Match  m,
string  word,
ref ArrayList  matches
[inline, private]
 

Helper function for CheckNamespaces.

void AutoCompletion::CheckType Type  type,
string  qualifier,
Match  m,
ref ArrayList  matches
[inline, private]
 

Checks for auto-completion, given a type of object (a class) and a string.

void AutoCompletion::CheckTypeDescrendLevel string  memberName,
Type  type,
string  qualifier,
Match  m,
ref ArrayList  matches
[inline, private]
 

Descrends a level when checking a type. It is done when there is a seperator, such as a dot (.).

void AutoCompletion::CheckVariables string  word,
ref ArrayList  matches
[inline, private]
 

Checks user defined variables.

void AutoCompletion::DllChanged  )  [inline, private]
 

static string AutoCompletion::MakeCommonPart ArrayList  matches  )  [inline, static]
 

Finds the n first common letters and insert them as the first string in the matches arraylist.

void AutoCompletion::RemoveDuplicates ref ArrayList  matches  )  [inline, private]
 

Remove duplicate intries in the match array list.

ArrayList AutoCompletion::Word string  word,
bool  firstWord
[inline]
 

Discovers auto-completion possibilities for a string.

Parameters:
word The string to investigate for auto-completion possibilities.
firstWord Whether this is the first word in the input window.
Returns:
A list of auto-completion possibilities. If there is more than possibility, the first string in the list will be their common part. For example, with possibilities: abcef, abcek, abcjk, the first string will be abc.


Member Data Documentation

Shell AutoCompletion::_shell [private]
 

Regex AutoCompletion::completePartRegex [static, private]
 

Initial value:

        new Regex(@"\#(?![a-zA-Z_])|\#?(([a-zA-Z_][a-zA-Z0-9_]*)" +
                  @"((?<rtparen>\))|(?<ltparen-rtparen>\()|" +
                  @"(?(rtparen)[^()]*))*\.?)+", RegexOptions.RightToLeft)

Regex AutoCompletion::completePartVerifyRegex [static, private]
 

Initial value:

        new Regex(@"\#(?![a-zA-Z_])|\#?(([a-zA-Z_][a-zA-Z0-9_]*)" +
                  @"((?<ltparen>\()|(?<rtparen-ltparen>\))|" +
                  @"(?(ltparen)[^()]*))*\.?)+")

Node AutoCompletion::head = null [private]
 

Regex AutoCompletion::isQualified = new Regex(@"[\(\)\.]") [static, private]
 

Regex AutoCompletion::namespaceRegex = new Regex(@"([a-zA-Z][a-zA-Z0-9]*)\.?") [private]
 

Regex AutoCompletion::typeMatch [static, private]
 

Initial value:

 new Regex(@"([a-zA-Z_][a-zA-Z0-9_]*)" + 
                                              @"((?<ltparen>\()|(?<rtparen-ltparen>\))|" +
                                              @"(?(ltparen)[^()]*))*\.?")
Todo:
Find a better name


The documentation for this class was generated from the following file: SourceForge.net Logo