comp.lang.ada
 help / color / mirror / Atom feed
* OpenToken : accessing the lexeme from synthetize
@ 2017-07-01 22:20 Lionel Draghi
  2017-07-02  0:01 ` Lionel Draghi
  0 siblings, 1 reply; 5+ messages in thread
From: Lionel Draghi @ 2017-07-01 22:20 UTC (permalink / raw)


Hi,
I suppose it’s obvious, but I couldn't find a way to get the lexeme image within a synthetize procedure.

   procedure Action
     (New_Token : out Nonterminal.Class;
      Source    : in  Token_List.Instance'Class;
      To_ID     : in  Token_ID_Type)
   is 
      Left  : constant Token_List.List_Iterator := Token_List.Initial_Iterator (Source);
      – the identifier I want to diplay is the first token in the list
      Tk : Master_Token.Class := Token_List.Token_Handle (Left).all;
   begin
      – and now?
      Ada.Text_IO.Put_Line (…); 	
   end Action;

Any help? TIA.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: OpenToken : accessing the lexeme from synthetize
  2017-07-01 22:20 OpenToken : accessing the lexeme from synthetize Lionel Draghi
@ 2017-07-02  0:01 ` Lionel Draghi
  2017-07-02 16:50   ` Stephen Leake
  0 siblings, 1 reply; 5+ messages in thread
From: Lionel Draghi @ 2017-07-02  0:01 UTC (permalink / raw)


Le 02/07/2017 à 00:20, Lionel Draghi a écrit :
> Hi,
> I suppose it’s obvious, but I couldn't find a way to get the lexeme image within a synthetize procedure.
>
>    procedure Action
>      (New_Token : out Nonterminal.Class;
>       Source    : in  Token_List.Instance'Class;
>       To_ID     : in  Token_ID_Type)
>    is
>       Left  : constant Token_List.List_Iterator := Token_List.Initial_Iterator (Source);
>       – the identifier I want to diplay is the first token in the list
>       Tk : Master_Token.Class := Token_List.Token_Handle (Left).all;
>    begin
>       – and now?
>       Ada.Text_IO.Put_Line (…); 	
>    end Action;
>
> Any help? TIA.
>

OK, got it :
I did not give the Enumerated.Identifier.Get to the defaulted 
OpenToken.Recognizer.Identifier.Get New_Token parameter !

Same trap than Jacob Sparre Andersen here 
https://groups.google.com/d/msg/comp.lang.ada/srIozAdn-2E/1srxULptGU4J

I wouldn’t have understood this by myself, far too complex.

   procedure Action
      (New_Token : out Nonterminal.Class;
       Source    : in  Token_List.Instance'Class;
       To_ID     : in  Token_ID_Type)
    is
       Left  : constant Token_List.List_Iterator :=
          Token_List.Initial_Iterator (Source);
    begin
       Ada.Text_IO.Put_Line (
          To_String (Identifiers.Instance (
             Token_List.Token_Handle (Left).all).Identifier)); 	
    end Action;
    -- not compiled code

BTW, is there a simpler way to get the identifier ?
Sounds still complex to me this way.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: OpenToken : accessing the lexeme from synthetize
  2017-07-02  0:01 ` Lionel Draghi
@ 2017-07-02 16:50   ` Stephen Leake
  2017-07-07 21:31     ` Lionel Draghi
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Leake @ 2017-07-02 16:50 UTC (permalink / raw)


On Saturday, July 1, 2017 at 7:01:03 PM UTC-5, Lionel Draghi wrote:
> BTW, is there a simpler way to get the identifier ?
> Sounds still complex to me this way.

OpenToken can be confusing.

I've pretty much rewritten it in the monotone branch org.wisitoken, and I'm working on adding error recovery to the parser. You might want to switch to using that. There are no examples, but the tests can be used as examples.

