Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Decompiled with JetBrains decompiler
- // Type: CompilerLib.Token
- // Assembly: CompilerLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
- // MVID: 5C2BD8B5-BFF6-2D3A-A745-0383B5D82B5C
- // Assembly location: D:\JB\CompilerLib.dll
- using Microsoft.FSharp.Core;
- using System;
- using System.Collections;
- using System.Diagnostics;
- using System.Runtime.CompilerServices;
- using System.Runtime.InteropServices;
- namespace CompilerLib
- {
- [DebuggerDisplay("{__DebugDisplay(),nq}")]
- [CompilationMapping]
- [Serializable]
- [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)]
- public class Token : IEquatable<Token>, IStructuralEquatable, IComparable<Token>, IComparable, IStructuralComparable
- {
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- [CompilerGenerated]
- [DebuggerNonUserCode]
- internal static readonly Token _unique_IncrementPtr = new Token(0);
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- [CompilerGenerated]
- [DebuggerNonUserCode]
- internal static readonly Token _unique_DecrementPtr = new Token(1);
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- [CompilerGenerated]
- [DebuggerNonUserCode]
- internal static readonly Token _unique_IncrementData = new Token(2);
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- [CompilerGenerated]
- [DebuggerNonUserCode]
- internal static readonly Token _unique_DecrementData = new Token(3);
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- [CompilerGenerated]
- [DebuggerNonUserCode]
- internal static readonly Token _unique_OutputData = new Token(4);
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- [CompilerGenerated]
- [DebuggerNonUserCode]
- internal static readonly Token _unique_InputData = new Token(5);
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- [CompilerGenerated]
- [DebuggerNonUserCode]
- internal static readonly Token _unique_LoopStart = new Token(6);
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- [CompilerGenerated]
- [DebuggerNonUserCode]
- internal static readonly Token _unique_LoopEnd = new Token(7);
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- [CompilerGenerated]
- [DebuggerNonUserCode]
- internal static readonly Token _unique_Unknown = new Token(8);
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- [CompilerGenerated]
- [DebuggerNonUserCode]
- internal static readonly Token _unique_ClearData = new Token(11);
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- [CompilerGenerated]
- [DebuggerNonUserCode]
- internal readonly int _tag;
- [CompilerGenerated]
- [DebuggerNonUserCode]
- internal Token(int _tag)
- {
- this._tag = _tag;
- }
- [CompilationMapping]
- public static Token get_IncrementPtr()
- {
- return Token._unique_IncrementPtr;
- }
- [CompilerGenerated]
- [DebuggerNonUserCode]
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- public static Token IncrementPtr
- {
- [CompilationMapping] get
- {
- return Token._unique_IncrementPtr;
- }
- }
- [DebuggerNonUserCode]
- public bool get_IsIncrementPtr()
- {
- return this.get_Tag() == 0;
- }
- [CompilerGenerated]
- [DebuggerNonUserCode]
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- public bool IsIncrementPtr
- {
- [DebuggerNonUserCode] get
- {
- return this.get_Tag() == 0;
- }
- }
- [CompilerGenerated]
- [DebuggerNonUserCode]
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- public static Token DecrementPtr
- {
- [CompilationMapping] get
- {
- return Token._unique_DecrementPtr;
- }
- }
- [CompilationMapping]
- public static Token get_DecrementPtr()
- {
- return Token._unique_DecrementPtr;
- }
- [DebuggerNonUserCode]
- public bool get_IsDecrementPtr()
- {
- return this.get_Tag() == 1;
- }
- [CompilerGenerated]
- [DebuggerNonUserCode]
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- public bool IsDecrementPtr
- {
- [DebuggerNonUserCode] get
- {
- return this.get_Tag() == 1;
- }
- }
- [CompilationMapping]
- public static Token get_IncrementData()
- {
- return Token._unique_IncrementData;
- }
- [CompilerGenerated]
- [DebuggerNonUserCode]
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- public static Token IncrementData
- {
- [CompilationMapping] get
- {
- return Token._unique_IncrementData;
- }
- }
- [CompilerGenerated]
- [DebuggerNonUserCode]
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- public bool IsIncrementData
- {
- [DebuggerNonUserCode] get
- {
- return this.get_Tag() == 2;
- }
- }
- [DebuggerNonUserCode]
- public bool get_IsIncrementData()
- {
- return this.get_Tag() == 2;
- }
- [CompilerGenerated]
- [DebuggerNonUserCode]
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- public static Token DecrementData
- {
- [CompilationMapping] get
- {
- return Token._unique_DecrementData;
- }
- }
- [CompilationMapping]
- public static Token get_DecrementData()
- {
- return Token._unique_DecrementData;
- }
- [DebuggerNonUserCode]
- public bool get_IsDecrementData()
- {
- return this.get_Tag() == 3;
- }
- [CompilerGenerated]
- [DebuggerNonUserCode]
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- public bool IsDecrementData
- {
- [DebuggerNonUserCode] get
- {
- return this.get_Tag() == 3;
- }
- }
- [CompilerGenerated]
- [DebuggerNonUserCode]
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- public static Token OutputData
- {
- [CompilationMapping] get
- {
- return Token._unique_OutputData;
- }
- }
- [CompilationMapping]
- public static Token get_OutputData()
- {
- return Token._unique_OutputData;
- }
- [DebuggerNonUserCode]
- public bool get_IsOutputData()
- {
- return this.get_Tag() == 4;
- }
- [CompilerGenerated]
- [DebuggerNonUserCode]
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- public bool IsOutputData
- {
- [DebuggerNonUserCode] get
- {
- return this.get_Tag() == 4;
- }
- }
- [CompilerGenerated]
- [DebuggerNonUserCode]
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- public static Token InputData
- {
- [CompilationMapping] get
- {
- return Token._unique_InputData;
- }
- }
- [CompilationMapping]
- public static Token get_InputData()
- {
- return Token._unique_InputData;
- }
- [CompilerGenerated]
- [DebuggerNonUserCode]
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- public bool IsInputData
- {
- [DebuggerNonUserCode] get
- {
- return this.get_Tag() == 5;
- }
- }
- [DebuggerNonUserCode]
- public bool get_IsInputData()
- {
- return this.get_Tag() == 5;
- }
- [CompilationMapping]
- public static Token get_LoopStart()
- {
- return Token._unique_LoopStart;
- }
- [CompilerGenerated]
- [DebuggerNonUserCode]
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- public static Token LoopStart
- {
- [CompilationMapping] get
- {
- return Token._unique_LoopStart;
- }
- }
- [DebuggerNonUserCode]
- public bool get_IsLoopStart()
- {
- return this.get_Tag() == 6;
- }
- [CompilerGenerated]
- [DebuggerNonUserCode]
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- public bool IsLoopStart
- {
- [DebuggerNonUserCode] get
- {
- return this.get_Tag() == 6;
- }
- }
- [CompilationMapping]
- public static Token get_LoopEnd()
- {
- return Token._unique_LoopEnd;
- }
- [CompilerGenerated]
- [DebuggerNonUserCode]
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- public static Token LoopEnd
- {
- [CompilationMapping] get
- {
- return Token._unique_LoopEnd;
- }
- }
- [DebuggerNonUserCode]
- public bool get_IsLoopEnd()
- {
- return this.get_Tag() == 7;
- }
- [CompilerGenerated]
- [DebuggerNonUserCode]
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- public bool IsLoopEnd
- {
- [DebuggerNonUserCode] get
- {
- return this.get_Tag() == 7;
- }
- }
- [CompilerGenerated]
- [DebuggerNonUserCode]
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- public static Token Unknown
- {
- [CompilationMapping] get
- {
- return Token._unique_Unknown;
- }
- }
- [CompilationMapping]
- public static Token get_Unknown()
- {
- return Token._unique_Unknown;
- }
- [CompilerGenerated]
- [DebuggerNonUserCode]
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- public bool IsUnknown
- {
- [DebuggerNonUserCode] get
- {
- return this.get_Tag() == 8;
- }
- }
- [DebuggerNonUserCode]
- public bool get_IsUnknown()
- {
- return this.get_Tag() == 8;
- }
- [CompilationMapping]
- public static Token NewMovePtrDelta(int _delta)
- {
- return (Token) new Token.MovePtrDelta(_delta);
- }
- [DebuggerNonUserCode]
- public bool get_IsMovePtrDelta()
- {
- return this.get_Tag() == 9;
- }
- [CompilerGenerated]
- [DebuggerNonUserCode]
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- public bool IsMovePtrDelta
- {
- [DebuggerNonUserCode] get
- {
- return this.get_Tag() == 9;
- }
- }
- [CompilationMapping]
- public static Token NewSetDataDelta(int _delta)
- {
- return (Token) new Token.SetDataDelta(_delta);
- }
- [CompilerGenerated]
- [DebuggerNonUserCode]
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- public bool IsSetDataDelta
- {
- [DebuggerNonUserCode] get
- {
- return this.get_Tag() == 10;
- }
- }
- [DebuggerNonUserCode]
- public bool get_IsSetDataDelta()
- {
- return this.get_Tag() == 10;
- }
- [CompilerGenerated]
- [DebuggerNonUserCode]
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- public static Token ClearData
- {
- [CompilationMapping] get
- {
- return Token._unique_ClearData;
- }
- }
- [CompilationMapping]
- public static Token get_ClearData()
- {
- return Token._unique_ClearData;
- }
- [CompilerGenerated]
- [DebuggerNonUserCode]
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- public bool IsClearData
- {
- [DebuggerNonUserCode] get
- {
- return this.get_Tag() == 11;
- }
- }
- [DebuggerNonUserCode]
- public bool get_IsClearData()
- {
- return this.get_Tag() == 11;
- }
- [DebuggerNonUserCode]
- public int get_Tag()
- {
- return this._tag;
- }
- [CompilerGenerated]
- [DebuggerNonUserCode]
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- public int Tag
- {
- [DebuggerNonUserCode] get
- {
- return this._tag;
- }
- }
- [CompilerGenerated]
- [DebuggerNonUserCode]
- [SpecialName]
- internal object __DebugDisplay()
- {
- return (object) ((FSharpFunc<Token, string>) ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<Token, string>>((PrintfFormat<M0, Unit, string, string>) new PrintfFormat<FSharpFunc<Token, string>, Unit, string, string, string>("%+0.8A"))).Invoke(this);
- }
- [CompilerGenerated]
- public override string ToString()
- {
- return ((FSharpFunc<Token, string>) ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<Token, string>>((PrintfFormat<M0, Unit, string, string>) new PrintfFormat<FSharpFunc<Token, string>, Unit, string, string, Token>("%+A"))).Invoke(this);
- }
- [CompilerGenerated]
- public virtual int CompareTo(Token obj)
- {
- if (this != null)
- {
- if (obj == null)
- return 1;
- int tag1 = this._tag;
- int tag2 = obj._tag;
- if (tag1 != tag2)
- return tag1 - tag2;
- switch (this.get_Tag())
- {
- case 9:
- Token.MovePtrDelta movePtrDelta1 = (Token.MovePtrDelta) this;
- Token.MovePtrDelta movePtrDelta2 = (Token.MovePtrDelta) obj;
- LanguagePrimitives.get_GenericComparer();
- int delta1 = movePtrDelta1._delta;
- int delta2 = movePtrDelta2._delta;
- if (delta1 < delta2)
- return -1;
- return delta1 > delta2 ? 1 : 0;
- case 10:
- Token.SetDataDelta setDataDelta1 = (Token.SetDataDelta) this;
- Token.SetDataDelta setDataDelta2 = (Token.SetDataDelta) obj;
- LanguagePrimitives.get_GenericComparer();
- int delta3 = setDataDelta1._delta;
- int delta4 = setDataDelta2._delta;
- if (delta3 < delta4)
- return -1;
- return delta3 > delta4 ? 1 : 0;
- default:
- return 0;
- }
- }
- else
- return obj != null ? -1 : 0;
- }
- [CompilerGenerated]
- public virtual int CompareTo(object obj)
- {
- return this.CompareTo((Token) obj);
- }
- [CompilerGenerated]
- public virtual int CompareTo(object obj, IComparer comp)
- {
- Token token = (Token) obj;
- if (this != null)
- {
- if ((Token) obj == null)
- return 1;
- int tag1 = this._tag;
- int tag2 = token._tag;
- if (tag1 != tag2)
- return tag1 - tag2;
- switch (this.get_Tag())
- {
- case 9:
- Token.MovePtrDelta movePtrDelta1 = (Token.MovePtrDelta) this;
- Token.MovePtrDelta movePtrDelta2 = (Token.MovePtrDelta) token;
- int delta1 = movePtrDelta1._delta;
- int delta2 = movePtrDelta2._delta;
- if (delta1 < delta2)
- return -1;
- return delta1 > delta2 ? 1 : 0;
- case 10:
- Token.SetDataDelta setDataDelta1 = (Token.SetDataDelta) this;
- Token.SetDataDelta setDataDelta2 = (Token.SetDataDelta) token;
- int delta3 = setDataDelta1._delta;
- int delta4 = setDataDelta2._delta;
- if (delta3 < delta4)
- return -1;
- return delta3 > delta4 ? 1 : 0;
- default:
- return 0;
- }
- }
- else
- return (Token) obj != null ? -1 : 0;
- }
- [CompilerGenerated]
- public virtual int GetHashCode(IEqualityComparer comp)
- {
- if (this == null)
- return 0;
- switch (this.get_Tag())
- {
- case 9:
- Token.MovePtrDelta movePtrDelta = (Token.MovePtrDelta) this;
- int num1 = 9;
- return movePtrDelta._delta + ((num1 << 6) + (num1 >> 2)) - 1640531527;
- case 10:
- Token.SetDataDelta setDataDelta = (Token.SetDataDelta) this;
- int num2 = 10;
- return setDataDelta._delta + ((num2 << 6) + (num2 >> 2)) - 1640531527;
- default:
- return this._tag;
- }
- }
- [CompilerGenerated]
- public override sealed int GetHashCode()
- {
- return this.GetHashCode(LanguagePrimitives.get_GenericEqualityComparer());
- }
- [CompilerGenerated]
- public virtual bool Equals(object obj, IEqualityComparer comp)
- {
- if (this == null)
- return obj == null;
- Token token1 = obj as Token;
- if (token1 == null)
- return false;
- Token token2 = token1;
- if (this._tag != token2._tag)
- return false;
- switch (this.get_Tag())
- {
- case 9:
- return ((Token.MovePtrDelta) this)._delta == ((Token.MovePtrDelta) token2)._delta;
- case 10:
- return ((Token.SetDataDelta) this)._delta == ((Token.SetDataDelta) token2)._delta;
- default:
- return true;
- }
- }
- [CompilerGenerated]
- public virtual bool Equals(Token obj)
- {
- if (this == null)
- return obj == null;
- if (obj == null || this._tag != obj._tag)
- return false;
- switch (this.get_Tag())
- {
- case 9:
- return ((Token.MovePtrDelta) this)._delta == ((Token.MovePtrDelta) obj)._delta;
- case 10:
- return ((Token.SetDataDelta) this)._delta == ((Token.SetDataDelta) obj)._delta;
- default:
- return true;
- }
- }
- [CompilerGenerated]
- public override sealed bool Equals(object obj)
- {
- Token token = obj as Token;
- if (token != null)
- return this.Equals(token);
- return false;
- }
- public static class Tags
- {
- public const int IncrementPtr = 0;
- public const int DecrementPtr = 1;
- public const int IncrementData = 2;
- public const int DecrementData = 3;
- public const int OutputData = 4;
- public const int InputData = 5;
- public const int LoopStart = 6;
- public const int LoopEnd = 7;
- public const int Unknown = 8;
- public const int MovePtrDelta = 9;
- public const int SetDataDelta = 10;
- public const int ClearData = 11;
- }
- [DebuggerTypeProxy(typeof (Token.MovePtrDelta\u0040DebugTypeProxy))]
- [DebuggerDisplay("{__DebugDisplay(),nq}")]
- [Serializable]
- [SpecialName]
- public class MovePtrDelta : Token
- {
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- [CompilerGenerated]
- [DebuggerNonUserCode]
- internal readonly int _delta;
- [CompilerGenerated]
- [DebuggerNonUserCode]
- internal MovePtrDelta(int _delta)
- : base(9)
- {
- this._delta = _delta;
- }
- [DebuggerNonUserCode]
- public int get_delta()
- {
- return this._delta;
- }
- [CompilationMapping]
- [CompilerGenerated]
- [DebuggerNonUserCode]
- public int delta
- {
- [DebuggerNonUserCode] get
- {
- return this._delta;
- }
- }
- }
- [DebuggerTypeProxy(typeof (Token.SetDataDelta\u0040DebugTypeProxy))]
- [DebuggerDisplay("{__DebugDisplay(),nq}")]
- [Serializable]
- [SpecialName]
- public class SetDataDelta : Token
- {
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- [CompilerGenerated]
- [DebuggerNonUserCode]
- internal readonly int _delta;
- [CompilerGenerated]
- [DebuggerNonUserCode]
- internal SetDataDelta(int _delta)
- : base(10)
- {
- this._delta = _delta;
- }
- [DebuggerNonUserCode]
- public int get_delta()
- {
- return this._delta;
- }
- [CompilationMapping]
- [CompilerGenerated]
- [DebuggerNonUserCode]
- public int delta
- {
- [DebuggerNonUserCode] get
- {
- return this._delta;
- }
- }
- }
- [SpecialName]
- internal class MovePtrDelta\u0040DebugTypeProxy
- {
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- [CompilerGenerated]
- [DebuggerNonUserCode]
- internal Token.MovePtrDelta _obj;
- [CompilerGenerated]
- [DebuggerNonUserCode]
- public MovePtrDelta\u0040DebugTypeProxy(Token.MovePtrDelta obj)
- {
- this._obj = obj;
- }
- [DebuggerNonUserCode]
- public int get_delta()
- {
- return this._obj._delta;
- }
- [CompilationMapping]
- [CompilerGenerated]
- [DebuggerNonUserCode]
- public int delta
- {
- [DebuggerNonUserCode] get
- {
- return this._obj._delta;
- }
- }
- }
- [SpecialName]
- internal class SetDataDelta\u0040DebugTypeProxy
- {
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- [CompilerGenerated]
- [DebuggerNonUserCode]
- internal Token.SetDataDelta _obj;
- [CompilerGenerated]
- [DebuggerNonUserCode]
- public SetDataDelta\u0040DebugTypeProxy(Token.SetDataDelta obj)
- {
- this._obj = obj;
- }
- [DebuggerNonUserCode]
- public int get_delta()
- {
- return this._obj._delta;
- }
- [CompilationMapping]
- [CompilerGenerated]
- [DebuggerNonUserCode]
- public int delta
- {
- [DebuggerNonUserCode] get
- {
- return this._obj._delta;
- }
- }
- }
- }
- }
- // Decompiled with JetBrains decompiler
- // Type: CompilerLib.Tokens
- // Assembly: CompilerLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
- // MVID: 5C2BD8B5-BFF6-2D3A-A745-0383B5D82B5C
- // Assembly location: D:\JB\CompilerLib.dll
- using Microsoft.FSharp.Collections;
- using Microsoft.FSharp.Core;
- using System;
- using System.Diagnostics;
- using System.Runtime.CompilerServices;
- namespace CompilerLib
- {
- [CompilationMapping]
- public static class Tokens
- {
- public static FSharpList<Token> tokenize(string code)
- {
- return (FSharpList<Token>) ListModule.Filter<Token>((FSharpFunc<M0, bool>) new Tokens.tokenize\u004029(Token.get_Unknown()), (FSharpList<M0>) ListModule.Map<char, Token>((FSharpFunc<M0, M1>) new Tokens.tokenize\u004018\u002D1(), ArrayModule.ToList<char>((M0[]) code.ToCharArray())));
- }
- [Serializable]
- internal sealed class tokenize\u004029 : FSharpFunc<Token, bool>
- {
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- [CompilerGenerated]
- [DebuggerNonUserCode]
- public Token x;
- [CompilerGenerated]
- [DebuggerNonUserCode]
- internal tokenize\u004029(Token x)
- {
- this.\u002Ector();
- this.x = x;
- }
- public virtual bool Invoke(Token y)
- {
- return !this.x.Equals((object) y, LanguagePrimitives.get_GenericEqualityComparer());
- }
- }
- [Serializable]
- internal sealed class tokenize\u004018\u002D1 : FSharpFunc<char, Token>
- {
- [CompilerGenerated]
- [DebuggerNonUserCode]
- internal tokenize\u004018\u002D1()
- {
- base.\u002Ector();
- }
- public virtual Token Invoke(char x)
- {
- switch (x)
- {
- case '+':
- return Token.get_IncrementData();
- case ',':
- return Token.get_InputData();
- case '-':
- return Token.get_DecrementData();
- case '.':
- return Token.get_OutputData();
- case '<':
- return Token.get_DecrementPtr();
- case '>':
- return Token.get_IncrementPtr();
- case '[':
- return Token.get_LoopStart();
- case ']':
- return Token.get_LoopEnd();
- default:
- return Token.get_Unknown();
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement