예제 #1
0
        protected override void visitConfigurationSpecification(ConfigurationSpecification specification)
        {
            writer.Append(KeywordEnum.FOR.ToString()).Append(' ');
            output.writeComponentSpecification(specification.ComponentSpecification);

            if (specification.EntityAspect != null)
            {
                writer.Append(' ').Append(KeywordEnum.USE.ToString()).Append(' ');
                writer.Append(specification.EntityAspect.ToString());
            }

            if (specification.GenericMap.Count != 0)
            {
                writer.NewLine();
                writer.Append(KeywordEnum.GENERIC.ToString()).Append(KeywordEnum.MAP.ToString()).Append(" (").NewLine();
                writer.Indent().BeginAlign();
                output.getMiscellaneousElementOutput().genericMap(specification.GenericMap);
                writer.EndAlign().Dedent();
                writer.Append(")");
            }

            if (specification.PortMap.Count != 0)
            {
                writer.NewLine();
                writer.Append(KeywordEnum.PORT.ToString()).Append(KeywordEnum.MAP.ToString()).Append(" (").NewLine();
                writer.Indent().BeginAlign();
                output.getMiscellaneousElementOutput().portMap(specification.PortMap);
                writer.EndAlign().Dedent();
                writer.Append(")");
            }

            writer.Append(';').NewLine();
        }
        private void associationList(List <AssociationElement> associationList, bool addLineBreaks)
        {
            bool first = true;

            foreach (AssociationElement element in associationList)
            {
                if (first)
                {
                    first = false;
                }
                else
                {
                    writer.Append(',');
                    if (addLineBreaks)
                    {
                        writer.NewLine();
                    }
                    else
                    {
                        writer.Append(' ');
                    }
                }
                VhdlOutputHelper.handleAnnotationsBefore(element, writer);
                associationElement(element);
                VhdlOutputHelper.handleAnnotationsAfter(element, writer);
            }
            if (addLineBreaks)
            {
                writer.NewLine();
            }
        }
        private void appendBlockConfiguration(AbstractBlockConfiguration block, string blockSpecification)
        {
            writer.Append(KeywordEnum.FOR.ToString()).Append(' ');
            writer.Append(blockSpecification);
            writer.NewLine().Indent();

            foreach (UseClause useClause in block.UseClauses)
            {
                output.writeLibraryUnit(useClause);
            }
            visit(block.ConfigurationItems);

            writer.Dedent().Append(KeywordEnum.END.ToString()).Append(KeywordEnum.FOR.ToString()).Append(";").NewLine();
        }
예제 #4
0
        protected override void visitCaseStatementAlternative(Alternative alternative)
        {
            writer.Append(KeywordEnum.WHEN.ToString()).Append(' ');

            bool first = true;

            foreach (Choice choice in alternative.Choices)
            {
                if (first)
                {
                    first = false;
                }
                else
                {
                    writer.Append(" | ");
                }
                output.writeChoice(choice);
            }
            writer.Append(" =>").NewLine();

            writer.Indent();
            output.writeSequentialStatements(alternative.Statements);
            writer.Dedent();
            writer.NewLine();
        }
        private void appendComponentInstantiationMaps(AbstractComponentInstantiation instantiation)
        {
            if (instantiation.GenericMap.Count != 0)
            {
                writer.NewLine();
                writer.Append(KeywordEnum.GENERIC.ToString()).Append(KeywordEnum.MAP.ToString()).Append(" (").NewLine();
                writer.Indent().BeginAlign();
                output.getMiscellaneousElementOutput().genericMap(instantiation.GenericMap);
                writer.EndAlign().Dedent();
                writer.Append(")");
            }

            if (instantiation.PortMap.Count != 0)
            {
                writer.NewLine();
                writer.Append(KeywordEnum.PORT.ToString()).Append(KeywordEnum.MAP.ToString()).Append(" (").NewLine();
                writer.Indent().BeginAlign();
                output.getMiscellaneousElementOutput().portMap(instantiation.PortMap);
                writer.EndAlign().Dedent();
                writer.Append(")");
            }
        }