Ejemplo n.º 1
0
 internal Statement(IHost host)
     : base(host)
 {
     Attributes = new AttributeList(host);
     Children = new StatementList(host);
     Parameters = new ParameterList(host);
 }
Ejemplo n.º 2
0
 private Statement()
 {
     Attributes = new AttributeList();
     Children = new StatementList();
     Parameters = new ParameterList();
     IdentifierParts = new List<Identifier>();
     Errors = new List<ParserError>();
 }
Ejemplo n.º 3
0
 private Statement()
 {
     Attributes      = new AttributeList();
     Children        = new StatementList();
     Parameters      = new ParameterList();
     IdentifierParts = new List <Identifier>();
     Errors          = new List <ParserError>();
 }
Ejemplo n.º 4
0
        private void AddAttributes(AttributeList attributes)
        {
            if (attributes == null)
            {
                return;
            }

            int length = attributes.Count;

            for (int i = 0; i < length; i++)
            {
                Attributes.Add(attributes[i]);
            }
        }
Ejemplo n.º 5
0
        private void AddAttributes(AttributeList attributes)
        {
            if (attributes == null) return;

            int length = attributes.Count;
            for (int i = 0; i < length; i++)
            {
                Attributes.Add(attributes[i]);
            }
        }
Ejemplo n.º 6
0
        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;
        }
Ejemplo n.º 7
0
 public AttributeList(IHost host, AttributeList list, params Attribute[] nodes) : base(host)
 {
     List.AddRange(list);
     List.AddRange(nodes);
 }