Notes on upcoming parser issues and changes

1 view
Skip to first unread message

Atul Varma

unread,
Dec 15, 2008, 5:55:15 PM12/15/08
to ubiqui...@googlegroups.com
Hey all,

Jono and I just had a brief discussion about changes that might need to
be made to the parser (currently contained in
ubiquity/modules/parser/parser.js) in the near future:

* There's a lot of similarities between a NLParser.Verb instance and a
command object (as created by a CommandSource object). Historically,
the reason for this is that NLParser and CommandSource were originally
written as two separate pieces of software that were later integrated,
but it would be good to unify the two so that there aren't two
very-similar classes lying about.

* NLParser.Parser currently assumes that there's only one query going on
at a time, which by and large is the case for Ubiquity (as using the
command mode or a context menu are mutually exclusive). However, this
may not always be the case: for instance, some extension may want to
query Ubiquity while the user is entering a sentence in command mode.
To this end, we might want to make a ParserQuery object that contains
the state for an individual query, which would allow multiple
asynchronous queries to be executed at the same time.

For the time being, I might move NLParser.Parser so that it's an
application-wide singleton that can only deal with one query at a time.
When I originally created application-wide singletons several weeks ago,
I didn't make Parser a singleton because of how it could only deal with
one query at a time, but it appears that creating per-window instances
of Parser that use the same suggestion memory may not result in correct
behavior either--see the diagram at [1] for more information.

If anyone has any questions or comments on this, please feel free to
post them!

- Atul

[1] https://wiki.mozilla.org/Labs/Ubiquity/Ubiquity_0.1.3_Architecture

Reply all
Reply to author
Forward
0 new messages