 A D E P T   S O F T W A R E             PROGRAMMING LANGUAGE CREATOR
_____________________________________________________________________

For up to date information on our products, please visit our homepage
on the web at:  http://www.adeptsoftware.com
_____________________________________________________________________

INTRODUCTION

The Programming Language Creator (PLC) allows you to easily create
your own programming languages.  The FREEWARE version of PLC includes
a C language module, making it a C interpreter!  PLC parses and
executes source files in any language created - and creating a
language definition only requires programming about 200 lines of C!
You can create custom keywords, operators, and commands just by
filling in a data structure.  Almost any language in existence can be
approximated in a few hours.  With the C language module, most
keywords such as FOR & SWITCH, and all operators work just like
compiled C!  Built-in enhancements allow you to do things like
concatenate strings easily (String1+="p.m.").  Variable types are
detected automatically, so declaration is not necessary.  PLC can
correctly execute any statements in a language module, from this:

10 PRINT "Hello World" 20 GOTO 10

to this:

do{
   Test+=(((++Count)/27)%3)+((Blah("test.exe",READONLY,4)>6)? 1 : 3);
}while(Test<500);

PLC includes the Adept C Library (also available separately), with
simple interfaces to advanced functions like file compression, DMA
programming, keyboard handling, and timer interception.  For an
example of PLC's versatility, check out the script capabilities of
the AdeptRES Resource Manager (included with the Nautilus Engine.)

FREEWARE VERSION & SOURCE CODE AVAILABLE

A version of PLC is available to use completely FREE! Complete source
code to PLC is available for use confidentially.
Please visit the Adept Software web page for our current price list
and license documents.
_____________________________________________________________________

SPECIFICATIONS

PLC is divided into 2 parts, the compiler and the executor.  The
compiler parses text into tokens according to the rules setup up in
the language module.  Each separate routine has its own environment,
providing local variable scope.  The executor begins execution with
the routine specified, and stops when the routine returns control.
If any expressions exist outside of a routine, in the header of a
source file, they are always executed BEFORE any other execution.
This allows for initialization of global variables.

CREATING A LANGUAGE

To create a language you need to first set up data structures for
common strings, keywords, and operators (about 200 lines of code).
These are all used in the compilation process.  You also need a
routine to handle the behavior of keywords during execution, and a
routine to define the behavior of operators on different data types
during execution (about 300 lines of code).

PERMANENT RESTRICTIONS

These restrictions will not be changed, but may be changed manually
after obtaining the source code with the Pro License.

  Variables and routines may not be declared; a variable's type is
  determined automatically when an assignment first takes place
  There are no structures, arrays, or pointers
  The only data types available are in "PLC_DT.H".  Creating new data
  types is a relatively easy task with the Pro License.
  A source file may consist of only:  global declarations and
  routines

The Programming Language Creator was written entirely in Watcom C for
DOS Protected Mode.  It is 100% Windows 95 compatible.  It includes
the Adept C library, and comes with a module for the language C.

REQUIREMENTS

The Programming Language Creator requires a 386+ with 2+ MB RAM, a
C Compiler, and a moderate knowledge of C programming.
Creating a language requires an advanced knowledge of C programming.
_____________________________________________________________________

EXECUTING SOURCE CODE

To execute a source file, follow these steps:

  Call PLC_Startup()
  Call the Init() routine for the language module you will be using
  Use PLC_AddCommand() to add any external commands
  Load a source file, and make sure the last byte of the buffer is a
    zero
  Compile with PLC_CompileFile() or PLC_CompileStatements()
  Check for errors
  Call PLC_Execute() with the name of the routine to execute
  Check for errors
  Call PLC_Shutdown()

COMPILATION

To compile source code, use PLC_CompileFile() or
PLC_CompileStatements().

PLC_CompileFile() searches a file for the following:

  Routines enclosed in CompoundOpen & CompoundClose strings
  Global variable assignment expressions

PLC_CompileStatements() compiles only statements within a routine,
and may not include routine or global variable declarations.  If the
language you are using does not support separate routines, use only
this routine to compile.

COMMANDS

Use PLC_AddCommand() to add external commands, which may be called
just like routines.

PLC_GetParms() is for use within a command, to obtain an array of the
parameters passed to it.

PLC_Err() functions the same as ERR_Report(), and should be used to
report any errors within a command.

EXECUTION

Expressions in the header of a file but not within a routine (such as
global variable assignments) are always executed before anything
else.

PLC_Execute() is used to execute any routine that has been compiled.