You can only get it from the Ada France monotone server; see http://www.stephe-leake.org/ada-france-access.html


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: OpenToken : accessing the lexeme from synthetize
  2017-07-02 16:50   ` Stephen Leake
@ 2017-07-07 21:31     ` Lionel Draghi
  2017-07-08 13:20       ` Stephen Leake
  0 siblings, 1 reply; 5+ messages in thread
From: Lionel Draghi @ 2017-07-07 21:31 UTC (permalink / raw)


Le 02/07/2017 à 18:50, Stephen Leake a écrit :
> On Saturday, July 1, 2017 at 7:01:03 PM UTC-5, Lionel Draghi wrote:
>> BTW, is there a simpler way to get the identifier ?
>> Sounds still complex to me this way.
>
> OpenToken can be confusing.
>
> I've pretty much rewritten it in the monotone branch org.wisitoken, and I'm working on adding error recovery to the parser. You might want to switch to using that. There are no examples, but the tests can be used as examples.
>
> You can only get it from the Ada France monotone server; see http://www.stephe-leake.org/ada-france-access.html
>

OK to switch, but unfortunately I m not familiar with monotone.

mtn --db ~/monotone-dbs/ada-france.db --key '' pull www.ada-france.org 
"org.wisi*"

seems to have some effect :

mtn: avertissement : les arguments séparés de serveur et de motif sont 
dépréciés, veuillez plutôt utiliser la syntaxe des appels d'URI.
mtn: réception anonyme ; utilisez -kNOMCLEF si vous avez besoin d'être 
authentifié
mtn: connexion à « mtn://www.ada-france.org »
mtn:   motif d'inclusion  « org.wisi* »
mtn:   motif d'exclusion  «  »
mtn: recherche d'éléments à synchroniser :
mtn: certificats | clefs | révisions
mtn:         994 |     5 |       324
mtn: octets entrants | octets sortants | cert. entrants | rév. sortants
mtn:           1,1 k |           1,3 k |            0/0 |           0/0
mtn: échange réussi avec « mtn://www.ada-france.org »

but there is nothing left in the directory.
Am I missing something obvious?



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: OpenToken : accessing the lexeme from synthetize
  2017-07-07 21:31     ` Lionel Draghi
@ 2017-07-08 13:20       ` Stephen Leake
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Leake @ 2017-07-08 13:20 UTC (permalink / raw)


On Friday, July 7, 2017 at 4:31:42 PM UTC-5, Lionel Draghi wrote:
> Le 02/07/2017 à 18:50, Stephen Leake a écrit :
> > On Saturday, July 1, 2017 at 7:01:03 PM UTC-5, Lionel Draghi wrote:
> >> BTW, is there a simpler way to get the identifier ?
> >> Sounds still complex to me this way.
> >
> > OpenToken can be confusing.
> >
> > I've pretty much rewritten it in the monotone branch org.wisitoken, and I'm working on adding error recovery to the parser. You might want to switch to using that. There are no examples, but the tests can be used as examples.
> >
> > You can only get it from the Ada France monotone server; see http://www.stephe-leake.org/ada-france-access.html
> >
> 
> OK to switch, but unfortunately I m not familiar with monotone.
> 
> mtn --db ~/monotone-dbs/ada-france.db --key '' pull www.ada-france.org 
> "org.wisi*"
> 
> seems to have some effect :
> <snip>
> 
> but there is nothing left in the directory.
> Am I missing something obvious?

'mtn pull' only pulls revs from the remote repository to the local repository.

You must follow it with 'mtn checkout' to populate a workspace on your disk. You can use 'mtn list branches' first to show what branches are present in your local repository.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-07-08 13:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-01 22:20 OpenToken : accessing the lexeme from synthetize Lionel Draghi
2017-07-02  0:01 ` Lionel Draghi
2017-07-02 16:50   ` Stephen Leake
2017-07-07 21:31     ` Lionel Draghi
2017-07-08 13:20       ` Stephen Leake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox