⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 manual.html

📁 Coware的LISA指令集描述语言开发包
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> lisa MANUAL </TITLE>
<META NAME="Generator" CONTENT="myself">
<META NAME="Author" CONTENT="Gabriele Budelacci">
</HEAD>

<BODY STYLE="font-family:sans-serif;">

<H1><B><I>lisa</I></B> MANUAL</H1>
<BR>
Copyright &copy; 2002, Gabriele Budelacci
&lt;<A HREF="mailto:g.bude@eudoramail.com">g.bude@eudoramail.com</A>&gt;
<BR>
<BR>
<small>Language version 0.2.2</small>
<BR>
<small>Manual version 0.0.4</small>
<BR>
<HR>
<BR>

<I>
NOTE:
<blockquote>
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.
<BR>
<BR>
I'm searching translators for documentation, because I'm Italian
and my english is very poor.
</blockquote>
</I>

<HR>
<BR>

<H3>INDEX</H3>

<A HREF="#preface">Preface</A>
<OL TYPE="I">
	<LI>
		<A HREF="#introduction">Introduction</A>
	</LI>
	<LI>
	<A HREF="#syntax">Language syntax</A>
		<OL TYPE="1">
			<LI>
				<A HREF="#types">Types</A>
			</LI>
			<LI>
				<A HREF="#variables">Variables</A>
			</LI>
			<LI>
				<A HREF="#functions">Functions</A>
			</LI>
			<LI>
				<A HREF="#expressions">Expressions</A>
			</LI>
			<LI>
				<A HREF="#statements">Control Statements</A>
			</LI>
			<LI>
				<A HREF="#comments">Comments</A>
			</LI>
			<LI>
				<A HREF="#directives">Directives</A>
			</LI>
		</OL>
	</LI>
	<LI>
		<A HREF="#config">XML configuration</A>
		<OL TYPE="1">
			<LI>
				<A HREF="#xmldatabase">Database setup</A>
			</LI>
		</OL>
	</LI>
	<LI>
		<A HREF="#modules">Modules</A>
		<OL TYPE="1">
			<LI>
				<A HREF="#std">The standard module <B>std</B></A>
				<OL TYPE="i">
					<LI>
						<A HREF="#supportf">Language support functions</A>
					</LI>
					<LI>
						<A HREF="#datef">Date and Time functions</A>
					</LI>
					<LI>
						<A HREF="#documentf">Document functions</A>
					</LI>
					<LI>
						<A HREF="#mathf">Math functions</A>
					</LI>
					<LI>
						<A HREF="#stringf">String functions</A>
					</LI>
				</OL>
			</LI>
			<LI>
				<A HREF="#dbsupport">The database module <B>dbsupport</B></A>
			</LI>
		</OL>
	</LI>
	<LI>
		<A HREF="#examples">Examples / Tutorials</A>
	</LI>
</OL>

<HR>
<A NAME="#preface">
<H2>PREFACE</H2>

Copyright &copy; 2002 Gabriele Budelacci &lt;<A HREF="mailto:g.bude@eudoramail.com">g.bude@eudoramail.com</A>&gt;<BR>
<BR>
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.<BR>
<BR>
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.<BR>
<BR>
If you use this software in a commercial distribution, it would be nice to send the authors a complimentary copy of your product.<BR>
<BR>

<HR>
<A NAME="#introduction">
<H2>INTRODUCTION</H2>

<B><I>lisa</I></B> (LIght Scripts Assistant) is an easy web language with C-like syntax, used for
simplified scripts generation.<BR>
<B><I>lisa</I></B> provide several abstraction layers:
<UL>
	<LI>
		<B>GET/POST parameters layer</B>
		<BR>
		Every parameter passed to a page via GET or POST method can be referenced like
		a standard (parameter) variable.
	</LI>
	<LI>
		<B>session layer</B>
		<BR>
		A session value is referenced with a global variable.
	</LI>
	<LI>
		<B>database layer</B>
		<BR>
		Database access and transactions are provided by simplest language constructs.
	</LI>
</UL>

