Beispiel #1
0
        /// <summary>
        /// Parser for Designator
        /// </summary>
        /// <returns>Parsed Designator</returns>
        public Designator ParseDesignator()
        {
            Designator tag = new Designator();

            //Parse identifier of tag
            NextToken("identifier", "identifier");
            tag.SetIdentifier(CurrentToken.GetValue().ToString());

            while (TokenStream.HasNext())
            {   //Parse attributes
                if (TokenStream.Peek(1).GetType() == TokenType.SYMBOL && IsAttribute(TokenStream.Peek(1).GetValue().ToString()))
                {
                    tag.AddAttribute(ParseAttribute());
                }
                else
                {
                    break; //No attributes left, so break
                }
            }

            return(tag);
        }