Perl 6 - the future is here, just unevenly distributed

IRC log for #marpa, 2016-07-19

| Channels | #marpa index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:46 rgrinberg joined #marpa
01:48 ilbot3 joined #marpa
01:48 Topic for #marpa is now Start here: http://savage.net.au/Marpa.html - Pastebin: http://scsys.co.uk:8002/marpa - Jeffrey's Marpa site: http://jeffreykegler.github.io/Marpa-web-site/ - IRC log: http://irclog.perlgeek.de/marpa/today
03:45 ronsavage joined #marpa
04:59 ernimril_ joined #marpa
05:21 idiosyncrat_ Good night!
07:43 pczarn joined #marpa
08:14 ronsavage joined #marpa
10:37 pczarn joined #marpa
12:13 rgrinberg joined #marpa
12:21 rgrinberg joined #marpa
16:35 user2_ joined #marpa
17:36 idiosyncrat_ joined #marpa
19:14 jdurand joined #marpa
19:15 jdurand Jeffrey, there is one thing I dunno understand with ASF v.s. classic parse tree values
19:15 jdurand In "classic" parse tree value, the marpa_v_xxx() methods are used, and we use the input stack on tokens
19:16 jdurand Now, in the ASF, how, if we want to compute the value of a token, do we know to which indice in the input it correspond?
19:16 jdurand "how do we know"
19:17 jdurand I noticed that the traverser methods only offers a "literal" method to get back to what was in the input string - how about the input stack used when we do lexeme alternative/compete
19:18 jdurand "alternative/complete" ?
19:18 idiosyncrat_ input stack used?
19:19 idiosyncrat_ do you mean the set of alternatives at that point?
19:21 jdurand Yes, I am talking about the "value" that is in marpa_r_alternative (Marpa_Recognizer r, Marpa_Symbol_ID token_id, int value, int length). My question is how do we get back "value" value when we are in the ASF mode
19:23 jdurand My idea is to reuse this "value" from an input stack, assuming "value" in an index in an array belonging to user-space, in order to get the user-space value associated to a token when traversing the tree in forest mode
19:23 idiosyncrat_ is symbol_id() not what you want?
19:26 jdurand No I am not talking about the symbol o rule id, but really something that allows to link to the user input, without assuming it is a string like in ASF. Then, only the "value" parameter of marpa_r_alternative is usable I think - no?
19:26 idiosyncrat_ If that is not what you wanted, perhaps you could use the values from span() to index an array that you create at input time.
19:27 idiosyncrat_ Oh, I see -- non-string values.
19:28 idiosyncrat_ Best I can think of is to create your own data structure reflecting the input and use the value from span() to index it.
19:28 jdurand Yes, I was thinking to span(), true - but using span() as an index is assuming that the whole thing is in the token-stream model - yes, you got it - non-string values: something that only the user knows about, and as far as I know, this is the "value" parameter of marpa_r_alternative: this semantic of this parameter is meaninful only to the end-user
19:30 jdurand In conclusion, it seems to me that there is a missing link between alternatives and the forest mode, in the sense that alternative values are not accessible directly
19:30 idiosyncrat_ It would have been nice to have included that, I agree
19:32 jdurand Isn't there a hiden/undocumented/experimetal marpa method to achieve that ?
19:37 jdurand ps: if not I'll stick to the span() method, stating that the length of an alternative must be 1 (from marpa_r_alternative point of view)
19:51 jdurand Btw I have finished the port of ASF.pm to pure C (modulo this span() thingy) and I am in the test phase -;
20:12 idiosyncrat_ Re a hidden/undocumented/experimental method.  I just looked and I don't see one.
20:13 idiosyncrat_ It's been so long there may be one I am missing.
20:14 idiosyncrat_ In any case, at the Libmarpa level token value is often an index into an external array of the actual values ...
20:14 idiosyncrat_ so using the span in place of it is not that different.
20:21 jdurand Fine with me - thx
22:46 ronsavage joined #marpa
23:59 idiosyncrat_ joined #marpa

| Channels | #marpa index | Today | | Search | Google Search | Plain-Text | summary