Semantic Rules¶
Properties¶
Variableproperties must have name and data type arguments, but the default value argument and description string literal arguments are optional.The data type argument cannot be vague.
The default value, if given, must be a literal.
The default value, if given, it’s data type must match that of the variable.
You cannot create 2 variables with the same name.
Includeproperties must have a single string literal argument, or a single name argument.Any sheet that produces errors should also produce errors in sheet that include it.
Note
As of now, only the string literal argument is functional. See the
add_property_Include function in dsemantic.c.
Functionproperties must have a name argument, and can have an optional description string literal argument.Subroutineproperties must have a name argument, and can have an optional description string literal argument.FunctionInputproperties must have a function name argument, a socket name argument, a data type argument, and an optional default value argument and an optional description string literal argument.The function name argument must reference a defined function.
The default value, if given, must be a literal.
The default value, if given, it’s data type must match that of the function input.
FunctionOutputproperties must have a function name argument, a socket name argument, a data type argument, and an optional description string literal argument.The function name argument must reference a defined function.
You cannot create 2 functions / subroutines with the same name.
Statements¶
For any node, if a literal is put in the place of a socket, then the literal must be the same data type as the socket.
Node names must reference defined nodes.
Wire identifiers as node inputs must be defined in the same sheet.
Both end-sockets of wires must have the same data type.
A sheet can only have up to 1
Startnode, and it cannot be run directly if it is absent.All functions and subroutines must have exactly 1
Definenode.All functions, not subroutines, must have exactly 1
Returnnode.
DefineandReturnnodes must reference defined functions.DefineandReturnnodes must reference functions and subroutines defined in the same sheet.
For any bitwise operators, all inputs must be of the same type.
Comparison nodes cannot compare between numbers and strings.
The program should not have any cycles.