Author: ptw
Date: 2007-01-24 10:43:45 -0800 (Wed, 24 Jan 2007)
New Revision: 3513

Added:
   openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/sc/lzsc.java
Removed:
   openlaszlo/branches/legals/WEB-INF/lps/server/sc/LFCCompiler.py
   openlaszlo/branches/legals/WEB-INF/lps/server/sc/lzsc.py
Modified:
   openlaszlo/branches/legals/WEB-INF/lps/server/build.xml
   
openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/sc/CodeGenerator.java
   
openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/sc/Instructions.java
   
openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/sc/JavascriptGenerator.java
   openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/sc/Main.java
Log:
Change 20070122-ptw-1 by [EMAIL PROTECTED] on 2007-01-22 17:22:13 EST
    in /Users/ptw/OpenLaszlo/legals-1

Summary: Finish Ben's good work

Bugs Fixed:
LPP-NaN: Get rid of more Python

Technical Reviewer: ben (Message-Id: <[EMAIL PROTECTED]>)
QA Reviewer: jgrandy (Message-Id: <[EMAIL PROTECTED]>)
Doc Reviewer: n/a

Details:
    LFCCompiler.py, lzsc.py: obsolete

    Instructions: permit Boolean as arg to push

    lzsc.java: Slavish conversion from lzsc.py

    JavascriptGenerator, CodeGenerator: remove old Python
    heuristicating

    Main: call lzsc directly

    build.xml: No more sc-compiler target

Tests:
    ant clean make, diffed the LFCdhtml, no significant difference,
    smoke/smokecheck runs.

Modified: openlaszlo/branches/legals/WEB-INF/lps/server/build.xml
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/server/build.xml     2007-01-24 
18:21:35 UTC (rev 3512)
+++ openlaszlo/branches/legals/WEB-INF/lps/server/build.xml     2007-01-24 
18:43:45 UTC (rev 3513)
@@ -53,22 +53,6 @@
                 ==changed to==
                 sc.build.java.1.4 = build.1.4/src/org/openlaszlo/sc}
 
-Target [sc-compiler]   (1.3 sources created by jython)
-jython; sc.src.py = ./sc/LFCCompiler.py
-                ==to== 
-                ./build.1.3/src/ (org/openlaszlo/sc/) LFCCompiler.java
-
-                {sc.build.java = build/src/org/openlaszlo/sc 
-                ==changed to== 
-                sc.build.java.1.3 = build.1.3/src/org/openlaszlo/sc}
-                {build.java = ./build/src 
-                 ==changed to== 
-                 build.java.1.3 = ./build.1.3/src}
-
-Target [compile]
-javac (1.3);    java.1.3.srcs = build.java = ./build.1.3/src
-                        ==to== build = ./build
-
 javac (1.4);     
       ${java.1.4.srcs} = 
       ${buildsrc.1.4} : ${src}:${jgen.src}:${jjt.src} =
@@ -101,22 +85,18 @@
   <property name="jgen.src" value="${jgen}/src" />
 
   <!-- Programmatically generated Java files -->
-  <property name="buildsrc.1.3" value="${build.1.3}/src" />
   <property name="buildsrc.1.4" value="${build.1.4}/src" />
   <property name="build.test.dir" value="${build}/test" />
   <property name="jjt.src" value="${buildsrc.1.4}/${pkg.sc.parser}" />
 
   <!-- Build file directories -->
   <property name="buildsrc.sc.1.4"  value="${buildsrc.1.4}/${pkg.sc}" />
-  <property name="buildsrc.sc.1.3"  value="${buildsrc.1.3}/${pkg.sc}" />
 
   <!-- All Java files that should be compiled: both hand-generated
        sources and programatically generated files. -->
   <property name="java.1.4.srcs" 
value="${buildsrc.1.4}:${src}:${jgen.src}:${jjt.src}" />
 
