ChipCenter Questlink
SEARCH CHIPCENTER
Search Type:
Search for:




Knowledge Centers
Product Reviews
Data Sheets
Guides & Experts
News
International
Ask Us
Circuit Cellar Online
App Notes
NetSeminars
Careers
Resources
FAQ
EE Times Network
Electronics Group Sites

USING PERL IN EMBEDDED SOFTWARE DEVELOPMENT


Circuit Cellar Online
THE MAGAZINE FOR COMPUTER APPLICATIONS
Circuit Cellar Online offers articles illustrating creative solutions
and unique applications through complete projects, practical
tutorials, and useful design techniques.

USING PERL IN EMBEDDED SOFTWARE DEVELOPMENT

Lessons from the Trenches by Liu Kai

Start ý Sales Front-End Online ý Custom Software Service Online ý Software Engineering ý Documentation ý Utilities for Debugging and Production ý GUI and OLE ý The Benefits ý Sources and PDF

DOCUMENTATION

Documentation is another headache for engineers. In principle, documentation must accompany the code during generation, modification, and delivery. And, it should be written by sales in the definition phase, by the project manager in the task dispatch phase, and by engineers during implementation and modification. But, thatýs only in principle. In reality, most sales teams and managers hesitate writing the documentation, thinking the task is an "engineering issue." Meanwhile, engineers have to write the code and documentation by themselves. There are two problems that develop; it occupies the engineering forcesý time and necessary cross-checking is ignored.

Perl has its own documentation class called POD, which allows the programmer to write the code and documentation in a single file. Perl skips the documentation file during execution, and the code while compiling its own documentation. Because the POD module is open, you can set up your own POD subclass. However, the compiler is fixed, so all the documentation lines have to follow a comment mark like "//", "/* */", ";", and so on (see Listing 1).

void main(void)
{
// Head= This is only a sample of self documentation
printf ("samples\n");
}

Listing 1ýThis is a sample C routine for an embedded Perl style document. A dedicated script can capture the sentence after Head= and compose the document in HTML of another format.

 

Head= is a switch, which tells Perl to generate the documentation head in the following sentence. Self-documentation is good when programming, so the documentation and code are always synchronized. The project manager can set up a check script to see whether or not the programmer has followed the documentation rule.

Using a script with the customersý inputs and an existing documentation tree, Perl can help engineers generate documentation. The unnecessary modules will be excluded while the custom documentation is compiling. When the new features are added, a "NEW" is marked, which notifies the engineers. As soon as the blank is complete, this part of the documentation is added to the documentation database.

PREVIOUS NEXT


Circuit Cellar provides up-to-date information for engineers. Visit www.circuitcellar.com for more information and additional articles.
For subscription information, call (860) 875-2199, subscribe@circuitcellar.com or subscribe online. ýCircuit Cellar, the Magazine for Computer Applications. Posted with permission.
Click here to get your listing up.

Copyright © 2003 ChipCenter-QuestLink
About ChipCenter-Questlink  Contact Us  Privacy Statement   Advertising Information  FAQ