[kea-dev] how to unparse token

Tomek Mrugalski tomasz at isc.org
Thu Nov 26 12:52:21 UTC 2015


Why is this needed at all? For debugging purposes?

If that is so, simply store the string. We can even enforce this by
requiring a string parameter in the base Token class. But it is needed
in 1.0?

Tomek

On 25.11.2015 17:40, Francis Dupont wrote:
> (the whole topic is about the clasification expression which are parsed
> as a vector of Token objects)
> 
> We are divided between two ways to provide an "unparse" method which
> from a Token gives back its textual input.
> In both case we have:
>  parse o unparse = identity
> which means if you parse again the result of unparse you get the same Token.
> Only a solution provides too:
>  unparse o parse = identity
> Ie., unparse gives back the exact input (there is no miracle: this solution
> simply caches the input into the Token object).
> 
> I argue we don't need this (expensive to implement) property, i.e.,
> we can live with in "substring('foo', 01, all)" the "01" be unparsed
> into "1". Opinion? Argument?
> 
> Thanks
> 
> Francis Dupont <fdupont at isc.org>
> 
> PS: I wrote a decompile function too but it requires only a from Token
> to string method so works with #4115 or #4124. Of course the same question
> can be raise: decompile or simply keep the "to be parsed" sring. And
> the day we'll provide a get text config you can guess the question...
> (with in this case the two common arguments: keep comments vs. pretty
> print the output which shows bad constructs :-).
> _______________________________________________
> kea-dev mailing list
> kea-dev at lists.isc.org
> https://lists.isc.org/mailman/listinfo/kea-dev
> 



More information about the kea-dev mailing list