Author: leo
Date: Sun Sep 25 02:36:38 2005
New Revision: 9240

Modified:
   branches/leo-ctx5/docs/req/model_users.pod
   branches/leo-ctx5/languages/LANGUAGES.STATUS
   branches/leo-ctx5/languages/bc/grammar/bc_python.g
   branches/leo-ctx5/languages/bc/python/lib/bc/BcTreeWalker.py
   branches/leo-ctx5/languages/bc/t/basic.t
Log:
merge -r9233:9238 from trunk

Modified: branches/leo-ctx5/docs/req/model_users.pod
==============================================================================
--- branches/leo-ctx5/docs/req/model_users.pod  (original)
+++ branches/leo-ctx5/docs/req/model_users.pod  Sun Sep 25 02:36:38 2005
@@ -33,13 +33,19 @@ Autrijus has a favorite language, Perl 6
 
 Autrijus:
 
-* values speed, but not above all else
-* values interoperability of languages, especially with Perl 5
-* doesn't care about PBC particularly, though he knows his users
-  might, eventually
-* doesn't mind incompatible source changes, as long as the entire tool
-  chain still works after upgrading
+=over 4
 
+=item * values speed, but not above all else
+
+=item * values interoperability of languages, especially with Perl 5
+
+=item * doesn't care about PBC particularly, though he knows his users might,
+eventually
+
+=item * doesn't mind incompatible source changes, as long as the entire tool
+chain still works after upgrading
+
+=back
 
 =head2 "Nick": Ponie implementer
 
