addState("ALIVE");
addRule(new CARule(new BooleanCondition(true),
new WolframCondition(r), 1, 1));
addRule(new CARule(new BooleanCondition(true),
new AntiWolframCondition(r), 0, 1));
retval.neighborhood = new NeumannNeighborhood(1, null);
neighborhood = retval.neighborhood;
retval.isWolfram = true;
retval.wolframRule = r;
}
}
break;
case 2:
// C:/Documents and Settings/stefan/Desktop/James II Dev/James II
// Trunk/plugins/ca_rules_f_antlr/src/model/carules/reader/antlr/parser/Carule.g:159:40:
// ( (d= dimension ) (n= neighborhood )? ( statedef )+ ( carule )+ )
{
// C:/Documents and Settings/stefan/Desktop/James II Dev/James II
// Trunk/plugins/ca_rules_f_antlr/src/model/carules/reader/antlr/parser/Carule.g:159:40:
// ( (d= dimension ) (n= neighborhood )? ( statedef )+ ( carule )+ )
// C:/Documents and Settings/stefan/Desktop/James II Dev/James II
// Trunk/plugins/ca_rules_f_antlr/src/model/carules/reader/antlr/parser/Carule.g:159:41:
// (d= dimension ) (n= neighborhood )? ( statedef )+ ( carule )+
{
// C:/Documents and Settings/stefan/Desktop/James II Dev/James II
// Trunk/plugins/ca_rules_f_antlr/src/model/carules/reader/antlr/parser/Carule.g:159:41:
// (d= dimension )
// C:/Documents and Settings/stefan/Desktop/James II Dev/James II
// Trunk/plugins/ca_rules_f_antlr/src/model/carules/reader/antlr/parser/Carule.g:159:42:
// d= dimension
{
pushFollow(FOLLOW_dimension_in_camodel136);
d = dimension();
state._fsp--;
retval.dimensions = (d != null ? d.dimension : 0);
dimensions = (d != null ? d.dimension : 0);
}
// C:/Documents and Settings/stefan/Desktop/James II Dev/James II
// Trunk/plugins/ca_rules_f_antlr/src/model/carules/reader/antlr/parser/Carule.g:163:40:
// (n= neighborhood )?
int alt1 = 2;
int LA1_0 = input.LA(1);
if ((LA1_0 == NEIGHBORHOOD)) {
alt1 = 1;
}
switch (alt1) {
case 1:
// C:/Documents and Settings/stefan/Desktop/James II Dev/James II
// Trunk/plugins/ca_rules_f_antlr/src/model/carules/reader/antlr/parser/Carule.g:163:41:
// n= neighborhood
{
pushFollow(FOLLOW_neighborhood_in_camodel184);
n = neighborhood();
state._fsp--;
retval.neighborhood = n;
neighborhood = retval.neighborhood;
neighborhoodDefined = true;
}
break;
}
// C:/Documents and Settings/stefan/Desktop/James II Dev/James II
// Trunk/plugins/ca_rules_f_antlr/src/model/carules/reader/antlr/parser/Carule.g:168:41:
// ( statedef )+
int cnt2 = 0;
loop2: do {
int alt2 = 2;
int LA2_0 = input.LA(1);
if ((LA2_0 == STATE)) {
alt2 = 1;
}
switch (alt2) {
case 1:
// C:/Documents and Settings/stefan/Desktop/James II Dev/James II
// Trunk/plugins/ca_rules_f_antlr/src/model/carules/reader/antlr/parser/Carule.g:168:41:
// statedef
{
pushFollow(FOLLOW_statedef_in_camodel231);
statedef();
state._fsp--;
}
break;
default:
if (cnt2 >= 1) {
break loop2;
}
EarlyExitException eee = new EarlyExitException(2, input);
throw eee;
}
cnt2++;
} while (true);
// C:/Documents and Settings/stefan/Desktop/James II Dev/James II
// Trunk/plugins/ca_rules_f_antlr/src/model/carules/reader/antlr/parser/Carule.g:168:51:
// ( carule )+
int cnt3 = 0;
loop3: do {
int alt3 = 2;
int LA3_0 = input.LA(1);
if ((LA3_0 == RULE)) {
alt3 = 1;
}
switch (alt3) {
case 1:
// C:/Documents and Settings/stefan/Desktop/James II Dev/James II
// Trunk/plugins/ca_rules_f_antlr/src/model/carules/reader/antlr/parser/Carule.g:168:51:
// carule
{
pushFollow(FOLLOW_carule_in_camodel234);
carule();
state._fsp--;
}
break;
default:
if (cnt3 >= 1) {
break loop3;
}
EarlyExitException eee = new EarlyExitException(3, input);
throw eee;
}
cnt3++;
} while (true);
}
if (retval.neighborhood == null && !neighborhoodDefined) {
// use standard neumann neighborhood
if (NeumannNeighborhood.isDimensionSupported(retval.dimensions)) {
retval.neighborhood =
new NeumannNeighborhood(retval.dimensions, null);
neighborhood = retval.neighborhood;
} else {
addProblemToken(CAProblemToken.VALUE_OUT_OF_RANGE,
(d != null ? ((Token) d.start) : null).getTokenIndex(),
"Default Neighborhood (Neumann) does not support the specified dimension.");