-  <!-- Java files that have to be compiled with -source 1.3 (for now -->
-  <property name="java.1.3.srcs" value="${buildsrc.1.3}" />
-  <property name="javasrcs" value="${java.1.4.srcs}:${java.1.3.srcs}" />
+  <property name="javasrcs" value="${java.1.4.srcs}" />
     
   <!-- More directories and files -->
   <property name="lib" value="./lib" />
@@ -189,33 +169,27 @@
            <exclude name=".project" />
            <exclude name=".settings" />
            <exclude name=".classpath" />
+           <!-- TODO: [2007-01-24 ptw] How could there be a .svn in a build 
dir? -->
            <exclude name=".svn" />
        </fileset>
     </delete>
-    <delete failonerror="false">
-       <fileset dir="${build.1.3}" >
-           <exclude name=".project" />
-           <exclude name=".settings" />
-           <exclude name=".classpath" />
-           <exclude name=".svn" />
-       </fileset>
+    <!-- FIXME: [2007-01-24 ptw] remove on next revision, this is just to 
clean up an obsolete dir -->
+    <delete includeemptydirs="true" failonerror="false">
+      <fileset dir="${build.1.3}" />
     </delete>
+    <!-- FIXME: [2007-01-24 ptw] remove on next revision, this is just to 
clean up an obsolete dir -->
+    <delete includeemptydirs="true" failonerror="false">
+      <fileset dir="${classes1.3}" />
+    </delete>
     <delete failonerror="false">
        <fileset dir="${build.1.4}" >
            <exclude name=".project" />
            <exclude name=".settings" />
            <exclude name=".classpath" />
+           <!-- TODO: [2007-01-24 ptw] How could there be a .svn in a build 
dir? -->
            <exclude name=".svn" />
        </fileset>
     </delete>
-    <delete failonerror="false">
-       <fileset dir="${classes1.3}" >
-           <exclude name=".project" />
-           <exclude name=".settings" />
-           <exclude name=".classpath" />
-           <exclude name=".svn" />
-       </fileset>
-    </delete>
     <delete dir="${lib}" failonerror="false" />
     <delete dir="${debug}" failonerror="false" />
     <delete dir="misc" failonerror="false" />
@@ -315,13 +289,6 @@
   </condition>
   <echo message="sc-parser.uptodate is ${sc-parser.uptodate}"/>
   
-  <uptodate property="sc-compiler.uptodate"
-       targetfile="${buildsrc.sc.1.3}/LFCCompiler.java">
-         <srcfiles dir="${sc.src.py}" includes="*.py" 
-                   excludes="test*.py,jsdoc2xml.py,xmldocutils.py"/>
-  </uptodate>      
-  <echo message="sc-compiler.uptodate is ${sc-compiler.uptodate}"/>
-  
   <uptodate property="server-javadoc.uptodate" 
targetfile="${javadoc}/index.html">
           <srcfiles dir="${src}" />
   </uptodate>
@@ -329,7 +296,6 @@
   <condition property="server.uptodate">
     <and>
         <istrue value="${sc-parser.uptodate}"/>
-        <istrue value="${sc-compiler.uptodate}"/>        
     </and>
   </condition>
       
@@ -367,33 +333,7 @@
       <fileset dir="${sc.src.java}/parser" includes="*.java"/>
     </copy>
   </target>
-  
-  <!--==============  Target [sc-compiler]  ===================-->
-  <target name="sc-compiler" depends="init" unless="sc-compiler.uptodate"
-      description="Run jythonc to create *.java files.">
 
-    <mkdir dir="${buildsrc.sc.1.3}"/>
-            <exec executable="${jython}" dir="${sc.src.py}" failonerror="true" 
>
-              <arg value="${LPS_HOME}/3rd-party/tools/jythonc/jythonc.py"/>
-              <arg line="--package org.openlaszlo.sc"/>
-              <arg line="--workdir ../${buildsrc.1.3}"/>
-              <arg value="--deep"/>
-              <arg line="--compiler NONE"/>
-              <arg value="LFCCompiler"/>
-            </exec>
-  </target>
-
-  <target name="test-jythonc" depends="init"
-          description="A target for quickly testing jythonc changes.">
-        <exec executable="${jython}" dir="${sc.src.py}" failonerror="true" >
-          <arg value="${LPS_HOME}/3rd-party/tools/jythonc/jythonc.py"/>
-          <arg line="--package org.openlaszlo.sc"/>
-          <arg line="--workdir ../${buildsrc.1.3}"/>
-          <arg line="--compiler NONE"/>
-          <arg value="Compiler"/>
-        </exec>
-  </target>
-
   <!--==============  Target [lps-xml]  ===================-->
   <target name="lps-xml" depends="init" unless="done-lps-xml"
           description="Create the lps.xml file" >
@@ -419,23 +359,10 @@
 
   <!--==============  Target [compile]  ===================-->
   <target name="compile" 
-      depends="init,lps-xml,css-parser,sc-parser,sc-compiler"
+      depends="init,lps-xml,css-parser,sc-parser"
       description="Compile java code and jar classes into ${build}">
 
     <javac classpathref="3rd.party.classpath"
-           srcdir="${java.1.3.srcs}"
-           destdir="${build}" debug="${build.debug}"
-           source="1.3"
-           nowarn="true"
-           >
-      <!-- 1.3 sources created by jython  -->
-      <include name="${pkg.sc}/**" />
-      <!-- not the jjt sources 
-            <exclude name="${pkg.sc.parser}/**" />
-      -->
-    </javac>
-
-    <javac classpathref="3rd.party.classpath"
            srcdir="${java.1.4.srcs}"
            destdir="${build}" debug="${build.debug}"
            source="1.4"

Deleted: openlaszlo/branches/legals/WEB-INF/lps/server/sc/LFCCompiler.py

Deleted: openlaszlo/branches/legals/WEB-INF/lps/server/sc/lzsc.py

Modified: 
openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/sc/CodeGenerator.java
===================================================================
--- 
openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/sc/CodeGenerator.java
      2007-01-24 18:21:35 UTC (rev 3512)
+++ 
openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/sc/CodeGenerator.java
      2007-01-24 18:43:45 UTC (rev 3513)
@@ -442,16 +442,6 @@
 //           if (value != null) {
 //             System.err.print( (new Compiler.ParseTreePrinter()).visit(node) 
+ ": " + value + "(" + value.getClass() + ")");
 //           }
