boots-developers team mailing list archive
-
boots-developers team
-
Mailing list archive
-
Message #00003
Re: Regarding the blueprint on Perform proper parsing on lingo input.
Hi Ashish,
PLy isn't always the easiest to work with, but it's pretty solid. To
see the usage of PLy in Boots, check out the Lisp lingo:
http://bazaar.launchpad.net/~boots-developers/boots/trunk/annotate/head%3A/boots/lib/lingos/lisp/lisp.py
http://bazaar.launchpad.net/~boots-developers/boots/trunk/annotate/head%3A/boots/lib/lingos/lisp/parser.py
Cheers!
Jay
On Sun, Apr 4, 2010 at 7:04 PM, Eric Day <eday@xxxxxxxxxxxx> wrote:
> Hi Ashish!
>
> I'm CC'ing the boots developers list (https://launchpad.net/~boots-developers)
> so other folks can comment as well. You probably want to join the group as well.
>
> On Sat, Apr 03, 2010 at 06:08:21PM -0000, buck wrote:
>> I have been thinking on this blueprint to start my boots
>> development journey. This is what I think about the idea.
>>
>> 1. We first need to create lexers and parsers(maybe) for different
>> lingos(first of all sql) so that we can identify what token has been
>> entered (or should be entered) in input.
>> 2. Specification for lexer of each lingo needs to be done separately.
>
> I think this makes sense. Since more than one lingo can use SQL,
> having a way to share the SQL parser/lexer components would be
> great. For example, both the 'sql' and 'piped_sql' lingo would want
> tab completion, so we'll want the ability to reuse that code. Of
> course with piped_sql, we'll want to do tab completion for other
> non-SQL components, such as nodes available to put in the pipe or
> arguments that can be filenames (ok, maybe those are down the road).
>
>> I think we can use the lexer generators to do this work for us. We will
>> be needed to specify the grammar for lingo there.
>> Right now I am studying how to use PLY, a python implementation for lex
>> and yacc.
>
> I'm not up on Python lexers/parser generators. Can anyone else comment
> on Ply?
>
>> Also I have questions related to it.
>> Q0. Am I right ?
>
> So far it sounds good, I'd see what some of the other devs have to say.
>
>> Q1. Do we then need to do a character by character scan to look for
>> tokens as they come? I think that if this blueprint is to support
>> syntax-highlighting in future then character by character scan will be
>> needed.
>
> Initially I would only worry about scanning for completion on TAB,
> but you certainly could do scans for each character for things like
> syntax highlighting.
>
>> Q2. For sql should we follow mysql's list of commands ?
>
> Yeah, more or less. You can also look at the Drizzle parser located
> in: drizzle/drizzled/sql_yacc.yy in the Drizzle source.
>
> Thanks!
> -Eric
>
> _______________________________________________
> Mailing list: https://launchpad.net/~boots-developers
> Post to : boots-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~boots-developers
> More help : https://help.launchpad.net/ListHelp
>
References