コード例 #1
0
        /// <summary>
        /// Outputs the VHDL representation of a <code>VhdlElement</code> to a <code>Writer</code> using a custom code format.
        /// </summary>
        /// <param name="element">the VHDL element</param>
        /// <param name="format">the custom code format</param>
        /// <param name="writer">the <code>Writer</code></param>
        public static void toWriter(VhdlElement element, IVhdlCodeFormat format, StreamWriter writer)
        {
            VhdlWriter   vhdlWriter = new VhdlWriter(writer, format);
            OutputModule output     = new VhdlOutputModule(vhdlWriter);

            output.writeVhdlElement(element);
        }
コード例 #2
0
 public static void constantInterfaceSuffix(Constant constant, VhdlWriter writer, OutputModule output)
 {
     output.writeSubtypeIndication(constant.Type);
     if (constant.DefaultValue != null)
     {
         writer.Append(" := ");
         output.writeExpression(constant.DefaultValue);
     }
 }
コード例 #3
0
 //TODO: add mode
 public static void variableInterfaceSuffix(Variable variable, VhdlWriter writer, OutputModule output)
 {
     output.writeSubtypeIndication(variable.Type);
     if (variable.DefaultValue != null)
     {
         writer.Append(" := ");
         output.writeExpression(variable.DefaultValue);
     }
 }
コード例 #4
0
        public static void handleAnnotationsAfter(VhdlElement element, VhdlWriter writer)
        {
            if (element == null)
            {
                return;
            }

            foreach (string comment in Comments.GetCommentsAfter(element))
            {
                writer.Append("--").Append(comment).NewLine();
            }
        }
コード例 #5
0
 internal VhdlOutputModule(VhdlWriter writer)
 {
     sequentialStatementVisitor = new VhdlSequentialStatementVisitor(writer, this);
     concurrentStatementVisitor = new VhdlConcurrentStatementVisitor(writer, this);
     libraryUnitVisitor         = new VhdlLibraryUnitVisitor(writer, this);
     declarationVisitor         = new VhdlDeclarationVisitor(writer, this);
     expressionVisitor          = new VhdlExpressionVisitor(writer, this);
     configurationVisitor       = new VhdlConfigurationVisitor(writer, this);
     typeVisitor = new VhdlTypeVisitor(writer, this);
     miscellaneousElementOutput = new VhdlMiscellaneousElementOutput(writer, this);
     nameVisitor = new VhdlNameVisitor(writer, this);
 }
コード例 #6
0
        //TODO: write BUS keyword
        public static void signalInterfaceSuffix(Signal signal, VhdlWriter writer, OutputModule output)
        {
            output.writeSubtypeIndication(signal.Type);

            if (signal.Kind == Signal.KindEnum.BUS)
            {
                writer.Append(' ').Append(signal.Kind.ToString());
            }
            else if (signal.Kind == Signal.KindEnum.REGISTER)
            {
                throw new Exception("Signal kind register isn't allowed in an interface declaration");
            }

            if (signal.DefaultValue != null)
            {
                writer.Append(" := ");
                output.writeExpression(signal.DefaultValue);
            }
        }
コード例 #7
0
 public static void interfaceSuffix(VhdlObject @object, VhdlWriter writer, OutputModule output)
 {
     if (@object is Signal)
     {
         signalInterfaceSuffix((Signal)@object, writer, output);
     }
     else if (@object is Constant)
     {
         constantInterfaceSuffix((Constant)@object, writer, output);
     }
     else if (@object is Variable)
     {
         variableInterfaceSuffix((Variable)@object, writer, output);
     }
     else if (@object is FileObject)
     {
         fileInterfaceSuffix((FileObject)@object, writer, output);
     }
     else
     {
         throw new ArgumentException("Unknown interface element.");
     }
 }
コード例 #8
0
 public VhdlConcurrentStatementVisitor(VhdlWriter writer, OutputModule output)
 {
     this.writer = writer;
     this.output = output;
 }
コード例 #9
0
 public VhdlConfigurationVisitor(VhdlWriter writer, OutputModule output)
 {
     this.writer = writer;
     this.output = output;
 }
コード例 #10
0
 public VhdlMiscellaneousElementOutput(VhdlWriter writer, OutputModule output)
 {
     this.writer = writer;
     this.output = output;
 }
コード例 #11
0
 public static void fileInterfaceSuffix(FileObject file, VhdlWriter writer, OutputModule output)
 {
     output.writeSubtypeIndication(file.Type);
 }
コード例 #12
0
 public VhdlExpressionVisitor(VhdlWriter writer, OutputModule output)
 {
     this.writer = writer;
     this.output = output;
 }
コード例 #13
0
 public VhdlSequentialStatementVisitor(VhdlWriter writer, OutputModule output)
 {
     this.writer = writer;
     this.output = output;
 }
コード例 #14
0
 public VhdlLibraryUnitVisitor(VhdlWriter writer, OutputModule output)
 {
     this.writer = writer;
     this.output = output;
 }
コード例 #15
0
 public VhdlTypeVisitor(VhdlWriter writer, OutputModule output)
 {
     this.writer = writer;
     this.output = output;
 }