Skip to content

Commit b24680d

Browse files
authored
Merge pull request stepcode#356 from luzpaz/ascii-typos
Fixed typos showing up as ascii chars
2 parents a78ca01 + 15afe96 commit b24680d

File tree

3 files changed

+58
-58
lines changed

3 files changed

+58
-58
lines changed

src/exp2python/python/SCL/AggregationDataTypes.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class ARRAY(BaseType.Type, BaseType.Aggregate):
6969
"""
7070
EXPRESS definition:
7171
==================
72-
An array data type has as its domain indexed, fixed-size collections of like elements. The lower
72+
An array data type has as its domain indexed, fixed-size collections of like elements. The lower
7373
and upper bounds, which are integer-valued expressions, define the range of index values, and
7474
thus the size of each array collection.
7575
An array data type definition may optionally specify
@@ -93,29 +93,29 @@ class ARRAY(BaseType.Type, BaseType.Aggregate):
9393
NOTE 1 { The bounds may be positive, negative or zero, but may not be indeterminate (?) (see
9494
14.2).
9595
Rules and restrictions:
96-
a) Both expressions in the bound specication, bound_1 and bound_2, shall evaluate to
96+
a) Both expressions in the bound specification, bound_1 and bound_2, shall evaluate to
9797
integer values. Neither shall evaluate to the indeterminate (?) value.
9898
b) bound_1 gives the lower bound of the array. This shall be the lowest index which is
9999
valid for an array value of this data type.
100100
c) bound_2 gives the upper bound of the array. This shall be the highest index which is
101101
valid for an array value of this data type.
102102
d) bound_1 shall be less than or equal to bound_2.
103-
e) If the optional keyword is specied, an array value of this data type may have the
103+
e) If the optional keyword is specified, an array value of this data type may have the
104104
indeterminate (?) value at one or more index positions.
105-
f) If the optional keyword is not specied, an array value of this data type shall not
105+
f) If the optional keyword is not specified, an array value of this data type shall not
106106
contain an indeterminate (?) value at any index position.
107-
g) If the unique keyword is specied, each element in an array value of this data type
108-
shall be dierent from (i.e., not instance equal to) every other element in the same array
107+
g) If the unique keyword is specified, each element in an array value of this data type
108+
shall be different from (i.e., not instance equal to) every other element in the same array
109109
value.
110-
NOTE 2 : Both optional and unique may be specied in the same array data type definition.
110+
NOTE 2 : Both optional and unique may be specified in the same array data type definition.
111111
This does not preclude multiple indeterminate (?) values from occurring in a single array value.
112112
This is because comparisons between indeterminate (?) values result in unknown so the uniqueness
113113
constraint is not violated.
114114
EXAMPLE 27 : This example shows how a multi-dimensioned array is declared.
115115
sectors : ARRAY [ 1 : 10 ] OF -- first dimension
116116
ARRAY [ 11 : 14 ] OF -- second dimension
117117
UNIQUE something;
118-
The first array has 10 elements of data type ARRAY[11:14] OF UNIQUE something. There is
118+
The first array has 10 elements of data type ARRAY[11:14] OF UNIQUE something. There is
119119
a total of 40 elements of data type something in the attribute named sectors. Within each
120120
ARRAY[11:14], no duplicates may occur; however, the same something instance may occur in two
121121
different ARRAY[11:14] values within a single value for the attribute named sectors.
@@ -223,10 +223,10 @@ class LIST(BaseType.Type, BaseType.Aggregate):
223223
If this value is indeterminate (?) the number of elements in a list value of this data type is
224224
not bounded from above.
225225
c) If the bound_spec is omitted, the limits are [0:?].
226-
d) If the unique keyword is specied, each element in a list value of this data type shall
227-
be dierent from (i.e., not instance equal to) every other element in the same list value.
228-
EXAMPLE 28 { This example denes a list of arrays. The list can contain zero to ten arrays. Each
229-
array of ten integers shall be dierent from all other arrays in a particular list.
226+
d) If the unique keyword is specified, each element in a list value of this data type shall
227+
be different from (i.e., not instance equal to) every other element in the same list value.
228+
EXAMPLE 28 { This example defines a list of arrays. The list can contain zero to ten arrays. Each
229+
array of ten integers shall be different from all other arrays in a particular list.
230230
complex_list : LIST[0:10] OF UNIQUE ARRAY[1:10] OF INTEGER;
231231
232232
Python definition:
@@ -374,7 +374,7 @@ class BAG(BaseType.Type, BaseType.Aggregate):
374374
==================
375375
A bag data type has as its domain unordered collections of like elements. The optional lower
376376
and upper bounds, which are integer-valued expressions, define the minimum and maximum
377-
number of elements that can be held in the collection dened by a bag data type.
377+
number of elements that can be held in the collection defined by a bag data type.
378378
379379
Syntax:
380380
170 bag_type = BAG [ bound_spec ] OF base_type .
@@ -490,8 +490,8 @@ class SET(BaseType.Type, BaseType.Aggregate):
490490
==================
491491
A set data type has as its domain unordered collections of like elements. The set data type is
492492
a specialization of the bag data type. The optional lower and upper bounds, which are integer-
493-
valued expressions, dene the minimum and maximum number of elements that can be held in
494-
the collection dened by a set data type. The collection dened by set data type shall not
493+
valued expressions, define the minimum and maximum number of elements that can be held in
494+
the collection defined by a set data type. The collection defined by set data type shall not
495495
contain two or more elements which are instance equal.
496496
Syntax:
497497
285 set_type = SET [ bound_spec ] OF base_type .
@@ -509,14 +509,14 @@ class SET(BaseType.Type, BaseType.Aggregate):
509509
If this value is indeterminate (?) the number of elements in a set value of this data type is
510510
not be bounded from above.
511511
c) If the bound_spec is omitted, the limits are [0:?].
512-
d) Each element in an occurrence of a set data type shall be dierent from (i.e., not
512+
d) Each element in an occurrence of a set data type shall be different from (i.e., not
513513
instance equal to) every other element in the same set value.
514-
EXAMPLE 30 { This example denes an attribute as a set of points (a named data type assumed
514+
EXAMPLE 30 { This example defines an attribute as a set of points (a named data type assumed
515515
to have been declared elsewhere).
516516
a_set_of_points : SET OF point;
517517
The attribute named a_set_of_points can contain zero or more points. Each point instance (in
518-
the set value) is required to be dierent from every other point in the set.
519-
If the value is required to have no more than 15 points, the specication can provide an upper bound,
518+
the set value) is required to be different from every other point in the set.
519+
If the value is required to have no more than 15 points, the specification can provide an upper bound,
520520
as in:
521521
a_set_of_points : SET [0:15] OF point;
522522
The value of the attribute named a_set_of_points now may contain no more than 15 points.

src/exp2python/python/SCL/Builtin.py

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
#14.2 Indeterminate
5151
#The indeterminate symbol (?) stands for an ambiguous value. It is compatible with all data
5252
#types.
53-
#NOTE - The most common use of indeterminate (?) is as the upper bound specication of a bag,
54-
#list or set. This usage represents the notion that the size of the aggregate value dened by the
53+
#NOTE - The most common use of indeterminate (?) is as the upper bound specification of a bag,
54+
#list or set. This usage represents the notion that the size of the aggregate value defined by the
5555
#aggregation data type is unbounded.
5656
# python note: indeterminate value is mapped to None in aggregate bounds
5757

@@ -65,7 +65,7 @@
6565
# EXPRESS definition:
6666
# ===================
6767
#14.4 Pi
68-
#PI is a REAL constant representing the mathematical value , the ratio of a circle's circumference
68+
#PI is a REAL constant representing the mathematical value π, the ratio of a circle's circumference
6969
#to its diameter.
7070
PI = REAL(math.pi)
7171

@@ -74,7 +74,7 @@
7474
#14.5 Self
7575
#SELF refers to the current entity instance or type value. self may appear within an entity
7676
#declaration, a type declaration or an entity constructor.
77-
#NOTE - sSELF is not a constant, but behaves as one in every context in which it can appear.
77+
#NOTE - SELF is not a constant, but behaves as one in every context in which it can appear.
7878
# python note: SELF is not mapped to any constant, but is mapper to self
7979

8080
# EXPRESS definition:
@@ -87,7 +87,7 @@
8787
# EXPRESS definition:
8888
# ===================
8989
#14.7 Unknown
90-
#unknown is a logical constant representing that there is insucient information available to
90+
#unknown is a logical constant representing that there is insufficient information available to
9191
#be able to evaluate a logical condition. It is compatible with the logical data type, but not
9292
#with the boolean data type.
9393
# @TODO: define UNKNOWN in python
@@ -122,7 +122,7 @@ def ABS(V):
122122
#FUNCTION ACOS ( V:NUMBER ) : REAL;
123123
#The acos function returns the angle given a cosine value.
124124
#Parameters : V is a number which is the cosine of an angle.
125-
#Result : The angle in radians (0 result ) whose cosine is V.
125+
#Result : The angle in radians (0 <= result <= pi) whose cosine is V.
126126
#Conditions : -1.0=<V<=1.0
127127
#EXAMPLE 126 { ACOS ( 0.3 ) --> 1.266103...
128128
# Python definition:
@@ -149,7 +149,7 @@ def ASIN(V):
149149
#a) V1 is a number.
150150
#b) V2 is a number.
151151
#Result : The angle in radians (-pi/2<=result<=pi/2) whose tangent is V. If V2 is zero, the result
152-
#is pi/2 or -pi/2 depending on the sign of V1.
152+
#is pi/2 or -pi/2 depending on the sign of V1.
153153
#Conditions : Both V1 and V2 shall not be zero.
154154
#EXAMPLE 128 { ATAN ( -5.5, 3.0 ) --> -1.071449...
155155
def ATAN(V1,V2):
@@ -197,7 +197,7 @@ def BLENGTH(V):
197197
#FUNCTION SIN ( V:NUMBER ) : REAL;
198198
#The sin function returns the sine of an angle.
199199
#Parameters : V is a number representing an angle expressed in radians.
200-
#Result : The sine of V (-1.0 result 1.0).
200+
#Result : The sine of V (-1.0 <= result <= 1.0).
201201
#EXAMPLE 144 { SIN ( PI ) --> 0.0
202202
#
203203
def COS(V):
@@ -487,14 +487,14 @@ def ODD(V):
487487
# ===================
488488
#15.20 RolesOf - general function
489489
#FUNCTION ROLESOF ( V:GENERIC ) : SET OF STRING;
490-
#The rolesof function returns a set of strings containing the fully qualied names of the roles
491-
#played by the specied entity instance. A fully qualied name is dened to be the name of the
492-
#attribute qualied by the name of the schema and entity in which this attribute is declared (i.e.
490+
#The rolesof function returns a set of strings containing the fully qualified names of the roles
491+
#played by the specified entity instance. A fully qualified name is defined to be the name of the
492+
#attribute qualified by the name of the schema and entity in which this attribute is declared (i.e.
493493
#'SCHEMA.ENTITY.ATTRIBUTE').
494494
#Parameters : V is any instance of an entity data type.
495-
#Result : A set of string values (in upper case) containing the fully qualied names of the
495+
#Result : A set of string values (in upper case) containing the fully qualified names of the
496496
#attributes of the entity instances which use the instance V.
497-
#When a named data type is use'd or reference'd, the schema and the name in that schema,
497+
#When a named data type is used or referenced, the schema and the name in that schema,
498498
#if renamed, are also returned. Since use statements may be chained, all the chained schema
499499
#names and the name in each schema are returned.
500500
#EXAMPLE 143 { This example shows that a point might be used as the centre of a circle. The
@@ -567,7 +567,7 @@ def SIZEOF(V):
567567
#The sqrt function returns the non-negative square root of a number.
568568
#Parameters : V is any non-negative number.
569569
#Result : The non-negative square root of V.
570-
#Conditions : V 0:0
570+
#Conditions : V >= 0:0
571571
#EXAMPLE 146 - SQRT ( 121 ) --> 11.0
572572
def SQRT(V):
573573
if not isinstance(V,NUMBER):
@@ -602,16 +602,16 @@ def TAN(V):
602602
#The typeof function returns a set of strings that contains the names of all the data types
603603
#of which the parameter is a member. Except for the simple data types (binary, boolean,
604604
#integer, logical, number, real, and string) and the aggregation data types (array, bag,
605-
#list, set) these names are qualied by the name of the schema which contains the denition of
605+
#list, set) these names are qualified by the name of the schema which contains the definition of
606606
#the type.
607607
#NOTE 1 { The primary purpose of this function is to check whether a given value (variable, at-
608608
#tribute value) can be used for a certain purpose, e.g. to ensure assignment compatibility between
609-
#two values. It may also be used if dierent subtypes or specializations of a given type have to be
610-
#treated dierently in some context.
609+
#two values. It may also be used if different subtypes or specializations of a given type have to be
610+
#treated differently in some context.
611611
#Parameters : V is a value of any type.
612612
#Result : The contents of the returned set of string values are the names (in upper case) of all
613-
#types the value V is a member of. Such names are qualied by the name of the schema which
614-
#contains the denition of the type ('SCHEMA.TYPE') if it is neither a simple data type nor an
613+
#types the value V is a member of. Such names are qualified by the name of the schema which
614+
#contains the definition of the type ('SCHEMA.TYPE') if it is neither a simple data type nor an
615615
#aggregation data type. It may be derived by the following algorithm (which is given here for
616616
#specification purposes rather than to prescribe any particular type of implementation)
617617
def TYPEOF(V):
@@ -636,8 +636,8 @@ def TYPEOF(V):
636636
# ===================
637637
#15.26 UsedIn - general function
638638
#FUNCTION USEDIN ( T:GENERIC; R:STRING) : BAG OF GENERIC;
639-
#The usedin function returns each entity instance that uses a specied entity instance in a
640-
#specied role.
639+
#The usedin function returns each entity instance that uses a specified entity instance in a
640+
#specified role.
641641
def USEDIN(T,R):
642642
raise NotImplemented("USEDIN function not yet implemented.")
643643

@@ -654,8 +654,8 @@ def USEDIN(T,R):
654654
#VALUE ( 'abc' ) --> ? null
655655
def VALUE(V):
656656
if not isinstance(V,STRING):
657-
raise TypeError("VALULE function takes a NUMBER parameter")
658-
# first try to instanciate an INTEGER from the string:
657+
raise TypeError("VALUE function takes a NUMBER parameter")
658+
# first try to instantiate an INTEGER from the string:
659659
try:
660660
return INTEGER(V)
661661
except:
@@ -691,7 +691,7 @@ def VALUE(V):
691691
def VALUE_IN(C,V):
692692
if not isinstance(C,Aggregate):
693693
raise TypeError("VALUE_IN method takes an aggregate as first parameter")
694-
raise NotImplemented("VALUE_IN function not et implemented")
694+
raise NotImplemented("VALUE_IN function not yet implemented")
695695

696696
# EXPRESS definition:
697697
# ===================
@@ -705,8 +705,8 @@ def VALUE_IN(C,V):
705705
#b) If any any two elements of V are value equal, false is returned.
706706
#c) If any element of V is indeterminate (?), unknown is returned.
707707
#d) Otherwise true is returned.
708-
#EXAMPLE 153 { The following test ensures tht each point is a set is at a dierent position, (by
709-
#denition they are distinct, i.e., instance unique).
708+
#EXAMPLE 153 { The following test ensures that each point is placed at a different position, (by
709+
#definition they are distinct, i.e., instance unique).
710710
#IF VALUE_UNIQUE(points) THEN ...
711711
def VALUE_UNIQUE(V):
712712
if not isinstance(V,Aggregate):

src/exp2python/python/SCL/SimpleDataTypes.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class NUMBER:
3838
EXPRESS definition:
3939
===================
4040
The number data type has as its domain all numeric values in the language. The number data
41-
type shall be used when a more specic numeric representation is not important.
41+
type shall be used when a more specific numeric representation is not important.
4242
Syntax:
4343
248 number_type = NUMBER .
4444
EXAMPLE 15 - Since we may not know the context of size we do not know how to correctly
@@ -56,7 +56,7 @@ class REAL(float,NUMBER):
5656
"""
5757
EXPRESS definition:
5858
===================
59-
The real data type has as its domain all rational, irrational and scientfic real numbers. It is
59+
The real data type has as its domain all rational, irrational and scientific real numbers. It is
6060
a specialization of the number data type.
6161
Syntax:
6262
265 real_type = REAL [ '(' precision_spec ')' ] .
@@ -110,23 +110,23 @@ class INTEGER(int,NUMBER):
110110
class STRING(str):
111111
"""
112112
The string data type has as its domain sequences of characters. The characters which are
113-
permitted to form part of a string value are dened in ISO 10646.
113+
permitted to form part of a string value are defined in ISO 10646.
114114
Syntax:
115115
293 string_type = STRING [ width_spec ] .
116116
318 width_spec = '(' width ')' [ FIXED ] .
117117
317 width = numeric_expression .
118-
A string data type may be dened as either xed or varying width (number of characters). If
118+
A string data type may be defined as either fixed or varying width (number of characters). If
119119
it is not specfically defined as fixed width (by using the fixed reserved word in the dfinition)
120120
the string has varying width.
121121
122-
The domain of a xed width string data type is the set of all character sequences of exactly
123-
the width specied in the type denition.
122+
The domain of a fixed width string data type is the set of all character sequences of exactly
123+
the width specified in the type definition.
124124
The domain of a varying width string data type is the set of all character sequences of width
125-
less than or equal to the maximum width specied in the type denition.
126-
If no width is specied, the domain is the set of all character sequences, with no constraint on
125+
less than or equal to the maximum width specified in the type definition.
126+
If no width is specified, the domain is the set of all character sequences, with no constraint on
127127
the width of these sequences.
128128
Substrings and individual characters may be addressed using subscripts as described in 12.5.
129-
The case (upper or lower) of letters within a string is signicant.
129+
The case (upper or lower) of letters within a string is significant.
130130
131131
Python mapping: INTEGER is mapped the 'str' type. An additional width_spec parameter can be passed
132132
to handle the FIXED length constraint
@@ -166,10 +166,10 @@ class BINARY(str):
166166
A binary data type may be defined as either fixed or varying width (number of bits). If it is
167167
not specifically defined as fixed width (by using the fixed reserved word in the definition) the
168168
binary data type has varying width.
169-
The domain of a fixed width binary data type is the set of all bit sequences of exactly the width
170-
specied in the type definition.
169+
The domain of a fixed width binary data type is the set of all bit sequences of exactly the width
170+
specified in the type definition.
171171
The domain of a varying width binary data type is the set of all bit sequences of width less
172-
than or equal to the maximum width specied in the type denition. If no width is specified,
172+
than or equal to the maximum width specified in the type definition. If no width is specified,
173173
the domain is the set of all bit sequences, with no constraint on the width of these sequences.
174174
Subbinaries and individual bits may be addressed using subscripts as described in 12.3.
175175
@@ -180,7 +180,7 @@ def __new__(self, value, width=-1, fixed=False):
180180
return str.__new__(self, value)
181181

182182
def __init__(self, value, width=-1, fixed=False):
183-
""" By default, lenght is set to None"""
183+
""" By default, length is set to None"""
184184
self._specified_width = width
185185
self._fixed = fixed
186186
# Check implicit width

0 commit comments

Comments
 (0)