André,

This looks great to me.

1) The edu.oswego (concurrent) package is now part of java.util.concurrent as 
of J2SE 5.0 .  So maybe we should file a JIRA to clean that up - we don't need 
to have our own version.  It looks like only 
WEB-INF/lps/server/src/org/openlaszlo/cache/Cache.java uses it.

2) I also got the cache errors that Tucker mentioned.  I definitely did an ant 
clean before building.

solo-compile-file:
     [echo] Compiling explore-nav.lzx
     [echo] arg: --runtime=swf10 explore-nav.lzx
     [echo] Using LPS_HOME: /Users/clients/laszlo/src/svn/openlaszlo/trunk-d
     [java] can't load cache file: 1296659464239.dat
     [java] exception: 
     [java] java.io.InvalidClassException: org.openlaszlo.cache.CachedInfo; 
local class incompatible: stream classdesc serialVersionUID = 
-8931702427313962763, local class serialVersionUID = 4726487588606762594
     [java]     at 
java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:562)
     [java]     at 
java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1582)
     [java]     at 
java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1495)
     [java]     at 
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1731)
     [java]     at 
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
     [java]     at 
java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
     [java]     at org.openlaszlo.cache.Cache$Item.<init>(Cache.java:1018)
     [java]     at org.openlaszlo.cache.Cache.loadFromDirectory(Cache.java:742)
     [java]     at org.openlaszlo.cache.Cache.<init>(Cache.java:178)
     [java]     at 
org.openlaszlo.compiler.CompilerMediaCache.<init>(CompilerMediaCache.java:49)
     [java]     at org.openlaszlo.compiler.Main.lzc(Main.java:362)
     [java]     at org.openlaszlo.compiler.Main.main(Main.java:116)
     [java] deleting cache files for : 1296659464239.dat
     [java] can't load cache file: 1296659464702.dat
     [java] exception: 
     [java] java.io.InvalidClassException: org.openlaszlo.cache.CachedInfo; 
local class incompatible: stream classdesc serialVersionUID = 
-8931702427313962763, local class serialVersionUID = 4726487588606762594
     [java]     at 
java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:562)
     [java]     at 
java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1582)
     [java]     at 
java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1495)
     [java]     at 
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1731)
     [java]     at 
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
     [java]     at 
java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
     [java]     at org.openlaszlo.cache.Cache$Item.<init>(Cache.java:1018)
     [java]     at org.openlaszlo.cache.Cache.loadFromDirectory(Cache.java:742)
     [java]     at org.openlaszlo.cache.Cache.<init>(Cache.java:178)
     [java]     at 
org.openlaszlo.compiler.CompilerMediaCache.<init>(CompilerMediaCache.java:49)
     [java]     at org.openlaszlo.compiler.Main.lzc(Main.java:362)
     [java]     at org.openlaszlo.compiler.Main.main(Main.java:116)
     [java] deleting cache files for : 1296659464702.dat
     [java] can't load cache file: 1296659464725.dat

and a whole lot more of the same.  It seemed to fix itself, with a second 'ant 
build' (even without a clean between) the problem was gone.

