You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2014/04/23 16:43:14 UTC
[lucy-commits] [2/3] git commit: Global rename of "cnick" to "nickname"
Global rename of "cnick" to "nickname"
Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/d0486854
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/d0486854
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/d0486854
Branch: refs/heads/master
Commit: d048685452bf87b89ac0b1c218575b5bf1526b86
Parents: b7d53da
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Wed Apr 23 16:23:53 2014 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Wed Apr 23 16:23:53 2014 +0200
----------------------------------------------------------------------
compiler/perl/lib/Clownfish.pod | 10 +-
compiler/perl/lib/Clownfish/CFC.pm | 79 +++++-----
compiler/perl/lib/Clownfish/CFC.xs | 148 ++++++++++---------
compiler/perl/t/051-symbol.t | 3 +-
compiler/perl/t/200-function.t | 14 +-
compiler/perl/t/201-method.t | 20 +--
compiler/perl/t/202-overridden_method.t | 18 +--
compiler/perl/t/203-final_method.t | 12 +-
compiler/perl/t/300-variable.t | 10 +-
compiler/perl/t/401-class.t | 6 +-
compiler/perl/t/403-parcel.t | 8 +-
compiler/perl/t/600-parser.t | 18 +--
compiler/src/CFCClass.c | 23 +--
compiler/src/CFCClass.h | 8 +-
compiler/src/CFCFunction.c | 8 +-
compiler/src/CFCFunction.h | 6 +-
compiler/src/CFCLexHeader.c | 82 +++++-----
compiler/src/CFCLexHeader.h | 33 +++--
compiler/src/CFCLexHeader.l | 2 +-
compiler/src/CFCMethod.c | 50 +++----
compiler/src/CFCMethod.h | 8 +-
compiler/src/CFCParcel.c | 65 ++++----
compiler/src/CFCParcel.h | 6 +-
compiler/src/CFCParseHeader.y | 102 ++++++-------
compiler/src/CFCParser.c | 34 ++---
compiler/src/CFCParser.h | 4 +-
compiler/src/CFCSymbol.c | 56 +++----
compiler/src/CFCSymbol.h | 13 +-
compiler/src/CFCTestClass.c | 4 +-
compiler/src/CFCTestFunction.c | 2 +-
compiler/src/CFCTestMethod.c | 2 +-
compiler/src/CFCTestParser.c | 12 +-
compiler/src/CFCTestSymbol.c | 6 +-
compiler/src/CFCVariable.c | 8 +-
compiler/src/CFCVariable.h | 6 +-
runtime/core/Clownfish/ByteBuf.cfh | 4 +-
runtime/core/Clownfish/CharBuf.cfh | 2 +-
runtime/core/Clownfish/LockFreeRegistry.cfh | 2 +-
runtime/core/Clownfish/Num.cfh | 6 +-
runtime/core/Clownfish/String.cfh | 8 +-
runtime/core/Clownfish/Test/TestByteBuf.cfh | 2 +-
runtime/core/Clownfish/Test/TestCharBuf.cfh | 2 +-
.../Clownfish/Test/TestLockFreeRegistry.cfh | 2 +-
runtime/core/Clownfish/Test/TestString.cfh | 2 +-
.../Clownfish/Test/Util/TestNumberUtils.cfh | 2 +-
.../Clownfish/Test/Util/TestStringHelper.cfh | 2 +-
runtime/core/Clownfish/Util/NumberUtils.cfh | 2 +-
runtime/core/Clownfish/Util/SortUtils.cfh | 2 +-
runtime/core/Clownfish/Util/StringHelper.cfh | 2 +-
runtime/core/Clownfish/VArray.cfh | 2 +-
runtime/perl/lib/Clownfish.pod | 8 +-
51 files changed, 487 insertions(+), 449 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/d0486854/compiler/perl/lib/Clownfish.pod
----------------------------------------------------------------------
diff --git a/compiler/perl/lib/Clownfish.pod b/compiler/perl/lib/Clownfish.pod
index 6e86f9e..cdc52be 100644
--- a/compiler/perl/lib/Clownfish.pod
+++ b/compiler/perl/lib/Clownfish.pod
@@ -101,7 +101,7 @@ Boat_capsize() is a function, Boat_Capsize() is a method.
=head2 Class declaration syntax
- [final] [inert] class CLASSNAME [cnick CNICK] [inherits PARENT] {
+ [final] [inert] class CLASSNAME [nickname NICKNAME] [inherits PARENT] {
[declarations]
@@ -109,7 +109,7 @@ Boat_capsize() is a function, Boat_Capsize() is a method.
Example:
- class Boat::RubberDinghy cnick RubDing inherits Boat {
+ class Boat::RubberDinghy nickname RubDing inherits Boat {
public inert incremented RubberDinghy*
new();
@@ -123,7 +123,7 @@ Example:
=item * B<CLASSNAME> - The name of this class. The last string of characters
will be used as the object's C struct name.
-=item * B<CNICK> - A recognizable abbreviation of the class name, used as a
+=item * B<NICKNAME> - A recognizable abbreviation of the class name, used as a
prefix for every function and method.
=item * B<PARENT> - The full name of the parent class.
@@ -143,10 +143,10 @@ Clownfish classes intended to be published as a single unit may be grouped
together using a "parcel". Parcel directives need to go at the top of each
class file.
- parcel Crustacean cnick Crust;
+ parcel Crustacean nickname Crust;
All symbols generated by Clownfish for classes within a parcel will be
-prefixed by varying capitalizations of the parcel's C-nickname or "cnick" in
+prefixed by varying capitalizations of the parcel's C-nickname in
order to avoid namespace collisions with other projects.
Within a parcel, the last part of each class name must be unique.
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/d0486854/compiler/perl/lib/Clownfish/CFC.pm
----------------------------------------------------------------------
diff --git a/compiler/perl/lib/Clownfish/CFC.pm b/compiler/perl/lib/Clownfish/CFC.pm
index 2f8c200..5034e85 100644
--- a/compiler/perl/lib/Clownfish/CFC.pm
+++ b/compiler/perl/lib/Clownfish/CFC.pm
@@ -116,7 +116,7 @@ BEGIN { XSLoader::load( 'Clownfish::CFC', '0.01' ) }
our %create_PARAMS = (
file_spec => undef,
class_name => undef,
- cnick => undef,
+ nickname => undef,
parent_class_name => undef,
docucomment => undef,
inert => undef,
@@ -154,7 +154,7 @@ BEGIN { XSLoader::load( 'Clownfish::CFC', '0.01' ) }
= Clownfish::CFC::Model::Parcel->acquire( $args{parcel} );
return _create(
@args{
- qw( parcel exposure class_name cnick micro_sym docucomment
+ qw( parcel exposure class_name nickname micro_sym docucomment
file_spec parent_class_name final inert)
}
);
@@ -212,15 +212,15 @@ BEGIN { XSLoader::load( 'Clownfish::CFC', '0.01' ) }
use Clownfish::CFC::Util qw( verify_args a_isa_b );
my %new_PARAMS = (
- return_type => undef,
- class_name => undef,
- class_cnick => undef,
- param_list => undef,
- micro_sym => undef,
- docucomment => undef,
- parcel => undef,
- inline => undef,
- exposure => undef,
+ return_type => undef,
+ class_name => undef,
+ class_nickname => undef,
+ param_list => undef,
+ micro_sym => undef,
+ docucomment => undef,
+ parcel => undef,
+ inline => undef,
+ exposure => undef,
);
sub new {
@@ -232,7 +232,7 @@ BEGIN { XSLoader::load( 'Clownfish::CFC', '0.01' ) }
= Clownfish::CFC::Model::Parcel->acquire( $args{parcel} );
return _new(
@args{
- qw( parcel exposure class_name class_cnick micro_sym
+ qw( parcel exposure class_name class_nickname micro_sym
return_type param_list docucomment inline )
}
);
@@ -264,16 +264,16 @@ BEGIN { XSLoader::load( 'Clownfish::CFC', '0.01' ) }
use Carp;
my %new_PARAMS = (
- return_type => undef,
- class_name => undef,
- class_cnick => undef,
- param_list => undef,
- macro_sym => undef,
- docucomment => undef,
- parcel => undef,
- abstract => undef,
- final => undef,
- exposure => 'parcel',
+ return_type => undef,
+ class_name => undef,
+ class_nickname => undef,
+ param_list => undef,
+ macro_sym => undef,
+ docucomment => undef,
+ parcel => undef,
+ abstract => undef,
+ final => undef,
+ exposure => 'parcel',
);
sub new {
@@ -286,7 +286,7 @@ BEGIN { XSLoader::load( 'Clownfish::CFC', '0.01' ) }
$args{final} ||= 0;
return _new(
@args{
- qw( parcel exposure class_name class_cnick macro_sym
+ qw( parcel exposure class_name class_nickname macro_sym
return_type param_list docucomment final abstract )
}
);
@@ -319,7 +319,7 @@ BEGIN { XSLoader::load( 'Clownfish::CFC', '0.01' ) }
our %new_PARAMS = (
name => undef,
- cnick => undef,
+ nickname => undef,
version => undef,
is_included => undef,
);
@@ -328,7 +328,7 @@ BEGIN { XSLoader::load( 'Clownfish::CFC', '0.01' ) }
my ( $either, %args ) = @_;
verify_args( \%new_PARAMS, %args ) or confess $@;
confess "no subclassing allowed" unless $either eq __PACKAGE__;
- return _new( @args{qw( name cnick version is_included )} );
+ return _new( @args{qw( name nickname version is_included )} );
}
our %new_from_json_PARAMS = (
@@ -419,11 +419,11 @@ BEGIN { XSLoader::load( 'Clownfish::CFC', '0.01' ) }
use Carp;
my %new_PARAMS = (
- parcel => undef,
- exposure => undef,
- class_name => undef,
- class_cnick => undef,
- micro_sym => undef,
+ parcel => undef,
+ exposure => undef,
+ class_name => undef,
+ class_nickname => undef,
+ micro_sym => undef,
);
sub new {
@@ -433,7 +433,7 @@ BEGIN { XSLoader::load( 'Clownfish::CFC', '0.01' ) }
$args{parcel}
= Clownfish::CFC::Model::Parcel->acquire( $args{parcel} );
return _new(
- @args{qw( parcel exposure class_name class_cnick micro_sym )} );
+ @args{qw( parcel exposure class_name class_nickname micro_sym )} );
}
}
@@ -601,13 +601,13 @@ BEGIN { XSLoader::load( 'Clownfish::CFC', '0.01' ) }
use Carp;
our %new_PARAMS = (
- type => undef,
- micro_sym => undef,
- parcel => undef,
- exposure => 'local',
- class_name => undef,
- class_cnick => undef,
- inert => undef,
+ type => undef,
+ micro_sym => undef,
+ parcel => undef,
+ exposure => 'local',
+ class_name => undef,
+ class_nickname => undef,
+ inert => undef,
);
sub new {
@@ -619,7 +619,8 @@ BEGIN { XSLoader::load( 'Clownfish::CFC', '0.01' ) }
= Clownfish::CFC::Model::Parcel->acquire( $args{parcel} );
return _new(
@args{
- qw( parcel exposure class_name class_cnick micro_sym type inert )
+ qw( parcel exposure class_name class_nickname micro_sym type
+ inert )
}
);
}
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/d0486854/compiler/perl/lib/Clownfish/CFC.xs
----------------------------------------------------------------------
diff --git a/compiler/perl/lib/Clownfish/CFC.xs b/compiler/perl/lib/Clownfish/CFC.xs
index 2725f79..bc9ee4c 100644
--- a/compiler/perl/lib/Clownfish/CFC.xs
+++ b/compiler/perl/lib/Clownfish/CFC.xs
@@ -155,11 +155,11 @@ PPCODE:
MODULE = Clownfish::CFC PACKAGE = Clownfish::CFC::Model::Class
SV*
-_create(parcel, exposure_sv, class_name_sv, cnick_sv, micro_sym_sv, docucomment, file_spec, parent_class_name_sv, is_final, is_inert)
+_create(parcel, exposure_sv, class_name_sv, class_nickname_sv, micro_sym_sv, docucomment, file_spec, parent_class_name_sv, is_final, is_inert)
CFCParcel *parcel;
SV *exposure_sv;
SV *class_name_sv;
- SV *cnick_sv;
+ SV *class_nickname_sv;
SV *micro_sym_sv;
CFCDocuComment *docucomment;
CFCFileSpec *file_spec;
@@ -171,15 +171,16 @@ CODE:
SvOK(exposure_sv) ? SvPV_nolen(exposure_sv) : NULL;
const char *class_name =
SvOK(class_name_sv) ? SvPV_nolen(class_name_sv) : NULL;
- const char *cnick =
- SvOK(cnick_sv) ? SvPV_nolen(cnick_sv) : NULL;
+ const char *class_nickname =
+ SvOK(class_nickname_sv) ? SvPV_nolen(class_nickname_sv) : NULL;
const char *micro_sym =
SvOK(micro_sym_sv) ? SvPV_nolen(micro_sym_sv) : NULL;
const char *parent_class_name =
SvOK(parent_class_name_sv) ? SvPV_nolen(parent_class_name_sv) : NULL;
- CFCClass *self = CFCClass_create(parcel, exposure, class_name, cnick,
- micro_sym, docucomment, file_spec,
- parent_class_name, is_final, is_inert);
+ CFCClass *self
+ = CFCClass_create(parcel, exposure, class_name, class_nickname,
+ micro_sym, docucomment, file_spec, parent_class_name,
+ is_final, is_inert);
RETVAL = S_cfcbase_to_perlref(self);
CFCBase_decref((CFCBase*)self);
OUTPUT: RETVAL
@@ -277,7 +278,7 @@ void
_set_or_get(self, ...)
CFCClass *self;
ALIAS:
- get_cnick = 2
+ get_nickname = 2
set_parent = 5
get_parent = 6
get_path_part = 10
@@ -304,7 +305,7 @@ PPCODE:
{
START_SET_OR_GET_SWITCH
case 2: {
- const char *value = CFCClass_get_cnick(self);
+ const char *value = CFCClass_get_nickname(self);
retval = newSVpvn(value, strlen(value));
}
break;
@@ -637,11 +638,11 @@ PPCODE:
MODULE = Clownfish::CFC PACKAGE = Clownfish::CFC::Model::Function
SV*
-_new(parcel, exposure_sv, class_name_sv, class_cnick_sv, micro_sym_sv, return_type, param_list, docucomment, is_inline)
+_new(parcel, exposure_sv, class_name_sv, class_nickname_sv, micro_sym_sv, return_type, param_list, docucomment, is_inline)
CFCParcel *parcel;
SV *exposure_sv;
SV *class_name_sv;
- SV *class_cnick_sv;
+ SV *class_nickname_sv;
SV *micro_sym_sv;
CFCType *return_type;
CFCParamList *param_list;
@@ -652,13 +653,14 @@ CODE:
SvOK(exposure_sv) ? SvPV_nolen(exposure_sv) : NULL;
const char *class_name =
SvOK(class_name_sv) ? SvPV_nolen(class_name_sv) : NULL;
- const char *class_cnick =
- SvOK(class_cnick_sv) ? SvPV_nolen(class_cnick_sv) : NULL;
+ const char *class_nickname =
+ SvOK(class_nickname_sv) ? SvPV_nolen(class_nickname_sv) : NULL;
const char *micro_sym =
SvOK(micro_sym_sv) ? SvPV_nolen(micro_sym_sv) : NULL;
- CFCFunction *self = CFCFunction_new(parcel, exposure, class_name,
- class_cnick, micro_sym, return_type,
- param_list, docucomment, is_inline);
+ CFCFunction *self
+ = CFCFunction_new(parcel, exposure, class_name, class_nickname,
+ micro_sym, return_type, param_list, docucomment,
+ is_inline);
RETVAL = S_cfcbase_to_perlref(self);
CFCBase_decref((CFCBase*)self);
OUTPUT: RETVAL
@@ -813,11 +815,11 @@ PPCODE:
MODULE = Clownfish::CFC PACKAGE = Clownfish::CFC::Model::Method
SV*
-_new(parcel, exposure_sv, class_name_sv, class_cnick_sv, macro_sym, return_type, param_list, docucomment, is_final, is_abstract)
+_new(parcel, exposure_sv, class_name_sv, class_nickname_sv, macro_sym, return_type, param_list, docucomment, is_final, is_abstract)
CFCParcel *parcel;
SV *exposure_sv;
SV *class_name_sv;
- SV *class_cnick_sv;
+ SV *class_nickname_sv;
const char *macro_sym;
CFCType *return_type;
CFCParamList *param_list;
@@ -829,11 +831,12 @@ CODE:
SvOK(exposure_sv) ? SvPV_nolen(exposure_sv) : NULL;
const char *class_name =
SvOK(class_name_sv) ? SvPV_nolen(class_name_sv) : NULL;
- const char *class_cnick =
- SvOK(class_cnick_sv) ? SvPV_nolen(class_cnick_sv) : NULL;
- CFCMethod *self = CFCMethod_new(parcel, exposure, class_name, class_cnick,
- macro_sym, return_type, param_list,
- docucomment, is_final, is_abstract);
+ const char *class_nickname =
+ SvOK(class_nickname_sv) ? SvPV_nolen(class_nickname_sv) : NULL;
+ CFCMethod *self
+ = CFCMethod_new(parcel, exposure, class_name, class_nickname,
+ macro_sym, return_type, param_list, docucomment,
+ is_final, is_abstract);
RETVAL = S_cfcbase_to_perlref(self);
CFCBase_decref((CFCBase*)self);
OUTPUT: RETVAL
@@ -1058,15 +1061,15 @@ PPCODE:
MODULE = Clownfish::CFC PACKAGE = Clownfish::CFC::Model::Parcel
SV*
-_new(name_sv, cnick_sv, version, is_included)
+_new(name_sv, nickname_sv, version, is_included)
SV *name_sv;
- SV *cnick_sv;
+ SV *nickname_sv;
CFCVersion *version;
bool is_included;
CODE:
- const char *name = SvOK(name_sv) ? SvPV_nolen(name_sv) : NULL;
- const char *cnick = SvOK(cnick_sv) ? SvPV_nolen(cnick_sv) : NULL;
- CFCParcel *self = CFCParcel_new(name, cnick, version, is_included);
+ const char *name = SvOK(name_sv) ? SvPV_nolen(name_sv) : NULL;
+ const char *nickname = SvOK(nickname_sv) ? SvPV_nolen(nickname_sv) : NULL;
+ CFCParcel *self = CFCParcel_new(name, nickname, version, is_included);
RETVAL = S_cfcbase_to_perlref(self);
CFCBase_decref((CFCBase*)self);
OUTPUT: RETVAL
@@ -1173,7 +1176,7 @@ _set_or_get(self, ...)
CFCParcel *self;
ALIAS:
get_name = 2
- get_cnick = 4
+ get_nickname = 4
get_prefix = 6
get_Prefix = 8
get_PREFIX = 10
@@ -1192,8 +1195,8 @@ PPCODE:
}
break;
case 4: {
- const char *cnick = CFCParcel_get_cnick(self);
- retval = newSVpvn(cnick, strlen(cnick));
+ const char *nickname = CFCParcel_get_nickname(self);
+ retval = newSVpvn(nickname, strlen(nickname));
}
break;
case 6: {
@@ -1282,24 +1285,25 @@ PPCODE:
MODULE = Clownfish::CFC PACKAGE = Clownfish::CFC::Model::Symbol
SV*
-_new(parcel, exposure, class_name_sv, class_cnick_sv, micro_sym_sv)
+_new(parcel, exposure, class_name_sv, class_nickname_sv, micro_sym_sv)
CFCParcel *parcel;
const char *exposure;
SV *class_name_sv;
- SV *class_cnick_sv;
+ SV *class_nickname_sv;
SV *micro_sym_sv;
CODE:
- const char *class_name = SvOK(class_name_sv)
- ? SvPV_nolen(class_name_sv)
- : NULL;
- const char *class_cnick = SvOK(class_cnick_sv)
- ? SvPV_nolen(class_cnick_sv)
- : NULL;
+ const char *class_name = SvOK(class_name_sv)
+ ? SvPV_nolen(class_name_sv)
+ : NULL;
+ const char *class_nickname = SvOK(class_nickname_sv)
+ ? SvPV_nolen(class_nickname_sv)
+ : NULL;
const char *micro_sym = SvOK(micro_sym_sv)
? SvPV_nolen(micro_sym_sv)
: NULL;
- CFCSymbol *self = CFCSymbol_new(parcel, exposure, class_name, class_cnick,
- micro_sym);
+ CFCSymbol *self
+ = CFCSymbol_new(parcel, exposure, class_name, class_nickname,
+ micro_sym);
RETVAL = S_cfcbase_to_perlref(self);
CFCBase_decref((CFCBase*)self);
OUTPUT: RETVAL
@@ -1316,20 +1320,20 @@ void
_set_or_get(self, ...)
CFCSymbol *self;
ALIAS:
- get_parcel = 2
- get_class_name = 4
- get_class_cnick = 6
- get_exposure = 8
- micro_sym = 10
- get_prefix = 12
- get_Prefix = 14
- get_PREFIX = 16
- public = 18
- private = 20
- parcel = 22
- local = 24
- short_sym = 26
- full_sym = 28
+ get_parcel = 2
+ get_class_name = 4
+ get_class_nickname = 6
+ get_exposure = 8
+ micro_sym = 10
+ get_prefix = 12
+ get_Prefix = 14
+ get_PREFIX = 16
+ public = 18
+ private = 20
+ parcel = 22
+ local = 24
+ short_sym = 26
+ full_sym = 28
PPCODE:
{
START_SET_OR_GET_SWITCH
@@ -1346,9 +1350,10 @@ PPCODE:
}
break;
case 6: {
- const char *class_cnick = CFCSymbol_get_class_cnick(self);
- retval = class_cnick
- ? newSVpvn(class_cnick, strlen(class_cnick))
+ const char *class_nickname
+ = CFCSymbol_get_class_nickname(self);
+ retval = class_nickname
+ ? newSVpvn(class_nickname, strlen(class_nickname))
: newSV(0);
}
break;
@@ -1778,21 +1783,21 @@ OUTPUT: RETVAL
MODULE = Clownfish::CFC PACKAGE = Clownfish::CFC::Model::Variable
SV*
-_new(parcel, exposure, class_name_sv, class_cnick_sv, micro_sym_sv, type_sv, inert_sv)
+_new(parcel, exposure, class_name_sv, class_nickname_sv, micro_sym_sv, type_sv, inert_sv)
CFCParcel *parcel;
const char *exposure;
SV *class_name_sv;
- SV *class_cnick_sv;
+ SV *class_nickname_sv;
SV *micro_sym_sv;
SV *type_sv;
SV *inert_sv;
CODE:
- const char *class_name = SvOK(class_name_sv)
- ? SvPV_nolen(class_name_sv)
- : NULL;
- const char *class_cnick = SvOK(class_cnick_sv)
- ? SvPV_nolen(class_cnick_sv)
- : NULL;
+ const char *class_name = SvOK(class_name_sv)
+ ? SvPV_nolen(class_name_sv)
+ : NULL;
+ const char *class_nickname = SvOK(class_nickname_sv)
+ ? SvPV_nolen(class_nickname_sv)
+ : NULL;
const char *micro_sym = SvOK(micro_sym_sv)
? SvPV_nolen(micro_sym_sv)
: NULL;
@@ -1806,8 +1811,9 @@ CODE:
else {
croak("Param 'type' is not a Clownfish::CFC::Model::Type");
}
- CFCVariable *self = CFCVariable_new(parcel, exposure, class_name,
- class_cnick, micro_sym, type, inert);
+ CFCVariable *self
+ = CFCVariable_new(parcel, exposure, class_name, class_nickname,
+ micro_sym, type, inert);
RETVAL = S_cfcbase_to_perlref(self);
CFCBase_decref((CFCBase*)self);
OUTPUT: RETVAL
@@ -2557,11 +2563,11 @@ PPCODE:
CFCParser_set_class_name(self, class_name);
void
-set_class_cnick(self, class_cnick)
+set_class_nickname(self, class_nickname)
CFCParser *self;
- const char *class_cnick;
+ const char *class_nickname;
PPCODE:
- CFCParser_set_class_cnick(self, class_cnick);
+ CFCParser_set_class_nickname(self, class_nickname);
SV*
get_parcel(self)
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/d0486854/compiler/perl/t/051-symbol.t
----------------------------------------------------------------------
diff --git a/compiler/perl/t/051-symbol.t b/compiler/perl/t/051-symbol.t
index 70d9f0e..0cd14df 100644
--- a/compiler/perl/t/051-symbol.t
+++ b/compiler/perl/t/051-symbol.t
@@ -41,7 +41,8 @@ my $foo = new_symbol( class_name => 'Foo' );
my $foo_jr = new_symbol( class_name => 'Foo::FooJr' );
ok( !$foo->equals($foo_jr), "different class_name spoils equals" );
is( $foo_jr->get_class_name, "Foo::FooJr", "get_class_name" );
-is( $foo_jr->get_class_cnick, "FooJr", "derive class_cnick from class_name" );
+is( $foo_jr->get_class_nickname, "FooJr",
+ "derive class_nickname from class_name" );
my $public_exposure = new_symbol( exposure => 'public' );
my $parcel_exposure = new_symbol( exposure => 'parcel' );
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/d0486854/compiler/perl/t/200-function.t
----------------------------------------------------------------------
diff --git a/compiler/perl/t/200-function.t b/compiler/perl/t/200-function.t
index 2bedb1d..d52ddc8 100644
--- a/compiler/perl/t/200-function.t
+++ b/compiler/perl/t/200-function.t
@@ -27,12 +27,12 @@ $parser->parse('parcel Neato;')
or die "failed to process parcel_definition";
my %args = (
- parcel => 'Neato',
- return_type => $parser->parse('Obj*'),
- class_name => 'Neato::Foo',
- class_cnick => 'Foo',
- param_list => $parser->parse('(int32_t some_num)'),
- micro_sym => 'return_an_obj',
+ parcel => 'Neato',
+ return_type => $parser->parse('Obj*'),
+ class_name => 'Neato::Foo',
+ class_nickname => 'Foo',
+ param_list => $parser->parse('(int32_t some_num)'),
+ micro_sym => 'return_an_obj',
);
my $func = Clownfish::CFC::Model::Function->new(%args);
@@ -48,7 +48,7 @@ eval { Clownfish::CFC::Model::Function->new( %args, micro_sym => 'Uh_Oh' ); };
like( $@, qr/Uh_Oh/, "invalid micro_sym kills constructor" );
$parser->set_class_name("Neato::Obj");
-$parser->set_class_cnick("Obj");
+$parser->set_class_nickname("Obj");
isa_ok(
$parser->parse($_),
"Clownfish::CFC::Model::Function",
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/d0486854/compiler/perl/t/201-method.t
----------------------------------------------------------------------
diff --git a/compiler/perl/t/201-method.t b/compiler/perl/t/201-method.t
index 32b02b0..260f58f 100644
--- a/compiler/perl/t/201-method.t
+++ b/compiler/perl/t/201-method.t
@@ -26,12 +26,12 @@ $parser->parse('parcel Neato;')
or die "failed to process parcel_definition";
my %args = (
- parcel => 'Neato',
- return_type => $parser->parse('Obj*'),
- class_name => 'Neato::Foo',
- class_cnick => 'Foo',
- param_list => $parser->parse('(Foo *self, int32_t count = 0)'),
- macro_sym => 'Return_An_Obj',
+ parcel => 'Neato',
+ return_type => $parser->parse('Obj*'),
+ class_name => 'Neato::Foo',
+ class_nickname => 'Foo',
+ param_list => $parser->parse('(Foo *self, int32_t count = 0)'),
+ macro_sym => 'Return_An_Obj',
);
my $method = Clownfish::CFC::Model::Method->new(%args);
@@ -97,9 +97,9 @@ ok( !$param_type_differs->compatible($method), "... reversed" );
my $self_type_differs = Clownfish::CFC::Model::Method->new(
%args,
- class_name => 'Neato::Bar',
- class_cnick => 'Bar',
- param_list => $parser->parse('(Bar *self, int32_t count = 0)'),
+ class_name => 'Neato::Bar',
+ class_nickname => 'Bar',
+ param_list => $parser->parse('(Bar *self, int32_t count = 0)'),
);
ok( $method->compatible($self_type_differs),
"different self type still compatible(), since can't test inheritance" );
@@ -119,7 +119,7 @@ for my $meth_meth (qw( short_method_sym full_method_sym full_offset_sym)) {
}
$parser->set_class_name("Neato::Obj");
-$parser->set_class_cnick("Obj");
+$parser->set_class_nickname("Obj");
isa_ok(
$parser->parse($_),
"Clownfish::CFC::Model::Method",
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/d0486854/compiler/perl/t/202-overridden_method.t
----------------------------------------------------------------------
diff --git a/compiler/perl/t/202-overridden_method.t b/compiler/perl/t/202-overridden_method.t
index 5e166ea..dea925f 100644
--- a/compiler/perl/t/202-overridden_method.t
+++ b/compiler/perl/t/202-overridden_method.t
@@ -26,20 +26,20 @@ $parser->parse('parcel Neato;')
or die "failed to process parcel_definition";
my %args = (
- return_type => $parser->parse('Obj*'),
- class_name => 'Neato::Foo',
- class_cnick => 'Foo',
- param_list => $parser->parse('(Foo *self)'),
- macro_sym => 'Return_An_Obj',
- parcel => 'Neato',
+ return_type => $parser->parse('Obj*'),
+ class_name => 'Neato::Foo',
+ class_nickname => 'Foo',
+ param_list => $parser->parse('(Foo *self)'),
+ macro_sym => 'Return_An_Obj',
+ parcel => 'Neato',
);
my $orig = Clownfish::CFC::Model::Method->new(%args);
my $overrider = Clownfish::CFC::Model::Method->new(
%args,
- param_list => $parser->parse('(FooJr *self)'),
- class_name => 'Neato::Foo::FooJr',
- class_cnick => 'FooJr'
+ param_list => $parser->parse('(FooJr *self)'),
+ class_name => 'Neato::Foo::FooJr',
+ class_nickname => 'FooJr'
);
$overrider->override($orig);
ok( !$overrider->novel, "A Method which overrides another is not 'novel'" );
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/d0486854/compiler/perl/t/203-final_method.t
----------------------------------------------------------------------
diff --git a/compiler/perl/t/203-final_method.t b/compiler/perl/t/203-final_method.t
index 8829f41..6dbccfb 100644
--- a/compiler/perl/t/203-final_method.t
+++ b/compiler/perl/t/203-final_method.t
@@ -25,12 +25,12 @@ $parser->parse('parcel Neato;')
or die "failed to process parcel_definition";
my %args = (
- return_type => $parser->parse('Obj*'),
- class_name => 'Neato::Foo',
- class_cnick => 'Foo',
- param_list => $parser->parse('(Foo* self)'),
- macro_sym => 'Return_An_Obj',
- parcel => 'Neato',
+ return_type => $parser->parse('Obj*'),
+ class_name => 'Neato::Foo',
+ class_nickname => 'Foo',
+ param_list => $parser->parse('(Foo* self)'),
+ macro_sym => 'Return_An_Obj',
+ parcel => 'Neato',
);
my $not_final_method = Clownfish::CFC::Model::Method->new(%args);
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/d0486854/compiler/perl/t/300-variable.t
----------------------------------------------------------------------
diff --git a/compiler/perl/t/300-variable.t b/compiler/perl/t/300-variable.t
index a5220e7..0c7ccaf 100644
--- a/compiler/perl/t/300-variable.t
+++ b/compiler/perl/t/300-variable.t
@@ -72,11 +72,11 @@ is( $var->local_c, 'float foo[1]',
my $foo_class = $parser->parse("class Foo {}");
$var = Clownfish::CFC::Model::Variable->new(
- parcel => 'Neato',
- micro_sym => 'foo',
- type => new_type("Foo*"),
- class_name => 'Crustacean::Lobster::LobsterClaw',
- class_cnick => 'LobClaw',
+ parcel => 'Neato',
+ micro_sym => 'foo',
+ type => new_type("Foo*"),
+ class_name => 'Crustacean::Lobster::LobsterClaw',
+ class_nickname => 'LobClaw',
);
$var->resolve_type;
is( $var->global_c, 'neato_Foo* neato_LobClaw_foo', "global_c" );
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/d0486854/compiler/perl/t/401-class.t
----------------------------------------------------------------------
diff --git a/compiler/perl/t/401-class.t b/compiler/perl/t/401-class.t
index 85a1d09..5a44c57 100644
--- a/compiler/perl/t/401-class.t
+++ b/compiler/perl/t/401-class.t
@@ -72,7 +72,7 @@ eval {
Clownfish::CFC::Model::Class->create(
parcel => 'Neato',
class_name => 'Bar',
- cnick => 'Foo',
+ nickname => 'Foo',
);
};
like( $@, qr/class nickname conflict/i,
@@ -169,7 +169,7 @@ is( $parser->parse("class MissingInherits { }")->get_parent_class_name,
"Clownfish::Obj", "class inherits from Clownfish::Obj by default" );
my $class_content
- = 'public class Foo::Foodie cnick Foodie inherits Foo { int num; }';
+ = 'public class Foo::Foodie nickname Foodie inherits Foo { int num; }';
my $class = $parser->parse($class_content);
isa_ok( $class, "Clownfish::CFC::Model::Class", "class_declaration FooJr" );
ok( ( scalar grep { $_->micro_sym eq 'num' } @{ $class->member_vars } ),
@@ -234,7 +234,7 @@ is( ( scalar grep { $_->public } @{ $class->methods } ),
6, "pass acl to Method constructor" );
$class_content = qq|
- inert class Rigor::Mortis cnick Mort {
+ inert class Rigor::Mortis nickname Mort {
inert void lie_still();
}|;
$class = $parser->parse($class_content);
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/d0486854/compiler/perl/t/403-parcel.t
----------------------------------------------------------------------
diff --git a/compiler/perl/t/403-parcel.t b/compiler/perl/t/403-parcel.t
index 4b8f973..2121322 100644
--- a/compiler/perl/t/403-parcel.t
+++ b/compiler/perl/t/403-parcel.t
@@ -45,8 +45,8 @@ like( $@, qr/parcel .* already registered/i,
"can't register two parcels with the same name" );
my $same_nick = Clownfish::CFC::Model::Parcel->new(
- name => "OtherFoo",
- cnick => "Foo",
+ name => "OtherFoo",
+ nickname => "Foo",
);
eval { $same_nick->register; };
like( $@, qr/parcel with nickname .* already registered/i,
@@ -90,8 +90,8 @@ isa_ok(
# Register singleton.
my $parcel = Clownfish::CFC::Model::Parcel->new(
- name => 'Crustacean',
- cnick => 'Crust',
+ name => 'Crustacean',
+ nickname => 'Crust',
);
$parcel->register;
is( $parcel->get_version->get_vstring, 'v0', "get_version" );
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/d0486854/compiler/perl/t/600-parser.t
----------------------------------------------------------------------
diff --git a/compiler/perl/t/600-parser.t b/compiler/perl/t/600-parser.t
index f0d56fa..8b81999 100644
--- a/compiler/perl/t/600-parser.t
+++ b/compiler/perl/t/600-parser.t
@@ -31,8 +31,8 @@ isa_ok(
# Set and leave parcel.
my $registered = Clownfish::CFC::Model::Parcel->new(
- name => 'Crustacean',
- cnick => 'Crust',
+ name => 'Crustacean',
+ nickname => 'Crust',
);
$registered->register;
my $parcel = $parser->parse('parcel Crustacean;')
@@ -121,10 +121,8 @@ is_deeply(
"initial values"
);
-my %sub_args = ( class => 'Stuff::Obj', cnick => 'Obj' );
-
$parser->set_class_name('Stuff::Obj');
-$parser->set_class_cnick('Obj');
+$parser->set_class_nickname('Obj');
ok( $parser->parse($_), "declaration statement: $_" )
for (
'public Foo* Spew_Foo(Obj *self, uint32_t *how_many);',
@@ -154,14 +152,14 @@ SKIP: {
for (qw( foo fooBar Foo_Bar FOOBAR 1Foo 1FOO ));
}
-is( $parser->parse(qq|class Foodie$_ cnick $_ { }|)->get_cnick,
- $_, "cnick: $_" )
+is( $parser->parse(qq|class Foodie$_ nickname $_ { }|)->get_nickname,
+ $_, "nickname: $_" )
for (qw( Food FF ));
SKIP: {
- skip( "Can't recover from bad cnick under flex/lemon parser", 3 );
- is( !$parser->parse(qq|class Foodie$_ cnick $_ { }|),
- "Illegal cnick: $_" )
+ skip( "Can't recover from bad nickname under flex/lemon parser", 3 );
+ is( !$parser->parse(qq|class Foodie$_ nickname $_ { }|),
+ "Illegal nickname: $_" )
for (qw( foo fOO 1Foo ));
}
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/d0486854/compiler/src/CFCClass.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCClass.c b/compiler/src/CFCClass.c
index eb84dfb..dc74cd1 100644
--- a/compiler/src/CFCClass.c
+++ b/compiler/src/CFCClass.c
@@ -99,12 +99,12 @@ static const CFCMeta CFCCLASS_META = {
CFCClass*
CFCClass_create(struct CFCParcel *parcel, const char *exposure,
- const char *class_name, const char *cnick,
+ const char *class_name, const char *nickname,
const char *micro_sym, CFCDocuComment *docucomment,
CFCFileSpec *file_spec, const char *parent_class_name,
int is_final, int is_inert) {
CFCClass *self = (CFCClass*)CFCBase_allocate(&CFCCLASS_META);
- return CFCClass_do_create(self, parcel, exposure, class_name, cnick,
+ return CFCClass_do_create(self, parcel, exposure, class_name, nickname,
micro_sym, docucomment, file_spec,
parent_class_name, is_final, is_inert);
}
@@ -112,13 +112,13 @@ CFCClass_create(struct CFCParcel *parcel, const char *exposure,
CFCClass*
CFCClass_do_create(CFCClass *self, struct CFCParcel *parcel,
const char *exposure, const char *class_name,
- const char *cnick, const char *micro_sym,
+ const char *nickname, const char *micro_sym,
CFCDocuComment *docucomment, CFCFileSpec *file_spec,
const char *parent_class_name, int is_final, int is_inert) {
CFCUTIL_NULL_CHECK(class_name);
exposure = exposure ? exposure : "parcel";
micro_sym = micro_sym ? micro_sym : "class";
- CFCSymbol_init((CFCSymbol*)self, parcel, exposure, class_name, cnick,
+ CFCSymbol_init((CFCSymbol*)self, parcel, exposure, class_name, nickname,
micro_sym);
if (!is_inert
&& !parent_class_name
@@ -159,9 +159,10 @@ CFCClass_do_create(CFCClass *self, struct CFCParcel *parcel,
self->full_struct_sym = CFCUtil_sprintf("%s%s", prefix, self->struct_sym);
self->ivars_struct = CFCUtil_sprintf("%sIVARS", self->struct_sym);
self->full_ivars_struct = CFCUtil_sprintf("%sIVARS", self->full_struct_sym);
- self->ivars_func = CFCUtil_sprintf("%s_IVARS", CFCClass_get_cnick(self));
+ self->ivars_func = CFCUtil_sprintf("%s_IVARS",
+ CFCClass_get_nickname(self));
self->full_ivars_func = CFCUtil_sprintf("%s%s_IVARS", prefix,
- CFCClass_get_cnick(self));
+ CFCClass_get_nickname(self));
self->full_ivars_offset = CFCUtil_sprintf("%s_OFFSET", self->full_ivars_func);
size_t full_struct_sym_len = strlen(self->full_struct_sym);
self->full_vtable_var = (char*)MALLOCATE(full_struct_sym_len + 1);
@@ -263,7 +264,7 @@ S_register(CFCClass *self) {
CFCParcel *parcel = CFCClass_get_parcel(self);
const char *prefix = CFCParcel_get_prefix(parcel);
const char *class_name = CFCClass_get_class_name(self);
- const char *cnick = CFCClass_get_cnick(self);
+ const char *nickname = CFCClass_get_nickname(self);
const char *key = self->full_struct_sym;
for (size_t i = 0; i < registry_size; i++) {
@@ -271,7 +272,7 @@ S_register(CFCClass *self) {
CFCParcel *other_parcel = CFCClass_get_parcel(other);
const char *other_prefix = CFCParcel_get_prefix(other_parcel);
const char *other_class_name = CFCClass_get_class_name(other);
- const char *other_cnick = CFCClass_get_cnick(other);
+ const char *other_nickname = CFCClass_get_nickname(other);
if (strcmp(class_name, other_class_name) == 0) {
CFCUtil_die("Two classes with name %s", class_name);
@@ -281,7 +282,7 @@ S_register(CFCClass *self) {
class_name, other_class_name);
}
if (strcmp(prefix, other_prefix) == 0
- && strcmp(cnick, other_cnick) == 0
+ && strcmp(nickname, other_nickname) == 0
) {
CFCUtil_die("Class nickname conflict between %s and %s",
class_name, other_class_name);
@@ -714,8 +715,8 @@ CFCClass_inert_vars(CFCClass *self) {
}
const char*
-CFCClass_get_cnick(CFCClass *self) {
- return CFCSymbol_get_class_cnick((CFCSymbol*)self);
+CFCClass_get_nickname(CFCClass *self) {
+ return CFCSymbol_get_class_nickname((CFCSymbol*)self);
}
void
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/d0486854/compiler/src/CFCClass.h
----------------------------------------------------------------------
diff --git a/compiler/src/CFCClass.h b/compiler/src/CFCClass.h
index 00e05a3..41691b2 100644
--- a/compiler/src/CFCClass.h
+++ b/compiler/src/CFCClass.h
@@ -44,7 +44,7 @@ struct CFCFileSpec;
* @param parcel See Clownfish::CFC::Model::Symbol.
* @param exposure See Clownfish::CFC::Model::Symbol.
* @param class_name See Clownfish::CFC::Model::Symbol.
- * @param cnick See Clownfish::CFC::Model::Symbol.
+ * @param nickname See Clownfish::CFC::Model::Symbol.
* @param micro_sym Defaults to "class".
* @param docucomment An optional Clownfish::CFC::Model::DocuComment attached
* to this class.
@@ -58,7 +58,7 @@ struct CFCFileSpec;
*/
CFCClass*
CFCClass_create(struct CFCParcel *parcel, const char *exposure,
- const char *class_name, const char *cnick,
+ const char *class_name, const char *nickname,
const char *micro_sym, struct CFCDocuComment *docucomment,
struct CFCFileSpec *file_spec, const char *parent_class_name,
int is_final, int is_inert);
@@ -66,7 +66,7 @@ CFCClass_create(struct CFCParcel *parcel, const char *exposure,
CFCClass*
CFCClass_do_create(CFCClass *self, struct CFCParcel *parcel,
const char *exposure, const char *class_name,
- const char *cnick, const char *micro_sym,
+ const char *nickname, const char *micro_sym,
struct CFCDocuComment *docucomment,
struct CFCFileSpec *file_spec, const char *parent_class_name,
int is_final, int is_inert);
@@ -197,7 +197,7 @@ struct CFCVariable**
CFCClass_inert_vars(CFCClass *self);
const char*
-CFCClass_get_cnick(CFCClass *self);
+CFCClass_get_nickname(CFCClass *self);
/** Set the parent Class. (Not class name, Class.)
*/
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/d0486854/compiler/src/CFCFunction.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCFunction.c b/compiler/src/CFCFunction.c
index 3926164..f0ee468 100644
--- a/compiler/src/CFCFunction.c
+++ b/compiler/src/CFCFunction.c
@@ -38,12 +38,12 @@ static const CFCMeta CFCFUNCTION_META = {
CFCFunction*
CFCFunction_new(CFCParcel *parcel, const char *exposure,
- const char *class_name, const char *class_cnick,
+ const char *class_name, const char *class_nickname,
const char *micro_sym, CFCType *return_type,
CFCParamList *param_list, CFCDocuComment *docucomment,
int is_inline) {
CFCFunction *self = (CFCFunction*)CFCBase_allocate(&CFCFUNCTION_META);
- return CFCFunction_init(self, parcel, exposure, class_name, class_cnick,
+ return CFCFunction_init(self, parcel, exposure, class_name, class_nickname,
micro_sym, return_type, param_list, docucomment,
is_inline);
}
@@ -61,7 +61,7 @@ S_validate_micro_sym(const char *micro_sym) {
CFCFunction*
CFCFunction_init(CFCFunction *self, CFCParcel *parcel, const char *exposure,
- const char *class_name, const char *class_cnick,
+ const char *class_name, const char *class_nickname,
const char *micro_sym, CFCType *return_type,
CFCParamList *param_list, CFCDocuComment *docucomment,
int is_inline) {
@@ -75,7 +75,7 @@ CFCFunction_init(CFCFunction *self, CFCParcel *parcel, const char *exposure,
CFCUtil_die("Invalid micro_sym: '%s'", micro_sym);
}
CFCSymbol_init((CFCSymbol*)self, parcel, exposure, class_name,
- class_cnick, micro_sym);
+ class_nickname, micro_sym);
self->return_type = (CFCType*)CFCBase_incref((CFCBase*)return_type);
self->param_list = (CFCParamList*)CFCBase_incref((CFCBase*)param_list);
self->docucomment = (CFCDocuComment*)CFCBase_incref((CFCBase*)docucomment);
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/d0486854/compiler/src/CFCFunction.h
----------------------------------------------------------------------
diff --git a/compiler/src/CFCFunction.h b/compiler/src/CFCFunction.h
index 16a789e..752d2da 100644
--- a/compiler/src/CFCFunction.h
+++ b/compiler/src/CFCFunction.h
@@ -49,7 +49,7 @@ struct CFCFunction {
* L<Clownfish::CFC::Model::Symbol>).
* @param class_name The full name of the class in whose namespace the
* function resides.
- * @param class_cnick The C nickname for the class.
+ * @param class_nickname The C nickname for the class.
* @param micro_sym The lower case name of the function, without any
* namespacing prefixes.
* @param return_type A Clownfish::CFC::Model::Type representing the
@@ -63,7 +63,7 @@ struct CFCFunction {
*/
CFCFunction*
CFCFunction_new(struct CFCParcel *parcel, const char *exposure,
- const char *class_name, const char *class_cnick,
+ const char *class_name, const char *class_nickname,
const char *micro_sym, struct CFCType *return_type,
struct CFCParamList *param_list,
struct CFCDocuComment *docucomment, int is_inline);
@@ -71,7 +71,7 @@ CFCFunction_new(struct CFCParcel *parcel, const char *exposure,
CFCFunction*
CFCFunction_init(CFCFunction *self, struct CFCParcel *parcel,
const char *exposure, const char *class_name,
- const char *class_cnick, const char *micro_sym,
+ const char *class_nickname, const char *micro_sym,
struct CFCType *return_type, struct CFCParamList *param_list,
struct CFCDocuComment *docucomment, int is_inline);
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/d0486854/compiler/src/CFCLexHeader.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCLexHeader.c b/compiler/src/CFCLexHeader.c
index b4362a8..866b79f 100644
--- a/compiler/src/CFCLexHeader.c
+++ b/compiler/src/CFCLexHeader.c
@@ -47,7 +47,6 @@ typedef int16_t flex_int16_t;
typedef uint16_t flex_uint16_t;
typedef int32_t flex_int32_t;
typedef uint32_t flex_uint32_t;
-typedef uint64_t flex_uint64_t;
#else
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
@@ -55,7 +54,6 @@ typedef int flex_int32_t;
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
-#endif /* ! C99 */
/* Limits of integral types. */
#ifndef INT8_MIN
@@ -86,6 +84,8 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif
+#endif /* ! C99 */
+
#endif /* ! FLEXINT_H */
#ifdef __cplusplus
@@ -142,7 +142,15 @@ typedef unsigned int flex_uint32_t;
/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k.
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
+ * Ditto for the __ia64__ case accordingly.
+ */
+#define YY_BUF_SIZE 32768
+#else
#define YY_BUF_SIZE 16384
+#endif /* __ia64__ */
#endif
/* The state buf must be large enough to hold one state per character in the main buffer.
@@ -154,12 +162,7 @@ typedef unsigned int flex_uint32_t;
typedef struct yy_buffer_state *YY_BUFFER_STATE;
#endif
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
-extern yy_size_t yyleng;
+extern int yyleng;
extern FILE *yyin, *yyout;
@@ -176,7 +179,7 @@ extern FILE *yyin, *yyout;
*/
#define YY_LESS_LINENO(n) \
do { \
- yy_size_t yyl;\
+ int yyl;\
for ( yyl = n; yyl < yyleng; ++yyl )\
if ( yytext[yyl] == '\n' )\
--yylineno;\
@@ -198,6 +201,11 @@ extern FILE *yyin, *yyout;
#define unput(c) yyunput( c, (yytext_ptr) )
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
@@ -215,7 +223,7 @@ struct yy_buffer_state
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
*/
- yy_size_t yy_n_chars;
+ int yy_n_chars;
/* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to
@@ -285,8 +293,8 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
/* yy_hold_char holds the character lost when yytext is formed. */
static char yy_hold_char;
-static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
-yy_size_t yyleng;
+static int yy_n_chars; /* number of characters read into yy_ch_buf */
+int yyleng;
/* Points to current character in buffer. */
static char *yy_c_buf_p = (char *) 0;
@@ -314,7 +322,7 @@ static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
-YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len );
+YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
void *yyalloc (yy_size_t );
void *yyrealloc (void *,yy_size_t );
@@ -372,7 +380,7 @@ static void yy_fatal_error (yyconst char msg[] );
*/
#define YY_DO_BEFORE_ACTION \
(yytext_ptr) = yy_bp; \
- yyleng = (yy_size_t) (yy_cp - yy_bp); \
+ yyleng = (size_t) (yy_cp - yy_bp); \
(yy_hold_char) = *yy_cp; \
*yy_cp = '\0'; \
(yy_c_buf_p) = yy_cp;
@@ -563,7 +571,6 @@ char *yytext;
{"bool", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
{"char", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
{"class", CFC_TOKENTYPE_CLASS },
- {"cnick", CFC_TOKENTYPE_CNICK },
{"const", CFC_TOKENTYPE_CONST },
{"decremented", CFC_TOKENTYPE_DECREMENTED },
{"double", CFC_TOKENTYPE_FLOAT_TYPE_NAME },
@@ -580,6 +587,7 @@ char *yytext;
{"int64_t", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
{"int8_t", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
{"long", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
+ {"nickname", CFC_TOKENTYPE_NICKNAME },
{"nullable", CFC_TOKENTYPE_NULLABLE },
{"parcel", CFC_TOKENTYPE_PARCEL },
{"public", CFC_TOKENTYPE_PUBLIC },
@@ -617,7 +625,7 @@ char *yytext;
}
}
-#line 621 "../src/CFCLexHeader.c"
+#line 629 "../src/CFCLexHeader.c"
#define INITIAL 0
#define CBLOCK 1
@@ -649,7 +657,7 @@ FILE *yyget_out (void );
void yyset_out (FILE * out_str );
-yy_size_t yyget_leng (void );
+int yyget_leng (void );
char *yyget_text (void );
@@ -691,7 +699,12 @@ static int input (void );
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k */
+#define YY_READ_BUF_SIZE 16384
+#else
#define YY_READ_BUF_SIZE 8192
+#endif /* __ia64__ */
#endif
/* Copy whatever the last rule matched to the standard output. */
@@ -699,7 +712,7 @@ static int input (void );
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
-#define ECHO fwrite( yytext, yyleng, 1, yyout )
+#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
@@ -710,7 +723,7 @@ static int input (void );
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
- yy_size_t n; \
+ size_t n; \
for ( n = 0; n < max_size && \
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
@@ -794,7 +807,7 @@ YY_DECL
#line 99 "../src/CFCLexHeader.l"
-#line 798 "../src/CFCLexHeader.c"
+#line 811 "../src/CFCLexHeader.c"
if ( !(yy_init) )
{
@@ -864,7 +877,7 @@ yy_find_action:
if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
{
- yy_size_t yyl;
+ int yyl;
for ( yyl = 0; yyl < yyleng; ++yyl )
if ( yytext[yyl] == '\n' )
@@ -1034,7 +1047,7 @@ YY_RULE_SETUP
#line 136 "../src/CFCLexHeader.l"
YY_FATAL_ERROR( "flex scanner jammed" );
YY_BREAK
-#line 1038 "../src/CFCLexHeader.c"
+#line 1051 "../src/CFCLexHeader.c"
case YY_END_OF_BUFFER:
{
@@ -1219,7 +1232,7 @@ static int yy_get_next_buffer (void)
else
{
- yy_size_t num_to_read =
+ int num_to_read =
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
while ( num_to_read <= 0 )
@@ -1233,7 +1246,7 @@ static int yy_get_next_buffer (void)
if ( b->yy_is_our_buffer )
{
- yy_size_t new_size = b->yy_buf_size * 2;
+ int new_size = b->yy_buf_size * 2;
if ( new_size <= 0 )
b->yy_buf_size += b->yy_buf_size / 8;
@@ -1264,7 +1277,7 @@ static int yy_get_next_buffer (void)
/* Read in more data. */
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
- (yy_n_chars), num_to_read );
+ (yy_n_chars), (size_t) num_to_read );
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
}
@@ -1374,7 +1387,7 @@ static int yy_get_next_buffer (void)
if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
{ /* need to shift things up to make room */
/* +2 for EOB chars. */
- register yy_size_t number_to_move = (yy_n_chars) + 2;
+ register int number_to_move = (yy_n_chars) + 2;
register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
register char *source =
@@ -1427,7 +1440,7 @@ static int yy_get_next_buffer (void)
else
{ /* need more input */
- yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
+ int offset = (yy_c_buf_p) - (yytext_ptr);
++(yy_c_buf_p);
switch ( yy_get_next_buffer( ) )
@@ -1451,7 +1464,7 @@ static int yy_get_next_buffer (void)
case EOB_ACT_END_OF_FILE:
{
if ( yywrap( ) )
- return 0;
+ return EOF;
if ( ! (yy_did_buffer_switch_on_eof) )
YY_NEW_FILE;
@@ -1704,7 +1717,7 @@ void yypop_buffer_state (void)
*/
static void yyensure_buffer_stack (void)
{
- yy_size_t num_to_alloc;
+ int num_to_alloc;
if (!(yy_buffer_stack)) {
@@ -1796,16 +1809,17 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
* scan from a @e copy of @a bytes.
- * @param bytes the byte buffer to scan
- * @param len the number of bytes in the buffer pointed to by @a bytes.
+ * @param yybytes the byte buffer to scan
+ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
*
* @return the newly allocated buffer state object.
*/
-YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
+YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
{
YY_BUFFER_STATE b;
char *buf;
- yy_size_t n, i;
+ yy_size_t n;
+ int i;
/* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2;
@@ -1887,7 +1901,7 @@ FILE *yyget_out (void)
/** Get the length of the current token.
*
*/
-yy_size_t yyget_leng (void)
+int yyget_leng (void)
{
return yyleng;
}
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/d0486854/compiler/src/CFCLexHeader.h
----------------------------------------------------------------------
diff --git a/compiler/src/CFCLexHeader.h b/compiler/src/CFCLexHeader.h
index 16b76f2..aa205d7 100644
--- a/compiler/src/CFCLexHeader.h
+++ b/compiler/src/CFCLexHeader.h
@@ -51,7 +51,6 @@ typedef int16_t flex_int16_t;
typedef uint16_t flex_uint16_t;
typedef int32_t flex_int32_t;
typedef uint32_t flex_uint32_t;
-typedef uint64_t flex_uint64_t;
#else
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
@@ -59,7 +58,6 @@ typedef int flex_int32_t;
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
-#endif /* ! C99 */
/* Limits of integral types. */
#ifndef INT8_MIN
@@ -90,6 +88,8 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif
+#endif /* ! C99 */
+
#endif /* ! FLEXINT_H */
#ifdef __cplusplus
@@ -115,7 +115,15 @@ typedef unsigned int flex_uint32_t;
/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k.
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
+ * Ditto for the __ia64__ case accordingly.
+ */
+#define YY_BUF_SIZE 32768
+#else
#define YY_BUF_SIZE 16384
+#endif /* __ia64__ */
#endif
#ifndef YY_TYPEDEF_YY_BUFFER_STATE
@@ -123,15 +131,15 @@ typedef unsigned int flex_uint32_t;
typedef struct yy_buffer_state *YY_BUFFER_STATE;
#endif
+extern int yyleng;
+
+extern FILE *yyin, *yyout;
+
#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t;
#endif
-extern yy_size_t yyleng;
-
-extern FILE *yyin, *yyout;
-
#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
@@ -149,7 +157,7 @@ struct yy_buffer_state
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
*/
- yy_size_t yy_n_chars;
+ int yy_n_chars;
/* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to
@@ -193,7 +201,7 @@ void yypop_buffer_state (void );
YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
-YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len );
+YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
void *yyalloc (yy_size_t );
void *yyrealloc (void *,yy_size_t );
@@ -240,7 +248,7 @@ FILE *yyget_out (void );
void yyset_out (FILE * out_str );
-yy_size_t yyget_leng (void );
+int yyget_leng (void );
char *yyget_text (void );
@@ -274,7 +282,12 @@ static int yy_flex_strlen (yyconst char * );
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k */
+#define YY_READ_BUF_SIZE 16384
+#else
#define YY_READ_BUF_SIZE 8192
+#endif /* __ia64__ */
#endif
/* Number of entries by which start-condition stack grows. */
@@ -310,6 +323,6 @@ extern int yylex (void);
#line 136 "../src/CFCLexHeader.l"
-#line 314 "../src/CFCLexHeader.h"
+#line 327 "../src/CFCLexHeader.h"
#undef yyIN_HEADER
#endif /* yyHEADER_H */
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/d0486854/compiler/src/CFCLexHeader.l
----------------------------------------------------------------------
diff --git a/compiler/src/CFCLexHeader.l b/compiler/src/CFCLexHeader.l
index 567cbeb..d14c3ac 100644
--- a/compiler/src/CFCLexHeader.l
+++ b/compiler/src/CFCLexHeader.l
@@ -34,7 +34,6 @@
{"bool", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
{"char", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
{"class", CFC_TOKENTYPE_CLASS },
- {"cnick", CFC_TOKENTYPE_CNICK },
{"const", CFC_TOKENTYPE_CONST },
{"decremented", CFC_TOKENTYPE_DECREMENTED },
{"double", CFC_TOKENTYPE_FLOAT_TYPE_NAME },
@@ -51,6 +50,7 @@
{"int64_t", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
{"int8_t", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
{"long", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
+ {"nickname", CFC_TOKENTYPE_NICKNAME },
{"nullable", CFC_TOKENTYPE_NULLABLE },
{"parcel", CFC_TOKENTYPE_PARCEL },
{"public", CFC_TOKENTYPE_PUBLIC },
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/d0486854/compiler/src/CFCMethod.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCMethod.c b/compiler/src/CFCMethod.c
index 090b35d..9335577 100644
--- a/compiler/src/CFCMethod.c
+++ b/compiler/src/CFCMethod.c
@@ -55,11 +55,11 @@ static const CFCMeta CFCMETHOD_META = {
CFCMethod*
CFCMethod_new(CFCParcel *parcel, const char *exposure, const char *class_name,
- const char *class_cnick, const char *macro_sym,
+ const char *class_nickname, const char *macro_sym,
CFCType *return_type, CFCParamList *param_list,
CFCDocuComment *docucomment, int is_final, int is_abstract) {
CFCMethod *self = (CFCMethod*)CFCBase_allocate(&CFCMETHOD_META);
- return CFCMethod_init(self, parcel, exposure, class_name, class_cnick,
+ return CFCMethod_init(self, parcel, exposure, class_name, class_nickname,
macro_sym, return_type, param_list, docucomment,
is_final, is_abstract);
}
@@ -88,7 +88,7 @@ S_validate_macro_sym(const char *macro_sym) {
CFCMethod*
CFCMethod_init(CFCMethod *self, CFCParcel *parcel, const char *exposure,
- const char *class_name, const char *class_cnick,
+ const char *class_name, const char *class_nickname,
const char *macro_sym, CFCType *return_type,
CFCParamList *param_list, CFCDocuComment *docucomment,
int is_final, int is_abstract) {
@@ -105,7 +105,7 @@ CFCMethod_init(CFCMethod *self, CFCParcel *parcel, const char *exposure,
// Super-init and clean up derived micro_sym.
CFCFunction_init((CFCFunction*)self, parcel, exposure, class_name,
- class_cnick, micro_sym, return_type, param_list,
+ class_nickname, micro_sym, return_type, param_list,
docucomment, false);
FREEMEM(micro_sym);
@@ -136,7 +136,7 @@ CFCMethod_init(CFCMethod *self, CFCParcel *parcel, const char *exposure,
// Derive name of implementing function.
self->short_imp_func
- = CFCUtil_sprintf("%s_%s_IMP", CFCMethod_get_class_cnick(self),
+ = CFCUtil_sprintf("%s_%s_IMP", CFCMethod_get_class_nickname(self),
self->macro_sym);
self->imp_func = CFCUtil_sprintf("%s%s", CFCMethod_get_PREFIX(self),
self->short_imp_func);
@@ -238,12 +238,12 @@ CFCMethod_override(CFCMethod *self, CFCMethod *orig) {
CFCMethod*
CFCMethod_finalize(CFCMethod *self) {
- CFCParcel *parcel = CFCMethod_get_parcel(self);
- const char *exposure = CFCMethod_get_exposure(self);
- const char *class_name = CFCMethod_get_class_name(self);
- const char *class_cnick = CFCMethod_get_class_cnick(self);
+ CFCParcel *parcel = CFCMethod_get_parcel(self);
+ const char *exposure = CFCMethod_get_exposure(self);
+ const char *class_name = CFCMethod_get_class_name(self);
+ const char *class_nickname = CFCMethod_get_class_nickname(self);
CFCMethod *finalized
- = CFCMethod_new(parcel, exposure, class_name, class_cnick,
+ = CFCMethod_new(parcel, exposure, class_name, class_nickname,
self->macro_sym, self->function.return_type,
self->function.param_list,
self->function.docucomment, true,
@@ -291,29 +291,29 @@ CFCMethod_excluded_from_host(CFCMethod *self) {
static char*
S_short_method_sym(CFCMethod *self, CFCClass *invoker, const char *postfix) {
- const char *cnick;
+ const char *nickname;
if (invoker) {
- cnick = CFCClass_get_cnick(invoker);
+ nickname = CFCClass_get_nickname(invoker);
}
else {
- cnick = CFCMethod_get_class_cnick(self);
+ nickname = CFCMethod_get_class_nickname(self);
}
- return CFCUtil_sprintf("%s_%s%s", cnick, self->macro_sym, postfix);
+ return CFCUtil_sprintf("%s_%s%s", nickname, self->macro_sym, postfix);
}
static char*
S_full_method_sym(CFCMethod *self, CFCClass *invoker, const char *postfix) {
const char *PREFIX;
- const char *cnick;
+ const char *nickname;
if (invoker) {
- PREFIX = CFCClass_get_PREFIX(invoker);
- cnick = CFCClass_get_cnick(invoker);
+ PREFIX = CFCClass_get_PREFIX(invoker);
+ nickname = CFCClass_get_nickname(invoker);
}
else {
- PREFIX = CFCMethod_get_PREFIX(self);
- cnick = CFCMethod_get_class_cnick(self);
+ PREFIX = CFCMethod_get_PREFIX(self);
+ nickname = CFCMethod_get_class_nickname(self);
}
- return CFCUtil_sprintf("%s%s_%s%s", PREFIX, cnick, self->macro_sym,
+ return CFCUtil_sprintf("%s%s_%s%s", PREFIX, nickname, self->macro_sym,
postfix);
}
@@ -355,10 +355,10 @@ CFCMethod_full_typedef(CFCMethod *self, CFCClass *invoker) {
const char*
CFCMethod_full_override_sym(CFCMethod *self) {
if (!self->full_override_sym) {
- const char *Prefix = CFCMethod_get_Prefix(self);
- const char *cnick = CFCMethod_get_class_cnick(self);
+ const char *Prefix = CFCMethod_get_Prefix(self);
+ const char *nickname = CFCMethod_get_class_nickname(self);
self->full_override_sym
- = CFCUtil_sprintf("%s%s_%s_OVERRIDE", Prefix, cnick,
+ = CFCUtil_sprintf("%s%s_%s_OVERRIDE", Prefix, nickname,
self->macro_sym);
}
return self->full_override_sym;
@@ -416,8 +416,8 @@ CFCMethod_get_class_name(CFCMethod *self) {
}
const char*
-CFCMethod_get_class_cnick(CFCMethod *self) {
- return CFCSymbol_get_class_cnick((CFCSymbol*)self);
+CFCMethod_get_class_nickname(CFCMethod *self) {
+ return CFCSymbol_get_class_nickname((CFCSymbol*)self);
}
int
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/d0486854/compiler/src/CFCMethod.h
----------------------------------------------------------------------
diff --git a/compiler/src/CFCMethod.h b/compiler/src/CFCMethod.h
index ad3294c..eef5129 100644
--- a/compiler/src/CFCMethod.h
+++ b/compiler/src/CFCMethod.h
@@ -44,7 +44,7 @@ struct CFCDocuComment;
* @param exposure See Clownfish::CFC::Model::Function. Defaults to "parcel"
* if not supplied.
* @param class_name See Clownfish::CFC::Model::Function.
- * @param class_cnick See Clownfish::CFC::Model::Function.
+ * @param class_nickname See Clownfish::CFC::Model::Function.
* @param macro_sym - The mixed case name which will be used when invoking the
* method.
* @param return_type See Clownfish::CFC::Model::Function.
@@ -56,7 +56,7 @@ struct CFCDocuComment;
*/
CFCMethod*
CFCMethod_new(struct CFCParcel *parcel, const char *exposure,
- const char *class_name, const char *class_cnick,
+ const char *class_name, const char *class_nickname,
const char *macro_sym, struct CFCType *return_type,
struct CFCParamList *param_list,
struct CFCDocuComment *docucomment, int is_final,
@@ -65,7 +65,7 @@ CFCMethod_new(struct CFCParcel *parcel, const char *exposure,
CFCMethod*
CFCMethod_init(CFCMethod *self, struct CFCParcel *parcel,
const char *exposure, const char *class_name,
- const char *class_cnick, const char *macro_sym,
+ const char *class_nickname, const char *macro_sym,
struct CFCType *return_type, struct CFCParamList *param_list,
struct CFCDocuComment *docucomment, int is_final,
int is_abstract);
@@ -219,7 +219,7 @@ const char*
CFCMethod_get_class_name(CFCMethod *self);
const char*
-CFCMethod_get_class_cnick(CFCMethod *self);
+CFCMethod_get_class_nickname(CFCMethod *self);
int
CFCMethod_public(CFCMethod *self);
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/d0486854/compiler/src/CFCParcel.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCParcel.c b/compiler/src/CFCParcel.c
index c09be38..15811e8 100644
--- a/compiler/src/CFCParcel.c
+++ b/compiler/src/CFCParcel.c
@@ -32,7 +32,7 @@
struct CFCParcel {
CFCBase base;
char *name;
- char *cnick;
+ char *nickname;
CFCVersion *version;
char *prefix;
char *Prefix;
@@ -97,8 +97,8 @@ CFCParcel_fetch(const char *name) {
void
CFCParcel_register(CFCParcel *self) {
- const char *name = self->name;
- const char *cnick = self->cnick;
+ const char *name = self->name;
+ const char *nickname = self->nickname;
for (size_t i = 0; i < num_registered ; i++) {
CFCParcel *other = registry[i];
@@ -106,8 +106,9 @@ CFCParcel_register(CFCParcel *self) {
if (strcmp(other->name, name) == 0) {
CFCUtil_die("Parcel '%s' already registered", name);
}
- if (strcmp(other->cnick, cnick) == 0) {
- CFCUtil_die("Parcel with nickname '%s' already registered", cnick);
+ if (strcmp(other->nickname, nickname) == 0) {
+ CFCUtil_die("Parcel with nickname '%s' already registered",
+ nickname);
}
}
@@ -138,7 +139,7 @@ CFCParcel_reap_singletons(void) {
}
static int
-S_validate_name_or_cnick(const char *orig) {
+S_validate_name_or_nickname(const char *orig) {
const char *ptr = orig;
for (; *ptr != 0; ptr++) {
if (!isalpha(*ptr)) { return false; }
@@ -153,31 +154,31 @@ static const CFCMeta CFCPARCEL_META = {
};
CFCParcel*
-CFCParcel_new(const char *name, const char *cnick, CFCVersion *version,
+CFCParcel_new(const char *name, const char *nickname, CFCVersion *version,
int is_included) {
CFCParcel *self = (CFCParcel*)CFCBase_allocate(&CFCPARCEL_META);
- return CFCParcel_init(self, name, cnick, version, is_included);
+ return CFCParcel_init(self, name, nickname, version, is_included);
}
CFCParcel*
-CFCParcel_init(CFCParcel *self, const char *name, const char *cnick,
+CFCParcel_init(CFCParcel *self, const char *name, const char *nickname,
CFCVersion *version, int is_included) {
// Validate name.
- if (!name || !S_validate_name_or_cnick(name)) {
+ if (!name || !S_validate_name_or_nickname(name)) {
CFCUtil_die("Invalid name: '%s'", name ? name : "[NULL]");
}
self->name = CFCUtil_strdup(name);
- // Validate or derive cnick.
- if (cnick) {
- if (!S_validate_name_or_cnick(cnick)) {
- CFCUtil_die("Invalid cnick: '%s'", cnick);
+ // Validate or derive nickname.
+ if (nickname) {
+ if (!S_validate_name_or_nickname(nickname)) {
+ CFCUtil_die("Invalid nickname: '%s'", nickname);
}
- self->cnick = CFCUtil_strdup(cnick);
+ self->nickname = CFCUtil_strdup(nickname);
}
else {
- // Default cnick to name.
- self->cnick = CFCUtil_strdup(name);
+ // Default nickname to name.
+ self->nickname = CFCUtil_strdup(name);
}
// Default to version v0.
@@ -189,19 +190,19 @@ CFCParcel_init(CFCParcel *self, const char *name, const char *cnick,
}
// Derive prefix, Prefix, PREFIX.
- size_t cnick_len = strlen(self->cnick);
- size_t prefix_len = cnick_len ? cnick_len + 1 : 0;
+ size_t nickname_len = strlen(self->nickname);
+ size_t prefix_len = nickname_len ? nickname_len + 1 : 0;
size_t amount = prefix_len + 1;
self->prefix = (char*)MALLOCATE(amount);
self->Prefix = (char*)MALLOCATE(amount);
self->PREFIX = (char*)MALLOCATE(amount);
- memcpy(self->Prefix, self->cnick, cnick_len);
- if (cnick_len) {
- self->Prefix[cnick_len] = '_';
- self->Prefix[cnick_len + 1] = '\0';
+ memcpy(self->Prefix, self->nickname, nickname_len);
+ if (nickname_len) {
+ self->Prefix[nickname_len] = '_';
+ self->Prefix[nickname_len + 1] = '\0';
}
else {
- self->Prefix[cnick_len] = '\0';
+ self->Prefix[nickname_len] = '\0';
}
for (size_t i = 0; i < amount; i++) {
self->prefix[i] = tolower(self->Prefix[i]);
@@ -212,11 +213,11 @@ CFCParcel_init(CFCParcel *self, const char *name, const char *cnick,
self->PREFIX[prefix_len] = '\0';
// Derive privacy symbol.
- size_t privacy_sym_len = cnick_len + 4;
+ size_t privacy_sym_len = nickname_len + 4;
self->privacy_sym = (char*)MALLOCATE(privacy_sym_len + 1);
memcpy(self->privacy_sym, "CFP_", 4);
- for (size_t i = 0; i < cnick_len; i++) {
- self->privacy_sym[i+4] = toupper(self->cnick[i]);
+ for (size_t i = 0; i < nickname_len; i++) {
+ self->privacy_sym[i+4] = toupper(self->nickname[i]);
}
self->privacy_sym[privacy_sym_len] = '\0';
@@ -353,7 +354,7 @@ CFCParcel_new_from_file(const char *path, int is_included) {
void
CFCParcel_destroy(CFCParcel *self) {
FREEMEM(self->name);
- FREEMEM(self->cnick);
+ FREEMEM(self->nickname);
CFCBase_decref((CFCBase*)self->version);
FREEMEM(self->prefix);
FREEMEM(self->Prefix);
@@ -377,7 +378,7 @@ CFCParcel_destroy(CFCParcel *self) {
int
CFCParcel_equals(CFCParcel *self, CFCParcel *other) {
if (strcmp(self->name, other->name)) { return false; }
- if (strcmp(self->cnick, other->cnick)) { return false; }
+ if (strcmp(self->nickname, other->nickname)) { return false; }
if (CFCVersion_compare_to(self->version, other->version) != 0) {
return false;
}
@@ -391,8 +392,8 @@ CFCParcel_get_name(CFCParcel *self) {
}
const char*
-CFCParcel_get_cnick(CFCParcel *self) {
- return self->cnick;
+CFCParcel_get_nickname(CFCParcel *self) {
+ return self->nickname;
}
CFCVersion*
@@ -603,7 +604,7 @@ CFCPrereq_new(const char *name, CFCVersion *version) {
CFCPrereq*
CFCPrereq_init(CFCPrereq *self, const char *name, CFCVersion *version) {
// Validate name.
- if (!name || !S_validate_name_or_cnick(name)) {
+ if (!name || !S_validate_name_or_nickname(name)) {
CFCUtil_die("Invalid name: '%s'", name ? name : "[NULL]");
}
self->name = CFCUtil_strdup(name);
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/d0486854/compiler/src/CFCParcel.h
----------------------------------------------------------------------
diff --git a/compiler/src/CFCParcel.h b/compiler/src/CFCParcel.h
index dcf1dfe..ec3d99a 100644
--- a/compiler/src/CFCParcel.h
+++ b/compiler/src/CFCParcel.h
@@ -62,7 +62,7 @@ void
CFCParcel_reap_singletons(void);
CFCParcel*
-CFCParcel_new(const char *name, const char *cnick,
+CFCParcel_new(const char *name, const char *nickname,
struct CFCVersion *version, int is_included);
CFCParcel*
@@ -72,7 +72,7 @@ CFCParcel*
CFCParcel_new_from_json(const char *json, int is_included);
CFCParcel*
-CFCParcel_init(CFCParcel *self, const char *name, const char *cnick,
+CFCParcel_init(CFCParcel *self, const char *name, const char *nickname,
struct CFCVersion *version, int is_included);
void
@@ -85,7 +85,7 @@ const char*
CFCParcel_get_name(CFCParcel *self);
const char*
-CFCParcel_get_cnick(CFCParcel *self);
+CFCParcel_get_nickname(CFCParcel *self);
struct CFCVersion*
CFCParcel_get_version(CFCParcel *self);