internal Statement(IHost host) : base(host) { Attributes = new AttributeList(host); Children = new StatementList(host); Parameters = new ParameterList(host); }
private Statement() { Attributes = new AttributeList(); Children = new StatementList(); Parameters = new ParameterList(); IdentifierParts = new List<Identifier>(); Errors = new List<ParserError>(); }
private Statement() { Attributes = new AttributeList(); Children = new StatementList(); Parameters = new ParameterList(); IdentifierParts = new List <Identifier>(); Errors = new List <ParserError>(); }
private void AddAttributes(AttributeList attributes) { if (attributes == null) { return; } int length = attributes.Count; for (int i = 0; i < length; i++) { Attributes.Add(attributes[i]); } }
private void AddAttributes(AttributeList attributes) { if (attributes == null) return; int length = attributes.Count; for (int i = 0; i < length; i++) { Attributes.Add(attributes[i]); } }
private AttributeList ParseAttributes(Stream stream) { var attributes = new AttributeList(); var open = stream.Next(); Token token = null; //expecting identifier while (stream.Peek() != null) { token = stream.Peek(); switch (token.Type) { case TokenType.Identifier: attributes.Add(ParseAttribute(stream)); break; case TokenType.CloseBracket: //consume close bracket stream.NextNoReturn(); goto doneWithAttribute; default: //invalid token Errors.Add(new AttributeIdentifierMissing { Index = token.Index }); //throw new ParserException(token); return attributes; } } doneWithAttribute: if (attributes.Count == 0) { //must be empty attribute list Errors.Add(new AttributeListEmpty { Index = token.Index }); return attributes; //throw new ParserException(token); } //do reduction here return attributes; }
public AttributeList(IHost host, AttributeList list, params Attribute[] nodes) : base(host) { List.AddRange(list); List.AddRange(nodes); }