Exemplo n.º 1
0
 public ValueGetter(string valueName, HashedVariables targetSource)
 {
     Name         = valueName;
     TargetSource = targetSource;
     ParamsCount  = 0;
     Inner        = null;
 }
Exemplo n.º 2
0
        public HashedVariables Merge(HashedVariables another)
        {
            var merged = new Dictionary <string, IValueHolder>(holders);

            foreach (var holder in another.holders)
            {
                if (merged.ContainsKey(holder.Key))
                {
                    var targetSequence = merged[holder.Key] as Sequence;

                    var seqence = holder.Value as Sequence;
                    int expressionsInSequence = seqence.hashedSequence.Count;

                    while (expressionsInSequence-- > 0)
                    {
                        targetSequence.AddExpression(seqence.hashedSequence.CircularInspect().Value);
                    }
                }
                else
                {
                    merged.Add(holder.Key, holder.Value);
                }
            }

            foreach (var getter in another.getters.Values)
            {
                getter.TargetSource = this;
            }

            holders = merged;

            return(this);
        }
Exemplo n.º 3
0
        public ExpressionTranslator(LexedExpression lexedExpression, HashedVariables variables)
        {
            this.variables       = variables;
            this.lexedExpression = lexedExpression;

            inner  = lexedExpression.LexicalQueue;
            type   = Validator.Elaborate(lexedExpression);
            result = new Expression(inner.First.Value.Represents, lexedExpression.Initial, lexedExpression.TargetSet);

            canCreateInstances = false;
        }
Exemplo n.º 4
0
        public VariableSet Translate()
        {
            translatedSet = new VariableSet(processedData.Name)
            {
                members = localVariables = new HashedVariables()
            };

            Tokenize();

            foreach (var lexed in lexedExpressions)
            {
                TranslateExpression(lexed);
            }

            return(translatedSet);
        }
Exemplo n.º 5
0
 public LastValueGetter(string name, HashedVariables target) : base(name, target)
 {
 }