Skip to content

Commit d054c88

Browse files
Version 1.3.1
1 parent db0126a commit d054c88

24 files changed

+94
-62
lines changed

Examples/Primes/LibPrimes_component/Bindings/C/libprimes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Copyright (C) 2018 Automatic Component Toolkit Developers
44
55
All rights reserved.
66
7-
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.0.
7+
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.1.
88
99
Abstract: This is an autogenerated plain C Header file in order to allow an easy
1010
use of Prime Numbers Interface

Examples/Primes/LibPrimes_component/Bindings/C/libprimes_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Copyright (C) 2018 Automatic Component Toolkit Developers
44
55
All rights reserved.
66
7-
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.0.
7+
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.1.
88
99
Abstract: This is an autogenerated plain C Header file with basic types in
1010
order to allow an easy use of Prime Numbers Interface

Examples/Primes/LibPrimes_component/Bindings/CDynamic/libprimes_dynamic.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Copyright (C) 2018 Automatic Component Toolkit Developers
44
55
All rights reserved.
66
7-
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.0.
7+
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.1.
88
99
Abstract: This is an autogenerated plain C Header file in order to allow an easy
1010
use of Prime Numbers Interface

Examples/Primes/LibPrimes_component/Bindings/CDynamic/libprimes_dynamic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Copyright (C) 2018 Automatic Component Toolkit Developers
44
55
All rights reserved.
66
7-
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.0.
7+
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.1.
88
99
Abstract: This is an autogenerated plain C Header file in order to allow an easy
1010
use of Prime Numbers Interface

Examples/Primes/LibPrimes_component/Bindings/CDynamic/libprimes_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Copyright (C) 2018 Automatic Component Toolkit Developers
44
55
All rights reserved.
66
7-
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.0.
7+
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.1.
88
99
Abstract: This is an autogenerated plain C Header file with basic types in
1010
order to allow an easy use of Prime Numbers Interface

Examples/Primes/LibPrimes_component/Bindings/Cpp/libprimes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Copyright (C) 2018 Automatic Component Toolkit Developers
44
55
All rights reserved.
66
7-
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.0.
7+
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.1.
88
99
Abstract: This is an autogenerated C++ Wrapper Implementation file in order to allow
1010
an easy use of Prime Numbers Interface

Examples/Primes/LibPrimes_component/Bindings/Cpp/libprimes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Copyright (C) 2018 Automatic Component Toolkit Developers
44
55
All rights reserved.
66
7-
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.0.
7+
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.1.
88
99
Abstract: This is an autogenerated plain C Header file in order to allow an easy
1010
use of Prime Numbers Interface

Examples/Primes/LibPrimes_component/Bindings/Cpp/libprimes.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Copyright (C) 2018 Automatic Component Toolkit Developers
44
55
All rights reserved.
66
7-
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.0.
7+
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.1.
88
99
Abstract: This is an autogenerated C++ Header file in order to allow an easy use
1010
of Prime Numbers Interface

Examples/Primes/LibPrimes_component/Bindings/Cpp/libprimes_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Copyright (C) 2018 Automatic Component Toolkit Developers
44
55
All rights reserved.
66
7-
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.0.
7+
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.1.
88
99
Abstract: This is an autogenerated plain C Header file with basic types in
1010
order to allow an easy use of Prime Numbers Interface

Examples/Primes/LibPrimes_component/Bindings/CppDynamic/libprimes_dynamic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Copyright (C) 2018 Automatic Component Toolkit Developers
44
55
All rights reserved.
66
7-
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.0.
7+
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.1.
88
99
Abstract: This is an autogenerated plain C Header file in order to allow an easy
1010
use of Prime Numbers Interface

Examples/Primes/LibPrimes_component/Bindings/CppDynamic/libprimes_dynamic.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Copyright (C) 2018 Automatic Component Toolkit Developers
44
55
All rights reserved.
66
7-
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.0.
7+
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.1.
88
99
Abstract: This is an autogenerated C++ Header file in order to allow an easy
1010
use of Prime Numbers Interface

