예제 #1
0
        public Function(string name, Tree.Embedding embedding, IEnumerable <Cdn.FunctionArgument> customArguments, bool canBeOverridden) : this(name, embedding.Expression, embedding.Arguments)
        {
            d_embedding       = embedding;
            d_canBeOverridden = canBeOverridden;

            if (customArguments != null)
            {
                d_customArguments = new List <Cdn.FunctionArgument>(customArguments);
            }
        }
예제 #2
0
        public Loop(Program program, DataTable indextable, Tree.Embedding embedding, Function function)
        {
            d_function   = function;
            d_embedding  = embedding;
            d_items      = new List <Item>();
            d_indextable = indextable;
            d_program    = program;

            // Create expression
            d_expression             = (Tree.Node)d_embedding.Expression.Clone();
            d_expression.Instruction = new Instructions.Function(d_function);

            // Generate mapping
            d_mapping = new Dictionary <Tree.NodePath, object>();
        }
예제 #3
0
 public Function(string name, Tree.Embedding embedding) : this(name, embedding, null, false)
 {
     d_embedding = embedding;
 }
예제 #4
0
파일: Embedding.cs 프로젝트: codyn-net/rawc
 public Instance(Tree.Embedding prototype, IEnumerable <ulong> embeddedIds, Instruction originalInstruction)
 {
     d_prototype           = prototype;
     d_embeddedIds         = new List <ulong>(embeddedIds);
     d_originalInstruction = originalInstruction;
 }
예제 #5
0
 private int CompareEmbeddings(Tree.Embedding a, Tree.Embedding b)
 {
     return(Score(a).CompareTo(Score(b)));
 }
예제 #6
0
 private int Score(Tree.Embedding embedding)
 {
     return(-1 * embedding.InstancesCount * embedding.Expression.Descendants.Length);
 }