<H3>Why <B><I>lisa</I></B>?</H3>
It's there enough space for a new web language? I think yes!<BR>
<B><I>lisa</I></B> doesn't support any data structure, class or object. It's a SIMPLIFIED
web language for all the small things of everyday.<BR>
<B><I>lisa</I></B> can be compiled to asp&trade;, jsp&trade; and php&trade; 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.<BR>
Probably, if you are an advanced web programmer, <B><I>lisa</I></B> may be too limited for you. It's a
basic language for beginners.<BR>
<BR>

<HR>
<A NAME="#syntax">
<H2>LANGUAGE SYNTAX</H2>

<B><I>lisa</I></B> is a C-like syntax variable, with few changes to optimize code development.<BR>
It's a <I>CASE INSENSITIVE</I> language, so elements called 'ABC' or 'abc' (or 'aBc', etc) are effectivelly
the same element.<BR>
Guidelines for standard scripts are:
<UL>
	<LI>
		variable names are written all lowercase, and may contains the underscore ('_') char, ie:<BR>
		<blockquote>
			<B>abc</B>, <B>abc_a</B>, <B>_abc</B> are valid names for variables;<BR>
		</blockquote>
		<blockquote>
			<B>Abc</B>, <B>aBc_a</B>, <B>abc_</B> are allowed, but DEPRECATED, names for variables;<BR>
		</blockquote>
		Variable names that ends with '_' are RESERVED for language optimizations.<BR>
		<BR>
	</LI>
	<LI>
		function names starts with lowercase chars, and are in capitalized form for the rest, ie:<BR>
		<blockquote>
			<B>func()</B>, <B>funcOpt()</B> are valid names for functions;<BR>
		</blockquote>
		<blockquote>
			<B>Func()</B>, <B>FuncOpt()</B> are allowed, but DEPRECATED, names for functions;<BR>
		</blockquote>
		Function names that starts with '_' are RESERVED for language optimizations.<BR>
		Function names that contains '_' char are allowed, expecially for a personal module identification, ie:<BR>
		<blockquote>
			<B>pers_func()</B>, <B>pers_funcOpt()</B> are functions of the <B>pers</B> module;<BR>
		</blockquote>
		<BR>
	</LI>
	<LI>
		language statements are written in lowercase form, ie:<BR>
		<blockquote>
			<B>if</B>, <B>next</B>, <B>var</B>, <B>while</B> etc...<BR>
		</blockquote>
		<BR>
	</LI>
	<LI>
		language directives are written in lowercase form, ie:<BR>
		<blockquote>
			<B>#include</B>, <B>#php</B>, <B>#/php</B> etc...<BR>
		</blockquote>
		<BR>
	</LI>
</UL>
<BR>

<HR>
<A NAME="#types"><H3>Types</H3>
<BR>

<B><I>lisa</I></B> support three standard types:
<UL>
	<LI>
		<B>variants</B><BR>
		This is the basic type of a variable. A variant variable may be a <I>string</I>, a <I>number</I> or a <I>boolean</I>.<BR>
		The effective type of a variant is runtime determined, while processing an expression.<BR>
		A tipical variant declaration is:<BR>
		<blockquote style="background-color:#CDCDCD;">
			<B>var</B> varname;<BR>
		</blockquote>
		<BR>
	</LI>
	<LI>
		<B>arrays</B><BR>
		This is the compound type. An array is a collection of variants. Each variant can be referenced by an index.<BR>
		The index may be a number or a string, so it's effectively a key for the associative array.<BR>
		The array is not statically limited in size.<BR>
		A tipical array declaration is:<BR>
		<blockquote style="background-color:#CDCDCD;">
			<B>array</B> arrname;<BR>
		</blockquote>
		<BR>
	</LI>
	<LI>
		<B>sets</B><BR>
		This is the special compound type for database access. A set represent the SQL cursor after a query.<BR>
		A tipical set declaration is:<BR>
		<blockquote style="background-color:#CDCDCD;">
			<B>set</B> varname;<BR>
		</blockquote>
		<BR>
	</LI>
</UL>
<BR>

<HR>
<A NAME="#variables"><H3>Variables</H3>
<BR>

Variable names that ends with '_' are RESERVED for language optimizations.<BR>
<BR>
All variables have a <I>scope</I>. A variable is valid in the block whithin is declared:<BR>
<blockquote style="background-color:#CDCDCD;">
	<B>Example:</B><BR>
	<pre>
	// 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...
	</pre>
