Home Page   We Generate Your Software.
Products Services Company Technology Demo Contact Site Map Search
Please note: this document is currently under revision.
The information herein contained, while still valid, does not reflect the latest state of the described technology.
The Somusar/SoProTech[tm] Booklet Series
Volume IV

"somusar/Tefigel: A Tutorial Introduction"

Printer friendly


Contents
1. Introduction
2. Language Summary
3. Text File Components
4. Text File Processing
5. Modularity
6. Multilanguage Applicability
7. Generating Object-oriented Languages
8. Generating Internet-oriented Languages and Protocols
9. Generating Procedural Languages
10. Generating Scripting or Special-purpose Languages
10.1 SQL
10.2 Perl
10.3 Python
10.4 REXX
10.5 LaTeX
11. Advanced Features and Topics
12. A More Extensive Example
13. Further Reading

Chapter 10 - Generating Scripting or Special-purpose Languages

10.1 - SQL        top

Code Example 32 - Generating SQL
SQL fragment containing a comment and a simple SELECT.
Source code - File "language/SQL"
    1      @ set sqltable=EMPLOYEE
    2      @ set search_key=POSITION
    3      @ set search_val=Manager
    4      @ dash $
    5      --
    6      -- By convention, each table contains a column with suffix ID.
    7      --
    8      SELECT sqltable$ID FROM sqltable
    9        WHERE search_key = 'search_val';
	       
Output of "/opt/somusar/bin/tefigel language/SQL"
    1      --
    2      -- By convention, each table contains a column with suffix ID.
    3      --
    4      SELECT EMPLOYEEID FROM EMPLOYEE
    5        WHERE POSITION = 'Manager';
	       

10.2 - Perl        top

Code Example 33 - Generating Perl
Generate a very simple "Hello, World!" Perl script.
Source code - File "language/perl"
    1      @ mark rem |
    2      @ set MESSAGE=Hello, world!
    3      @ set VAR=$msg
    4      # Simple Perl Script
    5      VAR = "MESSAGE\n";
    6      
    7      print VAR;
	       
Output of "/opt/somusar/bin/tefigel language/perl"
    1      # Simple Perl Script
    2      $msg = "Hello, world!\n";
    3      
    4      print $msg;
	       

10.3 - Python        top

Code Example 34 - Generating Python
Generate a Python fragment, containing a "usage" subroutine.
Source code - File "language/python"
    1      @ mark rem |
    2      @ set PROGRAM=some_tool
    3      @ set PARAMETERS=[-o output] [input]
    4      # Usage routine for script PROGRAM
    5      def usage():
    6              print "Usage: PROGRAM PARAMETERS"
    7              exit(1)
	       
Output of "/opt/somusar/bin/tefigel language/python"
    1      # Usage routine for script some_tool
    2      def usage():
    3              print "Usage: some_tool [-o output] [input]"
    4              exit(1)
	       

10.4 - REXX        top

Code Example 35 - Generating REXX
Generate a simple "Hello" script in REXX.
Source code - File "language/rexx"
    1      @ set msg=Hello!
    2      /* Simple REXX script */
    3      say "msg"
    4      exit
	       
Output of "/opt/somusar/bin/tefigel language/rexx"
    1      /* Simple REXX script */
    2      say "Hello!"
    3      exit
	       

10.5 - LaTeX        top

Code Example 36 - Generating LaTeX
Generate a simple LaTeX example.
Source code - File "language/latex"
    1      @ set LANG=LaTeX
    2      This is a simple    LANG  example, % --- LANG comment here
    3         with several whitespaces    and % --- one more comment
    4      comments.
	       
Output of "/opt/somusar/bin/tefigel language/latex"
    1      This is a simple    LaTeX  example, % --- LaTeX comment here
    2         with several whitespaces    and % --- one more comment
    3      comments.
	       

[Previous chapter]    [Next chapter]    [Back to top]

http:// www.somusar.com  / doc  / booklets  / tefigel_tut  - Powered by SoProMach
Copyright © 2003-2012 Somusar - Trademarks - Legal - Privacy - Webmaster