I did ant lztest just to make sure (since you don't have a QA reviewer).  It's 
running now and looks fine, I'll object later if it hiccups.

Approved.

- Don

On Feb 2, 2011, at 2:17 PM, André Bargull wrote:

> I'll update svn.openlaszlo.org/vendor/ and the wiki pages [1,2] later.
> 
> [1] http://wiki.openlaszlo.org/SubversionBuildInstructions#Install_JavaCC
> [2] 
> http://wiki.openlaszlo.org/NativeWindows7SubversionBuildInstructions#Install_javacc
> 
> 
> Change bargull-20110202-U3G by bargull@Bargull02 on 2011-02-02 17:03:34
> in /home/anba/src/svn/openlaszlo/trunk
> for http://svn.openlaszlo.org/openlaszlo/trunk
> 
> Summary: Upgrade to JavaCC5, fix ASI bugs in parser
> 
> New Features: LPP-8788 (We should use a more modern version of JavaCC)
> 
> Bugs Fixed: LPP-9714 (Parser does not enfore no-line-terminator in 
> break/continue/throw/postfix-op statements), LPP-9719 (Semicolon after 
> do-while creates empty statement), LPP-9720 (Newline in multi-line comment 
> not treated as newline for ASI), LPP-9721 (TypeIdentifier() should enforce 
> NoLineTerminator before Nullable()/NonNullable()), LPP-9722 (Multi-line 
> comment not handled when computing ASI)
> 
> Technical Reviewer: ptw, dda
> QA Reviewer: (pending)
> 
> Overview:
> JavaCC 5 has got a bug with javacode non-terminals, somehow the tokenstream 
> isn't rewinded properly in a (deeply?) nested syntactic lookahead if used in 
> conjunction with javacode non-terminals (e.g. see lookahead for 
> ModifiedDefinition() in Directive() and the Sc() non-terminal). Even using a 
> no-op javacode non-terminal broke the parser (JAVACODE void Nop () 
> {/*empty*/}). Because of that reason I had to re-implement the whole optional 
> semicolon mechanism in the parser. While doing this rework, I've encountered 
> a couple of bugs (LPP-9714, LPP-9719, LPP-9720, LPP-9721, LPP-9722).
> 
> 
> Details:
> All Sc() non-terminals for optional semicolons have been rewritten to use a 
> semantic lookahead: [LOOKAHEAD({Sc()}) ";"]
> The new Sc() function simply returns `true` if the next token in the stream 
> is a semicolon, this semicolon will then simply be consumed. If the next 
> token is not a semicolon, but an acceptable choice for automatic semicolon 
> insertion (ASI), Sc() returns `false`. So the lookahead is unsuccessful and 
> by that the optional block [...] is not processed any further. If the next 
> token is neither a semicolon nor an acceptable choice for ASI, a parser 
> exception is thrown.
> 
> JavaCC cannot infer the content a javacode non-terminal, therefore it 
> couldn't warn for possible ambiguities in the grammar after Sc() calls. As 
> the old Sc() non-terminal is gone, I had to add additional lookaheads to 
> resolve these ambiguities. See CallExpression(), AdditiveExpression(), 
> RelationalExpression() productions.
> 
> LPP-9714 (no-line-terminator rule):
> The ECMAScript grammar has got restricted productions for the 
> PostfixExpression, ContinueStatement, BreakStatement, ThrowStatement and 
> ReturnStatement productions. For these productions, line terminators are 
> strictly prohibited. This restriction was only implemented for the 
> ReturnStatement, it's now implemented for the other productions as well. The 
> pattern used to implement the restriction is simply: 
> [LOOKAHEAD(NonTerminal(), {NoLineTerminator()}) NonTerminal()]. So a 
> combination of syntactic and semantic lookahead: if the next token(s) can be 
> parsed as NonTerminal() and there are no intervening newlines, consume the 
> tokens, otherwise just proceed. I've added an extra function to produce a 
> nice error message for the ThrowStatement production, so it's easier for the 
> user to understand what's going wrong when she added a newline after the 
> `throw` statement. The default error message by JavaCC is pretty useless 
> here: Encountered "" at line 1, column 61. Was expecting one of: (empty list 
> here)
> 
> LPP-9719 (do-while loop):
> Just added the optional semicolon predicate for the do-while loop in 
> IterationStatement().
> 
> LPP-9720 (newline in multi-line comment):
> Scan for newlines in multi-line comments, they count as newlines for the 
> syntactic grammar, cf. ECMAScript 5, 7.4 Comments
> 
> LPP-9721 (restriced production for TypeIdentifier):
> TypeIdentifier was not a restricted production, but it should be, otherwise 
> "var x:Boolean \n !x;", where \n denotes a line break, is not parsed as "var 
> x:Boolean; !x;".
> 
> LPP-9722 (multi-line comment for ASI):
> The (now removed) optionalSc() function just used the first special token, 
> but special tokens are chained, e.g. consider multiple single-line and 
> multi-line comments appearing next to each other. Therefore it's necessary to 
> loop over the specialToken field, just like it's now done in 
> NoLineTerminator().
> 
> Token.java:
> JavaCC 5 requires a new interface in Token: Token.newToken(int, String).
> 
> TestParserASI.java:
> JUnit test case for LPP-9714, LPP-9719, LPP-9720, LPP-9721, LPP-9722
> 
> build.xml:
> - update 1.4 -> 1.5
> - comment out org/openlaszlo/iv/flash/context package, this was recently 
> discussed on laszlo-dev
> - explicitly add EDU/oswego package for build, sometimes my ant doesn't pick 
> it up, so make it explicit
> - add TestParserASI to the "test" target
> 
> 
> Tests:
> TestParserASI test case, lfc compiles, smokecheck and alldata (swf10, 
> dhtml)x(Firefox, Opera, Safari, IE)
> 
> (Don't forget to download and install JavaCC 5 and update your JAVACC_HOME 
> environment variable accordingly!)
> 
> Files:
> M WEB-INF/lib/javacc.jar
> M WEB-INF/lps/server/build.xml
> A WEB-INF/lps/server/src/org/openlaszlo/test/TestParserASI.java
> M WEB-INF/lps/server/sc/src/org/openlaszlo/sc/Parser.jjt
> M WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/Token.java
> 
> Changeset: 
> http://svn.openlaszlo.org/openlaszlo/patches/bargull-20110202-U3G.tar
> 


--

Don Anderson
Java/C/C++, Berkeley DB, systems consultant

voice: 617-306-2057
email: [email protected]
www: http://www.ddanderson.com
blog: http://libdb.wordpress.com





Reply via email to