ActionScript 3 import alias! Where is it?

How To Write An Admissions Essay For College Ok, no problem, in fact I remember I’ve read something in the as3 documentation about the import alias directive..
A quick google search and in fact I come to this page: http://livedocs.adobe.com/…?href=as3_specification106.html

http://lubeofsarasota.com/earth-day-essay/ Earth Day Essay Strange, it’s described in the documentation, but dont work!.. It’s also described in the es4 specs.
Fortunately Colin gives me an answer: “… single name aliases were indeed dropped for AS3. even if the plan is that they will go into the ES4 standard, and if that occurs, they will be added to ActionScript eventually.”
I hope it will happen soon!

Write Me A Perfect Essay

http://legaldebtsolutions.org/writer-for-dissertation/ Writer For Dissertation

ActionScript Parsing, the YACC revenge :)

So first I need to wrote from scratch the grammar/lexer files using only the ECMAScript 4 specifications and much patience (the elastic grammar file help me a lot too).

http://aaequipment.net/?college-papers-needed College Papers Needed The result was unbelievable: 0.02 seconds for that file!

Now, the next step is to finish and test the parser and finally create a python library using pyrex, then a benchmark test again.

An experience with antlr, java and python

http://www.surgeskateboard.com/college-admission-essay-online-requirements/ College Admission Essay Online Requirements I was trying first to create the parser using GNU Flex and Bison in C, probably the best way for a very performancing parser.
Yeah, that’s right.. but looking at the antlr syntax I realized that’s easier and easier.
Moreover I start using this very useful eclipse plugin for antlr debugging which made my life easier!

Paper On Immigration

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package org.sepy.core.parsers.as3;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import antlr.CommonAST;
import antlr.RecognitionException;
import antlr.TokenStreamException;
public class Application {
public static void main(String argv[])
{
if(argv.length > 0)
{
File file = new File(argv[0]);
if(file.exists())
{
FileInputStream is = null;
try {
is = new FileInputStream(file);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
AS3Lexer L = new AS3Lexer(is);
AS3Parser P = new AS3Parser(L);
try {
P.compilationUnit();
} catch (RecognitionException e) {
// TODO Auto-generated catch block
System.out.println(" line=" + e.line + ", column="+ e.column);
System.out.println(e.getMessage());
e.printStackTrace(System.err);
} catch (TokenStreamException e) {
// TODO Auto-generated catch block
System.out.println(" line=" + L.getLine() + ", column="+ L.getColumn());
System.out.println(L.getGuessInfo());
System.out.println(e.getMessage());
e.printStackTrace(System.err);
}
CommonAST.setVerboseStringConversion(false, P.getTokenNames());
CommonAST ast = (CommonAST) P.getAST();
System.out.println("Tree:");
System.out.println(ast.toStringTree());
}
}
}
}

http://www.dm.ufrpe.br/sites/dm.ufrpe.br/index.php?write-my-essays-online-please Write My Essays Online Please Everything works fine also for python, but I realized that the python script were so much slower than the java one!

1
2
3
4
5
6
7
8
9
10
11
12
import sys
import antlr
import AS3Parser
import AS3Lexer
L = AS3Lexer.Lexer(filename);
P = AS3Parser.Parser(L);
P.setFilename(filename)
try:
   P.compilationUnit();
   ast = P.getAST();
except:
   pass

Canadian Phd Thesis Database So I run the python hotshot profiler to see which could be the bottleneck in the python script and I found most of the problems were due to unuseless antlr (the python module) method’s calls.
After making corrections to the antlr.py file the same script took exactly half of the time. Now 3 seconds. Wow 🙂
But not fast enough.
So I enabled for the antlr python script psyco module and this time the same script took only 1.6 seconds.
Now the python script is fast enough, even if I’m sure I can make more optimizations in the antlr module…

E4X, ActionScript 3 new “sublanguage”

Finally ActionScript supports E4X and we can kick away the old XML object (always supported for backward compatibility)! we can stop using all the various xml2object classes created in these years, we finally have a validating parser, so we will see finally well formatted XML files from flash users 🙂
But finally we have a powerful “language” with a very strong syntax.

http://www.sephiroth.it/tutorials/flashPHP/E4X/index.php

P.s. I forgot to say that E4X is also available in the Geko1.8 browser (such as Firefox 1.5). For more info see this article: http://developer.mozilla.org/en/docs/E4X. Unfortunately E4X ins’t supported by python, neither there’s a module for it 🙁

ActionScript 3, … (rest) parameter, finally!

Yesterday I was reading the latest actionscript 3 documentation on adobe labs and I found that they finally introduced the … ( rest) function’s argument, as also described in the ECMA Script 4 specifications.
I say “finally” because it’s since I discovered python *args and **kwds function arguments that I pray for them also in actionscript.
In actionscript3 rest parameter is used for example:

1
2
3
4
5
6
7
8
9
public function log(message:String, ... rest):void
{
logging.text += message + "\n";
for(var i:uint = 0; i < rest.length; i++)
{
logging.text += rest[i] + "\n";
}
}
log("hello", "spammed", "world");

The reference says about the rest parameter: specifies that a function will accept any number of comma delimited arguments. The list of arguments becomes an array that is available throughout the function body.
Now I just will wait till they will intoduce also the **kwds python equivalent parameter and I will an happy man! 🙂
Read more here

Actionscript 3 ?

Recently Macromedia release some news about Flex 2…and what we can find in one page (you can see it here) ?
“With ActionScript 3.0, we have achieved more than simple compliance with the ECMAScript standard; Macromedia now chairs the ECMAScript committee and helps drive its evolution. ActionScript 3.0 features a compilation mode for stronger compile-time type checking that provides the benefits of languages such as Java or C#. It supports new features to streamline data manipulation, including the E4X (ECMAScript for XML) standard, which extends the language and adds XML as a native data type allowing developers to more naturally interact with and manipulate XML. It adds regular expressions support for better text parsing and processing. It sheds some of the ad hoc event handling schemes in the old virtual machine in favor of a unified model based on the W3C DOM Events standard. And it has significantly updated APIs aimed at the application developer audience.
For a complete overview of the new capabilities, stay tuned as we release an overview of ActionScript 3.0 and the Flash Player 8.5 alpha.”

It seems that on 17th October we’ll have a public preview of Flash Player 8.5…I’m curious a lot!
http://www.macromedia.com/devnet/…/flex2_intro.html

Will Flash 8 support E4X?

An unintentionally mail posted in the Flex mailing list talks about one of the new Flex 2.0 features, the support of E4X.
This means that probably the new flash player will support it also… This should be a great step over the old “DOM” flash support.. in this case XML entities will be threated as builtins objects Read more about ECMAScript for XML (E4X) Specification: http://www.ecma-international.org/publications/standards/Ecma-357.htm

see the original post