lisa MANUAL


Copyright © 2002, Gabriele Budelacci <g.bude@eudoramail.com>

Language version 0.1.0
Manual version 0.0.2


NOTE:
This first version of manual is still incomplete and only in HTML format. It may be rewritten using XML DTD language, like PHP manual structure.

I'm searching translators for documentation, because I'm Italian and my english is very poor.


INDEX

Preface
  1. Introduction
  2. Language syntax
    1. Types
    2. Variables
    3. Functions
    4. Expressions
    5. Control Statements
    6. Comments
    7. Directives
  3. Modules
    1. The standard module std
      1. Language support functions
      2. Document functions
  4. Example

PREFACE

Copyright © 2002 Gabriele Budelacci <
g.bude@eudoramail.com>

This manual is free documentation; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free software Foundation; either version 2 of the license, or (at your option) any later version.

This software is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See the GNU General Public License for more details. You can obtain a copy of the GNU General Public License by writing to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

If you use this software in a commercial distribution, it would be nice to send the authors a complimentary copy of your product.


INTRODUCTION

lisa (LIght Scripts Assistant) is an easy web language with C-like syntax, used for simplified scripts generation.
lisa provide several abstraction layers:

Why lisa?

It's there enough space for a new web language? I think yes!
lisa doesn't support any data structure, class or object. It's a SIMPLIFIED web language for all the small things of everyday.
lisa can be compiled to asp™, jsp™ and php™ sources (by now, only php generation is active). So, you may develop your application and test it with your preferred language and, when completed, convert it in the language supported by your internet provider.
Probably, if you are an advanced web programmer, lisa may be too limited for you. It's a basic language for beginners.


LANGUAGE SYNTAX

lisa is a C-like syntax variable, with few changes to optimize code development.
It's a CASE INSENSITIVE language, so elements called 'ABC' or 'abc' (or 'aBc', etc) are effectivelly the same element.
Guidelines for standard scripts are:

Types


lisa support three standard types:

Variables


Variable names that ends with '_' are RESERVED for language optimizations.

All variables have a scope. A variable is valid in the block whithin is declared:
Example:
	// this variable is visible globally in the page:
	var a;
	
	if ( ... )
	{
		// this variable is visible only in this block:
		var b;
		// 'a' variable is more visible...
	}

	// 'b' variable is no more visible...
	
Any variable is destroyed at the end of the page.
If you want preserve a variable in all your web application, then you can declare it global:
Example:
	// this variable is valid globally in all the pages of your project:
	global var a;
	
Only variant variables can be declared globals.
Global variables, when declared, can't be redeclared.

Special variables are parameters:
Example:
	// this is a parameter:
	parameter var x;
	
Parameters are defined in anoter page and passed to your page via a POST or GET FORM.
Only variant variables can be declared as parameters.
It is guarantee that if a parameter is not defined, then his value is set to empty value.


Functions


Funtions are declared with the function keyword:
function funcName( arg1, arg2, ... )
{
function code
return value;
}
You can't declare a function inner another.

A function can return a value, via the return keyword.
By default, and if no return value is specified, a function will return an EMPTY value.

Alternative syntax for arithmetic function declaration is:
function funcName( arg1, arg2, ... ) is expression;


Expressions


Expressions may use the following operators:


Control Statements




Comments


Comments presents Java-like syntax:
Example:
	// this is a single line comment

	/*
		this is a multi line comment...
		...............................
	*/
	
Comments aren't passed to the compiled file.


Directives


There are two types of directives:

The first type of directives are evaluated at compile time.
This is the standard of a directive in all the other languages.

The directives are:
#self
Represent the complete name of the page (with extension) is compiling.


#asp
...asp code...
#/asp
To include ASP source code directly in your pages.
The block of code is compiled only if you are in ASP compile mode.
NOT SUPPORTED YET!

#jsp
...jsp code...
#/jsp
To include JSP source code directly in your pages.
The block of code is compiled only if you are in JSP compile mode.
NOT SUPPORTED YET!

#php
...php code...
#/php
To include PHP source code directly in your pages.
The block of code is compiled only if you are in PHP compile mode.



The special directives are:
#include "filename"
This a Server Side Include directive.
The filename MUST be a string value (can't be a variable).
Note that the other file isn't compiled while including, but must be compiled separately.

A special syntax for module inclusion is:
#include <modulename>
The modulename MUST be a fixed value (can't be a variable) WITHOUT any extension. The extension will be added later by the lisa compiler.
Note that the other file isn't compiled while including, but must be compiled separately.




MODULES

You can create a function library for simplify the managing of your applications. This library is called module. Creating modules is very simple, just call the lisa compiler like the following example:
lisa --module --php < modulename.lisa > modulename.php
As you can see, the --module option (or -m in short form) is the way to inform the compiler that you want generate a module, nor the file generated is standard.
The module generated can be used in your applications by the #include directive:
#include <modulename>
Note that the modulename is specified WITHOUT any extension.

IMPORTANT

You're be warned to prevent recursive module inclusions: the Web Server may generate some errors.


The standard module std


The std module is automatically included in every standard page you create.
You must compile the std.lisa file as a module and place the result in the same directory of your deployed application.

There are some useful functions for your applications:


Language support functions


arrSize( array )
This function return the number of items contained in an array.


Document functions


echo( message )
This function will write the message to the generated HTML document.


EXAMPLE

THIS SECTION WILL BE ADDED LATER