<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>compiler &#8211; Alessandro Crugnola &#8211; sephiroth.it</title>
	<atom:link href="https://blog.sephiroth.it/tag/compiler/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.sephiroth.it</link>
	<description>programmer by pure chance</description>
	<lastBuildDate>Wed, 28 Jul 2010 18:07:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://blog.sephiroth.it/wp-content/uploads/2019/03/cropped-sepy-big-32x32.png</url>
	<title>compiler &#8211; Alessandro Crugnola &#8211; sephiroth.it</title>
	<link>https://blog.sephiroth.it</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Flex sdk 3.5.0 problem with ternary operators</title>
		<link>https://blog.sephiroth.it/2010/03/25/flex-sdk-3-5-0-problem-with-ternary-operators/</link>
					<comments>https://blog.sephiroth.it/2010/03/25/flex-sdk-3-5-0-problem-with-ternary-operators/#comments</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Thu, 25 Mar 2010 23:42:26 +0000</pubDate>
				<category><![CDATA[flex]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[compiler]]></category>
		<category><![CDATA[font]]></category>
		<category><![CDATA[sdk]]></category>
		<category><![CDATA[ternary]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=294</guid>

					<description><![CDATA[I&#8217;ve got problems to isolate the problem into a very big project with many linked sources. After hours inspecting and commenting lines of code trying to figure out the reason why flex gave me an &#8220;internal error&#8221; I found the problem. This very simple script was crashing the flex compiler if using the 3.5.0 sdk &#8230; <a href="https://blog.sephiroth.it/2010/03/25/flex-sdk-3-5-0-problem-with-ternary-operators/" class="more-link">Continue reading <span class="screen-reader-text">Flex sdk 3.5.0 problem with ternary operators</span></a>]]></description>
										<content:encoded><![CDATA[<div>I&#8217;ve got problems to isolate the problem into a very big project with many linked sources. After hours inspecting and commenting lines of code trying to figure out the reason why flex gave me an &#8220;internal error&#8221; I found the problem.</div>
<div>This very simple script was crashing the flex <a class="zem_slink freebase/en/compiler rdfa" title="Compiler" rel="ctag:means wikipedia" href="http://en.wikipedia.org/wiki/Compiler">compiler</a> if using the <strong>3.5.0 sdk</strong> ( revision 3.5.0.12683 ).</div>
<div>Fortunately the 4.0.0 compiler works fine. At the end it seems to be the combination of &#8220;+&#8221; and &#8220;-&#8221; and the ternary operator.</div>
<pre>package
{
   import flash.display.Sprite;
   public class ternary_test extends Sprite
   {
      public function ternary_test()
      {
         var n: Number = 0;
         var d: int = 3;
         var k: int = 5;
         var j: int = 10;
         n = 1 + ( -( d == 0 ? k : j ) );
         trace( "n=" + n );
      }
   }
}</pre>
<p>will cause the compiler to crash with the following stack trace:</p>
<pre><span style="text-decoration: underline;">compile</span><span style="color: #85afff;">:</span>

    [<span style="text-decoration: underline;">mxmlc</span>] Loading configuration file /Applications/Adobe Flash Builder 4 Plug-in/sdks/3.5.0/frameworks/flex-config.xml

    [<span style="text-decoration: underline;">mxmlc</span>] Error: null

<span style="color: #fd7a00;">    [</span><span style="text-decoration: underline;">mxmlc</span><span style="color: #fd7a00;">] </span><span style="text-decoration: underline;">java.lang.NullPointerException</span>

    [<span style="text-decoration: underline;">mxmlc</span>] <span style="white-space: pre;">	</span>at macromedia.asc.semantics.ConstantEvaluator.evaluate(<span style="text-decoration: underline;">ConstantEvaluator.java:1290</span>)

    [<span style="text-decoration: underline;">mxmlc</span>] <span style="white-space: pre;">	</span>at macromedia.asc.parser.UnaryExpressionNode.evaluate(<span style="text-decoration: underline;">UnaryExpressionNode.java:51</span>)

    [<span style="text-decoration: underline;">mxmlc</span>] <span style="white-space: pre;">	</span>at macromedia.asc.semantics.ConstantEvaluator.evaluate(<span style="text-decoration: underline;">ConstantEvaluator.java:2153</span>)

    [<span style="text-decoration: underline;">mxmlc</span>] <span style="white-space: pre;">	</span>at macromedia.asc.parser.ListNode.evaluate(<span style="text-decoration: underline;">ListNode.java:44</span>)

    [<span style="text-decoration: underline;">mxmlc</span>] <span style="white-space: pre;">	</span>at macromedia.asc.semantics.ConstantEvaluator.evaluate(<span style="text-decoration: underline;">ConstantEvaluator.java:1497</span>)

    [<span style="text-decoration: underline;">mxmlc</span>] <span style="white-space: pre;">	</span>at macromedia.asc.parser.BinaryExpressionNode.evaluate(<span style="text-decoration: underline;">BinaryExpressionNode.java:56</span>)

    [<span style="text-decoration: underline;">mxmlc</span>] <span style="white-space: pre;">	</span>at macromedia.asc.semantics.ConstantEvaluator.evaluate(<span style="text-decoration: underline;">ConstantEvaluator.java:2124</span>)

    [<span style="text-decoration: underline;">mxmlc</span>] <span style="white-space: pre;">	</span>at macromedia.asc.parser.ArgumentListNode.evaluate(<span style="text-decoration: underline;">ArgumentListNode.java:45</span>)...</pre>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><img decoding="async" class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/pixy.gif?x-id=cc432a65-0505-44c1-b8fe-35dab7bb5dda" alt="" /><span class="zem-script more-related more-info pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2010/03/25/flex-sdk-3-5-0-problem-with-ternary-operators/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>AsYacc &#8211; first alpha release</title>
		<link>https://blog.sephiroth.it/2009/01/15/asyacc-first-alpha-release/</link>
					<comments>https://blog.sephiroth.it/2009/01/15/asyacc-first-alpha-release/#comments</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Thu, 15 Jan 2009 15:35:48 +0000</pubDate>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[asyacc]]></category>
		<category><![CDATA[compiler]]></category>
		<category><![CDATA[gnu flex]]></category>
		<category><![CDATA[lexer]]></category>
		<category><![CDATA[parser]]></category>
		<category><![CDATA[regular expression]]></category>
		<category><![CDATA[yacc]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=271</guid>

					<description><![CDATA[Before going further with discussing how to add runtime scripting support to a Flash applications, I&#8217;d like to share with you the source code of a porting of Yacc I did a while ago. I did some simple modification to make Yacc able to generate ActionScript 3.0 source code instead of C. It works quite &#8230; <a href="https://blog.sephiroth.it/2009/01/15/asyacc-first-alpha-release/" class="more-link">Continue reading <span class="screen-reader-text">AsYacc &#8211; first alpha release</span></a>]]></description>
										<content:encoded><![CDATA[<p>Before going further with discussing how to add <a title="Runtime expression evaluation in ActionScript" href="https://blog.sephiroth.it/2008/04/19/runtime-expression-evaluation-in-actionscript/">runtime scripting support to a Flash applications</a>, I&#8217;d like to share with you the source code of a porting of <a href="http://en.wikipedia.org/wiki/Yacc">Yacc</a> I did a while ago. I did some simple modification to make Yacc able to <strong>generate ActionScript 3.0 source code</strong> instead of C. It works quite well and supports a lot standard Yacc features. There might be some issues &#8211; report them to me and I&#8217;ll try to fix them 🙂</p>
<p>You can easilly find documentation about Yacc searching Google (you can start <a href="http://dinosaur.compilertools.net/">here</a> for example).</p>
<p>Usually Yacc is used in conjunction with a <strong>Scanner generator</strong> (like <a href="http://en.wikipedia.org/wiki/Lex_programming_tool">Lex</a>/<a href="http://en.wikipedia.org/wiki/Flex_lexical_analyserx">Flex</a>), but I didn&#8217;t to any porting of commonly used Scanner generators yet.</p>
<p><a href="/wp-content/uploads/2009/01/AsYacc.zip">Here you can download the sources</a>. The <strong>source code should be portable</strong> and compilable on all the most common platform, but I didn&#8217;t tested it on Windows yet. To compile the source code on Mac or Linux, <em>cd</em> to the source code directory and type use:</p>
<pre>gcc *.c -o AsYacc</pre>
<p>Once you have the compiled binary file, you can run the Parser generator using:</p>
<pre>./AsYacc -Hpackage=it.sephiroth.test grammar.y</pre>
<p>Where <em>grammar.y</em> is a text file that contains the grammar of a language defined using the proper syntax (see the docs online for all the detailed information you may need).</p>
<p><a href="https://blog.sephiroth.it/wp-content/uploads/2009/01/TestAsYacc.zip">Here you can download a simple calculator example</a> that uses the RegexLexer <a title="Scripting Flash apps: scanning the input file" href="https://blog.sephiroth.it/2008/12/16/scripting-flash-apps-scanning-the-input-file/">described previously</a> to implement the Scanner. For the ones who might be interested, here is the grammar used:<br />
<code>/* Infix notation calculator. */<br />
%{<br />
%}<br />
%token NUM<br />
%left '-' '+'<br />
%left '*' '/'<br />
%left NEG<br />
%right '^' /* exponentiation */<br />
%%<br />
input:<br />
exp			{ trace( $1 ); }<br />
;<br />
exp:<br />
NUM 			{ $$ = $1; }<br />
| exp '+' exp 		{ $$ = $1 + $3; }<br />
| exp '-' exp 		{ $$ = $1 - $3; }<br />
| exp '*' exp 		{ $$ = $1 * $3; }<br />
| exp '/' exp 		{ $$ = $1 / $3; }<br />
| '-' exp %prec NEG 	{ $$ = -$2; }<br />
| exp '^' exp 		{ $$ = Math.pow( $1, $3 ); }<br />
| '(' exp ')' 		{ $$ = $2; }<br />
;<br />
%%</code></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2009/01/15/asyacc-first-alpha-release/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>Java 6 Update 10 breaks Flex compiler!</title>
		<link>https://blog.sephiroth.it/2008/09/12/java-6-update-10-breaks-flex-compiler/</link>
					<comments>https://blog.sephiroth.it/2008/09/12/java-6-update-10-breaks-flex-compiler/#comments</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Sat, 13 Sep 2008 00:04:39 +0000</pubDate>
				<category><![CDATA[flex]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[compiler]]></category>
		<category><![CDATA[java]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=262</guid>

					<description><![CDATA[I just want to share this problem I found so maybe someone can save some time.. Today while surfing the net I received a notification of an update of my Java installation to the Update 10 in order to see correctly the contents of that site.. bla bla bla.. Sometime later I switched to Flex &#8230; <a href="https://blog.sephiroth.it/2008/09/12/java-6-update-10-breaks-flex-compiler/" class="more-link">Continue reading <span class="screen-reader-text">Java 6 Update 10 breaks Flex compiler!</span></a>]]></description>
										<content:encoded><![CDATA[<p><a href="https://blog.sephiroth.it/wp-content/uploads/2008/09/java-update-10.png"><img decoding="async" class="alignleft size-full wp-image-1127" style="margin: 4px;" title="java-update-10" src="https://blog.sephiroth.it/wp-content/uploads/2008/09/java-update-10.png" alt="" width="50" height="59" /></a>I just want to share this problem I found so maybe someone can save some time..</p>
<p>Today while surfing the net I received a notification of an update of my Java installation to the Update 10 in order to see correctly the contents of that site.. bla bla bla..</p>
<p>Sometime later I switched to Flex and at the first execution of my ant script for compiling a flex project I suddenly received this beautiful error:<br />
<code>[exec] Error: java/security/MessageDigest<br />
[exec] java.lang.NoClassDefFoundError: java/security/MessageDigest<br />
[exec]     at java.io.ObjectStreamClass.computeDefaultSUID(Unknown Source)<br />
[exec]     at java.io.ObjectStreamClass.access$100(Unknown Source)<br />
[exec]     at java.io.ObjectStreamClass$1.run(Unknown Source)<br />
[exec]     at java.security.AccessController.doPrivileged(Native Method)<br />
[exec]     at java.io.ObjectStreamClass.getSerialVersionUID(Unknown Source)<br />
[exec]     at java.io.ObjectStreamClass.initNonProxy(Unknown Source)<br />
[exec]     at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)<br />
[exec]     at java.io.ObjectInputStream.readClassDesc(Unknown Source)<br />
[exec]     at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)<br />
[exec]     at java.io.ObjectInputStream.readClassDesc(Unknown Source)<br />
[exec]     at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)<br />
[exec]     at java.io.ObjectInputStream.readObject0(Unknown Source)<br />
[exec]     at java.io.ObjectInputStream.readObject(Unknown Source)<br />
[exec]     at flex.util.SerializedTemplateFactory.load(SerializedTemplateFactory.java:30)<br />
[exec]     at flex2.compiler.util.VelocityManager.getTemplate(VelocityManager.java:162)<br />
[exec]     at flex2.compiler.util.VelocityManager.getTemplate(VelocityManager.java:151)<br />
[exec]     at flex2.compiler.util.VelocityManager.getTemplate(VelocityManager.java:137)<br />
[exec]     at flex2.compiler.as3.genext.GenerativeSecondPassEvaluator.generateSupportCode(GenerativeSecondPassEvaluator.java:256)<br />
[exec]     at flex2.compiler.as3.genext.GenerativeSecondPassEvaluator.modifySyntaxTree(GenerativeSecondPassEvaluator.java:355)<br />
[exec]     at flex2.compiler.as3.binding.BindableSecondPassEvaluator.evaluate(BindableSecondPassEvaluator.java:102)<br />
[exec]     at macromedia.asc.parser.ClassDefinitionNode.evaluate(ClassDefinitionNode.java:106)<br />
[exec]     at flash.swf.tools.as3.EvaluatorAdapter.evaluate(EvaluatorAdapter.java:338)<br />
[exec]     at macromedia.asc.parser.StatementListNode.evaluate(StatementListNode.java:60)<br />
[exec]     at flash.swf.tools.as3.EvaluatorAdapter.evaluate(EvaluatorAdapter.java:923)<br />
[exec]     at macromedia.asc.parser.ProgramNode.evaluate(ProgramNode.java:80)<br />
[exec]     at flex2.compiler.as3.genext.GenerativeExtension.parse2(GenerativeExtension.java:114)<br />
[exec]     at flex2.compiler.as3.Compiler.parse2(Compiler.java:386)<br />
[exec]     at flex2.compiler.API.parse2(API.java:2390)<br />
[exec]     at flex2.compiler.API.parse2(API.java:2348)<br />
[exec]     at flex2.compiler.API.batch2(API.java:375)<br />
[exec]     at flex2.compiler.API.batch(API.java:1117)<br />
[exec]     at flex2.compiler.API.compile(API.java:1290)<br />
[exec]     at flex2.compiler.API.compile(API.java:1210)<br />
[exec]     at flex2.tools.Compc.compc(Compc.java:158)<br />
[exec]     at flex2.tools.Compc.main(Compc.java:41)</code><br />
so I tried also to compile another project before go crazy, but I got this another java funny error, which was more or less unreadable as the previous one!</p>
<p>Fortunately I remembered the update I did of Java! And in fact after remove that update everything worked again!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2008/09/12/java-6-update-10-breaks-flex-compiler/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
			</item>
		<item>
		<title>Expressions evaluation at (almost) native speed</title>
		<link>https://blog.sephiroth.it/2008/07/01/expressions-evaluation-at-almost-native-speed/</link>
					<comments>https://blog.sephiroth.it/2008/07/01/expressions-evaluation-at-almost-native-speed/#comments</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Wed, 02 Jul 2008 00:00:00 +0000</pubDate>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[scripting languages]]></category>
		<category><![CDATA[applicationDomain]]></category>
		<category><![CDATA[bytecode]]></category>
		<category><![CDATA[compiler]]></category>
		<category><![CDATA[expression]]></category>
		<category><![CDATA[haxe]]></category>
		<category><![CDATA[HxASM]]></category>
		<category><![CDATA[swfcompiler]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=257</guid>

					<description><![CDATA[Finally I found a bit of time this weekend to do some other tests with expressions evaluation. The results are pretty interesting, even if obvious from some point of view. I took the ExpressionEvaluator I wrote as example for the first post about this topic, and then I edited a bit the code adding just &#8230; <a href="https://blog.sephiroth.it/2008/07/01/expressions-evaluation-at-almost-native-speed/" class="more-link">Continue reading <span class="screen-reader-text">Expressions evaluation at (almost) native speed</span></a>]]></description>
										<content:encoded><![CDATA[<p>Finally I found a bit of time this weekend to do some other tests with <strong>expressions evaluation</strong>.</p>
<p>The results are pretty interesting, even if obvious from some point of view. I took the ExpressionEvaluator I wrote as example for the <a title="Runtime expression evaluation in ActionScript" href="https://blog.sephiroth.it/2008/04/19/runtime-expression-evaluation-in-actionscript/">first post</a> about this topic, and then I edited a bit the code adding just in time <strong>AS Bytecode compilation</strong>.<br />
Thanks to that, expressions evaluation is much more fast and always safe because it runs in its own <em>ApplicationDomain</em>.</p>
<p>You can <a href="https://blog.sephiroth.it/wp-content/uploads/2008/07/ExpressionEvaluator_compiler.zip">download the sources here</a>, that includes the edited code and a test file. <strong>The test file runs 1 milion of iterations and may hang your browser or at worst case your system. Reduce the value of the ITERATIONS constant if you are not sure about the power of you machine</strong>.</p>
<p>If you want to read a bit more details about that, click on the link below to continue reading.</p>
<p><span id="more-257"></span></p>
<p>I did some simple modification to the existing classes:</p>
<ul>
<li>Added a <em>compile</em> method to the IExpression interface;</li>
<li>Added the <em>symbolNames</em> getter to the SymbolTable class, to retrieve a list of all the symbols defined inside the symbol table.</li>
<li>Converted hxasm to Actionscript (finxing some small issues to avoid to include all the Haxe support classes);</li>
<li>Implemented the <em>compile</em> method on all the AST nodes using HxASM;</li>
<li>Added an <em>SWFCompile</em> class that takes an IExpression and a SymbolTable and produces an SWF;</li>
<li>Edited the <em>CompiledExpression</em> class adding a <em>compile</em> method that generates an SWF starting from an <em>IExpression</em>.</li>
</ul>
<p>Adding just in time compilation was easy a really quick thanks to <a href="http://haxe.org/com/libs/hxasm">HxASM</a>. <strong>HxASM</strong> is an <a href="http://haxe.org">Haxe</a> library written by Haxe&#8217;s author (<strong>Nicolas Cannasse</strong>) that makes you able to write low level bytecode instructions in ActionScript an generate a <em>ByteArray</em> that contains an (hopefully) valid SWF. The SWF can then be loaded by <em>Loader.loadBytes</em> and executed.</p>
<p>It have been easy to port HxASM to ActionScript too, thanks again to the <strong>Haxe compiler which is able to generate AS3 code starting from Haxe code</strong>.</p>
<p>Compilation was achieved easilly because the expressions we are compiling are really simple. The compiler generates a class called <em>CompiledExpression</em> that has a method <em>execute</em> that can be called to execute the expression. All the values inside the symbol table are exposed as public properties.</p>
<p>Just to make you understand better, givin this expression:</p>
<p><code>sin( x * 10 + y - 11 )</code></p>
<p>SWFCompiler will generate the bytecode for this class:<br />
<code lang="actionscript">class CompiledExpression<br />
{<br />
public var sin: *;<br />
public var x: *;<br />
public var y: *;<br />
public function execute(): Number<br />
{<br />
return sin( x * 10 + y - 11 );<br />
}<br />
}</code><br />
As you can see the type of the class variables is generic, but you can improve the generator to understand if a variable should contain a number or a function.</p>
<p>The generated SWF can be loaded and run easilly:<br />
<code lang="actionscript">var loader: Loader = new Loader();<br />
var parser: Parser = new Parser(<br />
new Scanner( "sin( x / ( 4 / 2 * 2 - 2 + 2 * x / x ) ) * 100" ) );<br />
var compiled: CompiledExpression = parser.parse();<br />
var data: ByteArray = compiled.compile();<br />
loader.contentLoaderInfo.addEventListener( Event.COMPLETE,<br />
function( event: Event ): void<br />
{<br />
var info: LoaderInfo = ( event.target as LoaderInfo );<br />
var klass: Class = (<br />
info.applicationDomain.getDefinition( "CompiledExpression" ) as Class );<br />
var cp: Object = new klass();<br />
cp.x = 10;<br />
cp.sin = Math.sin;<br />
trace( "Result", cp.execute() );<br />
} );<br />
loader.loadBytes( data, new LoaderContext( false,<br />
new ApplicationDomain( ApplicationDomain.currentDomain ) ) );<br />
</code><br />
I build a simple test (shipped with the sources) that runs 1 milion times an expression using 3 methods: Evaluation, Compiled and Native.</p>
<p>Results (on my Mac Pro 8 Core, 4GB ram) are obvious:</p>
<pre>eval 1000000 iterations: 12939
<strong>compiled 1000000 iterations: 848</strong>
native 1000000 iterations: 371</pre>
<p>As you can see native execution is faster, but compiled version runs really well (you might want to optimize the generated code to make it run faster) and it is many times faster then AST evaluation.</p>
<p>If you want to run a complex expression many times and dont want to stress your Flash Plugin, you can use the compiled version.</p>
<p>Gotta run, see u next time!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2008/07/01/expressions-evaluation-at-almost-native-speed/feed/</wfw:commentRss>
			<slash:comments>8</slash:comments>
		
		
			</item>
		<item>
		<title>mxmlc NullPointerException crash</title>
		<link>https://blog.sephiroth.it/2007/03/18/mxmlc-nullpointerexception-crash/</link>
					<comments>https://blog.sephiroth.it/2007/03/18/mxmlc-nullpointerexception-crash/#comments</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Mon, 19 Mar 2007 04:44:19 +0000</pubDate>
				<category><![CDATA[flex]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[compiler]]></category>
		<category><![CDATA[XMLList]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=206</guid>

					<description><![CDATA[Today I was getting crazy to find out why Flex didn't want to compile my application.. Clicking on compile it started suddenly to give me an internal compile error and nothing else. So i tried to compile with the mxmlc from a console just to see the error log and the outpuw was:...
]]></description>
										<content:encoded><![CDATA[<p>Today I was getting crazy to find out why Flex didn&#8217;t want to compile my application.. Clicking on compile it started suddenly to give me an internal compile error and nothing else. So i tried to compile with the mxmlc from a console just to see the error log and the outpuw was:<br />
<code>java.lang.NullPointerException<br />
at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:891)<br />
at macromedia.asc.parser.BinaryExpressionNode.evaluate(BinaryExpressionNode.java:38)<br />
at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:890)<br />
at macromedia.asc.parser.BinaryExpressionNode.evaluate(BinaryExpressionNode.java:38)<br />
at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:891)<br />
at macromedia.asc.parser.BinaryExpressionNode.evaluate(BinaryExpressionNode.java:38)<br />
at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:890)<br />
at macromedia.asc.parser.BinaryExpressionNode.evaluate(BinaryExpressionNode.java:38)<br />
at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:962)<br />
at macromedia.asc.parser.ListNode.evaluate(ListNode.java:27)<br />
at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:5859)<br />
at macromedia.asc.parser.LiteralXMLNode.evaluate(LiteralXMLNode.java:28)<br />
at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:3087)<br />
at macromedia.asc.parser.VariableBindingNode.evaluate(VariableBindingNode.java:48)<br />
at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:962)<br />
at macromedia.asc.parser.ListNode.evaluate(ListNode.java:27)<br />
at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:2897)<br />
at macromedia.asc.parser.VariableDefinitionNode.evaluate(VariableDefinitionNode.java:32)<br />
at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:4629)<br />
at macromedia.asc.parser.ClassDefinitionNode.evaluate(ClassDefinitionNode.java:86)<br />
at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:938)<br />
at macromedia.asc.parser.ArgumentListNode.evaluate(ArgumentListNode.java:28)<br />
at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:750)<br />
at macromedia.asc.parser.SetExpressionNode.evaluate(SetExpressionNode.java:39)<br />
at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:580)<br />
at macromedia.asc.parser.MemberExpressionNode.evaluate(MemberExpressionNode.java:31)<br />
at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:1273)<br />
at macromedia.asc.parser.ExpressionStatementNode.evaluate(ExpressionStatementNode.java:33)<br />
at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:4407)<br />
at macromedia.asc.parser.ClassDefinitionNode.evaluate(ClassDefinitionNode.java:86)<br />
at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:2577)<br />
at macromedia.asc.parser.ProgramNode.evaluate(ProgramNode.java:63)<br />
at flex2.compiler.as3.Compiler.analyze2(Compiler.java:436)<br />
at flex2.compiler.mxml.InterfaceCompiler.analyze2(InterfaceCompiler.java:337)<br />
at flex2.compiler.mxml.Compiler.analyze2(Compiler.java:130)<br />
at flex2.compiler.API.analyze(API.java:2360)<br />
at flex2.compiler.API.analyze(API.java:2275)<br />
at flex2.compiler.API.batch2(API.java:337)<br />
at flex2.compiler.API.batch(API.java:1025)<br />
at flex2.compiler.API.compile(API.java:1211)<br />
at flex2.compiler.API.compile(API.java:1114)<br />
at flex2.tools.Compiler.main(Compiler.java:222)</code><br />
Wow!!<br />
So, how can I find the problem? I can&#8217;t find any useful information from this log..<br />
For this reason I had to remove portion of code from my mxml and from all the imported packages.. 2 hours of &#8220;debugging&#8221; gave me the solution!</p>
<p>A syntax error in a declaration of an XMLList was the problem!  Fixed the line also the compiler started to run again with no problems.</p>
<p>This is a portion of mxml code to reproduce the problem:<br />
<code>;</p>
<p>< ![CDATA[
private var uuid:String = "";
private var menubarXML:XMLList =
<><br />
<menuitem data=uuid>
</menuitem>
<>;<br />
]]&gt;</p>
<p></code></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2007/03/18/mxmlc-nullpointerexception-crash/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Flex2 and namespaces extending components</title>
		<link>https://blog.sephiroth.it/2006/09/15/flex2-and-namespaces-extending-components/</link>
					<comments>https://blog.sephiroth.it/2006/09/15/flex2-and-namespaces-extending-components/#comments</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Fri, 15 Sep 2006 17:48:26 +0000</pubDate>
				<category><![CDATA[flex]]></category>
		<category><![CDATA[compiler]]></category>
		<category><![CDATA[component]]></category>
		<category><![CDATA[namespace]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=169</guid>

					<description><![CDATA[flex2 use namespace mx_internal
]]></description>
										<content:encoded><![CDATA[<p><a href="https://blog.sephiroth.it/wp-content/uploads/2006/09/setStyle_mx_internal.png"><img decoding="async" class="size-full wp-image-860 alignright" style="margin: 4px;" title="setStyle_mx_internal" src="https://blog.sephiroth.it/wp-content/uploads/2006/09/setStyle_mx_internal.png" alt="" width="257" height="97" /></a>I took 2 hours to find a solution for that and I decided to blog it..<br />
I was creating my new <a href="http://www.adobe.com/products/flex/">Flex2</a> component extending the <a href="http://livedocs.macromedia.com/flex/2/langref/mx/core/UIComponent.html">UIComponent</a> class and I need to define new custom styles for my own component&#8230;<br />
Ok, i opened the &#8220;<a href="http://download.macromedia.com/pub/documentation/en/flex/2/flex2_createextendcomponents.pdf">create and extend components</a>&#8221; PDF guide and found that I need to put this code to accomplish it:<br />
<code lang="actionscript">private static function classConstruct():Boolean<br />
{<br />
if (!StyleManager.getStyleDeclaration("ResizeManager"))<br />
{<br />
var newStyleDeclaration:CSSStyleDeclaration = new CSSStyleDeclaration();<br />
newStyleDeclaration.setStyle("boxSize", 4);<br />
StyleManager.setStyleDeclaration("ResizeManager", newStyleDeclaration, true);<br />
}<br />
return true;<br />
}</code><br />
That&#8217;s all, but at this time the compiler die with that error message &#8220;1000: Riferimento ambiguo a setStyle&#8221;, which in english should be: &#8220;<strong>1000: Ambiguous reference to setStyle</strong>&#8220;.<br />
I google for some time but without finding a solution, then I discovered the problem. I was using in my component the mx_internal <a href="http://livedocs.macromedia.com/flex/2/langref/statements.html#use_namespace">namespace</a>, that was the problem. Once changed namespace everything was ok.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2006/09/15/flex2-and-namespaces-extending-components/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>Flash Player 9, Flex 2, ActionScript 3.0: A Survey of the New Landscape</title>
		<link>https://blog.sephiroth.it/2006/07/07/flash-player-9-flex-2-actionscript-3-0-a-survey-of-the-new-landscape/</link>
					<comments>https://blog.sephiroth.it/2006/07/07/flash-player-9-flex-2-actionscript-3-0-a-survey-of-the-new-landscape/#respond</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Fri, 07 Jul 2006 20:37:59 +0000</pubDate>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[compiler]]></category>
		<category><![CDATA[flash 9]]></category>
		<category><![CDATA[survey]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=157</guid>

					<description><![CDATA[colin moock on actionscript3, flash9 and flex2<br />
]]></description>
										<content:encoded><![CDATA[<p><a href="http://www.moock.org" target="_blank">Colin</a> has posted an interesting article on flash9, flex2, actionscript3.<br />
Why ActionScript 2 coders should start learning ActionScript3 as soon as possible and why timeline coders and flash designers shouldn&#8217;t&#8230;<br />
Colin underlined a significant aspect of this new flash release: the <strong>free flex2 command line compiler. </strong>(I asked for it since so much time!)<strong><br />
</strong></p>
<p>Read the full entry here:<br />
<a href="http://www.moock.org/blog/archives/000189.html" target="_blank">http://www.moock.org/blog/archives/000189.html</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2006/07/07/flash-player-9-flex-2-actionscript-3-0-a-survey-of-the-new-landscape/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SWF server side compiler with MTASC</title>
		<link>https://blog.sephiroth.it/2006/02/02/swf-server-side-compiler-with-mtasc/</link>
					<comments>https://blog.sephiroth.it/2006/02/02/swf-server-side-compiler-with-mtasc/#comments</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Thu, 02 Feb 2006 18:58:15 +0000</pubDate>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[compiler]]></category>
		<category><![CDATA[mtasc]]></category>
		<category><![CDATA[remote]]></category>
		<category><![CDATA[server]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=127</guid>

					<description><![CDATA[I never thought at this before but it was so obvious!! &#8230;put the mtasc binary on remote server and let it create swf on the fly! HOSHI Tetsuya put toghether a server side swf compiler using mtasc (http://hossy.net, Everything is unreadable&#8230; just click on ENTER &#240;&#159;&#153;&#130; ). He also published the source code (php files): &#8230; <a href="https://blog.sephiroth.it/2006/02/02/swf-server-side-compiler-with-mtasc/" class="more-link">Continue reading <span class="screen-reader-text">SWF server side compiler with MTASC</span></a>]]></description>
										<content:encoded><![CDATA[<p>I never thought at this before but it was so obvious!! &#8230;put the mtasc binary on remote server and let it create swf on the fly!<br />
<span style="font-weight: bold;">HOSHI Tetsuya</span> put toghether a server side swf compiler using mtasc (<a href="http://hossy.net/">http://hossy.net</a>, Everything is unreadable&#8230; just click on ENTER 🙂 ).<br />
He also published the source code (php files): <a href="http://hossy.net/sssc.zip">http://hossy.net/sssc.zip</a><br />
<a href="http://hossy.net/">http://hossy.net/</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2006/02/02/swf-server-side-compiler-with-mtasc/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>NeoSwiff beta</title>
		<link>https://blog.sephiroth.it/2005/04/07/neoswiff-beta/</link>
					<comments>https://blog.sephiroth.it/2005/04/07/neoswiff-beta/#respond</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Fri, 08 Apr 2005 04:50:24 +0000</pubDate>
				<category><![CDATA[general]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[compiler]]></category>
		<category><![CDATA[visual studio]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=74</guid>

					<description><![CDATA[neoswiff
]]></description>
										<content:encoded><![CDATA[<p>After <a href="http://www.mtasc.org">MTASC</a> compiler, I read today of another upcoming SWF compiler.</p>
<p><a href="http://www.globfx.com/products/neoswiff/"><strong>NeoSwiff</strong></a> allows developers to write Flash™ applications in C#. NeoSwiff comes with a <span style="font-weight: bold;">C# to SWF</span> compiler, and also with a Visual Studio <span style="font-weight: bold;">.NET</span> support.  This is very interesting 🙂<br />
Moreover the compiler is available for Windows/Mac OSX and Linux<br />
Some screenshots are available here: <a href="http://www.globfx.com/products/neoswiff/screenshots.php">http://www.globfx.com/products/neoswiff/screenshots.php</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2005/04/07/neoswiff-beta/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>MTASC : Motion-Twin ActionScript 2 Compiler</title>
		<link>https://blog.sephiroth.it/2004/11/05/mtasc-motion-twin-actionscript-2-compiler/</link>
					<comments>https://blog.sephiroth.it/2004/11/05/mtasc-motion-twin-actionscript-2-compiler/#comments</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Fri, 05 Nov 2004 17:36:32 +0000</pubDate>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[SEPY]]></category>
		<category><![CDATA[compiler]]></category>
		<category><![CDATA[mtasc]]></category>
		<category><![CDATA[ocaml]]></category>
		<category><![CDATA[opensource]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=39</guid>

					<description><![CDATA[MTASC is the first ActionScript 2 Open Source free compiler. Right now it&#8217;s a command line compiler which get .as files as input and will generate .swf files as output. This means it can be easily integrated into any editor which can run command line tools (such as sepy). It seems MTASC is more and &#8230; <a href="https://blog.sephiroth.it/2004/11/05/mtasc-motion-twin-actionscript-2-compiler/" class="more-link">Continue reading <span class="screen-reader-text">MTASC : Motion-Twin ActionScript 2 Compiler</span></a>]]></description>
										<content:encoded><![CDATA[<p><strong>MTASC</strong> is the first ActionScript 2 Open Source free compiler.<br />
Right now it&#8217;s a command line compiler which get .as files as input and will generate .swf files as output. This means it can be easily integrated into any editor which can run command line tools (such as <a href="http://www.sf.net/projects/sepy">sepy</a>).<br />
It seems MTASC is more and more quickly than the internal flash compiler:<br />
<small><em>MTASC is based on the best compiler technology available (namely the OCaml programming language) and thus provide a great speed improvement over MMC (compile around 100 classes in less than 5 seconds).<br />
Since the source code is made more concise by using good technology, it is more easy to maintain and implement robust and proven typing algorithms. The feedback we get from Open Source community help us fixes the bug quickly.</em></small><br />
It&#8217;s made using <a href="http://caml.inria.fr/">OCaml</a> as programming language.<br />
The mailing list is available at this link: <a href="http://lists.motion-twin.com/mailman/listinfo/mtasc">http://lists.motion-twin.com/mailman/listinfo/mtasc</a><br />
For examples, download and bugs refer to the linked MTASC page.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2004/11/05/mtasc-motion-twin-actionscript-2-compiler/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
