On 09.09.13 16:28, Stephen Leake wrote:
> wisi-validate-cache: debug.adb:7:5: syntax error in grammar state 1026;
> unexpected P, expecting one of (default SEMICOLON)
>
> This is a bug in ada-grammar.wy; there's a missing 'identifier_opt' in
> 'protected_definition':
>
> --- ada-grammar.wy
> +++ ada-grammar.wy
> @@ -1584,7 +1584,7 @@ protected_definition
> (progn
> (wisi-statement-action 2 'block-middle 4 'block-end)
> (wisi-containing-action 2 3))
> - | declarative_part_opt END
> + | declarative_part_opt END identifier_opt
> (wisi-statement-action 2 'block-end)
> ;
>
>
The patch is working. Excellent.
I am appending a diff for opentoken-4.0w-2013-09-02, in case someone
wishes to experiment on Mac OS X. Some of them may be of interest also
if running on other systems.
The changes have let me
(a) translate wisi-generate.exe on a Mac (10.7.5) with GNAT GPL 2012,
(b) run the testing parts of the its "make" process.
Both appropriate the files in build/linux_{release|debug} for
configuration and building.
A minimal change for (a) was setting the GPRBUILD_TARGET
to the triple output by gcc -v.
The other changes address .gpr paths, source include paths,
line length issues, the executable path, and comparison of lines
of text irrespective of EOL characters (see AUnit.Check).
Only Windows includes "." in PATH automatically. Therefore,
starting "make" as seen below lets the process find the freshly
built executables:
$ PATH=$(pwd):$PATH make
(The only thing left, for full Mac support, is, I think, to select
the proper tools for making the dynamic library. (It is built as
a file ending with ".so"))
diff -Naur org.opentoken.stephe-4.0w-2013-09-02/Test/aunit-check.adb
opentoken-4.0w-2013-09-02/Test/aunit-check.adb
--- org.opentoken.stephe-4.0w-2013-09-02/Test/aunit-check.adb 2013-09-02
08:17:54.000000000 +0000
+++ opentoken-4.0w-2013-09-02/Test/aunit-check.adb 2013-09-09
23:00:50.000000000 +0000
@@ -26,6 +26,7 @@
with AUnit.Assertions;
with Ada.Exceptions;
with Ada.Strings.Fixed;
+with Ada.Strings.Maps;
package body AUnit.Check is
procedure Gen_Check_Discrete
@@ -94,6 +95,15 @@
return True;
end Not_In;
+ package IO_Aux is
+
+ function Chomp (Line : String) return String;
+ -- Get_Line may not discard all line terminating characters when input
has
+ -- been written on a system that uses a different sequence of them.
Chomp
+ -- removes all of those character at the end of Line if present.
+
+ end IO_Aux;
+
procedure Check_Files
(Label : in String;
Computed_Name : in String;
@@ -128,8 +138,9 @@
begin
while not End_Of_File (Expected) and not End_Of_File (Computed) loop
declare
- Computed_Line : constant String := Get_Line (Computed);
- Expected_Line : constant String := Get_Line (Expected);
+ use IO_Aux;
+ Computed_Line : constant String := Chomp (Get_Line (Computed));
+ Expected_Line : constant String := Chomp (Get_Line (Expected));
begin
-- Get_Line advances the line counter beyond the line of
interest
if Not_In (Line (Computed) - 1, Skip) then
@@ -152,4 +163,36 @@
end;
end Check_Files;
+ package body IO_Aux is
+
+ function Chomp (Line : String) return String
+ is
+ use Ada.Strings.Maps;
+
+ function Last_Non_Terminating (P : Natural) return Natural;
+ -- Position of the last character in Line that is not one of the line
+ -- terminating characters, or 0. Starts looking at position P,
backwards.
+
+ EOL_Set : constant Character_Set := To_Set (Character'Val (10) &
Character'Val (13));
+
+ function Last_Non_Terminating (P : Natural) return Natural
+ is
+ begin
+ if P >= Line'First then
+ if Is_In (Line (P), EOL_Set) then
+ return Last_Non_Terminating (P - 1);
+ else
+ return P;
+ end if;
+ else
+ return 0;
+ end if;
+ end Last_Non_Terminating;
+
+ begin
+ return Line (Line'First .. Last_Non_Terminating (Line'Last));
+ end Chomp;
+
+ end IO_Aux;
+
end AUnit.Check;
diff -Naur org.opentoken.stephe-4.0w-2013-09-02/Test/gen_opentoken_aunit.adb
opentoken-4.0w-2013-09-02/Test/gen_opentoken_aunit.adb
--- org.opentoken.stephe-4.0w-2013-09-02/Test/gen_opentoken_aunit.adb
2013-09-02 08:17:54.000000000 +0000
+++ opentoken-4.0w-2013-09-02/Test/gen_opentoken_aunit.adb 2013-09-09
21:30:30.000000000 +0000
@@ -59,7 +59,9 @@
Check (Label & ".RHS", First_Token (Computed), First_Token (Expected));
end Check;
- procedure Check (Label : in String; Computed : in
LALR.LRk.Item_Lookahead_Ptr; Expected : in LALR.LRk.Item_Lookahead_Ptr)
+ procedure Check (Label : in String;
+ Computed : in LALR.LRk.Item_Lookahead_Ptr;
+ Expected : in LALR.LRk.Item_Lookahead_Ptr)
is
use AUnit.Check;
use LALR.LRk;
@@ -121,7 +123,9 @@
Check (Label & ".Next = null", Computed.Next = null, Expected.Next =
null);
end Check;
- procedure Check (Label : in String; Computed : in
LALR.LRk.Set_Reference_Ptr; Expected : in LALR.LRk.Set_Reference_Ptr)
+ procedure Check (Label : in String;
+ Computed : in LALR.LRk.Set_Reference_Ptr;
+ Expected : in LALR.LRk.Set_Reference_Ptr)
is
use AUnit.Check;
use LALR.LRk;
@@ -220,7 +224,9 @@
return Result;
end "+";
- procedure Check (Label : in String; Computed : in LALR.Parse_Action_Rec;
Expected : in LALR.Parse_Action_Rec)
+ procedure Check (Label : in String;
+ Computed : in LALR.Parse_Action_Rec;
+ Expected : in LALR.Parse_Action_Rec)
is
use AUnit.Check;
use LALR;
@@ -237,7 +243,9 @@
end case;
end Check;
- procedure Check (Label : in String; Computed : in
LALR.Parse_Action_Node_Ptr; Expected : in LALR.Parse_Action_Node_Ptr)
+ procedure Check (Label : in String;
+ Computed : in LALR.Parse_Action_Node_Ptr;
+ Expected : in LALR.Parse_Action_Node_Ptr)
is
use AUnit.Check;
use type LALR.Parse_Action_Node_Ptr;
diff -Naur org.opentoken.stephe-4.0w-2013-09-02/build/linux_debug/Makefile
opentoken-4.0w-2013-09-02/build/linux_debug/Makefile
--- org.opentoken.stephe-4.0w-2013-09-02/build/linux_debug/Makefile
2013-09-02 08:17:54.000000000 +0000
+++ opentoken-4.0w-2013-09-02/build/linux_debug/Makefile 2013-09-09
21:12:42.000000000 +0000
@@ -10,7 +10,7 @@
one : RUN_ARGS := ../../wisi/test/body_instantiation_conflict.wy Elisp
one : wisi-generate.run
-GPRBUILD_TARGET := x86-linux
+GPRBUILD_TARGET := x86_64-apple-darwin10.8.0
include ../common.make
# Local Variables:
diff -Naur
org.opentoken.stephe-4.0w-2013-09-02/build/linux_debug/opentoken_test.gpr
opentoken-4.0w-2013-09-02/build/linux_debug/opentoken_test.gpr
--- org.opentoken.stephe-4.0w-2013-09-02/build/linux_debug/opentoken_test.gpr
2013-09-02 08:17:54.000000000 +0000
+++ opentoken-4.0w-2013-09-02/build/linux_debug/opentoken_test.gpr
2013-09-10 12:44:43.000000000 +0000
@@ -1,10 +1,11 @@
-- For running OpenToken tests.
with "aunit";
-with "common";
+with "../common";
project OpenToken_Test is
for Source_Dirs use
- ("../..",
+ (".",
+ "../..",
"../../Examples/ASU_Example_3_6",
"../../Examples/ASU_Example_4_46",
"../../Examples/ASU_Example_5_10",
@@ -12,6 +13,7 @@
"../../Language_Lexers",
"../../Test",
"../../Test",
+ "../../wisi",
"../../wisi/test");
for Object_Dir use "obj";
@@ -23,6 +25,10 @@
Common.Compiler.Style_Checks &
Common.Compiler'Default_Switches ("Ada");
+ for Switches ("empty_production_5*.ad?") use
+ Common.Compiler.Debug_Switches &
+ Common.Compiler.Style_Checks &
+ Common.Compiler'Default_Switches ("Ada") & ("-gnatyM123");
end Compiler;
package Builder is
diff -Naur org.opentoken.stephe-4.0w-2013-09-02/build/linux_release/Makefile
opentoken-4.0w-2013-09-02/build/linux_release/Makefile
--- org.opentoken.stephe-4.0w-2013-09-02/build/linux_release/Makefile
2013-09-02 08:17:54.000000000 +0000
+++ opentoken-4.0w-2013-09-02/build/linux_release/Makefile 2013-09-09
23:43:32.000000000 +0000
@@ -9,7 +9,7 @@
one : bracketed_comment_test-run.run
-GPRBUILD_TARGET := x86-linux
+GPRBUILD_TARGET := x86_64-apple-darwin10.8.0
include ../common.make
# Local Variables:
diff -Naur
org.opentoken.stephe-4.0w-2013-09-02/build/linux_release/opentoken_test.gpr
opentoken-4.0w-2013-09-02/build/linux_release/opentoken_test.gpr
--- org.opentoken.stephe-4.0w-2013-09-02/build/linux_release/opentoken_test.gpr
2013-09-02 08:17:54.000000000 +0000
+++ opentoken-4.0w-2013-09-02/build/linux_release/opentoken_test.gpr
2013-09-10 12:38:02.000000000 +0000
@@ -18,7 +18,8 @@
project OpenToken_Test is
for Source_Dirs use
- ("../../Examples/ASU_Example_3_6",
+ (".",
+ "../../Examples/ASU_Example_3_6",
"../../Examples/ASU_Example_4_46",
"../../Examples/ASU_Example_5_10",
"../../Examples/Language_Lexer_Examples",
@@ -33,6 +34,9 @@
-- AUnit requires -fno-strict-aliasing
OpenToken.Compiler'Default_Switches ("Ada") & ("-fno-strict-aliasing");
+ for Switches ("empty_production_5*.ad?") use
+ -- AUnit requires -fno-strict-aliasing
+ OpenToken.Compiler'Default_Switches ("Ada") & ("-fno-strict-aliasing",
"-gnatyM123");
end Compiler;
package Builder is
_______________________________________________
Emacs-ada-mode mailing list
[email protected]
http://host114.hostmonster.com/mailman/listinfo/emacs-ada-mode_stephe-leake.org