TableTest
UtilTest
lex.yyTest
+tags
}
-void In__Char_(char *ch)
+void In__Character_(char *ch)
{
int d;
}
-void In__Int_(OBNC_INTEGER *x)
+void In__Integer_(OBNC_INTEGER *x)
{
int ch, i, n;
char buf[(CHAR_BIT * sizeof (OBNC_INTEGER) / 3) + 3];
}
-void In__Real_(OBNC_REAL *x)
+void In__RealNum_(OBNC_REAL *x)
{
int scanCount;
end Open;
- procedure Char*(var ch: Char);
+ procedure Character*(var ch: Char);
(**returns in ch the character at the current position*)
- end Char;
+ end Character;
- procedure Int*(var i: Int);
+ procedure Integer*(var i: Int);
(**returns in i the integer constant at the current position according to the format
integer = digit {digit} | digit {hexDigit} "H".
hexDigit = digit | "A" | "B" | "C" | "D" | "E" | "F".
*)
- end Int;
+ end Integer;
- procedure Real*(var x: Real);
+ procedure RealNum*(var x: Real);
(**returns in x the real constant at the current position according to the format
real = digit {digit} "." {digit} [ScaleFactor].
ScaleFactor = "E" ["+" | "-"] digit {digit}.
*)
- end Real;
+ end RealNum;
procedure String*(var str: array of Char);
s: array 12 of Char;
begin
- In.Char(ch);
+ In.Character(ch);
ASSERT(In.Done);
ASSERT(ch = "a");
- In.Int(n);
+ In.Integer(n);
ASSERT(In.Done);
ASSERT(n = 37);
- In.Int(n);
+ In.Integer(n);
ASSERT(In.Done);
ASSERT(n = 37H);
- In.Real(x);
+ In.RealNum(x);
ASSERT(In.Done);
ASSERT(x >= 3.14 - eps);
ASSERT(x <= 3.14 + eps);
}
-void Out__Char_(char ch)
+void Out__Character_(char ch)
{
putchar(ch);
}
}
-void Out__Int_(OBNC_INTEGER i, OBNC_INTEGER n)
+void Out__Integer_(OBNC_INTEGER i, OBNC_INTEGER n)
{
OBNC_WriteInt(i, n, stdout);
}
}
-void Out__Real_(OBNC_REAL x, OBNC_INTEGER n)
+void Out__RealNum_(OBNC_REAL x, OBNC_INTEGER n)
{
printf("%*" OBNC_REAL_MOD_W "E", (int) n, x);
}
end Open;
- procedure Char*(ch: Char);
+ procedure Character*(ch: Char);
(**writes the character ch to the end of the output stream*)
- end Char;
+ end Character;
procedure String*(s: array of Char);
end String;
- procedure Int*(i, n: Int);
+ procedure Integer*(i, n: Int);
(**writes the integer i to the end of the output stream. If the textual representation of i requires m characters, i is right adjusted in a field of Max(n, m) characters padded with blanks at the left end. A plus sign is not written.*)
- end Int;
+ end Integer;
procedure Hex*(i: Int);
end Hex;
- procedure Real*(x: Real; n: Int);
+ procedure RealNum*(x: Real; n: Int);
(**writes the real number x to the end of the output stream using an exponential form. If the textual representation of x requires m characters (including a two-digit signed exponent), x is right adjusted in a field of Max(n, m) characters padded with blanks at the left end. A plus sign of the mantissa is not written.*)
- end Real;
+ end RealNum;
procedure Ln*;
import Out;
begin
- Out.Char("a"); Out.Ln;
+ Out.Character("a"); Out.Ln;
Out.String("abc"); Out.Ln;
- Out.Int(-07FFFH - 1, 0); Out.Ln; (*minimum 16-bit integer*)
- Out.Int(-1, 0); Out.Ln;
- Out.Int(-1, 3); Out.Ln;
- Out.Int(0, 0); Out.Ln;
- Out.Int(1, 0); Out.Ln;
- Out.Int(37, 0); Out.Ln;
- Out.Int(07FFFH, 0); Out.Ln; (*maximum 16-bit integer*)
+ Out.Integer(-07FFFH - 1, 0); Out.Ln; (*minimum 16-bit integer*)
+ Out.Integer(-1, 0); Out.Ln;
+ Out.Integer(-1, 3); Out.Ln;
+ Out.Integer(0, 0); Out.Ln;
+ Out.Integer(1, 0); Out.Ln;
+ Out.Integer(37, 0); Out.Ln;
+ Out.Integer(07FFFH, 0); Out.Ln; (*maximum 16-bit integer*)
Out.Hex(0); Out.Ln;
Out.Hex(1); Out.Ln;
Out.Hex(0BEEFH); Out.Ln;
- Out.Real(-1.0, 0); Out.Ln;
- Out.Real(0.0, 0); Out.Ln;
- Out.Real(0.0, 14); Out.Ln;
- Out.Real(1.0, 0); Out.Ln;
- Out.Real(37.0, 0); Out.Ln;
- Out.Real(0.37, 0); Out.Ln
+ Out.RealNum(-1.0, 0); Out.Ln;
+ Out.RealNum(0.0, 0); Out.Ln;
+ Out.RealNum(0.0, 14); Out.Ln;
+ Out.RealNum(1.0, 0); Out.Ln;
+ Out.RealNum(37.0, 0); Out.Ln;
+ Out.RealNum(0.37, 0); Out.Ln
end OutTest.
{"ASSERT", TREES_PROCEDURE_KIND, TREES_ASSERT_PROC},
{"Bool", TREES_TYPE_KIND, TREES_BOOLEAN_TYPE},
{"Byte", TREES_TYPE_KIND, TREES_BYTE_TYPE},
- {"Char", TREES_TYPE_KIND, TREES_CHAR_TYPE},
{"CHR", TREES_PROCEDURE_KIND, TREES_CHR_PROC},
+ {"Char", TREES_TYPE_KIND, TREES_CHAR_TYPE},
{"DEC", TREES_PROCEDURE_KIND, TREES_DEC_PROC},
{"EXCL", TREES_PROCEDURE_KIND, TREES_EXCL_PROC},
{"FLOOR", TREES_PROCEDURE_KIND, TREES_FLOOR_PROC},
{"ODD", TREES_PROCEDURE_KIND, TREES_ODD_PROC},
{"ORD", TREES_PROCEDURE_KIND, TREES_ORD_PROC},
{"PACK", TREES_PROCEDURE_KIND, TREES_PACK_PROC},
- {"Real", TREES_TYPE_KIND, TREES_REAL_TYPE},
{"ROR", TREES_PROCEDURE_KIND, TREES_ROR_PROC},
+ {"Real", TREES_TYPE_KIND, TREES_REAL_TYPE},
{"SET", TREES_TYPE_KIND, TREES_SET_TYPE},
- {"UNPK", TREES_PROCEDURE_KIND, TREES_UNPK_PROC}};
+ {"UNPK", TREES_PROCEDURE_KIND, TREES_UNPK_PROC}
+ };
int i;
Trees_Node node;
result = NULL;
if (Trees_Symbol(type) == IDENT) {
name = Trees_Name(type);
- fprintf(stderr,"%s\n", name);
identDef = Table_At(name);
- fprintf(stderr,"%p\n", identDef);
if (identDef != NULL) {
if (Trees_Kind(identDef) == TREES_TYPE_KIND) {
typeStruct = Types_Structure(identDef);
begin
a := 4;
b := 6;
-Out.Int(ORD({1, 2, a, 5, b, 8}), 0); Out.Ln;
-Out.Int(ORD({1, 2, a..b, 8}), 0); Out.Ln;
-Out.Int(ORD({1, 2, a, 5, b, 8} = {1, 2, a..b, 8}), 0); Out.Ln;
+Out.Integer(ORD({1, 2, a, 5, b, 8}), 0); Out.Ln;
+Out.Integer(ORD({1, 2, a..b, 8}), 0); Out.Ln;
+Out.Integer(ORD({1, 2, a, 5, b, 8} = {1, 2, a..b, 8}), 0); Out.Ln;
ASSERT({1, 2, a, 5, b, 8} = {1, 2, a..b, 8});
i := 0;
j := 0;