示例#1
0
        public void deployCode(codeSourceElement el, syntaxDeclaration syntax)
        {
            codeSourceElementCollection subElements = new codeSourceElementCollection(el, syntax);
            syntaxBlockDeclaration      sb;

            foreach (codeSourceElement subEl in subElements.codeElements)
            {
                if (subEl.lineClass != null)
                {
                    switch (subEl.lineClass.lineType)
                    {
                    case syntaxBlockLineType.normal:
                        codeLine cl = children.getElement <codeLine>(subEl.name);
                        if (cl == null)
                        {
                            syntaxBlockLineDeclaration cld = declaration.lines.Find(x => x.name == subEl.name);
                            cl = new codeLine(subEl.name, cld);
                            children.Add(cl);
                        }
                        cl.deployDeclaration(syntax);
                        cl.deployCode(subEl);
                        break;

                    case syntaxBlockLineType.block:

                        sb = syntax.blocks.find(subEl.name);

                        codeBlock cb = children.getElement <codeBlock>(subEl.name);

                        if (cb == null)
                        {
                            cb = new codeBlock(subEl.name, sb);
                            children.Add(cb);
                        }
                        // cb.deployDeclaration(syntax);
                        cb.deployCode(subEl, syntax);
                        ////// ovde poziva obradu koda

                        break;

                    case syntaxBlockLineType.emptyLine:
                        break;

                    default:
                        break;
                    }
                }
            }
        }
示例#2
0
        //public Object[] getValues()
        //{
        //    List<Object> output = new List<object>();

        //    foreach (codeLineToken tk in children.items)
        //    {
        //        tk.
        //    }

        //    return output.ToArray();
        //}

        public void deployCode(codeSourceElement subEl)
        {
            Int32 i = 0;

            foreach (String tkn in subEl.tokens)
            {
                codeLineToken ctk = children.getElement <codeLineToken>(i);
                if (ctk != null)
                {
                    ctk.setValue(tkn);
                    //ctk.
                }
                i++;
            }
        }