comparison notes.txt @ 37:ac3cd8de7a10

towards big rework of tokenisation
author Henry S. Thompson <ht@markup.co.uk>
date Tue, 25 Apr 2017 18:30:04 +0100
parents ae605b77d1e4
children 4c6a341e75da
comparison
equal deleted inserted replaced
36:ae605b77d1e4 37:ac3cd8de7a10
1 Tokenisation patterns, derived from parse.py, derived from
2 https://sites.google.com/site/e90e50/random-topics/tool-for-parsing-formulas-in-excel
3 and
4 parser_formule_with_textbox_v01_2003.xla
5 linked to therein
6
7 1 ("[^"]*") q
8 A text (delimited by double quotes)
9 2 (\{[^}]+}) m
10 A constant matrix
11 3 (,) c
12 A list (function parameter) separator
13 4 ([^=\-+*/();:,.$&lt;>^!]+(?:\.[^=\-+*/();:,.$&lt;>^!]+)*\() f
14 A function name followed by an opening parenthesis
15 5 ([)]) p
16 A closing parenthesis
17 6 (^=|\() l
18 The beginning of the formula or an opening
19 parenthesis (not part of a function)
20 7 ((?:(?:'[^']+')|(?:\[[0-9]+\][^!]*)|(?:[a-zA-Z_][a-zA-Z0-9._]*)!)) n
21 A sheet name (either delimited by single quotes, or
22 bracketed number plus optional string,
23 or simple name (syntax is a _guess_))
24 8 (\$?[A-Z]+\$?[0-9]+) s or r
25 A cell reference
26 9 ([a-zA-Z_\\][a-zA-Z0-9._]*) v
27 A name (always for a variable?)
28 10 (.) x
29 Single characters not matched by the previous patterns
30 ----------
1 You can't depend on 31 You can't depend on
2 <f si="..." t="shared"/> 32 <f si="..." t="shared"/>
3 That is, it's _true_, but you can have a table with shared formulae 33 That is, it's _true_, but you can have a table with shared formulae
4 that doesn't use it. Compare M17:T28 (see below, uses shared) and 34 that doesn't use it. Compare M17:T28 (see below, uses shared) and
5 C17:J28 (mostly no shared) in sample4 35 C17:J28 (mostly no shared) in sample4
63 Not handling variables as references FIXED. Not catching external 93 Not handling variables as references FIXED. Not catching external
64 references to variables FIXED (as externals). Not catching naked [n]! as external 94 references to variables FIXED (as externals). Not catching naked [n]! as external
65 references FIXED 95 references FIXED
66 Solo local vars are recursively dereferenced 96 Solo local vars are recursively dereferenced
67 The definition table is in workbook.xml definedNames/definedName[@name=$name]/. 97 The definition table is in workbook.xml definedNames/definedName[@name=$name]/.
68 Sheet name to filename mapping for locals is in workbook.xml sheets/sheet[@name=$sname]/@sheetId 98 Sheet name to filename mapping for locals is in workbook.xml
99 sheets/sheet[@name=$sname]/@sheetId
100 These appear in definedName, single-quoted if (iff?) the sheet name has spaces
101 (or other specials?)
69 ??? Variables on l or r of ranges are just looked up: if they are complex 102 ??? Variables on l or r of ranges are just looked up: if they are complex
70 no recursion is done: the _semantics_ of this case are not clear to 103 no recursion is done: the _semantics_ of this case are not clear to
71 me, need a real-life example... 104 me, need a real-life example...
72 @@ Variables whose value is itself a range are not being handled 105 @@ Variables whose value is itself a range are not being handled
73 ----------- 106 -----------