コード例 #1
0
        public void indexSubtypeIndication(IndexSubtypeIndication indication)
        {
            if (indication.BaseType != null)
            {
                output.writeSubtypeIndication(indication.BaseType);
            }
            else
            {
                writer.Append("null");
            }
            writer.Append('(');
            bool first = true;

            foreach (DiscreteRange range in indication.Ranges)
            {
                if (first)
                {
                    first = false;
                }
                else
                {
                    writer.Append(", ");
                }
                output.writeDiscreteRange(range);
            }
            writer.Append(')');
        }
コード例 #2
0
 protected override void visitForGenerateStatement(ForGenerateStatement statement)
 {
     appendLabel(statement);
     writer.Append(KeywordEnum.FOR.ToString()).Append(' ');
     writer.Append(statement.Parameter.Identifier);
     writer.Append(' ').Append(KeywordEnum.IN.ToString()).Append(' ');
     output.writeDiscreteRange(statement.Range);
     appendGenerateStatementSuffix(statement);
 }
コード例 #3
0
        protected override void visitConstrainedArray(ConstrainedArray type)
        {
            appendTypePrefix(type);
            writer.Append(' ').Append(KeywordEnum.ARRAY.ToString()).Append(" (");

            bool first = true;

            foreach (DiscreteRange range in type.IndexRanges)
            {
                if (first)
                {
                    first = false;
                }
                else
                {
                    writer.Append(", ");
                }
                output.writeDiscreteRange(range);
            }

            writer.Append(") ").Append(KeywordEnum.OF.ToString()).Append(' ');
            output.writeSubtypeIndication(type.ElementType);
            writer.Append(';').NewLine();
        }
コード例 #4
0
 public void visit(Slice name)
 {
     output.writeExpression(name.Prefix);
     writer.Append('(');
     for (int i = 0; i < name.Ranges.Count; i++)
     {
         DiscreteRange r = name.Ranges[i];
         output.writeDiscreteRange(r);
         if (i < name.Ranges.Count - 1)
         {
             writer.Append(", ");
         }
     }
     writer.Append(')');
 }