Example #1
0
        private void BeginType(Indention firstIndent)
        {
            if (this.Document != null)
            {
                var definitionParts = new List <string>()
                {
                    ".class", this.Builder.GetAttributes(), this.Builder.FullName,
                    "extends", new TypeDescriptor(this.Builder.BaseType,
                                                  this.Builder.Assembly).Value
                };

                if (this.InterfacesToImplement != null && this.InterfacesToImplement.Count > 0)
                {
                    foreach (var interfaceToImplement in this.InterfacesToImplement)
                    {
                        if (interfaceToImplement != null && interfaceToImplement.IsInterface)
                        {
                            definitionParts.Add("implements");
                            definitionParts.Add(interfaceToImplement.FullName);
                        }
                    }
                }

                this.Document.WriteText(new CodeLine(
                                            string.Join(" ", definitionParts.ToArray()), firstIndent));
                this.Document.WriteText(new CodeLine("{"));
            }
        }
Example #2
0
 internal TypeDebugging(TypeBuilder type, HashSet <Type> interfacesToImplement, CodeDocument document,
                        ISymbolDocumentWriter symbolDocument, Indention firstIndent)
     : base()
 {
     this.Builder               = type;
     this.Document              = document;
     this.SymbolDocument        = symbolDocument;
     this.InterfacesToImplement = interfacesToImplement;
     this.AddInterfacesToImplement();
     this.BeginType(firstIndent);
 }
Example #3
0
        private void Dispose(bool disposing)
        {
            if ((!this.Disposed && disposing) && (this.Document != null))
            {
                Indention decrease = Indention.Decrease;
                if (!this.CreatedMethod)
                {
                    decrease = Indention.KeepCurrent;
                }

                this.Document.WriteText(new CodeLine("}", decrease));
            }

            this.Disposed = true;
        }
        private IToken GenerateImaginaryToken(Indention indention, IToken original)
        {
            switch (indention)
            {
                case Indention.Indent:
                    return new CommonToken(original)
                    {
                        Text = "INDENT",
                        Type = this.indentType,
                        Channel = this.channelNumber,
                    };

                case Indention.Dedent:
                    return new CommonToken(original)
                    {
                        Text = "DEDENT",
                        Type = this.dedentType,
                        Channel = this.channelNumber,
                    };

                default:
                    throw new AutomationException("Unknown indentation: " + indention.ToString());
            }
        }
Example #5
0
 internal ConstructorMethodDebugging(ConstructorBuilder method, CodeDocument document,
                                     ISymbolDocumentWriter symbolDocument, Indention firstIndent)
     : base(method, method.GetILGenerator(), document, symbolDocument, firstIndent)
 {
 }
Example #6
0
 internal CodeLine(string code, Indention indent, bool isDebuggable, params Label[] labels)
     : this(code, indent, isDebuggable)
 {
     this.Labels = labels;
 }
Example #7
0
 internal CodeLine(string code, Indention indent, params Label[] labels)
     : this(code, indent, false, labels)
 {
 }
Example #8
0
 internal CodeLine(string code, Indention indent, bool isDebuggable)
     : this(code, isDebuggable)
 {
     this.Indent = indent;
 }
Example #9
0
 internal CodeLine(string code, Indention indent)
     : this(code, indent, false)
 {
 }
        protected internal MethodBaseDebugging(T method, ILGenerator generator, CodeDocument document, ISymbolDocumentWriter symbolDocument, Indention firstIndent)
            : this()
        {
            this.Builder        = method;
            this.Generator      = generator;
            this.Document       = document;
            this.SymbolDocument = symbolDocument;
            this.CurrentIndent  = firstIndent;

            if (this.Document != null)
            {
                this.BeginMethod(method);
            }
        }
Example #11
0
 internal CodeLine(string code, Indention indent, bool isDebuggable, params Label[] labels)
     : this(code, indent, isDebuggable)
 {
     this.Labels = labels;
 }
Example #12
0
 internal CodeLine(string code, Indention indent, params Label[] labels)
     : this(code, indent, false, labels)
 {
 }
Example #13
0
 internal CodeLine(string code, Indention indent, bool isDebuggable)
     : this(code, isDebuggable)
 {
     this.Indent = indent;
 }
Example #14
0
 internal CodeLine(string code, Indention indent)
     : this(code, indent, false)
 {
 }