Web-based RGL Browser

6 views
Skip to first unread message

John J. Camilleri

unread,
May 11, 2012, 8:07:31 AM5/11/12
to gf-...@googlegroups.com
Hello all
I wrote a quick and dirty web-based tool for quickly browsing the GF Resource Grammar Libraries. You can find it here: http://www.grammaticalframework.org/lib/doc/browse/
It allows you to browse the scope of any module in the RGL (coutesy of GF's "--tags" option), and follow links to source files to view them directly on the page. I found myself doing this sort of thing a lot, writing grep commands and opening source files in my browser, so I finally wrote this little tool which makes these tasks a bit easier.
I haven't tested it on any browsers other than Chrome, and admittedly it does crash sometimes when handling large files.
But anyway I share it with you all in the hopes you may find it useful too. Feedback is of course welcome!

John

Aarne Ranta

unread,
May 14, 2012, 3:00:04 AM5/14/12
to gf-...@googlegroups.com
Hello John,

This is a good initiative! And already useful as it is. It works on a Mac under Chrome as well. A couple of questions:

- It shows functions from open'ed modules on a par with the inherited ones and even the module's own constants. Is this intentional?
- The API modules are shown under "api" (src/api/) but not under "English" (src/english/) etc - this is of course what the directory structure gives, but takes some time to figure out - probably even more for a non-resource grammar author.
- Would it be difficult to make it jump to the definitions of each constant?

With best regards

  Aarne.

John J. Camilleri

unread,
May 14, 2012, 3:36:07 AM5/14/12
to gf-...@googlegroups.com
Hello Aarne,
Replies are below.

On 14 May 2012 09:00, Aarne Ranta <aa...@chalmers.se> wrote:
Hello John,

This is a good initiative! And already useful as it is. It works on a Mac under Chrome as well.

Good to know!
 
A couple of questions:

- It shows functions from open'ed modules on a par with the inherited ones and even the module's own constants. Is this intentional?

Yes, it is intentional - or more accurately known. I am directly using the output generated by running GF with the --tags flag. This returns the scope of a module in a flat structure, and as you say opened/imported functions are treated equally. Functions defined in the same module are distinguishable by looking at the source file (the last column in the list), which will be equal to current module. But of course this could be made more visually obvious.
 
- The API modules are shown under "api" (src/api/) but not under "English" (src/english/) etc - this is of course what the directory structure gives, but takes some time to figure out - probably even more for a non-resource grammar author.

This is true, but to be honest I was worried that abstracting over the true directory structure might still confuse things anyway.
There are a number of folders which shouldn't really be treated as languages: common, abstract, prelude, scandinavian, romance, etc. These could arguably be hidden and be made to appear only under each language, but I'm not convinced this is the best way forward.
As an alternative, I would rather leave things as they are and then offer a proper explanation of the directory structure. The tool could surely use from a brief user guide anyway.
 
- Would it be difficult to make it jump to the definitions of each constant?

No this shouldn't be too difficult, in fact given that we have the line numbers and even the function name it should be relatively easy. Will try to add this soon.

Erel Segal Halevi

unread,
May 31, 2012, 9:10:56 AM5/31/12
to gf-...@googlegroups.com
Great! I think it should be linked from the main page.
Reply all
Reply to author
Forward
0 new messages