@@ -47,9 +53,13 @@ Nick is implementing Perl 5 with (over? 
 
 Nick:
 
-* doesn't care about dynamic loading of features
-* ???
+=over 4
+
+=item * doesn't care about dynamic loading of features
+
+=item * ???
 
+=back
 
 =head2 "Dick": Scripting an existing application
 
@@ -58,15 +68,21 @@ Parrot to get PIR and the languages that
 
 Dick:
 
-* cares mostly about ease and stability of embedding
-  (no memory leaks!  no seg faults!)
-* is probably not very sensitive to performance, since scripting
-  interfaces are never speed demons anyway
-* probably bundles a specific Parrot version (or linkage to a specific
-  version) and maybe precompiled pbcs with his program
-* may be more or less tolerant of changes depending on the system
-  into which Parrot is embedded
+=over 4
 
+=item * cares mostly about ease and stability of embedding (no memory leaks!
+no seg faults!)
+
+=item * is probably not very sensitive to performance, since scripting
+interfaces are never speed demons anyway
+
+=item * probably bundles a specific Parrot version (or linkage to a specific
+version) and maybe precompiled pbcs with his program
+
+=item * may be more or less tolerant of changes depending on the system into
+which Parrot is embedded
+
+=back
 
 =head2 "Tom": Embedded system creator
 
@@ -76,16 +92,22 @@ crucial.
 
 Tom:
 
-* cares mostly about stable long-term execution
-  (no memory leaks!  no seg faults!)
-* doesn't care about inter-version compatibility,
-  since he bundles Parrot with his product
-* doesn't care very much about performance
-* depends on PBC for space efficiency
-* wants to be able to strip down Parrot for deployment,
-  omitting subsystems that are large or which depend on
-  large external systems
+=over 4
+
+=item * cares mostly about stable long-term execution (no memory leaks!  no seg
+faults!)
 
+=item * doesn't care about inter-version compatibility, since he bundles Parrot
+with his product
+
+=item * doesn't care very much about performance
+
+=item * depends on PBC for space efficiency
+
+=item * wants to be able to strip down Parrot for deployment, omitting
+subsystems that are large or which depend on large external systems
+
+=back
 
 =head2 "Ilya": Intensive CPU User
 
@@ -94,11 +116,16 @@ data structure manipulation or floating 
 
 Ilya:
 
-* cares about performance to exclusion of most other factors
-* doesn't care about PBC one way or the other
-* can't handle incompatible source changes; is likely to pick
-  a favorite feature set and stick with it
+=over 4
+
+=item * cares about performance to exclusion of most other factors
 
+=item * doesn't care about PBC one way or the other
+
+=item * can't handle incompatible source changes; is likely to pick a favorite
+feature set and stick with it
+
+=back
 
 =head2 "Magpie": Lover of shiny things
 
@@ -108,10 +135,15 @@ it work, just so he can play with it.
 
 Magpie:
 
-* loves neat features
-* doesn't care about PBC, backwards compatibility, or any of the
-  things that make a platform stable and useful for users who
-  don't care about shiny tech
-* will put up with almost any change as long as the inconvenience
-  leads to something even more shiny
+=over 4
+
+=item * loves neat features
+
+=item * doesn't care about PBC, backwards compatibility, or any of the things
+that make a platform stable and useful for users who don't care about shiny
+tech
+
+=item * will put up with almost any change as long as the inconvenience leads
+to something even more shiny
 
+=back

Modified: branches/leo-ctx5/languages/LANGUAGES.STATUS
==============================================================================
--- branches/leo-ctx5/languages/LANGUAGES.STATUS        (original)
+++ branches/leo-ctx5/languages/LANGUAGES.STATUS        Sun Sep 25 02:36:38 2005
@@ -152,7 +152,9 @@ V: 0.0.11
 N: Pint
 A: Alan Knowles
 D: An experimental implementation of PHP
-W: http://devel.akbkhome.com/svn/index.php/PintCompiler/
+S: This project has been abandoned. Any takers?
+W: http://www.akbkhome.com/svn.php/PintCompiler
+W: 
http://www.akbkhome.com/blog.php/View/44/Latest_in_Vapourware_PintCompiler__dbdo.html
 
 N: Pugs
 A: Autrijus Tang

Modified: branches/leo-ctx5/languages/bc/grammar/bc_python.g
==============================================================================
--- branches/leo-ctx5/languages/bc/grammar/bc_python.g  (original)
+++ branches/leo-ctx5/languages/bc/grammar/bc_python.g  Sun Sep 25 02:36:38 2005
@@ -66,7 +66,7 @@ NEWLINE
 
 // String literals are everything in double quotes, no escaping
 STRING
-  : '"'!  ( ~'"' )* '"'!  
+  : '"'!  ( ~'"' )* '"'!    
   ;
 
 LETTER
@@ -480,9 +480,16 @@ relational_expr! returns[reg_name]
       } 
     | #( op:REL_OP reg_name_left=e2:expr reg_name_right=e3:expr ) 
       {
-        reg_name = "temp_int"
+        reg_name = "temp_int"    // this will be returned
+        pir_op_for_rel_op = { "<":  "islt",
+                              "<=": "isle",
+                              ">":  "isgt",
+                              ">=": "isge",
+                              "==": "iseq",
+                              "!=": "isne",
+                            }
         pir = "\n" + \
-              "temp_int = islt " + reg_name_left + ", " + reg_name_right + "\n 
#"
+              reg_name + " = " + pir_op_for_rel_op[op.getText()] + ' ' + 
reg_name_left + ", " + reg_name_right + "\n #"
         #relational_expr = #( [ PIR_NOOP, "noop" ], #e2, e3, [PIR_OP, pir] )
       }
   ;

Modified: branches/leo-ctx5/languages/bc/python/lib/bc/BcTreeWalker.py
==============================================================================
--- branches/leo-ctx5/languages/bc/python/lib/bc/BcTreeWalker.py        
(original)
+++ branches/leo-ctx5/languages/bc/python/lib/bc/BcTreeWalker.py        Sun Sep 
25 02:36:38 2005
@@ -853,9 +853,16 @@ class Walker(antlr.TreeParser):
                 _t = _t104
                 _t = _t.getNextSibling()
                 relational_expr_AST = currentAST.root
-                reg_name = "temp_int"
+                reg_name = "temp_int"    # this will be returned
+                pir_op_for_rel_op = { "<":  "islt",
+                                     "<=": "isle",
+                                     ">":  "isgt",
+                                     ">=": "isge",
+                                     "==": "iseq",
+                                     "!=": "isne",
+                                   }
                 pir = "\n" + \
-                     "temp_int = islt " + reg_name_left + ", " + 
reg_name_right + "\n #"
+                     reg_name + " = " + pir_op_for_rel_op[op.getText()] + ' ' 
+ reg_name_left + ", " + reg_name_right + "\n #"
                 relational_expr_AST = 
antlr.make(self.astFactory.create(PIR_NOOP,"noop"), e2_AST, e3_AST, 
self.astFactory.create(PIR_OP,pir))
                 currentAST.root = relational_expr_AST
                 if (relational_expr_AST != None) and 