</blockquote>
Any variable is destroyed at the end of the page.<BR>
If you want preserve a variable in all your web application, then you can declare it <I>global</I>:<BR>
<blockquote style="background-color:#CDCDCD;">
	<B>Example:</B><BR>
	<pre>
	// this variable is valid globally in all the pages of your project:
	<B>global</B> var a;
	</pre>
</blockquote>
Only variant variables can be declared globals.<BR>
Global variables, when declared, can't be redeclared.<BR>
<BR>
Special variables are <I>parameters</I>:<BR>
<blockquote style="background-color:#CDCDCD;">
	<B>Example:</B><BR>
	<pre>
	// this is a parameter:
	<B>parameter</B> var x;
	</pre>
</blockquote>
Parameters are defined in anoter page and passed to your page via a POST or GET FORM.<BR>
Only variant variables can be declared as parameters.<BR>
It is guarantee that if a parameter is not defined, then his value is set to empty value.<BR>
<BR>

<HR>
<A NAME="#functions"><H3>Functions</H3>
<BR>

Function names that starts with '_' are RESERVED for language optimizations.<BR>
<BR>
Funtions are declared with the <I>function</I> keyword:<BR>
<blockquote style="background-color:#CDCDCD;">
	<B>function</B> funcName( <I>arg1</I>, <I>arg2</I>, ... )<BR>
	{<BR>
	<blockquote>
		<I>function code</I><BR>
		<B>return</B> <I>value</I>;<BR>
	</blockquote>
	}<BR>
</blockquote>

You can't declare a function inner another.<BR>
<BR>
A function can return a value, via the <I>return</I> keyword.<BR>
By default, and if no return value is specified, a function will return an EMPTY value.<BR>

<BR>
Alternative syntax for arithmetic function declaration is:<BR>
<blockquote style="background-color:#CDCDCD;">
	<B>function</B> funcName( <I>arg1</I>, <I>arg2</I>, ... ) <B>is</B> <I>expression</I>;<BR>
</blockquote>


<BR>

<HR>
<A NAME="#expressions"><H3>Expressions</H3>
<BR>

Expressions may use the following operators:<BR>
<UL>
	<LI>
		<B style="background-color:#CDCDCD;">+</B><BR>
		Addiction<BR>
		<I>a + b</I><BR>
		<BR>
	</LI>
	<LI>
		<B style="background-color:#CDCDCD;">-</B><BR>
		Subtraction<BR>
		<I>a - b</I><BR>
		<BR>
	</LI>
	<LI>
		<B style="background-color:#CDCDCD;">*</B><BR>
		Multiplication<BR>
		<I>a * b</I><BR>
		<BR>
	</LI>
	<LI>
		<B style="background-color:#CDCDCD;">/</B><BR>
		Division<BR>
		<I>a / b</I><BR>
		<BR>
	</LI>
	<LI>
		<B style="background-color:#CDCDCD;">%</B><BR>
		Module (integer rest of division)<BR>
		<I>a % b</I><BR>
		<BR>
	</LI>
	<LI>
		<B style="background-color:#CDCDCD;">-</B><BR>
		Negation<BR>
		<I>-a</I><BR>
		<BR>
	</LI>
	<LI>
		<B style="background-color:#CDCDCD;">&lt;</B><BR>
		Less than (<I>boolean</I>)<BR>
		<I>a &lt; b</I><BR>
		<BR>
	</LI>
	<LI>
		<B style="background-color:#CDCDCD;">&lt;=</B><BR>
		Less or equal (<I>boolean</I>)<BR>
		<I>a &lt;= b</I><BR>
		<BR>
	</LI>
	<LI>
		<B style="background-color:#CDCDCD;">&gt;</B><BR>
		Great than (<I>boolean</I>)<BR>
		<I>a &gt; b</I><BR>
		<BR>
	</LI>
	<LI>
		<B style="background-color:#CDCDCD;">&gt;=</B><BR>
		Great or equal (<I>boolean</I>)<BR>
		<I>a &gt;= b</I><BR>
		<BR>
	</LI>
	<LI>
		<B style="background-color:#CDCDCD;">==</B><BR>
		Equal (<I>boolean</I>)<BR>
		<I>a == b</I><BR>
		<BR>
	</LI>
	<LI>
		<B style="background-color:#CDCDCD;">!=</B><BR>
		Not equal (<I>boolean</I>)<BR>
		<I>a != b</I><BR>
		<BR>
	</LI>
	<LI>
		<B style="background-color:#CDCDCD;">!</B><BR>
		Not (<I>boolean</I>)<BR>
		<I>!b</I><BR>
		<BR>
	</LI>
	<LI>
		<B style="background-color:#CDCDCD;">&&</B><BR>
		And (<I>boolean</I>)<BR>
		<I>a && b</I><BR>
		<BR>
	</LI>
	<LI>
		<B style="background-color:#CDCDCD;">||</B><BR>
		Or (<I>boolean</I>)<BR>
		<I>a || b</I><BR>
		<BR>
	</LI>
	<LI>
		<B style="background-color:#CDCDCD;">.</B><BR>
		String catenation<BR>
		<I>a . b</I><BR>
		<BR>
	</LI>
	<LI>
		<B style="background-color:#CDCDCD;">=</B><BR>
		Assignment<BR>
		<I>a = b</I><BR>
		<BR>
	</LI>