-          if (value != null) {
-            if (value instanceof String &&
-                ("true".equalsIgnoreCase((String)value) ||
-                 "false".equalsIgnoreCase((String)value))) {
-              value = Boolean.valueOf((String)value);
-            } else if (value instanceof Integer) {
-              // Python crap
-              value = value.equals(new Integer(0)) ? Boolean.FALSE : 
Boolean.TRUE;
-            }
-          }
         }
       }
     }

Modified: 
openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/sc/Instructions.java
===================================================================
--- 
openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/sc/Instructions.java
       2007-01-24 18:21:35 UTC (rev 3512)
+++ 
openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/sc/Instructions.java
       2007-01-24 18:43:45 UTC (rev 3513)
@@ -795,14 +795,14 @@
 
     // Python interfaces
     public Instruction make(Object arg) {
-      assert arg instanceof Number || arg instanceof Value || arg instanceof 
String;
+      assert arg instanceof Number || arg instanceof Value || arg instanceof 
String || arg instanceof Boolean;
       return new PUSHInstruction(Collections.singletonList(arg));
     }
 
     public Instruction make(Object[] args) {
       for (Iterator i = this.args.iterator(); i.hasNext(); ) {
         Object arg = i.next();
-        assert arg instanceof Number || arg instanceof Value || arg instanceof 
String;
+        assert arg instanceof Number || arg instanceof Value || arg instanceof 
String || arg instanceof Boolean;
       }
       return new PUSHInstruction(Arrays.asList(args));
     }
@@ -916,6 +916,12 @@
             if (v instanceof ParameterizedValue) {
               bytes.put(((ParameterizedValue)v).value);
             }