Examples/Primes/LibPrimes_component/Bindings/CppDynamic/libprimes_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Copyright (C) 2018 Automatic Component Toolkit Developers
44
55
All rights reserved.
66
7-
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.0.
7+
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.1.
88
99
Abstract: This is an autogenerated plain C Header file with basic types in
1010
order to allow an easy use of Prime Numbers Interface

Examples/Primes/LibPrimes_component/Bindings/Pascal/Unit_LibPrimes.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
All rights reserved.
77
8-
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.0.
8+
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.1.
99
1010
Abstract: This is an autogenerated Pascal Header file in order to allow an easy
1111
use of Prime Numbers Interface

Examples/Primes/LibPrimes_component/Bindings/Python/LibPrimes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
All rights reserved.
66
7-
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.0.
7+
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.1.
88
99
Abstract: This is an autogenerated Python file in order to allow an easy
1010
use of Prime Numbers Interface

Examples/Primes/LibPrimes_component/Examples/CPP/LibPrimes_example.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Copyright (C) 2018 Automatic Component Toolkit Developers
44
55
All rights reserved.
66
7-
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.0.
7+
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.1.
88
99
Abstract: This is an autogenerated C++ application that demonstrates the
1010
usage of the C++ bindings of Prime Numbers Interface

Examples/Primes/LibPrimes_component/Implementations/Pascal/Interfaces/libprimes.lpr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
All rights reserved.
66
7-
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.0.
7+
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.1.
88
99
Abstract: This is an autogenerated Pascal project file in order to allow easy
1010
development of Prime Numbers Interface.

Examples/Primes/LibPrimes_component/Implementations/Pascal/Interfaces/libprimes_exception.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
All rights reserved.
66
7-
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.0.
7+
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.1.
88
99
Abstract: This is an autogenerated Pascal exception class definition file in order to allow easy
1010
development of Prime Numbers Interface. The functions in this file need to be implemented. It needs to be generated only once.

Examples/Primes/LibPrimes_component/Implementations/Pascal/Interfaces/libprimes_exports.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
All rights reserved.
66
7-
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.0.
7+
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.1.
88
99
Abstract: This is an autogenerated Pascal export implementation file in order to allow easy
1010
development of Prime Numbers Interface. The functions in this file need to be implemented. It needs to be generated only once.

Examples/Primes/LibPrimes_component/Implementations/Pascal/Interfaces/libprimes_interfaces.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
All rights reserved.
66
7-
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.0.
7+
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.1.
88
99
Abstract: This is an autogenerated Pascal interface definition file in order to allow easy
1010
development of Prime Numbers Interface. The functions in this file need to be implemented. It needs to be generated only once.

Examples/Primes/LibPrimes_component/Implementations/Pascal/Interfaces/libprimes_types.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
All rights reserved.
66
7-
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.0.
7+
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.1.
88
99
Abstract: This is an autogenerated Pascal type definition file in order to allow easy
1010
development of Prime Numbers Interface. The functions in this file need to be implemented. It needs to be generated only once.

Source/automaticcomponenttoolkit.go

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,12 @@ func readComponentDefinition(FileName string, ACTVersion string) (ComponentDefin
6969
}
7070

