Discussion
Topics
Last Day
Last Week
Tree View

Search
New Messages
Keyword Search

Help
Getting Started
Formatting
Troubleshooting
Program Credits

Utilities
Edit Profile
Administration
Contact

 
forum - discussion board
- about - downloads - registration - forum - misc - home - © 1996-99 GWD Text Editor

Custom Code Completion Files?

GWD Text Editor Forum: Technical Support: Custom Code Completion Files?
Top of pagePrevious messageNext messageBottom of pageLink to this message  By Anonymous on Tuesday, April 25, 2000 - 11:12 pm:

I love the new Code Completion feature! I am trying to create my own code completion files for different programming languages. I am looking at the existing "*.lb" files and the "CodeCmpl.ini" file for templates, but I am having trouble deciphering the delimited fields. Can you give a description of how to create a custom code completion file correctly?


Top of pagePrevious messageNext messageBottom of pageLink to this message  By Vedran Gaco (Vgaco) on Wednesday, April 26, 2000 - 01:40 am:


                     CodeCompletions File Format
                     ---------------------------


1. GWD CodeCompl.INI file format
--------------------------------

[C/C++]
Extensions=*.c;*.cpp;*.cxx;*.cc;*.h;*.hpp;*.hxx
Libraries=stdc.lb;win32.lb
CaseSensitive=1
OpenDelimiter=(
CloseDelimiter=)
FuncCallSeparator=,
FuncProtoSeparator=,
ClassDefSeparator=::
ClassCallSeparator1=.
ClassCallSeparator2=->
OrOperator=|
AndOperator=&
FuncProtoMask=#r #c::#f(#p)
ProcProtoMask=#r #c::#f(#p)


2. GWD Library File Format
--------------------------


In INI File are stored LanguageDescription:
   OpenDelim CloseDelim FuncCallSep FuncProtoSep ClassDefSep ClassCallSep1 ClassCallSep2 OrOper AndOper
   How to create function prototype from function description, etc.


CodeCompletion library are saved in two files: Text file with LB extension,
which contains all informations and binary index file with LBI extension
(generated from the LB file). LBI files are created for faster loading.


2.1 LB FILE FORMAT
------------------

LB file are textual file. From this file GWD Text Editor will create appropriate
index file which will be loaded in the memory.

Maximum line len in the LB file is 2047 bytes.

First Line:  Library_Name

Lines which begins with ; are comments
Lines which begins with : are class names
Lines which begins with + are functions description
Lines which begins with ! are language other tokens (definitions, constants, keywords, etc.)


2.1.1 FORMAT OF CLASS NAME LINE
-------------------------------

:ClassName

For example:

:CString


2.1.2 FORMAT OF FUNCTION/PROPERTY DEFINITION LINE
-------------------------------------------------

Function definition is consist from several field and subfields. Fileds
are separated with ASCII(1) character (\01).

+FunctionName \01 ReservDesc \01 FuncProcProperty \01 ClassName \01 ReturnType \01 PrototypeString \01 ParameterList

   FunctionName
   ------------

   Function name (e.g. malloc, GetWindowRect,...)

   ReservDesc
   ----------

   Reserved for function description (not used yet).

   FuncProcedureProperty
   ---------------------

   This paremeter specify is this is a function (requires open and close brackets) or
   procedure/command which takes parameters without brackets. It can be
   both (like in VisualBasic) or property (class data member).

   1 - This is a function                 print("string")
   2 - this is a procedure                print "string"
   3 - This can be function or procedure  print("string") or print "string"
   4 - This is a property (data member)   m_hWnd

   ClassName
   ---------

   Class name (empty for functions).

   ReturnType
   ----------

   Function return type (may be empty string for procedures in some languages and
   for class properties

   PrototypeString
   ---------------

   Function prototype string for tool-tip (for languages other than C/C++ like).
   In most cases this will be a empty string.

   ParameterList (empty for properties)
   ------------------------------------

   Function parameter list specifies parameters and possible values for function
   and procedure parameters. Format of this field are:

   FieldType \02 ParamType \02 ParamName \02 ParamValues \02 ParamString \02 Comment

       FieldType
       ---------

       Specifies field type in the dialog box for filling function parameters.
       This parameter can be:

       t - text box
       c - combo box
       l - drop down list box
       r - radio buttons
       x - check boxes      (for constant flags)

       ParamType (empty string for languages which does not support parameters)
       ------------------------------------------------------------------------

       This field specifies parameter type (e.g. int, long HWND, LONG,....)

       ParamName
       ---------

       Parameter name (e.g. pszString, nTime, ...)

       This field should always be defined expect if we define ParamString.
       This field will be default value for edit boxes, list boxes and combos.

       ParamValues (this can be empty expect for check boxes and radio buttons)
       ------------------------------------------------------------------------

       Specifies one or more possible parameter values:

       ParamVal1 \03 ParamVal2 \03 ParamVal3

       For example: GENERIC_READ \03 GENERIC_WRITE

       ParamString (empty in most cases)
       ---------------------------------

       In some cases GWD Text Editor may not define parameter string
       (LPCSTR lpszString) correctly from ParamType and ParamName fields.
       In this cases we will type this string (e.g. LPCSTR lpszName).

       Comment (can be empty)
       ----------------------

       Short description of this parameter (e.g. // handle of the registering window)


   Function description samples:

;Text boxes
+FuncName11RetTypetParamType1ParamName1//ParamComment1
+FuncName21RetTypetParamType1ParamName1//ParamComment1tParamType2ParamName2//ParamComment2
+FuncName31RetTypetParamType1ParamName1//ParamComment1tParamType2ParamName2//ParamComment2tParamType3ParamName3//ParamComment3
+FuncName41RetTypetParamType1ParamName1//ParamComment1tParamType2ParamName2//ParamComment2tParamType3ParamName3//ParamComment3tParamType4ParamName4//ParamComment4

;Check box
+FuncName11RetTypexParamType1ParamName1ParamVal1ParamVal2ParamVal3//ParamComment1

;List box
+FuncName11RetTypelParamType1ParamName1ParamVal1ParamVal2ParamVal3//ParamComment1

;Combo box
+FuncName11RetTypecParamType1ParamName1ParamVal1ParamVal2ParamVal3//ParamComment1


2.1.3 FORMAT OF LANGUAGE TOKEN LINE
-----------------------------------

!token

For example
!FILENAME_MAX


2.2 LBI FILE FORMAT
-------------------

LBI file is binary file created from LBI file for faster loading from disk.
When GWD Text Editor loads library file into memory it actually reads LBI
file. LBI file is similiar to LB file except it does not contain all
informations for function/property definitions (lines that begins with !).
Instead of loading all parameters for function, we will load only function
name and offset of this line in the LB file.

This file is byte-order depedent but in most cases if byte-order does not
match, file will be regenerated because file-time will also not match.

0x0000  DWORD dwLBTime          Modified date of the LB file (in C/C++ time format).
                                (Used also for byte order checking) if file time
                                does not match LB file time, LBI file will be
                                regenerated.

For each line:

DWORD dwLineOffset              Offset of this line in the LBI file.
DWORD dwLen                     Lenght in bytes of this line in the LBI file
BYTE  LineKeyword[dwLen]        Part of the line in the LB file.


Add a Message


This is a public posting area. If you do not have an account, enter your full name into the "Username" box and leave the "Password" box empty. Your e-mail address is optional.
Username:  
Password:
E-mail:


- about - downloads - registration - forum - misc - home - © 1996-99 GWD Text Editor