Example #1
0
 void XmlNestedContent(out XmlExpression expr)
 {
     XmlExpression tmpExpr = null; Location start = la.Location;
     switch (la.kind) {
     case 16: {
     Get();
     tmpExpr = new XmlContentExpression(t.val, XmlContentType.Text);
     break;
     }
     case 18: {
     Get();
     tmpExpr = new XmlContentExpression(t.val, XmlContentType.CData);
     break;
     }
     case 17: {
     Get();
     tmpExpr = new XmlContentExpression(t.val, XmlContentType.Comment);
     break;
     }
     case 19: {
     Get();
     tmpExpr = new XmlContentExpression(t.val, XmlContentType.ProcessingInstruction);
     break;
     }
     case 12: {
     Get();
     Expression innerExpression;
     Expr(out innerExpression);
     Expect(13);
     tmpExpr = new XmlEmbeddedExpression() { InlineVBExpression = innerExpression };
     break;
     }
     case 10: {
     XmlElement(out tmpExpr);
     break;
     }
     default: SynErr(289); break;
     }
     if (tmpExpr.StartLocation.IsEmpty)
         tmpExpr.StartLocation = start;
     if (tmpExpr.EndLocation.IsEmpty)
         tmpExpr.EndLocation = t.EndLocation;
     expr = tmpExpr;
 }
Example #2
0
 void XmlElement(out XmlExpression expr)
 {
     XmlElementExpression el = new XmlElementExpression();
     Expect(10);
     el.StartLocation = t.Location;
     if (la.kind == 12) {
     Get();
     Expression innerExpression;
     Expr(out innerExpression);
     Expect(13);
     el.NameExpression = new XmlEmbeddedExpression() { InlineVBExpression = innerExpression };
     } else if (StartOf(5)) {
     Identifier();
     el.XmlName = t.val;
     } else SynErr(287);
     while (StartOf(37)) {
     XmlAttribute(el.Attributes);
     }
     if (la.kind == 14) {
     Get();
     el.EndLocation = t.EndLocation;
     } else if (la.kind == 11) {
     Get();
     while (StartOf(38)) {
         XmlExpression child;
         XmlNestedContent(out child);
         el.Children.Add(child);
     }
     Expect(15);
     while (StartOf(39)) {
         Get();
     }
     Expect(11);
     el.EndLocation = t.EndLocation;
     } else SynErr(288);
     expr = el;
 }