+          } else if (o instanceof Boolean) {
+            Value v = ((Boolean)o).booleanValue() ? Values.True : Values.False;
+            bytes.put(v.type);
+            if (v instanceof ParameterizedValue) {
+              bytes.put(((ParameterizedValue)v).value);
+            }
           } else if (o instanceof String) {
             String s = (String)o;
             if (constants != null && constants.containsKey(s)) {
@@ -934,7 +940,7 @@
               bytes.put((byte)0);
             }
           } else {
-            throw new CompilerException("Unknown type for PUSH: " + o);
+            throw new CompilerException("Unknown type for PUSH: " + o + " (in 
args " + this.args + ")");
           }
         }
       } catch (UnsupportedEncodingException e) {

Modified: 
openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/sc/JavascriptGenerator.java
===================================================================
--- 
openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/sc/JavascriptGenerator.java
        2007-01-24 18:21:35 UTC (rev 3512)
+++ 
openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/sc/JavascriptGenerator.java
        2007-01-24 18:43:45 UTC (rev 3513)
@@ -1,24 +1,16 @@
 /* -*- mode: Java; c-basic-offset: 2; -*- */
 
-/***
+/**
+ * Javascript Generation
  *
- * JavascriptGenerator.java
- * Author: Oliver Steele, P T Withington
- * Description: JavaScript -> JavaScript translator
+ * @author [EMAIL PROTECTED]
+ * @author [EMAIL PROTECTED]
+ * @description: JavaScript -> JavaScript translator
+ *
+ * Transform the parse tree from ECMA ~4 to ECMA 3.  Includes
+ * analyzing constraint functions and generating their dependencies.
  */
 
-/* J_LZ_COPYRIGHT_BEGIN *******************************************************
-* Copyright 2006 Laszlo Systems, Inc.  All Rights Reserved.              *
-* Use is subject to license terms.                                            *
-* J_LZ_COPYRIGHT_END *********************************************************/
-
-//
-// Javascript Generation
-//
-
-// Transform the parse tree from ECMA ~4 to ECMA 3.  Includes
-// analyzing constraint functions and generating their dependencies.
-
 // TODO: [2006-01-25 ptw] Share this with the SWF Code generator, from
 // which this was derived.
 
@@ -255,16 +247,6 @@
 //           if (value != null) {
 //             + ": " + value + "(" + value.getClass() + ")");
 //           }
-          if (value != null) {
-            if (value instanceof String &&
-                ("true".equalsIgnoreCase((String)value) ||
-                 "false".equalsIgnoreCase((String)value))) {
-              value = Boolean.valueOf((String)value);
-            } else if (value instanceof Integer) {
-              // Python crap
-              value = value.equals(new Integer(0)) ? Boolean.FALSE : 
Boolean.TRUE;
-            }
-          }
         }
       }
     }
@@ -2237,3 +2219,9 @@
     return new JavascriptReference(this, node, referenceCount);
   }
 }
+
+/**
+ * @copyright Copyright 2006-2007 Laszlo Systems, Inc.  All Rights
+ * Reserved.  Use is subject to license terms.
+ */
+

Modified: 
openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/sc/Main.java
===================================================================
--- 
openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/sc/Main.java   
    2007-01-24 18:21:35 UTC (rev 3512)
+++ 
openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/sc/Main.java   
    2007-01-24 18:43:45 UTC (rev 3513)
@@ -7,7 +7,7 @@
 public class Main {
     public static void main(String args[])
     {
-        int status = new LFCCompiler().compile(args);
+        int status = new lzsc().compile(args);
         if (status != 0) {
           java.lang.System.exit(status);
         }
@@ -15,6 +15,6 @@
 }
 
 /* J_LZ_COPYRIGHT_BEGIN *******************************************************
-* Copyright 2001-2006 Laszlo Systems, Inc.  All Rights Reserved.              *
+* Copyright 2001-2007 Laszlo Systems, Inc.  All Rights Reserved.              *
 * Use is subject to license terms.                                            *
 * J_LZ_COPYRIGHT_END *********************************************************/

Copied: 
openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/sc/lzsc.java 
(from rev 3473, openlaszlo/branches/legals/WEB-INF/lps/server/sc/lzsc.py)


_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Reply via email to