PLC_Evaluate() evaluates a text expression (no keywords allowed).
The result is placed in PLC_Result.

CREATING A LANGUAGE

The easiest way to learn how to create a language is by example.
Examine the source code for the C language module "PLC_C.*".  The
operators work for most languages, so you may find it easiest to copy
this file and modify it to match the requirements of the language you
are creating.

DATA STRUCTURES

The first thing to do when creating a language is to set up data
structures for your common strings, keywords, and operators.  These
are all used in the compilation process.

Common Strings

Common strings include comment strings, whitespace, compound
statement enclosures, and other strings that are used in most
languages.

Keywords

A keyword definition includes the keword name string, and a list of
the objects the parser should look for after the keyword.

Operators

An operator definition includes the operator string, the precedence
group it belongs to, the direction to evaluate, and which of the
surrounding expressions are affected by the operator.

ROUTINES

Your language must have 3 routines:  Init(), ExecKeyword(), and
ApplyOperator().  Init() sets up some variables in PLC for use with
your language.  ExecKeyword() handles the behavior of keywords during
execution.  This routines is called whenever a keyword token is
encountered.  ApplyOperator() defines the behavior of operators on
different data types during execution.  The datatypes available are
in "PLC_DT.H", and may not be modified unless you have the Pro
Version of PLC.  COMPILING If your language doesn't contain multiple
routines within each source file, and has no routine headers, use
PLC_CompileRoutine(), not PLC_CompileFile().

_____________________________________________________________________

COPYRIGHT NOTICE

This product is protected by United States copyright laws and
international treaty provisions.  All rights are reserved.  Copying
any part of this product including the "look and feel", or creating
derivative development tools using any part of this product is
strictly forbidden.

DISCLAIMER

This product is provided "as-is".  Your sole remedy from any problems
relating to this product shall be a full refund of the purchase price
submitted to Adept Software.  You are responsible for any creations
made with this product.  Adept Software shall not be liable for any
damages whatsoever caused by your creations.  ADEPT SOFTWARE DOES NOT
WARRANT THAT THE OPERATION OF THE SOFTWARE WILL BE UNINTERRUPTED,
ERROR FREE OR MEET YOUR SPECIFIC REQUIREMENTS.  THE WARRANTY SET
FORTH ABOVE IS IN LIEU OF ALL OTHER EXPRESS WARRANTIES WHETHER ORAL
OR WRITTEN.  THE AGENTS, EMPLOYEES, DISTRIBUTORS, AND DEALERS OF
LICENSOR ARE NOT AUTHORIZED TO MAKE MODIFICATIONS TO THIS WARRANTY,
OR ADDITIONAL WARRANTIES ON BEHALF OF ADEPT SOFTWARE.  ADDITIONAL
STATEMENTS SUCH AS DEALER ADVERTISING OR PRESENTATIONS, WHETHER ORAL
OR WRITTEN, DO NOT CONSTITUTE WARRANTIES AND SHOULD NOT BE RELIED
UPON.  FURTHER WARRANTIES MAY BE GRANTED IN WRITTEN FORM AT ADEPT
SOFTWARE'S DISCRETION.  IN NO EVENT WILL ADEPT SOFTWARE BE LIABLE FOR
ANY DAMAGES, INCLUDING LOSS OF DATA, LOSS OF PROFITS, LOST SAVINGS,
SPECIAL, INCIDENTAL, CONSEQUENTIAL, INDIRECT OR OTHER SIMILAR DAMAGES
ARISING FROM BREACH OF WARRANTY, BREACH OF CONTRACT, NEGLIGENCE, OR
OTHER LEGAL THEORY EVEN IF LICENSOR OR ITS AGENT HAS BEEN ADVISED OF
THE POSSIBILITY OF SUCH DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY.
ADEPT SOFTWARE DISCLAIMS ALL OTHER WARRANTIES, BOTH EXPRESS IMPLIED,
INCLUDING BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY
OR FITNESS FOR A PARTICULAR PURPOSE WITH RESPECT TO THE SOFTWARE AND
THE ACCOMPANYING WRITTEN MATERIALS.  THIS LIMITED WARRANTY GIVES YOU
SPECIFIC LEGAL RIGHTS.  YOU MAY HAVE OTHER RIGHTS WHICH VARY FROM
JURISDICTION TO JURISDICTION.  Some jurisdictions do not allow the
exclusion or limitation of incidental or consequential damages, so
the above limitation or exclusion may not apply to you.
_____________________________________________________________________
