root/branches/maintenance/2.2.2/Modelica/Utilities/Types.mo

Revision 550, 3.4 kB (checked in by otter, 15 months ago)

Library description string made in a standardized fashion for the top-level libraries
(Library of xxx)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1within Modelica.Utilities;
2package Types "Type definitions used in package Modelica.Utilities" 
3  package Compare
4    "Type and constants to compare two strings, as temporary solution until enumerations are available" 
5   
6    extends Modelica.Icons.Enumeration;
7    constant Integer Less=1;
8    constant Integer Equal=2;
9    constant Integer Greater=3;
10    type Type = Integer;
11    annotation (Documentation(info="<html>
12<h4>Syntax</h4>
13<blockquote><pre>
14<b>TokenType</b>.Temp tokenType = TokenType.<b>RealToken</b>;
15</pre></blockquote>
16<h4>Description</h4>
17<p>
18Package <b>TokenType</b> is an emulation of the following enumeration
19</p>
20<pre>
21   enumeration TokenType = {RealToken, IntegerToken, BooleanToken,
22                            StringToken, IdentifierToken, DelimiterToken,
23                            NoToken);
24</pre>
25<p>
26since enumerations are not yet supported in available
27Modelica tools.
28</p>
29</html>"));
30  end Compare;
31 
32  package FileType
33    "Type and constants to describe the type of a file, as temporary solution until enumerations are available" 
34   
35    extends Modelica.Icons.Enumeration;
36    constant Integer NoFile=1 "no file exists";
37    constant Integer RegularFile=2 "regular file";
38    constant Integer Directory=3 "directory";
39    constant Integer SpecialFile=4 "pipe, FIFO, device, etc.";
40   
41    type Type = Integer;
42    annotation (Documentation(info="<html>
43<h4>Syntax</h4>
44<blockquote><pre>
45<b>FileType</b>.Type fileType = FileType.<b>RegularFile</b>;
46</pre></blockquote>
47<h4>Description</h4>
48<p>
49Package <b>FileType</b> is an emulation of the following enumeration
50</p>
51<pre>
52   enumeration FileType = {NoFile, RegularFile, Directory, SpecialFile};
53</pre>
54<p>
55since enumerations are not yet supported in available
56Modelica tools.
57</p>
58</html>"));
59  end FileType;
60 
61  package TokenType
62    "Type and constants for token types, as temporary solution until enumerations are available" 
63   
64    extends Modelica.Icons.Enumeration;
65    constant Integer RealToken=1;
66    constant Integer IntegerToken=2;
67    constant Integer BooleanToken=3;
68    constant Integer StringToken=4;
69    constant Integer IdentifierToken=5;
70    constant Integer DelimiterToken=6;
71    constant Integer NoToken=7;
72   
73    type Type = Integer;
74    annotation (Documentation(info="<html>
75<h4>Syntax</h4>
76<blockquote><pre>
77<b>TokenType</b>.Temp tokenType = TokenType.<b>RealToken</b>;
78</pre></blockquote>
79<h4>Description</h4>
80<p>
81Package <b>TokenType</b> is an emulation of the following enumeration
82</p>
83<pre>
84   enumeration TokenType = {RealToken, IntegerToken, BooleanToken,
85                            StringToken, IdentifierToken, DelimiterToken,
86                            NoToken);
87</pre>
88<p>
89since enumerations are not yet supported in available
90Modelica tools.
91</p>
92</html>"));
93  end TokenType;
94 
95  record TokenValue "Value of token" 
96     extends Modelica.Icons.Record;
97     TokenType.Type tokenType "Type of token";
98     Real real "Value if tokenType == TokenType.RealToken";
99     Integer integer "Value if tokenType == TokenType.IntegerToken";
100     Boolean boolean "Value if tokenType == TokenType.BooleanToken";
101     String string
102      "Value if tokenType == TokenType.StringToken/IdentifierToken/DelimiterToken";
103    annotation (Documentation(info="<html>
104   
105</html>"));
106  end TokenValue;
107  annotation (Documentation(info="<html>
108<p>
109This package contains type definitions used in Modelica.Utilities.
110</p>
111
112</html>"));
113end Types;
Note: See TracBrowser for help on using the browser.