Esempio n. 1
0
        public void icalbody(
            ISerializationContext ctx, IICalendar iCal
            ) //throws RecognitionException, TokenStreamException
        {
            ISerializerFactory        sf = ctx.GetService(typeof(ISerializerFactory)) as ISerializerFactory;
            ICalendarComponentFactory cf = ctx.GetService(typeof(ICalendarComponentFactory)) as ICalendarComponentFactory;

            {        // ( ... )*
                for (;;)
                {
                    switch (LA(1))
                    {
                    case IANA_TOKEN:
                    case X_NAME:
                    {
                        property(ctx, iCal);
                        break;
                    }

                    case BEGIN:
                    {
                        component(ctx, sf, cf, iCal);
                        break;
                    }

                    default:
                    {
                        goto _loop12_breakloop;
                    }
                    }
                }
                _loop12_breakloop :;
            }        // ( ... )*
        }
Esempio n. 2
0
        /// <summary>
        /// Normalizes line endings, converting "\r" into "\r\n" and "\n" into "\r\n".        
        /// </summary>
        public static TextReader Normalize(string s, ISerializationContext ctx)
        {
            // Replace \r and \n with \r\n.
            s = Regex.Replace(s, @"((\r(?=[^\n]))|((?<=[^\r])\n))", "\r\n");

            ISerializationSettings settings = ctx.GetService(typeof(ISerializationSettings)) as ISerializationSettings;
            if (settings == null || !settings.EnsureAccurateLineNumbers)
                s = RemoveEmptyLines(UnwrapLines(s));

            return new StringReader(s);
        }
Esempio n. 3
0
        /// <summary>
        /// Normalizes line endings, converting "\r" into "\r\n" and "\n" into "\r\n".
        /// </summary>
        public static TextReader Normalize(string s, ISerializationContext ctx)
        {
            // Replace \r and \n with \r\n.
            s = Regex.Replace(s, @"((\r(?=[^\n]))|((?<=[^\r])\n))", "\r\n");

            ISerializationSettings settings = ctx.GetService(typeof(ISerializationSettings)) as ISerializationSettings;

            if (settings == null || !settings.EnsureAccurateLineNumbers)
            {
                s = RemoveEmptyLines(UnwrapLines(s));
            }

            return(new StringReader(s));
        }
Esempio n. 4
0
 public string DecodeString(string encoding, string value)
 {
     if (encoding != null && value != null)
     {
         var data = DecodeData(encoding, value);
         if (data != null)
         {
             // Decode the string into the current encoding
             var encodingStack = _mSerializationContext.GetService(typeof(IEncodingStack)) as IEncodingStack;
             return(encodingStack.Current.GetString(data));
         }
     }
     return(null);
 }
Esempio n. 5
0
        /// <summary>
        /// Normalizes line endings, converting "\r" into "\r\n" and "\n" into "\r\n".
        /// </summary>
        public static TextReader Normalize(string s, ISerializationContext ctx)
        {
            // Replace \r and \n with \r\n.
            s = _normalizeToCrLf.Replace(s, "\r\n");

            var settings = ctx.GetService(typeof(ISerializationSettings)) as ISerializationSettings;

            if (settings == null || !settings.EnsureAccurateLineNumbers)
            {
                s = RemoveEmptyLines(UnwrapLines(s));
            }

            return(new StringReader(s));
        }
Esempio n. 6
0
        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);
        }