</UL>

<BR>

<HR>
<A NAME="#statements"><H3>Control Statements</H3>
<BR>

<UL>
<LI>
	<H4>Optional statement:</H4>
	<BR>
	<blockquote style="background-color:#CDCDCD;">
		<B>if</B> ( <I>condition</I> )<BR>
		{<BR>
			<blockquote>
			<I>...true statements...</I>
			</blockquote>
		}<BR>
		<B>else</B><BR>
		{<BR>
			<blockquote>
			<I>...conditional false statements...</I>
			</blockquote>
		}<BR>
	</blockquote>

	The condition is an expression returning a <I>boolean</I> value.<BR>
	So, a comparison operator (==, !=, &lt;, &gt;, &lt;=, &gt;=) may be used in the condition.<BR>

	<BR>
	There's an optional syntax in TAG format:<BR>
	<blockquote style="background-color:#CDCDCD;">
		&lt;% <B>if</B> ( <I>condition</I> )<B>:</B> %&gt;<BR>
			<blockquote>
			<I>...true statements...</I>
			</blockquote>
		&lt;% <B>else:</B> %&gt;<BR>
			<blockquote>
			<I>...conditional false statements...</I>
			</blockquote>
		&lt;% <B>endif</B>; %&gt;<BR>
	</blockquote>

	<BR>
</LI>
<LI>
	<H4>Multi options statement:</H4>
	<BR>
	<blockquote style="background-color:#CDCDCD;">
		<B>switch</B> ( <I>condition</I> )<BR>
		{<BR>
			<blockquote>
				<B>case</B> <I>fixed-value</I>:<BR>
				<blockquote>
					// this code is executed if condition equals fixed-value...
				</blockquote>
				<B>case</B>...:<BR>
				<blockquote>
					// another case code...
				</blockquote>
				<B>default</B>:<BR>
				<blockquote>
					
				</blockquote>
			</blockquote>
		}<BR>
	</blockquote>

	The condition is an expression returning a value.<BR>
	Each (optional) value of a <B>case</B> construct is compared with the result of the condition.
	So, the value of a case statement MUST be a <I>fixed</I> value (ie: a <I>number</I> or a <I>string</I>).<BR>
	The (optional) <B>default</B> statement will be verified if any case values match is verified.<BR>
	The default statement must be placed after all the others case statements.<BR>
	The first occurance of a case value that equals to the return value determine the which statements
	are being executed.<BR>
	If no <B>break</B> statement is specified, then the following case or default conditions are automatically verified.<BR>

	<BR>
	There's an optional syntax in TAG format:<BR>
	<blockquote style="background-color:#CDCDCD;">
		&lt;% <B>switch</B> ( <I>condition</I> ):<BR>
		<blockquote>
			<B>case</B> <I>fixed-value</I>: %&gt;<BR>
			<blockquote>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -