FAQ - Frequently Asked Questions
(Cogencee - compiler generator for Delphi. Cocolsoft Computer Solutions http://www.cocolsoft.com.au)
What differences are there between the 16 bit and 32 bit environments?
The Delphi 1 environment is for Windows 3.1 and 16 bit. The only significant difference to you is that the 32 bit (Delphi 4 and higher) environment handles long file names. In the example grammars the Cocol code is the same for each environment. However, because of changes made to the Delphi compiler some minor changes to embedded Delphi code has been necessary in some cases.
Does Cogencee support other Delphi versions?
The code generated by Cogencee is the same for Delphi 1 and Delphi 4 and higher. Output of the version of Cogencee for 32 bit has been successfully compiled using Delphi 2 and Delphi 3.
Will Cogencee run under Windows 98 and NT and Windows XP?
It is not expected that there would be any problem in running under these environments although Cogencee has only been tested under Windows 3.1 and Windows 95 and Windows XP.
What sort of code is generated by Cogencee?
Cogencee generates code based on the technique of frames. The frame (consisting of Delphi code) is added to at certain places (slots) to create the output Delphi unit. The Delphi unit is human readable commented code. The Delphi units are then called by your program as required. In the example (downloadable from this site) the amount of resulting Delphi code is 17 times as long as the input grammar file!
How maintainable are grammars built with Cogencee?
One of the great strengths of Cogencee is that it is very easy to maintain your grammars. Need to add another method of handling comments? Just add a line of Cocol code and regenerate! Need to add another script item to your scripting language? Just add some keywords and a grammar rule and regenerate! Cogencee will save you a lot of time and money in maintaining and improving grammars you have written.
Tell me more about the language Cocol.
Cocol or Compiler Compiler Language describes the lexical structure, the syntax and the semantics of the language you want to specify. The rules paragraph is the heart of the Cocol language. It holds the syntax of the grammar you are defining. The syntax is written in EBNF (Extended Backus-Naur Form). EBNF is commonly taught in Computer Science classes and expanded upon in many textbooks.
Is the product only for console applications?
No! The downloadable example CHD3 has been created that way to achieve a small file size. There is another downloadable CHD3GUI which is a visual simple calculator.
Can I create a component from the code Cogencee generates?
Yes. See the Downloads page for background to the simple calculator example. There is a list of the events, methods and properties for a component based on that example. Cocolsoft have produced TColDelphi, a component for the 'Cocolsoft Delphi Grammar'. This component is bundled with Cogencee. It is also available seperately. Cogencee version 2.0 supports the construction of Delphi components.
My input is keyed by a user - is Cogencee for me?
Traditional compilers read their input from a file on disk. Cogencee handles this traditional situation. Cogencee also can read input from a field keyed by a user to the screen. The downloadable example CHD3GUI demonstrates this. Input can also be read from a field in a database or column from a table.
Can I change the error handling?
Error handling by Cogencee is one of its strong points. Your compiler doesn't have to stop at the first error. (In fact, the so called simple calulator example, 'Calc.zip', exhibits better error handling than Delphi 1.) With the Professional version you get the source code to the base units (including the error handler) so they can be altered.
What about error handling?
The strong point of the current form of Cogencee is the excellent error handling. It is far superior to recursive descent parsers.
Can I upgrade from Cogencee Standard to Cogencee Professional?
Yes. Price on application.
Is there a recursive descent parser available?
Cogencee can be made available in a recursive descent version. Development of this version will be made available on a time and materials basis.
Is Cogencee thread safe?
Threads provide a means of running code routines simultaneously. Local variables are separately maintained in threads so those are not a problem. Any global variables are a problem. Cogencee generates global variables so this means that Cogencee is not thread safe.
Can the output of Cogencee be used in a DLL?
The purpose of using DLLs is to share code etc between a number of Windows applications. For example, a Delphi DLL can be read be a Visual Basic program.You will have to ensure that error handling in the DLL is handled in the DLL. Under 32bit Windows there is no sharing of global data and each application (calling the DLL) gets its own copy of the data. Cocolsoft have produced TColDelphi, a component for the 'Cocolsoft Delphi Grammar' which works in, for example, a single application with more than one instance of the component in it, then the same methodology use to centralise error handling etc should be able to be used in creating a DLL. Cocolsoft have not created a DLL using output from Cogencee so can make no claims as to its suitability or practicality.
I want to include an expression calculator (or other grammar based functionality) in my application. Can I sell this to my users?
Provided that you sell a compiled executable then there shouldn't be any problems. But my users expect me to sell them the source to my application? Provided you only ship them our Redistributables and your generated units there shouldn't be any problems. (Contact Cocolsoft for a copy of the Licence Agreement.)
I want to sell a Delphi component which is an expression calculator (or other grammar based functionality). Can I sell this to my users?
Provided that you sell a compiled executable (component) then there shouldn't be any problems. But my users expect me to sell them the source to the component? Provided you only ship them our Redistributables and your generated units there shouldn't be any problems. (Contact Cocolsoft for a copy of the Licence Agreement.)
I am doing consulting work and my employer wants to keep the source to the grammar. How can I satisfy their demands?
This is a common situation where you have been hired to create a scripting language (for example) and your employer wants the grammar as well as the source to the completed application. Your employer also insists on being able to modify your work at some future date. They will need to purchase a copy of Cogencee to do modifications.
I'm considering selling the DCU units incorporating a grammar I am developing. How do I protect my intellectual property?
The Professional version has an Obfuscator which runs against your Cocol code. The output of this is then regenerated. Enough said.
Are royalties paid for programs created by Cogencee?
I teach a course on compiler design. How can I use Cogencee?
You will need at least one copy of the Professional version. You will need multiple copies of the Standard version for your students. These can be offered at a discount. As EBNF is used by the language Cocol then existing grammars can be readily modified.
What's the purpose of the Redistributables?
We acknowledge that many users of a computer product such as a "third party tool" want to have the source code. Why? So that they are protected against compiler upgrades and if upgrades to the "third party tool" are no longer obtainable. Your users may insist you provide them with source code. Obviously some of the source code for the product you are developing came from Cocolsoft. Cocolsoft has made available certain Redistributables that can be shipped with your product to overcome this difficulty. (Contact Cocolsoft for a copy of the Licence Agreement.)
(Copyright (C) 1998-2003 Cocolsoft Computer Solutions. All Rights Reserved.)
(This page updated 28 Jan 2003)