Software development device and software development program
There is provided an environment in which various constraints can be freely set for a program executed by an edge device or the like. A software development device for generating an object code from a source code includes: an evaluation means for extracting constraints set in a source code and evaluating whether or not the source code conforms to the constraints within an application range of the extracted restrictions; and a generation means for generating an object code so as to conform to the constraints.
1 . A software development device comprising:
one or more processors; and
one or more memories storing computer-readable instructions which, when executed by the one or more processors, cause the one or more processors to:
extract, from a source code, a designated syntax defining constraints,
determine a first scope in the source code to which constraints specified by the extracted designated syntax are applied,
determine a second scope in the source code associated with the first scope, the second scope being configured to inherit the first scope, and
evaluate whether a subset of the source code in the first scope and a subset of the source code in the second scope conform to the constraints specified by the extracted designated syntax;
wherein the constraints specified by the extracted designated syntax comprise at least two of:
(a) a definition of behavior of at least one of a preprocessor, a compiler, or an optimizer,
(b) constraints on hardware resources of a target device used by an object code at a time of execution,
(c) constraints on an execution state of the object code, or
(d) constraints on an execution procedure of the object code; and
wherein evaluating results in a state wherein the object code is able to be generated;
compiling the source code to generate the object code when the evaluating determines the subset of the source code in the first scope and the subset of the source code in the second scope conform to the constraints; and
stopping the generation of the object code when the evaluating determines that the subset of the source code in the first scope and/or the subset of the source code in the second scope do not conform to the constraints.
2 . The software development device according to claim 1 , wherein the one or more processors determine the second scope comprises determining, as the second scope, a scope corresponding to a set of instructions called by a call command in the source code.
3 . A software development method comprising providing one or more processors, and one or more memories storing computer-readable instructions which, when executed by the one or more processors, cause the one or more processors to:
extract, from a source code, a designated syntax defining constraints;
determine a first scope in the source code to which constraints specified by the extracted designated syntax are applied;
determine a second scope in the source code associated with the first scope, the second scope being configured to inherit the first scope; and
evaluate whether a subset of the source code in the first scope and a subset of the source code in the second scope conform to the constraints specified by the extracted designated syntax;
wherein the constraints specified by the extracted designated syntax comprises at least two of:
(a) a definition of behavior of at least one of a preprocessor, a compiler, or an optimizer,
(b) constraints on hardware resources of a target device used by an object code at a time of execution,
(c) constraints on an execution state of the object code,
(d) constraints on an execution procedure of the object code; and
wherein evaluating results in a state wherein the object code is able to be generated;
compiling the source code to generate the object code when the evaluating determines the subset of the source code in the first scope and the subset of the source code in the second scope conform to the constraints; and
stopping the generation of the object code when the evaluating determines that the subset of the source code in the first scope and/or the subset of the source code in the second scope do not conform to the constraints.
4 . The software development method according to claim 3 , wherein the determining the second scope comprises determining, by the one or more processors, as the second scope, a scope corresponding to a set of instructions called by a call command in the source code.
5 . A non-transitory computer-readable storage medium having computer-readable instructions stored thereon which, when executed by one or more processors, cause the one or more processors to:
extract, from a source code, a designated syntax defining constraints;
determine a first scope in the source code to which constraints specified by the extracted designated syntax are applied;
determine a second scope in the source code associated with the first scope, the second scope being configured to inherit the first scope; and
evaluate whether a subset of the source code in the first scope and a subset of the source code in the second scope conform to the constraints specified by the extracted designated syntax;
wherein the constraints specified by the extracted designated syntax comprises at least two of:
(a) a definition of behavior of at least one of a preprocessor, a compiler, or an optimizer,
(b) constraints on hardware resources of a target device used by an object code at a time of execution,
(c) constraints on an execution state of the object code, or
(d) constraints on an execution procedure of the object code; and
wherein evaluating results in a state wherein the object code is able to be generated;
compiling the source code to generate the object code when the evaluating determines the subset of the source code in the first scope and the subset of the source code in the second scope conform to the constraints; and
stopping the generation of the object code when the evaluating determines that the subset of the source code in the first scope and/or the subset of the source code in the second scope do not conform to the constraints.
6 . The non-transitory computer-readable storage medium according to claim 5 , wherein the determining the second scope comprises determining, by the one or more processors, as the second scope, a scope corresponding to a set of instructions called by a call command in the source code.