lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [lucy-commits] svn commit: r1179379 - in /incubator/lucy/branches/clownfish_lemon/clownfish: src/CFCParseHeader.y t/105-object_type.t t/600-parser.t
Date Wed, 05 Oct 2011 18:53:20 GMT
Author: marvin
Date: Wed Oct  5 18:53:20 2011
New Revision: 1179379

URL: http://svn.apache.org/viewvc?rev=1179379&view=rev
Log:
Add support for type qualifiers to object types.

Modified:
    incubator/lucy/branches/clownfish_lemon/clownfish/src/CFCParseHeader.y
    incubator/lucy/branches/clownfish_lemon/clownfish/t/105-object_type.t
    incubator/lucy/branches/clownfish_lemon/clownfish/t/600-parser.t

Modified: incubator/lucy/branches/clownfish_lemon/clownfish/src/CFCParseHeader.y
URL: http://svn.apache.org/viewvc/incubator/lucy/branches/clownfish_lemon/clownfish/src/CFCParseHeader.y?rev=1179379&r1=1179378&r2=1179379&view=diff
==============================================================================
--- incubator/lucy/branches/clownfish_lemon/clownfish/src/CFCParseHeader.y (original)
+++ incubator/lucy/branches/clownfish_lemon/clownfish/src/CFCParseHeader.y Wed Oct  5 18:53:20
2011
@@ -90,9 +90,13 @@ void_type(A) ::= void_type_specifier.
 %type float_type_specifier          {const char*}
 %type integer_type_specifier        {const char*}
 %type object_type_specifier         {char*}
+%type type_qualifier                {int}
+%type type_qualifier_list           {int}
 %destructor float_type_specifier        { }
 %destructor integer_type_specifier      { }
 %destructor object_type_specifier       { FREEMEM($$); }
+%destructor type_qualifier              { }
+%destructor type_qualifier_list         { }
 
 void_type_specifier ::= VOID.
 va_list_specifier         ::= VA_LIST.
@@ -148,8 +152,24 @@ object_type(A) ::= object_type_specifier
     A = (CFCBase*)CFCType_new_object(0, CFCParser_get_parcel(), B, 1);
 }
 
+object_type(A) ::= type_qualifier_list(B) object_type_specifier(C) ASTERISK.
+{
+    A = (CFCBase*)CFCType_new_object(B, CFCParser_get_parcel(), C, 1);
+}
+
 object_type_specifier(A) ::= OBJECT_TYPE_SPECIFIER.
 {
     A = CFCUtil_strdup(CFCParser_current_state->text);
 }
 
+type_qualifier(A) ::= CONST.       { A = CFCTYPE_CONST; }
+type_qualifier(A) ::= NULLABLE.    { A = CFCTYPE_NULLABLE; }
+type_qualifier(A) ::= INCREMENTED. { A = CFCTYPE_INCREMENTED; }
+type_qualifier(A) ::= DECREMENTED. { A = CFCTYPE_DECREMENTED; }
+
+type_qualifier_list(A) ::= type_qualifier(B).               { A = B; }
+type_qualifier_list(A) ::= type_qualifier_list CONST.       { A |= CFCTYPE_CONST; }
+type_qualifier_list(A) ::= type_qualifier_list NULLABLE.    { A |= CFCTYPE_NULLABLE; }
+type_qualifier_list(A) ::= type_qualifier_list INCREMENTED. { A |= CFCTYPE_INCREMENTED; }
+type_qualifier_list(A) ::= type_qualifier_list DECREMENTED. { A |= CFCTYPE_DECREMENTED; }
+

Modified: incubator/lucy/branches/clownfish_lemon/clownfish/t/105-object_type.t
URL: http://svn.apache.org/viewvc/incubator/lucy/branches/clownfish_lemon/clownfish/t/105-object_type.t?rev=1179379&r1=1179378&r2=1179379&view=diff
==============================================================================
--- incubator/lucy/branches/clownfish_lemon/clownfish/t/105-object_type.t (original)
+++ incubator/lucy/branches/clownfish_lemon/clownfish/t/105-object_type.t Wed Oct  5 18:53:20
2011
@@ -49,11 +49,11 @@ for my $specifier (qw( Foo FooJr FooIII 
     ok( $type && $type->is_object, "$specifier*" );
     $type = $parser->parse("neato_$specifier*");
     ok( $type && $type->is_object, "neato_$specifier*" );
-    $type = $parser->object_type("const $specifier*");
+    $type = $parser->parse("const $specifier*");
     ok( $type && $type->is_object, "const $specifier*" );
-    $type = $parser->object_type("incremented $specifier*");
+    $type = $parser->parse("incremented $specifier*");
     ok( $type && $type->is_object, "incremented $specifier*" );
-    $type = $parser->object_type("decremented $specifier*");
+    $type = $parser->parse("decremented $specifier*");
     ok( $type && $type->is_object, "decremented $specifier*" );
 }
 

Modified: incubator/lucy/branches/clownfish_lemon/clownfish/t/600-parser.t
URL: http://svn.apache.org/viewvc/incubator/lucy/branches/clownfish_lemon/clownfish/t/600-parser.t?rev=1179379&r1=1179378&r2=1179379&view=diff
==============================================================================
--- incubator/lucy/branches/clownfish_lemon/clownfish/t/600-parser.t (original)
+++ incubator/lucy/branches/clownfish_lemon/clownfish/t/600-parser.t Wed Oct  5 18:53:20 2011
@@ -106,7 +106,7 @@ for my $composite (@composites) {
 
 my @object_types = ( 'Obj *', "incremented Foo*", "decremented CharBuf *" );
 for my $object_type (@object_types) {
-    my $parsed = $parser->object_type($object_type);
+    my $parsed = $parser->parse($object_type);
     ok( $parsed && $parsed->is_object, "object_type: $object_type" );
 }
 



Mime
View raw message