Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ANN: SilverCity 0.1.0

4 views
Skip to first unread message

Brian Quinlan

unread,
Feb 2, 2002, 4:20:38 PM2/2/02
to
SilverCity is a Python extension that allows you to retrieve lexical
information about different languages (e.g. C/C++, HTML, Python).
Amongst other things, you can use it to style source code into styled
HTML. It is based on Neil Hodgson's excellent Scintilla project.

I'm pretty far from release (at least another week :-) so I'd really
like a sanity check for the API. Any feedback would be greatly
appreciated.

Windows installers are available for Python 2.0, Python 2.1 and Python
2.2 (I haven't gotten around to a Linux build yet). There is also an
example script that can create HTML output for Python and C/C++ files.
Other than that, you will really have to read the code to figure out the
project but the code is pretty simple.

See:
http://www.sweetapp.com/silvercity

Cheers,
Brian


Neil Hodgson

unread,
Feb 3, 2002, 6:58:05 AM2/3/02
to
Brian Quinlan:

> SilverCity is a Python extension that allows you to retrieve lexical
> information about different languages (e.g. C/C++, HTML, Python).
> Amongst other things, you can use it to style source code into styled
> HTML. It is based on Neil Hodgson's excellent Scintilla project.
>
> I'm pretty far from release (at least another week :-) so I'd really
> like a sanity check for the API. Any feedback would be greatly
> appreciated.

Not sure which level you are interested in. The _SilverCity interface
looks straightforward. There could be a script for generating language
modules or outlines of language modules from the constants: generate("CPP",
"SCE_C_*"). BTW, the verbatim lexical class that got the "XXX what is this?"
comment is for C#'s multiline verbatim strings: @"Just like
""Python"" uses
triple quotes for long texts."

Neil

Brian Quinlan

unread,
Feb 3, 2002, 2:24:42 PM2/3/02
to
Neil Hodgson wrote:
> Not sure which level you are interested in.

Whatever level you are willing to provide :-) Really, I am trying to
make sure that my API does not make it difficult to retrieve useful
information.

> The _SilverCity interface
> looks straightforward.

Yes, it's pretty simple. I'll probably write a test suite in the next
few days that will exercise/demonstrate all of its features. The only
feature that is not demonstrated, I believe, is that PropertySets act
like mapping types e.g. propset['tab.timmy.wingy.level'] = 3

I have a Scintilla features request though:
- expose the name of the lexer in the LexerModule class (it'd like to
include the lexer's name in __repr__ and exceptions)

> There could be a script for generating language
> modules or outlines of language modules from the constants:
generate("CPP",
> "SCE_C_*").

Great idea! I don't think that the event handler names can be exactly
what I want (I like to segment identifiers by name i.e. SCE_C_COMMENTDOC
=> handle_c_comment_doc) but I think that saving me all the typing is
well worth it!

What did you think about the higher-level API? i.e. lexing to events,
the HTML generators, etc?

> BTW, the verbatim lexical class that got the "XXX what is
> this?" comment is for C#'s multiline verbatim strings:
> @"Just like ""Python"" uses triple quotes for long texts."

Cool, thanks.

Thanks a lot for the feedback, Neil!

Cheers,
Brian


Neil Hodgson

unread,
Feb 3, 2002, 9:09:13 PM2/3/02
to
Brian Quinlan:

> I have a Scintilla features request though:
> - expose the name of the lexer in the LexerModule class (it'd like to
> include the lexer's name in __repr__ and exceptions)

Assuming you just mean moving it from private to public, OK, I'll change
that after 1.44 is released.

> What did you think about the higher-level API? i.e. lexing to events,
> the HTML generators, etc?

Not my preferred way of working. I generally prefer writing navigational
code rather than visitors or event handlers. Other people really like these
styles of interface and they are certainly popular for XML.

Neil


Brian Quinlan

unread,
Feb 4, 2002, 11:48:42 AM2/4/02
to
Neil Hodgson wrote:
> Assuming you just mean moving it from private to public, OK, I'll
> change that after 1.44 is released.

Thanks.



> Not my preferred way of working. I generally prefer writing
> navigational code rather than visitors or event handlers.
> Other people really like these styles of interface and they
> are certainly popular for XML.

Fair enough.

Thanks again!

Cheers,
Brian


0 new messages