public void Reset(string name, string value, char quote) { this.Name = name; this.literalValue = value; this.QuoteChar = quote; this.DtdType = null; }
public void Reset(string name, string value, char quote) { this.Name = name; this.literalValue = value; this.QuoteChar = quote; this.DtdType = null; }
AttDef ParseAttDef(char ch) { ch = this.current.SkipWhitespace(); string name = ScanName(SgmlDtd.WhiteSpace); name = name.ToUpper(); name = this.nameTable.Add(name); AttDef attdef = new AttDef(name); ch = this.current.SkipWhitespace(); if (ch == '-') { ch = ParseDeclComments(); } ParseAttType(ch, attdef); ch = this.current.SkipWhitespace(); if (ch == '-') { ch = ParseDeclComments(); } ParseAttDefault(ch, attdef); ch = this.current.SkipWhitespace(); if (ch == '-') { ch = ParseDeclComments(); } return(attdef); }
void ParseAttList(AttList list, char term) { char ch = this.current.SkipWhitespace(); while (ch != term) { if (ch == '%') { Entity e = ParseParameterEntity(SgmlDtd.peterm); PushEntity(this.current.ResolvedUri, e); ParseAttList(list, Entity.EOF); PopEntity(); ch = this.current.SkipWhitespace(); } else if (ch == '-') { ch = ParseDeclComments(); } else { AttDef a = ParseAttDef(ch); list.Add(a); } ch = this.current.SkipWhitespace(); } }
void ParseAttDefault(char ch, AttDef attdef) { if (ch == '%') { Entity e = ParseParameterEntity(SgmlDtd.WhiteSpace); PushEntity(this.current.ResolvedUri, e); ParseAttDefault(this.current.Lastchar, attdef); PopEntity(); ch = this.current.Lastchar; return; } bool hasdef = true; if (ch == '#') { this.current.ReadChar(); string token = this.current.ScanToken(this.sb, SgmlDtd.WhiteSpace, true); hasdef = attdef.SetPresence(token); ch = this.current.SkipWhitespace(); } if (hasdef) { if (ch == '\'' || ch == '"') { string lit = this.current.ScanLiteral(this.sb, ch); attdef.Default = lit; ch = this.current.SkipWhitespace(); } else { string name = this.current.ScanToken(this.sb, SgmlDtd.WhiteSpace, false); name = name.ToUpper(); name = this.nameTable.Add(name); attdef.Default = name; ch = this.current.SkipWhitespace(); } } }
void ParseAttType(char ch, AttDef attdef) { if (ch == '%') { Entity e = ParseParameterEntity(SgmlDtd.WhiteSpace); PushEntity(this.current.ResolvedUri, e); ParseAttType(this.current.Lastchar, attdef); PopEntity(); ch = this.current.Lastchar; return; } if (ch == '(') { attdef.EnumValues = ParseNameGroup(ch, false); attdef.Type = AttributeType.ENUMERATION; } else { string token = ScanName(SgmlDtd.WhiteSpace); if (token == "NOTATION") { ch = this.current.SkipWhitespace(); if (ch != '(') { this.current.Error("Expecting name group '(', but found '{0}'", ch); } attdef.Type = AttributeType.NOTATION; attdef.EnumValues = ParseNameGroup(ch, true); } else { attdef.SetType(token); } } }
public void Add(AttDef a) { AttDefs.Add(a.Name, a); }
public void Add(AttDef a) { AttDefs.Add(a.Name, a); }
void ParseAttType(char ch, AttDef attdef) { if (ch == '%') { Entity e = ParseParameterEntity(SgmlDtd.WhiteSpace); PushEntity(this.current.ResolvedUri, e); ParseAttType(this.current.Lastchar, attdef); PopEntity(); ch = this.current.Lastchar; return; } if (ch == '(') { attdef.EnumValues = ParseNameGroup(ch, false); attdef.Type = AttributeType.ENUMERATION; } else { string token = ScanName(SgmlDtd.WhiteSpace); if (token == "NOTATION") { ch = this.current.SkipWhitespace(); if (ch != '(') { this.current.Error("Expecting name group '(', but found '{0}'", ch); } attdef.Type = AttributeType.NOTATION; attdef.EnumValues = ParseNameGroup(ch, true); } else { attdef.SetType(token); } } }
void ParseAttDefault(char ch, AttDef attdef) { if (ch == '%') { Entity e = ParseParameterEntity(SgmlDtd.WhiteSpace); PushEntity(this.current.ResolvedUri, e); ParseAttDefault(this.current.Lastchar, attdef); PopEntity(); ch = this.current.Lastchar; return; } bool hasdef = true; if (ch == '#') { this.current.ReadChar(); string token = this.current.ScanToken(this.sb, SgmlDtd.WhiteSpace, true); hasdef = attdef.SetPresence(token); ch = this.current.SkipWhitespace(); } if (hasdef) { if (ch == '\'' || ch == '"') { string lit = this.current.ScanLiteral(this.sb, ch); attdef.Default = lit; ch = this.current.SkipWhitespace(); } else { string name = this.current.ScanToken(this.sb, SgmlDtd.WhiteSpace, false); name = name.ToUpper(); name = this.nameTable.Add(name); attdef.Default = name; ch = this.current.SkipWhitespace(); } } }
AttDef ParseAttDef(char ch) { ch = this.current.SkipWhitespace(); string name = ScanName(SgmlDtd.WhiteSpace); name = name.ToUpper(); name = this.nameTable.Add(name); AttDef attdef = new AttDef(name); ch = this.current.SkipWhitespace(); if (ch == '-') ch = ParseDeclComments(); ParseAttType(ch, attdef); ch = this.current.SkipWhitespace(); if (ch == '-') ch = ParseDeclComments(); ParseAttDefault(ch, attdef); ch = this.current.SkipWhitespace(); if (ch == '-') ch = ParseDeclComments(); return attdef; }