www.pudn.com > sswf-1.7.4-src.zip > valid.asc


/* valid.asc -- written by Alexis WILKE for Made to Order Software, Ltd. (c) 2005-2006 */

/*

Copyright (c) 2005-2006 Made to Order Software, Ltd.

Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and
associated documentation files (the "Software"), to
deal in the Software without restriction, including
without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom
the Software is furnished to do so, subject to the
following conditions:

The above copyright notice and this permission notice
shall be included in all copies or substantial
portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

*/


/*
 * The following is an action script used to check whether the parser
 * can read a perfectly valid script. Only the syntax is checked. Thus,
 * if the script seems meaningless and/or repeatitive and/or some variables
 * aren't defined, etc. this is because it doesn't matter in the outcome
 * of this script.
 */

// define a variable
const var attr := public true;

// different expressions
a = b + c + d;
a = b ? c : d;
a = d + b * c;

// empty statement
;

// set a variable
a = 5;

// call a function
test();

// pragmas
use octal;
use extended_operators;
use octal?;

// a much more complex function
a = b + c & long_variable_name ** ~ 33 | 2.3 ^ .33 ? and : 0.59,
	next_line / 0123 > _name_ < $name$ % ! name123
	* mul.more - hello - - more += + + + me;

// assignments
a &= b;
a |= b;
a ^= b;
a /= b;
a &&= b;
a ||= b;
a ^^= b;
a %= b;
a *= b;
a **= b;
a <<= b;
a >>= b;
a >>>= b;
a !<= b;
a !>= b;
a ?<= b;
a ?>= b;
a -= b;

;

a = idx--;
a = --idx;
a == b;
a >= b <= c;
a = idx++;
a = ++idx;

a = b && c || d ^^ e ~= f ?> g ?< h != i ** j ** k ** l;

a = (b in c .. d)::test instanceof boolean::system;

a = b !< c + d !> e::f;

a = b << c - d >> e === f >>> g ** 33.123 !== "String";

void a = (b is c && d as e || f instanceof g ^^ h in i) | j ~= k;

"undefined" === typeof my_var;

object = new Object("Test", .33e-3, ...)::scheme;

delete object.machin.truc.bidule;
delete object.my_func();

;

Call(Me(And(Me(Too(a, b, c)[3 , 4 , 5])[2])[1])[0])[-1];

object = { a: 35, b: "Hello", c: 3 + 1, d: test(more) };

function lone;
function set machin;
function get test(const in out named all : long = 123456789,
		const a, in b, out c, ... named rest)
{
	if(c < 0) {
		throw long(25);
	}
	if(a ~= b) {
		return my.first.block()++
	}
	else return;
}

switch(complex)
{
	case 1:
	case 2:
	case 3:
		print("Hello");
		break;
	default:
		printf("Default!");
		break;
}

try
{
	there:
	do {
		if(echo(1, 2, 3) === 0123) {
			continue;
			continue more;
		}
		else break here;
		if(!me) break;
	} while(true || false);
}
catch(a:long)
{
	var cnt = 4;
	const s = "long";
	const var e = "error";
	while(cnt > 0) {
		cnt--;
		for(i = 0; i < 10; ++i)
			print(s & " " & e);
		for(const var j = 33; j <= 3; j--)
		{
			yell("Ooops") }
		for(member in object)
			display("Member");
		goto beginning;
	}
}
finally
{
	printf("clean up");
}

object.SetColor = function (rgb: long = 0) { this = rgb; } + 5;

function tt(a)
{
	with(math) {
		super.tt(a);
		super(etendu, ...).tt(a);

		if(this.GetColor() == "RED") break everything;
	}
}

intrinsic interface salad
{
	abstract function perfect();
}


hidden interface weird extends salad, error
{
	abstract function mixup();
};


wonderful class sauce implements salad, weird
{
	function perfect() { return done; }
	function mixup() { throw cant_do_that; }
	private function super_hidden(a, b) { return a + b; }
	public function super_visible(a, b) { }
}

package system.math.trigonometry
{
	function sin(x: float) { return -cos(x); }
	function asin(x: float) { return -acos(x); }
}

intrinsic package system.exceptions
{
	namespace exceptional;
	class info_t
	{
		const var name: String;
	};
	intrinsic function last_throw_info(info: info_t);
};


import system.exceptions;
import "That Stuff";

use namespace (complex + expression + to + get + the + name + we + want);


enum;
enum test;
enum test {
	hmmm,
	tiens = 3,
	max,
	end = 64,
	STOP
}