1
0
forked from GitHub/gf-core

minibar: abstract syntax trees are now shown with or without category names

Function names are always shown.
This commit is contained in:
hallgren
2013-04-02 11:56:10 +00:00
parent e56bfe8811
commit 4e40fd5697
2 changed files with 15 additions and 15 deletions

View File

@@ -228,14 +228,14 @@ Some implementation details:
trees without function names. Click again to add function names.
<li>[Added 2013-03-27] Click on a linearization to obtain a table with all
variants and forms. Click again to hide the table.
<li>[Added 2013-03-28] Abstract syntax tree visualizations: click once to
show abstract syntax trees without function names. Click again to add
function names.
<li>[Added 2013-04-02] Abstract syntax tree visualizations: click once to
show abstract syntax trees without category names. Click again to add
category names.
</ul>
<hr>
<div class=modtime><small>
<!-- hhmts start -->Last modified: Thu Mar 28 16:56:32 CET 2013 <!-- hhmts end -->
<!-- hhmts start -->Last modified: Tue Apr 2 13:55:59 CEST 2013 <!-- hhmts end -->
</small></div>
<address>
<a href="http://www.cse.chalmers.se/~hallgren/">TH</a>

View File

@@ -213,22 +213,22 @@ Translations.prototype.show_groupedtranslations=function(translationsResult) {
}
function tree_button(img_url) {
var imgs=[tree_icon,img_url+"&nofun=true",img_url]
var current=0;
function cycle() {
current++;
if(current>=imgs.length) current=0;
i.src=imgs[current]
}
var i=button_img(tree_icon,cycle);
return i
function tree_button(img_url,opt) {
var imgs=[tree_icon,img_url+(opt||"&nofun=true"),img_url]
var current=0;
function cycle() {
current++;
if(current>=imgs.length) current=0;
i.src=imgs[current]
}
var i=button_img(tree_icon,cycle);
return i
}
Translations.prototype.abstree_button=function(abs) {
var f=this.options.tree_img_format;
var img=this.server.current_grammar_url+"?command=abstrtree&format="+f+"&tree="+encodeURIComponent(abs)
var btn=tree_button(img);
var btn=tree_button(img,"&nocat=true");
btn.title="Click to display abstract syntax tree"
return btn
}