From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,XPRIO autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d875f8fc1f73cf09,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-04-21 12:22:29 PST Path: newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!dispose.news.demon.net!demon!btnet-peer0!btnet-feed5!btnet!mendelevium.btinternet.com!not-for-mail From: "singlespeeder" Newsgroups: comp.lang.ada Subject: Compiling AFLEX 1.4a with Dec Ada 83 3.5-20 on Open VMS 7.1 Date: Sat, 21 Apr 2001 20:19:12 +0100 Organization: BT Internet Message-ID: <9bsm5c$khe$1@uranium.btinternet.com> NNTP-Posting-Host: host213-122-132-4.btinternet.com X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: newsfeed.google.com comp.lang.ada:6830 Date: 2001-04-21T20:19:12+01:00 List-Id: I've got hold of the source for AFLEX 1.4a and want to compile it to run on Open VMS 7.1 The compiler I have access to is DEC Ada 83 3.5-20. As far as I can tell there are two things in the code that require modification. 1) AFLEX 1.4a assumes that the Ada 95 package Ada.Command_Line is available. 2) AFLEX 1.4a assumes that the Ada 95 implementation of Text_IO is available, and uses the file Standard_Error. It also generates a debug scanner that uses Standard_Error. I've addressed the first issue by writing a package VAX_Command_Line that wraps starlet, and I just used that in place of Ada.Command_Line - I only had to change two packages, both of which were documented in the manual. I'm having more trouble with the second issue. In the lex specification for the scanner I currently get around the scanner assuimg the presence of Standard_Error by the following kludge in my lex specification. (Note that AFLEX 1.4a only has two user defined sections, not 4 as in some manuals) -- definitions %% -- rules %% -- user defined section copied before yylex package foo is standard_error : text_io.file_type; function yylex return token; end foo; package body foo is ## -- user defined section copied after yylex begin text_io.create (file => standard_error, mode => out_file, name => lexer_error.txt); end foo; So my package foo declares it's own standard_error, which it creates when the package is elaborated. It always does this even when I instruct AFLEX not to generate a debug scanner - in which case I get an empty lexer_error.txt file. Is there a better way of writing my lex specification so that I don't have to have this kludge, or am I going to have to poke around in the source of Aflex? I don't want to do this because I don't want to then have to generate a set of tests for AFLEX to make sure I haven't screwed it up. Nick