コード例 #1
0
        protected override void visitPhysicalType(PhysicalType type)
        {
            //TODO: implement repeated label
            appendTypePrefix(type);
            writer.Append(' ').Append(KeywordEnum.RANGE.ToString()).Append(' ');
            output.writeDiscreteRange(type.Range);
            writer.Append(' ').NewLine();
            writer.Indent().Append(KeywordEnum.UNITS.ToString()).NewLine();
            writer.Indent().Append(type.PrimaryUnit).Append(';').NewLine().BeginAlign();
            foreach (PhysicalType.Unit unit in type.Units)
            {
                writer.AppendIdentifier(unit).Align().Append(" = ");
                if (unit.Factor != null)
                {
                    output.writeExpression(unit.Factor);
                    writer.Append(' ');
                }
                writer.Append(unit.BaseUnit).Append(';').NewLine();
            }
            writer.EndAlign().Dedent();

            writer.Append(KeywordEnum.END.ToString()).Append(KeywordEnum.UNITS.ToString()).Append(';').Dedent().NewLine();
        }
コード例 #2
0
 /// <summary>
 /// Visits a physical type.
 /// </summary>
 /// <param name="type"></param>
 protected internal virtual void visitPhysicalType(PhysicalType type)
 {
 }