module Syntax: sig
.. end
Modelica 3.x abstract syntax
This module contains an interpretation of a "usable" form of the abstract syntax
of the modeling language Modelica
Since Modelica only specifies the concrete syntax in the specification, there
is a certain degree of freedom applied here.
Author(s): Christoph Höger
type
str = string Location.loc
type
name = str list
A type-name is a list of strings separated by dots, e.g. Modelica.Icons.Example
= {
}
Something that can be commented can wrapped in this record
type 'a
annotated = {
}
Something that can be annotated can wrapped in this record
= str option annotated
Comments are optionally annotated optional strings
type
unit_ = {
}
The stored definition unit is the representation of a single Modelica file
type
typedef_options = {
|
type_replaceable : bool ; |
|
type_final : bool ; |
|
partial : bool ; |
|
encapsulated : bool ; |
}
The options of a type-definition:
is the definition replaceable / final / partial / encapsulated ?
type 'a
typedef_struct = {
}
Typedefs share a lot of common code.
This is reflected by the
Syntax.typedef_struct
:
'a
denotes the definition's distincitve payload.
type
typedef_desc =
The definition of a new type/class etc.
type
extension = composition * modification option
type
typedef = typedef_desc commented
type
constraint_ = texp commented
type
algorithm = statement list
type
behavior = {
}
type
external_def_struct = {
|
lang : string ; |
|
ext_lhs : exp option ; |
|
ext_ident : string ; |
|
ext_args : exp list ; |
}
type
external_def = external_def_struct annotated
type
elements = {
}
type
composition = {
}
type
enum_literal = string commented
type
der_spec = {
|
der_name : name ; |
|
idents : str list ; |
}
Partial derivative specification, see section 12.7.2
type
sort =
| |
Package |
| |
Class |
| |
Model |
| |
Block |
| |
Connector |
| |
ExpandableConnector |
| |
Record |
| |
Function |
| |
Type |
| |
Operator |
| |
OperatorRecord |
| |
OperatorFunction |
type
connectivity =
type
variability =
| |
Constant |
| |
Parameter |
| |
Discrete |
type
causality =
type
named_import = {
|
global : name ; |
|
local : string ; |
}
type
import = import_desc commented
type
import_desc =
type
extend = {
}
type
scope =
| |
Inner |
| |
Outer |
| |
InnerOuter |
| |
Local |
type
definition_options = {
|
final : bool ; |
|
scope : scope ; |
|
replaceable : bool ; |
}
type
definition_structure = {
}
type
definition = definition_structure commented
type
statement = statement_desc commented
type
statements = statement list
type
statement_desc =
type
assignment = {
}
type
named_arg = {
|
argument_name : str ; |
|
argument : exp ; |
}
type
call_statement = {
}
type 'a
else_condition = {
|
guard : exp ; |
|
elsethen : 'a ; |
}
type 'a
condition_struct = {
}
type
if_statement = statements condition_struct
type
when_statement = statements condition_struct
type 'a
for_loop_struct = {
|
idx : idx list ; |
|
body : 'a ; |
}
type
for_statement = statements for_loop_struct
type
while_statement = {
}
type
equations = equation list
type
equation = equation_desc commented
type
equation_desc =
type
for_equation = equations for_loop_struct
type
if_equation = equations condition_struct
type
when_equation = equations condition_struct
type
binary_exp = {
}
type
if_expression = exp condition_struct
type
array_access = {
|
lhs : exp ; |
|
indices : exp list ; |
}
type
range = {
}
type
projection = {
|
object_ : exp ; |
|
field : string ; |
}
type
application = {
}
type
comprehension = {
}
type
exp =
type
idx = {
|
variable : str ; |
|
range : exp option ; |
}
type
tprojection = {
|
class_type : texp ; |
|
type_element : string ; |
}
type
array_type = {
}
type
mod_type = {
}
type
texp =
type 'a
flagged_type = {
|
flag : 'a ; |
|
flagged : texp ; |
}
type
type_redeclaration = {
}
type
component_redeclaration = {
}
type
component_modification_struct = {
}
type
modification_value =
type
nested_and_rebind_modification = {
}
type
component_modification = component_modification_struct commented
type
modification = {
}