7171
func main () {
72-
ACTVersion := "1.3.0"
72+
ACTVersion := "1.3.1"
7373
fmt.Fprintln(os.Stdout, "Automatic Component Toolkit v" + ACTVersion)
7474
if (len (os.Args) < 2) {
75-
log.Fatal ("Please run with the configuration XML as command line parameter.");
75+
log.Fatal ("Please run with the Interface Description XML as command line parameter.");
7676
log.Fatal ("To specify a path for the generated source code use the optional flag \"-o ABSOLUTE_PATH_TO_OUTPUT_FOLDER\"");
77+
log.Fatal ("To create a diff between two versions of an Interface Description XML use the optional flagg \"-d OTHER_IDL_FILE\"");
7778
}
7879
if os.Args[1] == "-v" {
7980
fmt.Fprintln(os.Stdout, "Version: "+ACTVersion)
@@ -156,11 +157,20 @@ func main () {
156157
log.Fatal (err);
157158
}
158159

160+
161+
licenseFileName := path.Join(outputFolder, "license.txt");
162+
log.Printf("Creating \"%s\"", licenseFileName)
163+
licenseFile, err := CreateLanguageFile (licenseFileName, "")
164+
if err != nil {
165+
log.Fatal (err);
166+
}
167+
licenseFile.WritePlainLicenseHeader(component, "", false);
168+
159169
if (len(component.BindingList.Bindings) > 0) {
160170
err = os.MkdirAll(outputFolderBindings, os.ModePerm);
161171
if (err != nil) {
162172
log.Fatal (err);
163-
}
173+
}
164174
}
165175
for bindingindex := 0; bindingindex < len(component.BindingList.Bindings); bindingindex++ {
166176
binding := component.BindingList.Bindings[bindingindex];

Source/componentdefinition.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,24 @@ func checkClasses(classes[] ComponentDefinitionClass) (map[string]bool, error) {
380380
classLowerNameList[strings.ToLower(class.ClassName)] = true
381381
classNameList[class.ClassName] = true
382382
}
383+
384+
for i := 0; i < len(classes); i++ {
385+
class := classes[i];
386+
parentClass := class.ParentClass;
387+
if (len(parentClass) > 0) {
388+
if !nameIsValidIdentifier(parentClass) {
389+
return nil, fmt.Errorf ("invalid class parent name \"%s\"", parentClass);
390+
}
391+
if (classNameList[parentClass] == false) {
392+
return nil, fmt.Errorf ("unknown parent class \"%s\" for class \"%s\"", parentClass, class.ClassName);
393+
}
394+
if (strings.ToLower(class.ClassName) == strings.ToLower(parentClass)) {
395+
return nil, fmt.Errorf ("class \"%s\" cannot be its own parent class \"%s\"", class.ClassName, parentClass);
396+
}
397+
398+
}
399+
}
400+
383401
return classNameList, nil
384402
}
385403

Source/languagepascal.go

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -168,33 +168,6 @@ func writePascalBaseTypeDefinitions(componentdefinition ComponentDefinition, w L
168168

169169
w.Writeln ( "");
170170

171-
if len(componentdefinition.Functions) > 0 {
172-
w.Writeln ("(*************************************************************************************************************************");
173-
w.Writeln (" Declaration of function types");
174-
w.Writeln ("**************************************************************************************************************************)");
175-
w.Writeln ("");
176-
for i := 0; i < len(componentdefinition.Functions); i++ {
177-
funcinfo := componentdefinition.Functions[i];
178-
arguments := ""
179-
for j := 0; j<len(funcinfo.Params); j++ {
180-
param := funcinfo.Params[j]
181-
if (arguments != "") {
182-
arguments = arguments + "; "
183-
}
184-
cParams, err := generatePlainPascalParameter(param, "", funcinfo.FunctionName, NameSpace)
185-
if (err != nil) {
186-
return err
187-
}
188-
arguments = arguments + cParams[0].ParamConvention + cParams[0].ParamName + ": " + cParams[0].ParamType
189-
}
190-
191-
w.Writeln (" P%s_%s = function(%s): Integer;", NameSpace, funcinfo.FunctionName, arguments);
192-
}
193-
}
194-
195-
w.Writeln ( "");
196-
197-
198171
w.Writeln ("(*************************************************************************************************************************");
199172
w.Writeln (" Declaration of struct arrays");
200173
w.Writeln ("**************************************************************************************************************************)");
@@ -207,6 +180,33 @@ func writePascalBaseTypeDefinitions(componentdefinition ComponentDefinition, w L
207180

208181
w.Writeln ("");
209182
}
183+
184+
if len(componentdefinition.Functions) > 0 {
185+
w.Writeln ("(*************************************************************************************************************************");
186+
w.Writeln (" Declaration of function types");
187+
w.Writeln ("**************************************************************************************************************************)");
188+
w.Writeln ("");
189+
for i := 0; i < len(componentdefinition.Functions); i++ {
190+
funcinfo := componentdefinition.Functions[i];
191+
arguments := ""
192+
for j := 0; j<len(funcinfo.Params); j++ {
193+
param := funcinfo.Params[j]
194+
if (arguments != "") {
195+
arguments = arguments + "; "
196+
}
197+
cParams, err := generatePlainPascalParameter(param, "", funcinfo.FunctionName, NameSpace)
198+
if (err != nil) {
199+
return err
200+
}
201+
arguments = arguments + cParams[0].ParamConvention + cParams[0].ParamName + ": " + cParams[0].ParamType
202+
}
203+
204+
w.Writeln (" P%s_%s = function(%s): Integer;", NameSpace, funcinfo.FunctionName, arguments);
205+
}
206+
}
207+
208+
w.Writeln ( "");
209+
210210
return nil;
211211
}
212212

Source/languagewriter.go

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -132,27 +132,27 @@ func (writer *LanguageWriter) WritePythonLicenseHeader (component ComponentDefin
132132
writeLicenseHeaderEx (writer.Writer, component, abstract, includeVersion, "'''", "'''");
133133
}
134134

135-
135+
// WritePlainLicenseHeader writes a license header into a writer without comments
136+
func (writer *LanguageWriter) WritePlainLicenseHeader (component ComponentDefinition, abstract string, includeVersion bool) {
137+
writeLicenseHeaderEx (writer.Writer, component, abstract, includeVersion, "", "");
138+
}
136139

137140
// WriteLicenseHeader writes a license header into a writer with C-style comments
138141
func WriteLicenseHeader (w io.Writer, component ComponentDefinition, abstract string, includeVersion bool) {
139142
writeLicenseHeaderEx (w, component, abstract, includeVersion, "/*", "*/");
140143
}
141144

142-
// WritePascalLicenseHeader writes a license header into a writer Pascal-style comments
143-
func WritePascalLicenseHeader (w io.Writer, component ComponentDefinition, abstract string, includeVersion bool) {
144-
writeLicenseHeaderEx (w, component, abstract, includeVersion, "(*", "*)");
145-
}
146-
147145
// writeLicenseHeaderEx writes a license header into a writer.
148146
func writeLicenseHeaderEx (w io.Writer, component ComponentDefinition, abstract string, includeVersion bool, CommandStart string, CommandEnd string) {
149147
ACTVersion := component.ACTVersion;
150148
version := component.Version;
151149
copyright := component.Copyright;
152150
year := component.Year;
153151

154-
fmt.Fprintf (w, "%s++\n", CommandStart);
155-
fmt.Fprintf (w, "\n");
152+
if (len(CommandStart) > 0) {
153+
fmt.Fprintf (w, "%s++\n", CommandStart);
154+
fmt.Fprintf (w, "\n");
155+
}
156156
fmt.Fprintf (w, "Copyright (C) %d %s\n", year, copyright);
157157
fmt.Fprintf (w, "\n");
158158
for i := 0; i < len(component.License.Lines); i++ {
@@ -164,13 +164,17 @@ func writeLicenseHeaderEx (w io.Writer, component ComponentDefinition, abstract
164164
fmt.Fprintf (w, "This file has been generated by the Automatic Component Toolkit (ACT) version %s.\n", ACTVersion)
165165
fmt.Fprintf (w, "\n");
166166
}
167-
fmt.Fprintf (w, "Abstract: %s\n", abstract);
168-
if (includeVersion) {
169-
fmt.Fprintf (w, "\nInterface version: %d.%d.%d\n", majorVersion(version), minorVersion(version), microVersion(version))
167+
if (len(abstract) > 0 ) {
168+
fmt.Fprintf (w, "Abstract: %s\n", abstract);
169+
if (includeVersion) {
170+
fmt.Fprintf (w, "\nInterface version: %d.%d.%d\n", majorVersion(version), minorVersion(version), microVersion(version))
171+
}
170172
}
171173
fmt.Fprintf (w, "\n");
172-
fmt.Fprintf (w, "%s\n", CommandEnd);
174+
if (len(CommandEnd) > 0) {
175+
fmt.Fprintf (w, "%s\n", CommandEnd);
173176
fmt.Fprintf (w, "\n");
177+
}
174178
}
175179

176180

0 commit comments

Comments
 (0)