You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2011/10/19 03:30:16 UTC
[lucy-commits] svn commit: r1185941 - in
/incubator/lucy/branches/clownfish_lemon/clownfish/src: CFCParseHeader.y
CFCParser.c CFCParser.h
Author: marvin
Date: Wed Oct 19 01:30:16 2011
New Revision: 1185941
URL: http://svn.apache.org/viewvc?rev=1185941&view=rev
Log:
Use accessors rather than direct access for parser result.
Modified:
incubator/lucy/branches/clownfish_lemon/clownfish/src/CFCParseHeader.y
incubator/lucy/branches/clownfish_lemon/clownfish/src/CFCParser.c
incubator/lucy/branches/clownfish_lemon/clownfish/src/CFCParser.h
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=1185941&r1=1185940&r2=1185941&view=diff
==============================================================================
--- incubator/lucy/branches/clownfish_lemon/clownfish/src/CFCParseHeader.y (original)
+++ incubator/lucy/branches/clownfish_lemon/clownfish/src/CFCParseHeader.y Wed Oct 19 01:30:16 2011
@@ -61,13 +61,13 @@ static const char KW_DOUBLE[] = "doubl
}
/* Temporary. */
-result ::= type(A). { state->result = A; }
-result ::= param_list(A). { state->result = A; }
-result ::= param_variable(A). { state->result = A; }
-result ::= docucomment(A). { state->result = A; }
-result ::= parcel_definition(A). { state->result = A; }
-result ::= cblock(A). { state->result = A; }
-result ::= var_declaration_statement(A). { state->result = A; }
+result ::= type(A). { CFCParser_set_result(state, A); }
+result ::= param_list(A). { CFCParser_set_result(state, A); }
+result ::= param_variable(A). { CFCParser_set_result(state, A); }
+result ::= docucomment(A). { CFCParser_set_result(state, A); }
+result ::= parcel_definition(A). { CFCParser_set_result(state, A); }
+result ::= cblock(A). { CFCParser_set_result(state, A); }
+result ::= var_declaration_statement(A). { CFCParser_set_result(state, A); }
parcel_definition(A) ::= exposure_specifier(B) class_name(C) SEMICOLON.
{
Modified: incubator/lucy/branches/clownfish_lemon/clownfish/src/CFCParser.c
URL: http://svn.apache.org/viewvc/incubator/lucy/branches/clownfish_lemon/clownfish/src/CFCParser.c?rev=1185941&r1=1185940&r2=1185941&view=diff
==============================================================================
--- incubator/lucy/branches/clownfish_lemon/clownfish/src/CFCParser.c (original)
+++ incubator/lucy/branches/clownfish_lemon/clownfish/src/CFCParser.c Wed Oct 19 01:30:16 2011
@@ -94,6 +94,13 @@ CFCParser_parse(CFCParser *self, const c
}
void
+CFCParser_set_result(CFCParserState *self, CFCBase *result)
+{
+ CFCBase_decref(self->result);
+ self->result = CFCBase_incref(result);
+}
+
+void
CFCParser_set_text(CFCParserState *self, const char *text, size_t len) {
if (text) {
if (len >= self->cap) {
Modified: incubator/lucy/branches/clownfish_lemon/clownfish/src/CFCParser.h
URL: http://svn.apache.org/viewvc/incubator/lucy/branches/clownfish_lemon/clownfish/src/CFCParser.h?rev=1185941&r1=1185940&r2=1185941&view=diff
==============================================================================
--- incubator/lucy/branches/clownfish_lemon/clownfish/src/CFCParser.h (original)
+++ incubator/lucy/branches/clownfish_lemon/clownfish/src/CFCParser.h Wed Oct 19 01:30:16 2011
@@ -52,10 +52,13 @@ struct CFCBase*
CFCParser_parse(CFCParser *self, const char *string);
void
+CFCParser_set_result(CFCParserState *self, struct CFCBase *result);
+
+void
CFCParser_set_text(CFCParserState *self, const char *text, size_t len);
const char*
-CFCParser_get_text(CFCParserState *self);
+CFCParser_get_text(CFCParserState *state);
void
CFCParser_set_parcel(struct CFCParcel *parcel);