Simplify the handling of SerializableAttribute in portable libraries

This commit is contained in:
Sam Harwell 2014-04-28 07:38:01 -05:00 committed by Sam Harwell
parent 5924d1a9d2
commit cbd5d1ae85
15 changed files with 14 additions and 24 deletions

View File

@ -188,6 +188,7 @@
<Compile Include="Sharpen\AtomicReference`1.cs" />
<Compile Include="Sharpen\BitSet.cs" />
<Compile Include="Sharpen\Collections.cs" />
<Compile Include="Sharpen\Compat\SerializableAttribute.cs" />
<Compile Include="Sharpen\DictionaryExtensions.cs" />
<Compile Include="Sharpen\ListExtensions.cs" />
<Compile Include="Sharpen\Runtime.cs" />

View File

@ -193,6 +193,7 @@
<Compile Include="Sharpen\Collections.cs" />
<Compile Include="Sharpen\Compat\CollectionDebuggerView`2.cs" />
<Compile Include="Sharpen\Compat\ConcurrentDictionary`2.cs" />
<Compile Include="Sharpen\Compat\SerializableAttribute.cs" />
<Compile Include="Sharpen\Compat\SplitOrderedList`2.cs" />
<Compile Include="Sharpen\DictionaryExtensions.cs" />
<Compile Include="Sharpen\ListExtensions.cs" />

View File

@ -193,6 +193,7 @@
<Compile Include="Sharpen\Collections.cs" />
<Compile Include="Sharpen\Compat\CollectionDebuggerView`2.cs" />
<Compile Include="Sharpen\Compat\ConcurrentDictionary`2.cs" />
<Compile Include="Sharpen\Compat\SerializableAttribute.cs" />
<Compile Include="Sharpen\Compat\SplitOrderedList`2.cs" />
<Compile Include="Sharpen\DictionaryExtensions.cs" />
<Compile Include="Sharpen\ListExtensions.cs" />

View File

@ -44,9 +44,7 @@ namespace Antlr4.Runtime.Atn
/// utility methods for analyzing configuration sets for conflicts and/or
/// ambiguities.
/// </remarks>
#if !PORTABLE
[System.Serializable]
#endif
public sealed class PredictionMode
{
/// <summary>The SLL(*) prediction mode.</summary>

View File

@ -34,9 +34,7 @@ using Antlr4.Runtime.Sharpen;
namespace Antlr4.Runtime
{
#if !PORTABLE
[System.Serializable]
#endif
public class CommonToken : IWritableToken
{
private const long serialVersionUID = -6708843461296520577L;

View File

@ -42,9 +42,7 @@ namespace Antlr4.Runtime
/// Disambiguating predicate evaluation occurs when we test a predicate during
/// prediction.
/// </remarks>
#if !PORTABLE
[System.Serializable]
#endif
public class FailedPredicateException : RecognitionException
{
private const long serialVersionUID = 5379330841495778709L;

View File

@ -40,9 +40,7 @@ namespace Antlr4.Runtime
/// This signifies any kind of mismatched input exceptions such as
/// when the current input does not match the expected token.
/// </remarks>
#if !PORTABLE
[System.Serializable]
#endif
public class InputMismatchException : RecognitionException
{
private const long serialVersionUID = 1532568338707443067L;

View File

@ -35,9 +35,7 @@ using Antlr4.Runtime.Sharpen;
namespace Antlr4.Runtime
{
#if !PORTABLE
[System.Serializable]
#endif
public class LexerNoViableAltException : RecognitionException
{
private const long serialVersionUID = -730999203913001726L;

View File

@ -34,9 +34,7 @@ using Antlr4.Runtime.Sharpen;
namespace Antlr4.Runtime.Misc
{
#if !PORTABLE
[System.Serializable]
#endif
public class MultiMap<K, V> : Dictionary<K, IList<V>>
{
private const long serialVersionUID = -4956746660057462312L;

View File

@ -48,9 +48,7 @@ namespace Antlr4.Runtime.Misc
/// response to a parse error.
/// </remarks>
/// <author>Sam Harwell</author>
#if !PORTABLE
[System.Serializable]
#endif
public class ParseCanceledException : OperationCanceledException
{
public ParseCanceledException()

View File

@ -44,9 +44,7 @@ namespace Antlr4.Runtime
/// of the offending input and also knows where the parser was
/// in the various paths when the error. Reported by reportNoViableAlternative()
/// </remarks>
#if !PORTABLE
[System.Serializable]
#endif
public class NoViableAltException : RecognitionException
{
private const long serialVersionUID = 5096000008992867052L;

View File

@ -43,9 +43,7 @@ namespace Antlr4.Runtime
/// in the input, where it is in the ATN, the rule invocation stack,
/// and what kind of problem occurred.
/// </remarks>
#if !PORTABLE
[System.Serializable]
#endif
public class RecognitionException : Exception
{
private const long serialVersionUID = -3861826954750022374L;

View File

@ -0,0 +1,11 @@
#if PORTABLE
namespace System
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Delegate, Inherited = false)]
internal sealed class SerializableAttribute : Attribute
{
}
}
#endif

View File

@ -155,9 +155,7 @@ namespace Antlr4.Runtime.Tree.Pattern
/// </summary>
public class ParseTreePatternMatcher
{
#if !PORTABLE
[System.Serializable]
#endif
public class CannotInvokeStartRule : Exception
{
public CannotInvokeStartRule(Exception e)
@ -166,9 +164,7 @@ namespace Antlr4.Runtime.Tree.Pattern
}
}
#if !PORTABLE
[System.Serializable]
#endif
public class StartRuleDoesNotConsumeFullPattern : Exception
{
// Fixes https://github.com/antlr/antlr4/issues/413

View File

@ -43,9 +43,7 @@ namespace Antlr4.Runtime.Tree.Pattern
/// chunks where the
/// tag corresponds to a lexer rule or token type.
/// </summary>
#if !PORTABLE
[System.Serializable]
#endif
public class TokenTagToken : CommonToken
{
/// <summary>