Esempio n. 7
0
        public ICalendarComponent  component(

            ISerializationContext ctx,
            ISerializerFactory sf,
            ICalendarComponentFactory cf,
            ICalendarObject o

            ) //throws RecognitionException, TokenStreamException
        {
            ICalendarComponent c = null;;

            IToken n = null;
            IToken m = null;

            match(BEGIN);
            match(COLON);
            {
                switch (LA(1))
                {
                case IANA_TOKEN:
                {
                    n = LT(1);
                    match(IANA_TOKEN);
                    c = cf.Build(n.getText().ToLower(), true);
                    break;
                }

                case X_NAME:
                {
                    m = LT(1);
                    match(X_NAME);
                    c = cf.Build(m.getText().ToLower(), true);
                    break;
                }

                default:
                {
                    throw new NoViableAltException(LT(1), getFilename());
                }
                }
            }

            ISerializationProcessor <ICalendarComponent> processor = ctx.GetService(typeof(ISerializationProcessor <ICalendarComponent>)) as ISerializationProcessor <ICalendarComponent>;

            // Do some pre-processing on the component
            if (processor != null)
            {
                processor.PreDeserialization(c);
            }

            SerializationUtil.OnDeserializing(c);

            // Push the component onto the serialization context stack
            ctx.Push(c);

            if (o != null)
            {
                // Add the component as a child immediately, in case
                // embedded components need to access this component,
                // or the iCalendar itself.
                o.AddChild(c);
            }

            c.Line   = n.getLine();
            c.Column = n.getColumn();

            {        // ( ... )*
                for (;;)
                {
                    if ((LA(1) == CRLF))
                    {
                        match(CRLF);
                    }
                    else
                    {
                        goto _loop16_breakloop;
                    }
                }
                _loop16_breakloop :;
            }        // ( ... )*
            {        // ( ... )*
                for (;;)
                {
                    switch (LA(1))
                    {
                    case IANA_TOKEN:
                    case X_NAME:
                    {
                        property(ctx, c);
                        break;
                    }

                    case BEGIN:
                    {
                        component(ctx, sf, cf, c);
                        break;
                    }

                    default:
                    {
                        goto _loop18_breakloop;
                    }
                    }
                }
                _loop18_breakloop :;
            }        // ( ... )*
            match(END);
            match(COLON);
            match(IANA_TOKEN);
            {        // ( ... )*
                for (;;)
                {
                    if ((LA(1) == CRLF))
                    {
                        match(CRLF);
                    }
                    else
                    {
                        goto _loop20_breakloop;
                    }
                }
                _loop20_breakloop :;
            }        // ( ... )*

            // Do some final processing on the component
            if (processor != null)
            {
                processor.PostDeserialization(c);
            }

            // Notify that the component has been loaded
            c.OnLoaded();

            SerializationUtil.OnDeserialized(c);

            // Pop the component off the serialization context stack
            ctx.Pop();

            return(c);
        }
Esempio n. 8
0
        public ICalendarProperty  property(

            ISerializationContext ctx,
            ICalendarPropertyListContainer c

            ) //throws RecognitionException, TokenStreamException
        {
            ICalendarProperty p = null;;

            IToken n = null;
            IToken m = null;

            string v;


            {
                switch (LA(1))
                {
                case IANA_TOKEN:
                {
                    n = LT(1);
                    match(IANA_TOKEN);

                    p      = new CalendarProperty(n.getLine(), n.getColumn());
                    p.Name = n.getText().ToUpper();

                    break;
                }

                case X_NAME:
                {
                    m = LT(1);
                    match(X_NAME);

                    p      = new CalendarProperty(m.getLine(), m.getColumn());
                    p.Name = m.getText().ToUpper();

                    break;
                }

                default:
                {
                    throw new NoViableAltException(LT(1), getFilename());
                }
                }
            }

            ISerializationProcessor <ICalendarProperty> processor = ctx.GetService(typeof(ISerializationProcessor <ICalendarProperty>)) as ISerializationProcessor <ICalendarProperty>;

            // Do some pre-processing on the property
            if (processor != null)
            {
                processor.PreDeserialization(p);
            }

            if (c != null)
            {
                // Add the property to the container, as the parent object(s)
                // may be needed during deserialization.
                c.Properties.Add(p);
            }

            // Push the property onto the serialization context stack
            ctx.Push(p);
            IStringSerializer dataMapSerializer = new DataMapSerializer(ctx);

            {        // ( ... )*
                for (;;)
                {
                    if ((LA(1) == SEMICOLON))
                    {
                        match(SEMICOLON);
                        parameter(ctx, p);
                    }
                    else
                    {
                        goto _loop24_breakloop;
                    }
                }
                _loop24_breakloop :;
            }        // ( ... )*
            match(COLON);
            v = value();

            // Deserialize the value of the property
            // into a concrete iCalendar data type,
            // a list of concrete iCalendar data types,
            // or string value.
            object deserialized = dataMapSerializer.Deserialize(new StringReader(v));

            if (deserialized != null)
            {
                // Try to determine if this is was deserialized as a *list*
                // of concrete types.
                Type targetType       = dataMapSerializer.TargetType;
                Type listOfTargetType = typeof(IList <>).MakeGenericType(targetType);
                if (listOfTargetType.IsAssignableFrom(deserialized.GetType()))
                {
                    // We deserialized a list - add each value to the
                    // resulting object.
                    foreach (var item in (IEnumerable)deserialized)
                    {
                        p.AddValue(item);
                    }
                }
                else
                {
                    // We deserialized a single value - add it to the object.
                    p.AddValue(deserialized);
                }
            }

            {        // ( ... )*
                for (;;)
                {
                    if ((LA(1) == CRLF))
                    {
                        match(CRLF);
                    }
                    else
                    {
                        goto _loop26_breakloop;
                    }
                }
                _loop26_breakloop :;
            }        // ( ... )*

            // Do some final processing on the property:
            if (processor != null)
            {
                processor.PostDeserialization(p);
            }

            // Notify that the property has been loaded
            p.OnLoaded();

            // Pop the property off the serialization context stack
            ctx.Pop();

            return(p);
        }
