public IICalendarCollection icalendar(
ISerializationContext ctx
) //throws RecognitionException, TokenStreamException
{
IICalendarCollection iCalendars = new iCalendarCollection();
SerializationUtil.OnDeserializing(iCalendars);
IICalendar iCal = null;
ISerializationSettings settings = ctx.GetService(typeof(ISerializationSettings)) as ISerializationSettings;
{ // ( ... )*
for (;;)
{
if ((LA(1)==CRLF||LA(1)==BEGIN))
{
{ // ( ... )*
for (;;)
{
if ((LA(1)==CRLF))
{
match(CRLF);
}
else
{
goto _loop4_breakloop;
}
}
_loop4_breakloop: ;
} // ( ... )*
match(BEGIN);
match(COLON);
match(VCALENDAR);
{ // ( ... )*
for (;;)
{
if ((LA(1)==CRLF))
{
match(CRLF);
}
else
{
goto _loop6_breakloop;
}
}
_loop6_breakloop: ;
} // ( ... )*
ISerializationProcessor<IICalendar> processor = ctx.GetService(typeof(ISerializationProcessor<IICalendar>)) as ISerializationProcessor<IICalendar>;
// Do some pre-processing on the calendar:
if (processor != null)
processor.PreDeserialization(iCal);
iCal = (IICalendar)SerializationUtil.GetUninitializedObject(settings.iCalendarType);
SerializationUtil.OnDeserializing(iCal);
// Push the iCalendar onto the serialization context stack
ctx.Push(iCal);
icalbody(ctx, iCal);
match(END);
match(COLON);
match(VCALENDAR);
{ // ( ... )*
for (;;)
{
if ((LA(1)==CRLF) && (LA(2)==EOF||LA(2)==CRLF||LA(2)==BEGIN) && (tokenSet_0_.member(LA(3))))
{
match(CRLF);
}
else
{
goto _loop8_breakloop;
}
}
_loop8_breakloop: ;
} // ( ... )*
// Do some final processing on the calendar:
if (processor != null)
processor.PostDeserialization(iCal);
// Notify that the iCalendar has been loaded
iCal.OnLoaded();
iCalendars.Add(iCal);
SerializationUtil.OnDeserialized(iCal);
// Pop the iCalendar off the serialization context stack
ctx.Pop();
}
else
{
goto _loop9_breakloop;
}
}
_loop9_breakloop: ;
} // ( ... )*
SerializationUtil.OnDeserialized(iCalendars);
return iCalendars;
}