[GRASS5] I18N for GRASS: continued discussion
glynn.clements at virgin.net
Sun, 17 Nov 2002 11:27:39 +0000
Glynn Clements wrote:
> Updating the history file probably wouldn't be that hard in itself.
> However, when reading from stdin, the original form of the expression
> isn't currently stored anywhere, so you would get e.g. "add(a,mul(b,c))"
> instead of "a+b*c". To fix this, I would need to add code to record the
> input when reading from stdin.
I've committed an update to CVS which stores the expression in the
The expression is regenerated from the parse tree, rather than from
stored input. The main reason for taking this approach is that the
input can consist of multiple definitions, and you can't reliably tell
where the boundaries lie without actually parsing the input.
Consequently, using stored input would require that the complete input
was stored for each map. If the input consisted of a large number of
expressions, or the expressions were particularly complex, this could
result in the history being truncated, so the expressions for the
later maps wouldn't be stored at all.
I also changed certain aspects of the parser and the parse tree to
allow the original expression to be reconstructed more accurately.
Specifically, where the input uses infix operators, the stored version
will now use infix operators instead of prefix functions. Also, any
type conversion functions which are inserted by the type checking code
won't appear in the output.
Obviously, certain aspects of the input won't be reflected in the
stored version, e.g. the amount and type of whitespace, or extraneous
Glynn Clements <firstname.lastname@example.org>