+ Activator.log(IStatus.WARNING, Messages.IOStructGen_UnknownTraceAttributeWarning + " " + left); //$NON-NLS-1$
+ }
+ }
+
+ private static void addByteOrder(ByteOrder byteOrder,
+ final DeclarationScope parentScope, String name,
+ IntegerDeclaration decl) throws ParseException {
+
+ if (decl.getByteOrder() == null) {
+ IntegerDeclaration newI;
+ newI = new IntegerDeclaration(decl.getLength(), decl.isSigned(),
+ decl.getBase(), byteOrder, decl.getEncoding(),
+ decl.getClock(), decl.getAlignment());
+ parentScope.replaceType(name, newI);
+ }
+ }
+
+ private void setAlign(DeclarationScope parentScope, StructDeclaration sd,
+ ByteOrder byteOrder) throws ParseException {
+
+ for (String s : sd.getFieldsList()) {
+ IDeclaration d = sd.getFields().get(s);
+
+ if (d instanceof StructDeclaration) {
+ setAlign(parentScope, (StructDeclaration) d, byteOrder);
+
+ } else if (d instanceof VariantDeclaration) {
+ setAlign(parentScope, (VariantDeclaration) d, byteOrder);
+
+ } else if (d instanceof IntegerDeclaration) {
+ IntegerDeclaration decl = (IntegerDeclaration) d;
+ if (decl.getByteOrder() == null) {
+ IntegerDeclaration newI;
+ newI = new IntegerDeclaration(decl.getLength(),
+ decl.isSigned(), decl.getBase(), byteOrder,
+ decl.getEncoding(), decl.getClock(),
+ decl.getAlignment());
+ sd.getFields().put(s, newI);
+ }
+ }
+ }
+ }
+
+ private void setAlign(DeclarationScope parentScope, VariantDeclaration vd,
+ ByteOrder byteOrder) throws ParseException {
+
+ for (String s : vd.getFields().keySet()) {
+ IDeclaration d = vd.getFields().get(s);
+
+ if (d instanceof StructDeclaration) {
+ setAlign(parentScope, (StructDeclaration) d, byteOrder);
+
+ } else if (d instanceof IntegerDeclaration) {
+ IntegerDeclaration decl = (IntegerDeclaration) d;
+ IntegerDeclaration newI;
+ newI = new IntegerDeclaration(decl.getLength(),
+ decl.isSigned(), decl.getBase(), byteOrder,
+ decl.getEncoding(), decl.getClock(),
+ decl.getAlignment());
+ vd.getFields().put(s, newI);
+ }