(relational_expr_AST.getFirstChild() != None):

Modified: branches/leo-ctx5/languages/bc/t/basic.t
==============================================================================
--- branches/leo-ctx5/languages/bc/t/basic.t    (original)
+++ branches/leo-ctx5/languages/bc/t/basic.t    Sun Sep 25 02:36:38 2005
@@ -15,8 +15,8 @@ use strict;
 use FindBin;
 use lib "$FindBin::Bin/../../lib", "$FindBin::Bin/../../../../lib";
 
+use Parrot::Test tests => 72;
 use Test::More;
-use Parrot::Test tests => 54;
 
 sub run_tests
 {
@@ -108,22 +108,46 @@ my @tests = 
        # If 
        [ "1; if ( 1 ) 2; 3", [1,2,3], 'if with a true condition' ],
        [ "1; if ( 0 ) 2; 3", [1,3], 'if with a true condition' ],
-       [ "1; if ( 1 < 2 ) 2; 3", [1,2,3] ],
+       [ "1; if ( 1 < 2 ) 2; 3", [1, 2, 3], 'if with a relational operator' ],
+       # If with '<'
+       [ "1; if ( 3 + 4 < 8*2 - 10 ) 2; 3", [1, 3] ],
+       [ "1; if ( 3 + 4 < 8*2 - 9 ) 2; 3", [1, 3] ],
+       [ "1; if ( 3 + 4 < 8*2 + 10 ) 2; 3", [1, 2, 3] ],
+       # If with '<='
+       [ "1; if ( 3 + 4 <= 8*2 - 10 ) 2; 3", [1, 3] ],
+       [ "1; if ( 3 + 4 <= 8*2 - 9 ) 2; 3", [1, 2, 3] ],
+       [ "1; if ( 3 + 4 <= 8*2 + 10 ) 2; 3", [1, 2, 3] ],
+       # If with '==', still TODO
+       # If with '!='
+       [ "1; if ( 3 + 4 != 8*2 - 10 ) 2; 3", [1, 2, 3] ],
+       [ "1; if ( 3 + 4 != 8*2 - 9 ) 2; 3", [1, 3] ],
+       [ "1; if ( 3 + 4 != 8*2 + 10 ) 2; 3", [1, 2, 3] ],
+       # If with '>='
+       [ "1; if ( 3 + 4 >= 8*2 - 10 ) 2; 3", [1, 2, 3] ],
+       [ "1; if ( 3 + 4 >= 8*2 - 9 ) 2; 3", [1, 2, 3] ],
+       [ "1; if ( 3 + 4 >= 8*2 + 10 ) 2; 3", [1, 3] ],
+       # If with '>'
+       [ "1; if ( 3 + 4 > 8*2 - 10 ) 2; 3", [1, 2, 3] ],
+       [ "1; if ( 3 + 4 > 8*2 - 9 ) 2; 3", [1, 3] ],
+       [ "1; if ( 3 + 4 > 8*2 + 10 ) 2; 3", [1, 3] ],
      );
 
-my @todo_tests = 
+run_tests( [EMAIL PROTECTED] );
+
+TODO:
+{
+  local $TODO = 'not implemented';
+  my @todo_tests = 
      ( # floats
        [ '.1', '.1', 'Parrot bc says 0.1' ],
        [ '-.1', '-.1', 'Parrot bc says -0.1'],
        [ '-1.0000001', '-1.0000001', 'propably limited precission of Float 
PMC' ],
        # keyword quit
        [ "0\n1; 2; quit;  3", [ 0 ], 'is that correct in GNU bc?' ],
+       # If with '==', propable not correctly parsed
+       [ "1; if ( 3 + 4 == 8*2 - 10 ) 2; 3", [1, 3], 'strange ==' ],
+       [ "1; if ( 3 + 4 == 8*2 - 9 ) 2; 3", [1, 2, 3], 'strange ==' ],
+       [ "1; if ( 3 + 4 == 8*2 + 10 ) 2; 3", [1, 3], 'strange ==' ],
      );
-
-run_tests( [EMAIL PROTECTED] );
-
-TODO:
-{
-  local $TODO = 'not implemented';
   run_tests( [EMAIL PROTECTED] );
-} 
+}; 

Reply via email to