Пример #1
0
        internal override HxlLangElement ConvertToElement()
        {
            // TODO Default var names
            HxlForElement e = (HxlForElement)this.OwnerDocument.CreateElement("c:for");

            e.Var = this.Var;
            e.To  = Expression.Parse(this.Value);
            return(e);
        }
Пример #2
0
        public IEnumerable <string> Start(HxlForElement e)
        {
            yield return(EmitVarLoopStatus(e));

            // TODO Expression.ToString() not currently correct, and implicit conversion is probably required on text
            yield return(string.Format("for (var {0} = {1}; {0} <= {2}; {0} += {3}) {{",
                                       e.Var,
                                       e.From.ToString().Trim('\''),
                                       e.To.ToString().Trim('\''),
                                       e.Step.ToString().Trim('\'')));

            yield return(EmitVarLoopStatusCurrent(e));
        }
Пример #3
0
 void IHxlLanguageVisitor.Visit(HxlForElement element)
 {
     VisitFor(element);
 }
Пример #4
0
 protected virtual void VisitFor(HxlForElement element)
 {
     DefaultVisit(element);
 }
Пример #5
0
        public IEnumerable <string> End(HxlForElement e)
        {
            yield return(EmitVarLoopStatusIncrement(e));

            yield return("}");
        }