On 07/05/2012 17:04, Nick Treleaven wrote:
On 02/05/2012 05:46, Lex Trotman wrote:
- its not clear how it all goes together, the workspace contains
global tags and work_objects, or is that files and whats the
workspace work objects are document tags. global tags explained in geany's manual.
difference between source_file and file_entry?
It doesn't look like tm_file_entry_ is really used.
- similarly whats the difference between symbol and tag?
tm_symbol_ doesn't seem to be used.
Also, tm_project_ is not used either.
- Ability to expand tagmanager to handle names declared in lexical
scopes (not to be confused with struct/class scopes). Here is the example again with some numbers so I can refer to them
b. @Nick, when you say sort by scope then name, are you wanting to have an entry in the table for each declaration of the name?
no
- If so this makes the array much bigger to search and your search
speed depends on size, and it doesn't get you anything, you can't search by scope since you don't know if the name is declared in the scope you are in or an outer scope compare p at<1> and<2>
- having a single name array which then points to scope info for the
name is a viable approach (disclosure, thats how I'm doing the symbol table for a language I'm developing) but the table being searched is usually larger than if you have nested arrays. Being smaller these are faster to search if the search isn't O(1), hence the suggestion of trie instead of bsearch.
the gain in simplicity makes a bigger array to search worth it. Remember, global tags aren't included in the workspace array of tagmanager, so we're not talking a big number of tags, and we have o(log n) searching.
Oops, forget the global/workspace division, we still need to search global scopes. But I don't know why you think this is too slow.