Esempio n. 1
0
 public WhileNode(GenKeeper keeper, ITerminalNode terminal, IExprNode condition, IExprNode prog, IExprNode elseProg)
     : base(keeper, terminal)
 {
     _condition = condition;
     _prog      = prog;
     _elseProg  = elseProg;
 }
Esempio n. 2
0
 public FieldNode(GenKeeper keeper, ITerminalNode terminal)
     : base(keeper, terminal)
 {
     if (terminal != null)
     {
         _field = terminal.Symbol.Text;
     }
 }
Esempio n. 3
0
        public VarSetNode(GenKeeper keeper, ITerminalNode terminal, IExprNode nodeMean)
            : base(keeper, terminal)
        {
            var name = terminal.Symbol.Text;

            _var      = keeper.Vars.Add(name, new Var(name));
            _nodeMean = nodeMean;
        }
Esempio n. 4
0
 public NodeRTabl(GenKeeper keeper, ITerminalNode terminal, IExprNode condition)
     : base(keeper, terminal)
 {
     if (terminal != null)
     {
         _tablName = terminal.Symbol.Text;
     }
     _condition = condition;
 }
Esempio n. 5
0
        public VarNode(GenKeeper keeper, ITerminalNode terminal)
            : base(keeper, terminal)
        {
            var name = terminal.Symbol.Text;

            if (!keeper.Vars.ContainsKey(name))
            {
                AddError("Использование неприсвоеной переменной");
            }
            else
            {
                _var = keeper.Vars[name];
            }
        }
Esempio n. 6
0
        public GenBaseRow(ModuleGenerator generator, //Ссылка на генератор
                          GenTemplateTable table,    //Описание полей таблицы-шаблона
                          DaoRec rec)                //Рекордсет таблицы шаблона генерации
        {
            Table  = table;
            Keeper = new GenKeeper(generator);

            RuleString = rec.GetString(Table.RuleField);
            if (!RuleString.IsEmpty())
            {
                var parse = Table.IsSub
                        ? new SubRuleParsing(Keeper, Table.RuleField, RuleString)
                        : new RuleParsing(Keeper, Table.RuleField, RuleString);
                Rule = parse.ResultTree;
            }

            foreach (Field field in rec.Recordset.Fields)
            {
                var name = field.Name;
                if (!Table.IsSpecial(name) && !rec.IsNull(name))
                {
                    var dataType = field.Type.ToDataType();
                    if (dataType != DataType.String)
                    {
                        Fields.Add(name, new GenConstNode(rec.GetMean(dataType, name)));
                    }
                    else
                    {
                        string s = rec.GetString(name);
                        if (!s.Contains("["))
                        {
                            Fields.Add(name, new GenConstNode(null, s));
                        }
                        else
                        {
                            var fparse = new FieldsParsing(Keeper, name, rec.GetString(name));
                            var f      = (IExprNode)fparse.ResultTree;
                            if (f != null)
                            {
                                Fields.Add(name, f);
                            }
                        }
                    }
                }
            }
        }
Esempio n. 7
0
 public NodeIfVoid(GenKeeper keeper, ITerminalNode terminal, List <IExprNode> conditions, List <IVoidNode> variants)
     : base(keeper, terminal)
 {
     _conditions = conditions;
     _variants   = variants;
 }
Esempio n. 8
0
 public FunNode(GenKeeper keeper, ITerminalNode terminal, //Имя функции
                ListNode argsList)                        //Узел с аргументами
     : base(keeper, terminal)
 {
     _args = argsList.Nodes.Cast <IExprNode>().ToArray();
 }
Esempio n. 9
0
 public NodeWhileVoid(GenKeeper keeper, ITerminalNode terminal, IExprNode condition, IVoidNode prog)
     : base(keeper, terminal)
 {
     _condition = condition;
     _prog      = prog;
 }
Esempio n. 10
0
 public SubRuleParsing(GenKeeper keeper, string fieldName, string fieldValue)
     : base(keeper, fieldName, fieldValue + Environment.NewLine)
 {
 }
Esempio n. 11
0
 public FunNode(GenKeeper keeper, ITerminalNode terminal, //Имя функции
                params IExprNode[] args)                  //Аргументы
     : base(keeper, terminal)
 {
     _args = args;
 }
Esempio n. 12
0
 public SubNodeR(GenKeeper keeper, ITerminalNode terminal, IExprNode condition)
     : base(keeper, terminal)
 {
     Condition = condition;
 }
Esempio n. 13
0
 public FieldsParsing(GenKeeper keeper, string fieldName, string fieldValue)
     : base(keeper, fieldName, fieldValue)
 {
 }
Esempio n. 14
0
 public RuleVisitor(GenKeeper keeper)
 {
     _keeper = keeper;
 }
Esempio n. 15
0
 public GroupNodeR(GenKeeper keeper, ITerminalNode terminal, IEnumerable <INode> fieldsNodes)
     : base(keeper, terminal)
 {
     _fieldsNodes = (fieldsNodes ?? new INode[0]).ToArray();
     _fields      = _fieldsNodes.Select(node => node.Token.Text).ToArray();
 }
Esempio n. 16
0
 public FieldsVisitor(GenKeeper keeper)
 {
     _keeper = keeper;
 }
Esempio n. 17
0
 protected KeeperNode(GenKeeper keeper, ITerminalNode terminal)
     : base(terminal)
 {
     Keeper = keeper;
 }
Esempio n. 18
0
 public SubNode(GenKeeper keeper, ITerminalNode terminal,
                IEnumerable <IExprNode> pars)          //Параметры, смысл каждого параметра определяется при проверке
     : base(keeper, terminal)
 {
     _pars = pars.ToArray();
 }
Esempio n. 19
0
 public OverNode(GenKeeper keeper, ITerminalNode terminal, IExprNode expr)
     : base(keeper, terminal)
 {
     _expr = expr;
 }
Esempio n. 20
0
 public OverVoidNode(GenKeeper keeper, ITerminalNode terminal, IVoidNode prog)
     : base(keeper, terminal)
 {
     _prog = prog;
 }