private void writeInterfaceList <T1>(IList <T1> list, bool isGeneric) where T1 : VhdlObjectProvider { writer.BeginAlign(); bool first = true; foreach (VhdlObjectProvider objectProvider in list) { if (first) { first = false; } else { writer.Append(";").NewLine(); } if (objectProvider is VhdlObjectGroup <VhdlObject> ) { VhdlObjectGroup <VhdlObject> group = (VhdlObjectGroup <VhdlObject>)objectProvider; VhdlOutputHelper.handleAnnotationsBefore(group, writer); } //TODO: check for equal types etc. VhdlObject obj0 = objectProvider.VhdlObjects[0]; InterfaceDeclarationFormat format = Annotations.getAnnotation <InterfaceDeclarationFormat>(obj0); if (format != null && format.UseObjectClass) { writer.Append(obj0.ObjectClass.ToString()).Append(' '); } writer.AppendIdentifiers(objectProvider.VhdlObjects, ", "); writer.Align(); writer.Append(" : "); if (format != null) { if (format.UseMode || (obj0.Mode != VhdlObject.ModeEnum.IN)) { writer.Append(obj0.Mode.ToString()).Append(' '); } } else { if (!isGeneric || obj0.Mode != VhdlObject.ModeEnum.IN) { writer.Append(obj0.Mode.ToString()).Append(' '); } } VhdlObjectOutputHelper.interfaceSuffix(obj0, writer, output); } writer.NewLine().EndAlign(); }
protected override void visitWaitStatement(WaitStatement statement) { appendLabel(statement); writer.Append(KeywordEnum.WAIT.ToString()); if (statement.SensitivityList.Count != 0) { writer.Append(' ').Append(KeywordEnum.ON.ToString()).Append(' '); writer.AppendIdentifiers(statement.SensitivityList, ", "); } if (statement.Condition != null) { writer.Append(' ').Append(KeywordEnum.UNTIL.ToString()).Append(' '); output.writeExpression(statement.Condition); } if (statement.Timeout != null) { writer.Append(' ').Append(KeywordEnum.FOR.ToString()).Append(' '); output.writeExpression(statement.Timeout); } writer.Append(';').NewLine(); }
private void appendProcedureParameters(IList <VhdlObjectProvider> parameters) { if (parameters.Count != 0) { writer.Append(" ("); bool first = true; foreach (var provider in parameters) { if (first) { first = false; } else { writer.Append("; "); } VhdlObject object0 = provider.VhdlObjects[0]; if (isOutputObjectClassProcedure(object0)) { writer.Append(object0.ObjectClass.ToString()).Append(' '); } writer.AppendIdentifiers(provider.VhdlObjects, ", "); writer.Append(" : "); if (isOutputMode(object0)) { writer.Append(object0.Mode.ToString()).Append(' '); } VhdlObjectOutputHelper.interfaceSuffix(object0, writer, output); } writer.Append(")"); } }