Esempio n. 9
0
	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;
	}
Esempio n. 10
0
	public ICalendarComponent  component(
		
	ISerializationContext ctx,
	ISerializerFactory sf,
	ICalendarComponentFactory cf,
	ICalendarObject o

	) //throws RecognitionException, TokenStreamException
{
		ICalendarComponent c = null;;
		
		IToken  n = null;
		IToken  m = null;
		
		match(BEGIN);
		match(COLON);
		{
			switch ( LA(1) )
			{
			case IANA_TOKEN:
			{
				n = LT(1);
				match(IANA_TOKEN);
				c = cf.Build(n.getText().ToLower(), true);
				break;
			}
			case X_NAME:
			{
				m = LT(1);
				match(X_NAME);
				c = cf.Build(m.getText().ToLower(), true);
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			 }
		}
		
			ISerializationProcessor<ICalendarComponent> processor = ctx.GetService(typeof(ISerializationProcessor<ICalendarComponent>)) as ISerializationProcessor<ICalendarComponent>;
			// Do some pre-processing on the component
			if (processor != null)
				processor.PreDeserialization(c);
		
			SerializationUtil.OnDeserializing(c);
		
			// Push the component onto the serialization context stack
			ctx.Push(c);
		
			if (o != null)
			{
				// Add the component as a child immediately, in case
				// embedded components need to access this component,
				// or the iCalendar itself.
				o.AddChild(c); 
			}
			
			c.Line = n.getLine();
			c.Column = n.getColumn();
		
		{    // ( ... )*
			for (;;)
			{
				if ((LA(1)==CRLF))
				{
					match(CRLF);
				}
				else
				{
					goto _loop16_breakloop;
				}
				
			}
_loop16_breakloop:			;
		}    // ( ... )*
		{    // ( ... )*
			for (;;)
			{
				switch ( LA(1) )
				{
				case IANA_TOKEN:
				case X_NAME:
				{
					property(ctx, c);
					break;
				}
				case BEGIN:
				{
					component(ctx, sf, cf, c);
					break;
				}
				default:
				{
					goto _loop18_breakloop;
				}
				 }
			}
_loop18_breakloop:			;
		}    // ( ... )*
		match(END);
		match(COLON);
		match(IANA_TOKEN);
		{    // ( ... )*
			for (;;)
			{
				if ((LA(1)==CRLF))
				{
					match(CRLF);
				}
				else
				{
					goto _loop20_breakloop;
				}
				
			}
_loop20_breakloop:			;
		}    // ( ... )*
			
			// Do some final processing on the component
			if (processor != null)
				processor.PostDeserialization(c);
		
			// Notify that the component has been loaded
			c.OnLoaded();
			
			SerializationUtil.OnDeserialized(c);
			
			// Pop the component off the serialization context stack
			ctx.Pop();
		
		return c;
	}
Esempio n. 11
0
	public ICalendarProperty  property(
		
	ISerializationContext ctx,	
	ICalendarPropertyListContainer c

	) //throws RecognitionException, TokenStreamException
{
		ICalendarProperty p = null;;
		
		IToken  n = null;
		IToken  m = null;
		
			string v;
		
		
		{
			switch ( LA(1) )
			{
			case IANA_TOKEN:
			{
				n = LT(1);
				match(IANA_TOKEN);
				
						p = new CalendarProperty(n.getLine(), n.getColumn());
						p.Name = n.getText().ToUpper();
					
				break;
			}
			case X_NAME:
			{
				m = LT(1);
				match(X_NAME);
				
						p = new CalendarProperty(m.getLine(), m.getColumn());
						p.Name = m.getText().ToUpper();
					
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			 }
		}
		
			ISerializationProcessor<ICalendarProperty> processor = ctx.GetService(typeof(ISerializationProcessor<ICalendarProperty>)) as ISerializationProcessor<ICalendarProperty>;
			// Do some pre-processing on the property
			if (processor != null)
				processor.PreDeserialization(p);
		
			if (c != null)
			{
				// Add the property to the container, as the parent object(s)
				// may be needed during deserialization.
				c.Properties.Add(p);
			}
		
			// Push the property onto the serialization context stack
			ctx.Push(p);
			IStringSerializer dataMapSerializer = new DataMapSerializer(ctx);
		
		{    // ( ... )*
			for (;;)
			{
				if ((LA(1)==SEMICOLON))
				{
					match(SEMICOLON);
					parameter(ctx, p);
				}
				else
				{
					goto _loop24_breakloop;
				}
				
			}
_loop24_breakloop:			;
		}    // ( ... )*
		match(COLON);
		v=value();
		
			// Deserialize the value of the property
			// into a concrete iCalendar data type,
			// a list of concrete iCalendar data types,
			// or string value.
			object deserialized = dataMapSerializer.Deserialize(new StringReader(v));
		if (deserialized != null)
		{
				// Try to determine if this is was deserialized as a *list*
				// of concrete types.
		Type targetType = dataMapSerializer.TargetType;
		Type listOfTargetType = typeof(IList<>).MakeGenericType(targetType);
		if (listOfTargetType.IsAssignableFrom(deserialized.GetType()))
		{
					// We deserialized a list - add each value to the
					// resulting object.
		foreach (var item in (IEnumerable)deserialized)
		p.AddValue(item);
		}
		else
		{
					// We deserialized a single value - add it to the object.
		p.AddValue(deserialized);
		}
		}
		
		{    // ( ... )*
			for (;;)
			{
				if ((LA(1)==CRLF))
				{
					match(CRLF);
				}
				else
				{
					goto _loop26_breakloop;
				}
				
			}
_loop26_breakloop:			;
		}    // ( ... )*
		
			// Do some final processing on the property:
			if (processor != null)
				processor.PostDeserialization(p);
		
			// Notify that the property has been loaded
			p.OnLoaded();
			
			// Pop the property off the serialization context stack
			ctx.Pop();
		
		return p;
	}
Esempio n. 12
0
	public void icalbody(
		ISerializationContext ctx, IICalendar iCal
	) //throws RecognitionException, TokenStreamException
{
		
		
		
			ISerializerFactory sf = ctx.GetService(typeof(ISerializerFactory)) as ISerializerFactory;
			ICalendarComponentFactory cf = ctx.GetService(typeof(ICalendarComponentFactory)) as ICalendarComponentFactory;
			ICalendarComponent c;
			ICalendarProperty p;
		
		{    // ( ... )*
			for (;;)
			{
				switch ( LA(1) )
				{
				case IANA_TOKEN:
				case X_NAME:
				{
					property(ctx, iCal);
					break;
				}
				case BEGIN:
				{
					component(ctx, sf, cf, iCal);
					break;
				}
				default:
				{
					goto _loop12_breakloop;
				}
				 }
			}
_loop12_breakloop:			;
		}    // ( ... )*
	}
Esempio n. 13
0
	public ICalendarProperty  property(
		
	ISerializationContext ctx,	
	ICalendarPropertyListContainer c

	) //throws RecognitionException, TokenStreamException
{
		ICalendarProperty p = null;;
		
		IToken  n = null;
		IToken  m = null;
		
			string v;
		
		
		{
			switch ( LA(1) )
			{
			case IANA_TOKEN:
			{
				n = LT(1);
				match(IANA_TOKEN);
				
						p = new CalendarProperty(n.getLine(), n.getColumn());
						p.Name = n.getText().ToUpper();
					
				break;
			}
			case X_NAME:
			{
				m = LT(1);
				match(X_NAME);
				
						p = new CalendarProperty(m.getLine(), m.getColumn());
						p.Name = m.getText().ToUpper();
					
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			 }
		}
		
			ISerializationProcessor<ICalendarProperty> processor = ctx.GetService(typeof(ISerializationProcessor<ICalendarProperty>)) as ISerializationProcessor<ICalendarProperty>;
			// Do some pre-processing on the property
			if (processor != null)
				processor.PreDeserialization(p);
		
			if (c != null)
			{
				// Add the property to the container, as the parent object(s)
				// may be needed during deserialization.
				c.Properties.Add(p);
			}
		
			// Push the property onto the serialization context stack
			ctx.Push(p);
            IStringSerializer dataMapSerializer = new DataMapSerializer(ctx);
		
		{    // ( ... )*
			for (;;)
			{
				if ((LA(1)==SEMICOLON))
				{
					match(SEMICOLON);
					parameter(ctx, p);
				}
				else
				{
					goto _loop24_breakloop;
				}
				
			}
_loop24_breakloop:			;
		}    // ( ... )*
		match(COLON);
		v=value();
		
			// Deserialize the value of the property
			// into a concrete iCalendar data type,
			// or string value.
            p.Value = dataMapSerializer.Deserialize(new StringReader(v));
		
		{    // ( ... )*
			for (;;)
			{
				if ((LA(1)==CRLF))
				{
					match(CRLF);
				}
				else
				{
					goto _loop26_breakloop;
				}
				
			}
_loop26_breakloop:			;
		}    // ( ... )*
		
			// Do some final processing on the property:
			if (processor != null)
				processor.PostDeserialization(p);
		
			// Notify that the property has been loaded
			p.OnLoaded();
			
			// Pop the property off the serialization context stack
			ctx.Pop();
		
		return p;
	}
Esempio n. 14
0
        public ICalendarProperty  property(

            ISerializationContext ctx,
            ICalendarPropertyListContainer c

            ) //throws RecognitionException, TokenStreamException
        {
            ICalendarProperty p = null;;

            IToken n = null;
            IToken m = null;

            string v;


            {
                switch (LA(1))
                {
                case IANA_TOKEN:
                {
                    n = LT(1);
                    match(IANA_TOKEN);

                    p      = new CalendarProperty(n.getLine(), n.getColumn());
                    p.Name = n.getText().ToUpper();

                    break;
                }

                case X_NAME:
                {
                    m = LT(1);
                    match(X_NAME);

                    p      = new CalendarProperty(m.getLine(), m.getColumn());
                    p.Name = m.getText().ToUpper();

                    break;
                }

                default:
                {
                    throw new NoViableAltException(LT(1), getFilename());
                }
                }
            }

            ISerializationProcessor <ICalendarProperty> processor = ctx.GetService(typeof(ISerializationProcessor <ICalendarProperty>)) as ISerializationProcessor <ICalendarProperty>;

            // Do some pre-processing on the property
            if (processor != null)
            {
                processor.PreDeserialization(p);
            }

            if (c != null)
            {
                // Add the property to the container, as the parent object(s)
                // may be needed during deserialization.
                c.Properties.Add(p);
            }

            // Push the property onto the serialization context stack
            ctx.Push(p);
            IStringSerializer dataMapSerializer = new DataMapSerializer(ctx);

            {        // ( ... )*
                for (;;)
                {
                    if ((LA(1) == SEMICOLON))
                    {
                        match(SEMICOLON);
                        parameter(ctx, p);
                    }
                    else
                    {
                        goto _loop24_breakloop;
                    }
                }
                _loop24_breakloop :;
            }        // ( ... )*
            match(COLON);
            v = value();

            // Deserialize the value of the property
            // into a concrete iCalendar data type,
            // or string value.
            p.Value = dataMapSerializer.Deserialize(new StringReader(v));

            {        // ( ... )*
                for (;;)
                {
                    if ((LA(1) == CRLF))
                    {
                        match(CRLF);
                    }
                    else
                    {
                        goto _loop26_breakloop;
                    }
                }
                _loop26_breakloop :;
            }        // ( ... )*

            // Do some final processing on the property:
            if (processor != null)
            {
                processor.PostDeserialization(p);
            }

            // Notify that the property has been loaded
            p.OnLoaded();

            // Pop the property off the serialization context stack
            ctx.Pop();

            return(p);
        }