/// <summary> /// parses the macro. We need to do this here, at init time, or else /// the local-scope template feature is hard to get to work :) /// </summary> private void parseTree(String[] callArgs) { try { //UPGRADE_ISSUE: The equivalent of constructor 'java.io.BufferedReader.BufferedReader' is incompatible with the expected type in C#. 'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="jlca1109"' TextReader br = new StringReader(macroBody); /* * now parse the macro - and don't dump the namespace */ nodeTree = rsvc.parse(br, namespace_Renamed, false); /* * now, to make null references render as proper schmoo * we need to tweak the tree and change the literal of * the appropriate references * * we only do this at init time, so it's the overhead * is irrelevant */ Hashtable hm = new Hashtable(); for (int i = 1; i < argArray.Length; i++) { String arg = callArgs[i - 1]; /* * if the calling arg is indeed a reference * then we add to the map. We ignore other * stuff */ if (arg[0] == '$') { hm[argArray[i]] = arg; } } /* * now make one of our reference-munging visitor, and * let 'er rip */ VMReferenceMungeVisitor v = new VMReferenceMungeVisitor(hm); nodeTree.jjtAccept(v, null); } catch (Exception e) { rsvc.error("VelocimacroManager.parseTree() : exception " + macroName + " : " + StringUtils.stackTrace(e)); } }
/// <summary> /// parses the macro. We need to do this here, at init time, or else /// the local-scope template feature is hard to get to work :) /// </summary> private void parseTree(String[] callArgs) { try { TextReader br = new StringReader(macroBody); // now parse the macro - and don't dump the namespace nodeTree = runtimeServices.Parse(br, ns, false); // now, to make null references render as proper schmoo // we need to tweak the tree and change the literal of // the appropriate references // we only do this at init time, so it's the overhead // is irrelevant Hashtable hm = new Hashtable(); for (int i = 1; i < argArray.Length; i++) { String arg = callArgs[i - 1]; // if the calling arg is indeed a reference // then we add to the map. We ignore other // stuff if (arg[0] == '$') { hm[argArray[i]] = arg; } } // now make one of our reference-munging visitor, and // let 'er rip VMReferenceMungeVisitor v = new VMReferenceMungeVisitor(hm); nodeTree.Accept(v, null); } catch (Exception e) { runtimeServices.Error(string.Format("VelocimacroManager.parseTree() : exception {0} : {1}", macroName, e)); } }
private void parseTree(string[] callArgs) { try { TextReader reader = new StringReader(this.macroBody); this.nodeTree = this.rsvc.Parse(reader, this.ns, false); Hashtable hashtable = new Hashtable(); for (int i = 1; i < this.argArray.Length; i++) { string text = callArgs[i - 1]; if (text[0] == '$') { hashtable[this.argArray[i]] = text; } } VMReferenceMungeVisitor visitor = new VMReferenceMungeVisitor(hashtable); this.nodeTree.Accept(visitor, null); } catch (System.Exception e) { this.rsvc.Error("VelocimacroManager.parseTree() : exception " + this.macroName + " : " + StringUtils.StackTrace(e)); } }
/// <summary> /// parses the macro. We need to do this here, at init time, or else /// the local-scope template feature is hard to get to work :) /// </summary> private void parseTree(String[] callArgs) { try { TextReader br = new StringReader(macroBody); // now parse the macro - and don't dump the namespace nodeTree = rsvc.Parse(br, ns, false); // now, to make null references render as proper schmoo // we need to tweak the tree and change the literal of // the appropriate references // we only do this at init time, so it's the overhead // is irrelevant Hashtable hm = new Hashtable(); for(int i = 1; i < argArray.Length; i++) { String arg = callArgs[i - 1]; // if the calling arg is indeed a reference // then we add to the map. We ignore other // stuff if (arg[0] == '$') { hm[argArray[i]] = arg; } } // now make one of our reference-munging visitor, and // let 'er rip VMReferenceMungeVisitor v = new VMReferenceMungeVisitor(hm); nodeTree.Accept(v, null); } catch(Exception e) { rsvc.Error("VelocimacroManager.parseTree() : exception " + macroName + " : " + e); } }