private Vec children = new Vec(); ///< during XML parsing, this holds the list of currently-parsed children; null otherwise
private JS script = null; ///< the script on this node
Template prev;
private Vec children = new Vec(); ///< during XML parsing, this holds the list of currently-parsed children; null otherwise
private JS script = null; ///< the script on this node
Template prev;
private void apply(Box b, PerInstantiationScope parentPis) throws JSExn, IOException {
if (prev != null) prev.apply(b, null);
private void apply(Box b, PerInstantiationScope parentPis) throws JSExn, IOException {
if (prev != null) prev.apply(b, null);
// FIXME this dollar stuff is all wrong
if (id != null) parentPis.putDollar(id, b);
// FIXME this dollar stuff is all wrong
if (id != null) parentPis.putDollar(id, b);
- PerInstantiationScope pis = new PerInstantiationScope(b, ibex, parentPis, staticScope);
+ PerInstantiationScope pis = new PerInstantiationScope(b, ibex, parentPis, staticObject);
parse(new InputStreamReader(is));
JS staticScript = parseScript(static_content, static_content_start);
parse(new InputStreamReader(is));
JS staticScript = parseScript(static_content, static_content_start);
- t.staticScope = new PerInstantiationScope(null, ibex, null, null);
+ t.staticObject = new JS();
+ t.staticScope = new PerInstantiationScope(null, ibex, null, t.staticObject);
if (staticScript != null) JS.cloneWithNewParentScope(staticScript, t.staticScope).call(null, null, null, null, 0);
}
if (staticScript != null) JS.cloneWithNewParentScope(staticScript, t.staticScope).call(null, null, null, null, 0);
}
if (c.getAttrLen() != 0)
throw new XML.Exn("root element must not have attributes", XML.Exn.SCHEMA, getLine(), getCol());
if (c.getUri("ui") == null || "".equals(c.getUri("ui"))) c.addUri("ui", "ibex://ui");
if (c.getAttrLen() != 0)
throw new XML.Exn("root element must not have attributes", XML.Exn.SCHEMA, getLine(), getCol());
if (c.getUri("ui") == null || "".equals(c.getUri("ui"))) c.addUri("ui", "ibex://ui");
if (c.getUri("") == null || "".equals(c.getUri(""))) c.addUri("", initial_uri);
state = STATE_IN_ROOT_NODE;
return;
if (c.getUri("") == null || "".equals(c.getUri(""))) c.addUri("", initial_uri);
state = STATE_IN_ROOT_NODE;
return;
- t.prev = (Template)t.ibex.resolveString(tagname, false).call(null, null, null, null, 9999);
+ // GROSSER hack
+ t.prev2 = (Template)t.ibex.resolveString(tagname, false).call(null, null, null, null, 9999);
} catch (Exception e) {
Log.error(Template.class, e);
}
}
Hash urimap = c.getUriMap();
} catch (Exception e) {
Log.error(Template.class, e);
}
}
Hash urimap = c.getUriMap();
- t.urikeys = new String[urimap.size() - (urimap.get("ui") == null ? 0 : 1)];
- t.urivals = new String[urimap.size() - (urimap.get("ui") == null ? 0 : 1)];
+ t.urikeys = new String[urimap.size()];
+ t.urivals = new String[urimap.size()];
Enumeration uriEnumeration = urimap.keys();
int ii = 0;
while(uriEnumeration.hasMoreElements()) {
String key = (String)uriEnumeration.nextElement();
Enumeration uriEnumeration = urimap.keys();
int ii = 0;
while(uriEnumeration.hasMoreElements()) {
String key = (String)uriEnumeration.nextElement();
// process attributes into Vecs, dealing with any XML Namespaces in the process
ATTR: for (int i=0; i < c.getAttrLen(); i++) {
// process attributes into Vecs, dealing with any XML Namespaces in the process
ATTR: for (int i=0; i < c.getAttrLen(); i++) {
// treat value starting with '.' as resource reference
String uri = c.getAttrUri(i); if (!uri.equals("")) uri = '.' + uri;
// treat value starting with '.' as resource reference
String uri = c.getAttrUri(i); if (!uri.equals("")) uri = '.' + uri;
nodeStack.setSize(nodeStack.size() - 1);
t.children.addElement(oldt);
int oldt_lines = getLine() - oldt.startLine;
nodeStack.setSize(nodeStack.size() - 1);
t.children.addElement(oldt);
int oldt_lines = getLine() - oldt.startLine;
private static class PerInstantiationScope extends JSScope {
Ibex ibex = null;
PerInstantiationScope parentBoxPis = null;
private static class PerInstantiationScope extends JSScope {
Ibex ibex = null;
PerInstantiationScope parentBoxPis = null;
void putDollar(String key, Box target) throws JSExn {
if (parentBoxPis != null) parentBoxPis.putDollar(key, target);
declare("$" + key);
put("$" + key, target);
}
void putDollar(String key, Box target) throws JSExn {
if (parentBoxPis != null) parentBoxPis.putDollar(key, target);
declare("$" + key);
put("$" + key, target);
}
- public PerInstantiationScope(JSScope parentScope, Ibex ibex, PerInstantiationScope parentBoxPis, JSScope myStatic) {
+ public PerInstantiationScope(JSScope parentScope, Ibex ibex, PerInstantiationScope parentBoxPis, JS myStatic) {