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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,fae38b9316611100,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.213.106 with SMTP id nr10mr103767pbc.2.1335294078998; Tue, 24 Apr 2012 12:01:18 -0700 (PDT) Path: r9ni94056pbh.0!nntp.google.com!news1.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Charly Newsgroups: comp.lang.ada Subject: question about the usage of opentoken-4.0b Date: Tue, 24 Apr 2012 12:01:18 -0700 (PDT) Organization: http://groups.google.com Message-ID: <10328658.73.1335294078629.JavaMail.geo-discussion-forums@vber6> NNTP-Posting-Host: 91.34.78.176 Mime-Version: 1.0 X-Trace: posting.google.com 1335294078 27675 127.0.0.1 (24 Apr 2012 19:01:18 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 24 Apr 2012 19:01:18 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=91.34.78.176; posting-account=5zx--goAAAD06H29EnWQGKTO-gctuXHl User-Agent: G2/1.0 Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-04-24T12:01:18-07:00 List-Id: Hi, I have a question about the usage of opentoken-4.0b, a scanner/parser-library written in Ada. So my question isn't about the language Ada itself but only about this library. I define a Grammar starting with Grammar : constant Production_List.Instance := Prog <= Def_List & EOF + Program_Token.Create and Def_List <= Def_List & Ent + Element_List.Concat and Def_List <= Ent + Element_List.Create and Ent <= Entity_Key & Ident & Colon & El_List & End_Key & Semicolon + Entity_Token.Create and ... and I create and call the parser with Text_Parser := LALR_Parser.Generate (Grammar, Analyzer, False); LALR_Parser.Parse (Text_Parser); It works fine, but to use the result of the parsing, which happens to be the start element 'Prog' of the above Grammar, I had to store it in an global variable, as one of the actions of the procedure 'Program_Token.Create'. But I would like to avoid this, because I don't like global variables; The variable 'Prog' in the Grammar definition has the right type, but does not contain any data, as I expected. Any help would be appreciated. Sincerely Charly