My Profile
Active Members
TodayLast 7 Days
more...
Awards & Gifts
Online Exams
Fresher Jobs
Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian
cities including Bangalore, Chennai, Hyderabad, Pune or Kochi
Resources
Find educational articles, blogs, discussion threads and other resources.
Colleges
Find details about any college in India or search for courses.
|
Formula Editor. Interfaces
Posted Date:
Total Responses: 0
Posted By: Mahesh Member Level: Platinum Points/Cash: 5
|
using System; using System.Collections.Generic; using System.Linq; using System.Text;
using FormulaEditor.Interfaces;
namespace FormulaEditor.CodeCreators { public static class StaticCodeCreator { public static void Add(StringBuilder stringBuilder, IList list) { foreach (string str in list) { stringBuilder.Append(str + "\r\n"); } }
public static int GetNumber(ICodeCreator creator, ObjectFormulaTree tree) { ObjectFormulaTree[] trees = creator.Trees; for (int i = 0; i < trees.Length; i++) { if (trees[i] == tree) { return i; } } throw new Exception("Tree not found"); }
public static IList CreateCode(ObjectFormulaTree[] trees, ICodeCreator creator, out ICodeCreator local, out IList variables, out IList initializers) { List code = new List(); List vari = new List(); List init = new List(); //IList lt = ObjectFormulaTree.CreateList(trees); local = creator.Create(trees); IList lt = local.Trees; foreach (ObjectFormulaTree t in lt) { string ret = local[t]; IList par = new List(); int n = t.Count; for (int i = 0; i < n; i++) { ObjectFormulaTree child = t[i]; if (child == null) { continue; } par.Add(local[child]); } IList lv; IList lp; IList c = local.CreateCode(t, ret, par.ToArray(), out lv, out lp); if (lv != null) { vari.AddRange(lv); } if (lp != null) { init.AddRange(lp); } if (creator.GetConstValue(t) == null) { code.AddRange(c); } } variables = vari; initializers = init; return code; } } }
|
Project Feedbacks
|
No feedbacks found. Be the first to respond and make money from revenue sharing program.
|
|
|
| Post Feedback |
|
|
You must Sign In to post a feedback.
|
|
|
|
|
Advertise Here
|