Beispiel #1
0
 public ValueGetter(string valueName, HashedVariables targetSource)
 {
     Name         = valueName;
     TargetSource = targetSource;
     ParamsCount  = 0;
     Inner        = null;
 }
Beispiel #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);
        }
        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;
        }
Beispiel #4
0
        public VariableSet Translate()
        {
            translatedSet = new VariableSet(processedData.Name)
            {
                members = localVariables = new HashedVariables()
            };

            Tokenize();

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

            return(translatedSet);
        }
Beispiel #5
0
 public LastValueGetter(string name, HashedVariables target) : base(name, target)
 {
 }